lightgallery 2.3.0-beta.3 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +4 -0
  2. package/angular/10/bundles/lightgallery-angular-10.umd.js +34 -1
  3. package/angular/10/bundles/lightgallery-angular-10.umd.js.map +1 -1
  4. package/angular/10/bundles/lightgallery-angular-10.umd.min.js +1 -1
  5. package/angular/10/bundles/lightgallery-angular-10.umd.min.js.map +1 -1
  6. package/angular/10/esm2015/lib/lightgallery-angular.component.js +35 -2
  7. package/angular/10/fesm2015/lightgallery-angular-10.js +34 -1
  8. package/angular/10/fesm2015/lightgallery-angular-10.js.map +1 -1
  9. package/angular/10/lib/lightgallery-angular.component.d.ts +6 -2
  10. package/angular/10/lib/lightgallery-angular.component.d.ts.map +1 -1
  11. package/angular/11/bundles/lightgallery-angular-11.umd.js +34 -1
  12. package/angular/11/bundles/lightgallery-angular-11.umd.js.map +1 -1
  13. package/angular/11/bundles/lightgallery-angular-11.umd.min.js +1 -1
  14. package/angular/11/bundles/lightgallery-angular-11.umd.min.js.map +1 -1
  15. package/angular/11/esm2015/lib/lightgallery-angular.component.js +35 -2
  16. package/angular/11/fesm2015/lightgallery-angular-11.js +34 -1
  17. package/angular/11/fesm2015/lightgallery-angular-11.js.map +1 -1
  18. package/angular/11/lib/lightgallery-angular.component.d.ts +6 -2
  19. package/angular/11/lib/lightgallery-angular.component.d.ts.map +1 -1
  20. package/angular/9/bundles/lightgallery-angular-9.umd.js +34 -1
  21. package/angular/9/bundles/lightgallery-angular-9.umd.js.map +1 -1
  22. package/angular/9/bundles/lightgallery-angular-9.umd.min.js +1 -1
  23. package/angular/9/bundles/lightgallery-angular-9.umd.min.js.map +1 -1
  24. package/angular/9/esm2015/lib/lightgallery-angular.component.js +35 -2
  25. package/angular/9/esm5/lib/lightgallery-angular.component.js +35 -2
  26. package/angular/9/fesm2015/lightgallery-angular-9.js +34 -1
  27. package/angular/9/fesm2015/lightgallery-angular-9.js.map +1 -1
  28. package/angular/9/fesm5/lightgallery-angular-9.js +34 -1
  29. package/angular/9/fesm5/lightgallery-angular-9.js.map +1 -1
  30. package/angular/9/lib/lightgallery-angular.component.d.ts +6 -2
  31. package/angular/bundles/lightgallery-angular.umd.js +34 -1
  32. package/angular/bundles/lightgallery-angular.umd.js.map +1 -1
  33. package/angular/esm2015/lib/lightgallery-angular.component.js +35 -2
  34. package/angular/fesm2015/lightgallery-angular.js +34 -1
  35. package/angular/fesm2015/lightgallery-angular.js.map +1 -1
  36. package/angular/lib/lightgallery-angular.component.d.ts +6 -2
  37. package/angular/lib/lightgallery-angular.component.d.ts.map +1 -1
  38. package/css/lightgallery-bundle.css +0 -1
  39. package/css/lightgallery-bundle.min.css +1 -1
  40. package/css/lightgallery-core.css +0 -1
  41. package/css/lightgallery.css +0 -1
  42. package/lg-events.d.ts +44 -0
  43. package/lg-settings.d.ts +30 -2
  44. package/lg-utils.d.ts +16 -4
  45. package/lib/lg-events.js +3 -0
  46. package/lib/lg-events.js.map +1 -1
  47. package/lib/lg-settings.js +12 -1
  48. package/lib/lg-settings.js.map +1 -1
  49. package/lib/lg-utils.js +4 -4
  50. package/lib/lg-utils.js.map +1 -1
  51. package/lib/lgQuery.js +29 -20
  52. package/lib/lgQuery.js.map +1 -1
  53. package/lib/lightgallery.js +30 -16
  54. package/lib/lightgallery.js.map +1 -1
  55. package/lib/plugins/autoplay/lg-autoplay-settings.js +3 -0
  56. package/lib/plugins/autoplay/lg-autoplay-settings.js.map +1 -1
  57. package/lib/plugins/autoplay/lg-autoplay.js +20 -11
  58. package/lib/plugins/autoplay/lg-autoplay.js.map +1 -1
  59. package/lib/plugins/comment/lg-comment-settings.js +3 -0
  60. package/lib/plugins/comment/lg-comment-settings.js.map +1 -1
  61. package/lib/plugins/comment/lg-comment.js +1 -1
  62. package/lib/plugins/comment/lg-comment.js.map +1 -1
  63. package/lib/plugins/fullscreen/lg-fullscreen-settings.js +3 -0
  64. package/lib/plugins/fullscreen/lg-fullscreen-settings.js.map +1 -1
  65. package/lib/plugins/fullscreen/lg-fullscreen.js +1 -2
  66. package/lib/plugins/fullscreen/lg-fullscreen.js.map +1 -1
  67. package/lib/plugins/rotate/lg-rotate-settings.js +6 -0
  68. package/lib/plugins/rotate/lg-rotate-settings.js.map +1 -1
  69. package/lib/plugins/rotate/lg-rotate.js +4 -8
  70. package/lib/plugins/rotate/lg-rotate.js.map +1 -1
  71. package/lib/plugins/share/lg-share-settings.js +1 -0
  72. package/lib/plugins/share/lg-share-settings.js.map +1 -1
  73. package/lib/plugins/share/lg-share.js +1 -1
  74. package/lib/plugins/share/lg-share.js.map +1 -1
  75. package/lib/plugins/thumbnail/lg-thumbnail-settings.js +3 -0
  76. package/lib/plugins/thumbnail/lg-thumbnail-settings.js.map +1 -1
  77. package/lib/plugins/thumbnail/lg-thumbnail.js +3 -1
  78. package/lib/plugins/thumbnail/lg-thumbnail.js.map +1 -1
  79. package/lib/plugins/zoom/lg-zoom-settings.js +5 -0
  80. package/lib/plugins/zoom/lg-zoom-settings.js.map +1 -1
  81. package/lib/plugins/zoom/lg-zoom.js +2 -2
  82. package/lib/plugins/zoom/lg-zoom.js.map +1 -1
  83. package/lightgallery.d.ts +1 -1
  84. package/lightgallery.es5.js +172 -135
  85. package/lightgallery.es5.js.map +1 -1
  86. package/lightgallery.min.js +2 -2
  87. package/lightgallery.umd.js +172 -135
  88. package/lightgallery.umd.js.map +1 -1
  89. package/lit/lightgallery.esm.js +7 -7
  90. package/lit/lightgallery.umd.js +3 -3
  91. package/package.json +1 -1
  92. package/plugins/autoplay/lg-autoplay-settings.d.ts +7 -0
  93. package/plugins/autoplay/lg-autoplay.d.ts +2 -2
  94. package/plugins/autoplay/lg-autoplay.es5.js +27 -12
  95. package/plugins/autoplay/lg-autoplay.es5.js.map +1 -1
  96. package/plugins/autoplay/lg-autoplay.min.js +2 -2
  97. package/plugins/autoplay/lg-autoplay.umd.js +27 -12
  98. package/plugins/autoplay/lg-autoplay.umd.js.map +1 -1
  99. package/plugins/comment/lg-comment-settings.d.ts +7 -0
  100. package/plugins/comment/lg-comment.es5.js +8 -2
  101. package/plugins/comment/lg-comment.es5.js.map +1 -1
  102. package/plugins/comment/lg-comment.min.js +2 -2
  103. package/plugins/comment/lg-comment.umd.js +8 -2
  104. package/plugins/comment/lg-comment.umd.js.map +1 -1
  105. package/plugins/fullscreen/lg-fullscreen-settings.d.ts +7 -0
  106. package/plugins/fullscreen/lg-fullscreen.es5.js +5 -3
  107. package/plugins/fullscreen/lg-fullscreen.es5.js.map +1 -1
  108. package/plugins/fullscreen/lg-fullscreen.min.js +2 -2
  109. package/plugins/fullscreen/lg-fullscreen.umd.js +5 -3
  110. package/plugins/fullscreen/lg-fullscreen.umd.js.map +1 -1
  111. package/plugins/hash/lg-hash.es5.js +4 -1
  112. package/plugins/hash/lg-hash.es5.js.map +1 -1
  113. package/plugins/hash/lg-hash.min.js +1 -1
  114. package/plugins/hash/lg-hash.umd.js +4 -1
  115. package/plugins/hash/lg-hash.umd.js.map +1 -1
  116. package/plugins/mediumZoom/lg-medium-zoom.es5.js +4 -1
  117. package/plugins/mediumZoom/lg-medium-zoom.es5.js.map +1 -1
  118. package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
  119. package/plugins/mediumZoom/lg-medium-zoom.umd.js +4 -1
  120. package/plugins/mediumZoom/lg-medium-zoom.umd.js.map +1 -1
  121. package/plugins/pager/lg-pager.es5.js +4 -1
  122. package/plugins/pager/lg-pager.es5.js.map +1 -1
  123. package/plugins/pager/lg-pager.min.js +1 -1
  124. package/plugins/pager/lg-pager.umd.js +4 -1
  125. package/plugins/pager/lg-pager.umd.js.map +1 -1
  126. package/plugins/relativeCaption/lg-relative-caption.es5.js +4 -1
  127. package/plugins/relativeCaption/lg-relative-caption.es5.js.map +1 -1
  128. package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
  129. package/plugins/relativeCaption/lg-relative-caption.umd.js +4 -1
  130. package/plugins/relativeCaption/lg-relative-caption.umd.js.map +1 -1
  131. package/plugins/rotate/lg-rotate-settings.d.ts +11 -0
  132. package/plugins/rotate/lg-rotate.es5.js +14 -9
  133. package/plugins/rotate/lg-rotate.es5.js.map +1 -1
  134. package/plugins/rotate/lg-rotate.min.js +2 -2
  135. package/plugins/rotate/lg-rotate.umd.js +14 -9
  136. package/plugins/rotate/lg-rotate.umd.js.map +1 -1
  137. package/plugins/share/lg-share-settings.d.ts +8 -0
  138. package/plugins/share/lg-share.es5.js +6 -2
  139. package/plugins/share/lg-share.es5.js.map +1 -1
  140. package/plugins/share/lg-share.min.js +2 -2
  141. package/plugins/share/lg-share.umd.js +6 -2
  142. package/plugins/share/lg-share.umd.js.map +1 -1
  143. package/plugins/thumbnail/lg-thumbnail-settings.d.ts +8 -0
  144. package/plugins/thumbnail/lg-thumbnail.es5.js +10 -2
  145. package/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -1
  146. package/plugins/thumbnail/lg-thumbnail.min.js +2 -2
  147. package/plugins/thumbnail/lg-thumbnail.umd.js +10 -2
  148. package/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -1
  149. package/plugins/video/lg-video.es5.js +4 -1
  150. package/plugins/video/lg-video.es5.js.map +1 -1
  151. package/plugins/video/lg-video.min.js +1 -1
  152. package/plugins/video/lg-video.umd.js +4 -1
  153. package/plugins/video/lg-video.umd.js.map +1 -1
  154. package/plugins/zoom/lg-zoom-settings.d.ts +9 -0
  155. package/plugins/zoom/lg-zoom.es5.js +11 -3
  156. package/plugins/zoom/lg-zoom.es5.js.map +1 -1
  157. package/plugins/zoom/lg-zoom.min.js +2 -2
  158. package/plugins/zoom/lg-zoom.umd.js +11 -3
  159. package/plugins/zoom/lg-zoom.umd.js.map +1 -1
  160. package/react/Lightgallery.d.ts +5 -1
  161. package/react/Lightgallery.es5.js +201 -136
  162. package/react/Lightgallery.es5.js.map +1 -1
  163. package/react/Lightgallery.umd.js +201 -136
  164. package/react/Lightgallery.umd.js.map +1 -1
  165. package/scss/lightgallery-core.scss +0 -1
  166. package/vue/LightGallery.vue.d.ts +5 -1
  167. package/vue/LightGalleryVue.common.js +314 -264
  168. package/vue/LightGalleryVue.common.js.map +1 -1
  169. package/vue/LightGalleryVue.umd.js +314 -264
  170. package/vue/LightGalleryVue.umd.js.map +1 -1
  171. package/vue/LightGalleryVue.umd.min.js +2 -2
  172. package/vue/LightGalleryVue.umd.min.js.map +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.3.0-beta.3 | October 9th 2021
2
+ * lightgallery | 2.4.0 | January 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -45,24 +45,140 @@
45
45
  return r;
46
46
  }
47
47
 
48
- (function () {
49
- if (typeof window.CustomEvent === 'function')
50
- return false;
51
- function CustomEvent(event, params) {
52
- params = params || { bubbles: false, cancelable: false, detail: null };
53
- var evt = document.createEvent('CustomEvent');
54
- evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
55
- return evt;
56
- }
57
- window.CustomEvent = CustomEvent;
58
- })();
59
- (function () {
60
- if (!Element.prototype.matches) {
61
- Element.prototype.matches =
62
- Element.prototype.msMatchesSelector ||
63
- Element.prototype.webkitMatchesSelector;
64
- }
65
- })();
48
+ /**
49
+ * List of lightGallery events
50
+ * All events should be documented here
51
+ * Below interfaces are used to build the website documentations
52
+ * */
53
+ var lGEvents = {
54
+ afterAppendSlide: 'lgAfterAppendSlide',
55
+ init: 'lgInit',
56
+ hasVideo: 'lgHasVideo',
57
+ containerResize: 'lgContainerResize',
58
+ updateSlides: 'lgUpdateSlides',
59
+ afterAppendSubHtml: 'lgAfterAppendSubHtml',
60
+ beforeOpen: 'lgBeforeOpen',
61
+ afterOpen: 'lgAfterOpen',
62
+ slideItemLoad: 'lgSlideItemLoad',
63
+ beforeSlide: 'lgBeforeSlide',
64
+ afterSlide: 'lgAfterSlide',
65
+ posterClick: 'lgPosterClick',
66
+ dragStart: 'lgDragStart',
67
+ dragMove: 'lgDragMove',
68
+ dragEnd: 'lgDragEnd',
69
+ beforeNextSlide: 'lgBeforeNextSlide',
70
+ beforePrevSlide: 'lgBeforePrevSlide',
71
+ beforeClose: 'lgBeforeClose',
72
+ afterClose: 'lgAfterClose',
73
+ rotateLeft: 'lgRotateLeft',
74
+ rotateRight: 'lgRotateRight',
75
+ flipHorizontal: 'lgFlipHorizontal',
76
+ flipVertical: 'lgFlipVertical',
77
+ autoplay: 'lgAutoplay',
78
+ autoplayStart: 'lgAutoplayStart',
79
+ autoplayStop: 'lgAutoplayStop',
80
+ };
81
+
82
+ var lightGalleryCoreSettings = {
83
+ mode: 'lg-slide',
84
+ easing: 'ease',
85
+ speed: 400,
86
+ licenseKey: '0000-0000-000-0000',
87
+ height: '100%',
88
+ width: '100%',
89
+ addClass: '',
90
+ startClass: 'lg-start-zoom',
91
+ backdropDuration: 300,
92
+ container: '',
93
+ startAnimationDuration: 400,
94
+ zoomFromOrigin: true,
95
+ hideBarsDelay: 0,
96
+ showBarsAfter: 10000,
97
+ slideDelay: 0,
98
+ supportLegacyBrowser: true,
99
+ allowMediaOverlap: false,
100
+ videoMaxSize: '1280-720',
101
+ loadYouTubePoster: true,
102
+ defaultCaptionHeight: 0,
103
+ ariaLabelledby: '',
104
+ ariaDescribedby: '',
105
+ closable: true,
106
+ swipeToClose: true,
107
+ closeOnTap: true,
108
+ showCloseIcon: true,
109
+ showMaximizeIcon: false,
110
+ loop: true,
111
+ escKey: true,
112
+ keyPress: true,
113
+ controls: true,
114
+ slideEndAnimation: true,
115
+ hideControlOnEnd: false,
116
+ mousewheel: false,
117
+ getCaptionFromTitleOrAlt: true,
118
+ appendSubHtmlTo: '.lg-sub-html',
119
+ subHtmlSelectorRelative: false,
120
+ preload: 2,
121
+ numberOfSlideItemsInDom: 10,
122
+ selector: '',
123
+ selectWithin: '',
124
+ nextHtml: '',
125
+ prevHtml: '',
126
+ index: 0,
127
+ iframeWidth: '100%',
128
+ iframeHeight: '100%',
129
+ iframeMaxWidth: '100%',
130
+ iframeMaxHeight: '100%',
131
+ download: true,
132
+ counter: true,
133
+ appendCounterTo: '.lg-toolbar',
134
+ swipeThreshold: 50,
135
+ enableSwipe: true,
136
+ enableDrag: true,
137
+ dynamic: false,
138
+ dynamicEl: [],
139
+ extraProps: [],
140
+ exThumbImage: '',
141
+ isMobile: undefined,
142
+ mobileSettings: {
143
+ controls: false,
144
+ showCloseIcon: false,
145
+ download: false,
146
+ },
147
+ plugins: [],
148
+ strings: {
149
+ closeGallery: 'Close gallery',
150
+ toggleMaximize: 'Toggle maximize',
151
+ previousSlide: 'Previous slide',
152
+ nextSlide: 'Next slide',
153
+ download: 'Download',
154
+ playVideo: 'Play video',
155
+ },
156
+ };
157
+
158
+ function initLgPolyfills() {
159
+ (function () {
160
+ if (typeof window.CustomEvent === 'function')
161
+ return false;
162
+ function CustomEvent(event, params) {
163
+ params = params || {
164
+ bubbles: false,
165
+ cancelable: false,
166
+ detail: null,
167
+ };
168
+ var evt = document.createEvent('CustomEvent');
169
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
170
+ return evt;
171
+ }
172
+ window.CustomEvent = CustomEvent;
173
+ })();
174
+ (function () {
175
+ if (!Element.prototype.matches) {
176
+ Element.prototype.matches =
177
+ Element.prototype.msMatchesSelector ||
178
+ Element.prototype.webkitMatchesSelector;
179
+ }
180
+ })();
181
+ }
66
182
  var lgQuery = /** @class */ (function () {
67
183
  function lgQuery(selector) {
68
184
  this.cssVenderPrefixes = [
@@ -296,8 +412,10 @@
296
412
  // Does not support IE
297
413
  lgQuery.prototype.load = function (url) {
298
414
  var _this = this;
299
- fetch(url).then(function (res) {
300
- _this.selector.innerHTML = res;
415
+ fetch(url)
416
+ .then(function (res) { return res.text(); })
417
+ .then(function (html) {
418
+ _this.selector.innerHTML = html;
301
419
  });
302
420
  return this;
303
421
  };
@@ -408,6 +526,7 @@
408
526
  return lgQuery;
409
527
  }());
410
528
  function $LG(selector) {
529
+ initLgPolyfills();
411
530
  return new lgQuery(selector);
412
531
  }
413
532
 
@@ -531,9 +650,9 @@
531
650
  ', 1)';
532
651
  return transform;
533
652
  },
534
- getIframeMarkup: function (iframeWidth, iframeHeight, src, iframeTitle) {
653
+ getIframeMarkup: function (iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {
535
654
  var title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
536
- return "<div class=\"lg-video-cont lg-has-iframe\" style=\"width:" + iframeWidth + "; height: " + iframeHeight + "\">\n <iframe class=\"lg-object\" frameborder=\"0\" " + title + " src=\"" + src + "\" allowfullscreen=\"true\"></iframe>\n </div>";
655
+ return "<div class=\"lg-video-cont lg-has-iframe\" style=\"width:" + iframeWidth + "; max-width:" + iframeMaxWidth + "; height: " + iframeHeight + "; max-height:" + iframeMaxHeight + "\">\n <iframe class=\"lg-object\" frameborder=\"0\" " + title + " src=\"" + src + "\" allowfullscreen=\"true\"></iframe>\n </div>";
537
656
  },
538
657
  getImgMarkup: function (index, src, altAttr, srcset, sizes, sources) {
539
658
  var srcsetAttr = srcset ? "srcset=\"" + srcset + "\"" : '';
@@ -594,7 +713,7 @@
594
713
  // No other way of checking: assume it’s ok.
595
714
  return true;
596
715
  },
597
- getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, _isVideo) {
716
+ getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, playVideoString, _isVideo) {
598
717
  var videoClass = '';
599
718
  if (_isVideo && _isVideo.youtube) {
600
719
  videoClass = 'lg-has-youtube';
@@ -605,7 +724,7 @@
605
724
  else {
606
725
  videoClass = 'lg-has-html5';
607
726
  }
608
- return "<div class=\"lg-video-cont " + videoClass + "\" style=\"" + videoContStyle + "\">\n <div class=\"lg-video-play-button\">\n <svg\n viewBox=\"0 0 20 20\"\n preserveAspectRatio=\"xMidYMid\"\n focusable=\"false\"\n aria-labelledby=\"Play video\"\n role=\"img\"\n class=\"lg-video-play-icon\"\n >\n <title>Play video</title>\n <polygon class=\"lg-video-play-icon-inner\" points=\"1,0 20,10 1,20\"></polygon>\n </svg>\n <svg class=\"lg-video-play-icon-bg\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle></svg>\n <svg class=\"lg-video-play-icon-circle\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle>\n </svg>\n </div>\n " + (dummyImg || '') + "\n <img class=\"lg-object lg-video-poster\" src=\"" + _poster + "\" />\n </div>";
727
+ return "<div class=\"lg-video-cont " + videoClass + "\" style=\"" + videoContStyle + "\">\n <div class=\"lg-video-play-button\">\n <svg\n viewBox=\"0 0 20 20\"\n preserveAspectRatio=\"xMidYMid\"\n focusable=\"false\"\n aria-labelledby=\"" + playVideoString + "\"\n role=\"img\"\n class=\"lg-video-play-icon\"\n >\n <title>" + playVideoString + "</title>\n <polygon class=\"lg-video-play-icon-inner\" points=\"1,0 20,10 1,20\"></polygon>\n </svg>\n <svg class=\"lg-video-play-icon-bg\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle></svg>\n <svg class=\"lg-video-play-icon-circle\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle>\n </svg>\n </div>\n " + (dummyImg || '') + "\n <img class=\"lg-object lg-video-poster\" src=\"" + _poster + "\" />\n </div>";
609
728
  },
610
729
  /**
611
730
  * @desc Create dynamic elements array from gallery items when dynamic option is false
@@ -693,102 +812,6 @@
693
812
  },
694
813
  };
695
814
 
696
- var lightGalleryCoreSettings = {
697
- mode: 'lg-slide',
698
- easing: 'ease',
699
- speed: 400,
700
- licenseKey: '0000-0000-000-0000',
701
- height: '100%',
702
- width: '100%',
703
- addClass: '',
704
- startClass: 'lg-start-zoom',
705
- backdropDuration: 300,
706
- container: document.body,
707
- startAnimationDuration: 400,
708
- zoomFromOrigin: true,
709
- hideBarsDelay: 0,
710
- showBarsAfter: 10000,
711
- slideDelay: 0,
712
- supportLegacyBrowser: true,
713
- allowMediaOverlap: false,
714
- videoMaxSize: '1280-720',
715
- defaultCaptionHeight: 0,
716
- ariaLabelledby: '',
717
- ariaDescribedby: '',
718
- closable: true,
719
- swipeToClose: true,
720
- closeOnTap: true,
721
- showCloseIcon: true,
722
- showMaximizeIcon: false,
723
- loop: true,
724
- escKey: true,
725
- keyPress: true,
726
- controls: true,
727
- slideEndAnimation: true,
728
- hideControlOnEnd: false,
729
- mousewheel: false,
730
- getCaptionFromTitleOrAlt: true,
731
- appendSubHtmlTo: '.lg-sub-html',
732
- subHtmlSelectorRelative: false,
733
- preload: 2,
734
- numberOfSlideItemsInDom: 10,
735
- selector: '',
736
- selectWithin: '',
737
- nextHtml: '',
738
- prevHtml: '',
739
- index: 0,
740
- iframeWidth: '100%',
741
- iframeHeight: '100%',
742
- download: true,
743
- counter: true,
744
- appendCounterTo: '.lg-toolbar',
745
- swipeThreshold: 50,
746
- enableSwipe: true,
747
- enableDrag: true,
748
- dynamic: false,
749
- dynamicEl: [],
750
- extraProps: [],
751
- exThumbImage: '',
752
- isMobile: undefined,
753
- mobileSettings: {
754
- controls: false,
755
- showCloseIcon: false,
756
- download: false,
757
- },
758
- plugins: [],
759
- };
760
-
761
- /**
762
- * List of lightGallery events
763
- * All events should be documented here
764
- * Below interfaces are used to build the website documentations
765
- * */
766
- var lGEvents = {
767
- afterAppendSlide: 'lgAfterAppendSlide',
768
- init: 'lgInit',
769
- hasVideo: 'lgHasVideo',
770
- containerResize: 'lgContainerResize',
771
- updateSlides: 'lgUpdateSlides',
772
- afterAppendSubHtml: 'lgAfterAppendSubHtml',
773
- beforeOpen: 'lgBeforeOpen',
774
- afterOpen: 'lgAfterOpen',
775
- slideItemLoad: 'lgSlideItemLoad',
776
- beforeSlide: 'lgBeforeSlide',
777
- afterSlide: 'lgAfterSlide',
778
- posterClick: 'lgPosterClick',
779
- dragStart: 'lgDragStart',
780
- dragMove: 'lgDragMove',
781
- dragEnd: 'lgDragEnd',
782
- beforeNextSlide: 'lgBeforeNextSlide',
783
- beforePrevSlide: 'lgBeforePrevSlide',
784
- beforeClose: 'lgBeforeClose',
785
- afterClose: 'lgAfterClose',
786
- rotateLeft: 'lgRotateLeft',
787
- rotateRight: 'lgRotateRight',
788
- flipHorizontal: 'lgFlipHorizontal',
789
- flipVertical: 'lgFlipVertical',
790
- };
791
-
792
815
  // @ref - https://stackoverflow.com/questions/3971841/how-to-resize-images-proportionally-keeping-the-aspect-ratio
793
816
  // @ref - https://2ality.com/2017/04/setting-up-multi-platform-packages.html
794
817
  // Unique id for each gallery
@@ -960,7 +983,7 @@
960
983
  var subHtmlCont = '';
961
984
  // Create controls
962
985
  if (this.settings.controls) {
963
- controls = "<button type=\"button\" id=\"" + this.getIdName('lg-prev') + "\" aria-label=\"Previous slide\" class=\"lg-prev lg-icon\"> " + this.settings.prevHtml + " </button>\n <button type=\"button\" id=\"" + this.getIdName('lg-next') + "\" aria-label=\"Next slide\" class=\"lg-next lg-icon\"> " + this.settings.nextHtml + " </button>";
986
+ controls = "<button type=\"button\" id=\"" + this.getIdName('lg-prev') + "\" aria-label=\"" + this.settings.strings['previousSlide'] + "\" class=\"lg-prev lg-icon\"> " + this.settings.prevHtml + " </button>\n <button type=\"button\" id=\"" + this.getIdName('lg-next') + "\" aria-label=\"" + this.settings.strings['nextSlide'] + "\" class=\"lg-next lg-icon\"> " + this.settings.nextHtml + " </button>";
964
987
  }
965
988
  if (this.settings.appendSubHtmlTo !== '.lg-item') {
966
989
  subHtmlCont =
@@ -979,19 +1002,20 @@
979
1002
  : '';
980
1003
  var containerClassName = "lg-container " + this.settings.addClass + " " + (document.body !== this.settings.container ? 'lg-inline' : '');
981
1004
  var closeIcon = this.settings.closable && this.settings.showCloseIcon
982
- ? "<button type=\"button\" aria-label=\"Close gallery\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
1005
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['closeGallery'] + "\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
983
1006
  : '';
984
1007
  var maximizeIcon = this.settings.showMaximizeIcon
985
- ? "<button type=\"button\" aria-label=\"Toggle maximize\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
1008
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['toggleMaximize'] + "\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
986
1009
  : '';
987
1010
  var template = "\n <div class=\"" + containerClassName + "\" id=\"" + this.getIdName('lg-container') + "\" tabindex=\"-1\" aria-modal=\"true\" " + ariaLabelledby + " " + ariaDescribedby + " role=\"dialog\"\n >\n <div id=\"" + this.getIdName('lg-backdrop') + "\" class=\"lg-backdrop\"></div>\n\n <div id=\"" + this.getIdName('lg-outer') + "\" class=\"lg-outer lg-use-css3 lg-css3 lg-hide-items " + addClasses + " \">\n\n <div id=\"" + this.getIdName('lg-content') + "\" class=\"lg-content\">\n <div id=\"" + this.getIdName('lg-inner') + "\" class=\"lg-inner\">\n </div>\n " + controls + "\n </div>\n <div id=\"" + this.getIdName('lg-toolbar') + "\" class=\"lg-toolbar lg-group\">\n " + maximizeIcon + "\n " + closeIcon + "\n </div>\n " + (this.settings.appendSubHtmlTo === '.lg-outer'
988
1011
  ? subHtmlCont
989
1012
  : '') + "\n <div id=\"" + this.getIdName('lg-components') + "\" class=\"lg-components\">\n " + (this.settings.appendSubHtmlTo === '.lg-sub-html'
990
1013
  ? subHtmlCont
991
1014
  : '') + "\n </div>\n </div>\n </div>\n ";
992
- $LG(this.settings.container)
993
- .css('position', 'relative')
994
- .append(template);
1015
+ $LG(this.settings.container).append(template);
1016
+ if (document.body !== this.settings.container) {
1017
+ $LG(this.settings.container).css('position', 'relative');
1018
+ }
995
1019
  this.outer = this.getElementById('lg-outer');
996
1020
  this.$lgComponents = this.getElementById('lg-components');
997
1021
  this.$backdrop = this.getElementById('lg-backdrop');
@@ -1009,7 +1033,7 @@
1009
1033
  this.$inner.css('transition-timing-function', this.settings.easing);
1010
1034
  this.$inner.css('transition-duration', this.settings.speed + 'ms');
1011
1035
  if (this.settings.download) {
1012
- this.$toolbar.append("<a id=\"" + this.getIdName('lg-download') + "\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download\" download class=\"lg-download lg-icon\"></a>");
1036
+ this.$toolbar.append("<a id=\"" + this.getIdName('lg-download') + "\" target=\"_blank\" rel=\"noopener\" aria-label=\"" + this.settings.strings['download'] + "\" download class=\"lg-download lg-icon\"></a>");
1013
1037
  }
1014
1038
  this.counter();
1015
1039
  $LG(window).on("resize.lg.global" + this.lgId + " orientationchange.lg.global" + this.lgId, function () {
@@ -1528,8 +1552,15 @@
1528
1552
  };
1529
1553
  // Add video slideInfo
1530
1554
  LightGallery.prototype.addSlideVideoInfo = function (items) {
1555
+ var _this = this;
1531
1556
  items.forEach(function (element, index) {
1532
1557
  element.__slideVideoInfo = utils.isVideo(element.src, !!element.video, index);
1558
+ if (element.__slideVideoInfo &&
1559
+ _this.settings.loadYouTubePoster &&
1560
+ !element.poster &&
1561
+ element.__slideVideoInfo.youtube) {
1562
+ element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/maxresdefault.jpg";
1563
+ }
1533
1564
  });
1534
1565
  };
1535
1566
  /**
@@ -1571,7 +1602,7 @@
1571
1602
  lgVideoStyle = this.getVideoContStyle(videoSize);
1572
1603
  }
1573
1604
  if (iframe) {
1574
- var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, src, currentGalleryItem.iframeTitle);
1605
+ var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);
1575
1606
  $currentSlide.prepend(markup);
1576
1607
  }
1577
1608
  else if (poster) {
@@ -1582,7 +1613,7 @@
1582
1613
  if (hasStartAnimation) {
1583
1614
  dummyImg = this.getDummyImageContent($currentSlide, index, '');
1584
1615
  }
1585
- var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, videoInfo);
1616
+ var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, this.settings.strings['playVideo'], videoInfo);
1586
1617
  $currentSlide.prepend(markup);
1587
1618
  }
1588
1619
  else if (videoInfo) {
@@ -2365,17 +2396,23 @@
2365
2396
  };
2366
2397
  LightGallery.prototype.mousewheel = function () {
2367
2398
  var _this = this;
2368
- this.outer.on('mousewheel.lg', function (e) {
2399
+ var lastCall = 0;
2400
+ this.outer.on('wheel.lg', function (e) {
2369
2401
  if (!e.deltaY || _this.galleryItems.length < 2) {
2370
2402
  return;
2371
2403
  }
2372
- if (e.deltaY > 0) {
2373
- _this.goToPrevSlide();
2404
+ e.preventDefault();
2405
+ var now = new Date().getTime();
2406
+ if (now - lastCall < 1000) {
2407
+ return;
2374
2408
  }
2375
- else {
2409
+ lastCall = now;
2410
+ if (e.deltaY > 0) {
2376
2411
  _this.goToNextSlide();
2377
2412
  }
2378
- e.preventDefault();
2413
+ else if (e.deltaY < 0) {
2414
+ _this.goToPrevSlide();
2415
+ }
2379
2416
  });
2380
2417
  };
2381
2418
  LightGallery.prototype.isSlideElement = function (target) {