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.
- package/lg-settings.d.ts +13 -1
- package/lg-utils.d.ts +15 -3
- package/lib/lg-settings.js +3 -0
- package/lib/lg-settings.js.map +1 -1
- package/lib/lg-utils.js +2 -2
- package/lib/lg-utils.js.map +1 -1
- package/lib/lightgallery.js +16 -4
- package/lib/lightgallery.js.map +1 -1
- package/lightgallery.es5.js +22 -7
- package/lightgallery.es5.js.map +1 -1
- package/lightgallery.min.js +2 -2
- package/lightgallery.umd.js +22 -7
- package/lightgallery.umd.js.map +1 -1
- package/lit/lightgallery.esm.js +7 -7
- package/lit/lightgallery.umd.js +2 -2
- package/package.json +1 -1
- package/plugins/autoplay/lg-autoplay.es5.js +1 -1
- package/plugins/autoplay/lg-autoplay.min.js +1 -1
- package/plugins/autoplay/lg-autoplay.umd.js +1 -1
- package/plugins/comment/lg-comment.es5.js +1 -1
- package/plugins/comment/lg-comment.min.js +1 -1
- package/plugins/comment/lg-comment.umd.js +1 -1
- package/plugins/fullscreen/lg-fullscreen.es5.js +1 -1
- package/plugins/fullscreen/lg-fullscreen.min.js +1 -1
- package/plugins/fullscreen/lg-fullscreen.umd.js +1 -1
- package/plugins/hash/lg-hash.es5.js +1 -1
- package/plugins/hash/lg-hash.min.js +1 -1
- package/plugins/hash/lg-hash.umd.js +1 -1
- package/plugins/mediumZoom/lg-medium-zoom.es5.js +1 -1
- package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
- package/plugins/mediumZoom/lg-medium-zoom.umd.js +1 -1
- package/plugins/pager/lg-pager.es5.js +1 -1
- package/plugins/pager/lg-pager.min.js +1 -1
- package/plugins/pager/lg-pager.umd.js +1 -1
- package/plugins/relativeCaption/lg-relative-caption.es5.js +1 -1
- package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
- package/plugins/relativeCaption/lg-relative-caption.umd.js +1 -1
- package/plugins/rotate/lg-rotate.es5.js +1 -1
- package/plugins/rotate/lg-rotate.min.js +1 -1
- package/plugins/rotate/lg-rotate.umd.js +1 -1
- package/plugins/share/lg-share.es5.js +1 -1
- package/plugins/share/lg-share.min.js +1 -1
- package/plugins/share/lg-share.umd.js +1 -1
- package/plugins/thumbnail/lg-thumbnail.es5.js +1 -1
- package/plugins/thumbnail/lg-thumbnail.min.js +1 -1
- package/plugins/thumbnail/lg-thumbnail.umd.js +1 -1
- package/plugins/video/lg-video.es5.js +1 -1
- package/plugins/video/lg-video.min.js +1 -1
- package/plugins/video/lg-video.umd.js +1 -1
- package/plugins/zoom/lg-zoom.es5.js +1 -1
- package/plugins/zoom/lg-zoom.min.js +1 -1
- package/plugins/zoom/lg-zoom.umd.js +1 -1
- package/react/Lightgallery.es5.js +22 -7
- package/react/Lightgallery.es5.js.map +1 -1
- package/react/Lightgallery.umd.js +22 -7
- package/react/Lightgallery.umd.js.map +1 -1
- package/vue/LightGalleryVue.common.js +154 -139
- package/vue/LightGalleryVue.common.js.map +1 -1
- package/vue/LightGalleryVue.umd.js +154 -139
- package/vue/LightGalleryVue.umd.js.map +1 -1
- package/vue/LightGalleryVue.umd.min.js +2 -2
- package/vue/LightGalleryVue.umd.min.js.map +1 -1
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/*!
|
|
35
|
-
* lightgallery | 2.3.0
|
|
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
|
-
|
|
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
|
};
|