Skip to content

Commit

Permalink
Add cdn option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Ludwig committed Sep 13, 2016
1 parent 71e3e9f commit b1246c8
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 14 deletions.
6 changes: 3 additions & 3 deletions dist/galleria.js
Original file line number Diff line number Diff line change
Expand Up @@ -5690,7 +5690,7 @@ Galleria.addTheme = function( theme ) {
}

var css = false,
reg;
reg, reg2;

if ( typeof theme.css === 'string' ) {

Expand Down Expand Up @@ -5724,8 +5724,8 @@ Galleria.addTheme = function( theme ) {
$('script').each(function (i, script) {
// look for the theme script
reg = new RegExp('galleria\\.' + theme.name.toLowerCase() + '\\.');
if (reg.test(script.src)) {

reg2 = new RegExp('galleria\\.io\\/theme\\/' + theme.name.toLowerCase() + '\\/js');
if (reg.test(script.src) || reg2.test(script.src)) {
// we have a match
css = script.src.replace(/[^\/]*$/, '') + theme.css;

Expand Down
6 changes: 3 additions & 3 deletions dist/galleria.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/plugins/flickr/galleria.flickr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/history/galleria.history.min.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Galleria - v1.4.5 2016-09-07
* Galleria - v1.4.5 2016-09-13
* https://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/picasa/galleria.picasa.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions dist/themes/classic/classic-demo-cdn.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Galleria Classic Theme</title>
<style>

/* Demo styles */
html,body{background:#222;margin:0;}
body{border-top:4px solid #000;}
.content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;}
h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;}
p{margin:0 0 20px}
a {color:#22BCB9;text-decoration:none;}
.cred{margin-top:20px;font-size:11px;}

/* This rule is read by Galleria to define the gallery height: */
#galleria{height:320px}

</style>
</head>
<body>
<div class="content">
<h1>Galleria Classic Theme</h1>
<p>Demonstrating a basic gallery example.</p>

<!-- Adding gallery images. We use resized thumbnails here for better performance, but it’s not necessary -->

<div id="galleria">
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Biandintz_eta_zaldiak_-_modified2.jpg/800px-Biandintz_eta_zaldiak_-_modified2.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Biandintz_eta_zaldiak_-_modified2.jpg/100px-Biandintz_eta_zaldiak_-_modified2.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Biandintz_eta_zaldiak_-_modified2.jpg/1280px-Biandintz_eta_zaldiak_-_modified2.jpg"
data-title="Biandintz eta zaldiak"
data-description="Horses on Bianditz mountain, in Navarre, Spain."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Athabasca_Rail_at_Brule_Lake.jpg/800px-Athabasca_Rail_at_Brule_Lake.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Athabasca_Rail_at_Brule_Lake.jpg/100px-Athabasca_Rail_at_Brule_Lake.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Athabasca_Rail_at_Brule_Lake.jpg/1280px-Athabasca_Rail_at_Brule_Lake.jpg"
data-title="Athabasca Rail"
data-description="The Athabasca River railroad track at the mouth of Brulé Lake in Alberta, Canada."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Back-scattering_crepuscular_rays_panorama_1.jpg/1280px-Back-scattering_crepuscular_rays_panorama_1.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Back-scattering_crepuscular_rays_panorama_1.jpg/100px-Back-scattering_crepuscular_rays_panorama_1.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Back-scattering_crepuscular_rays_panorama_1.jpg/1400px-Back-scattering_crepuscular_rays_panorama_1.jpg"
data-title="Back-scattering crepuscular rays"
data-description="Picture of the day on Wikimedia Commons 26 September 2010."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Interior_convento_3.jpg/800px-Interior_convento_3.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Interior_convento_3.jpg/120px-Interior_convento_3.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Interior_convento_3.jpg/1400px-Interior_convento_3.jpg"
data-title="Interior convento"
data-description="Interior view of Yuriria Convent, founded in 1550."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg/800px-Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg/100px-Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg/1280px-Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg"
data-title="Oxbow Bend outlook"
data-description="View over the Snake River to the Mount Moran with the Skillet Glacier."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Hazy_blue_hour_in_Grand_Canyon.JPG/800px-Hazy_blue_hour_in_Grand_Canyon.JPG">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Hazy_blue_hour_in_Grand_Canyon.JPG/100px-Hazy_blue_hour_in_Grand_Canyon.JPG",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Hazy_blue_hour_in_Grand_Canyon.JPG/1280px-Hazy_blue_hour_in_Grand_Canyon.JPG"
data-title="Hazy blue hour"
data-description="Hazy blue hour in Grand Canyon. View from the South Rim."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/2909_vallon_moy_res.jpg/800px-2909_vallon_moy_res.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/2909_vallon_moy_res.jpg/100px-2909_vallon_moy_res.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/2909_vallon_moy_res.jpg/1280px-2909_vallon_moy_res.jpg"
data-title="Haute Severaisse valley"
data-description="View of Haute Severaisse valley and surrounding summits from the slopes of Les Vernets."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/800px-Bohinjsko_jezero_2.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/100px-Bohinjsko_jezero_2.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/1280px-Bohinjsko_jezero_2.jpg"
data-title="Bohinj lake"
data-description="Bohinj lake (Triglav National Park, Slovenia) in the morning."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Bowling_Balls_Beach_2_edit.jpg/800px-Bowling_Balls_Beach_2_edit.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Bowling_Balls_Beach_2_edit.jpg/100px-Bowling_Balls_Beach_2_edit.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Bowling_Balls_Beach_2_edit.jpg/1280px-Bowling_Balls_Beach_2_edit.jpg"
data-title="Bowling Balls"
data-description="Mendocino county, California, USA."
>
</a>
<a href="https://vimeo.com/25750735">
<span class="video">Works for vimeo too.</span>
</a>
<a href="https://www.youtube.com/watch?v=gAeYCJZ_meY">
<span class="video">Works for youtube too.</span>
</a>

</div>
<p class="cred">Made by <a href="http://galleria.io">Galleria</a>.</p>
</div>

<!-- load jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<!-- load Galleria -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.4.5/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.4.5/themes/classic/galleria.classic.min.js"></script>
<script>
$(function() {
Galleria.run('#galleria');
});
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion dist/themes/classic/classic-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>

<!-- load Galleria -->
<script src="../../galleria.min.js"></script>
<script src="../../galleria.js"></script>

</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion dist/themes/classic/galleria.classic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/galleria.js
Original file line number Diff line number Diff line change
Expand Up @@ -5690,7 +5690,7 @@ Galleria.addTheme = function( theme ) {
}

var css = false,
reg;
reg, reg2;

if ( typeof theme.css === 'string' ) {

Expand Down Expand Up @@ -5724,8 +5724,8 @@ Galleria.addTheme = function( theme ) {
$('script').each(function (i, script) {
// look for the theme script
reg = new RegExp('galleria\\.' + theme.name.toLowerCase() + '\\.');
if (reg.test(script.src)) {

reg2 = new RegExp('galleria\\.io\\/theme\\/' + theme.name.toLowerCase() + '\\/js');
if (reg.test(script.src) || reg2.test(script.src)) {
// we have a match
css = script.src.replace(/[^\/]*$/, '') + theme.css;

Expand Down
124 changes: 124 additions & 0 deletions src/themes/classic/classic-demo-cdn.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Galleria Classic Theme</title>
<style>

/* Demo styles */
html,body{background:#222;margin:0;}
body{border-top:4px solid #000;}
.content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;}
h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;}
p{margin:0 0 20px}
a {color:#22BCB9;text-decoration:none;}
.cred{margin-top:20px;font-size:11px;}

/* This rule is read by Galleria to define the gallery height: */
#galleria{height:320px}

</style>
</head>
<body>
<div class="content">
<h1>Galleria Classic Theme</h1>
<p>Demonstrating a basic gallery example.</p>

<!-- Adding gallery images. We use resized thumbnails here for better performance, but it’s not necessary -->

<div id="galleria">
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Biandintz_eta_zaldiak_-_modified2.jpg/800px-Biandintz_eta_zaldiak_-_modified2.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Biandintz_eta_zaldiak_-_modified2.jpg/100px-Biandintz_eta_zaldiak_-_modified2.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Biandintz_eta_zaldiak_-_modified2.jpg/1280px-Biandintz_eta_zaldiak_-_modified2.jpg"
data-title="Biandintz eta zaldiak"
data-description="Horses on Bianditz mountain, in Navarre, Spain."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Athabasca_Rail_at_Brule_Lake.jpg/800px-Athabasca_Rail_at_Brule_Lake.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Athabasca_Rail_at_Brule_Lake.jpg/100px-Athabasca_Rail_at_Brule_Lake.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Athabasca_Rail_at_Brule_Lake.jpg/1280px-Athabasca_Rail_at_Brule_Lake.jpg"
data-title="Athabasca Rail"
data-description="The Athabasca River railroad track at the mouth of Brulé Lake in Alberta, Canada."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Back-scattering_crepuscular_rays_panorama_1.jpg/1280px-Back-scattering_crepuscular_rays_panorama_1.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Back-scattering_crepuscular_rays_panorama_1.jpg/100px-Back-scattering_crepuscular_rays_panorama_1.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Back-scattering_crepuscular_rays_panorama_1.jpg/1400px-Back-scattering_crepuscular_rays_panorama_1.jpg"
data-title="Back-scattering crepuscular rays"
data-description="Picture of the day on Wikimedia Commons 26 September 2010."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Interior_convento_3.jpg/800px-Interior_convento_3.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Interior_convento_3.jpg/120px-Interior_convento_3.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Interior_convento_3.jpg/1400px-Interior_convento_3.jpg"
data-title="Interior convento"
data-description="Interior view of Yuriria Convent, founded in 1550."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg/800px-Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg/100px-Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg/1280px-Oxbow_Bend_outlook_in_the_Grand_Teton_National_Park.jpg"
data-title="Oxbow Bend outlook"
data-description="View over the Snake River to the Mount Moran with the Skillet Glacier."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Hazy_blue_hour_in_Grand_Canyon.JPG/800px-Hazy_blue_hour_in_Grand_Canyon.JPG">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Hazy_blue_hour_in_Grand_Canyon.JPG/100px-Hazy_blue_hour_in_Grand_Canyon.JPG",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Hazy_blue_hour_in_Grand_Canyon.JPG/1280px-Hazy_blue_hour_in_Grand_Canyon.JPG"
data-title="Hazy blue hour"
data-description="Hazy blue hour in Grand Canyon. View from the South Rim."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/2909_vallon_moy_res.jpg/800px-2909_vallon_moy_res.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/2909_vallon_moy_res.jpg/100px-2909_vallon_moy_res.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/2909_vallon_moy_res.jpg/1280px-2909_vallon_moy_res.jpg"
data-title="Haute Severaisse valley"
data-description="View of Haute Severaisse valley and surrounding summits from the slopes of Les Vernets."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/800px-Bohinjsko_jezero_2.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/100px-Bohinjsko_jezero_2.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/1280px-Bohinjsko_jezero_2.jpg"
data-title="Bohinj lake"
data-description="Bohinj lake (Triglav National Park, Slovenia) in the morning."
>
</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Bowling_Balls_Beach_2_edit.jpg/800px-Bowling_Balls_Beach_2_edit.jpg">
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Bowling_Balls_Beach_2_edit.jpg/100px-Bowling_Balls_Beach_2_edit.jpg",
data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Bowling_Balls_Beach_2_edit.jpg/1280px-Bowling_Balls_Beach_2_edit.jpg"
data-title="Bowling Balls"
data-description="Mendocino county, California, USA."
>
</a>
<a href="https://vimeo.com/25750735">
<span class="video">Works for vimeo too.</span>
</a>
<a href="https://www.youtube.com/watch?v=gAeYCJZ_meY">
<span class="video">Works for youtube too.</span>
</a>

</div>
<p class="cred">Made by <a href="http://galleria.io">Galleria</a>.</p>
</div>

<!-- load jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<!-- load Galleria -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.4.5/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.4.5/themes/classic/galleria.classic.min.js"></script>
<script>
$(function() {
Galleria.run('#galleria');
});
</script>
</body>
</html>

0 comments on commit b1246c8

Please sign in to comment.