lightgallery 2.3.0-beta.2 → 2.4.0-beta.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 (173) 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 +19 -27
  39. package/css/lightgallery-bundle.min.css +1 -1
  40. package/css/lightgallery-core.css +0 -20
  41. package/css/lightgallery.css +19 -27
  42. package/lg-events.d.ts +44 -0
  43. package/lg-settings.d.ts +20 -8
  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 -2
  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 +31 -20
  52. package/lib/lgQuery.js.map +1 -1
  53. package/lib/lightgallery.js +30 -19
  54. package/lib/lightgallery.js.map +1 -1
  55. package/lib/plugins/autoplay/lg-autoplay-settings.js +1 -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 +1 -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 +1 -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 +1 -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 +174 -139
  85. package/lightgallery.es5.js.map +1 -1
  86. package/lightgallery.min.js +2 -2
  87. package/lightgallery.umd.js +174 -139
  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 +6 -0
  93. package/plugins/autoplay/lg-autoplay.d.ts +2 -2
  94. package/plugins/autoplay/lg-autoplay.es5.js +25 -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 +25 -12
  98. package/plugins/autoplay/lg-autoplay.umd.js.map +1 -1
  99. package/plugins/comment/lg-comment-settings.d.ts +6 -0
  100. package/plugins/comment/lg-comment.es5.js +6 -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 +6 -2
  104. package/plugins/comment/lg-comment.umd.js.map +1 -1
  105. package/plugins/fullscreen/lg-fullscreen-settings.d.ts +6 -0
  106. package/plugins/fullscreen/lg-fullscreen.es5.js +3 -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 +3 -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 +12 -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 +9 -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 +6 -0
  144. package/plugins/thumbnail/lg-thumbnail.es5.js +8 -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 +8 -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 +6 -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 +203 -140
  162. package/react/Lightgallery.es5.js.map +1 -1
  163. package/react/Lightgallery.umd.js +203 -140
  164. package/react/Lightgallery.umd.js.map +1 -1
  165. package/scss/_lg-theme-default.scss +17 -10
  166. package/scss/lightgallery-core.scss +0 -25
  167. package/vue/LightGallery.vue.d.ts +5 -1
  168. package/vue/LightGalleryVue.common.js +317 -270
  169. package/vue/LightGalleryVue.common.js.map +1 -1
  170. package/vue/LightGalleryVue.umd.js +317 -270
  171. package/vue/LightGalleryVue.umd.js.map +1 -1
  172. package/vue/LightGalleryVue.umd.min.js +2 -2
  173. package/vue/LightGalleryVue.umd.min.js.map +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.3.0-beta.2 | September 28th 2021
2
+ * lightgallery | 2.4.0-beta.0 | December 12th 2021
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 = [
@@ -195,7 +311,9 @@
195
311
  this._each(function (el) {
196
312
  // IE doesn't support multiple arguments
197
313
  classNames.split(' ').forEach(function (className) {
198
- el.classList.add(className);
314
+ if (className) {
315
+ el.classList.add(className);
316
+ }
199
317
  });
200
318
  });
201
319
  return this;
@@ -204,7 +322,9 @@
204
322
  this._each(function (el) {
205
323
  // IE doesn't support multiple arguments
206
324
  classNames.split(' ').forEach(function (className) {
207
- el.classList.remove(className);
325
+ if (className) {
326
+ el.classList.remove(className);
327
+ }
208
328
  });
209
329
  });
210
330
  return this;
@@ -404,6 +524,7 @@
404
524
  return lgQuery;
405
525
  }());
406
526
  function $LG(selector) {
527
+ initLgPolyfills();
407
528
  return new lgQuery(selector);
408
529
  }
409
530
 
@@ -527,9 +648,9 @@
527
648
  ', 1)';
528
649
  return transform;
529
650
  },
530
- getIframeMarkup: function (iframeWidth, iframeHeight, src, iframeTitle) {
651
+ getIframeMarkup: function (iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {
531
652
  var title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
532
- 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>";
653
+ 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>";
533
654
  },
534
655
  getImgMarkup: function (index, src, altAttr, srcset, sizes, sources) {
535
656
  var srcsetAttr = srcset ? "srcset=\"" + srcset + "\"" : '';
@@ -590,7 +711,7 @@
590
711
  // No other way of checking: assume it’s ok.
591
712
  return true;
592
713
  },
593
- getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, _isVideo) {
714
+ getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, playVideoString, _isVideo) {
594
715
  var videoClass = '';
595
716
  if (_isVideo && _isVideo.youtube) {
596
717
  videoClass = 'lg-has-youtube';
@@ -601,7 +722,7 @@
601
722
  else {
602
723
  videoClass = 'lg-has-html5';
603
724
  }
604
- 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>";
725
+ 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>";
605
726
  },
606
727
  /**
607
728
  * @desc Create dynamic elements array from gallery items when dynamic option is false
@@ -689,103 +810,6 @@
689
810
  },
690
811
  };
691
812
 
692
- var lightGalleryCoreSettings = {
693
- mode: 'lg-slide',
694
- easing: 'ease',
695
- speed: 400,
696
- licenseKey: '0000-0000-000-0000',
697
- height: '100%',
698
- width: '100%',
699
- addClass: '',
700
- startClass: 'lg-start-zoom',
701
- backdropDuration: 300,
702
- container: document.body,
703
- startAnimationDuration: 400,
704
- zoomFromOrigin: true,
705
- hideBarsDelay: 0,
706
- showBarsAfter: 10000,
707
- slideDelay: 0,
708
- supportLegacyBrowser: true,
709
- allowMediaOverlap: false,
710
- videoMaxSize: '1280-720',
711
- defaultCaptionHeight: 0,
712
- ariaLabelledby: '',
713
- ariaDescribedby: '',
714
- closable: true,
715
- swipeToClose: true,
716
- closeOnTap: true,
717
- showCloseIcon: true,
718
- showMaximizeIcon: false,
719
- loop: true,
720
- escKey: true,
721
- keyPress: true,
722
- controls: true,
723
- slideEndAnimation: true,
724
- hideControlOnEnd: false,
725
- mousewheel: false,
726
- getCaptionFromTitleOrAlt: true,
727
- appendSubHtmlTo: '.lg-sub-html',
728
- subHtmlSelectorRelative: false,
729
- preload: 2,
730
- numberOfSlideItemsInDom: 10,
731
- showAfterLoad: true,
732
- selector: '',
733
- selectWithin: '',
734
- nextHtml: '',
735
- prevHtml: '',
736
- index: 0,
737
- iframeWidth: '100%',
738
- iframeHeight: '100%',
739
- download: true,
740
- counter: true,
741
- appendCounterTo: '.lg-toolbar',
742
- swipeThreshold: 50,
743
- enableSwipe: true,
744
- enableDrag: true,
745
- dynamic: false,
746
- dynamicEl: [],
747
- extraProps: [],
748
- exThumbImage: '',
749
- isMobile: undefined,
750
- mobileSettings: {
751
- controls: false,
752
- showCloseIcon: false,
753
- download: false,
754
- },
755
- plugins: [],
756
- };
757
-
758
- /**
759
- * List of lightGallery events
760
- * All events should be documented here
761
- * Below interfaces are used to build the website documentations
762
- * */
763
- var lGEvents = {
764
- afterAppendSlide: 'lgAfterAppendSlide',
765
- init: 'lgInit',
766
- hasVideo: 'lgHasVideo',
767
- containerResize: 'lgContainerResize',
768
- updateSlides: 'lgUpdateSlides',
769
- afterAppendSubHtml: 'lgAfterAppendSubHtml',
770
- beforeOpen: 'lgBeforeOpen',
771
- afterOpen: 'lgAfterOpen',
772
- slideItemLoad: 'lgSlideItemLoad',
773
- beforeSlide: 'lgBeforeSlide',
774
- afterSlide: 'lgAfterSlide',
775
- posterClick: 'lgPosterClick',
776
- dragStart: 'lgDragStart',
777
- dragMove: 'lgDragMove',
778
- dragEnd: 'lgDragEnd',
779
- beforeNextSlide: 'lgBeforeNextSlide',
780
- beforePrevSlide: 'lgBeforePrevSlide',
781
- beforeClose: 'lgBeforeClose',
782
- afterClose: 'lgAfterClose',
783
- rotateLeft: 'lgRotateLeft',
784
- rotateRight: 'lgRotateRight',
785
- flipHorizontal: 'lgFlipHorizontal',
786
- flipVertical: 'lgFlipVertical',
787
- };
788
-
789
813
  // @ref - https://stackoverflow.com/questions/3971841/how-to-resize-images-proportionally-keeping-the-aspect-ratio
790
814
  // @ref - https://2ality.com/2017/04/setting-up-multi-platform-packages.html
791
815
  // Unique id for each gallery
@@ -957,7 +981,7 @@
957
981
  var subHtmlCont = '';
958
982
  // Create controls
959
983
  if (this.settings.controls) {
960
- 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>";
984
+ 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>";
961
985
  }
962
986
  if (this.settings.appendSubHtmlTo !== '.lg-item') {
963
987
  subHtmlCont =
@@ -976,19 +1000,20 @@
976
1000
  : '';
977
1001
  var containerClassName = "lg-container " + this.settings.addClass + " " + (document.body !== this.settings.container ? 'lg-inline' : '');
978
1002
  var closeIcon = this.settings.closable && this.settings.showCloseIcon
979
- ? "<button type=\"button\" aria-label=\"Close gallery\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
1003
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['closeGallery'] + "\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
980
1004
  : '';
981
1005
  var maximizeIcon = this.settings.showMaximizeIcon
982
- ? "<button type=\"button\" aria-label=\"Toggle maximize\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
1006
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['toggleMaximize'] + "\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
983
1007
  : '';
984
1008
  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'
985
1009
  ? subHtmlCont
986
1010
  : '') + "\n <div id=\"" + this.getIdName('lg-components') + "\" class=\"lg-components\">\n " + (this.settings.appendSubHtmlTo === '.lg-sub-html'
987
1011
  ? subHtmlCont
988
1012
  : '') + "\n </div>\n </div>\n </div>\n ";
989
- $LG(this.settings.container)
990
- .css('position', 'relative')
991
- .append(template);
1013
+ $LG(this.settings.container).append(template);
1014
+ if (document.body !== this.settings.container) {
1015
+ $LG(this.settings.container).css('position', 'relative');
1016
+ }
992
1017
  this.outer = this.getElementById('lg-outer');
993
1018
  this.$lgComponents = this.getElementById('lg-components');
994
1019
  this.$backdrop = this.getElementById('lg-backdrop');
@@ -1002,14 +1027,11 @@
1002
1027
  if (this.settings.enableDrag) {
1003
1028
  outerClassNames += 'lg-grab ';
1004
1029
  }
1005
- if (this.settings.showAfterLoad) {
1006
- outerClassNames += 'lg-show-after-load';
1007
- }
1008
1030
  this.outer.addClass(outerClassNames);
1009
1031
  this.$inner.css('transition-timing-function', this.settings.easing);
1010
1032
  this.$inner.css('transition-duration', this.settings.speed + 'ms');
1011
1033
  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>");
1034
+ 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
1035
  }
1014
1036
  this.counter();
1015
1037
  $LG(window).on("resize.lg.global" + this.lgId + " orientationchange.lg.global" + this.lgId, function () {
@@ -1528,8 +1550,15 @@
1528
1550
  };
1529
1551
  // Add video slideInfo
1530
1552
  LightGallery.prototype.addSlideVideoInfo = function (items) {
1553
+ var _this = this;
1531
1554
  items.forEach(function (element, index) {
1532
1555
  element.__slideVideoInfo = utils.isVideo(element.src, !!element.video, index);
1556
+ if (element.__slideVideoInfo &&
1557
+ _this.settings.loadYouTubePoster &&
1558
+ !element.poster &&
1559
+ element.__slideVideoInfo.youtube) {
1560
+ element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/maxresdefault.jpg";
1561
+ }
1533
1562
  });
1534
1563
  };
1535
1564
  /**
@@ -1571,7 +1600,7 @@
1571
1600
  lgVideoStyle = this.getVideoContStyle(videoSize);
1572
1601
  }
1573
1602
  if (iframe) {
1574
- var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, src, currentGalleryItem.iframeTitle);
1603
+ var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);
1575
1604
  $currentSlide.prepend(markup);
1576
1605
  }
1577
1606
  else if (poster) {
@@ -1582,7 +1611,7 @@
1582
1611
  if (hasStartAnimation) {
1583
1612
  dummyImg = this.getDummyImageContent($currentSlide, index, '');
1584
1613
  }
1585
- var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, videoInfo);
1614
+ var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, this.settings.strings['playVideo'], videoInfo);
1586
1615
  $currentSlide.prepend(markup);
1587
1616
  }
1588
1617
  else if (videoInfo) {
@@ -2365,17 +2394,23 @@
2365
2394
  };
2366
2395
  LightGallery.prototype.mousewheel = function () {
2367
2396
  var _this = this;
2368
- this.outer.on('mousewheel.lg', function (e) {
2397
+ var lastCall = 0;
2398
+ this.outer.on('wheel.lg', function (e) {
2369
2399
  if (!e.deltaY || _this.galleryItems.length < 2) {
2370
2400
  return;
2371
2401
  }
2372
- if (e.deltaY > 0) {
2373
- _this.goToPrevSlide();
2402
+ e.preventDefault();
2403
+ var now = new Date().getTime();
2404
+ if (now - lastCall < 1000) {
2405
+ return;
2374
2406
  }
2375
- else {
2407
+ lastCall = now;
2408
+ if (e.deltaY > 0) {
2376
2409
  _this.goToNextSlide();
2377
2410
  }
2378
- e.preventDefault();
2411
+ else if (e.deltaY < 0) {
2412
+ _this.goToPrevSlide();
2413
+ }
2379
2414
  });
2380
2415
  };
2381
2416
  LightGallery.prototype.isSlideElement = function (target) {