j1m_lightbox 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +21 -0
  3. data/README.md +41 -0
  4. data/_data/modules/default/j1_lightbox-0.0.1/j1_colorbox.yml +106 -0
  5. data/_data/modules/default/j1_lightbox-0.0.1/j1_light_gallery.yml +162 -0
  6. data/_data/modules/default/j1_lightbox-0.0.1/j1_lightbox2.yml +168 -0
  7. data/_data/resources/default/j1_lightbox-0.0.1/resource.yml +84 -0
  8. data/assets/themes/j1/lightboxes/colorbox/css/theme_1/colorbox.css +93 -0
  9. data/assets/themes/j1/lightboxes/colorbox/css/theme_1/images/border.png +0 -0
  10. data/assets/themes/j1/lightboxes/colorbox/css/theme_1/images/controls.png +0 -0
  11. data/assets/themes/j1/lightboxes/colorbox/css/theme_1/images/loading.gif +0 -0
  12. data/assets/themes/j1/lightboxes/colorbox/css/theme_1/images/loading_background.png +0 -0
  13. data/assets/themes/j1/lightboxes/colorbox/css/theme_1/images/overlay.png +0 -0
  14. data/assets/themes/j1/lightboxes/colorbox/css/theme_2/colorbox.css +72 -0
  15. data/assets/themes/j1/lightboxes/colorbox/css/theme_2/images/controls.png +0 -0
  16. data/assets/themes/j1/lightboxes/colorbox/css/theme_2/images/loading.gif +0 -0
  17. data/assets/themes/j1/lightboxes/colorbox/css/theme_3/colorbox.css +68 -0
  18. data/assets/themes/j1/lightboxes/colorbox/css/theme_3/images/controls.png +0 -0
  19. data/assets/themes/j1/lightboxes/colorbox/css/theme_3/images/loading.gif +0 -0
  20. data/assets/themes/j1/lightboxes/colorbox/css/theme_4/colorbox.css +89 -0
  21. data/assets/themes/j1/lightboxes/colorbox/css/theme_4/images/border1.png +0 -0
  22. data/assets/themes/j1/lightboxes/colorbox/css/theme_4/images/border2.png +0 -0
  23. data/assets/themes/j1/lightboxes/colorbox/css/theme_4/images/loading.gif +0 -0
  24. data/assets/themes/j1/lightboxes/colorbox/css/theme_5/colorbox.css +81 -0
  25. data/assets/themes/j1/lightboxes/colorbox/css/theme_5/images/border.png +0 -0
  26. data/assets/themes/j1/lightboxes/colorbox/css/theme_5/images/controls.png +0 -0
  27. data/assets/themes/j1/lightboxes/colorbox/css/theme_5/images/loading.gif +0 -0
  28. data/assets/themes/j1/lightboxes/colorbox/css/theme_5/images/loading_background.png +0 -0
  29. data/assets/themes/j1/lightboxes/colorbox/js/jquery.colorbox.js +1105 -0
  30. data/assets/themes/j1/lightboxes/colorbox/js/jquery.colorbox.min.js +6 -0
  31. data/assets/themes/j1/lightboxes/light_gallery/css/lg-fb-comment-box.css +57 -0
  32. data/assets/themes/j1/lightboxes/light_gallery/css/lg-fb-comment-box.min.css +1 -0
  33. data/assets/themes/j1/lightboxes/light_gallery/css/lg-transitions.css +778 -0
  34. data/assets/themes/j1/lightboxes/light_gallery/css/lg-transitions.min.css +1 -0
  35. data/assets/themes/j1/lightboxes/light_gallery/css/lightgallery.css +967 -0
  36. data/assets/themes/j1/lightboxes/light_gallery/css/lightgallery.min.css +1 -0
  37. data/assets/themes/j1/lightboxes/light_gallery/css/theme/j1_template.css +290 -0
  38. data/assets/themes/j1/lightboxes/light_gallery/fonts/lg.eot +0 -0
  39. data/assets/themes/j1/lightboxes/light_gallery/fonts/lg.svg +47 -0
  40. data/assets/themes/j1/lightboxes/light_gallery/fonts/lg.ttf +0 -0
  41. data/assets/themes/j1/lightboxes/light_gallery/fonts/lg.woff +0 -0
  42. data/assets/themes/j1/lightboxes/light_gallery/img/icons/animation-w.png +0 -0
  43. data/assets/themes/j1/lightboxes/light_gallery/img/icons/customize-w.png +0 -0
  44. data/assets/themes/j1/lightboxes/light_gallery/img/icons/dynamic-w.png +0 -0
  45. data/assets/themes/j1/lightboxes/light_gallery/img/icons/facebook-icon.svg +10 -0
  46. data/assets/themes/j1/lightboxes/light_gallery/img/icons/googleplus-icon.svg +30 -0
  47. data/assets/themes/j1/lightboxes/light_gallery/img/icons/html5-w.png +0 -0
  48. data/assets/themes/j1/lightboxes/light_gallery/img/icons/linked-in.png +0 -0
  49. data/assets/themes/j1/lightboxes/light_gallery/img/icons/module-w.png +0 -0
  50. data/assets/themes/j1/lightboxes/light_gallery/img/icons/play-button.png +0 -0
  51. data/assets/themes/j1/lightboxes/light_gallery/img/icons/responsive-w.png +0 -0
  52. data/assets/themes/j1/lightboxes/light_gallery/img/icons/thumb-w.png +0 -0
  53. data/assets/themes/j1/lightboxes/light_gallery/img/icons/touch-w.png +0 -0
  54. data/assets/themes/j1/lightboxes/light_gallery/img/icons/twitter-icon.svg +15 -0
  55. data/assets/themes/j1/lightboxes/light_gallery/img/icons/twitter.png +0 -0
  56. data/assets/themes/j1/lightboxes/light_gallery/img/icons/video1-w.png +0 -0
  57. data/assets/themes/j1/lightboxes/light_gallery/img/icons/zoom-w.png +0 -0
  58. data/assets/themes/j1/lightboxes/light_gallery/img/icons/zoom.png +0 -0
  59. data/assets/themes/j1/lightboxes/light_gallery/img/loading.gif +0 -0
  60. data/assets/themes/j1/lightboxes/light_gallery/img/video-play.png +0 -0
  61. data/assets/themes/j1/lightboxes/light_gallery/img/vimeo-play.png +0 -0
  62. data/assets/themes/j1/lightboxes/light_gallery/img/youtube-play.png +0 -0
  63. data/assets/themes/j1/lightboxes/light_gallery/js/lg-autoplay.js +204 -0
  64. data/assets/themes/j1/lightboxes/light_gallery/js/lg-autoplay.min.js +4 -0
  65. data/assets/themes/j1/lightboxes/light_gallery/js/lg-fullscreen.js +116 -0
  66. data/assets/themes/j1/lightboxes/light_gallery/js/lg-fullscreen.min.js +4 -0
  67. data/assets/themes/j1/lightboxes/light_gallery/js/lg-hash.js +93 -0
  68. data/assets/themes/j1/lightboxes/light_gallery/js/lg-hash.min.js +4 -0
  69. data/assets/themes/j1/lightboxes/light_gallery/js/lg-pager.js +105 -0
  70. data/assets/themes/j1/lightboxes/light_gallery/js/lg-pager.min.js +4 -0
  71. data/assets/themes/j1/lightboxes/light_gallery/js/lg-share.js +92 -0
  72. data/assets/themes/j1/lightboxes/light_gallery/js/lg-share.min.js +4 -0
  73. data/assets/themes/j1/lightboxes/light_gallery/js/lg-thumbnail.js +473 -0
  74. data/assets/themes/j1/lightboxes/light_gallery/js/lg-thumbnail.min.js +4 -0
  75. data/assets/themes/j1/lightboxes/light_gallery/js/lg-video.js +312 -0
  76. data/assets/themes/j1/lightboxes/light_gallery/js/lg-video.min.js +4 -0
  77. data/assets/themes/j1/lightboxes/light_gallery/js/lg-zoom.js +497 -0
  78. data/assets/themes/j1/lightboxes/light_gallery/js/lg-zoom.min.js +4 -0
  79. data/assets/themes/j1/lightboxes/light_gallery/js/lightgallery.js +1340 -0
  80. data/assets/themes/j1/lightboxes/light_gallery/js/lightgallery.min.js +4 -0
  81. data/assets/themes/j1/lightboxes/lightbox2/css/lightbox.css +213 -0
  82. data/assets/themes/j1/lightboxes/lightbox2/css/lightbox.min.css +1 -0
  83. data/assets/themes/j1/lightboxes/lightbox2/images/close.png +0 -0
  84. data/assets/themes/j1/lightboxes/lightbox2/images/loading.gif +0 -0
  85. data/assets/themes/j1/lightboxes/lightbox2/images/next.png +0 -0
  86. data/assets/themes/j1/lightboxes/lightbox2/images/prev.png +0 -0
  87. data/assets/themes/j1/lightboxes/lightbox2/js/lightbox-plus-jquery.js +9719 -0
  88. data/assets/themes/j1/lightboxes/lightbox2/js/lightbox-plus-jquery.min.js +38 -0
  89. data/assets/themes/j1/lightboxes/lightbox2/js/lightbox-plus-jquery.min.map +1 -0
  90. data/assets/themes/j1/lightboxes/lightbox2/js/lightbox.js +508 -0
  91. data/assets/themes/j1/lightboxes/lightbox2/js/lightbox.min.js +13 -0
  92. data/assets/themes/j1/lightboxes/lightbox2/js/lightbox.min.map +1 -0
  93. data/exe/console +14 -0
  94. data/exe/setup +8 -0
  95. data/lib/j1m_lightbox.rb +5 -0
  96. data/lib/j1m_lightbox/version.rb +3 -0
  97. metadata +185 -0
@@ -0,0 +1,4 @@
1
+ /*! lg-pager - v1.0.0 - 2016-09-20
2
+ * http://sachinchoolur.github.io/lightGallery
3
+ * Copyright (c) 2016 Sachin N; Licensed GPLv3 */
4
+ !function(a,b){"function"==typeof define&&define.amd?define([],function(){return b()}):"object"==typeof exports?module.exports=b():b()}(this,function(){!function(a,b,c,d){"use strict";var e={pager:!1},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.core.s.pager&&this.core.$items.length>1&&this.init(),this};f.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('<div class="lg-pager-outer"></div>'),e.core.s.dynamic)for(var g=0;g<e.core.s.dynamicEl.length;g++)f+='<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+e.core.s.dynamicEl[g].thumb+'" /></div></span>';else e.core.$items.each(function(){f+=e.core.s.exThumbImage?'<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+a(this).attr(e.core.s.exThumbImage)+'" /></div></span>':'<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+a(this).find("img").attr("src")+'" /></div></span>'});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},f.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=f}(jQuery,window,document)});
@@ -0,0 +1,92 @@
1
+ /*! lg-share - v1.0.0 - 2016-09-20
2
+ * http://sachinchoolur.github.io/lightGallery
3
+ * Copyright (c) 2016 Sachin N; Licensed GPLv3 */
4
+
5
+ (function (root, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ // AMD. Register as an anonymous module unless amdModuleId is set
8
+ define([], function () {
9
+ return (factory());
10
+ });
11
+ } else if (typeof exports === 'object') {
12
+ // Node. Does not work with strict CommonJS, but
13
+ // only CommonJS-like environments that support module.exports,
14
+ // like Node.
15
+ module.exports = factory();
16
+ } else {
17
+ factory();
18
+ }
19
+ }(this, function () {
20
+
21
+ (function($, window, document, undefined) {
22
+
23
+ 'use strict';
24
+
25
+ var defaults = {
26
+ share: true,
27
+ facebook: true,
28
+ facebookDropdownText: 'Facebook',
29
+ twitter: true,
30
+ twitterDropdownText: 'Twitter',
31
+ googlePlus: true,
32
+ googlePlusDropdownText: 'GooglePlus',
33
+ pinterest: true,
34
+ pinterestDropdownText: 'Pinterest'
35
+ };
36
+
37
+ var Share = function(element) {
38
+
39
+ this.core = $(element).data('lightGallery');
40
+
41
+ this.core.s = $.extend({}, defaults, this.core.s);
42
+ this.init();
43
+
44
+ return this;
45
+ };
46
+
47
+ Share.prototype.init = function() {
48
+ var _this = this;
49
+ var shareHtml = '<span id="lg-share" class="lg-icon">' +
50
+ '<ul class="lg-dropdown" style="position: absolute;">';
51
+ shareHtml += _this.core.s.facebook ? '<li><a id="lg-share-facebook" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.facebookDropdownText + '</span></a></li>' : '';
52
+ shareHtml += _this.core.s.twitter ? '<li><a id="lg-share-twitter" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.twitterDropdownText + '</span></a></li>' : '';
53
+ shareHtml += _this.core.s.googlePlus ? '<li><a id="lg-share-googleplus" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.googlePlusDropdownText + '</span></a></li>' : '';
54
+ shareHtml += _this.core.s.pinterest ? '<li><a id="lg-share-pinterest" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.pinterestDropdownText + '</span></a></li>' : '';
55
+ shareHtml += '</ul></span>';
56
+
57
+ this.core.$outer.find('.lg-toolbar').append(shareHtml);
58
+ this.core.$outer.find('.lg').append('<div id="lg-dropdown-overlay"></div>');
59
+ $('#lg-share').on('click.lg', function(){
60
+ _this.core.$outer.toggleClass('lg-dropdown-active');
61
+ });
62
+
63
+ $('#lg-dropdown-overlay').on('click.lg', function(){
64
+ _this.core.$outer.removeClass('lg-dropdown-active');
65
+ });
66
+
67
+ _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
68
+
69
+ setTimeout(function() {
70
+ $('#lg-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(_this.core.$items.eq(index).attr('data-facebook-share-url') || window.location.href)));
71
+
72
+ $('#lg-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=' + _this.core.$items.eq(index).attr('data-tweet-text') + '&url=' + (encodeURIComponent(_this.core.$items.eq(index).attr('data-twitter-share-url') || window.location.href)));
73
+
74
+ $('#lg-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(_this.core.$items.eq(index).attr('data-googleplus-share-url') || window.location.href)));
75
+
76
+ $('#lg-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(_this.core.$items.eq(index).attr('data-pinterest-share-url') || window.location.href)) + '&media=' + encodeURIComponent(_this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src')) + '&description=' + _this.core.$items.eq(index).attr('data-pinterest-text'));
77
+
78
+ }, 100);
79
+ });
80
+ };
81
+
82
+ Share.prototype.destroy = function() {
83
+
84
+ };
85
+
86
+ $.fn.lightGallery.modules.share = Share;
87
+
88
+ })(jQuery, window, document);
89
+
90
+
91
+
92
+ }));
@@ -0,0 +1,4 @@
1
+ /*! lg-share - v1.0.0 - 2016-09-20
2
+ * http://sachinchoolur.github.io/lightGallery
3
+ * Copyright (c) 2016 Sachin N; Licensed GPLv3 */
4
+ !function(a,b){"function"==typeof define&&define.amd?define([],function(){return b()}):"object"==typeof exports?module.exports=b():b()}(this,function(){!function(a,b,c,d){"use strict";var e={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",googlePlus:!0,googlePlusDropdownText:"GooglePlus",pinterest:!0,pinterestDropdownText:"Pinterest"},f=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.init(),this};f.prototype.init=function(){var c=this,d='<span id="lg-share" class="lg-icon"><ul class="lg-dropdown" style="position: absolute;">';d+=c.core.s.facebook?'<li><a id="lg-share-facebook" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+this.core.s.facebookDropdownText+"</span></a></li>":"",d+=c.core.s.twitter?'<li><a id="lg-share-twitter" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+this.core.s.twitterDropdownText+"</span></a></li>":"",d+=c.core.s.googlePlus?'<li><a id="lg-share-googleplus" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+this.core.s.googlePlusDropdownText+"</span></a></li>":"",d+=c.core.s.pinterest?'<li><a id="lg-share-pinterest" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+this.core.s.pinterestDropdownText+"</span></a></li>":"",d+="</ul></span>",this.core.$outer.find(".lg-toolbar").append(d),this.core.$outer.find(".lg").append('<div id="lg-dropdown-overlay"></div>'),a("#lg-share").on("click.lg",function(){c.core.$outer.toggleClass("lg-dropdown-active")}),a("#lg-dropdown-overlay").on("click.lg",function(){c.core.$outer.removeClass("lg-dropdown-active")}),c.core.$el.on("onAfterSlide.lg.tm",function(d,e,f){setTimeout(function(){a("#lg-share-facebook").attr("href","https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(c.core.$items.eq(f).attr("data-facebook-share-url")||b.location.href)),a("#lg-share-twitter").attr("href","https://twitter.com/intent/tweet?text="+c.core.$items.eq(f).attr("data-tweet-text")+"&url="+encodeURIComponent(c.core.$items.eq(f).attr("data-twitter-share-url")||b.location.href)),a("#lg-share-googleplus").attr("href","https://plus.google.com/share?url="+encodeURIComponent(c.core.$items.eq(f).attr("data-googleplus-share-url")||b.location.href)),a("#lg-share-pinterest").attr("href","http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(c.core.$items.eq(f).attr("data-pinterest-share-url")||b.location.href)+"&media="+encodeURIComponent(c.core.$items.eq(f).attr("href")||c.core.$items.eq(f).attr("data-src"))+"&description="+c.core.$items.eq(f).attr("data-pinterest-text"))},100)})},f.prototype.destroy=function(){},a.fn.lightGallery.modules.share=f}(jQuery,window,document)});
@@ -0,0 +1,473 @@
1
+ /*! lg-thumbnail - v1.0.0 - 2016-09-20
2
+ * http://sachinchoolur.github.io/lightGallery
3
+ * Copyright (c) 2016 Sachin N; Licensed GPLv3 */
4
+
5
+ (function (root, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ // AMD. Register as an anonymous module unless amdModuleId is set
8
+ define([], function () {
9
+ return (factory());
10
+ });
11
+ } else if (typeof exports === 'object') {
12
+ // Node. Does not work with strict CommonJS, but
13
+ // only CommonJS-like environments that support module.exports,
14
+ // like Node.
15
+ module.exports = factory();
16
+ } else {
17
+ factory();
18
+ }
19
+ }(this, function () {
20
+
21
+ (function($, window, document, undefined) {
22
+
23
+ 'use strict';
24
+
25
+ var defaults = {
26
+ thumbnail: true,
27
+
28
+ animateThumb: true,
29
+ currentPagerPosition: 'middle',
30
+
31
+ thumbWidth: 100,
32
+ thumbContHeight: 100,
33
+ thumbMargin: 5,
34
+
35
+ exThumbImage: false,
36
+ showThumbByDefault: true,
37
+ toogleThumb: true,
38
+ pullCaptionUp: true,
39
+
40
+ enableThumbDrag: true,
41
+ enableThumbSwipe: true,
42
+ swipeThreshold: 50,
43
+
44
+ loadYoutubeThumbnail: true,
45
+ youtubeThumbSize: 1,
46
+
47
+ loadVimeoThumbnail: true,
48
+ vimeoThumbSize: 'thumbnail_small',
49
+
50
+ loadDailymotionThumbnail: true
51
+ };
52
+
53
+ var Thumbnail = function(element) {
54
+
55
+ // get lightGallery core plugin data
56
+ this.core = $(element).data('lightGallery');
57
+
58
+ // extend module default settings with lightGallery core settings
59
+ this.core.s = $.extend({}, defaults, this.core.s);
60
+
61
+ this.$el = $(element);
62
+ this.$thumbOuter = null;
63
+ this.thumbOuterWidth = 0;
64
+ this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
65
+ this.thumbIndex = this.core.index;
66
+
67
+ // Thumbnail animation value
68
+ this.left = 0;
69
+
70
+ this.init();
71
+
72
+ return this;
73
+ };
74
+
75
+ Thumbnail.prototype.init = function() {
76
+ var _this = this;
77
+ if (this.core.s.thumbnail && this.core.$items.length > 1) {
78
+ if (this.core.s.showThumbByDefault) {
79
+ setTimeout(function(){
80
+ _this.core.$outer.addClass('lg-thumb-open');
81
+ }, 700);
82
+ }
83
+
84
+ if (this.core.s.pullCaptionUp) {
85
+ this.core.$outer.addClass('lg-pull-caption-up');
86
+ }
87
+
88
+ this.build();
89
+ if (this.core.s.animateThumb) {
90
+ if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) {
91
+ this.enableThumbDrag();
92
+ }
93
+
94
+ if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) {
95
+ this.enableThumbSwipe();
96
+ }
97
+
98
+ this.thumbClickable = false;
99
+ } else {
100
+ this.thumbClickable = true;
101
+ }
102
+
103
+ this.toogle();
104
+ this.thumbkeyPress();
105
+ }
106
+ };
107
+
108
+ Thumbnail.prototype.build = function() {
109
+ var _this = this;
110
+ var thumbList = '';
111
+ var vimeoErrorThumbSize = '';
112
+ var $thumb;
113
+ var html = '<div class="lg-thumb-outer">' +
114
+ '<div class="lg-thumb group">' +
115
+ '</div>' +
116
+ '</div>';
117
+
118
+ switch (this.core.s.vimeoThumbSize) {
119
+ case 'thumbnail_large':
120
+ vimeoErrorThumbSize = '640';
121
+ break;
122
+ case 'thumbnail_medium':
123
+ vimeoErrorThumbSize = '200x150';
124
+ break;
125
+ case 'thumbnail_small':
126
+ vimeoErrorThumbSize = '100x75';
127
+ }
128
+
129
+ _this.core.$outer.addClass('lg-has-thumb');
130
+
131
+ _this.core.$outer.find('.lg').append(html);
132
+
133
+ _this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
134
+ _this.thumbOuterWidth = _this.$thumbOuter.width();
135
+
136
+ if (_this.core.s.animateThumb) {
137
+ _this.core.$outer.find('.lg-thumb').css({
138
+ width: _this.thumbTotalWidth + 'px',
139
+ position: 'relative'
140
+ });
141
+ }
142
+
143
+ if (this.core.s.animateThumb) {
144
+ _this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
145
+ }
146
+
147
+ function getThumb(src, thumb, index) {
148
+ var isVideo = _this.core.isVideo(src, index) || {};
149
+ var thumbImg;
150
+ var vimeoId = '';
151
+
152
+ if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
153
+ if (isVideo.youtube) {
154
+ if (_this.core.s.loadYoutubeThumbnail) {
155
+ thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
156
+ } else {
157
+ thumbImg = thumb;
158
+ }
159
+ } else if (isVideo.vimeo) {
160
+ if (_this.core.s.loadVimeoThumbnail) {
161
+ thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
162
+ vimeoId = isVideo.vimeo[1];
163
+ } else {
164
+ thumbImg = thumb;
165
+ }
166
+ } else if (isVideo.dailymotion) {
167
+ if (_this.core.s.loadDailymotionThumbnail) {
168
+ thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
169
+ } else {
170
+ thumbImg = thumb;
171
+ }
172
+ }
173
+ } else {
174
+ thumbImg = thumb;
175
+ }
176
+
177
+ thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
178
+ vimeoId = '';
179
+ }
180
+
181
+ if (_this.core.s.dynamic) {
182
+ for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
183
+ getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i);
184
+ }
185
+ } else {
186
+ _this.core.$items.each(function(i) {
187
+
188
+ if (!_this.core.s.exThumbImage) {
189
+ getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
190
+ } else {
191
+ getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i);
192
+ }
193
+
194
+ });
195
+ }
196
+
197
+ _this.core.$outer.find('.lg-thumb').html(thumbList);
198
+
199
+ $thumb = _this.core.$outer.find('.lg-thumb-item');
200
+
201
+ // Load vimeo thumbnails
202
+ $thumb.each(function() {
203
+ var $this = $(this);
204
+ var vimeoVideoId = $this.attr('data-vimeo-id');
205
+
206
+ if (vimeoVideoId) {
207
+ $.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
208
+ format: 'json'
209
+ }, function(data) {
210
+ $this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
211
+ });
212
+ }
213
+ });
214
+
215
+ // manage active class for thumbnail
216
+ $thumb.eq(_this.core.index).addClass('active');
217
+ _this.core.$el.on('onBeforeSlide.lg.tm', function() {
218
+ $thumb.removeClass('active');
219
+ $thumb.eq(_this.core.index).addClass('active');
220
+ });
221
+
222
+ $thumb.on('click.lg touchend.lg', function() {
223
+ var _$this = $(this);
224
+ setTimeout(function() {
225
+
226
+ // In IE9 and bellow touch does not support
227
+ // Go to slide if browser does not support css transitions
228
+ if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
229
+ _this.core.index = _$this.index();
230
+ _this.core.slide(_this.core.index, false, true);
231
+ }
232
+ }, 50);
233
+ });
234
+
235
+ _this.core.$el.on('onBeforeSlide.lg.tm', function() {
236
+ _this.animateThumb(_this.core.index);
237
+ });
238
+
239
+ $(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
240
+ setTimeout(function() {
241
+ _this.animateThumb(_this.core.index);
242
+ _this.thumbOuterWidth = _this.$thumbOuter.width();
243
+ }, 200);
244
+ });
245
+
246
+ };
247
+
248
+ Thumbnail.prototype.setTranslate = function(value) {
249
+ // jQuery supports Automatic CSS prefixing since jQuery 1.8.0
250
+ this.core.$outer.find('.lg-thumb').css({
251
+ transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
252
+ });
253
+ };
254
+
255
+ Thumbnail.prototype.animateThumb = function(index) {
256
+ var $thumb = this.core.$outer.find('.lg-thumb');
257
+ if (this.core.s.animateThumb) {
258
+ var position;
259
+ switch (this.core.s.currentPagerPosition) {
260
+ case 'left':
261
+ position = 0;
262
+ break;
263
+ case 'middle':
264
+ position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
265
+ break;
266
+ case 'right':
267
+ position = this.thumbOuterWidth - this.core.s.thumbWidth;
268
+ }
269
+ this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position;
270
+ if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) {
271
+ this.left = this.thumbTotalWidth - this.thumbOuterWidth;
272
+ }
273
+
274
+ if (this.left < 0) {
275
+ this.left = 0;
276
+ }
277
+
278
+ if (this.core.lGalleryOn) {
279
+ if (!$thumb.hasClass('on')) {
280
+ this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
281
+ }
282
+
283
+ if (!this.core.doCss()) {
284
+ $thumb.animate({
285
+ left: -this.left + 'px'
286
+ }, this.core.s.speed);
287
+ }
288
+ } else {
289
+ if (!this.core.doCss()) {
290
+ $thumb.css('left', -this.left + 'px');
291
+ }
292
+ }
293
+
294
+ this.setTranslate(this.left);
295
+
296
+ }
297
+ };
298
+
299
+ // Enable thumbnail dragging and swiping
300
+ Thumbnail.prototype.enableThumbDrag = function() {
301
+
302
+ var _this = this;
303
+ var startCoords = 0;
304
+ var endCoords = 0;
305
+ var isDraging = false;
306
+ var isMoved = false;
307
+ var tempLeft = 0;
308
+
309
+ _this.$thumbOuter.addClass('lg-grab');
310
+
311
+ _this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
312
+ if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
313
+ // execute only on .lg-object
314
+ e.preventDefault();
315
+ startCoords = e.pageX;
316
+ isDraging = true;
317
+
318
+ // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
319
+ _this.core.$outer.scrollLeft += 1;
320
+ _this.core.$outer.scrollLeft -= 1;
321
+
322
+ // *
323
+ _this.thumbClickable = false;
324
+ _this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
325
+ }
326
+ });
327
+
328
+ $(window).on('mousemove.lg.thumb', function(e) {
329
+ if (isDraging) {
330
+ tempLeft = _this.left;
331
+ isMoved = true;
332
+ endCoords = e.pageX;
333
+
334
+ _this.$thumbOuter.addClass('lg-dragging');
335
+
336
+ tempLeft = tempLeft - (endCoords - startCoords);
337
+
338
+ if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
339
+ tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
340
+ }
341
+
342
+ if (tempLeft < 0) {
343
+ tempLeft = 0;
344
+ }
345
+
346
+ // move current slide
347
+ _this.setTranslate(tempLeft);
348
+
349
+ }
350
+ });
351
+
352
+ $(window).on('mouseup.lg.thumb', function() {
353
+ if (isMoved) {
354
+ isMoved = false;
355
+ _this.$thumbOuter.removeClass('lg-dragging');
356
+
357
+ _this.left = tempLeft;
358
+
359
+ if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
360
+ _this.thumbClickable = true;
361
+ }
362
+
363
+ } else {
364
+ _this.thumbClickable = true;
365
+ }
366
+
367
+ if (isDraging) {
368
+ isDraging = false;
369
+ _this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
370
+ }
371
+ });
372
+
373
+ };
374
+
375
+ Thumbnail.prototype.enableThumbSwipe = function() {
376
+ var _this = this;
377
+ var startCoords = 0;
378
+ var endCoords = 0;
379
+ var isMoved = false;
380
+ var tempLeft = 0;
381
+
382
+ _this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
383
+ if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
384
+ e.preventDefault();
385
+ startCoords = e.originalEvent.targetTouches[0].pageX;
386
+ _this.thumbClickable = false;
387
+ }
388
+ });
389
+
390
+ _this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
391
+ if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
392
+ e.preventDefault();
393
+ endCoords = e.originalEvent.targetTouches[0].pageX;
394
+ isMoved = true;
395
+
396
+ _this.$thumbOuter.addClass('lg-dragging');
397
+
398
+ tempLeft = _this.left;
399
+
400
+ tempLeft = tempLeft - (endCoords - startCoords);
401
+
402
+ if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
403
+ tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
404
+ }
405
+
406
+ if (tempLeft < 0) {
407
+ tempLeft = 0;
408
+ }
409
+
410
+ // move current slide
411
+ _this.setTranslate(tempLeft);
412
+
413
+ }
414
+ });
415
+
416
+ _this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
417
+ if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
418
+
419
+ if (isMoved) {
420
+ isMoved = false;
421
+ _this.$thumbOuter.removeClass('lg-dragging');
422
+ if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
423
+ _this.thumbClickable = true;
424
+ }
425
+
426
+ _this.left = tempLeft;
427
+ } else {
428
+ _this.thumbClickable = true;
429
+ }
430
+ } else {
431
+ _this.thumbClickable = true;
432
+ }
433
+ });
434
+
435
+ };
436
+
437
+ Thumbnail.prototype.toogle = function() {
438
+ var _this = this;
439
+ if (_this.core.s.toogleThumb) {
440
+ _this.core.$outer.addClass('lg-can-toggle');
441
+ _this.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>');
442
+ _this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
443
+ _this.core.$outer.toggleClass('lg-thumb-open');
444
+ });
445
+ }
446
+ };
447
+
448
+ Thumbnail.prototype.thumbkeyPress = function() {
449
+ var _this = this;
450
+ $(window).on('keydown.lg.thumb', function(e) {
451
+ if (e.keyCode === 38) {
452
+ e.preventDefault();
453
+ _this.core.$outer.addClass('lg-thumb-open');
454
+ } else if (e.keyCode === 40) {
455
+ e.preventDefault();
456
+ _this.core.$outer.removeClass('lg-thumb-open');
457
+ }
458
+ });
459
+ };
460
+
461
+ Thumbnail.prototype.destroy = function() {
462
+ if (this.core.s.thumbnail && this.core.$items.length > 1) {
463
+ $(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb');
464
+ this.$thumbOuter.remove();
465
+ this.core.$outer.removeClass('lg-has-thumb');
466
+ }
467
+ };
468
+
469
+ $.fn.lightGallery.modules.Thumbnail = Thumbnail;
470
+
471
+ })(jQuery, window, document);
472
+
473
+ }));