sbbs/themes/hueman/source/libs/lightgallery/js/lightgallery.min.js

7 lines
24 KiB
JavaScript
Raw Permalink Normal View History

2018-09-03 07:41:16 +00:00
/**!
* lightgallery.js | 0.0.2 | August 4th 2016
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2016 Sachin N;
* @license Apache 2.0
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Lightgallery=e()}}(function(){var e,t,s;return function e(t,s,l){function i(d,r){if(!s[d]){if(!t[d]){var n="function"==typeof require&&require;if(!r&&n)return n(d,!0);if(o)return o(d,!0);var a=new Error("Cannot find module '"+d+"'");throw a.code="MODULE_NOT_FOUND",a}var u=s[d]={exports:{}};t[d][0].call(u.exports,function(e){var s=t[d][1][e];return i(s?s:e)},u,u.exports,e,t,s,l)}return s[d].exports}for(var o="function"==typeof require&&require,d=0;d<l.length;d++)i(l[d]);return i}({1:[function(t,s,l){!function(t,s){if("function"==typeof e&&e.amd)e(["exports"],s);else if("undefined"!=typeof l)s(l);else{var i={exports:{}};s(i.exports),t.lgUtils=i.exports}}(this,function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),window.getAttribute=function(e){return window[e]},window.setAttribute=function(e,t){window[e]=t},document.getAttribute=function(e){return document[e]},document.setAttribute=function(e,t){document[e]=t};var t={wrap:function e(t,s){if(t){var l=document.createElement("div");l.className=s,t.parentNode.insertBefore(l,t),t.parentNode.removeChild(t),l.appendChild(t)}},addClass:function e(t,s){t&&(t.classList?t.classList.add(s):t.className+=" "+s)},removeClass:function e(t,s){t&&(t.classList?t.classList.remove(s):t.className=t.className.replace(new RegExp("(^|\\b)"+s.split(" ").join("|")+"(\\b|$)","gi")," "))},hasClass:function e(t,s){return t.classList?t.classList.contains(s):new RegExp("(^| )"+s+"( |$)","gi").test(t.className)},setVendor:function e(t,s,l){t&&(t.style[s.charAt(0).toLowerCase()+s.slice(1)]=l,t.style["webkit"+s]=l,t.style["moz"+s]=l,t.style["ms"+s]=l,t.style["o"+s]=l)},trigger:function e(t,s){var l=arguments.length<=2||void 0===arguments[2]?null:arguments[2];if(t){var i=new CustomEvent(s,{detail:l});t.dispatchEvent(i)}},Listener:{uid:0},on:function e(s,l,i){s&&l.split(" ").forEach(function(e){var l=s.getAttribute("lg-event-uid")||"";t.Listener.uid++,l+="&"+t.Listener.uid,s.setAttribute("lg-event-uid",l),t.Listener[e+t.Listener.uid]=i,s.addEventListener(e.split(".")[0],i,!1)})},off:function e(s,l){if(s){var i=s.getAttribute("lg-event-uid");if(i){i=i.split("&");for(var o=0;o<i.length;o++)if(i[o]){var d=l+i[o];if("."===d.substring(0,1))for(var r in t.Listener)t.Listener.hasOwnProperty(r)&&r.split(".").indexOf(d.split(".")[1])>-1&&(s.removeEventListener(r.split(".")[0],t.Listener[r]),s.setAttribute("lg-event-uid",s.getAttribute("lg-event-uid").replace("&"+i[o],"")),delete t.Listener[r]);else s.removeEventListener(d.split(".")[0],t.Listener[d]),s.setAttribute("lg-event-uid",s.getAttribute("lg-event-uid").replace("&"+i[o],"")),delete t.Listener[d]}}}},param:function e(t){return Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")}};e.default=t})},{}],2:[function(t,s,l){!function(s,i){if("function"==typeof e&&e.amd)e(["./lg-utils"],i);else if("undefined"!=typeof l)i(t("./lg-utils"));else{var o={exports:{}};i(s.lgUtils),s.lightgallery=o.exports}}(this,function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(this.el=e,this.s=i({},o,t),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.items=[],this.s.dynamic?this.items=this.s.dynamicEl:"this"===this.s.selector?this.items.push(this.el):""!==this.s.selector?this.s.selectWithin?this.items=document.querySelector(this.s.selectWithin).querySelectorAll(this.s.selector):this.items=this.el.querySelectorAll(this.s.selector):this.items=this.el.children,this.___slide="",this.outer="",this