restore composer.json, add mysqli extension
This commit is contained in:
8
public/vendor/site/libs/lightgallery/css/js/jquery.mousewheel.min.js
vendored
Executable file
8
public/vendor/site/libs/lightgallery/css/js/jquery.mousewheel.min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* jQuery Mousewheel 3.1.13
|
||||
*
|
||||
* Copyright 2015 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
||||
206
public/vendor/site/libs/lightgallery/css/js/lg-autoplay.js
vendored
Executable file
206
public/vendor/site/libs/lightgallery/css/js/lg-autoplay.js
vendored
Executable file
@@ -0,0 +1,206 @@
|
||||
/*! lg-autoplay - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
autoplay: false,
|
||||
pause: 5000,
|
||||
progressBar: true,
|
||||
fourceAutoplay: false,
|
||||
autoplayControls: true,
|
||||
appendAutoplayControlsTo: '.lg-toolbar'
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates the autoplay plugin.
|
||||
* @param {object} element - lightGallery element
|
||||
*/
|
||||
var Autoplay = function(element) {
|
||||
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.$el = $(element);
|
||||
|
||||
// Execute only if items are above 1
|
||||
if (this.core.$items.length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
this.interval = false;
|
||||
|
||||
// Identify if slide happened from autoplay
|
||||
this.fromAuto = true;
|
||||
|
||||
// Identify if autoplay canceled from touch/drag
|
||||
this.canceledOnTouch = false;
|
||||
|
||||
// save fourceautoplay value
|
||||
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
||||
|
||||
// do not allow progress bar if browser does not support css3 transitions
|
||||
if (!this.core.doCss()) {
|
||||
this.core.s.progressBar = false;
|
||||
}
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Autoplay.prototype.init = function() {
|
||||
var _this = this;
|
||||
|
||||
// append autoplay controls
|
||||
if (_this.core.s.autoplayControls) {
|
||||
_this.controls();
|
||||
}
|
||||
|
||||
// Create progress bar
|
||||
if (_this.core.s.progressBar) {
|
||||
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
||||
}
|
||||
|
||||
// set progress
|
||||
_this.progress();
|
||||
|
||||
// Start autoplay
|
||||
if (_this.core.s.autoplay) {
|
||||
_this.$el.one('onSlideItemLoad.lg.tm', function() {
|
||||
_this.startlAuto();
|
||||
});
|
||||
}
|
||||
|
||||
// cancel interval on touchstart and dragstart
|
||||
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
||||
if (_this.interval) {
|
||||
_this.cancelAuto();
|
||||
_this.canceledOnTouch = true;
|
||||
}
|
||||
});
|
||||
|
||||
// restore autoplay if autoplay canceled from touchstart / dragstart
|
||||
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
||||
if (!_this.interval && _this.canceledOnTouch) {
|
||||
_this.startlAuto();
|
||||
_this.canceledOnTouch = false;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Autoplay.prototype.progress = function() {
|
||||
|
||||
var _this = this;
|
||||
var _$progressBar;
|
||||
var _$progress;
|
||||
|
||||
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
||||
|
||||
// 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');
|
||||
_$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);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
||||
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
||||
_this.cancelAuto();
|
||||
}
|
||||
|
||||
_this.fromAuto = false;
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
// Manage autoplay via play/stop buttons
|
||||
Autoplay.prototype.controls = function() {
|
||||
var _this = this;
|
||||
var _html = '<button aria-label="Toggle autoplay" class="lg-autoplay-button lg-icon"></button>';
|
||||
|
||||
// Append autoplay controls
|
||||
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
||||
|
||||
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
||||
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
||||
_this.cancelAuto();
|
||||
_this.core.s.fourceAutoplay = false;
|
||||
} else {
|
||||
if (!_this.interval) {
|
||||
_this.startlAuto();
|
||||
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Autostart gallery
|
||||
Autoplay.prototype.startlAuto = function() {
|
||||
var _this = this;
|
||||
|
||||
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
||||
_this.core.$outer.addClass('lg-show-autoplay');
|
||||
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
||||
|
||||
_this.interval = setInterval(function() {
|
||||
if (_this.core.index + 1 < _this.core.$items.length) {
|
||||
_this.core.index++;
|
||||
} else {
|
||||
_this.core.index = 0;
|
||||
}
|
||||
|
||||
_this.fromAuto = true;
|
||||
_this.core.slide(_this.core.index, false, false, 'next');
|
||||
}, _this.core.s.speed + _this.core.s.pause);
|
||||
};
|
||||
|
||||
// cancel Autostart
|
||||
Autoplay.prototype.cancelAuto = function() {
|
||||
clearInterval(this.interval);
|
||||
this.interval = false;
|
||||
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');
|
||||
};
|
||||
|
||||
Autoplay.prototype.destroy = function() {
|
||||
|
||||
this.cancelAuto();
|
||||
this.core.$outer.find('.lg-progress-bar').remove();
|
||||
};
|
||||
|
||||
$.fn.lightGallery.modules.autoplay = Autoplay;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
}));
|
||||
126
public/vendor/site/libs/lightgallery/css/js/lg-fullscreen.js
vendored
Executable file
126
public/vendor/site/libs/lightgallery/css/js/lg-fullscreen.js
vendored
Executable file
@@ -0,0 +1,126 @@
|
||||
/*! lg-fullscreen - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
fullScreen: true
|
||||
};
|
||||
|
||||
function isFullScreen() {
|
||||
return (
|
||||
document.fullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.msFullscreenElement
|
||||
);
|
||||
}
|
||||
|
||||
var Fullscreen = function(element) {
|
||||
|
||||
// get lightGallery core plugin data
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.$el = $(element);
|
||||
|
||||
// extend module defalut settings with lightGallery core settings
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Fullscreen.prototype.init = function() {
|
||||
var fullScreen = '';
|
||||
if (this.core.s.fullScreen) {
|
||||
|
||||
// check for fullscreen browser support
|
||||
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
||||
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
||||
return;
|
||||
} else {
|
||||
fullScreen = '<button aria-label="Toggle fullscreen" class="lg-fullscreen lg-icon"></button>';
|
||||
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
||||
this.fullScreen();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Fullscreen.prototype.requestFullscreen = function() {
|
||||
var el = document.documentElement;
|
||||
if (el.requestFullscreen) {
|
||||
el.requestFullscreen();
|
||||
} else if (el.msRequestFullscreen) {
|
||||
el.msRequestFullscreen();
|
||||
} else if (el.mozRequestFullScreen) {
|
||||
el.mozRequestFullScreen();
|
||||
} else if (el.webkitRequestFullscreen) {
|
||||
el.webkitRequestFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
Fullscreen.prototype.exitFullscreen = function() {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
||||
Fullscreen.prototype.fullScreen = function() {
|
||||
var _this = this;
|
||||
|
||||
$(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;
|
||||
|
||||
})();
|
||||
|
||||
}));
|
||||
478
public/vendor/site/libs/lightgallery/css/js/lg-thumbnail.js
vendored
Executable file
478
public/vendor/site/libs/lightgallery/css/js/lg-thumbnail.js
vendored
Executable file
@@ -0,0 +1,478 @@
|
||||
/*! lg-thumbnail - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
thumbnail: true,
|
||||
|
||||
animateThumb: true,
|
||||
currentPagerPosition: 'middle',
|
||||
|
||||
thumbWidth: 100,
|
||||
thumbHeight: '80px',
|
||||
thumbContHeight: 100,
|
||||
thumbMargin: 5,
|
||||
|
||||
exThumbImage: false,
|
||||
showThumbByDefault: true,
|
||||
toogleThumb: true,
|
||||
pullCaptionUp: true,
|
||||
|
||||
enableThumbDrag: true,
|
||||
enableThumbSwipe: true,
|
||||
swipeThreshold: 50,
|
||||
|
||||
loadYoutubeThumbnail: true,
|
||||
youtubeThumbSize: 1,
|
||||
|
||||
loadVimeoThumbnail: true,
|
||||
vimeoThumbSize: 'thumbnail_small',
|
||||
|
||||
loadDailymotionThumbnail: true
|
||||
};
|
||||
|
||||
var Thumbnail = function(element) {
|
||||
|
||||
// get lightGallery core plugin data
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
|
||||
this.$el = $(element);
|
||||
this.$thumbOuter = null;
|
||||
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.animateThumb) {
|
||||
this.core.s.thumbHeight = '100%';
|
||||
}
|
||||
|
||||
// Thumbnail animation value
|
||||
this.left = 0;
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Thumbnail.prototype.init = function() {
|
||||
var _this = this;
|
||||
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
||||
if (this.core.s.showThumbByDefault) {
|
||||
setTimeout(function(){
|
||||
_this.core.$outer.addClass('lg-thumb-open');
|
||||
}, 700);
|
||||
}
|
||||
|
||||
if (this.core.s.pullCaptionUp) {
|
||||
this.core.$outer.addClass('lg-pull-caption-up');
|
||||
}
|
||||
|
||||
this.build();
|
||||
if (this.core.s.animateThumb && this.core.doCss()) {
|
||||
if (this.core.s.enableThumbDrag) {
|
||||
this.enableThumbDrag();
|
||||
}
|
||||
|
||||
if (this.core.s.enableThumbSwipe) {
|
||||
this.enableThumbSwipe();
|
||||
}
|
||||
|
||||
this.thumbClickable = false;
|
||||
} else {
|
||||
this.thumbClickable = true;
|
||||
}
|
||||
|
||||
this.toogle();
|
||||
this.thumbkeyPress();
|
||||
}
|
||||
};
|
||||
|
||||
Thumbnail.prototype.build = function() {
|
||||
var _this = this;
|
||||
var thumbList = '';
|
||||
var vimeoErrorThumbSize = '';
|
||||
var $thumb;
|
||||
var html = '<div class="lg-thumb-outer">' +
|
||||
'<div class="lg-thumb lg-group">' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
switch (this.core.s.vimeoThumbSize) {
|
||||
case 'thumbnail_large':
|
||||
vimeoErrorThumbSize = '640';
|
||||
break;
|
||||
case 'thumbnail_medium':
|
||||
vimeoErrorThumbSize = '200x150';
|
||||
break;
|
||||
case 'thumbnail_small':
|
||||
vimeoErrorThumbSize = '100x75';
|
||||
}
|
||||
|
||||
_this.core.$outer.addClass('lg-has-thumb');
|
||||
|
||||
_this.core.$outer.find('.lg').append(html);
|
||||
|
||||
_this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
|
||||
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
||||
|
||||
if (_this.core.s.animateThumb) {
|
||||
_this.core.$outer.find('.lg-thumb').css({
|
||||
width: _this.thumbTotalWidth + 'px',
|
||||
position: 'relative'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.core.s.animateThumb) {
|
||||
_this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
|
||||
}
|
||||
|
||||
function getThumb(src, thumb, index) {
|
||||
var isVideo = _this.core.isVideo(src, index) || {};
|
||||
var thumbImg;
|
||||
var vimeoId = '';
|
||||
|
||||
if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
|
||||
if (isVideo.youtube) {
|
||||
if (_this.core.s.loadYoutubeThumbnail) {
|
||||
thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
} else if (isVideo.vimeo) {
|
||||
if (_this.core.s.loadVimeoThumbnail) {
|
||||
thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
|
||||
vimeoId = isVideo.vimeo[1];
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
} else if (isVideo.dailymotion) {
|
||||
if (_this.core.s.loadDailymotionThumbnail) {
|
||||
thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
|
||||
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 = '';
|
||||
}
|
||||
|
||||
if (_this.core.s.dynamic) {
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
_this.core.$items.each(function(i) {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').html(thumbList);
|
||||
|
||||
$thumb = _this.core.$outer.find('.lg-thumb-item');
|
||||
|
||||
// Load vimeo thumbnails
|
||||
$thumb.each(function() {
|
||||
var $this = $(this);
|
||||
var vimeoVideoId = $this.attr('data-vimeo-id');
|
||||
|
||||
if (vimeoVideoId) {
|
||||
$.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
|
||||
format: 'json'
|
||||
}, function(data) {
|
||||
$this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 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');
|
||||
});
|
||||
|
||||
$thumb.on('click.lg touchend.lg', function() {
|
||||
var _$this = $(this);
|
||||
setTimeout(function() {
|
||||
|
||||
// In IE9 and bellow touch does not support
|
||||
// Go to slide if browser does not support css transitions
|
||||
if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
|
||||
_this.core.index = _$this.index();
|
||||
_this.core.slide(_this.core.index, false, true, false);
|
||||
}
|
||||
}, 50);
|
||||
});
|
||||
|
||||
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
||||
_this.animateThumb(_this.core.index);
|
||||
});
|
||||
|
||||
$(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
|
||||
setTimeout(function() {
|
||||
_this.animateThumb(_this.core.index);
|
||||
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
||||
}, 200);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Thumbnail.prototype.setTranslate = function(value) {
|
||||
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
||||
this.core.$outer.find('.lg-thumb').css({
|
||||
transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
|
||||
});
|
||||
};
|
||||
|
||||
Thumbnail.prototype.animateThumb = function(index) {
|
||||
var $thumb = this.core.$outer.find('.lg-thumb');
|
||||
if (this.core.s.animateThumb) {
|
||||
var position;
|
||||
switch (this.core.s.currentPagerPosition) {
|
||||
case 'left':
|
||||
position = 0;
|
||||
break;
|
||||
case 'middle':
|
||||
position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
|
||||
break;
|
||||
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)) {
|
||||
this.left = this.thumbTotalWidth - this.thumbOuterWidth;
|
||||
}
|
||||
|
||||
if (this.left < 0) {
|
||||
this.left = 0;
|
||||
}
|
||||
|
||||
if (this.core.lGalleryOn) {
|
||||
if (!$thumb.hasClass('on')) {
|
||||
this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
|
||||
}
|
||||
|
||||
if (!this.core.doCss()) {
|
||||
$thumb.animate({
|
||||
left: -this.left + 'px'
|
||||
}, this.core.s.speed);
|
||||
}
|
||||
} else {
|
||||
if (!this.core.doCss()) {
|
||||
$thumb.css('left', -this.left + 'px');
|
||||
}
|
||||
}
|
||||
|
||||
this.setTranslate(this.left);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// Enable thumbnail dragging and swiping
|
||||
Thumbnail.prototype.enableThumbDrag = function() {
|
||||
|
||||
var _this = this;
|
||||
var startCoords = 0;
|
||||
var endCoords = 0;
|
||||
var isDraging = false;
|
||||
var isMoved = false;
|
||||
var tempLeft = 0;
|
||||
|
||||
_this.$thumbOuter.addClass('lg-grab');
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
// execute only on .lg-object
|
||||
e.preventDefault();
|
||||
startCoords = e.pageX;
|
||||
isDraging = true;
|
||||
|
||||
// ** 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;
|
||||
|
||||
// *
|
||||
_this.thumbClickable = false;
|
||||
_this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mousemove.lg.thumb', function(e) {
|
||||
if (isDraging) {
|
||||
tempLeft = _this.left;
|
||||
isMoved = true;
|
||||
endCoords = e.pageX;
|
||||
|
||||
_this.$thumbOuter.addClass('lg-dragging');
|
||||
|
||||
tempLeft = tempLeft - (endCoords - startCoords);
|
||||
|
||||
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
||||
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
||||
}
|
||||
|
||||
if (tempLeft < 0) {
|
||||
tempLeft = 0;
|
||||
}
|
||||
|
||||
// move current slide
|
||||
_this.setTranslate(tempLeft);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mouseup.lg.thumb', function() {
|
||||
if (isMoved) {
|
||||
isMoved = false;
|
||||
_this.$thumbOuter.removeClass('lg-dragging');
|
||||
|
||||
_this.left = tempLeft;
|
||||
|
||||
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
|
||||
if (isDraging) {
|
||||
isDraging = false;
|
||||
_this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Thumbnail.prototype.enableThumbSwipe = function() {
|
||||
var _this = this;
|
||||
var startCoords = 0;
|
||||
var endCoords = 0;
|
||||
var isMoved = false;
|
||||
var tempLeft = 0;
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
e.preventDefault();
|
||||
startCoords = e.originalEvent.targetTouches[0].pageX;
|
||||
_this.thumbClickable = false;
|
||||
}
|
||||
});
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
e.preventDefault();
|
||||
endCoords = e.originalEvent.targetTouches[0].pageX;
|
||||
isMoved = true;
|
||||
|
||||
_this.$thumbOuter.addClass('lg-dragging');
|
||||
|
||||
tempLeft = _this.left;
|
||||
|
||||
tempLeft = tempLeft - (endCoords - startCoords);
|
||||
|
||||
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
||||
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
||||
}
|
||||
|
||||
if (tempLeft < 0) {
|
||||
tempLeft = 0;
|
||||
}
|
||||
|
||||
// move current slide
|
||||
_this.setTranslate(tempLeft);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
|
||||
if (isMoved) {
|
||||
isMoved = false;
|
||||
_this.$thumbOuter.removeClass('lg-dragging');
|
||||
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
|
||||
_this.left = tempLeft;
|
||||
} else {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
} else {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Thumbnail.prototype.toogle = function() {
|
||||
var _this = this;
|
||||
if (_this.core.s.toogleThumb) {
|
||||
_this.core.$outer.addClass('lg-can-toggle');
|
||||
_this.$thumbOuter.append('<button aria-label="Toggle thumbnails" class="lg-toogle-thumb lg-icon"></button>');
|
||||
_this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
|
||||
_this.core.$outer.toggleClass('lg-thumb-open');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Thumbnail.prototype.thumbkeyPress = function() {
|
||||
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;
|
||||
|
||||
})();
|
||||
|
||||
}));
|
||||
353
public/vendor/site/libs/lightgallery/css/js/lg-video.js
vendored
Executable file
353
public/vendor/site/libs/lightgallery/css/js/lg-video.js
vendored
Executable file
@@ -0,0 +1,353 @@
|
||||
/*! lg-video - v1.3.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
videoMaxWidth: '855px',
|
||||
|
||||
autoplayFirstVideo: true,
|
||||
|
||||
youtubePlayerParams: false,
|
||||
vimeoPlayerParams: false,
|
||||
dailymotionPlayerParams: false,
|
||||
vkPlayerParams: false,
|
||||
|
||||
videojs: false,
|
||||
videojsOptions: {}
|
||||
};
|
||||
|
||||
var Video = function(element) {
|
||||
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.$el = $(element);
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
this.videoLoaded = false;
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Video.prototype.init = function() {
|
||||
var _this = this;
|
||||
|
||||
// Event triggered when video url found without poster
|
||||
_this.core.$el.on('hasVideo.lg.tm', onHasVideo.bind(this));
|
||||
|
||||
// Set max width for video
|
||||
_this.core.$el.on('onAferAppendSlide.lg.tm', onAferAppendSlide.bind(this));
|
||||
|
||||
if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) {
|
||||
_this.core.$el.on('onSlideClick.lg.tm', function() {
|
||||
var $el = _this.core.$slide.eq(_this.core.index);
|
||||
_this.loadVideoOnclick($el);
|
||||
});
|
||||
} else {
|
||||
|
||||
// For IE 9 and bellow
|
||||
_this.core.$slide.on('click.lg', function() {
|
||||
_this.loadVideoOnclick($(this));
|
||||
});
|
||||
}
|
||||
|
||||
_this.core.$el.on('onBeforeSlide.lg.tm', onBeforeSlide.bind(this));
|
||||
|
||||
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) {
|
||||
_this.core.$slide.eq(prevIndex).removeClass('lg-video-playing');
|
||||
});
|
||||
|
||||
if (_this.core.s.autoplayFirstVideo) {
|
||||
_this.core.$el.on('onAferAppendSlide.lg.tm', function (e, index) {
|
||||
if (!_this.core.lGalleryOn) {
|
||||
var $el = _this.core.$slide.eq(index);
|
||||
setTimeout(function () {
|
||||
_this.loadVideoOnclick($el);
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Video.prototype.loadVideo = function(src, addClass, noPoster, index, html) {
|
||||
var _this = this;
|
||||
var video = '';
|
||||
var autoplay = 1;
|
||||
var a = '';
|
||||
var isVideo = this.core.isVideo(src, index) || {};
|
||||
var videoTitle;
|
||||
|
||||
if (_this.core.s.dynamic) {
|
||||
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');
|
||||
}
|
||||
|
||||
videoTitle = videoTitle ? 'title="' + videoTitle + '"' : '';
|
||||
|
||||
// Enable autoplay based on setting for first video if poster doesn't exist
|
||||
if (noPoster) {
|
||||
if (this.videoLoaded) {
|
||||
autoplay = 0;
|
||||
} else {
|
||||
autoplay = this.core.s.autoplayFirstVideo ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isVideo.youtube) {
|
||||
|
||||
a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
|
||||
if (this.core.s.youtubePlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.youtubePlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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 (isVideo.vimeo) {
|
||||
|
||||
a = '?autoplay=' + autoplay + '&api=1';
|
||||
if (this.core.s.vimeoPlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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 (isVideo.dailymotion) {
|
||||
|
||||
a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
|
||||
if (this.core.s.dailymotionPlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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);
|
||||
if (fL === '.' || fL === '#') {
|
||||
html = $(html).html();
|
||||
}
|
||||
|
||||
video = html;
|
||||
|
||||
} else if (isVideo.vk) {
|
||||
|
||||
a = '&autoplay=' + autoplay;
|
||||
if (this.core.s.vkPlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.vkPlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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>';
|
||||
|
||||
}
|
||||
|
||||
return video;
|
||||
};
|
||||
|
||||
Video.prototype.loadVideoOnclick = function($el){
|
||||
|
||||
var _this = this;
|
||||
// check slide has poster
|
||||
if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
|
||||
|
||||
// check already video element present
|
||||
if (!$el.hasClass('lg-has-video')) {
|
||||
|
||||
$el.addClass('lg-video-playing lg-has-video');
|
||||
|
||||
var _src;
|
||||
var _html;
|
||||
var _loadVideo = function(_src, _html) {
|
||||
|
||||
$el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
|
||||
|
||||
if (_html) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
||||
this.play();
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included videojs');
|
||||
}
|
||||
} else {
|
||||
_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if (_this.core.s.dynamic) {
|
||||
|
||||
_src = _this.core.s.dynamicEl[_this.core.index].src;
|
||||
_html = _this.core.s.dynamicEl[_this.core.index].html;
|
||||
|
||||
_loadVideo(_src, _html);
|
||||
|
||||
} else {
|
||||
|
||||
_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);
|
||||
|
||||
}
|
||||
|
||||
var $tempImg = $el.find('.lg-object');
|
||||
$el.find('.lg-video').append($tempImg);
|
||||
|
||||
// @todo loading icon for html5 videos also
|
||||
// for showing the loading indicator while loading video
|
||||
if (!$el.find('.lg-video-object').hasClass('lg-html5')) {
|
||||
$el.removeClass('lg-complete');
|
||||
$el.find('.lg-video-object').on('load.lg error.lg', function() {
|
||||
$el.addClass('lg-complete');
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
var youtubePlayer = $el.find('.lg-youtube').get(0);
|
||||
var vimeoPlayer = $el.find('.lg-vimeo').get(0);
|
||||
var dailymotionPlayer = $el.find('.lg-dailymotion').get(0);
|
||||
var html5Player = $el.find('.lg-html5').get(0);
|
||||
if (youtubePlayer) {
|
||||
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
|
||||
} else if (vimeoPlayer) {
|
||||
try {
|
||||
$f(vimeoPlayer).api('play');
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included froogaloop2 js');
|
||||
}
|
||||
} else if (dailymotionPlayer) {
|
||||
dailymotionPlayer.contentWindow.postMessage('play', '*');
|
||||
|
||||
} else if (html5Player) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(html5Player).play();
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included videojs');
|
||||
}
|
||||
} else {
|
||||
html5Player.play();
|
||||
}
|
||||
}
|
||||
|
||||
$el.addClass('lg-video-playing');
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Video.prototype.destroy = function() {
|
||||
this.videoLoaded = false;
|
||||
};
|
||||
|
||||
function onHasVideo(event, index, src, html) {
|
||||
/*jshint validthis:true */
|
||||
var _this = this;
|
||||
_this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
|
||||
if (html) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
||||
if (!_this.videoLoaded && _this.core.s.autoplayFirstVideo) {
|
||||
this.play();
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('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 {
|
||||
$f(vimeoPlayer).api('pause');
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included froogaloop2 js');
|
||||
}
|
||||
} else if (dailymotionPlayer) {
|
||||
dailymotionPlayer.contentWindow.postMessage('pause', '*');
|
||||
|
||||
} else if (html5Player) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(html5Player).pause();
|
||||
} catch (e) {
|
||||
console.error('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;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
}));
|
||||
527
public/vendor/site/libs/lightgallery/css/js/lg-zoom.js
vendored
Executable file
527
public/vendor/site/libs/lightgallery/css/js/lg-zoom.js
vendored
Executable file
@@ -0,0 +1,527 @@
|
||||
/*! lg-zoom - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var getUseLeft = function() {
|
||||
var useLeft = false;
|
||||
var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
||||
if (isChrome && parseInt(isChrome[2], 10) < 54) {
|
||||
useLeft = true;
|
||||
}
|
||||
|
||||
return useLeft;
|
||||
};
|
||||
|
||||
var defaults = {
|
||||
scale: 1,
|
||||
zoom: true,
|
||||
actualSize: true,
|
||||
enableZoomAfter: 300,
|
||||
useLeftForZoom: getUseLeft()
|
||||
};
|
||||
|
||||
var Zoom = function(element) {
|
||||
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
|
||||
if (this.core.s.zoom && this.core.doCss()) {
|
||||
this.init();
|
||||
|
||||
// Store the zoomable timeout value just to clear it while closing
|
||||
this.zoomabletimeout = false;
|
||||
|
||||
// Set the initial value center
|
||||
this.pageX = $(window).width() / 2;
|
||||
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Zoom.prototype.init = function() {
|
||||
|
||||
var _this = this;
|
||||
var zoomIcons = '<button aria-label="Zoom in" id="lg-zoom-in" class="lg-icon"></button><button aria-label="Zoom out" id="lg-zoom-out" class="lg-icon"></button>';
|
||||
|
||||
if (_this.core.s.actualSize) {
|
||||
zoomIcons += '<button aria-label="Actual size" id="lg-actual-size" class="lg-icon"></button>';
|
||||
}
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_this.core.$outer.addClass('lg-use-left-for-zoom');
|
||||
} else {
|
||||
_this.core.$outer.addClass('lg-use-transition-for-zoom');
|
||||
}
|
||||
|
||||
this.core.$outer.find('.lg-toolbar').append(zoomIcons);
|
||||
|
||||
// Add zoomable class
|
||||
_this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) {
|
||||
|
||||
// delay will be 0 except first time
|
||||
var _speed = _this.core.s.enableZoomAfter + delay;
|
||||
|
||||
// set _speed value 0 if gallery opened from direct url and if it is first slide
|
||||
if ($('body').hasClass('lg-from-hash') && delay) {
|
||||
|
||||
// will execute only once
|
||||
_speed = 0;
|
||||
} else {
|
||||
|
||||
// Remove lg-from-hash to enable starting animation.
|
||||
$('body').removeClass('lg-from-hash');
|
||||
}
|
||||
|
||||
_this.zoomabletimeout = setTimeout(function() {
|
||||
_this.core.$slide.eq(index).addClass('lg-zoomable');
|
||||
}, _speed + 30);
|
||||
});
|
||||
|
||||
var scale = 1;
|
||||
/**
|
||||
* @desc Image zoom
|
||||
* Translate the wrap and scale the image to get better user experience
|
||||
*
|
||||
* @param {String} scaleVal - Zoom decrement/increment value
|
||||
*/
|
||||
var zoom = function(scaleVal) {
|
||||
|
||||
var $image = _this.core.$outer.find('.lg-current .lg-image');
|
||||
var _x;
|
||||
var _y;
|
||||
|
||||
// Find offset manually to avoid issue after zoom
|
||||
var offsetX = ($(window).width() - $image.prop('offsetWidth')) / 2;
|
||||
var offsetY = (($(window).height() - $image.prop('offsetHeight')) / 2) + $(window).scrollTop();
|
||||
|
||||
_x = _this.pageX - offsetX;
|
||||
_y = _this.pageY - offsetY;
|
||||
|
||||
var x = (scaleVal - 1) * (_x);
|
||||
var y = (scaleVal - 1) * (_y);
|
||||
|
||||
$image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
$image.parent().css({
|
||||
left: -x + 'px',
|
||||
top: -y + 'px'
|
||||
}).attr('data-x', x).attr('data-y', y);
|
||||
} else {
|
||||
$image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y);
|
||||
}
|
||||
};
|
||||
|
||||
var callScale = function() {
|
||||
if (scale > 1) {
|
||||
_this.core.$outer.addClass('lg-zoomed');
|
||||
} else {
|
||||
_this.resetZoom();
|
||||
}
|
||||
|
||||
if (scale < 1) {
|
||||
scale = 1;
|
||||
}
|
||||
|
||||
zoom(scale);
|
||||
};
|
||||
|
||||
var actualSize = function(event, $image, index, fromIcon) {
|
||||
var w = $image.prop('offsetWidth');
|
||||
var nw;
|
||||
if (_this.core.s.dynamic) {
|
||||
nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w;
|
||||
} else {
|
||||
nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w;
|
||||
}
|
||||
|
||||
var _scale;
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
scale = 1;
|
||||
} else {
|
||||
if (nw > w) {
|
||||
_scale = nw / w;
|
||||
scale = _scale || 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (fromIcon) {
|
||||
_this.pageX = $(window).width() / 2;
|
||||
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
} else {
|
||||
_this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX;
|
||||
_this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY;
|
||||
}
|
||||
|
||||
callScale();
|
||||
setTimeout(function() {
|
||||
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
||||
}, 10);
|
||||
};
|
||||
|
||||
var tapped = false;
|
||||
|
||||
// event triggered after appending slide content
|
||||
_this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) {
|
||||
|
||||
// Get the current element
|
||||
var $image = _this.core.$slide.eq(index).find('.lg-image');
|
||||
|
||||
$image.on('dblclick', function(event) {
|
||||
actualSize(event, $image, index);
|
||||
});
|
||||
|
||||
$image.on('touchstart', function(event) {
|
||||
if (!tapped) {
|
||||
tapped = setTimeout(function() {
|
||||
tapped = null;
|
||||
}, 300);
|
||||
} else {
|
||||
clearTimeout(tapped);
|
||||
tapped = null;
|
||||
actualSize(event, $image, index);
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Update zoom on resize and orientationchange
|
||||
$(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() {
|
||||
_this.pageX = $(window).width() / 2;
|
||||
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
zoom(scale);
|
||||
});
|
||||
|
||||
$('#lg-zoom-out').on('click.lg', function() {
|
||||
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
||||
scale -= _this.core.s.scale;
|
||||
callScale();
|
||||
}
|
||||
});
|
||||
|
||||
$('#lg-zoom-in').on('click.lg', function() {
|
||||
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
||||
scale += _this.core.s.scale;
|
||||
callScale();
|
||||
}
|
||||
});
|
||||
|
||||
$('#lg-actual-size').on('click.lg', function(event) {
|
||||
actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true);
|
||||
});
|
||||
|
||||
// Reset zoom on slide change
|
||||
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
||||
scale = 1;
|
||||
_this.resetZoom();
|
||||
});
|
||||
|
||||
// Drag option after zoom
|
||||
_this.zoomDrag();
|
||||
|
||||
_this.zoomSwipe();
|
||||
|
||||
};
|
||||
|
||||
// Reset zoom effect
|
||||
Zoom.prototype.resetZoom = function() {
|
||||
this.core.$outer.removeClass('lg-zoomed');
|
||||
this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y');
|
||||
this.core.$slide.find('.lg-image').removeAttr('style data-scale');
|
||||
|
||||
// Reset pagx pagy values to center
|
||||
this.pageX = $(window).width() / 2;
|
||||
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
};
|
||||
|
||||
Zoom.prototype.zoomSwipe = function() {
|
||||
var _this = this;
|
||||
var startCoords = {};
|
||||
var endCoords = {};
|
||||
var isMoved = false;
|
||||
|
||||
// Allow x direction drag
|
||||
var allowX = false;
|
||||
|
||||
// Allow Y direction drag
|
||||
var allowY = false;
|
||||
|
||||
_this.core.$slide.on('touchstart.lg', function(e) {
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
||||
|
||||
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
||||
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
||||
if ((allowX || allowY)) {
|
||||
e.preventDefault();
|
||||
startCoords = {
|
||||
x: e.originalEvent.targetTouches[0].pageX,
|
||||
y: e.originalEvent.targetTouches[0].pageY
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
_this.core.$slide.on('touchmove.lg', function(e) {
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
|
||||
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
||||
var distanceX;
|
||||
var distanceY;
|
||||
|
||||
e.preventDefault();
|
||||
isMoved = true;
|
||||
|
||||
endCoords = {
|
||||
x: e.originalEvent.targetTouches[0].pageX,
|
||||
y: e.originalEvent.targetTouches[0].pageY
|
||||
};
|
||||
|
||||
// reset opacity and transition duration
|
||||
_this.core.$outer.addClass('lg-zoom-dragging');
|
||||
|
||||
if (allowY) {
|
||||
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
||||
} else {
|
||||
distanceY = -Math.abs(_$el.attr('data-y'));
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
||||
} else {
|
||||
distanceX = -Math.abs(_$el.attr('data-x'));
|
||||
}
|
||||
|
||||
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_$el.css({
|
||||
left: distanceX + 'px',
|
||||
top: distanceY + 'px'
|
||||
});
|
||||
} else {
|
||||
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
_this.core.$slide.on('touchend.lg', function() {
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
if (isMoved) {
|
||||
isMoved = false;
|
||||
_this.core.$outer.removeClass('lg-zoom-dragging');
|
||||
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Zoom.prototype.zoomDrag = function() {
|
||||
|
||||
var _this = this;
|
||||
var startCoords = {};
|
||||
var endCoords = {};
|
||||
var isDraging = false;
|
||||
var isMoved = false;
|
||||
|
||||
// Allow x direction drag
|
||||
var allowX = false;
|
||||
|
||||
// Allow Y direction drag
|
||||
var allowY = false;
|
||||
|
||||
_this.core.$slide.on('mousedown.lg.zoom', function(e) {
|
||||
|
||||
// execute only on .lg-object
|
||||
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
||||
|
||||
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
||||
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
if ($(e.target).hasClass('lg-object') && (allowX || allowY)) {
|
||||
e.preventDefault();
|
||||
startCoords = {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
|
||||
isDraging = true;
|
||||
|
||||
// ** 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;
|
||||
|
||||
_this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mousemove.lg.zoom', function(e) {
|
||||
if (isDraging) {
|
||||
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
||||
var distanceX;
|
||||
var distanceY;
|
||||
|
||||
isMoved = true;
|
||||
endCoords = {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
|
||||
// reset opacity and transition duration
|
||||
_this.core.$outer.addClass('lg-zoom-dragging');
|
||||
|
||||
if (allowY) {
|
||||
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
||||
} else {
|
||||
distanceY = -Math.abs(_$el.attr('data-y'));
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
||||
} else {
|
||||
distanceX = -Math.abs(_$el.attr('data-x'));
|
||||
}
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_$el.css({
|
||||
left: distanceX + 'px',
|
||||
top: distanceY + 'px'
|
||||
});
|
||||
} else {
|
||||
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mouseup.lg.zoom', function(e) {
|
||||
|
||||
if (isDraging) {
|
||||
isDraging = false;
|
||||
_this.core.$outer.removeClass('lg-zoom-dragging');
|
||||
|
||||
// Fix for chrome mouse move on click
|
||||
if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
|
||||
endCoords = {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
||||
|
||||
}
|
||||
|
||||
isMoved = false;
|
||||
}
|
||||
|
||||
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) {
|
||||
|
||||
var _this = this;
|
||||
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
||||
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
||||
var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
||||
var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
||||
var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2;
|
||||
var maxY = Math.abs(($image.prop('offsetHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY);
|
||||
var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2;
|
||||
var maxX = Math.abs(($image.prop('offsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX);
|
||||
|
||||
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
||||
if (allowY) {
|
||||
if (distanceY <= -maxY) {
|
||||
distanceY = -maxY;
|
||||
} else if (distanceY >= -minY) {
|
||||
distanceY = -minY;
|
||||
}
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
if (distanceX <= -maxX) {
|
||||
distanceX = -maxX;
|
||||
} else if (distanceX >= -minX) {
|
||||
distanceX = -minX;
|
||||
}
|
||||
}
|
||||
|
||||
if (allowY) {
|
||||
_$el.attr('data-y', Math.abs(distanceY));
|
||||
} else {
|
||||
distanceY = -Math.abs(_$el.attr('data-y'));
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
_$el.attr('data-x', Math.abs(distanceX));
|
||||
} else {
|
||||
distanceX = -Math.abs(_$el.attr('data-x'));
|
||||
}
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_$el.css({
|
||||
left: distanceX + 'px',
|
||||
top: distanceY + 'px'
|
||||
});
|
||||
} else {
|
||||
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Zoom.prototype.destroy = function() {
|
||||
|
||||
var _this = this;
|
||||
|
||||
// Unbind all events added by lightGallery zoom plugin
|
||||
_this.core.$el.off('.lg.zoom');
|
||||
$(window).off('.lg.zoom');
|
||||
_this.core.$slide.off('.lg.zoom');
|
||||
_this.core.$el.off('.lg.tm.zoom');
|
||||
_this.resetZoom();
|
||||
clearTimeout(_this.zoomabletimeout);
|
||||
_this.zoomabletimeout = false;
|
||||
};
|
||||
|
||||
$.fn.lightGallery.modules.zoom = Zoom;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
}));
|
||||
4
public/vendor/site/libs/lightgallery/css/js/lightgallery.min.js
vendored
Executable file
4
public/vendor/site/libs/lightgallery/css/js/lightgallery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
1
public/vendor/site/libs/lightgallery/css/lightgallery.min.css
vendored
Executable file
1
public/vendor/site/libs/lightgallery/css/lightgallery.min.css
vendored
Executable file
File diff suppressed because one or more lines are too long
51
public/vendor/site/libs/lightgallery/fonts/lg.svg
vendored
Executable file
51
public/vendor/site/libs/lightgallery/fonts/lg.svg
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>
|
||||
<json>
|
||||
<![CDATA[
|
||||
{
|
||||
"fontFamily": "lg",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 0,
|
||||
"fontURL": "https://github.com/sachinchoolur/lightGallery",
|
||||
"copyright": "sachin",
|
||||
"license": "MLT",
|
||||
"licenseURL": "http://opensource.org/licenses/MIT",
|
||||
"description": "Font generated by IcoMoon.",
|
||||
"version": "Version 1.0",
|
||||
"fontId": "lg",
|
||||
"psName": "lg",
|
||||
"subFamily": "Regular",
|
||||
"fullName": "lg"
|
||||
}
|
||||
]]>
|
||||
</json>
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="lg" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="pause_circle_outline" data-tags="pause_circle_outline" d="M554 256.667v340h86v-340h-86zM512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM384 256.667v340h86v-340h-86z" />
|
||||
<glyph unicode="" glyph-name="play_circle_outline" data-tags="play_circle_outline" d="M512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM426 234.667v384l256-192z" />
|
||||
<glyph unicode="" glyph-name="stack-2" data-tags="stack-2" d="M384 853.334h426.667q53 0 90.5-37.5t37.5-90.5v-426.667q0-53-37.5-90.5t-90.5-37.5h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 53 37.5 90.5t90.5 37.5zM170.667 675.334v-547.333q0-17.667 12.5-30.167t30.167-12.5h547.333q-13.333-37.667-46.333-61.5t-74.333-23.833h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 41.333 23.833 74.333t61.5 46.333zM810.667 768h-426.667q-17.667 0-30.167-12.5t-12.5-30.167v-426.667q0-17.667 12.5-30.167t30.167-12.5h426.667q17.667 0 30.167 12.5t12.5 30.167v426.667q0 17.667-12.5 30.167t-30.167 12.5z" />
|
||||
<glyph unicode="" glyph-name="clear" data-tags="clear" d="M810 664.667l-238-238 238-238-60-60-238 238-238-238-60 60 238 238-238 238 60 60 238-238 238 238z" />
|
||||
<glyph unicode="" glyph-name="arrow-left" data-tags="arrow-left" d="M426.667 768q17.667 0 30.167-12.5t12.5-30.167q0-18-12.667-30.333l-225.667-225.667h665q17.667 0 30.167-12.5t12.5-30.167-12.5-30.167-30.167-12.5h-665l225.667-225.667q12.667-12.333 12.667-30.333 0-17.667-12.5-30.167t-30.167-12.5q-18 0-30.333 12.333l-298.667 298.667q-12.333 13-12.333 30.333t12.333 30.333l298.667 298.667q12.667 12.333 30.333 12.333z" />
|
||||
<glyph unicode="" glyph-name="arrow-right" data-tags="arrow-right" d="M597.333 768q18 0 30.333-12.333l298.667-298.667q12.333-12.333 12.333-30.333t-12.333-30.333l-298.667-298.667q-12.333-12.333-30.333-12.333-18.333 0-30.5 12.167t-12.167 30.5q0 18 12.333 30.333l226 225.667h-665q-17.667 0-30.167 12.5t-12.5 30.167 12.5 30.167 30.167 12.5h665l-226 225.667q-12.333 12.333-12.333 30.333 0 18.333 12.167 30.5t30.5 12.167z" />
|
||||
<glyph unicode="" glyph-name="vertical_align_bottom" data-tags="vertical_align_bottom" d="M170 128.667h684v-86h-684v86zM682 384.667l-170-172-170 172h128v426h84v-426h128z" />
|
||||
<glyph unicode="" glyph-name="apps" data-tags="apps" d="M682 84.667v172h172v-172h-172zM682 340.667v172h172v-172h-172zM426 596.667v172h172v-172h-172zM682 768.667h172v-172h-172v172zM426 340.667v172h172v-172h-172zM170 340.667v172h172v-172h-172zM170 84.667v172h172v-172h-172zM426 84.667v172h172v-172h-172zM170 596.667v172h172v-172h-172z" />
|
||||
<glyph unicode="" glyph-name="fullscreen" data-tags="fullscreen" d="M598 724.667h212v-212h-84v128h-128v84zM726 212.667v128h84v-212h-212v84h128zM214 512.667v212h212v-84h-128v-128h-84zM298 340.667v-128h128v-84h-212v212h84z" />
|
||||
<glyph unicode="" glyph-name="fullscreen_exit" data-tags="fullscreen_exit" d="M682 596.667h128v-84h-212v212h84v-128zM598 128.667v212h212v-84h-128v-128h-84zM342 596.667v128h84v-212h-212v84h128zM214 256.667v84h212v-212h-84v128h-128z" />
|
||||
<glyph unicode="" glyph-name="zoom_in" data-tags="zoom_in" d="M512 512.667h-86v-86h-42v86h-86v42h86v86h42v-86h86v-42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
|
||||
<glyph unicode="" glyph-name="zoom_out" data-tags="zoom_out" d="M298 554.667h214v-42h-214v42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
|
||||
<glyph unicode="" glyph-name="share" data-tags="share" d="M768 252.667c68 0 124-56 124-124s-56-126-124-126-124 58-124 126c0 10 0 20 2 28l-302 176c-24-22-54-34-88-34-70 0-128 58-128 128s58 128 128 128c34 0 64-12 88-34l300 174c-2 10-4 20-4 30 0 70 58 128 128 128s128-58 128-128-58-128-128-128c-34 0-64 14-88 36l-300-176c2-10 4-20 4-30s-2-20-4-30l304-176c22 20 52 32 84 32z" />
|
||||
<glyph unicode="" glyph-name="rotate_left" data-tags="rotate_left" d="M554 764.667q126-16 213-112t87-226-87-226-213-112v86q92 16 153 87t61 165-61 165-153 87v-166l-194 190 194 194v-132zM302 156.667l62 62q46-34 106-44v-86q-96 12-168 68zM260 384.667q10-58 42-106l-60-60q-56 74-68 166h86zM304 574.667q-36-52-44-106h-86q12 90 70 166z" />
|
||||
<glyph unicode="" glyph-name="rotate_right" data-tags="rotate_right" d="M720 278.667q34 46 44 106h86q-12-92-68-166zM554 174.667q60 10 106 44l62-62q-72-56-168-68v86zM850 468.667h-86q-10 60-44 106l62 60q58-72 68-166zM664 702.667l-194-190v166q-92-16-153-87t-61-165 61-165 153-87v-86q-126 16-213 112t-87 226 87 226 213 112v132z" />
|
||||
<glyph unicode="" glyph-name="swap_horiz" data-tags="swap_horiz" d="M896 554.667l-170-170v128h-300v84h300v128zM298 468.667v-128h300v-84h-300v-128l-170 170z" />
|
||||
<glyph unicode="" glyph-name="swap_vert" data-tags="swap_vert" d="M384 810.667l170-170h-128v-300h-84v300h-128zM682 212.667h128l-170-170-170 170h128v300h84v-300z" />
|
||||
<glyph unicode="" glyph-name="facebook-with-circle" data-tags="facebook-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM628.429 612.659h-73.882c-8.755 0-18.483-11.52-18.483-26.829v-53.35h92.416l-13.978-76.083h-78.438v-228.403h-87.194v228.403h-79.104v76.083h79.104v44.749c0 64.205 44.544 116.378 105.677 116.378h73.882v-80.947z" />
|
||||
<glyph unicode="" glyph-name="google-with-circle" data-tags="google+-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM483.686 249.805c-30.874-15.002-64.102-16.589-76.954-16.589-2.458 0-3.84 0-3.84 0s-1.178 0-2.765 0c-20.070 0-119.962 4.608-119.962 95.59 0 89.395 108.8 96.41 142.131 96.41h0.87c-19.251 25.702-15.258 51.61-15.258 51.61-1.69-0.102-4.147-0.205-7.168-0.205-12.544 0-36.762 1.997-57.549 15.411-25.498 16.384-38.4 44.288-38.4 82.893 0 109.107 119.142 113.51 120.32 113.613h118.989v-2.611c0-13.312-23.91-15.923-40.192-18.125-5.53-0.819-16.64-1.894-19.763-3.482 30.157-16.128 35.021-41.421 35.021-79.104 0-42.906-16.794-65.587-34.611-81.51-11.059-9.882-19.712-17.613-19.712-28.006 0-10.189 11.878-20.582 25.702-32.717 22.579-19.917 53.555-47.002 53.555-92.723 0-47.258-20.326-81.050-60.416-100.454zM742.4 460.8h-76.8v-76.8h-51.2v76.8h-76.8v51.2h76.8v76.8h51.2v-76.8h76.8v-51.2zM421.018 401.92c-2.662 0-5.325-0.102-8.038-0.307-22.733-1.69-43.725-10.189-58.88-24.013-15.053-13.619-22.733-30.822-21.658-48.179 2.304-36.403 41.37-57.702 88.832-54.323 46.694 3.379 77.824 30.31 75.571 66.714-2.15 34.202-31.898 60.109-75.827 60.109zM465.766 599.808c-12.39 43.52-32.358 56.422-63.386 56.422-3.328 0-6.707-0.512-9.933-1.382-13.466-3.84-24.166-15.053-30.106-31.744-6.093-16.896-6.451-34.509-1.229-54.579 9.472-35.891 34.97-61.901 60.672-61.901 3.379 0 6.758 0.41 9.933 1.382 28.109 7.885 45.722 50.79 34.048 91.802z" />
|
||||
<glyph unicode="" glyph-name="pinterest-with-circle" data-tags="pinterest-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM545.638 344.32c-31.539 2.406-44.749 18.022-69.427 32.973-13.568-71.219-30.157-139.52-79.309-175.206-15.206 107.725 22.221 188.518 39.629 274.381-29.645 49.92 3.533 150.323 66.099 125.645 76.954-30.515-66.662-185.6 29.747-205.005 100.659-20.173 141.773 174.694 79.36 237.978-90.214 91.494-262.502 2.099-241.306-128.87 5.12-32 38.246-41.728 13.21-85.914-57.702 12.8-74.957 58.317-72.704 118.989 3.533 99.328 89.242 168.909 175.155 178.483 108.698 12.083 210.688-39.885 224.819-142.182 15.821-115.405-49.101-240.282-165.274-231.27z" />
|
||||
<glyph unicode="" glyph-name="twitter-with-circle" data-tags="twitter-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM711.936 549.683c0.205-4.198 0.256-8.397 0.256-12.493 0-128-97.331-275.507-275.405-275.507-54.682 0-105.574 15.974-148.378 43.52 7.526-0.922 15.258-1.28 23.091-1.28 45.363 0 87.091 15.411 120.218 41.421-42.342 0.819-78.080 28.774-90.419 67.174 5.888-1.075 11.93-1.69 18.176-1.69 8.806 0 17.408 1.178 25.498 3.379-44.288 8.909-77.67 48.026-77.67 94.925v1.178c13.056-7.219 28.006-11.622 43.878-12.134-26.010 17.408-43.059 47.002-43.059 80.64 0 17.715 4.762 34.406 13.107 48.691 47.77-58.573 119.040-97.075 199.526-101.222-1.69 7.117-2.509 14.49-2.509 22.118 0 53.402 43.315 96.819 96.819 96.819 27.802 0 52.992-11.776 70.656-30.618 22.067 4.403 42.752 12.39 61.44 23.501-7.219-22.579-22.528-41.574-42.547-53.606 19.61 2.406 38.246 7.578 55.603 15.309-12.954-19.405-29.389-36.506-48.282-50.125z" />
|
||||
</font></defs></svg>
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
BIN
public/vendor/site/libs/lightgallery/fonts/lg.ttf
vendored
Executable file
BIN
public/vendor/site/libs/lightgallery/fonts/lg.ttf
vendored
Executable file
Binary file not shown.
BIN
public/vendor/site/libs/lightgallery/fonts/lg.woff
vendored
Executable file
BIN
public/vendor/site/libs/lightgallery/fonts/lg.woff
vendored
Executable file
Binary file not shown.
BIN
public/vendor/site/libs/lightgallery/img/loading.gif
vendored
Executable file
BIN
public/vendor/site/libs/lightgallery/img/loading.gif
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/vendor/site/libs/lightgallery/img/video-play.png
vendored
Executable file
BIN
public/vendor/site/libs/lightgallery/img/video-play.png
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 819 B |
BIN
public/vendor/site/libs/lightgallery/img/vimeo-play.png
vendored
Executable file
BIN
public/vendor/site/libs/lightgallery/img/vimeo-play.png
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/vendor/site/libs/lightgallery/img/youtube-play.png
vendored
Executable file
BIN
public/vendor/site/libs/lightgallery/img/youtube-play.png
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
8
public/vendor/site/libs/lightgallery/js/jquery.mousewheel.min.js
vendored
Executable file
8
public/vendor/site/libs/lightgallery/js/jquery.mousewheel.min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* jQuery Mousewheel 3.1.13
|
||||
*
|
||||
* Copyright 2015 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
||||
206
public/vendor/site/libs/lightgallery/js/lg-autoplay.js
vendored
Executable file
206
public/vendor/site/libs/lightgallery/js/lg-autoplay.js
vendored
Executable file
@@ -0,0 +1,206 @@
|
||||
/*! lg-autoplay - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
autoplay: false,
|
||||
pause: 5000,
|
||||
progressBar: true,
|
||||
fourceAutoplay: false,
|
||||
autoplayControls: true,
|
||||
appendAutoplayControlsTo: '.lg-toolbar'
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates the autoplay plugin.
|
||||
* @param {object} element - lightGallery element
|
||||
*/
|
||||
var Autoplay = function(element) {
|
||||
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.$el = $(element);
|
||||
|
||||
// Execute only if items are above 1
|
||||
if (this.core.$items.length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
this.interval = false;
|
||||
|
||||
// Identify if slide happened from autoplay
|
||||
this.fromAuto = true;
|
||||
|
||||
// Identify if autoplay canceled from touch/drag
|
||||
this.canceledOnTouch = false;
|
||||
|
||||
// save fourceautoplay value
|
||||
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
||||
|
||||
// do not allow progress bar if browser does not support css3 transitions
|
||||
if (!this.core.doCss()) {
|
||||
this.core.s.progressBar = false;
|
||||
}
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Autoplay.prototype.init = function() {
|
||||
var _this = this;
|
||||
|
||||
// append autoplay controls
|
||||
if (_this.core.s.autoplayControls) {
|
||||
_this.controls();
|
||||
}
|
||||
|
||||
// Create progress bar
|
||||
if (_this.core.s.progressBar) {
|
||||
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
||||
}
|
||||
|
||||
// set progress
|
||||
_this.progress();
|
||||
|
||||
// Start autoplay
|
||||
if (_this.core.s.autoplay) {
|
||||
_this.$el.one('onSlideItemLoad.lg.tm', function() {
|
||||
_this.startlAuto();
|
||||
});
|
||||
}
|
||||
|
||||
// cancel interval on touchstart and dragstart
|
||||
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
||||
if (_this.interval) {
|
||||
_this.cancelAuto();
|
||||
_this.canceledOnTouch = true;
|
||||
}
|
||||
});
|
||||
|
||||
// restore autoplay if autoplay canceled from touchstart / dragstart
|
||||
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
||||
if (!_this.interval && _this.canceledOnTouch) {
|
||||
_this.startlAuto();
|
||||
_this.canceledOnTouch = false;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Autoplay.prototype.progress = function() {
|
||||
|
||||
var _this = this;
|
||||
var _$progressBar;
|
||||
var _$progress;
|
||||
|
||||
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
||||
|
||||
// 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');
|
||||
_$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);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
||||
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
||||
_this.cancelAuto();
|
||||
}
|
||||
|
||||
_this.fromAuto = false;
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
// Manage autoplay via play/stop buttons
|
||||
Autoplay.prototype.controls = function() {
|
||||
var _this = this;
|
||||
var _html = '<button aria-label="Toggle autoplay" class="lg-autoplay-button lg-icon"></button>';
|
||||
|
||||
// Append autoplay controls
|
||||
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
||||
|
||||
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
||||
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
||||
_this.cancelAuto();
|
||||
_this.core.s.fourceAutoplay = false;
|
||||
} else {
|
||||
if (!_this.interval) {
|
||||
_this.startlAuto();
|
||||
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Autostart gallery
|
||||
Autoplay.prototype.startlAuto = function() {
|
||||
var _this = this;
|
||||
|
||||
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
||||
_this.core.$outer.addClass('lg-show-autoplay');
|
||||
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
||||
|
||||
_this.interval = setInterval(function() {
|
||||
if (_this.core.index + 1 < _this.core.$items.length) {
|
||||
_this.core.index++;
|
||||
} else {
|
||||
_this.core.index = 0;
|
||||
}
|
||||
|
||||
_this.fromAuto = true;
|
||||
_this.core.slide(_this.core.index, false, false, 'next');
|
||||
}, _this.core.s.speed + _this.core.s.pause);
|
||||
};
|
||||
|
||||
// cancel Autostart
|
||||
Autoplay.prototype.cancelAuto = function() {
|
||||
clearInterval(this.interval);
|
||||
this.interval = false;
|
||||
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');
|
||||
};
|
||||
|
||||
Autoplay.prototype.destroy = function() {
|
||||
|
||||
this.cancelAuto();
|
||||
this.core.$outer.find('.lg-progress-bar').remove();
|
||||
};
|
||||
|
||||
$.fn.lightGallery.modules.autoplay = Autoplay;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
}));
|
||||
126
public/vendor/site/libs/lightgallery/js/lg-fullscreen.js
vendored
Executable file
126
public/vendor/site/libs/lightgallery/js/lg-fullscreen.js
vendored
Executable file
@@ -0,0 +1,126 @@
|
||||
/*! lg-fullscreen - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
fullScreen: true
|
||||
};
|
||||
|
||||
function isFullScreen() {
|
||||
return (
|
||||
document.fullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.msFullscreenElement
|
||||
);
|
||||
}
|
||||
|
||||
var Fullscreen = function(element) {
|
||||
|
||||
// get lightGallery core plugin data
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.$el = $(element);
|
||||
|
||||
// extend module defalut settings with lightGallery core settings
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Fullscreen.prototype.init = function() {
|
||||
var fullScreen = '';
|
||||
if (this.core.s.fullScreen) {
|
||||
|
||||
// check for fullscreen browser support
|
||||
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
||||
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
||||
return;
|
||||
} else {
|
||||
fullScreen = '<button aria-label="Toggle fullscreen" class="lg-fullscreen lg-icon"></button>';
|
||||
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
||||
this.fullScreen();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Fullscreen.prototype.requestFullscreen = function() {
|
||||
var el = document.documentElement;
|
||||
if (el.requestFullscreen) {
|
||||
el.requestFullscreen();
|
||||
} else if (el.msRequestFullscreen) {
|
||||
el.msRequestFullscreen();
|
||||
} else if (el.mozRequestFullScreen) {
|
||||
el.mozRequestFullScreen();
|
||||
} else if (el.webkitRequestFullscreen) {
|
||||
el.webkitRequestFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
Fullscreen.prototype.exitFullscreen = function() {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
||||
Fullscreen.prototype.fullScreen = function() {
|
||||
var _this = this;
|
||||
|
||||
$(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;
|
||||
|
||||
})();
|
||||
|
||||
}));
|
||||
478
public/vendor/site/libs/lightgallery/js/lg-thumbnail.js
vendored
Executable file
478
public/vendor/site/libs/lightgallery/js/lg-thumbnail.js
vendored
Executable file
@@ -0,0 +1,478 @@
|
||||
/*! lg-thumbnail - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
thumbnail: true,
|
||||
|
||||
animateThumb: true,
|
||||
currentPagerPosition: 'middle',
|
||||
|
||||
thumbWidth: 100,
|
||||
thumbHeight: '80px',
|
||||
thumbContHeight: 100,
|
||||
thumbMargin: 5,
|
||||
|
||||
exThumbImage: false,
|
||||
showThumbByDefault: true,
|
||||
toogleThumb: true,
|
||||
pullCaptionUp: true,
|
||||
|
||||
enableThumbDrag: true,
|
||||
enableThumbSwipe: true,
|
||||
swipeThreshold: 50,
|
||||
|
||||
loadYoutubeThumbnail: true,
|
||||
youtubeThumbSize: 1,
|
||||
|
||||
loadVimeoThumbnail: true,
|
||||
vimeoThumbSize: 'thumbnail_small',
|
||||
|
||||
loadDailymotionThumbnail: true
|
||||
};
|
||||
|
||||
var Thumbnail = function(element) {
|
||||
|
||||
// get lightGallery core plugin data
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
|
||||
this.$el = $(element);
|
||||
this.$thumbOuter = null;
|
||||
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.animateThumb) {
|
||||
this.core.s.thumbHeight = '100%';
|
||||
}
|
||||
|
||||
// Thumbnail animation value
|
||||
this.left = 0;
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Thumbnail.prototype.init = function() {
|
||||
var _this = this;
|
||||
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
||||
if (this.core.s.showThumbByDefault) {
|
||||
setTimeout(function(){
|
||||
_this.core.$outer.addClass('lg-thumb-open');
|
||||
}, 700);
|
||||
}
|
||||
|
||||
if (this.core.s.pullCaptionUp) {
|
||||
this.core.$outer.addClass('lg-pull-caption-up');
|
||||
}
|
||||
|
||||
this.build();
|
||||
if (this.core.s.animateThumb && this.core.doCss()) {
|
||||
if (this.core.s.enableThumbDrag) {
|
||||
this.enableThumbDrag();
|
||||
}
|
||||
|
||||
if (this.core.s.enableThumbSwipe) {
|
||||
this.enableThumbSwipe();
|
||||
}
|
||||
|
||||
this.thumbClickable = false;
|
||||
} else {
|
||||
this.thumbClickable = true;
|
||||
}
|
||||
|
||||
this.toogle();
|
||||
this.thumbkeyPress();
|
||||
}
|
||||
};
|
||||
|
||||
Thumbnail.prototype.build = function() {
|
||||
var _this = this;
|
||||
var thumbList = '';
|
||||
var vimeoErrorThumbSize = '';
|
||||
var $thumb;
|
||||
var html = '<div class="lg-thumb-outer">' +
|
||||
'<div class="lg-thumb lg-group">' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
switch (this.core.s.vimeoThumbSize) {
|
||||
case 'thumbnail_large':
|
||||
vimeoErrorThumbSize = '640';
|
||||
break;
|
||||
case 'thumbnail_medium':
|
||||
vimeoErrorThumbSize = '200x150';
|
||||
break;
|
||||
case 'thumbnail_small':
|
||||
vimeoErrorThumbSize = '100x75';
|
||||
}
|
||||
|
||||
_this.core.$outer.addClass('lg-has-thumb');
|
||||
|
||||
_this.core.$outer.find('.lg').append(html);
|
||||
|
||||
_this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
|
||||
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
||||
|
||||
if (_this.core.s.animateThumb) {
|
||||
_this.core.$outer.find('.lg-thumb').css({
|
||||
width: _this.thumbTotalWidth + 'px',
|
||||
position: 'relative'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.core.s.animateThumb) {
|
||||
_this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
|
||||
}
|
||||
|
||||
function getThumb(src, thumb, index) {
|
||||
var isVideo = _this.core.isVideo(src, index) || {};
|
||||
var thumbImg;
|
||||
var vimeoId = '';
|
||||
|
||||
if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
|
||||
if (isVideo.youtube) {
|
||||
if (_this.core.s.loadYoutubeThumbnail) {
|
||||
thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
} else if (isVideo.vimeo) {
|
||||
if (_this.core.s.loadVimeoThumbnail) {
|
||||
thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
|
||||
vimeoId = isVideo.vimeo[1];
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
} else if (isVideo.dailymotion) {
|
||||
if (_this.core.s.loadDailymotionThumbnail) {
|
||||
thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
thumbImg = thumb;
|
||||
}
|
||||
|
||||
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 = '';
|
||||
}
|
||||
|
||||
if (_this.core.s.dynamic) {
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
_this.core.$items.each(function(i) {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').html(thumbList);
|
||||
|
||||
$thumb = _this.core.$outer.find('.lg-thumb-item');
|
||||
|
||||
// Load vimeo thumbnails
|
||||
$thumb.each(function() {
|
||||
var $this = $(this);
|
||||
var vimeoVideoId = $this.attr('data-vimeo-id');
|
||||
|
||||
if (vimeoVideoId) {
|
||||
$.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
|
||||
format: 'json'
|
||||
}, function(data) {
|
||||
$this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 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');
|
||||
});
|
||||
|
||||
$thumb.on('click.lg touchend.lg', function() {
|
||||
var _$this = $(this);
|
||||
setTimeout(function() {
|
||||
|
||||
// In IE9 and bellow touch does not support
|
||||
// Go to slide if browser does not support css transitions
|
||||
if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
|
||||
_this.core.index = _$this.index();
|
||||
_this.core.slide(_this.core.index, false, true, false);
|
||||
}
|
||||
}, 50);
|
||||
});
|
||||
|
||||
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
||||
_this.animateThumb(_this.core.index);
|
||||
});
|
||||
|
||||
$(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
|
||||
setTimeout(function() {
|
||||
_this.animateThumb(_this.core.index);
|
||||
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
||||
}, 200);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Thumbnail.prototype.setTranslate = function(value) {
|
||||
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
||||
this.core.$outer.find('.lg-thumb').css({
|
||||
transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
|
||||
});
|
||||
};
|
||||
|
||||
Thumbnail.prototype.animateThumb = function(index) {
|
||||
var $thumb = this.core.$outer.find('.lg-thumb');
|
||||
if (this.core.s.animateThumb) {
|
||||
var position;
|
||||
switch (this.core.s.currentPagerPosition) {
|
||||
case 'left':
|
||||
position = 0;
|
||||
break;
|
||||
case 'middle':
|
||||
position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
|
||||
break;
|
||||
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)) {
|
||||
this.left = this.thumbTotalWidth - this.thumbOuterWidth;
|
||||
}
|
||||
|
||||
if (this.left < 0) {
|
||||
this.left = 0;
|
||||
}
|
||||
|
||||
if (this.core.lGalleryOn) {
|
||||
if (!$thumb.hasClass('on')) {
|
||||
this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
|
||||
}
|
||||
|
||||
if (!this.core.doCss()) {
|
||||
$thumb.animate({
|
||||
left: -this.left + 'px'
|
||||
}, this.core.s.speed);
|
||||
}
|
||||
} else {
|
||||
if (!this.core.doCss()) {
|
||||
$thumb.css('left', -this.left + 'px');
|
||||
}
|
||||
}
|
||||
|
||||
this.setTranslate(this.left);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// Enable thumbnail dragging and swiping
|
||||
Thumbnail.prototype.enableThumbDrag = function() {
|
||||
|
||||
var _this = this;
|
||||
var startCoords = 0;
|
||||
var endCoords = 0;
|
||||
var isDraging = false;
|
||||
var isMoved = false;
|
||||
var tempLeft = 0;
|
||||
|
||||
_this.$thumbOuter.addClass('lg-grab');
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
// execute only on .lg-object
|
||||
e.preventDefault();
|
||||
startCoords = e.pageX;
|
||||
isDraging = true;
|
||||
|
||||
// ** 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;
|
||||
|
||||
// *
|
||||
_this.thumbClickable = false;
|
||||
_this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mousemove.lg.thumb', function(e) {
|
||||
if (isDraging) {
|
||||
tempLeft = _this.left;
|
||||
isMoved = true;
|
||||
endCoords = e.pageX;
|
||||
|
||||
_this.$thumbOuter.addClass('lg-dragging');
|
||||
|
||||
tempLeft = tempLeft - (endCoords - startCoords);
|
||||
|
||||
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
||||
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
||||
}
|
||||
|
||||
if (tempLeft < 0) {
|
||||
tempLeft = 0;
|
||||
}
|
||||
|
||||
// move current slide
|
||||
_this.setTranslate(tempLeft);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mouseup.lg.thumb', function() {
|
||||
if (isMoved) {
|
||||
isMoved = false;
|
||||
_this.$thumbOuter.removeClass('lg-dragging');
|
||||
|
||||
_this.left = tempLeft;
|
||||
|
||||
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
|
||||
if (isDraging) {
|
||||
isDraging = false;
|
||||
_this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Thumbnail.prototype.enableThumbSwipe = function() {
|
||||
var _this = this;
|
||||
var startCoords = 0;
|
||||
var endCoords = 0;
|
||||
var isMoved = false;
|
||||
var tempLeft = 0;
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
e.preventDefault();
|
||||
startCoords = e.originalEvent.targetTouches[0].pageX;
|
||||
_this.thumbClickable = false;
|
||||
}
|
||||
});
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
e.preventDefault();
|
||||
endCoords = e.originalEvent.targetTouches[0].pageX;
|
||||
isMoved = true;
|
||||
|
||||
_this.$thumbOuter.addClass('lg-dragging');
|
||||
|
||||
tempLeft = _this.left;
|
||||
|
||||
tempLeft = tempLeft - (endCoords - startCoords);
|
||||
|
||||
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
||||
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
||||
}
|
||||
|
||||
if (tempLeft < 0) {
|
||||
tempLeft = 0;
|
||||
}
|
||||
|
||||
// move current slide
|
||||
_this.setTranslate(tempLeft);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
_this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
|
||||
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
||||
|
||||
if (isMoved) {
|
||||
isMoved = false;
|
||||
_this.$thumbOuter.removeClass('lg-dragging');
|
||||
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
|
||||
_this.left = tempLeft;
|
||||
} else {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
} else {
|
||||
_this.thumbClickable = true;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Thumbnail.prototype.toogle = function() {
|
||||
var _this = this;
|
||||
if (_this.core.s.toogleThumb) {
|
||||
_this.core.$outer.addClass('lg-can-toggle');
|
||||
_this.$thumbOuter.append('<button aria-label="Toggle thumbnails" class="lg-toogle-thumb lg-icon"></button>');
|
||||
_this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
|
||||
_this.core.$outer.toggleClass('lg-thumb-open');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Thumbnail.prototype.thumbkeyPress = function() {
|
||||
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;
|
||||
|
||||
})();
|
||||
|
||||
}));
|
||||
353
public/vendor/site/libs/lightgallery/js/lg-video.js
vendored
Executable file
353
public/vendor/site/libs/lightgallery/js/lg-video.js
vendored
Executable file
@@ -0,0 +1,353 @@
|
||||
/*! lg-video - v1.3.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var defaults = {
|
||||
videoMaxWidth: '855px',
|
||||
|
||||
autoplayFirstVideo: true,
|
||||
|
||||
youtubePlayerParams: false,
|
||||
vimeoPlayerParams: false,
|
||||
dailymotionPlayerParams: false,
|
||||
vkPlayerParams: false,
|
||||
|
||||
videojs: false,
|
||||
videojsOptions: {}
|
||||
};
|
||||
|
||||
var Video = function(element) {
|
||||
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.$el = $(element);
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
this.videoLoaded = false;
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Video.prototype.init = function() {
|
||||
var _this = this;
|
||||
|
||||
// Event triggered when video url found without poster
|
||||
_this.core.$el.on('hasVideo.lg.tm', onHasVideo.bind(this));
|
||||
|
||||
// Set max width for video
|
||||
_this.core.$el.on('onAferAppendSlide.lg.tm', onAferAppendSlide.bind(this));
|
||||
|
||||
if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) {
|
||||
_this.core.$el.on('onSlideClick.lg.tm', function() {
|
||||
var $el = _this.core.$slide.eq(_this.core.index);
|
||||
_this.loadVideoOnclick($el);
|
||||
});
|
||||
} else {
|
||||
|
||||
// For IE 9 and bellow
|
||||
_this.core.$slide.on('click.lg', function() {
|
||||
_this.loadVideoOnclick($(this));
|
||||
});
|
||||
}
|
||||
|
||||
_this.core.$el.on('onBeforeSlide.lg.tm', onBeforeSlide.bind(this));
|
||||
|
||||
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) {
|
||||
_this.core.$slide.eq(prevIndex).removeClass('lg-video-playing');
|
||||
});
|
||||
|
||||
if (_this.core.s.autoplayFirstVideo) {
|
||||
_this.core.$el.on('onAferAppendSlide.lg.tm', function (e, index) {
|
||||
if (!_this.core.lGalleryOn) {
|
||||
var $el = _this.core.$slide.eq(index);
|
||||
setTimeout(function () {
|
||||
_this.loadVideoOnclick($el);
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Video.prototype.loadVideo = function(src, addClass, noPoster, index, html) {
|
||||
var _this = this;
|
||||
var video = '';
|
||||
var autoplay = 1;
|
||||
var a = '';
|
||||
var isVideo = this.core.isVideo(src, index) || {};
|
||||
var videoTitle;
|
||||
|
||||
if (_this.core.s.dynamic) {
|
||||
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');
|
||||
}
|
||||
|
||||
videoTitle = videoTitle ? 'title="' + videoTitle + '"' : '';
|
||||
|
||||
// Enable autoplay based on setting for first video if poster doesn't exist
|
||||
if (noPoster) {
|
||||
if (this.videoLoaded) {
|
||||
autoplay = 0;
|
||||
} else {
|
||||
autoplay = this.core.s.autoplayFirstVideo ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isVideo.youtube) {
|
||||
|
||||
a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
|
||||
if (this.core.s.youtubePlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.youtubePlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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 (isVideo.vimeo) {
|
||||
|
||||
a = '?autoplay=' + autoplay + '&api=1';
|
||||
if (this.core.s.vimeoPlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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 (isVideo.dailymotion) {
|
||||
|
||||
a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
|
||||
if (this.core.s.dailymotionPlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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);
|
||||
if (fL === '.' || fL === '#') {
|
||||
html = $(html).html();
|
||||
}
|
||||
|
||||
video = html;
|
||||
|
||||
} else if (isVideo.vk) {
|
||||
|
||||
a = '&autoplay=' + autoplay;
|
||||
if (this.core.s.vkPlayerParams) {
|
||||
a = a + '&' + $.param(this.core.s.vkPlayerParams);
|
||||
}
|
||||
|
||||
video = '<iframe 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>';
|
||||
|
||||
}
|
||||
|
||||
return video;
|
||||
};
|
||||
|
||||
Video.prototype.loadVideoOnclick = function($el){
|
||||
|
||||
var _this = this;
|
||||
// check slide has poster
|
||||
if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
|
||||
|
||||
// check already video element present
|
||||
if (!$el.hasClass('lg-has-video')) {
|
||||
|
||||
$el.addClass('lg-video-playing lg-has-video');
|
||||
|
||||
var _src;
|
||||
var _html;
|
||||
var _loadVideo = function(_src, _html) {
|
||||
|
||||
$el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
|
||||
|
||||
if (_html) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
||||
this.play();
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included videojs');
|
||||
}
|
||||
} else {
|
||||
_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if (_this.core.s.dynamic) {
|
||||
|
||||
_src = _this.core.s.dynamicEl[_this.core.index].src;
|
||||
_html = _this.core.s.dynamicEl[_this.core.index].html;
|
||||
|
||||
_loadVideo(_src, _html);
|
||||
|
||||
} else {
|
||||
|
||||
_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);
|
||||
|
||||
}
|
||||
|
||||
var $tempImg = $el.find('.lg-object');
|
||||
$el.find('.lg-video').append($tempImg);
|
||||
|
||||
// @todo loading icon for html5 videos also
|
||||
// for showing the loading indicator while loading video
|
||||
if (!$el.find('.lg-video-object').hasClass('lg-html5')) {
|
||||
$el.removeClass('lg-complete');
|
||||
$el.find('.lg-video-object').on('load.lg error.lg', function() {
|
||||
$el.addClass('lg-complete');
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
var youtubePlayer = $el.find('.lg-youtube').get(0);
|
||||
var vimeoPlayer = $el.find('.lg-vimeo').get(0);
|
||||
var dailymotionPlayer = $el.find('.lg-dailymotion').get(0);
|
||||
var html5Player = $el.find('.lg-html5').get(0);
|
||||
if (youtubePlayer) {
|
||||
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
|
||||
} else if (vimeoPlayer) {
|
||||
try {
|
||||
$f(vimeoPlayer).api('play');
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included froogaloop2 js');
|
||||
}
|
||||
} else if (dailymotionPlayer) {
|
||||
dailymotionPlayer.contentWindow.postMessage('play', '*');
|
||||
|
||||
} else if (html5Player) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(html5Player).play();
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included videojs');
|
||||
}
|
||||
} else {
|
||||
html5Player.play();
|
||||
}
|
||||
}
|
||||
|
||||
$el.addClass('lg-video-playing');
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Video.prototype.destroy = function() {
|
||||
this.videoLoaded = false;
|
||||
};
|
||||
|
||||
function onHasVideo(event, index, src, html) {
|
||||
/*jshint validthis:true */
|
||||
var _this = this;
|
||||
_this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
|
||||
if (html) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
||||
if (!_this.videoLoaded && _this.core.s.autoplayFirstVideo) {
|
||||
this.play();
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('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 {
|
||||
$f(vimeoPlayer).api('pause');
|
||||
} catch (e) {
|
||||
console.error('Make sure you have included froogaloop2 js');
|
||||
}
|
||||
} else if (dailymotionPlayer) {
|
||||
dailymotionPlayer.contentWindow.postMessage('pause', '*');
|
||||
|
||||
} else if (html5Player) {
|
||||
if (_this.core.s.videojs) {
|
||||
try {
|
||||
videojs(html5Player).pause();
|
||||
} catch (e) {
|
||||
console.error('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;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
}));
|
||||
527
public/vendor/site/libs/lightgallery/js/lg-zoom.js
vendored
Executable file
527
public/vendor/site/libs/lightgallery/js/lg-zoom.js
vendored
Executable file
@@ -0,0 +1,527 @@
|
||||
/*! lg-zoom - v1.2.0 - 2020-05-03
|
||||
* http://sachinchoolur.github.io/lightGallery
|
||||
* Copyright (c) 2020 Sachin N; Licensed GPLv3 */
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(['jquery'], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var getUseLeft = function() {
|
||||
var useLeft = false;
|
||||
var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
||||
if (isChrome && parseInt(isChrome[2], 10) < 54) {
|
||||
useLeft = true;
|
||||
}
|
||||
|
||||
return useLeft;
|
||||
};
|
||||
|
||||
var defaults = {
|
||||
scale: 1,
|
||||
zoom: true,
|
||||
actualSize: true,
|
||||
enableZoomAfter: 300,
|
||||
useLeftForZoom: getUseLeft()
|
||||
};
|
||||
|
||||
var Zoom = function(element) {
|
||||
|
||||
this.core = $(element).data('lightGallery');
|
||||
|
||||
this.core.s = $.extend({}, defaults, this.core.s);
|
||||
|
||||
if (this.core.s.zoom && this.core.doCss()) {
|
||||
this.init();
|
||||
|
||||
// Store the zoomable timeout value just to clear it while closing
|
||||
this.zoomabletimeout = false;
|
||||
|
||||
// Set the initial value center
|
||||
this.pageX = $(window).width() / 2;
|
||||
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Zoom.prototype.init = function() {
|
||||
|
||||
var _this = this;
|
||||
var zoomIcons = '<button aria-label="Zoom in" id="lg-zoom-in" class="lg-icon"></button><button aria-label="Zoom out" id="lg-zoom-out" class="lg-icon"></button>';
|
||||
|
||||
if (_this.core.s.actualSize) {
|
||||
zoomIcons += '<button aria-label="Actual size" id="lg-actual-size" class="lg-icon"></button>';
|
||||
}
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_this.core.$outer.addClass('lg-use-left-for-zoom');
|
||||
} else {
|
||||
_this.core.$outer.addClass('lg-use-transition-for-zoom');
|
||||
}
|
||||
|
||||
this.core.$outer.find('.lg-toolbar').append(zoomIcons);
|
||||
|
||||
// Add zoomable class
|
||||
_this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) {
|
||||
|
||||
// delay will be 0 except first time
|
||||
var _speed = _this.core.s.enableZoomAfter + delay;
|
||||
|
||||
// set _speed value 0 if gallery opened from direct url and if it is first slide
|
||||
if ($('body').hasClass('lg-from-hash') && delay) {
|
||||
|
||||
// will execute only once
|
||||
_speed = 0;
|
||||
} else {
|
||||
|
||||
// Remove lg-from-hash to enable starting animation.
|
||||
$('body').removeClass('lg-from-hash');
|
||||
}
|
||||
|
||||
_this.zoomabletimeout = setTimeout(function() {
|
||||
_this.core.$slide.eq(index).addClass('lg-zoomable');
|
||||
}, _speed + 30);
|
||||
});
|
||||
|
||||
var scale = 1;
|
||||
/**
|
||||
* @desc Image zoom
|
||||
* Translate the wrap and scale the image to get better user experience
|
||||
*
|
||||
* @param {String} scaleVal - Zoom decrement/increment value
|
||||
*/
|
||||
var zoom = function(scaleVal) {
|
||||
|
||||
var $image = _this.core.$outer.find('.lg-current .lg-image');
|
||||
var _x;
|
||||
var _y;
|
||||
|
||||
// Find offset manually to avoid issue after zoom
|
||||
var offsetX = ($(window).width() - $image.prop('offsetWidth')) / 2;
|
||||
var offsetY = (($(window).height() - $image.prop('offsetHeight')) / 2) + $(window).scrollTop();
|
||||
|
||||
_x = _this.pageX - offsetX;
|
||||
_y = _this.pageY - offsetY;
|
||||
|
||||
var x = (scaleVal - 1) * (_x);
|
||||
var y = (scaleVal - 1) * (_y);
|
||||
|
||||
$image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
$image.parent().css({
|
||||
left: -x + 'px',
|
||||
top: -y + 'px'
|
||||
}).attr('data-x', x).attr('data-y', y);
|
||||
} else {
|
||||
$image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y);
|
||||
}
|
||||
};
|
||||
|
||||
var callScale = function() {
|
||||
if (scale > 1) {
|
||||
_this.core.$outer.addClass('lg-zoomed');
|
||||
} else {
|
||||
_this.resetZoom();
|
||||
}
|
||||
|
||||
if (scale < 1) {
|
||||
scale = 1;
|
||||
}
|
||||
|
||||
zoom(scale);
|
||||
};
|
||||
|
||||
var actualSize = function(event, $image, index, fromIcon) {
|
||||
var w = $image.prop('offsetWidth');
|
||||
var nw;
|
||||
if (_this.core.s.dynamic) {
|
||||
nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w;
|
||||
} else {
|
||||
nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w;
|
||||
}
|
||||
|
||||
var _scale;
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
scale = 1;
|
||||
} else {
|
||||
if (nw > w) {
|
||||
_scale = nw / w;
|
||||
scale = _scale || 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (fromIcon) {
|
||||
_this.pageX = $(window).width() / 2;
|
||||
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
} else {
|
||||
_this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX;
|
||||
_this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY;
|
||||
}
|
||||
|
||||
callScale();
|
||||
setTimeout(function() {
|
||||
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
||||
}, 10);
|
||||
};
|
||||
|
||||
var tapped = false;
|
||||
|
||||
// event triggered after appending slide content
|
||||
_this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) {
|
||||
|
||||
// Get the current element
|
||||
var $image = _this.core.$slide.eq(index).find('.lg-image');
|
||||
|
||||
$image.on('dblclick', function(event) {
|
||||
actualSize(event, $image, index);
|
||||
});
|
||||
|
||||
$image.on('touchstart', function(event) {
|
||||
if (!tapped) {
|
||||
tapped = setTimeout(function() {
|
||||
tapped = null;
|
||||
}, 300);
|
||||
} else {
|
||||
clearTimeout(tapped);
|
||||
tapped = null;
|
||||
actualSize(event, $image, index);
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Update zoom on resize and orientationchange
|
||||
$(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() {
|
||||
_this.pageX = $(window).width() / 2;
|
||||
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
zoom(scale);
|
||||
});
|
||||
|
||||
$('#lg-zoom-out').on('click.lg', function() {
|
||||
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
||||
scale -= _this.core.s.scale;
|
||||
callScale();
|
||||
}
|
||||
});
|
||||
|
||||
$('#lg-zoom-in').on('click.lg', function() {
|
||||
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
||||
scale += _this.core.s.scale;
|
||||
callScale();
|
||||
}
|
||||
});
|
||||
|
||||
$('#lg-actual-size').on('click.lg', function(event) {
|
||||
actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true);
|
||||
});
|
||||
|
||||
// Reset zoom on slide change
|
||||
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
||||
scale = 1;
|
||||
_this.resetZoom();
|
||||
});
|
||||
|
||||
// Drag option after zoom
|
||||
_this.zoomDrag();
|
||||
|
||||
_this.zoomSwipe();
|
||||
|
||||
};
|
||||
|
||||
// Reset zoom effect
|
||||
Zoom.prototype.resetZoom = function() {
|
||||
this.core.$outer.removeClass('lg-zoomed');
|
||||
this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y');
|
||||
this.core.$slide.find('.lg-image').removeAttr('style data-scale');
|
||||
|
||||
// Reset pagx pagy values to center
|
||||
this.pageX = $(window).width() / 2;
|
||||
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
||||
};
|
||||
|
||||
Zoom.prototype.zoomSwipe = function() {
|
||||
var _this = this;
|
||||
var startCoords = {};
|
||||
var endCoords = {};
|
||||
var isMoved = false;
|
||||
|
||||
// Allow x direction drag
|
||||
var allowX = false;
|
||||
|
||||
// Allow Y direction drag
|
||||
var allowY = false;
|
||||
|
||||
_this.core.$slide.on('touchstart.lg', function(e) {
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
||||
|
||||
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
||||
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
||||
if ((allowX || allowY)) {
|
||||
e.preventDefault();
|
||||
startCoords = {
|
||||
x: e.originalEvent.targetTouches[0].pageX,
|
||||
y: e.originalEvent.targetTouches[0].pageY
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
_this.core.$slide.on('touchmove.lg', function(e) {
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
|
||||
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
||||
var distanceX;
|
||||
var distanceY;
|
||||
|
||||
e.preventDefault();
|
||||
isMoved = true;
|
||||
|
||||
endCoords = {
|
||||
x: e.originalEvent.targetTouches[0].pageX,
|
||||
y: e.originalEvent.targetTouches[0].pageY
|
||||
};
|
||||
|
||||
// reset opacity and transition duration
|
||||
_this.core.$outer.addClass('lg-zoom-dragging');
|
||||
|
||||
if (allowY) {
|
||||
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
||||
} else {
|
||||
distanceY = -Math.abs(_$el.attr('data-y'));
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
||||
} else {
|
||||
distanceX = -Math.abs(_$el.attr('data-x'));
|
||||
}
|
||||
|
||||
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_$el.css({
|
||||
left: distanceX + 'px',
|
||||
top: distanceY + 'px'
|
||||
});
|
||||
} else {
|
||||
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
_this.core.$slide.on('touchend.lg', function() {
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
if (isMoved) {
|
||||
isMoved = false;
|
||||
_this.core.$outer.removeClass('lg-zoom-dragging');
|
||||
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Zoom.prototype.zoomDrag = function() {
|
||||
|
||||
var _this = this;
|
||||
var startCoords = {};
|
||||
var endCoords = {};
|
||||
var isDraging = false;
|
||||
var isMoved = false;
|
||||
|
||||
// Allow x direction drag
|
||||
var allowX = false;
|
||||
|
||||
// Allow Y direction drag
|
||||
var allowY = false;
|
||||
|
||||
_this.core.$slide.on('mousedown.lg.zoom', function(e) {
|
||||
|
||||
// execute only on .lg-object
|
||||
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
||||
|
||||
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
||||
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
||||
|
||||
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
||||
if ($(e.target).hasClass('lg-object') && (allowX || allowY)) {
|
||||
e.preventDefault();
|
||||
startCoords = {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
|
||||
isDraging = true;
|
||||
|
||||
// ** 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;
|
||||
|
||||
_this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mousemove.lg.zoom', function(e) {
|
||||
if (isDraging) {
|
||||
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
||||
var distanceX;
|
||||
var distanceY;
|
||||
|
||||
isMoved = true;
|
||||
endCoords = {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
|
||||
// reset opacity and transition duration
|
||||
_this.core.$outer.addClass('lg-zoom-dragging');
|
||||
|
||||
if (allowY) {
|
||||
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
||||
} else {
|
||||
distanceY = -Math.abs(_$el.attr('data-y'));
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
||||
} else {
|
||||
distanceX = -Math.abs(_$el.attr('data-x'));
|
||||
}
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_$el.css({
|
||||
left: distanceX + 'px',
|
||||
top: distanceY + 'px'
|
||||
});
|
||||
} else {
|
||||
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('mouseup.lg.zoom', function(e) {
|
||||
|
||||
if (isDraging) {
|
||||
isDraging = false;
|
||||
_this.core.$outer.removeClass('lg-zoom-dragging');
|
||||
|
||||
// Fix for chrome mouse move on click
|
||||
if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
|
||||
endCoords = {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
||||
|
||||
}
|
||||
|
||||
isMoved = false;
|
||||
}
|
||||
|
||||
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) {
|
||||
|
||||
var _this = this;
|
||||
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
||||
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
||||
var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
||||
var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
||||
var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2;
|
||||
var maxY = Math.abs(($image.prop('offsetHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY);
|
||||
var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2;
|
||||
var maxX = Math.abs(($image.prop('offsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX);
|
||||
|
||||
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
||||
if (allowY) {
|
||||
if (distanceY <= -maxY) {
|
||||
distanceY = -maxY;
|
||||
} else if (distanceY >= -minY) {
|
||||
distanceY = -minY;
|
||||
}
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
if (distanceX <= -maxX) {
|
||||
distanceX = -maxX;
|
||||
} else if (distanceX >= -minX) {
|
||||
distanceX = -minX;
|
||||
}
|
||||
}
|
||||
|
||||
if (allowY) {
|
||||
_$el.attr('data-y', Math.abs(distanceY));
|
||||
} else {
|
||||
distanceY = -Math.abs(_$el.attr('data-y'));
|
||||
}
|
||||
|
||||
if (allowX) {
|
||||
_$el.attr('data-x', Math.abs(distanceX));
|
||||
} else {
|
||||
distanceX = -Math.abs(_$el.attr('data-x'));
|
||||
}
|
||||
|
||||
if (_this.core.s.useLeftForZoom) {
|
||||
_$el.css({
|
||||
left: distanceX + 'px',
|
||||
top: distanceY + 'px'
|
||||
});
|
||||
} else {
|
||||
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Zoom.prototype.destroy = function() {
|
||||
|
||||
var _this = this;
|
||||
|
||||
// Unbind all events added by lightGallery zoom plugin
|
||||
_this.core.$el.off('.lg.zoom');
|
||||
$(window).off('.lg.zoom');
|
||||
_this.core.$slide.off('.lg.zoom');
|
||||
_this.core.$el.off('.lg.tm.zoom');
|
||||
_this.resetZoom();
|
||||
clearTimeout(_this.zoomabletimeout);
|
||||
_this.zoomabletimeout = false;
|
||||
};
|
||||
|
||||
$.fn.lightGallery.modules.zoom = Zoom;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
}));
|
||||
4
public/vendor/site/libs/lightgallery/js/lightgallery.min.js
vendored
Executable file
4
public/vendor/site/libs/lightgallery/js/lightgallery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user