Update js
-jquery -lightgallery
This commit is contained in:
6
theme/public/jquery.min.js
vendored
6
theme/public/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
theme/public/lightgallery/.DS_Store
vendored
BIN
theme/public/lightgallery/.DS_Store
vendored
Binary file not shown.
@@ -1,34 +1,57 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lightgallery - v1.10.0 - 2020-11-07
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery/
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||||
.lg-outer.fb-comments .lg-img-wrap {
|
.lg-outer.fb-comments .lg-img-wrap, .lg-outer.fb-comments .lg-video-cont {
|
||||||
padding-right: 400px !important; }
|
padding-right: 400px !important;
|
||||||
.lg-outer.fb-comments .fb-comments {
|
}
|
||||||
height: 100%;
|
|
||||||
overflow-y: auto;
|
.lg-outer.fb-comments .fb-comments {
|
||||||
position: absolute;
|
height: 100%;
|
||||||
right: 0;
|
overflow-y: auto;
|
||||||
top: 0;
|
position: absolute;
|
||||||
width: 420px;
|
right: 0;
|
||||||
z-index: 99999;
|
top: 0;
|
||||||
background: #fff url("../img/loading.gif") no-repeat scroll center center; }
|
width: 420px;
|
||||||
.lg-outer.fb-comments .fb-comments.fb_iframe_widget {
|
z-index: 99999;
|
||||||
background-image: none; }
|
background: #fff url("../img/loading.gif") no-repeat scroll center center;
|
||||||
.lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader {
|
}
|
||||||
background: #fff url("../img/loading.gif") no-repeat scroll center center; }
|
|
||||||
.lg-outer.fb-comments .lg-toolbar {
|
.lg-outer.fb-comments .fb-comments.fb_iframe_widget {
|
||||||
right: 420px;
|
background-image: none;
|
||||||
width: auto; }
|
}
|
||||||
.lg-outer.fb-comments .lg-actions .lg-next {
|
|
||||||
right: 420px; }
|
.lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader {
|
||||||
.lg-outer.fb-comments .lg-item {
|
background: #fff url("../img/loading.gif") no-repeat scroll center center;
|
||||||
background-image: none; }
|
}
|
||||||
.lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap {
|
|
||||||
background-image: none; }
|
.lg-outer.fb-comments .lg-toolbar {
|
||||||
.lg-outer.fb-comments .lg-img-wrap {
|
right: 420px;
|
||||||
background: url(../img/loading.gif) no-repeat scroll center center transparent; }
|
width: auto;
|
||||||
.lg-outer.fb-comments .lg-sub-html {
|
}
|
||||||
padding: 0;
|
|
||||||
position: static; }
|
.lg-outer.fb-comments .lg-actions .lg-next {
|
||||||
|
right: 420px;
|
||||||
/*# sourceMappingURL=lg-fb-comment-box.css.map */
|
}
|
||||||
|
|
||||||
|
.lg-outer.fb-comments .lg-item {
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap, .lg-outer.fb-comments .lg-item.lg-complete .lg-video-cont {
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lg-outer.fb-comments .lg-img-wrap, .lg-outer.fb-comments .lg-video-cont {
|
||||||
|
background: url("../img/loading.gif") no-repeat scroll transparent;
|
||||||
|
background-position: center center;
|
||||||
|
background-position: calc((100% - 400px) / 2) center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lg-outer.fb-comments .lg-sub-html {
|
||||||
|
padding: 0;
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lg-outer.fb-comments .lg-video-cont {
|
||||||
|
max-width: 1250px !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
.lg-outer.fb-comments .fb-comments{height:100%;overflow-y:auto;position:absolute;right:0;top:0;width:420px;z-index:99999;background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .fb-comments.fb_iframe_widget{background-image:none}.lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader{background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .lg-toolbar{right:420px;width:auto}.lg-outer.fb-comments .lg-actions .lg-next{right:420px}.lg-outer.fb-comments .lg-item,.lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap{background-image:none}.lg-outer.fb-comments .lg-img-wrap{padding-right:400px!important;background:url(../img/loading.gif) center center no-repeat}.lg-outer.fb-comments .lg-sub-html{padding:0;position:static}
|
.lg-outer.fb-comments .fb-comments{height:100%;overflow-y:auto;position:absolute;right:0;top:0;width:420px;z-index:99999;background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .fb-comments.fb_iframe_widget{background-image:none}.lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader{background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .lg-toolbar{right:420px;width:auto}.lg-outer.fb-comments .lg-actions .lg-next{right:420px}.lg-outer.fb-comments .lg-item,.lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap,.lg-outer.fb-comments .lg-item.lg-complete .lg-video-cont{background-image:none}.lg-outer.fb-comments .lg-img-wrap,.lg-outer.fb-comments .lg-video-cont{padding-right:400px!important;background:url(../img/loading.gif) center center no-repeat;background-position:calc((100% - 400px)/ 2) center}.lg-outer.fb-comments .lg-sub-html{padding:0;position:static}.lg-outer.fb-comments .lg-video-cont{max-width:1250px!important}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,191 +1,206 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-autoplay - v1.2.1 - 2020-06-13
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||||
/**
|
|
||||||
* Autoplay Plugin
|
(function (root, factory) {
|
||||||
* @version 1.2.0
|
if (typeof define === 'function' && define.amd) {
|
||||||
* @author Sachin N - @sachinchoolur
|
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||||
* @license MIT License (MIT)
|
define(['jquery'], function (a0) {
|
||||||
*/
|
return (factory(a0));
|
||||||
|
});
|
||||||
(function($, window, document, undefined) {
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
|
// Node. Does not work with strict CommonJS, but
|
||||||
'use strict';
|
// only CommonJS-like environments that support module.exports,
|
||||||
|
// like Node.
|
||||||
var defaults = {
|
module.exports = factory(require('jquery'));
|
||||||
autoplay: false,
|
} else {
|
||||||
pause: 5000,
|
factory(root["jQuery"]);
|
||||||
progressBar: true,
|
}
|
||||||
fourceAutoplay: false,
|
}(this, function ($) {
|
||||||
autoplayControls: true,
|
|
||||||
appendAutoplayControlsTo: '.lg-toolbar'
|
|
||||||
};
|
(function() {
|
||||||
|
|
||||||
/**
|
'use strict';
|
||||||
* Creates the autoplay plugin.
|
|
||||||
* @param {object} element - lightGallery element
|
var defaults = {
|
||||||
*/
|
autoplay: false,
|
||||||
var Autoplay = function(element) {
|
pause: 5000,
|
||||||
|
progressBar: true,
|
||||||
this.core = $(element).data('lightGallery');
|
fourceAutoplay: false,
|
||||||
|
autoplayControls: true,
|
||||||
this.$el = $(element);
|
appendAutoplayControlsTo: '.lg-toolbar'
|
||||||
|
};
|
||||||
// Execute only if items are above 1
|
|
||||||
if (this.core.$items.length < 2) {
|
/**
|
||||||
return false;
|
* Creates the autoplay plugin.
|
||||||
}
|
* @param {object} element - lightGallery element
|
||||||
|
*/
|
||||||
this.core.s = $.extend({}, defaults, this.core.s);
|
var Autoplay = function(element) {
|
||||||
this.interval = false;
|
|
||||||
|
this.core = $(element).data('lightGallery');
|
||||||
// Identify if slide happened from autoplay
|
|
||||||
this.fromAuto = true;
|
this.$el = $(element);
|
||||||
|
|
||||||
// Identify if autoplay canceled from touch/drag
|
// Execute only if items are above 1
|
||||||
this.canceledOnTouch = false;
|
if (this.core.$items.length < 2) {
|
||||||
|
return false;
|
||||||
// save fourceautoplay value
|
}
|
||||||
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
|
||||||
|
this.core.s = $.extend({}, defaults, this.core.s);
|
||||||
// do not allow progress bar if browser does not support css3 transitions
|
this.interval = false;
|
||||||
if (!this.core.doCss()) {
|
|
||||||
this.core.s.progressBar = false;
|
// Identify if slide happened from autoplay
|
||||||
}
|
this.fromAuto = true;
|
||||||
|
|
||||||
this.init();
|
// Identify if autoplay canceled from touch/drag
|
||||||
|
this.canceledOnTouch = false;
|
||||||
return this;
|
|
||||||
};
|
// save fourceautoplay value
|
||||||
|
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
||||||
Autoplay.prototype.init = function() {
|
|
||||||
var _this = this;
|
// do not allow progress bar if browser does not support css3 transitions
|
||||||
|
if (!this.core.doCss()) {
|
||||||
// append autoplay controls
|
this.core.s.progressBar = false;
|
||||||
if (_this.core.s.autoplayControls) {
|
}
|
||||||
_this.controls();
|
|
||||||
}
|
this.init();
|
||||||
|
|
||||||
// Create progress bar
|
return this;
|
||||||
if (_this.core.s.progressBar) {
|
};
|
||||||
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
|
||||||
}
|
Autoplay.prototype.init = function() {
|
||||||
|
var _this = this;
|
||||||
// set progress
|
|
||||||
_this.progress();
|
// append autoplay controls
|
||||||
|
if (_this.core.s.autoplayControls) {
|
||||||
// Start autoplay
|
_this.controls();
|
||||||
if (_this.core.s.autoplay) {
|
}
|
||||||
_this.startlAuto();
|
|
||||||
}
|
// Create progress bar
|
||||||
|
if (_this.core.s.progressBar) {
|
||||||
// cancel interval on touchstart and dragstart
|
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
||||||
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
}
|
||||||
if (_this.interval) {
|
|
||||||
_this.cancelAuto();
|
// set progress
|
||||||
_this.canceledOnTouch = true;
|
_this.progress();
|
||||||
}
|
|
||||||
});
|
// Start autoplay
|
||||||
|
if (_this.core.s.autoplay) {
|
||||||
// restore autoplay if autoplay canceled from touchstart / dragstart
|
_this.$el.one('onSlideItemLoad.lg.tm', function() {
|
||||||
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
_this.startlAuto();
|
||||||
if (!_this.interval && _this.canceledOnTouch) {
|
});
|
||||||
_this.startlAuto();
|
}
|
||||||
_this.canceledOnTouch = false;
|
|
||||||
}
|
// cancel interval on touchstart and dragstart
|
||||||
});
|
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
||||||
|
if (_this.interval) {
|
||||||
};
|
_this.cancelAuto();
|
||||||
|
_this.canceledOnTouch = true;
|
||||||
Autoplay.prototype.progress = function() {
|
}
|
||||||
|
});
|
||||||
var _this = this;
|
|
||||||
var _$progressBar;
|
// restore autoplay if autoplay canceled from touchstart / dragstart
|
||||||
var _$progress;
|
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
||||||
|
if (!_this.interval && _this.canceledOnTouch) {
|
||||||
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
_this.startlAuto();
|
||||||
|
_this.canceledOnTouch = false;
|
||||||
// start progress bar animation
|
}
|
||||||
if (_this.core.s.progressBar && _this.fromAuto) {
|
});
|
||||||
_$progressBar = _this.core.$outer.find('.lg-progress-bar');
|
|
||||||
_$progress = _this.core.$outer.find('.lg-progress');
|
};
|
||||||
if (_this.interval) {
|
|
||||||
_$progress.removeAttr('style');
|
Autoplay.prototype.progress = function() {
|
||||||
_$progressBar.removeClass('lg-start');
|
|
||||||
setTimeout(function() {
|
var _this = this;
|
||||||
_$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
var _$progressBar;
|
||||||
_$progressBar.addClass('lg-start');
|
var _$progress;
|
||||||
}, 20);
|
|
||||||
}
|
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
||||||
}
|
|
||||||
|
// start progress bar animation
|
||||||
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
if (_this.core.s.progressBar && _this.fromAuto) {
|
||||||
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
_$progressBar = _this.core.$outer.find('.lg-progress-bar');
|
||||||
_this.cancelAuto();
|
_$progress = _this.core.$outer.find('.lg-progress');
|
||||||
}
|
if (_this.interval) {
|
||||||
|
_$progress.removeAttr('style');
|
||||||
_this.fromAuto = false;
|
_$progressBar.removeClass('lg-start');
|
||||||
|
setTimeout(function() {
|
||||||
});
|
_$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
||||||
};
|
_$progressBar.addClass('lg-start');
|
||||||
|
}, 20);
|
||||||
// Manage autoplay via play/stop buttons
|
}
|
||||||
Autoplay.prototype.controls = function() {
|
}
|
||||||
var _this = this;
|
|
||||||
var _html = '<span class="lg-autoplay-button lg-icon"></span>';
|
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
||||||
|
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
||||||
// Append autoplay controls
|
_this.cancelAuto();
|
||||||
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
}
|
||||||
|
|
||||||
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
_this.fromAuto = false;
|
||||||
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
|
||||||
_this.cancelAuto();
|
});
|
||||||
_this.core.s.fourceAutoplay = false;
|
};
|
||||||
} else {
|
|
||||||
if (!_this.interval) {
|
// Manage autoplay via play/stop buttons
|
||||||
_this.startlAuto();
|
Autoplay.prototype.controls = function() {
|
||||||
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
var _this = this;
|
||||||
}
|
var _html = '<button type="button" aria-label="Toggle autoplay" class="lg-autoplay-button lg-icon"></button>';
|
||||||
}
|
|
||||||
});
|
// Append autoplay controls
|
||||||
};
|
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
||||||
|
|
||||||
// Autostart gallery
|
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
||||||
Autoplay.prototype.startlAuto = function() {
|
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
||||||
var _this = this;
|
_this.cancelAuto();
|
||||||
|
_this.core.s.fourceAutoplay = false;
|
||||||
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
} else {
|
||||||
_this.core.$outer.addClass('lg-show-autoplay');
|
if (!_this.interval) {
|
||||||
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
_this.startlAuto();
|
||||||
|
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
||||||
_this.interval = setInterval(function() {
|
}
|
||||||
if (_this.core.index + 1 < _this.core.$items.length) {
|
}
|
||||||
_this.core.index = _this.core.index;
|
});
|
||||||
} else {
|
};
|
||||||
_this.core.index = -1;
|
|
||||||
}
|
// Autostart gallery
|
||||||
|
Autoplay.prototype.startlAuto = function() {
|
||||||
_this.core.index++;
|
var _this = this;
|
||||||
_this.fromAuto = true;
|
|
||||||
_this.core.slide(_this.core.index, false, false);
|
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
||||||
}, _this.core.s.speed + _this.core.s.pause);
|
_this.core.$outer.addClass('lg-show-autoplay');
|
||||||
};
|
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
||||||
|
|
||||||
// cancel Autostart
|
_this.interval = setInterval(function() {
|
||||||
Autoplay.prototype.cancelAuto = function() {
|
if (_this.core.index + 1 < _this.core.$items.length) {
|
||||||
clearInterval(this.interval);
|
_this.core.index++;
|
||||||
this.interval = false;
|
} else {
|
||||||
this.core.$outer.find('.lg-progress').removeAttr('style');
|
_this.core.index = 0;
|
||||||
this.core.$outer.removeClass('lg-show-autoplay');
|
}
|
||||||
this.core.$outer.find('.lg-progress-bar').removeClass('lg-start');
|
|
||||||
};
|
_this.fromAuto = true;
|
||||||
|
_this.core.slide(_this.core.index, false, false, 'next');
|
||||||
Autoplay.prototype.destroy = function() {
|
}, _this.core.s.speed + _this.core.s.pause);
|
||||||
|
};
|
||||||
this.cancelAuto();
|
|
||||||
this.core.$outer.find('.lg-progress-bar').remove();
|
// cancel Autostart
|
||||||
};
|
Autoplay.prototype.cancelAuto = function() {
|
||||||
|
clearInterval(this.interval);
|
||||||
$.fn.lightGallery.modules.autoplay = Autoplay;
|
this.interval = false;
|
||||||
|
this.core.$outer.find('.lg-progress').removeAttr('style');
|
||||||
})(jQuery, window, document);
|
this.core.$outer.removeClass('lg-show-autoplay');
|
||||||
|
this.core.$outer.find('.lg-progress-bar').removeClass('lg-start');
|
||||||
|
};
|
||||||
|
|
||||||
|
Autoplay.prototype.destroy = function() {
|
||||||
|
|
||||||
|
this.cancelAuto();
|
||||||
|
this.core.$outer.find('.lg-progress-bar').remove();
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.lightGallery.modules.autoplay = Autoplay;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
}));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-autoplay - v1.2.1 - 2020-06-13
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||||
!function(a,b,c,d){"use strict";var e={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.$items.length<2?!1:(this.core.s=a.extend({},e,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};f.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),a.progress(),a.core.s.autoplay&&a.startlAuto(),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},f.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},f.prototype.controls=function(){var b=this,c='<span class="lg-autoplay-button lg-icon"></span>';a(this.core.s.appendAutoplayControlsTo).append(c),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},f.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+1<a.core.$items.length?a.core.index=a.core.index:a.core.index=-1,a.core.index++,a.fromAuto=!0,a.core.slide(a.core.index,!1,!1)},a.core.s.speed+a.core.s.pause)},f.prototype.cancelAuto=function(){clearInterval(this.interval),this.interval=!1,this.core.$outer.find(".lg-progress").removeAttr("style"),this.core.$outer.removeClass("lg-show-autoplay"),this.core.$outer.find(".lg-progress-bar").removeClass("lg-start")},f.prototype.destroy=function(){this.cancelAuto(),this.core.$outer.find(".lg-progress-bar").remove()},a.fn.lightGallery.modules.autoplay=f}(jQuery,window,document);
|
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";var b={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),!(this.core.$items.length<2)&&(this.core.s=a.extend({},b,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};c.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),a.progress(),a.core.s.autoplay&&a.$el.one("onSlideItemLoad.lg.tm",function(){a.startlAuto()}),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},c.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},c.prototype.controls=function(){var b=this;a(this.core.s.appendAutoplayControlsTo).append('<button type="button" aria-label="Toggle autoplay" class="lg-autoplay-button lg-icon"></button>'),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},c.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+1<a.core.$items.length?a.core.index++:a.core.index=0,a.fromAuto=!0,a.core.slide(a.core.index,!1,!1,"next")},a.core.s.speed+a.core.s.pause)},c.prototype.cancelAuto=function(){clearInterval(this.interval),this.interval=!1,this.core.$outer.find(".lg-progress").removeAttr("style"),this.core.$outer.removeClass("lg-show-autoplay"),this.core.$outer.find(".lg-progress-bar").removeClass("lg-start")},c.prototype.destroy=function(){this.cancelAuto(),this.core.$outer.find(".lg-progress-bar").remove()},a.fn.lightGallery.modules.autoplay=c}()});
|
||||||
@@ -1,97 +1,126 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-fullscreen - v1.2.1 - 2020-06-13
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||||
(function($, window, document, undefined) {
|
|
||||||
|
(function (root, factory) {
|
||||||
'use strict';
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||||
var defaults = {
|
define(['jquery'], function (a0) {
|
||||||
fullScreen: true
|
return (factory(a0));
|
||||||
};
|
});
|
||||||
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
var Fullscreen = function(element) {
|
// Node. Does not work with strict CommonJS, but
|
||||||
|
// only CommonJS-like environments that support module.exports,
|
||||||
// get lightGallery core plugin data
|
// like Node.
|
||||||
this.core = $(element).data('lightGallery');
|
module.exports = factory(require('jquery'));
|
||||||
|
} else {
|
||||||
this.$el = $(element);
|
factory(root["jQuery"]);
|
||||||
|
}
|
||||||
// extend module defalut settings with lightGallery core settings
|
}(this, function ($) {
|
||||||
this.core.s = $.extend({}, defaults, this.core.s);
|
|
||||||
|
(function() {
|
||||||
this.init();
|
|
||||||
|
'use strict';
|
||||||
return this;
|
|
||||||
};
|
var defaults = {
|
||||||
|
fullScreen: true
|
||||||
Fullscreen.prototype.init = function() {
|
};
|
||||||
var fullScreen = '';
|
|
||||||
if (this.core.s.fullScreen) {
|
function isFullScreen() {
|
||||||
|
return (
|
||||||
// check for fullscreen browser support
|
document.fullscreenElement ||
|
||||||
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
document.mozFullScreenElement ||
|
||||||
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
document.webkitFullscreenElement ||
|
||||||
return;
|
document.msFullscreenElement
|
||||||
} else {
|
);
|
||||||
fullScreen = '<span class="lg-fullscreen lg-icon"></span>';
|
}
|
||||||
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
|
||||||
this.fullScreen();
|
var Fullscreen = function(element) {
|
||||||
}
|
|
||||||
}
|
// get lightGallery core plugin data
|
||||||
};
|
this.core = $(element).data('lightGallery');
|
||||||
|
|
||||||
Fullscreen.prototype.requestFullscreen = function() {
|
this.$el = $(element);
|
||||||
var el = document.documentElement;
|
|
||||||
if (el.requestFullscreen) {
|
// extend module defalut settings with lightGallery core settings
|
||||||
el.requestFullscreen();
|
this.core.s = $.extend({}, defaults, this.core.s);
|
||||||
} else if (el.msRequestFullscreen) {
|
|
||||||
el.msRequestFullscreen();
|
this.init();
|
||||||
} else if (el.mozRequestFullScreen) {
|
|
||||||
el.mozRequestFullScreen();
|
return this;
|
||||||
} else if (el.webkitRequestFullscreen) {
|
};
|
||||||
el.webkitRequestFullscreen();
|
|
||||||
}
|
Fullscreen.prototype.init = function() {
|
||||||
};
|
var fullScreen = '';
|
||||||
|
if (this.core.s.fullScreen) {
|
||||||
Fullscreen.prototype.exitFullscreen = function() {
|
|
||||||
if (document.exitFullscreen) {
|
// check for fullscreen browser support
|
||||||
document.exitFullscreen();
|
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
||||||
} else if (document.msExitFullscreen) {
|
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
||||||
document.msExitFullscreen();
|
return;
|
||||||
} else if (document.mozCancelFullScreen) {
|
} else {
|
||||||
document.mozCancelFullScreen();
|
fullScreen = '<button type="button" aria-label="Toggle fullscreen" class="lg-fullscreen lg-icon"></button>';
|
||||||
} else if (document.webkitExitFullscreen) {
|
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
||||||
document.webkitExitFullscreen();
|
this.fullScreen();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
};
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
|
||||||
Fullscreen.prototype.fullScreen = function() {
|
Fullscreen.prototype.requestFullscreen = function() {
|
||||||
var _this = this;
|
var el = document.documentElement;
|
||||||
|
if (el.requestFullscreen) {
|
||||||
$(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() {
|
el.requestFullscreen();
|
||||||
_this.core.$outer.toggleClass('lg-fullscreen-on');
|
} else if (el.msRequestFullscreen) {
|
||||||
});
|
el.msRequestFullscreen();
|
||||||
|
} else if (el.mozRequestFullScreen) {
|
||||||
this.core.$outer.find('.lg-fullscreen').on('click.lg', function() {
|
el.mozRequestFullScreen();
|
||||||
if (!document.fullscreenElement &&
|
} else if (el.webkitRequestFullscreen) {
|
||||||
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {
|
el.webkitRequestFullscreen();
|
||||||
_this.requestFullscreen();
|
}
|
||||||
} else {
|
};
|
||||||
_this.exitFullscreen();
|
|
||||||
}
|
Fullscreen.prototype.exitFullscreen = function() {
|
||||||
});
|
if (document.exitFullscreen) {
|
||||||
|
document.exitFullscreen();
|
||||||
};
|
} else if (document.msExitFullscreen) {
|
||||||
|
document.msExitFullscreen();
|
||||||
Fullscreen.prototype.destroy = function() {
|
} else if (document.mozCancelFullScreen) {
|
||||||
|
document.mozCancelFullScreen();
|
||||||
// exit from fullscreen if activated
|
} else if (document.webkitExitFullscreen) {
|
||||||
this.exitFullscreen();
|
document.webkitExitFullscreen();
|
||||||
|
}
|
||||||
$(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg');
|
};
|
||||||
};
|
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
||||||
$.fn.lightGallery.modules.fullscreen = Fullscreen;
|
Fullscreen.prototype.fullScreen = function() {
|
||||||
|
var _this = this;
|
||||||
})(jQuery, window, document);
|
|
||||||
|
$(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() {
|
||||||
|
_this.core.$outer.toggleClass('lg-fullscreen-on');
|
||||||
|
});
|
||||||
|
|
||||||
|
this.core.$outer.find('.lg-fullscreen').on('click.lg', function() {
|
||||||
|
if (isFullScreen()) {
|
||||||
|
_this.exitFullscreen();
|
||||||
|
} else {
|
||||||
|
_this.requestFullscreen();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
Fullscreen.prototype.destroy = function() {
|
||||||
|
|
||||||
|
// exit from fullscreen if activated
|
||||||
|
if(isFullScreen()) {
|
||||||
|
this.exitFullscreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg');
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.lightGallery.modules.fullscreen = Fullscreen;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
}));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-fullscreen - v1.2.1 - 2020-06-13
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||||
!function(a,b,c,d){"use strict";var e={fullScreen:!0},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.init(),this};f.prototype.init=function(){var a="";if(this.core.s.fullScreen){if(!(c.fullscreenEnabled||c.webkitFullscreenEnabled||c.mozFullScreenEnabled||c.msFullscreenEnabled))return;a='<span class="lg-fullscreen lg-icon"></span>',this.core.$outer.find(".lg-toolbar").append(a),this.fullScreen()}},f.prototype.requestFullscreen=function(){var a=c.documentElement;a.requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen&&a.webkitRequestFullscreen()},f.prototype.exitFullscreen=function(){c.exitFullscreen?c.exitFullscreen():c.msExitFullscreen?c.msExitFullscreen():c.mozCancelFullScreen?c.mozCancelFullScreen():c.webkitExitFullscreen&&c.webkitExitFullscreen()},f.prototype.fullScreen=function(){var b=this;a(c).on("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg",function(){b.core.$outer.toggleClass("lg-fullscreen-on")}),this.core.$outer.find(".lg-fullscreen").on("click.lg",function(){c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement||c.msFullscreenElement?b.exitFullscreen():b.requestFullscreen()})},f.prototype.destroy=function(){this.exitFullscreen(),a(c).off("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg")},a.fn.lightGallery.modules.fullscreen=f}(jQuery,window,document);
|
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";function b(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement}var c={fullScreen:!0},d=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},c,this.core.s),this.init(),this};d.prototype.init=function(){var a="";if(this.core.s.fullScreen){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))return;a='<button type="button" aria-label="Toggle fullscreen" class="lg-fullscreen lg-icon"></button>',this.core.$outer.find(".lg-toolbar").append(a),this.fullScreen()}},d.prototype.requestFullscreen=function(){var a=document.documentElement;a.requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen&&a.webkitRequestFullscreen()},d.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},d.prototype.fullScreen=function(){var c=this;a(document).on("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg",function(){c.core.$outer.toggleClass("lg-fullscreen-on")}),this.core.$outer.find(".lg-fullscreen").on("click.lg",function(){b()?c.exitFullscreen():c.requestFullscreen()})},d.prototype.destroy=function(){b()&&this.exitFullscreen(),a(document).off("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg")},a.fn.lightGallery.modules.fullscreen=d}()});
|
||||||
@@ -1,67 +1,101 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-hash - v1.0.4 - 2017-12-20
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
||||||
(function($, window, document, undefined) {
|
|
||||||
|
(function (root, factory) {
|
||||||
'use strict';
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||||
var defaults = {
|
define(['jquery'], function (a0) {
|
||||||
hash: true
|
return (factory(a0));
|
||||||
};
|
});
|
||||||
|
} else if (typeof exports === 'object') {
|
||||||
var Hash = function(element) {
|
// Node. Does not work with strict CommonJS, but
|
||||||
|
// only CommonJS-like environments that support module.exports,
|
||||||
this.core = $(element).data('lightGallery');
|
// like Node.
|
||||||
|
module.exports = factory(require('jquery'));
|
||||||
this.core.s = $.extend({}, defaults, this.core.s);
|
} else {
|
||||||
|
factory(jQuery);
|
||||||
if (this.core.s.hash) {
|
}
|
||||||
this.oldHash = window.location.hash;
|
}(this, function ($) {
|
||||||
this.init();
|
|
||||||
}
|
(function() {
|
||||||
|
|
||||||
return this;
|
'use strict';
|
||||||
};
|
|
||||||
|
var defaults = {
|
||||||
Hash.prototype.init = function() {
|
hash: true
|
||||||
var _this = this;
|
};
|
||||||
var _hash;
|
|
||||||
|
var Hash = function(element) {
|
||||||
// Change hash value on after each slide transition
|
|
||||||
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
this.core = $(element).data('lightGallery');
|
||||||
window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index;
|
|
||||||
});
|
this.core.s = $.extend({}, defaults, this.core.s);
|
||||||
|
|
||||||
// Listen hash change and change the slide according to slide value
|
if (this.core.s.hash) {
|
||||||
$(window).on('hashchange', function() {
|
this.oldHash = window.location.hash;
|
||||||
_hash = window.location.hash;
|
this.init();
|
||||||
var _idx = parseInt(_hash.split('&slide=')[1], 10);
|
}
|
||||||
|
|
||||||
// it galleryId doesn't exist in the url close the gallery
|
return this;
|
||||||
if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) {
|
};
|
||||||
_this.core.slide(_idx);
|
|
||||||
} else if (_this.core.lGalleryOn) {
|
Hash.prototype.init = function() {
|
||||||
_this.core.destroy();
|
var _this = this;
|
||||||
}
|
var _hash;
|
||||||
|
|
||||||
});
|
// Change hash value on after each slide transition
|
||||||
};
|
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
||||||
|
if (history.replaceState) {
|
||||||
Hash.prototype.destroy = function() {
|
history.replaceState(null, null, window.location.pathname + window.location.search + '#lg=' + _this.core.s.galleryId + '&slide=' + index);
|
||||||
|
} else {
|
||||||
// Reset to old hash value
|
window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index;
|
||||||
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
|
}
|
||||||
window.location.hash = this.oldHash;
|
});
|
||||||
} else {
|
|
||||||
if (history.pushState) {
|
// Listen hash change and change the slide according to slide value
|
||||||
history.pushState('', document.title, window.location.pathname + window.location.search);
|
$(window).on('hashchange.lg.hash', function() {
|
||||||
} else {
|
_hash = window.location.hash;
|
||||||
window.location.hash = '';
|
var _idx = parseInt(_hash.split('&slide=')[1], 10);
|
||||||
}
|
|
||||||
}
|
// it galleryId doesn't exist in the url close the gallery
|
||||||
|
if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) {
|
||||||
};
|
_this.core.slide(_idx, false, false);
|
||||||
|
} else if (_this.core.lGalleryOn) {
|
||||||
$.fn.lightGallery.modules.hash = Hash;
|
_this.core.destroy();
|
||||||
|
}
|
||||||
})(jQuery, window, document);
|
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Hash.prototype.destroy = function() {
|
||||||
|
|
||||||
|
if (!this.core.s.hash) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset to old hash value
|
||||||
|
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
|
||||||
|
if (history.replaceState) {
|
||||||
|
history.replaceState(null, null, this.oldHash);
|
||||||
|
} else {
|
||||||
|
window.location.hash = this.oldHash;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (history.replaceState) {
|
||||||
|
history.replaceState(null, document.title, window.location.pathname + window.location.search);
|
||||||
|
} else {
|
||||||
|
window.location.hash = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.core.$el.off('.lg.hash');
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.lightGallery.modules.hash = Hash;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
}));
|
||||||
|
|||||||
8
theme/public/lightgallery/js/lg-hash.min.js
vendored
8
theme/public/lightgallery/js/lg-hash.min.js
vendored
@@ -1,4 +1,4 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-hash - v1.0.4 - 2017-12-20
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
||||||
!function(a,b,c,d){"use strict";var e={hash:!0},f=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.core.s.hash&&(this.oldHash=b.location.hash,this.init()),this};f.prototype.init=function(){var c,d=this;d.core.$el.on("onAfterSlide.lg.tm",function(a,c,e){b.location.hash="lg="+d.core.s.galleryId+"&slide="+e}),a(b).on("hashchange",function(){c=b.location.hash;var a=parseInt(c.split("&slide=")[1],10);c.indexOf("lg="+d.core.s.galleryId)>-1?d.core.slide(a):d.core.lGalleryOn&&d.core.destroy()})},f.prototype.destroy=function(){this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?b.location.hash=this.oldHash:history.pushState?history.pushState("",c.title,b.location.pathname+b.location.search):b.location.hash=""},a.fn.lightGallery.modules.hash=f}(jQuery,window,document);
|
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={hash:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.hash&&(this.oldHash=window.location.hash,this.init()),this};c.prototype.init=function(){var b,c=this;c.core.$el.on("onAfterSlide.lg.tm",function(a,b,d){history.replaceState?history.replaceState(null,null,window.location.pathname+window.location.search+"#lg="+c.core.s.galleryId+"&slide="+d):window.location.hash="lg="+c.core.s.galleryId+"&slide="+d}),a(window).on("hashchange.lg.hash",function(){b=window.location.hash;var a=parseInt(b.split("&slide=")[1],10);b.indexOf("lg="+c.core.s.galleryId)>-1?c.core.slide(a,!1,!1):c.core.lGalleryOn&&c.core.destroy()})},c.prototype.destroy=function(){this.core.s.hash&&(this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?history.replaceState?history.replaceState(null,null,this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash="",this.core.$el.off(".lg.hash"))},a.fn.lightGallery.modules.hash=c}()});
|
||||||
@@ -1,85 +1,105 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-pager - v1.0.2 - 2017-01-22
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
||||||
(function($, window, document, undefined) {
|
|
||||||
|
(function (root, factory) {
|
||||||
'use strict';
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||||
var defaults = {
|
define(['jquery'], function (a0) {
|
||||||
pager: false
|
return (factory(a0));
|
||||||
};
|
});
|
||||||
|
} else if (typeof exports === 'object') {
|
||||||
var Pager = function(element) {
|
// Node. Does not work with strict CommonJS, but
|
||||||
|
// only CommonJS-like environments that support module.exports,
|
||||||
this.core = $(element).data('lightGallery');
|
// like Node.
|
||||||
|
module.exports = factory(require('jquery'));
|
||||||
this.$el = $(element);
|
} else {
|
||||||
this.core.s = $.extend({}, defaults, this.core.s);
|
factory(jQuery);
|
||||||
if (this.core.s.pager && this.core.$items.length > 1) {
|
}
|
||||||
this.init();
|
}(this, function ($) {
|
||||||
}
|
|
||||||
|
(function() {
|
||||||
return this;
|
|
||||||
};
|
'use strict';
|
||||||
|
|
||||||
Pager.prototype.init = function() {
|
var defaults = {
|
||||||
var _this = this;
|
pager: false
|
||||||
var pagerList = '';
|
};
|
||||||
var $pagerCont;
|
|
||||||
var $pagerOuter;
|
var Pager = function(element) {
|
||||||
var timeout;
|
|
||||||
|
this.core = $(element).data('lightGallery');
|
||||||
_this.core.$outer.find('.lg').append('<div class="lg-pager-outer"></div>');
|
|
||||||
|
this.$el = $(element);
|
||||||
if (_this.core.s.dynamic) {
|
this.core.s = $.extend({}, defaults, this.core.s);
|
||||||
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
if (this.core.s.pager && this.core.$items.length > 1) {
|
||||||
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + _this.core.s.dynamicEl[i].thumb + '" /></div></span>';
|
this.init();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
_this.core.$items.each(function() {
|
return this;
|
||||||
|
};
|
||||||
if (!_this.core.s.exThumbImage) {
|
|
||||||
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).find('img').attr('src') + '" /></div></span>';
|
Pager.prototype.init = function() {
|
||||||
} else {
|
var _this = this;
|
||||||
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).attr(_this.core.s.exThumbImage) + '" /></div></span>';
|
var pagerList = '';
|
||||||
}
|
var $pagerCont;
|
||||||
|
var $pagerOuter;
|
||||||
});
|
var timeout;
|
||||||
}
|
|
||||||
|
_this.core.$outer.find('.lg').append('<div class="lg-pager-outer"></div>');
|
||||||
$pagerOuter = _this.core.$outer.find('.lg-pager-outer');
|
|
||||||
|
if (_this.core.s.dynamic) {
|
||||||
$pagerOuter.html(pagerList);
|
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
||||||
|
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + _this.core.s.dynamicEl[i].thumb + '" /></div></span>';
|
||||||
$pagerCont = _this.core.$outer.find('.lg-pager-cont');
|
}
|
||||||
$pagerCont.on('click.lg touchend.lg', function() {
|
} else {
|
||||||
var _$this = $(this);
|
_this.core.$items.each(function() {
|
||||||
_this.core.index = _$this.index();
|
|
||||||
_this.core.slide(_this.core.index, false, false);
|
if (!_this.core.s.exThumbImage) {
|
||||||
});
|
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).find('img').attr('src') + '" /></div></span>';
|
||||||
|
} else {
|
||||||
$pagerOuter.on('mouseover.lg', function() {
|
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).attr(_this.core.s.exThumbImage) + '" /></div></span>';
|
||||||
clearTimeout(timeout);
|
}
|
||||||
$pagerOuter.addClass('lg-pager-hover');
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
$pagerOuter.on('mouseout.lg', function() {
|
|
||||||
timeout = setTimeout(function() {
|
$pagerOuter = _this.core.$outer.find('.lg-pager-outer');
|
||||||
$pagerOuter.removeClass('lg-pager-hover');
|
|
||||||
});
|
$pagerOuter.html(pagerList);
|
||||||
});
|
|
||||||
|
$pagerCont = _this.core.$outer.find('.lg-pager-cont');
|
||||||
_this.core.$el.on('onBeforeSlide.lg.tm', function(e, prevIndex, index) {
|
$pagerCont.on('click.lg touchend.lg', function() {
|
||||||
$pagerCont.removeClass('lg-pager-active');
|
var _$this = $(this);
|
||||||
$pagerCont.eq(index).addClass('lg-pager-active');
|
_this.core.index = _$this.index();
|
||||||
});
|
_this.core.slide(_this.core.index, false, true, false);
|
||||||
|
});
|
||||||
};
|
|
||||||
|
$pagerOuter.on('mouseover.lg', function() {
|
||||||
Pager.prototype.destroy = function() {
|
clearTimeout(timeout);
|
||||||
|
$pagerOuter.addClass('lg-pager-hover');
|
||||||
};
|
});
|
||||||
|
|
||||||
$.fn.lightGallery.modules.pager = Pager;
|
$pagerOuter.on('mouseout.lg', function() {
|
||||||
|
timeout = setTimeout(function() {
|
||||||
})(jQuery, window, document);
|
$pagerOuter.removeClass('lg-pager-hover');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
_this.core.$el.on('onBeforeSlide.lg.tm', function(e, prevIndex, index) {
|
||||||
|
$pagerCont.removeClass('lg-pager-active');
|
||||||
|
$pagerCont.eq(index).addClass('lg-pager-active');
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
Pager.prototype.destroy = function() {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.lightGallery.modules.pager = Pager;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
}));
|
||||||
|
|||||||
8
theme/public/lightgallery/js/lg-pager.min.js
vendored
8
theme/public/lightgallery/js/lg-pager.min.js
vendored
@@ -1,4 +1,4 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-pager - v1.0.2 - 2017-01-22
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
||||||
!function(a,b,c,d){"use strict";var e={pager:!1},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.core.s.pager&&this.core.$items.length>1&&this.init(),this};f.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('<div class="lg-pager-outer"></div>'),e.core.s.dynamic)for(var g=0;g<e.core.s.dynamicEl.length;g++)f+='<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+e.core.s.dynamicEl[g].thumb+'" /></div></span>';else e.core.$items.each(function(){f+=e.core.s.exThumbImage?'<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+a(this).attr(e.core.s.exThumbImage)+'" /></div></span>':'<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+a(this).find("img").attr("src")+'" /></div></span>'});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},f.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=f}(jQuery,window,document);
|
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={pager:!1},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),this.core.s=a.extend({},b,this.core.s),this.core.s.pager&&this.core.$items.length>1&&this.init(),this};c.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('<div class="lg-pager-outer"></div>'),e.core.s.dynamic)for(var g=0;g<e.core.s.dynamicEl.length;g++)f+='<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+e.core.s.dynamicEl[g].thumb+'" /></div></span>';else e.core.$items.each(function(){f+=e.core.s.exThumbImage?'<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+a(this).attr(e.core.s.exThumbImage)+'" /></div></span>':'<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+a(this).find("img").attr("src")+'" /></div></span>'});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!0,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},c.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=c}()});
|
||||||
@@ -1,454 +1,478 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-thumbnail - v1.2.1 - 2020-06-13
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||||
(function($, window, document, undefined) {
|
|
||||||
|
(function (root, factory) {
|
||||||
'use strict';
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||||
var defaults = {
|
define(['jquery'], function (a0) {
|
||||||
thumbnail: true,
|
return (factory(a0));
|
||||||
|
});
|
||||||
animateThumb: true,
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
currentPagerPosition: 'middle',
|
// Node. Does not work with strict CommonJS, but
|
||||||
|
// only CommonJS-like environments that support module.exports,
|
||||||
thumbWidth: 100,
|
// like Node.
|
||||||
thumbContHeight: 100,
|
module.exports = factory(require('jquery'));
|
||||||
thumbMargin: 5,
|
} else {
|
||||||
|
factory(root["jQuery"]);
|
||||||
exThumbImage: false,
|
}
|
||||||
showThumbByDefault: true,
|
}(this, function ($) {
|
||||||
toogleThumb: true,
|
|
||||||
pullCaptionUp: true,
|
(function() {
|
||||||
|
|
||||||
enableThumbDrag: true,
|
'use strict';
|
||||||
enableThumbSwipe: true,
|
|
||||||
swipeThreshold: 50,
|
var defaults = {
|
||||||
|
thumbnail: true,
|
||||||
loadYoutubeThumbnail: true,
|
|
||||||
youtubeThumbSize: 1,
|
animateThumb: true,
|
||||||
|
currentPagerPosition: 'middle',
|
||||||
loadVimeoThumbnail: true,
|
|
||||||
vimeoThumbSize: 'thumbnail_small',
|
thumbWidth: 100,
|
||||||
|
thumbHeight: '80px',
|
||||||
loadDailymotionThumbnail: true
|
thumbContHeight: 100,
|
||||||
};
|
thumbMargin: 5,
|
||||||
|
|
||||||
var Thumbnail = function(element) {
|
exThumbImage: false,
|
||||||
|
showThumbByDefault: true,
|
||||||
// get lightGallery core plugin data
|
toogleThumb: true,
|
||||||
this.core = $(element).data('lightGallery');
|
pullCaptionUp: true,
|
||||||
|
|
||||||
// extend module default settings with lightGallery core settings
|
enableThumbDrag: true,
|
||||||
this.core.s = $.extend({}, defaults, this.core.s);
|
enableThumbSwipe: true,
|
||||||
|
swipeThreshold: 50,
|
||||||
this.$el = $(element);
|
|
||||||
this.$thumbOuter = null;
|
loadYoutubeThumbnail: true,
|
||||||
this.thumbOuterWidth = 0;
|
youtubeThumbSize: 1,
|
||||||
this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
|
|
||||||
this.thumbIndex = this.core.index;
|
loadVimeoThumbnail: true,
|
||||||
|
vimeoThumbSize: 'thumbnail_small',
|
||||||
// Thumbnail animation value
|
|
||||||
this.left = 0;
|
loadDailymotionThumbnail: true
|
||||||
|
};
|
||||||
this.init();
|
|
||||||
|
var Thumbnail = function(element) {
|
||||||
return this;
|
|
||||||
};
|
// get lightGallery core plugin data
|
||||||
|
this.core = $(element).data('lightGallery');
|
||||||
Thumbnail.prototype.init = function() {
|
|
||||||
var _this = this;
|
// extend module default settings with lightGallery core settings
|
||||||
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
this.core.s = $.extend({}, defaults, this.core.s);
|
||||||
if (this.core.s.showThumbByDefault) {
|
|
||||||
setTimeout(function(){
|
this.$el = $(element);
|
||||||
_this.core.$outer.addClass('lg-thumb-open');
|
this.$thumbOuter = null;
|
||||||
}, 700);
|
this.thumbOuterWidth = 0;
|
||||||
}
|
this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
|
||||||
|
this.thumbIndex = this.core.index;
|
||||||
if (this.core.s.pullCaptionUp) {
|
|
||||||
this.core.$outer.addClass('lg-pull-caption-up');
|
if (this.core.s.animateThumb) {
|
||||||
}
|
this.core.s.thumbHeight = '100%';
|
||||||
|
}
|
||||||
this.build();
|
|
||||||
if (this.core.s.animateThumb) {
|
// Thumbnail animation value
|
||||||
if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) {
|
this.left = 0;
|
||||||
this.enableThumbDrag();
|
|
||||||
}
|
this.init();
|
||||||
|
|
||||||
if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) {
|
return this;
|
||||||
this.enableThumbSwipe();
|
};
|
||||||
}
|
|
||||||
|
Thumbnail.prototype.init = function() {
|
||||||
this.thumbClickable = false;
|
var _this = this;
|
||||||
} else {
|
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
||||||
this.thumbClickable = true;
|
if (this.core.s.showThumbByDefault) {
|
||||||
}
|
setTimeout(function(){
|
||||||
|
_this.core.$outer.addClass('lg-thumb-open');
|
||||||
this.toogle();
|
}, 700);
|
||||||
this.thumbkeyPress();
|
}
|
||||||
}
|
|
||||||
};
|
if (this.core.s.pullCaptionUp) {
|
||||||
|
this.core.$outer.addClass('lg-pull-caption-up');
|
||||||
Thumbnail.prototype.build = function() {
|
}
|
||||||
var _this = this;
|
|
||||||
var thumbList = '';
|
this.build();
|
||||||
var vimeoErrorThumbSize = '';
|
if (this.core.s.animateThumb && this.core.doCss()) {
|
||||||
var $thumb;
|
if (this.core.s.enableThumbDrag) {
|
||||||
var html = '<div class="lg-thumb-outer">' +
|
this.enableThumbDrag();
|
||||||
'<div class="lg-thumb group">' +
|
}
|
||||||
'</div>' +
|
|
||||||
'</div>';
|
if (this.core.s.enableThumbSwipe) {
|
||||||
|
this.enableThumbSwipe();
|
||||||
switch (this.core.s.vimeoThumbSize) {
|
}
|
||||||
case 'thumbnail_large':
|
|
||||||
vimeoErrorThumbSize = '640';
|
this.thumbClickable = false;
|
||||||
break;
|
} else {
|
||||||
case 'thumbnail_medium':
|
this.thumbClickable = true;
|
||||||
vimeoErrorThumbSize = '200x150';
|
}
|
||||||
break;
|
|
||||||
case 'thumbnail_small':
|
this.toogle();
|
||||||
vimeoErrorThumbSize = '100x75';
|
this.thumbkeyPress();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
_this.core.$outer.addClass('lg-has-thumb');
|
|
||||||
|
Thumbnail.prototype.build = function() {
|
||||||
_this.core.$outer.find('.lg').append(html);
|
var _this = this;
|
||||||
|
var thumbList = '';
|
||||||
_this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
|
var vimeoErrorThumbSize = '';
|
||||||
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
var $thumb;
|
||||||
|
var html = '<div class="lg-thumb-outer">' +
|
||||||
if (_this.core.s.animateThumb) {
|
'<div class="lg-thumb lg-group">' +
|
||||||
_this.core.$outer.find('.lg-thumb').css({
|
'</div>' +
|
||||||
width: _this.thumbTotalWidth + 'px',
|
'</div>';
|
||||||
position: 'relative'
|
|
||||||
});
|
switch (this.core.s.vimeoThumbSize) {
|
||||||
}
|
case 'thumbnail_large':
|
||||||
|
vimeoErrorThumbSize = '640';
|
||||||
if (this.core.s.animateThumb) {
|
break;
|
||||||
_this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
|
case 'thumbnail_medium':
|
||||||
}
|
vimeoErrorThumbSize = '200x150';
|
||||||
|
break;
|
||||||
function getThumb(src, thumb, index) {
|
case 'thumbnail_small':
|
||||||
var isVideo = _this.core.isVideo(src, index) || {};
|
vimeoErrorThumbSize = '100x75';
|
||||||
var thumbImg;
|
}
|
||||||
var vimeoId = '';
|
|
||||||
|
_this.core.$outer.addClass('lg-has-thumb');
|
||||||
if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
|
|
||||||
if (isVideo.youtube) {
|
_this.core.$outer.find('.lg').append(html);
|
||||||
if (_this.core.s.loadYoutubeThumbnail) {
|
|
||||||
thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
|
_this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
|
||||||
} else {
|
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
||||||
thumbImg = thumb;
|
|
||||||
}
|
if (_this.core.s.animateThumb) {
|
||||||
} else if (isVideo.vimeo) {
|
_this.core.$outer.find('.lg-thumb').css({
|
||||||
if (_this.core.s.loadVimeoThumbnail) {
|
width: _this.thumbTotalWidth + 'px',
|
||||||
thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
|
position: 'relative'
|
||||||
vimeoId = isVideo.vimeo[1];
|
});
|
||||||
} else {
|
}
|
||||||
thumbImg = thumb;
|
|
||||||
}
|
if (this.core.s.animateThumb) {
|
||||||
} else if (isVideo.dailymotion) {
|
_this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
|
||||||
if (_this.core.s.loadDailymotionThumbnail) {
|
}
|
||||||
thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
|
|
||||||
} else {
|
function getThumb(src, thumb, index) {
|
||||||
thumbImg = thumb;
|
var isVideo = _this.core.isVideo(src, index) || {};
|
||||||
}
|
var thumbImg;
|
||||||
}
|
var vimeoId = '';
|
||||||
} else {
|
|
||||||
thumbImg = thumb;
|
if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
|
||||||
}
|
if (isVideo.youtube) {
|
||||||
|
if (_this.core.s.loadYoutubeThumbnail) {
|
||||||
thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
|
thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
|
||||||
vimeoId = '';
|
} else {
|
||||||
}
|
thumbImg = thumb;
|
||||||
|
}
|
||||||
if (_this.core.s.dynamic) {
|
} else if (isVideo.vimeo) {
|
||||||
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
if (_this.core.s.loadVimeoThumbnail) {
|
||||||
getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i);
|
thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
|
||||||
}
|
vimeoId = isVideo.vimeo[1];
|
||||||
} else {
|
} else {
|
||||||
_this.core.$items.each(function(i) {
|
thumbImg = thumb;
|
||||||
|
}
|
||||||
if (!_this.core.s.exThumbImage) {
|
} else if (isVideo.dailymotion) {
|
||||||
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
|
if (_this.core.s.loadDailymotionThumbnail) {
|
||||||
} else {
|
thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
|
||||||
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i);
|
} else {
|
||||||
}
|
thumbImg = thumb;
|
||||||
|
}
|
||||||
});
|
}
|
||||||
}
|
} else {
|
||||||
|
thumbImg = thumb;
|
||||||
_this.core.$outer.find('.lg-thumb').html(thumbList);
|
}
|
||||||
|
|
||||||
$thumb = _this.core.$outer.find('.lg-thumb-item');
|
thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; height: ' + _this.core.s.thumbHeight + '; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
|
||||||
|
vimeoId = '';
|
||||||
// Load vimeo thumbnails
|
}
|
||||||
$thumb.each(function() {
|
|
||||||
var $this = $(this);
|
if (_this.core.s.dynamic) {
|
||||||
var vimeoVideoId = $this.attr('data-vimeo-id');
|
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
||||||
|
getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i);
|
||||||
if (vimeoVideoId) {
|
}
|
||||||
$.getJSON('http://www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
|
} else {
|
||||||
format: 'json'
|
_this.core.$items.each(function(i) {
|
||||||
}, function(data) {
|
|
||||||
$this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
|
if (!_this.core.s.exThumbImage) {
|
||||||
});
|
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
|
||||||
}
|
} else {
|
||||||
});
|
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i);
|
||||||
|
}
|
||||||
// manage active class for thumbnail
|
|
||||||
$thumb.eq(_this.core.index).addClass('active');
|
});
|
||||||
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
}
|
||||||
$thumb.removeClass('active');
|
|
||||||
$thumb.eq(_this.core.index).addClass('active');
|
_this.core.$outer.find('.lg-thumb').html(thumbList);
|
||||||
});
|
|
||||||
|
$thumb = _this.core.$outer.find('.lg-thumb-item');
|
||||||
$thumb.on('click.lg touchend.lg', function() {
|
|
||||||
var _$this = $(this);
|
// Load vimeo thumbnails
|
||||||
setTimeout(function() {
|
$thumb.each(function() {
|
||||||
|
var $this = $(this);
|
||||||
// In IE9 and bellow touch does not support
|
var vimeoVideoId = $this.attr('data-vimeo-id');
|
||||||
// Go to slide if browser does not support css transitions
|
|
||||||
if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
|
if (vimeoVideoId) {
|
||||||
_this.core.index = _$this.index();
|
$.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
|
||||||
_this.core.slide(_this.core.index, false, true);
|
format: 'json'
|
||||||
}
|
}, function(data) {
|
||||||
}, 50);
|
$this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
});
|
||||||
_this.animateThumb(_this.core.index);
|
|
||||||
});
|
// manage active class for thumbnail
|
||||||
|
$thumb.eq(_this.core.index).addClass('active');
|
||||||
$(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
|
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
||||||
setTimeout(function() {
|
$thumb.removeClass('active');
|
||||||
_this.animateThumb(_this.core.index);
|
$thumb.eq(_this.core.index).addClass('active');
|
||||||
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
});
|
||||||
}, 200);
|
|
||||||
});
|
$thumb.on('click.lg touchend.lg', function() {
|
||||||
|
var _$this = $(this);
|
||||||
};
|
setTimeout(function() {
|
||||||
|
|
||||||
Thumbnail.prototype.setTranslate = function(value) {
|
// In IE9 and bellow touch does not support
|
||||||
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
// Go to slide if browser does not support css transitions
|
||||||
this.core.$outer.find('.lg-thumb').css({
|
if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
|
||||||
transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
|
_this.core.index = _$this.index();
|
||||||
});
|
_this.core.slide(_this.core.index, false, true, false);
|
||||||
};
|
}
|
||||||
|
}, 50);
|
||||||
Thumbnail.prototype.animateThumb = function(index) {
|
});
|
||||||
var $thumb = this.core.$outer.find('.lg-thumb');
|
|
||||||
if (this.core.s.animateThumb) {
|
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
||||||
var position;
|
_this.animateThumb(_this.core.index);
|
||||||
switch (this.core.s.currentPagerPosition) {
|
});
|
||||||
case 'left':
|
|
||||||
position = 0;
|
$(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
|
||||||
break;
|
setTimeout(function() {
|
||||||
case 'middle':
|
_this.animateThumb(_this.core.index);
|
||||||
position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
|
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
||||||
break;
|
}, 200);
|
||||||
case 'right':
|
});
|
||||||
position = this.thumbOuterWidth - this.core.s.thumbWidth;
|
|
||||||
}
|
};
|
||||||
this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position;
|
|
||||||
if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) {
|
Thumbnail.prototype.setTranslate = function(value) {
|
||||||
this.left = this.thumbTotalWidth - this.thumbOuterWidth;
|
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
||||||
}
|
this.core.$outer.find('.lg-thumb').css({
|
||||||
|
transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
|
||||||
if (this.left < 0) {
|
});
|
||||||
this.left = 0;
|
};
|
||||||
}
|
|
||||||
|
Thumbnail.prototype.animateThumb = function(index) {
|
||||||
if (this.core.lGalleryOn) {
|
var $thumb = this.core.$outer.find('.lg-thumb');
|
||||||
if (!$thumb.hasClass('on')) {
|
if (this.core.s.animateThumb) {
|
||||||
this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
|
var position;
|
||||||
}
|
switch (this.core.s.currentPagerPosition) {
|
||||||
|
case 'left':
|
||||||
if (!this.core.doCss()) {
|
position = 0;
|
||||||
$thumb.animate({
|
break;
|
||||||
left: -this.left + 'px'
|
case 'middle':
|
||||||
}, this.core.s.speed);
|
position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
|
||||||
}
|
break;
|
||||||
} else {
|
case 'right':
|
||||||
if (!this.core.doCss()) {
|
position = this.thumbOuterWidth - this.core.s.thumbWidth;
|
||||||
$thumb.css('left', -this.left + 'px');
|
}
|
||||||
}
|
this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position;
|
||||||
}
|
if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) {
|
||||||
|
this.left = this.thumbTotalWidth - this.thumbOuterWidth;
|
||||||
this.setTranslate(this.left);
|
}
|
||||||
|
|
||||||
}
|
if (this.left < 0) {
|
||||||
};
|
this.left = 0;
|
||||||
|
}
|
||||||
// Enable thumbnail dragging and swiping
|
|
||||||
Thumbnail.prototype.enableThumbDrag = function() {
|
if (this.core.lGalleryOn) {
|
||||||
|
if (!$thumb.hasClass('on')) {
|
||||||
var _this = this;
|
this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
|
||||||
var startCoords = 0;
|
}
|
||||||
var endCoords = 0;
|
|
||||||
var isDraging = false;
|
if (!this.core.doCss()) {
|
||||||
var isMoved = false;
|
$thumb.animate({
|
||||||
var tempLeft = 0;
|
left: -this.left + 'px'
|
||||||
|
}, this.core.s.speed);
|
||||||
_this.$thumbOuter.addClass('lg-grab');
|
}
|
||||||
|
} else {
|
||||||
_this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
|
if (!this.core.doCss()) {
|
||||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
$thumb.css('left', -this.left + 'px');
|
||||||
// execute only on .lg-object
|
}
|
||||||
e.preventDefault();
|
}
|
||||||
startCoords = e.pageX;
|
|
||||||
isDraging = true;
|
this.setTranslate(this.left);
|
||||||
|
|
||||||
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
}
|
||||||
_this.core.$outer.scrollLeft += 1;
|
};
|
||||||
_this.core.$outer.scrollLeft -= 1;
|
|
||||||
|
// Enable thumbnail dragging and swiping
|
||||||
// *
|
Thumbnail.prototype.enableThumbDrag = function() {
|
||||||
_this.thumbClickable = false;
|
|
||||||
_this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
|
var _this = this;
|
||||||
}
|
var startCoords = 0;
|
||||||
});
|
var endCoords = 0;
|
||||||
|
var isDraging = false;
|
||||||
$(window).on('mousemove.lg.thumb', function(e) {
|
var isMoved = false;
|
||||||
if (isDraging) {
|
var tempLeft = 0;
|
||||||
tempLeft = _this.left;
|
|
||||||
isMoved = true;
|
_this.$thumbOuter.addClass('lg-grab');
|
||||||
endCoords = e.pageX;
|
|
||||||
|
_this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
|
||||||
_this.$thumbOuter.addClass('lg-dragging');
|
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||||
|
// execute only on .lg-object
|
||||||
tempLeft = tempLeft - (endCoords - startCoords);
|
e.preventDefault();
|
||||||
|
startCoords = e.pageX;
|
||||||
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
isDraging = true;
|
||||||
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
|
||||||
}
|
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
||||||
|
_this.core.$outer.scrollLeft += 1;
|
||||||
if (tempLeft < 0) {
|
_this.core.$outer.scrollLeft -= 1;
|
||||||
tempLeft = 0;
|
|
||||||
}
|
// *
|
||||||
|
_this.thumbClickable = false;
|
||||||
// move current slide
|
_this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
|
||||||
_this.setTranslate(tempLeft);
|
}
|
||||||
|
});
|
||||||
}
|
|
||||||
});
|
$(window).on('mousemove.lg.thumb', function(e) {
|
||||||
|
if (isDraging) {
|
||||||
$(window).on('mouseup.lg.thumb', function() {
|
tempLeft = _this.left;
|
||||||
if (isMoved) {
|
isMoved = true;
|
||||||
isMoved = false;
|
endCoords = e.pageX;
|
||||||
_this.$thumbOuter.removeClass('lg-dragging');
|
|
||||||
|
_this.$thumbOuter.addClass('lg-dragging');
|
||||||
_this.left = tempLeft;
|
|
||||||
|
tempLeft = tempLeft - (endCoords - startCoords);
|
||||||
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
|
||||||
_this.thumbClickable = true;
|
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
||||||
}
|
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
||||||
|
}
|
||||||
} else {
|
|
||||||
_this.thumbClickable = true;
|
if (tempLeft < 0) {
|
||||||
}
|
tempLeft = 0;
|
||||||
|
}
|
||||||
if (isDraging) {
|
|
||||||
isDraging = false;
|
// move current slide
|
||||||
_this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
|
_this.setTranslate(tempLeft);
|
||||||
}
|
|
||||||
});
|
}
|
||||||
|
});
|
||||||
};
|
|
||||||
|
$(window).on('mouseup.lg.thumb', function() {
|
||||||
Thumbnail.prototype.enableThumbSwipe = function() {
|
if (isMoved) {
|
||||||
var _this = this;
|
isMoved = false;
|
||||||
var startCoords = 0;
|
_this.$thumbOuter.removeClass('lg-dragging');
|
||||||
var endCoords = 0;
|
|
||||||
var isMoved = false;
|
_this.left = tempLeft;
|
||||||
var tempLeft = 0;
|
|
||||||
|
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
||||||
_this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
|
_this.thumbClickable = true;
|
||||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
}
|
||||||
e.preventDefault();
|
|
||||||
startCoords = e.originalEvent.targetTouches[0].pageX;
|
} else {
|
||||||
_this.thumbClickable = false;
|
_this.thumbClickable = true;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
if (isDraging) {
|
||||||
_this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
|
isDraging = false;
|
||||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
_this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
|
||||||
e.preventDefault();
|
}
|
||||||
endCoords = e.originalEvent.targetTouches[0].pageX;
|
});
|
||||||
isMoved = true;
|
|
||||||
|
};
|
||||||
_this.$thumbOuter.addClass('lg-dragging');
|
|
||||||
|
Thumbnail.prototype.enableThumbSwipe = function() {
|
||||||
tempLeft = _this.left;
|
var _this = this;
|
||||||
|
var startCoords = 0;
|
||||||
tempLeft = tempLeft - (endCoords - startCoords);
|
var endCoords = 0;
|
||||||
|
var isMoved = false;
|
||||||
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
var tempLeft = 0;
|
||||||
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
|
||||||
}
|
_this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
|
||||||
|
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||||
if (tempLeft < 0) {
|
e.preventDefault();
|
||||||
tempLeft = 0;
|
startCoords = e.originalEvent.targetTouches[0].pageX;
|
||||||
}
|
_this.thumbClickable = false;
|
||||||
|
}
|
||||||
// move current slide
|
});
|
||||||
_this.setTranslate(tempLeft);
|
|
||||||
|
_this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
|
||||||
}
|
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||||
});
|
e.preventDefault();
|
||||||
|
endCoords = e.originalEvent.targetTouches[0].pageX;
|
||||||
_this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
|
isMoved = true;
|
||||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
|
||||||
|
_this.$thumbOuter.addClass('lg-dragging');
|
||||||
if (isMoved) {
|
|
||||||
isMoved = false;
|
tempLeft = _this.left;
|
||||||
_this.$thumbOuter.removeClass('lg-dragging');
|
|
||||||
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
tempLeft = tempLeft - (endCoords - startCoords);
|
||||||
_this.thumbClickable = true;
|
|
||||||
}
|
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
||||||
|
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
||||||
_this.left = tempLeft;
|
}
|
||||||
} else {
|
|
||||||
_this.thumbClickable = true;
|
if (tempLeft < 0) {
|
||||||
}
|
tempLeft = 0;
|
||||||
} else {
|
}
|
||||||
_this.thumbClickable = true;
|
|
||||||
}
|
// move current slide
|
||||||
});
|
_this.setTranslate(tempLeft);
|
||||||
|
|
||||||
};
|
}
|
||||||
|
});
|
||||||
Thumbnail.prototype.toogle = function() {
|
|
||||||
var _this = this;
|
_this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
|
||||||
if (_this.core.s.toogleThumb) {
|
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||||
_this.core.$outer.addClass('lg-can-toggle');
|
|
||||||
_this.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>');
|
if (isMoved) {
|
||||||
_this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
|
isMoved = false;
|
||||||
_this.core.$outer.toggleClass('lg-thumb-open');
|
_this.$thumbOuter.removeClass('lg-dragging');
|
||||||
});
|
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
||||||
}
|
_this.thumbClickable = true;
|
||||||
};
|
}
|
||||||
|
|
||||||
Thumbnail.prototype.thumbkeyPress = function() {
|
_this.left = tempLeft;
|
||||||
var _this = this;
|
} else {
|
||||||
$(window).on('keydown.lg.thumb', function(e) {
|
_this.thumbClickable = true;
|
||||||
if (e.keyCode === 38) {
|
}
|
||||||
e.preventDefault();
|
} else {
|
||||||
_this.core.$outer.addClass('lg-thumb-open');
|
_this.thumbClickable = true;
|
||||||
} else if (e.keyCode === 40) {
|
}
|
||||||
e.preventDefault();
|
});
|
||||||
_this.core.$outer.removeClass('lg-thumb-open');
|
|
||||||
}
|
};
|
||||||
});
|
|
||||||
};
|
Thumbnail.prototype.toogle = function() {
|
||||||
|
var _this = this;
|
||||||
Thumbnail.prototype.destroy = function() {
|
if (_this.core.s.toogleThumb) {
|
||||||
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
_this.core.$outer.addClass('lg-can-toggle');
|
||||||
$(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb');
|
_this.$thumbOuter.append('<button type="button" aria-label="Toggle thumbnails" class="lg-toogle-thumb lg-icon"></button>');
|
||||||
this.$thumbOuter.remove();
|
_this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
|
||||||
this.core.$outer.removeClass('lg-has-thumb');
|
_this.core.$outer.toggleClass('lg-thumb-open');
|
||||||
}
|
});
|
||||||
};
|
}
|
||||||
|
};
|
||||||
$.fn.lightGallery.modules.Thumbnail = Thumbnail;
|
|
||||||
|
Thumbnail.prototype.thumbkeyPress = function() {
|
||||||
})(jQuery, window, document);
|
var _this = this;
|
||||||
|
$(window).on('keydown.lg.thumb', function(e) {
|
||||||
|
if (e.keyCode === 38) {
|
||||||
|
e.preventDefault();
|
||||||
|
_this.core.$outer.addClass('lg-thumb-open');
|
||||||
|
} else if (e.keyCode === 40) {
|
||||||
|
e.preventDefault();
|
||||||
|
_this.core.$outer.removeClass('lg-thumb-open');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Thumbnail.prototype.destroy = function() {
|
||||||
|
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
||||||
|
$(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb');
|
||||||
|
this.$thumbOuter.remove();
|
||||||
|
this.core.$outer.removeClass('lg-has-thumb');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.lightGallery.modules.Thumbnail = Thumbnail;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
}));
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,277 +1,357 @@
|
|||||||
/*! lightgallery - v1.2.14 - 2016-01-18
|
/*! lg-video - v1.4.0 - November-07-2020
|
||||||
* http://sachinchoolur.github.io/lightGallery/
|
* http://sachinchoolur.github.io/lightGallery
|
||||||
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||||
(function($, window, document, undefined) {
|
|
||||||
|
(function (root, factory) {
|
||||||
'use strict';
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||||
var defaults = {
|
define(['jquery'], function (a0) {
|
||||||
videoMaxWidth: '855px',
|
return (factory(a0));
|
||||||
youtubePlayerParams: false,
|
});
|
||||||
vimeoPlayerParams: false,
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
dailymotionPlayerParams: false,
|
// Node. Does not work with strict CommonJS, but
|
||||||
videojs: false
|
// only CommonJS-like environments that support module.exports,
|
||||||
};
|
// like Node.
|
||||||
|
module.exports = factory(require('jquery'));
|
||||||
var Video = function(element) {
|
} else {
|
||||||
|
factory(root["jQuery"]);
|
||||||
this.core = $(element).data('lightGallery');
|
}
|
||||||
|
}(this, function ($) {
|
||||||
this.$el = $(element);
|
|
||||||
this.core.s = $.extend({}, defaults, this.core.s);
|
(function() {
|
||||||
this.videoLoaded = false;
|
|
||||||
|
'use strict';
|
||||||
this.init();
|
|
||||||
|
var defaults = {
|
||||||
return this;
|
videoMaxWidth: '855px',
|
||||||
};
|
|
||||||
|
autoplayFirstVideo: true,
|
||||||
Video.prototype.init = function() {
|
|
||||||
var _this = this;
|
youtubePlayerParams: false,
|
||||||
|
vimeoPlayerParams: false,
|
||||||
// Event triggered when video url found without poster
|
dailymotionPlayerParams: false,
|
||||||
_this.core.$el.on('hasVideo.lg.tm', function(event, index, src, html) {
|
vkPlayerParams: false,
|
||||||
_this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
|
|
||||||
if (html) {
|
videojs: false,
|
||||||
if (_this.core.s.videojs) {
|
videojsOptions: {}
|
||||||
try {
|
};
|
||||||
videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), {}, function() {
|
|
||||||
if (!_this.videoLoaded) {
|
var Video = function(element) {
|
||||||
this.play();
|
|
||||||
}
|
this.core = $(element).data('lightGallery');
|
||||||
});
|
|
||||||
} catch (e) {
|
this.$el = $(element);
|
||||||
console.error('Make sure you have included videojs');
|
this.core.s = $.extend({}, defaults, this.core.s);
|
||||||
}
|
this.videoLoaded = false;
|
||||||
} else {
|
|
||||||
_this.core.$slide.eq(index).find('.lg-html5').get(0).play();
|
this.init();
|
||||||
}
|
|
||||||
}
|
return this;
|
||||||
});
|
};
|
||||||
|
|
||||||
// Set max width for video
|
Video.prototype.init = function() {
|
||||||
_this.core.$el.on('onAferAppendSlide.lg.tm', function(event, index) {
|
var _this = this;
|
||||||
_this.core.$slide.eq(index).find('.lg-video-cont').css('max-width', _this.core.s.videoMaxWidth);
|
|
||||||
_this.videoLoaded = true;
|
// Event triggered when video url found without poster
|
||||||
});
|
_this.core.$el.on('hasVideo.lg.tm', onHasVideo.bind(this));
|
||||||
|
|
||||||
var loadOnClick = function($el) {
|
// Set max width for video
|
||||||
// check slide has poster
|
_this.core.$el.on('onAferAppendSlide.lg.tm', onAferAppendSlide.bind(this));
|
||||||
if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
|
|
||||||
|
if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) {
|
||||||
// chack already video element present
|
_this.core.$el.on('onSlideClick.lg.tm', function() {
|
||||||
if (!$el.hasClass('lg-has-video')) {
|
var $el = _this.core.$slide.eq(_this.core.index);
|
||||||
|
_this.loadVideoOnclick($el);
|
||||||
$el.addClass('lg-video-palying lg-has-video');
|
});
|
||||||
|
} else {
|
||||||
var _src;
|
|
||||||
var _html;
|
// For IE 9 and bellow
|
||||||
var _loadVideo = function(_src, _html) {
|
_this.core.$slide.on('click.lg', function() {
|
||||||
|
_this.loadVideoOnclick($(this));
|
||||||
$el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
|
});
|
||||||
|
}
|
||||||
if (_html) {
|
|
||||||
if (_this.core.s.videojs) {
|
_this.core.$el.on('onBeforeSlide.lg.tm', onBeforeSlide.bind(this));
|
||||||
try {
|
|
||||||
videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), {}, function() {
|
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) {
|
||||||
this.play();
|
_this.core.$slide.eq(prevIndex).removeClass('lg-video-playing');
|
||||||
});
|
});
|
||||||
} catch (e) {
|
|
||||||
console.error('Make sure you have included videojs');
|
if (_this.core.s.autoplayFirstVideo) {
|
||||||
}
|
_this.core.$el.on('onAferAppendSlide.lg.tm', function (e, index) {
|
||||||
} else {
|
if (!_this.core.lGalleryOn) {
|
||||||
_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
|
var $el = _this.core.$slide.eq(index);
|
||||||
}
|
setTimeout(function () {
|
||||||
}
|
_this.loadVideoOnclick($el);
|
||||||
|
}, 100);
|
||||||
};
|
}
|
||||||
|
});
|
||||||
if (_this.core.s.dynamic) {
|
}
|
||||||
|
};
|
||||||
_src = _this.core.s.dynamicEl[_this.core.index].src;
|
|
||||||
_html = _this.core.s.dynamicEl[_this.core.index].html;
|
Video.prototype.loadVideo = function(src, addClass, noPoster, index, html) {
|
||||||
|
var _this = this;
|
||||||
_loadVideo(_src, _html);
|
var video = '';
|
||||||
|
var autoplay = 1;
|
||||||
} else {
|
var a = '';
|
||||||
|
var isVideo = this.core.isVideo(src, index) || {};
|
||||||
_src = _this.core.$items.eq(_this.core.index).attr('href') || _this.core.$items.eq(_this.core.index).attr('data-src');
|
var videoTitle;
|
||||||
_html = _this.core.$items.eq(_this.core.index).attr('data-html');
|
|
||||||
|
if (_this.core.s.dynamic) {
|
||||||
_loadVideo(_src, _html);
|
videoTitle = _this.core.s.dynamicEl[_this.core.index].title;
|
||||||
|
} else {
|
||||||
}
|
videoTitle = _this.core.$items.eq(_this.core.index).attr('title') || _this.core.$items.eq(_this.core.index).find('img').first().attr('alt');
|
||||||
|
}
|
||||||
var $tempImg = $el.find('.lg-object');
|
|
||||||
$el.find('.lg-video').append($tempImg);
|
videoTitle = videoTitle ? 'title="' + videoTitle + '"' : '';
|
||||||
|
|
||||||
// @todo loading icon for html5 videos also
|
// Enable autoplay based on setting for first video if poster doesn't exist
|
||||||
// for showing the loading indicator while loading video
|
if (noPoster) {
|
||||||
if (!$el.find('.lg-video-object').hasClass('lg-html5')) {
|
if (this.videoLoaded) {
|
||||||
$el.removeClass('lg-complete');
|
autoplay = 0;
|
||||||
$el.find('.lg-video-object').on('load.lg error.lg', function() {
|
} else {
|
||||||
$el.addClass('lg-complete');
|
autoplay = this.core.s.autoplayFirstVideo ? 1 : 0;
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
if (isVideo.youtube) {
|
||||||
|
|
||||||
var youtubePlayer = $el.find('.lg-youtube').get(0);
|
a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
|
||||||
var vimeoPlayer = $el.find('.lg-vimeo').get(0);
|
if (this.core.s.youtubePlayerParams) {
|
||||||
var dailymotionPlayer = $el.find('.lg-dailymotion').get(0);
|
a = a + '&' + $.param(this.core.s.youtubePlayerParams);
|
||||||
var html5Player = $el.find('.lg-html5').get(0);
|
}
|
||||||
if (youtubePlayer) {
|
|
||||||
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
|
video = '<iframe allow="autoplay" class="lg-video-object lg-youtube ' + addClass + '" ' + videoTitle + ' width="560" height="315" src="//www.youtube.com/embed/' + isVideo.youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>';
|
||||||
} else if (vimeoPlayer) {
|
|
||||||
try {
|
} else if (isVideo.vimeo) {
|
||||||
$f(vimeoPlayer).api('play');
|
|
||||||
} catch (e) {
|
a = '?autoplay=' + autoplay;
|
||||||
console.error('Make sure you have included froogaloop2 js');
|
if (this.core.s.vimeoPlayerParams) {
|
||||||
}
|
a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
|
||||||
} else if (dailymotionPlayer) {
|
}
|
||||||
dailymotionPlayer.contentWindow.postMessage('play', '*');
|
|
||||||
|
video = '<iframe allow="autoplay" class="lg-video-object lg-vimeo ' + addClass + '" ' + videoTitle + ' width="560" height="315" src="//player.vimeo.com/video/' + isVideo.vimeo[1] + a + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
||||||
} else if (html5Player) {
|
|
||||||
if (_this.core.s.videojs) {
|
} else if (isVideo.dailymotion) {
|
||||||
try {
|
|
||||||
videojs(html5Player).play();
|
a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
|
||||||
} catch (e) {
|
if (this.core.s.dailymotionPlayerParams) {
|
||||||
console.error('Make sure you have included videojs');
|
a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
html5Player.play();
|
video = '<iframe allow="autoplay" class="lg-video-object lg-dailymotion ' + addClass + '" ' + videoTitle + ' width="560" height="315" src="//www.dailymotion.com/embed/video/' + isVideo.dailymotion[1] + a + '" frameborder="0" allowfullscreen></iframe>';
|
||||||
}
|
|
||||||
}
|
} else if (isVideo.html5) {
|
||||||
|
var fL = html.substring(0, 1);
|
||||||
$el.addClass('lg-video-palying');
|
if (fL === '.' || fL === '#') {
|
||||||
|
html = $(html).html();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
video = html;
|
||||||
|
|
||||||
if (_this.core.doCss() && _this.core.$items.length > 1 && ((_this.core.s.enableSwipe && _this.core.isTouch) || (_this.core.s.enableDrag && !_this.core.isTouch))) {
|
} else if (isVideo.vk) {
|
||||||
_this.core.$el.on('onSlideClick.lg.tm', function() {
|
|
||||||
var $el = _this.core.$slide.eq(_this.core.index);
|
a = '&autoplay=' + autoplay;
|
||||||
loadOnClick($el);
|
if (this.core.s.vkPlayerParams) {
|
||||||
});
|
a = a + '&' + $.param(this.core.s.vkPlayerParams);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
// For IE 9 and bellow
|
video = '<iframe allow="autoplay" class="lg-video-object lg-vk ' + addClass + '" ' + videoTitle + ' width="560" height="315" src="//vk.com/video_ext.php?' + isVideo.vk[1] + a + '" frameborder="0" allowfullscreen></iframe>';
|
||||||
_this.core.$slide.on('click.lg', function() {
|
|
||||||
loadOnClick($(this));
|
}
|
||||||
});
|
|
||||||
}
|
return video;
|
||||||
|
};
|
||||||
_this.core.$el.on('onBeforeSlide.lg.tm', function(event, prevIndex, index) {
|
|
||||||
|
Video.prototype.loadVideoOnclick = function($el){
|
||||||
var $videoSlide = _this.core.$slide.eq(prevIndex);
|
|
||||||
var youtubePlayer = $videoSlide.find('.lg-youtube').get(0);
|
var _this = this;
|
||||||
var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0);
|
// check slide has poster
|
||||||
var dailymotionPlayer = $videoSlide.find('.lg-dailymotion').get(0);
|
if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
|
||||||
var html5Player = $videoSlide.find('.lg-html5').get(0);
|
|
||||||
if (youtubePlayer) {
|
// check already video element present
|
||||||
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
|
if (!$el.hasClass('lg-has-video')) {
|
||||||
} else if (vimeoPlayer) {
|
|
||||||
try {
|
$el.addClass('lg-video-playing lg-has-video');
|
||||||
$f(vimeoPlayer).api('pause');
|
|
||||||
} catch (e) {
|
var _src;
|
||||||
console.error('Make sure you have included froogaloop2 js');
|
var _html;
|
||||||
}
|
var _loadVideo = function(_src, _html) {
|
||||||
} else if (dailymotionPlayer) {
|
|
||||||
dailymotionPlayer.contentWindow.postMessage('pause', '*');
|
$el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
|
||||||
|
|
||||||
} else if (html5Player) {
|
if (_html) {
|
||||||
if (_this.core.s.videojs) {
|
if (_this.core.s.videojs) {
|
||||||
try {
|
try {
|
||||||
videojs(html5Player).pause();
|
videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
||||||
} catch (e) {
|
this.play();
|
||||||
console.error('Make sure you have included videojs');
|
});
|
||||||
}
|
} catch (e) {
|
||||||
} else {
|
console.error('lightGallery:- Make sure you have included videojs');
|
||||||
html5Player.pause();
|
}
|
||||||
}
|
} else {
|
||||||
}
|
_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
|
||||||
|
}
|
||||||
var _src;
|
}
|
||||||
if (_this.core.s.dynamic) {
|
|
||||||
_src = _this.core.s.dynamicEl[index].src;
|
};
|
||||||
} else {
|
|
||||||
_src = _this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src');
|
if (_this.core.s.dynamic) {
|
||||||
|
|
||||||
}
|
_src = _this.core.s.dynamicEl[_this.core.index].src;
|
||||||
|
_html = _this.core.s.dynamicEl[_this.core.index].html;
|
||||||
var _isVideo = _this.core.isVideo(_src, index) || {};
|
|
||||||
if (_isVideo.youtube || _isVideo.vimeo || _isVideo.dailymotion) {
|
_loadVideo(_src, _html);
|
||||||
_this.core.$outer.addClass('lg-hide-download');
|
|
||||||
}
|
} else {
|
||||||
|
|
||||||
//$videoSlide.addClass('lg-complete');
|
_src = _this.core.$items.eq(_this.core.index).attr('href') || _this.core.$items.eq(_this.core.index).attr('data-src');
|
||||||
|
_html = _this.core.$items.eq(_this.core.index).attr('data-html');
|
||||||
});
|
|
||||||
|
_loadVideo(_src, _html);
|
||||||
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) {
|
|
||||||
_this.core.$slide.eq(prevIndex).removeClass('lg-video-palying');
|
}
|
||||||
});
|
|
||||||
};
|
var $tempImg = $el.find('.lg-object');
|
||||||
|
$el.find('.lg-video').append($tempImg);
|
||||||
Video.prototype.loadVideo = function(src, addClass, noposter, index, html) {
|
|
||||||
var video = '';
|
// @todo loading icon for html5 videos also
|
||||||
var autoplay = 1;
|
// for showing the loading indicator while loading video
|
||||||
var a = '';
|
if (!$el.find('.lg-video-object').hasClass('lg-html5')) {
|
||||||
var isVideo = this.core.isVideo(src, index) || {};
|
$el.removeClass('lg-complete');
|
||||||
|
$el.find('.lg-video-object').on('load.lg error.lg', function() {
|
||||||
// Enable autoplay for first video if poster doesn't exist
|
$el.addClass('lg-complete');
|
||||||
if (noposter) {
|
});
|
||||||
if (this.videoLoaded) {
|
}
|
||||||
autoplay = 0;
|
|
||||||
} else {
|
} else {
|
||||||
autoplay = 1;
|
|
||||||
}
|
var youtubePlayer = $el.find('.lg-youtube').get(0);
|
||||||
}
|
var vimeoPlayer = $el.find('.lg-vimeo').get(0);
|
||||||
|
var dailymotionPlayer = $el.find('.lg-dailymotion').get(0);
|
||||||
if (isVideo.youtube) {
|
var html5Player = $el.find('.lg-html5').get(0);
|
||||||
|
if (youtubePlayer) {
|
||||||
a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
|
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
|
||||||
if (this.core.s.youtubePlayerParams) {
|
} else if (vimeoPlayer) {
|
||||||
a = a + '&' + $.param(this.core.s.youtubePlayerParams);
|
try {
|
||||||
}
|
new Vimeo.Player(vimeoPlayer).play().catch(function(error) {
|
||||||
|
console.error('error playing the video:', error.name);
|
||||||
video = '<iframe class="lg-video-object lg-youtube ' + addClass + '" width="560" height="315" src="//www.youtube.com/embed/' + isVideo.youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>';
|
});
|
||||||
|
} catch (e) {
|
||||||
} else if (isVideo.vimeo) {
|
console.warn('lightGallery:- Make sure you have included https://github.com/vimeo/player.js');
|
||||||
|
}
|
||||||
a = '?autoplay=' + autoplay + '&api=1';
|
} else if (dailymotionPlayer) {
|
||||||
if (this.core.s.vimeoPlayerParams) {
|
dailymotionPlayer.contentWindow.postMessage('play', '*');
|
||||||
a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
|
|
||||||
}
|
} else if (html5Player) {
|
||||||
|
if (_this.core.s.videojs) {
|
||||||
video = '<iframe class="lg-video-object lg-vimeo ' + addClass + '" width="560" height="315" src="http://player.vimeo.com/video/' + isVideo.vimeo[1] + a + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
try {
|
||||||
|
videojs(html5Player).play();
|
||||||
} else if (isVideo.dailymotion) {
|
} catch (e) {
|
||||||
|
console.error('lightGallery:- Make sure you have included videojs');
|
||||||
a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
|
}
|
||||||
if (this.core.s.dailymotionPlayerParams) {
|
} else {
|
||||||
a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
|
html5Player.play();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
video = '<iframe class="lg-video-object lg-dailymotion ' + addClass + '" width="560" height="315" src="//www.dailymotion.com/embed/video/' + isVideo.dailymotion[1] + a + '" frameborder="0" allowfullscreen></iframe>';
|
|
||||||
|
$el.addClass('lg-video-playing');
|
||||||
} else if (isVideo.html5) {
|
|
||||||
var fL = html.substring(0, 1);
|
}
|
||||||
if (fL === '.' || fL === '#') {
|
}
|
||||||
html = $(html).html();
|
};
|
||||||
}
|
|
||||||
|
Video.prototype.destroy = function() {
|
||||||
video = html;
|
this.videoLoaded = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
return video;
|
function onHasVideo(event, index, src, html) {
|
||||||
};
|
/*jshint validthis:true */
|
||||||
|
var _this = this;
|
||||||
Video.prototype.destroy = function() {
|
_this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
|
||||||
this.videoLoaded = false;
|
if (html) {
|
||||||
};
|
if (_this.core.s.videojs) {
|
||||||
|
try {
|
||||||
$.fn.lightGallery.modules.video = Video;
|
videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
||||||
|
if (!_this.videoLoaded && _this.core.s.autoplayFirstVideo) {
|
||||||
})(jQuery, window, document);
|
this.play();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error('lightGallery:- Make sure you have included videojs');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(!_this.videoLoaded && _this.core.s.autoplayFirstVideo) {
|
||||||
|
_this.core.$slide.eq(index).find('.lg-html5').get(0).play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAferAppendSlide(event, index) {
|
||||||
|
/*jshint validthis:true */
|
||||||
|
var $videoCont = this.core.$slide.eq(index).find('.lg-video-cont');
|
||||||
|
if (!$videoCont.hasClass('lg-has-iframe')) {
|
||||||
|
$videoCont.css('max-width', this.core.s.videoMaxWidth);
|
||||||
|
this.videoLoaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onBeforeSlide(event, prevIndex, index) {
|
||||||
|
/*jshint validthis:true */
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var $videoSlide = _this.core.$slide.eq(prevIndex);
|
||||||
|
var youtubePlayer = $videoSlide.find('.lg-youtube').get(0);
|
||||||
|
var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0);
|
||||||
|
var dailymotionPlayer = $videoSlide.find('.lg-dailymotion').get(0);
|
||||||
|
var vkPlayer = $videoSlide.find('.lg-vk').get(0);
|
||||||
|
var html5Player = $videoSlide.find('.lg-html5').get(0);
|
||||||
|
if (youtubePlayer) {
|
||||||
|
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
|
||||||
|
} else if (vimeoPlayer) {
|
||||||
|
try {
|
||||||
|
new Vimeo.Player(vimeoPlayer).pause().catch(function(error) {
|
||||||
|
console.error('Unable to pause the video:', error.name);
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('lightGallery:- Make sure you have included https://github.com/vimeo/player.js');
|
||||||
|
}
|
||||||
|
} else if (dailymotionPlayer) {
|
||||||
|
dailymotionPlayer.contentWindow.postMessage('pause', '*');
|
||||||
|
|
||||||
|
} else if (html5Player) {
|
||||||
|
if (_this.core.s.videojs) {
|
||||||
|
try {
|
||||||
|
videojs(html5Player).pause();
|
||||||
|
} catch (e) {
|
||||||
|
console.error('lightGallery:- Make sure you have included videojs');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
html5Player.pause();
|
||||||
|
}
|
||||||
|
} if (vkPlayer) {
|
||||||
|
$(vkPlayer).attr('src', $(vkPlayer).attr('src').replace('&autoplay', '&noplay'));
|
||||||
|
}
|
||||||
|
|
||||||
|
var _src;
|
||||||
|
if (_this.core.s.dynamic) {
|
||||||
|
_src = _this.core.s.dynamicEl[index].src;
|
||||||
|
} else {
|
||||||
|
_src = _this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var _isVideo = _this.core.isVideo(_src, index) || {};
|
||||||
|
if (_isVideo.youtube || _isVideo.vimeo || _isVideo.dailymotion || _isVideo.vk) {
|
||||||
|
_this.core.$outer.addClass('lg-hide-download');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.lightGallery.modules.video = Video;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
}));
|
||||||
|
|||||||
8
theme/public/lightgallery/js/lg-video.min.js
vendored
8
theme/public/lightgallery/js/lg-video.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
8
theme/public/lightgallery/js/lg-zoom.min.js
vendored
8
theme/public/lightgallery/js/lg-zoom.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user