lightgallery 2.3.0-beta.4 → 2.3.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 (62) hide show
  1. package/lg-settings.d.ts +13 -1
  2. package/lg-utils.d.ts +15 -3
  3. package/lib/lg-settings.js +3 -0
  4. package/lib/lg-settings.js.map +1 -1
  5. package/lib/lg-utils.js +2 -2
  6. package/lib/lg-utils.js.map +1 -1
  7. package/lib/lightgallery.js +16 -4
  8. package/lib/lightgallery.js.map +1 -1
  9. package/lightgallery.es5.js +22 -7
  10. package/lightgallery.es5.js.map +1 -1
  11. package/lightgallery.min.js +2 -2
  12. package/lightgallery.umd.js +22 -7
  13. package/lightgallery.umd.js.map +1 -1
  14. package/lit/lightgallery.esm.js +7 -7
  15. package/lit/lightgallery.umd.js +2 -2
  16. package/package.json +1 -1
  17. package/plugins/autoplay/lg-autoplay.es5.js +1 -1
  18. package/plugins/autoplay/lg-autoplay.min.js +1 -1
  19. package/plugins/autoplay/lg-autoplay.umd.js +1 -1
  20. package/plugins/comment/lg-comment.es5.js +1 -1
  21. package/plugins/comment/lg-comment.min.js +1 -1
  22. package/plugins/comment/lg-comment.umd.js +1 -1
  23. package/plugins/fullscreen/lg-fullscreen.es5.js +1 -1
  24. package/plugins/fullscreen/lg-fullscreen.min.js +1 -1
  25. package/plugins/fullscreen/lg-fullscreen.umd.js +1 -1
  26. package/plugins/hash/lg-hash.es5.js +1 -1
  27. package/plugins/hash/lg-hash.min.js +1 -1
  28. package/plugins/hash/lg-hash.umd.js +1 -1
  29. package/plugins/mediumZoom/lg-medium-zoom.es5.js +1 -1
  30. package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
  31. package/plugins/mediumZoom/lg-medium-zoom.umd.js +1 -1
  32. package/plugins/pager/lg-pager.es5.js +1 -1
  33. package/plugins/pager/lg-pager.min.js +1 -1
  34. package/plugins/pager/lg-pager.umd.js +1 -1
  35. package/plugins/relativeCaption/lg-relative-caption.es5.js +1 -1
  36. package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
  37. package/plugins/relativeCaption/lg-relative-caption.umd.js +1 -1
  38. package/plugins/rotate/lg-rotate.es5.js +1 -1
  39. package/plugins/rotate/lg-rotate.min.js +1 -1
  40. package/plugins/rotate/lg-rotate.umd.js +1 -1
  41. package/plugins/share/lg-share.es5.js +1 -1
  42. package/plugins/share/lg-share.min.js +1 -1
  43. package/plugins/share/lg-share.umd.js +1 -1
  44. package/plugins/thumbnail/lg-thumbnail.es5.js +1 -1
  45. package/plugins/thumbnail/lg-thumbnail.min.js +1 -1
  46. package/plugins/thumbnail/lg-thumbnail.umd.js +1 -1
  47. package/plugins/video/lg-video.es5.js +1 -1
  48. package/plugins/video/lg-video.min.js +1 -1
  49. package/plugins/video/lg-video.umd.js +1 -1
  50. package/plugins/zoom/lg-zoom.es5.js +1 -1
  51. package/plugins/zoom/lg-zoom.min.js +1 -1
  52. package/plugins/zoom/lg-zoom.umd.js +1 -1
  53. package/react/Lightgallery.es5.js +22 -7
  54. package/react/Lightgallery.es5.js.map +1 -1
  55. package/react/Lightgallery.umd.js +22 -7
  56. package/react/Lightgallery.umd.js.map +1 -1
  57. package/vue/LightGalleryVue.common.js +154 -139
  58. package/vue/LightGalleryVue.common.js.map +1 -1
  59. package/vue/LightGalleryVue.umd.js +154 -139
  60. package/vue/LightGalleryVue.umd.js.map +1 -1
  61. package/vue/LightGalleryVue.umd.min.js +2 -2
  62. package/vue/LightGalleryVue.umd.min.js.map +1 -1
@@ -32,7 +32,7 @@
32
32
  }
33
33
 
34
34
  /*!
35
- * lightgallery | 2.3.0-beta.4 | October 11th 2021
35
+ * lightgallery | 2.3.0 | October 28th 2021
36
36
  * http://www.lightgalleryjs.com/
37
37
  * Copyright (c) 2020 Sachin Neravath;
38
38
  * @license GPLv3
@@ -565,9 +565,9 @@
565
565
  ', 1)';
566
566
  return transform;
567
567
  },
568
- getIframeMarkup: function (iframeWidth, iframeHeight, src, iframeTitle) {
568
+ getIframeMarkup: function (iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {
569
569
  var title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
570
- 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>";
570
+ 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>";
571
571
  },
572
572
  getImgMarkup: function (index, src, altAttr, srcset, sizes, sources) {
573
573
  var srcsetAttr = srcset ? "srcset=\"" + srcset + "\"" : '';
@@ -746,6 +746,7 @@
746
746
  supportLegacyBrowser: true,
747
747
  allowMediaOverlap: false,
748
748
  videoMaxSize: '1280-720',
749
+ loadYouTubePoster: true,
749
750
  defaultCaptionHeight: 0,
750
751
  ariaLabelledby: '',
751
752
  ariaDescribedby: '',
@@ -773,6 +774,8 @@
773
774
  index: 0,
774
775
  iframeWidth: '100%',
775
776
  iframeHeight: '100%',
777
+ iframeMaxWidth: '100%',
778
+ iframeMaxHeight: '100%',
776
779
  download: true,
777
780
  counter: true,
778
781
  appendCounterTo: '.lg-toolbar',
@@ -1562,8 +1565,15 @@
1562
1565
  };
1563
1566
  // Add video slideInfo
1564
1567
  LightGallery.prototype.addSlideVideoInfo = function (items) {
1568
+ var _this = this;
1565
1569
  items.forEach(function (element, index) {
1566
1570
  element.__slideVideoInfo = utils.isVideo(element.src, !!element.video, index);
1571
+ if (element.__slideVideoInfo &&
1572
+ _this.settings.loadYouTubePoster &&
1573
+ !element.poster &&
1574
+ element.__slideVideoInfo.youtube) {
1575
+ element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/maxresdefault.jpg";
1576
+ }
1567
1577
  });
1568
1578
  };
1569
1579
  /**
@@ -1605,7 +1615,7 @@
1605
1615
  lgVideoStyle = this.getVideoContStyle(videoSize);
1606
1616
  }
1607
1617
  if (iframe) {
1608
- var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, src, currentGalleryItem.iframeTitle);
1618
+ var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);
1609
1619
  $currentSlide.prepend(markup);
1610
1620
  }
1611
1621
  else if (poster) {
@@ -2399,17 +2409,22 @@
2399
2409
  };
2400
2410
  LightGallery.prototype.mousewheel = function () {
2401
2411
  var _this = this;
2402
- this.outer.on('mousewheel.lg', function (e) {
2412
+ var lastCall = 0;
2413
+ this.outer.on('wheel.lg', function (e) {
2403
2414
  if (!e.deltaY || _this.galleryItems.length < 2) {
2404
2415
  return;
2405
2416
  }
2417
+ e.preventDefault();
2418
+ var now = new Date().getTime();
2419
+ if (now - lastCall < 1000) {
2420
+ return;
2421
+ }
2422
+ lastCall = now;
2406
2423
  if (e.deltaY > 0) {
2407
2424
  _this.goToNextSlide();
2408
- e.preventDefault();
2409
2425
  }
2410
2426
  else if (e.deltaY < 0) {
2411
2427
  _this.goToPrevSlide();
2412
- e.preventDefault();
2413
2428
  }
2414
2429
  });
2415
2430
  };