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
@@ -39,24 +39,140 @@ function __spreadArrays() {
39
39
  return r;
40
40
  }
41
41
 
42
- (function () {
43
- if (typeof window.CustomEvent === 'function')
44
- return false;
45
- function CustomEvent(event, params) {
46
- params = params || { bubbles: false, cancelable: false, detail: null };
47
- var evt = document.createEvent('CustomEvent');
48
- evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
49
- return evt;
50
- }
51
- window.CustomEvent = CustomEvent;
52
- })();
53
- (function () {
54
- if (!Element.prototype.matches) {
55
- Element.prototype.matches =
56
- Element.prototype.msMatchesSelector ||
57
- Element.prototype.webkitMatchesSelector;
58
- }
59
- })();
42
+ /**
43
+ * List of lightGallery events
44
+ * All events should be documented here
45
+ * Below interfaces are used to build the website documentations
46
+ * */
47
+ var lGEvents = {
48
+ afterAppendSlide: 'lgAfterAppendSlide',
49
+ init: 'lgInit',
50
+ hasVideo: 'lgHasVideo',
51
+ containerResize: 'lgContainerResize',
52
+ updateSlides: 'lgUpdateSlides',
53
+ afterAppendSubHtml: 'lgAfterAppendSubHtml',
54
+ beforeOpen: 'lgBeforeOpen',
55
+ afterOpen: 'lgAfterOpen',
56
+ slideItemLoad: 'lgSlideItemLoad',
57
+ beforeSlide: 'lgBeforeSlide',
58
+ afterSlide: 'lgAfterSlide',
59
+ posterClick: 'lgPosterClick',
60
+ dragStart: 'lgDragStart',
61
+ dragMove: 'lgDragMove',
62
+ dragEnd: 'lgDragEnd',
63
+ beforeNextSlide: 'lgBeforeNextSlide',
64
+ beforePrevSlide: 'lgBeforePrevSlide',
65
+ beforeClose: 'lgBeforeClose',
66
+ afterClose: 'lgAfterClose',
67
+ rotateLeft: 'lgRotateLeft',
68
+ rotateRight: 'lgRotateRight',
69
+ flipHorizontal: 'lgFlipHorizontal',
70
+ flipVertical: 'lgFlipVertical',
71
+ autoplay: 'lgAutoplay',
72
+ autoplayStart: 'lgAutoplayStart',
73
+ autoplayStop: 'lgAutoplayStop',
74
+ };
75
+
76
+ var lightGalleryCoreSettings = {
77
+ mode: 'lg-slide',
78
+ easing: 'ease',
79
+ speed: 400,
80
+ licenseKey: '0000-0000-000-0000',
81
+ height: '100%',
82
+ width: '100%',
83
+ addClass: '',
84
+ startClass: 'lg-start-zoom',
85
+ backdropDuration: 300,
86
+ container: '',
87
+ startAnimationDuration: 400,
88
+ zoomFromOrigin: true,
89
+ hideBarsDelay: 0,
90
+ showBarsAfter: 10000,
91
+ slideDelay: 0,
92
+ supportLegacyBrowser: true,
93
+ allowMediaOverlap: false,
94
+ videoMaxSize: '1280-720',
95
+ loadYouTubePoster: true,
96
+ defaultCaptionHeight: 0,
97
+ ariaLabelledby: '',
98
+ ariaDescribedby: '',
99
+ closable: true,
100
+ swipeToClose: true,
101
+ closeOnTap: true,
102
+ showCloseIcon: true,
103
+ showMaximizeIcon: false,
104
+ loop: true,
105
+ escKey: true,
106
+ keyPress: true,
107
+ controls: true,
108
+ slideEndAnimation: true,
109
+ hideControlOnEnd: false,
110
+ mousewheel: false,
111
+ getCaptionFromTitleOrAlt: true,
112
+ appendSubHtmlTo: '.lg-sub-html',
113
+ subHtmlSelectorRelative: false,
114
+ preload: 2,
115
+ numberOfSlideItemsInDom: 10,
116
+ selector: '',
117
+ selectWithin: '',
118
+ nextHtml: '',
119
+ prevHtml: '',
120
+ index: 0,
121
+ iframeWidth: '100%',
122
+ iframeHeight: '100%',
123
+ iframeMaxWidth: '100%',
124
+ iframeMaxHeight: '100%',
125
+ download: true,
126
+ counter: true,
127
+ appendCounterTo: '.lg-toolbar',
128
+ swipeThreshold: 50,
129
+ enableSwipe: true,
130
+ enableDrag: true,
131
+ dynamic: false,
132
+ dynamicEl: [],
133
+ extraProps: [],
134
+ exThumbImage: '',
135
+ isMobile: undefined,
136
+ mobileSettings: {
137
+ controls: false,
138
+ showCloseIcon: false,
139
+ download: false,
140
+ },
141
+ plugins: [],
142
+ strings: {
143
+ closeGallery: 'Close gallery',
144
+ toggleMaximize: 'Toggle maximize',
145
+ previousSlide: 'Previous slide',
146
+ nextSlide: 'Next slide',
147
+ download: 'Download',
148
+ playVideo: 'Play video',
149
+ },
150
+ };
151
+
152
+ function initLgPolyfills() {
153
+ (function () {
154
+ if (typeof window.CustomEvent === 'function')
155
+ return false;
156
+ function CustomEvent(event, params) {
157
+ params = params || {
158
+ bubbles: false,
159
+ cancelable: false,
160
+ detail: null,
161
+ };
162
+ var evt = document.createEvent('CustomEvent');
163
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
164
+ return evt;
165
+ }
166
+ window.CustomEvent = CustomEvent;
167
+ })();
168
+ (function () {
169
+ if (!Element.prototype.matches) {
170
+ Element.prototype.matches =
171
+ Element.prototype.msMatchesSelector ||
172
+ Element.prototype.webkitMatchesSelector;
173
+ }
174
+ })();
175
+ }
60
176
  var lgQuery = /** @class */ (function () {
61
177
  function lgQuery(selector) {
62
178
  this.cssVenderPrefixes = [
@@ -290,8 +406,10 @@ var lgQuery = /** @class */ (function () {
290
406
  // Does not support IE
291
407
  lgQuery.prototype.load = function (url) {
292
408
  var _this = this;
293
- fetch(url).then(function (res) {
294
- _this.selector.innerHTML = res;
409
+ fetch(url)
410
+ .then(function (res) { return res.text(); })
411
+ .then(function (html) {
412
+ _this.selector.innerHTML = html;
295
413
  });
296
414
  return this;
297
415
  };
@@ -402,6 +520,7 @@ var lgQuery = /** @class */ (function () {
402
520
  return lgQuery;
403
521
  }());
404
522
  function $LG(selector) {
523
+ initLgPolyfills();
405
524
  return new lgQuery(selector);
406
525
  }
407
526
 
@@ -525,9 +644,9 @@ var utils = {
525
644
  ', 1)';
526
645
  return transform;
527
646
  },
528
- getIframeMarkup: function (iframeWidth, iframeHeight, src, iframeTitle) {
647
+ getIframeMarkup: function (iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {
529
648
  var title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
530
- 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>";
649
+ 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>";
531
650
  },
532
651
  getImgMarkup: function (index, src, altAttr, srcset, sizes, sources) {
533
652
  var srcsetAttr = srcset ? "srcset=\"" + srcset + "\"" : '';
@@ -588,7 +707,7 @@ var utils = {
588
707
  // No other way of checking: assume it’s ok.
589
708
  return true;
590
709
  },
591
- getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, _isVideo) {
710
+ getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, playVideoString, _isVideo) {
592
711
  var videoClass = '';
593
712
  if (_isVideo && _isVideo.youtube) {
594
713
  videoClass = 'lg-has-youtube';
@@ -599,7 +718,7 @@ var utils = {
599
718
  else {
600
719
  videoClass = 'lg-has-html5';
601
720
  }
602
- 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>";
721
+ 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>";
603
722
  },
604
723
  /**
605
724
  * @desc Create dynamic elements array from gallery items when dynamic option is false
@@ -687,102 +806,6 @@ var utils = {
687
806
  },
688
807
  };
689
808
 
690
- var lightGalleryCoreSettings = {
691
- mode: 'lg-slide',
692
- easing: 'ease',
693
- speed: 400,
694
- licenseKey: '0000-0000-000-0000',
695
- height: '100%',
696
- width: '100%',
697
- addClass: '',
698
- startClass: 'lg-start-zoom',
699
- backdropDuration: 300,
700
- container: document.body,
701
- startAnimationDuration: 400,
702
- zoomFromOrigin: true,
703
- hideBarsDelay: 0,
704
- showBarsAfter: 10000,
705
- slideDelay: 0,
706
- supportLegacyBrowser: true,
707
- allowMediaOverlap: false,
708
- videoMaxSize: '1280-720',
709
- defaultCaptionHeight: 0,
710
- ariaLabelledby: '',
711
- ariaDescribedby: '',
712
- closable: true,
713
- swipeToClose: true,
714
- closeOnTap: true,
715
- showCloseIcon: true,
716
- showMaximizeIcon: false,
717
- loop: true,
718
- escKey: true,
719
- keyPress: true,
720
- controls: true,
721
- slideEndAnimation: true,
722
- hideControlOnEnd: false,
723
- mousewheel: false,
724
- getCaptionFromTitleOrAlt: true,
725
- appendSubHtmlTo: '.lg-sub-html',
726
- subHtmlSelectorRelative: false,
727
- preload: 2,
728
- numberOfSlideItemsInDom: 10,
729
- selector: '',
730
- selectWithin: '',
731
- nextHtml: '',
732
- prevHtml: '',
733
- index: 0,
734
- iframeWidth: '100%',
735
- iframeHeight: '100%',
736
- download: true,
737
- counter: true,
738
- appendCounterTo: '.lg-toolbar',
739
- swipeThreshold: 50,
740
- enableSwipe: true,
741
- enableDrag: true,
742
- dynamic: false,
743
- dynamicEl: [],
744
- extraProps: [],
745
- exThumbImage: '',
746
- isMobile: undefined,
747
- mobileSettings: {
748
- controls: false,
749
- showCloseIcon: false,
750
- download: false,
751
- },
752
- plugins: [],
753
- };
754
-
755
- /**
756
- * List of lightGallery events
757
- * All events should be documented here
758
- * Below interfaces are used to build the website documentations
759
- * */
760
- var lGEvents = {
761
- afterAppendSlide: 'lgAfterAppendSlide',
762
- init: 'lgInit',
763
- hasVideo: 'lgHasVideo',
764
- containerResize: 'lgContainerResize',
765
- updateSlides: 'lgUpdateSlides',
766
- afterAppendSubHtml: 'lgAfterAppendSubHtml',
767
- beforeOpen: 'lgBeforeOpen',
768
- afterOpen: 'lgAfterOpen',
769
- slideItemLoad: 'lgSlideItemLoad',
770
- beforeSlide: 'lgBeforeSlide',
771
- afterSlide: 'lgAfterSlide',
772
- posterClick: 'lgPosterClick',
773
- dragStart: 'lgDragStart',
774
- dragMove: 'lgDragMove',
775
- dragEnd: 'lgDragEnd',
776
- beforeNextSlide: 'lgBeforeNextSlide',
777
- beforePrevSlide: 'lgBeforePrevSlide',
778
- beforeClose: 'lgBeforeClose',
779
- afterClose: 'lgAfterClose',
780
- rotateLeft: 'lgRotateLeft',
781
- rotateRight: 'lgRotateRight',
782
- flipHorizontal: 'lgFlipHorizontal',
783
- flipVertical: 'lgFlipVertical',
784
- };
785
-
786
809
  // @ref - https://stackoverflow.com/questions/3971841/how-to-resize-images-proportionally-keeping-the-aspect-ratio
787
810
  // @ref - https://2ality.com/2017/04/setting-up-multi-platform-packages.html
788
811
  // Unique id for each gallery
@@ -954,7 +977,7 @@ var LightGallery = /** @class */ (function () {
954
977
  var subHtmlCont = '';
955
978
  // Create controls
956
979
  if (this.settings.controls) {
957
- 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>";
980
+ 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>";
958
981
  }
959
982
  if (this.settings.appendSubHtmlTo !== '.lg-item') {
960
983
  subHtmlCont =
@@ -973,19 +996,20 @@ var LightGallery = /** @class */ (function () {
973
996
  : '';
974
997
  var containerClassName = "lg-container " + this.settings.addClass + " " + (document.body !== this.settings.container ? 'lg-inline' : '');
975
998
  var closeIcon = this.settings.closable && this.settings.showCloseIcon
976
- ? "<button type=\"button\" aria-label=\"Close gallery\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
999
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['closeGallery'] + "\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
977
1000
  : '';
978
1001
  var maximizeIcon = this.settings.showMaximizeIcon
979
- ? "<button type=\"button\" aria-label=\"Toggle maximize\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
1002
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['toggleMaximize'] + "\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
980
1003
  : '';
981
1004
  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'
982
1005
  ? subHtmlCont
983
1006
  : '') + "\n <div id=\"" + this.getIdName('lg-components') + "\" class=\"lg-components\">\n " + (this.settings.appendSubHtmlTo === '.lg-sub-html'
984
1007
  ? subHtmlCont
985
1008
  : '') + "\n </div>\n </div>\n </div>\n ";
986
- $LG(this.settings.container)
987
- .css('position', 'relative')
988
- .append(template);
1009
+ $LG(this.settings.container).append(template);
1010
+ if (document.body !== this.settings.container) {
1011
+ $LG(this.settings.container).css('position', 'relative');
1012
+ }
989
1013
  this.outer = this.getElementById('lg-outer');
990
1014
  this.$lgComponents = this.getElementById('lg-components');
991
1015
  this.$backdrop = this.getElementById('lg-backdrop');
@@ -1003,7 +1027,7 @@ var LightGallery = /** @class */ (function () {
1003
1027
  this.$inner.css('transition-timing-function', this.settings.easing);
1004
1028
  this.$inner.css('transition-duration', this.settings.speed + 'ms');
1005
1029
  if (this.settings.download) {
1006
- this.$toolbar.append("<a id=\"" + this.getIdName('lg-download') + "\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download\" download class=\"lg-download lg-icon\"></a>");
1030
+ 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>");
1007
1031
  }
1008
1032
  this.counter();
1009
1033
  $LG(window).on("resize.lg.global" + this.lgId + " orientationchange.lg.global" + this.lgId, function () {
@@ -1522,8 +1546,15 @@ var LightGallery = /** @class */ (function () {
1522
1546
  };
1523
1547
  // Add video slideInfo
1524
1548
  LightGallery.prototype.addSlideVideoInfo = function (items) {
1549
+ var _this = this;
1525
1550
  items.forEach(function (element, index) {
1526
1551
  element.__slideVideoInfo = utils.isVideo(element.src, !!element.video, index);
1552
+ if (element.__slideVideoInfo &&
1553
+ _this.settings.loadYouTubePoster &&
1554
+ !element.poster &&
1555
+ element.__slideVideoInfo.youtube) {
1556
+ element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/maxresdefault.jpg";
1557
+ }
1527
1558
  });
1528
1559
  };
1529
1560
  /**
@@ -1565,7 +1596,7 @@ var LightGallery = /** @class */ (function () {
1565
1596
  lgVideoStyle = this.getVideoContStyle(videoSize);
1566
1597
  }
1567
1598
  if (iframe) {
1568
- var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, src, currentGalleryItem.iframeTitle);
1599
+ var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);
1569
1600
  $currentSlide.prepend(markup);
1570
1601
  }
1571
1602
  else if (poster) {
@@ -1576,7 +1607,7 @@ var LightGallery = /** @class */ (function () {
1576
1607
  if (hasStartAnimation) {
1577
1608
  dummyImg = this.getDummyImageContent($currentSlide, index, '');
1578
1609
  }
1579
- var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, videoInfo);
1610
+ var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, this.settings.strings['playVideo'], videoInfo);
1580
1611
  $currentSlide.prepend(markup);
1581
1612
  }
1582
1613
  else if (videoInfo) {
@@ -2359,17 +2390,23 @@ var LightGallery = /** @class */ (function () {
2359
2390
  };
2360
2391
  LightGallery.prototype.mousewheel = function () {
2361
2392
  var _this = this;
2362
- this.outer.on('mousewheel.lg', function (e) {
2393
+ var lastCall = 0;
2394
+ this.outer.on('wheel.lg', function (e) {
2363
2395
  if (!e.deltaY || _this.galleryItems.length < 2) {
2364
2396
  return;
2365
2397
  }
2366
- if (e.deltaY > 0) {
2367
- _this.goToPrevSlide();
2398
+ e.preventDefault();
2399
+ var now = new Date().getTime();
2400
+ if (now - lastCall < 1000) {
2401
+ return;
2368
2402
  }
2369
- else {
2403
+ lastCall = now;
2404
+ if (e.deltaY > 0) {
2370
2405
  _this.goToNextSlide();
2371
2406
  }
2372
- e.preventDefault();
2407
+ else if (e.deltaY < 0) {
2408
+ _this.goToPrevSlide();
2409
+ }
2373
2410
  });
2374
2411
  };
2375
2412
  LightGallery.prototype.isSlideElement = function (target) {