Skip to content

Commit 36945e8

Browse files
author
Frank Ludwig
committed
Build 1.6.0
1 parent 82d6d82 commit 36945e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1122
-1177
lines changed

README.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ Galleria
77
This is the open source repository for the Galleria core, the Classic theme, plugins and everything else that comes bundled with the free download.
88
Feel free to post issues - but keep them code related please. You may also do pull requests, but make sure you include some comments and/or tests.
99

10-
Info, demos, docs and everything else: http://galleria.io
11-
12-
Updates via twitter: http://twitter.com/galleriajs
10+
Info, demos, docs and everything else: https://galleria.io
1311

1412
Documentation
1513
=============
1614

17-
http://docs.galleria.io
15+
https://docs.galleria.io
16+
17+
18+
FAQ
19+
=============
20+
21+
https://docs.galleria.io/references/faq.html
22+
1823

1924
Installation
2025
============
@@ -34,13 +39,13 @@ bower
3439

3540
$ bower install galleria
3641

37-
http://bower.io/search/?q=galleria
42+
https://bower.io/search/?q=galleria
3843

3944

4045
CDN
4146
---
4247
::
4348

44-
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.7/galleria.min.js"></script>
49+
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.6.0/galleria.min.js"></script>
4550

4651
https://cdnjs.com/libraries/galleria

dist/galleria.js

Lines changed: 83 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,46 @@
11
/**
2-
* Galleria v1.5.7 2017-05-10
2+
* Galleria v1.6.0 2019-10-13
33
* http://galleria.io
44
*
5-
* Copyright (c) 2010 - 2016 worse is better UG
5+
* Copyright (c) 2010 - 2019 worse is better UG
66
* Licensed under the MIT license
77
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
88
*
99
*/
1010

11-
(function( $, window, Galleria, undef ) {
11+
( function( window, factory ) {
12+
if ( typeof define == 'function' && define.amd ) {
13+
define( [ 'jquery' ], function( jQuery ) {
14+
return factory( window, jQuery );
15+
});
16+
} else if ( typeof module == 'object' && module.exports ) {
17+
module.exports = factory(
18+
window,
19+
require('jquery')
20+
);
21+
} else {
22+
// browser global
23+
window.Galleria = factory(
24+
window,
25+
window.jQuery
26+
);
27+
}
28+
29+
}( window, function factory( window, $, Galleria, undef ) {
1230

1331
/*global jQuery, navigator, Image, module, define */
1432

1533
// some references
1634
var doc = window.document,
1735
$doc = $( doc ),
1836
$win = $( window ),
37+
jQuery = $,
1938

2039
// native prototypes
2140
protoArray = Array.prototype,
2241

2342
// internal constants
24-
VERSION = 1.57,
43+
VERSION = 1.60,
2544
DEBUG = true,
2645
TIMEOUT = 30000,
2746
DUMMY = false,
@@ -128,7 +147,7 @@ var doc = window.document,
128147
return PROT + '//img.youtube.com/vi/'+this.id+'/default.jpg';
129148
},
130149
get_image: function( data ) {
131-
return PROT + '//img.youtube.com/vi/'+this.id+'/hqdefault.jpg'; }
150+
return PROT + '//img.youtube.com/vi/'+this.id+'/maxresdefault.jpg'; }
132151
},
133152
vimeo: {
134153
reg: /https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,
@@ -1866,8 +1885,14 @@ Galleria = function() {
18661885
var image = self._controls.getActive().image;
18671886
if ( image ) {
18681887
$( image ).width( big.image.width ).height( big.image.height )
1869-
.attr( 'style', $( big.image ).attr('style') )
1870-
.attr( 'src', big.image.src );
1888+
.attr( 'style', $( big.image ).attr('style') );
1889+
if (big.image.src.srcset) {
1890+
$( image ).attr( 'srcset', big.image.src.srcset );
1891+
}
1892+
if (big.image.src.sizes) {
1893+
$( image ).attr( 'sizes', big.image.src.sizes );
1894+
}
1895+
$( image ).attr( 'src', big.image.src );
18711896
}
18721897
}
18731898
});
@@ -3873,22 +3898,37 @@ Galleria.prototype = {
38733898
} else if( href && elem.hasClass('iframe') ) {
38743899
data.iframe = href;
38753900
} else {
3876-
data.image = data.big = href;
3901+
data.image = href;
38773902
}
38783903

38793904
if ( rel ) {
38803905
data.big = rel;
38813906
}
38823907

3883-
// alternative extraction from HTML5 data attribute, added in 1.2.7
3884-
$.each( 'big title description link layer image'.split(' '), function( i, val ) {
3908+
data.imagesrcset = parent.data( 'srcset' );
3909+
data.imagesizes = parent.data( 'sizes' );
3910+
data.thumbsizes = elem.attr( 'sizes' );
3911+
data.thumbsrcset = elem.attr( 'srcset' );
3912+
3913+
// alternative extraction from HTML5 data attribute
3914+
$.each( 'big bigsrcset bigsizes title description link layer image imagesrcset imagesizes'.split(' '), function( i, val ) {
38853915
if ( elem.data(val) ) {
38863916
data[ val ] = elem.data(val).toString();
38873917
}
38883918
});
38893919

3920+
if (elem.data('srcset')) {
3921+
data.imagesrcset = elem.data('srcset');
3922+
}
3923+
3924+
if (elem.data('sizes')) {
3925+
data.imagesizes = elem.data('sizes');
3926+
}
3927+
38903928
if ( !data.big ) {
38913929
data.big = data.image;
3930+
data.bigsrcset = data.imagesrcset;
3931+
data.bigsizes = data.imagesizes;
38923932
}
38933933

38943934
// mix default extractions with the hrefs and config
@@ -3950,6 +3990,15 @@ Galleria.prototype = {
39503990

39513991
current = self._data[ i ];
39523992

3993+
// q&d hack to attach srcset & sizes to src
3994+
$.each( 'big image thumb'.split(' '), function( i, val ) {
3995+
if ( data[ val] ) {
3996+
data[val] = new String(data[val]);
3997+
data[val].srcset = data [val + 'srcset'];
3998+
data[val].sizes = data [val + 'sizes'];
3999+
}
4000+
});
4001+
39534002
// copy image as thumb if no thumb exists
39544003
if ( 'thumb' in data === false ) {
39554004
current.thumb = data.image;
@@ -4029,6 +4078,7 @@ Galleria.prototype = {
40294078
this.clearTimer();
40304079
Utils.removeFromArray( _instances, this );
40314080
Utils.removeFromArray( _galleries, this );
4081+
_video._inst = [];
40324082
if ( Galleria._waiters !== undefined && Galleria._waiters.length ) {
40334083
$.each( Galleria._waiters, function( i, w ) {
40344084
if ( w ) window.clearTimeout( w );
@@ -6168,11 +6218,22 @@ Galleria.Picture.prototype = {
61686218
*/
61696219

61706220
preload: function( src ) {
6171-
$( new Image() ).on( 'load', (function(src, cache) {
6221+
var $image = $( new Image() ).on( 'load', (function(src, cache) {
61726222
return function() {
61736223
cache[ src ] = src;
61746224
};
6175-
}( src, this.cache ))).attr( 'src', src );
6225+
}( src, this.cache )));
6226+
6227+
// due to a bug in safari, need to set srcset first
6228+
if (src.srcset) {
6229+
$image.attr( 'srcset', src.srcset );
6230+
}
6231+
6232+
if (src.sizes) {
6233+
$image.attr( 'sizes', src.sizes );
6234+
}
6235+
6236+
$image.attr( 'src', src );
61766237
},
61776238

61786239
/**
@@ -6340,7 +6401,14 @@ Galleria.Picture.prototype = {
63406401
});
63416402

63426403
// begin load and insert in cache when done
6343-
$image.on( 'load', onload ).on( 'error', onerror ).attr( 'src', src );
6404+
$image.on( 'load', onload ).on( 'error', onerror );
6405+
if (src.srcset) {
6406+
$image.attr( 'srcset', src.srcset );
6407+
}
6408+
if (src.sizes) {
6409+
$image.attr( 'sizes', src.sizes );
6410+
}
6411+
$image.attr( 'src', src );
63446412

63456413
// return the container
63466414
return this.container;
@@ -6915,16 +6983,7 @@ $.fn.galleria = function( options ) {
69156983

69166984
};
69176985

6918-
// export as AMD or CommonJS
6919-
if ( typeof module === "object" && module && typeof module.exports === "object" ) {
6920-
module.exports = Galleria;
6921-
} else {
6922-
window.Galleria = Galleria;
6923-
if ( typeof define === "function" && define.amd ) {
6924-
define( "galleria", ['jquery'], function() { return Galleria; } );
6925-
}
6926-
}
6927-
69286986
// phew
6987+
return Galleria;
69296988

6930-
}( jQuery, this ) );
6989+
}));

dist/galleria.min.js

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

dist/plugins/flickr/flickr-loader.gif

-2.08 KB
Binary file not shown.

dist/plugins/flickr/galleria.flickr.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
/**
2-
* Galleria Flickr Plugin 2016-09-03
2+
* Galleria Flickr Plugin 2019-10-13
33
* http://galleria.io
44
*
5-
* Copyright (c) 2010 - 2017 worse is better UG
5+
* Copyright (c) 2010 - 2019 worse is better UG
66
* Licensed under the MIT license
77
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
88
*
99
*/
1010

11-
(function($) {
11+
12+
( function( window, factory ) {
13+
if ( typeof define == 'function' && define.amd ) {
14+
define( ['../galleria', 'jquery' ], function( Galleria, jQuery ) {
15+
return factory( window, Galleria, jQuery );
16+
});
17+
} else if ( typeof module == 'object' && module.exports ) {
18+
module.exports = factory(
19+
window,
20+
require('galleria'),
21+
require('jquery')
22+
);
23+
} else {
24+
factory(
25+
window,
26+
window.Galleria,
27+
window.jQuery
28+
);
29+
}
30+
}( window, function factory( window, Galleria, $ ) {
1231

1332
/*global jQuery, Galleria, window */
1433

@@ -335,7 +354,7 @@ Galleria.prototype.load = function() {
335354
width: 48,
336355
height: 48,
337356
opacity: 0.7,
338-
background:'#000 url('+PATH+'loader.gif) no-repeat 50% 50%'
357+
background:"#000 url('data:image/gif;base64,R0lGODlhEAAQAPQAAAAAAP///w4ODnR0dB4eHri4uISEhP///6amptra2lJSUkBAQOrq6mJiYvr6+sjIyJaWlgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAAKAAEALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnA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q2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkEAAoACAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAAKAAkALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQACgAKACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQACgALACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==') no-repeat 50% 50%"
339358
});
340359

341360
if ( flickr.length ) {
@@ -381,4 +400,5 @@ Galleria.prototype.load = function() {
381400
}
382401
};
383402

384-
}( jQuery ) );
403+
return Galleria;
404+
}));

0 commit comments

Comments
 (0)