/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.rightwindow.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge}); //# sourceMappingURL=popper.min.js.map /*! * Bootstrap v4.5.0 (https://getbootstrap.com/) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,(function(t,e,n){"use strict";function i(t,e){for(var n=0;n=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};c.jQueryDetection(),e.fn.emulateTransitionEnd=l,e.event.special[c.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var h="alert",u=e.fn[h],d=function(){function t(t){this._element=t}var n=t.prototype;return n.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},n.dispose=function(){e.removeData(this._element,"bs.alert"),this._element=null},n._getRootElement=function(t){var n=c.getSelectorFromElement(t),i=!1;return n&&(i=document.querySelector(n)),i||(i=e(t).closest(".alert")[0]),i},n._triggerCloseEvent=function(t){var n=e.Event("close.bs.alert");return e(t).trigger(n),n},n._removeElement=function(t){var n=this;if(e(t).removeClass("show"),e(t).hasClass("fade")){var i=c.getTransitionDurationFromElement(t);e(t).one(c.TRANSITION_END,(function(e){return n._destroyElement(t,e)})).emulateTransitionEnd(i)}else this._destroyElement(t)},n._destroyElement=function(t){e(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||(o=new t(this),i.data("bs.alert",o)),"close"===n&&o[n](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',d._handleDismiss(new d)),e.fn[h]=d._jQueryInterface,e.fn[h].Constructor=d,e.fn[h].noConflict=function(){return e.fn[h]=u,d._jQueryInterface};var f=e.fn.button,g=function(){function t(t){this._element=t}var n=t.prototype;return n.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var o=this._element.querySelector('input:not([type="hidden"])');if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains("active"))t=!1;else{var s=i.querySelector(".active");s&&e(s).removeClass("active")}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains("active")),e(o).trigger("change")),o.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},n.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.button");i||(i=new t(this),e(this).data("bs.button",i)),"toggle"===n&&i[n]()}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"LABEL"===i.tagName&&o&&"checkbox"===o.type&&t.preventDefault(),g._jQueryInterface.call(e(n),"toggle")}})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))})),e(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&e(this._element).is(":visible")&&"hidden"!==e(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(c.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var n=this;this._activeElement=this._element.querySelector(".active.carousel-item");var i=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)e(this._element).one("slid.bs.carousel",(function(){return n.to(t)}));else{if(i===t)return this.pause(),void this.cycle();var o=t>i?"next":"prev";this._slide(o,this._items[t])}},n.dispose=function(){e(this._element).off(p),e.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=a(a({},v),t),c.typeCheckConfig(m,t,b),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},n._addEventListeners=function(){var t=this;this._config.keyboard&&e(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&e(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var n=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},i=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};e(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(e(this._element).on("pointerdown.bs.carousel",(function(t){return n(t)})),e(this._element).on("pointerup.bs.carousel",(function(t){return i(t)})),this._element.classList.add("pointer-event")):(e(this._element).on("touchstart.bs.carousel",(function(t){return n(t)})),e(this._element).on("touchmove.bs.carousel",(function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),e(this._element).on("touchend.bs.carousel",(function(t){return i(t)})))}},n._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},n._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+("prev"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,n){var i=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(".active.carousel-item")),s=e.Event("slide.bs.carousel",{relatedTarget:t,direction:n,from:o,to:i});return e(this._element).trigger(s),s},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));e(n).removeClass("active");var i=this._indicatorsElement.children[this._getItemIndex(t)];i&&e(i).addClass("active")}},n._slide=function(t,n){var i,o,s,r=this,a=this._element.querySelector(".active.carousel-item"),l=this._getItemIndex(a),h=n||a&&this._getItemByDirection(t,a),u=this._getItemIndex(h),d=Boolean(this._interval);if("next"===t?(i="carousel-item-left",o="carousel-item-next",s="left"):(i="carousel-item-right",o="carousel-item-prev",s="right"),h&&e(h).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(h,s).isDefaultPrevented()&&a&&h){this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(h);var f=e.Event("slid.bs.carousel",{relatedTarget:h,direction:s,from:l,to:u});if(e(this._element).hasClass("slide")){e(h).addClass(o),c.reflow(h),e(a).addClass(i),e(h).addClass(i);var g=parseInt(h.getAttribute("data-interval"),10);g?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=g):this._config.interval=this._config.defaultInterval||this._config.interval;var m=c.getTransitionDurationFromElement(a);e(a).one(c.TRANSITION_END,(function(){e(h).removeClass(i+" "+o).addClass("active"),e(a).removeClass("active "+o+" "+i),r._isSliding=!1,setTimeout((function(){return e(r._element).trigger(f)}),0)})).emulateTransitionEnd(m)}else e(a).removeClass("active"),e(h).addClass("active"),this._isSliding=!1,e(this._element).trigger(f);d&&this.cycle()}},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.carousel"),o=a(a({},v),e(this).data());"object"==typeof n&&(o=a(a({},o),n));var s="string"==typeof n?n:o.slide;if(i||(i=new t(this,o),e(this).data("bs.carousel",i)),"number"==typeof n)i.to(n);else if("string"==typeof s){if("undefined"==typeof i[s])throw new TypeError('No method named "'+s+'"');i[s]()}else o.interval&&o.ride&&(i.pause(),i.cycle())}))},t._dataApiClickHandler=function(n){var i=c.getSelectorFromElement(this);if(i){var o=e(i)[0];if(o&&e(o).hasClass("carousel")){var s=a(a({},e(o).data()),e(this).data()),r=this.getAttribute("data-slide-to");r&&(s.interval=!1),t._jQueryInterface.call(e(o),s),r&&e(o).data("bs.carousel").to(r),n.preventDefault()}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return v}}]),t}();e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",E._dataApiClickHandler),e(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),n=0,i=t.length;n0&&(this._selector=r,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=t.prototype;return n.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},n.show=function(){var n,i,o=this;if(!this._isTransitioning&&!e(this._element).hasClass("show")&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains("collapse")}))).length&&(n=null),!(n&&(i=e(n).not(this._selector).data("bs.collapse"))&&i._isTransitioning))){var s=e.Event("show.bs.collapse");if(e(this._element).trigger(s),!s.isDefaultPrevented()){n&&(t._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data("bs.collapse",null));var r=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[r]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var a="scroll"+(r[0].toUpperCase()+r.slice(1)),l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[r]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(l),this._element.style[r]=this._element[a]+"px"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var n=e.Event("hide.bs.collapse");if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",c.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var s=0;s0},i._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},i._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),a(a({},t),this._config.popperConfig)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.dropdown");if(i||(i=new t(this,"object"==typeof n?n:null),e(this).data("bs.dropdown",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},t._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var i=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),o=0,s=i.length;o0&&r--,40===n.which&&rdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:F,popperConfig:null},Y={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},$=function(){function t(t,e){if("undefined"==typeof n)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var i=t.prototype;return i.enable=function(){this._isEnabled=!0},i.disable=function(){this._isEnabled=!1},i.toggleEnabled=function(){this._isEnabled=!this._isEnabled},i.toggle=function(t){if(this._isEnabled)if(t){var n=this.constructor.DATA_KEY,i=e(t.currentTarget).data(n);i||(i=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(e(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},i.dispose=function(){clearTimeout(this._timeout),e.removeData(this.element,this.constructor.DATA_KEY),e(this.element).off(this.constructor.EVENT_KEY),e(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&e(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},i.show=function(){var t=this;if("none"===e(this.element).css("display"))throw new Error("Please use show on visible elements");var i=e.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){e(this.element).trigger(i);var o=c.findShadowRoot(this.element),s=e.contains(null!==o?o:this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),a=c.getUID(this.constructor.NAME);r.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&e(r).addClass("fade");var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var u=this._getContainer();e(r).data(this.constructor.DATA_KEY,this),e.contains(this.element.ownerDocument.documentElement,this.tip)||e(r).appendTo(u),e(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,this._getPopperConfig(h)),e(r).addClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().on("mouseover",null,e.noop);var d=function(){t.config.animation&&t._fixTransition();var n=t._hoverState;t._hoverState=null,e(t.element).trigger(t.constructor.Event.SHOWN),"out"===n&&t._leave(null,t)};if(e(this.tip).hasClass("fade")){var f=c.getTransitionDurationFromElement(this.tip);e(this.tip).one(c.TRANSITION_END,d).emulateTransitionEnd(f)}else d()}},i.hide=function(t){var n=this,i=this.getTipElement(),o=e.Event(this.constructor.Event.HIDE),s=function(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),e(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),t&&t()};if(e(this.element).trigger(o),!o.isDefaultPrevented()){if(e(i).removeClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,e(this.tip).hasClass("fade")){var r=c.getTransitionDurationFromElement(i);e(i).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s();this._hoverState=""}},i.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},i.isWithContent=function(){return Boolean(this.getTitle())},i.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-tooltip-"+t)},i.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},i.setContent=function(){var t=this.getTipElement();this.setElementContent(e(t.querySelectorAll(".tooltip-inner")),this.getTitle()),e(t).removeClass("fade show")},i.setElementContent=function(t,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=H(n,this.config.whiteList,this.config.sanitizeFn)),t.html(n)):t.text(n):this.config.html?e(n).parent().is(t)||t.empty().append(n):t.text(e(n).text())},i.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},i._getPopperConfig=function(t){var e=this;return a(a({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),this.config.popperConfig)},i._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},i._getContainer=function(){return!1===this.config.container?document.body:c.isElement(this.config.container)?e(this.config.container):e(document).find(this.config.container)},i._getAttachment=function(t){return K[t.toUpperCase()]},i._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(n){if("click"===n)e(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==n){var i="hover"===n?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o="hover"===n?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;e(t.element).on(i,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},e(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=a(a({},this.config),{},{trigger:"manual",selector:""}):this._fixTitle()},i._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},i._enter=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e(n.getTipElement()).hasClass("show")||"show"===n._hoverState?n._hoverState="show":(clearTimeout(n._timeout),n._hoverState="show",n.config.delay&&n.config.delay.show?n._timeout=setTimeout((function(){"show"===n._hoverState&&n.show()}),n.config.delay.show):n.show())},i._leave=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState="out",n.config.delay&&n.config.delay.hide?n._timeout=setTimeout((function(){"out"===n._hoverState&&n.hide()}),n.config.delay.hide):n.hide())},i._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},i._getConfig=function(t){var n=e(this.element).data();return Object.keys(n).forEach((function(t){-1!==V.indexOf(t)&&delete n[t]})),"number"==typeof(t=a(a(a({},this.constructor.Default),n),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),c.typeCheckConfig(U,t,this.constructor.DefaultType),t.sanitize&&(t.template=H(t.template,t.whiteList,t.sanitizeFn)),t},i._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},i._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(W);null!==n&&n.length&&t.removeClass(n.join(""))},i._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},i._fixTransition=function(){var t=this.getTipElement(),n=this.config.animation;null===t.getAttribute("x-placement")&&(e(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.tooltip"),o="object"==typeof n&&n;if((i||!/dispose|hide/.test(n))&&(i||(i=new t(this,o),e(this).data("bs.tooltip",i)),"string"==typeof n)){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return X}},{key:"NAME",get:function(){return U}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Y}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return z}}]),t}();e.fn[U]=$._jQueryInterface,e.fn[U].Constructor=$,e.fn[U].noConflict=function(){return e.fn[U]=M,$._jQueryInterface};var J="popover",G=e.fn[J],Z=new RegExp("(^|\\s)bs-popover\\S+","g"),tt=a(a({},$.Default),{},{placement:"right",trigger:"click",content:"",template:''}),et=a(a({},$.DefaultType),{},{content:"(string|element|function)"}),nt={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},it=function(t){var n,i;function s(){return t.apply(this,arguments)||this}i=t,(n=s).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var r=s.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},r.setContent=function(){var t=e(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(t.find(".popover-body"),n),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(Z);null!==n&&n.length>0&&t.removeClass(n.join(""))},s._jQueryInterface=function(t){return this.each((function(){var n=e(this).data("bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new s(this,i),e(this).data("bs.popover",n)),"string"==typeof t)){if("undefined"==typeof n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},o(s,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return tt}},{key:"NAME",get:function(){return J}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return nt}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return et}}]),s}($);e.fn[J]=it._jQueryInterface,e.fn[J].Constructor=it,e.fn[J].noConflict=function(){return e.fn[J]=G,it._jQueryInterface};var ot="scrollspy",st=e.fn[ot],rt={offset:10,method:"auto",target:""},at={offset:"number",method:"string",target:"(string|element)"},lt=function(){function t(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return i._process(t)})),this.refresh(),this._process()}var n=t.prototype;return n.refresh=function(){var t=this,n=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?n:this._config.method,o="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var n,s=c.getSelectorFromElement(t);if(s&&(n=document.querySelector(s)),n){var r=n.getBoundingClientRect();if(r.width||r.height)return[e(n)[i]().top+o,s]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},n.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=a(a({},rt),"object"==typeof t&&t?t:{})).target&&c.isElement(t.target)){var n=e(t.target).attr("id");n||(n=c.getUID(ot),e(t.target).attr("id",n)),t.target="#"+n}return c.typeCheckConfig(ot,t,at),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t li > .active":".active";i=(i=e.makeArray(e(o).find(r)))[i.length-1]}var a=e.Event("hide.bs.tab",{relatedTarget:this._element}),l=e.Event("show.bs.tab",{relatedTarget:i});if(i&&e(i).trigger(a),e(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=document.querySelector(s)),this._activate(this._element,o);var h=function(){var n=e.Event("hidden.bs.tab",{relatedTarget:t._element}),o=e.Event("shown.bs.tab",{relatedTarget:i});e(i).trigger(n),e(t._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},n.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(t,n,i){var o=this,s=(!n||"UL"!==n.nodeName&&"OL"!==n.nodeName?e(n).children(".active"):e(n).find("> li > .active"))[0],r=i&&s&&e(s).hasClass("fade"),a=function(){return o._transitionComplete(t,s,i)};if(s&&r){var l=c.getTransitionDurationFromElement(s);e(s).removeClass("show").one(c.TRANSITION_END,a).emulateTransitionEnd(l)}else a()},n._transitionComplete=function(t,n,i){if(n){e(n).removeClass("active");var o=e(n.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(e(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),c.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&e(t.parentNode).hasClass("dropdown-menu")){var s=e(t).closest(".dropdown")[0];if(s){var r=[].slice.call(s.querySelectorAll(".dropdown-toggle"));e(r).addClass("active")}t.setAttribute("aria-expanded",!0)}i&&i()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.tab");if(o||(o=new t(this),i.data("bs.tab",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),ht._jQueryInterface.call(e(this),"show")})),e.fn.tab=ht._jQueryInterface,e.fn.tab.Constructor=ht,e.fn.tab.noConflict=function(){return e.fn.tab=ct,ht._jQueryInterface};var ut=e.fn.toast,dt={animation:"boolean",autohide:"boolean",delay:"number"},ft={animation:!0,autohide:!0,delay:500},gt=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var n=t.prototype;return n.show=function(){var t=this,n=e.Event("show.bs.toast");if(e(this._element).trigger(n),!n.isDefaultPrevented()){this._config.animation&&this._element.classList.add("fade");var i=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),e(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),c.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var o=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,i).emulateTransitionEnd(o)}else i()}},n.hide=function(){if(this._element.classList.contains("show")){var t=e.Event("hide.bs.toast");e(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},n.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains("show")&&this._element.classList.remove("show"),e(this._element).off("click.dismiss.bs.toast"),e.removeData(this._element,"bs.toast"),this._element=null,this._config=null},n._getConfig=function(t){return t=a(a(a({},ft),e(this._element).data()),"object"==typeof t&&t?t:{}),c.typeCheckConfig("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;e(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',(function(){return t.hide()}))},n._close=function(){var t=this,n=function(){t._element.classList.add("hide"),e(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,n).emulateTransitionEnd(i)}else n()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.toast");if(o||(o=new t(this,"object"==typeof n&&n),i.data("bs.toast",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n](this)}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"DefaultType",get:function(){return dt}},{key:"Default",get:function(){return ft}}]),t}();e.fn.toast=gt._jQueryInterface,e.fn.toast.Constructor=gt,e.fn.toast.noConflict=function(){return e.fn.toast=ut,gt._jQueryInterface},t.Alert=d,t.Button=g,t.Carousel=E,t.Collapse=D,t.Dropdown=j,t.Modal=R,t.Popover=it,t.Scrollspy=lt,t.Tab=ht,t.Toast=gt,t.Tooltip=$,t.Util=c,Object.defineProperty(t,"__esModule",{value:!0})})); /*! * jQuery Mobile Events * by Ben Major (www.ben-major.co.uk) * * Copyright 2011, Ben Major * Licensed under the MIT License: * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ (function ($) { $.attrFn = $.attrFn || {}; // navigator.userAgent.toLowerCase() isn't reliable for Chrome installs // on mobile devices. As such, we will create a boolean isChromeDesktop // The reason that we need to do this is because Chrome annoyingly // purports support for touch events even if the underlying hardware // does not! var agent = navigator.userAgent.toLowerCase(), isChromeDesktop = (agent.indexOf('chrome') > -1 && ((agent.indexOf('windows') > -1) || (agent.indexOf('macintosh') > -1) || (agent.indexOf('linux') > -1)) && agent.indexOf('mobile') < 0 && agent.indexOf('android') < 0), settings = { tap_pixel_range: 5, swipe_h_threshold: 50, swipe_v_threshold: 50, taphold_threshold: 750, doubletap_int: 500, touch_capable: ('ontouchstart' in window && !isChromeDesktop), orientation_support: ('orientation' in window && 'onorientationchange' in window), startevent: ('ontouchstart' in window && !isChromeDesktop) ? 'touchstart' : 'mousedown', endevent: ('ontouchstart' in window && !isChromeDesktop) ? 'touchend' : 'mouseup', moveevent: ('ontouchstart' in window && !isChromeDesktop) ? 'touchmove' : 'mousemove', tapevent: ('ontouchstart' in window && !isChromeDesktop) ? 'tap' : 'click', scrollevent: ('ontouchstart' in window && !isChromeDesktop) ? 'touchmove' : 'scroll', hold_timer: null, tap_timer: null }; // Convenience functions: $.isTouchCapable = function() { return settings.touch_capable; }; $.getStartEvent = function() { return settings.startevent; }; $.getEndEvent = function() { return settings.endevent; }; $.getMoveEvent = function() { return settings.moveevent; }; $.getTapEvent = function() { return settings.tapevent; }; $.getScrollEvent = function() { return settings.scrollevent; }; // Add Event shortcuts: $.each(['tapstart', 'tapend', 'tapmove', 'tap', 'tap2', 'tap3', 'tap4', 'singletap', 'doubletap', 'taphold', 'swipe', 'swipeup', 'swiperight', 'swipedown', 'swipeleft', 'swipeend', 'scrollstart', 'scrollend', 'orientationchange'], function (i, name) { $.fn[name] = function (fn) { return fn ? this.on(name, fn) : this.trigger(name); }; $.attrFn[name] = true; }); // tapstart Event: $.event.special.tapstart = { setup: function () { var thisObject = this, $this = $(thisObject); $this.on(settings.startevent, function (e) { $this.data('callee', arguments.callee); if (e.which && e.which !== 1) { return false; } var origEvent = e.originalEvent, touchData = { 'position': { 'x': ((settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX), 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.touches[0].pageX - origEvent.touches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.touches[0].pageY - origEvent.touches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; triggerCustomEvent(thisObject, 'tapstart', e, touchData); return true; }); }, remove: function () { $(this).off(settings.startevent, $(this).data.callee); } }; // tapmove Event: $.event.special.tapmove = { setup: function() { var thisObject = this, $this = $(thisObject); $this.on(settings.moveevent, function(e) { $this.data('callee', arguments.callee); var origEvent = e.originalEvent, touchData = { 'position': { 'x': ((settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX), 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.touches[0].pageX - origEvent.touches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.touches[0].pageY - origEvent.touches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; triggerCustomEvent(thisObject, 'tapmove', e, touchData); return true; }); }, remove: function() { $(this).off(settings.moveevent, $(this).data.callee); } } // tapend Event: $.event.special.tapend = { setup: function () { var thisObject = this, $this = $(thisObject); $this.on(settings.endevent, function (e) { // Touch event data: $this.data('callee', arguments.callee); var origEvent = e.originalEvent; var touchData = { 'position': { 'x': (settings.touch_capable) ? origEvent.changedTouches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.changedTouches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.changedTouches[0].pageX - origEvent.changedTouches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.changedTouches[0].pageY - origEvent.changedTouches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; triggerCustomEvent(thisObject, 'tapend', e, touchData); return true; }); }, remove: function () { $(this).off(settings.endevent, $(this).data.callee); } }; // taphold Event: $.event.special.taphold = { setup: function () { var thisObject = this, $this = $(thisObject), origTarget, timer, start_pos = { x: 0, y: 0 }, end_x = 0, end_y = 0; $this.on(settings.startevent, function (e) { if (e.which && e.which !== 1) { return false; } else { $this.data('tapheld', false); origTarget = e.target; var origEvent = e.originalEvent; var start_time = Date.now(), startPosition = { 'x': (settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY }, startOffset = { 'x': (settings.touch_capable) ? origEvent.touches[0].pageX - origEvent.touches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.touches[0].pageY - origEvent.touches[0].target.offsetTop : e.offsetY }; start_pos.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX : e.pageX; start_pos.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY : e.pageY; end_x = start_pos.x; end_y = start_pos.y; settings.hold_timer = window.setTimeout(function () { var diff_x = (start_pos.x - end_x), diff_y = (start_pos.y - end_y); if (e.target == origTarget && ((start_pos.x == end_x && start_pos.y == end_y) || (diff_x >= -(settings.tap_pixel_range) && diff_x <= settings.tap_pixel_range && diff_y >= -(settings.tap_pixel_range) && diff_y <= settings.tap_pixel_range))) { $this.data('tapheld', true); var end_time = Date.now(), endPosition = { 'x': (settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY }, endOffset = { 'x': (settings.touch_capable) ? origEvent.touches[0].pageX - origEvent.touches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.touches[0].pageY - origEvent.touches[0].target.offsetTop : e.offsetY }; duration = end_time - start_time; // Build the touch data: var touchData = { 'startTime': start_time, 'endTime': end_time, 'startPosition': startPosition, 'startOffset': startOffset, 'endPosition': endPosition, 'endOffset': endOffset, 'duration': duration, 'target': e.target } $this.data('callee1', arguments.callee); triggerCustomEvent(thisObject, 'taphold', e, touchData); } }, settings.taphold_threshold); return true; } }).on(settings.endevent, function () { $this.data('callee2', arguments.callee); $this.data('tapheld', false); window.clearTimeout(settings.hold_timer); }) .on(settings.moveevent, function (e) { $this.data('callee3', arguments.callee); end_x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX : e.pageX; end_y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY : e.pageY; }); }, remove: function () { $(this).off(settings.startevent, $(this).data.callee1).off(settings.endevent, $(this).data.callee2).off(settings.moveevent, $(this).data.callee3); } }; // doubletap Event: $.event.special.doubletap = { setup: function () { var thisObject = this, $this = $(thisObject), origTarget, action, firstTap, origEvent, cooloff, cooling = false; $this.on(settings.startevent, function (e) { if (e.which && e.which !== 1) { return false; } $this.data('doubletapped', false); origTarget = e.target; $this.data('callee1', arguments.callee); origEvent = e.originalEvent; firstTap = { 'position': { 'x': (settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.touches[0].pageX - origEvent.touches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.touches[0].pageY - origEvent.touches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; return true; }).on(settings.endevent, function (e) { var now = Date.now(); var lastTouch = $this.data('lastTouch') || now + 1; var delta = now - lastTouch; window.clearTimeout(action); $this.data('callee2', arguments.callee); if (delta < settings.doubletap_int && (e.target == origTarget) && delta > 100) { $this.data('doubletapped', true); window.clearTimeout(settings.tap_timer); // Now get the current event: var lastTap = { 'position': { 'x': (settings.touch_capable) ? e.originalEvent.changedTouches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? e.originalEvent.changedTouches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? e.originalEvent.changedTouches[0].pageX - e.originalEvent.changedTouches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? e.originalEvent.changedTouches[0].pageY - e.originalEvent.changedTouches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target } var touchData = { 'firstTap': firstTap, 'secondTap': lastTap, 'interval': lastTap.time - firstTap.time }; if (!cooling) { triggerCustomEvent(thisObject, 'doubletap', e, touchData); } cooling = true; cooloff = window.setTimeout(function (e) { cooling = false; }, settings.doubletap_int); } else { $this.data('lastTouch', now); action = window.setTimeout(function (e) { window.clearTimeout(action); }, settings.doubletap_int, [e]); } $this.data('lastTouch', now); }); }, remove: function () { $(this).off(settings.startevent, $(this).data.callee1).off(settings.endevent, $(this).data.callee2); } }; // singletap Event: // This is used in conjuction with doubletap when both events are needed on the same element $.event.special.singletap = { setup: function () { var thisObject = this, $this = $(thisObject), origTarget = null, startTime = null, start_pos = { x: 0, y: 0 }; $this.on(settings.startevent, function (e) { if (e.which && e.which !== 1) { return false; } else { startTime = Date.now(); origTarget = e.target; $this.data('callee1', arguments.callee); // Get the start x and y position: start_pos.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX : e.pageX; start_pos.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY : e.pageY; return true; } }).on(settings.endevent, function (e) { $this.data('callee2', arguments.callee); if (e.target == origTarget) { // Get the end point: end_pos_x = (e.originalEvent.changedTouches) ? e.originalEvent.changedTouches[0].pageX : e.pageX; end_pos_y = (e.originalEvent.changedTouches) ? e.originalEvent.changedTouches[0].pageY : e.pageY; // We need to check if it was a taphold: settings.tap_timer = window.setTimeout(function () { if (!$this.data('doubletapped') && !$this.data('tapheld') && (start_pos.x == end_pos_x) && (start_pos.y == end_pos_y)) { var origEvent = e.originalEvent; var touchData = { 'position': { 'x': (settings.touch_capable) ? origEvent.changedTouches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.changedTouches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.changedTouches[0].pageX - origEvent.changedTouches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.changedTouches[0].pageY - origEvent.changedTouches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; // Was it a taphold? if((touchData.time - startTime) < settings.taphold_threshold) { triggerCustomEvent(thisObject, 'singletap', e, touchData); } } }, settings.doubletap_int); } }); }, remove: function () { $(this).off(settings.startevent, $(this).data.callee1).off(settings.endevent, $(this).data.callee2); } }; // tap Event: $.event.special.tap = { setup: function () { var thisObject = this, $this = $(thisObject), started = false, origTarget = null, start_time, start_pos = { x: 0, y: 0 }, touches; $this.on(settings.startevent, function (e) { $this.data('callee1', arguments.callee); if (e.which && e.which !== 1) { return false; } else { started = true; start_pos.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX : e.pageX; start_pos.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY : e.pageY; start_time = Date.now(); origTarget = e.target; touches = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches : [ e ]; return true; } }).on(settings.endevent, function (e) { $this.data('callee2', arguments.callee); // Only trigger if they've started, and the target matches: var end_x = (e.originalEvent.targetTouches) ? e.originalEvent.changedTouches[0].pageX : e.pageX, end_y = (e.originalEvent.targetTouches) ? e.originalEvent.changedTouches[0].pageY : e.pageY, diff_x = (start_pos.x - end_x), diff_y = (start_pos.y - end_y), eventName; if (origTarget == e.target && started && ((Date.now() - start_time) < settings.taphold_threshold) && ((start_pos.x == end_x && start_pos.y == end_y) || (diff_x >= -(settings.tap_pixel_range) && diff_x <= settings.tap_pixel_range && diff_y >= -(settings.tap_pixel_range) && diff_y <= settings.tap_pixel_range))) { var origEvent = e.originalEvent; var touchData = [ ]; for( var i = 0; i < touches.length; i++) { var touch = { 'position': { 'x': (settings.touch_capable) ? origEvent.changedTouches[i].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.changedTouches[i].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.changedTouches[i].pageX - origEvent.changedTouches[i].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.changedTouches[i].pageY - origEvent.changedTouches[i].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; touchData.push( touch ); } switch( touches.length ) { case 1: eventName = 'tap'; break; case 2: eventName = 'tap2'; break; case 3: eventName = 'tap3'; break; case 4: eventName = 'tap4'; break; } triggerCustomEvent(thisObject, eventName, e, touchData); } }); }, remove: function () { $(this).off(settings.startevent, $(this).data.callee1).off(settings.endevent, $(this).data.callee2); } }; // swipe Event (also handles swipeup, swiperight, swipedown and swipeleft): $.event.special.swipe = { setup: function () { var thisObject = this, $this = $(thisObject), started = false, hasSwiped = false, originalCoord = { x: 0, y: 0 }, finalCoord = { x: 0, y: 0 }, startEvnt; // Screen touched, store the original coordinate function touchStart(e) { $this = $(e.currentTarget); $this.data('callee1', arguments.callee); originalCoord.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX : e.pageX; originalCoord.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY : e.pageY; finalCoord.x = originalCoord.x; finalCoord.y = originalCoord.y; started = true; var origEvent = e.originalEvent; // Read event data into our startEvt: startEvnt = { 'position': { 'x': (settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.touches[0].pageX - origEvent.touches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.touches[0].pageY - origEvent.touches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; } // Store coordinates as finger is swiping function touchMove(e) { $this = $(e.currentTarget); $this.data('callee2', arguments.callee); finalCoord.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX : e.pageX; finalCoord.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY : e.pageY; var swipedir; // We need to check if the element to which the event was bound contains a data-xthreshold | data-vthreshold: var ele_x_threshold = ($this.parent().data('xthreshold')) ? $this.parent().data('xthreshold') : $this.data('xthreshold'), ele_y_threshold = ($this.parent().data('ythreshold')) ? $this.parent().data('ythreshold') : $this.data('ythreshold'), h_threshold = (typeof ele_x_threshold !== 'undefined' && ele_x_threshold !== false && parseInt(ele_x_threshold)) ? parseInt(ele_x_threshold) : settings.swipe_h_threshold, v_threshold = (typeof ele_y_threshold !== 'undefined' && ele_y_threshold !== false && parseInt(ele_y_threshold)) ? parseInt(ele_y_threshold) : settings.swipe_v_threshold; if (originalCoord.y > finalCoord.y && (originalCoord.y - finalCoord.y > v_threshold)) { swipedir = 'swipeup'; } if (originalCoord.x < finalCoord.x && (finalCoord.x - originalCoord.x > h_threshold)) { swipedir = 'swiperight'; } if (originalCoord.y < finalCoord.y && (finalCoord.y - originalCoord.y > v_threshold)) { swipedir = 'swipedown'; } if (originalCoord.x > finalCoord.x && (originalCoord.x - finalCoord.x > h_threshold)) { swipedir = 'swipeleft'; } if (swipedir != undefined && started) { originalCoord.x = 0; originalCoord.y = 0; finalCoord.x = 0; finalCoord.y = 0; started = false; // Read event data into our endEvnt: var origEvent = e.originalEvent; endEvnt = { 'position': { 'x': (settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.touches[0].pageX - origEvent.touches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.touches[0].pageY - origEvent.touches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; // Calculate the swipe amount (normalized): var xAmount = Math.abs(startEvnt.position.x - endEvnt.position.x), yAmount = Math.abs(startEvnt.position.y - endEvnt.position.y); var touchData = { 'startEvnt': startEvnt, 'endEvnt': endEvnt, 'direction': swipedir.replace('swipe', ''), 'xAmount': xAmount, 'yAmount': yAmount, 'duration': endEvnt.time - startEvnt.time } hasSwiped = true; $this.trigger('swipe', touchData).trigger(swipedir, touchData); } } function touchEnd(e) { $this = $(e.currentTarget); var swipedir = ""; $this.data('callee3', arguments.callee); if (hasSwiped) { // We need to check if the element to which the event was bound contains a data-xthreshold | data-vthreshold: var ele_x_threshold = $this.data('xthreshold'), ele_y_threshold = $this.data('ythreshold'), h_threshold = (typeof ele_x_threshold !== 'undefined' && ele_x_threshold !== false && parseInt(ele_x_threshold)) ? parseInt(ele_x_threshold) : settings.swipe_h_threshold, v_threshold = (typeof ele_y_threshold !== 'undefined' && ele_y_threshold !== false && parseInt(ele_y_threshold)) ? parseInt(ele_y_threshold) : settings.swipe_v_threshold; var origEvent = e.originalEvent; endEvnt = { 'position': { 'x': (settings.touch_capable) ? origEvent.changedTouches[0].screenX : e.screenX, 'y': (settings.touch_capable) ? origEvent.changedTouches[0].screenY : e.screenY }, 'offset': { 'x': (settings.touch_capable) ? origEvent.changedTouches[0].pageX - origEvent.changedTouches[0].target.offsetLeft : e.offsetX, 'y': (settings.touch_capable) ? origEvent.changedTouches[0].pageY - origEvent.changedTouches[0].target.offsetTop : e.offsetY }, 'time': Date.now(), 'target': e.target }; // Read event data into our endEvnt: if (startEvnt.position.y > endEvnt.position.y && (startEvnt.position.y - endEvnt.position.y > v_threshold)) { swipedir = 'swipeup'; } if (startEvnt.position.x < endEvnt.position.x && (endEvnt.position.x - startEvnt.position.x > h_threshold)) { swipedir = 'swiperight'; } if (startEvnt.position.y < endEvnt.position.y && (endEvnt.position.y - startEvnt.position.y > v_threshold)) { swipedir = 'swipedown'; } if (startEvnt.position.x > endEvnt.position.x && (startEvnt.position.x - endEvnt.position.x > h_threshold)) { swipedir = 'swipeleft'; } // Calculate the swipe amount (normalized): var xAmount = Math.abs(startEvnt.position.x - endEvnt.position.x), yAmount = Math.abs(startEvnt.position.y - endEvnt.position.y); var touchData = { 'startEvnt': startEvnt, 'endEvnt': endEvnt, 'direction': swipedir.replace('swipe', ''), 'xAmount': xAmount, 'yAmount': yAmount, 'duration': endEvnt.time - startEvnt.time } $this.trigger('swipeend', touchData); } started = false; hasSwiped = false; } $this.on(settings.startevent, touchStart); $this.on(settings.moveevent, touchMove); $this.on(settings.endevent, touchEnd); }, remove: function () { $(this).off(settings.startevent, $(this).data.callee1).off(settings.moveevent, $(this).data.callee2).off(settings.endevent, $(this).data.callee3); } }; // scrollstart Event (also handles scrollend): $.event.special.scrollstart = { setup: function () { var thisObject = this, $this = $(thisObject), scrolling, timer; function trigger(event, state) { scrolling = state; triggerCustomEvent(thisObject, scrolling ? 'scrollstart' : 'scrollend', event); } // iPhone triggers scroll after a small delay; use touchmove instead $this.on(settings.scrollevent, function (event) { $this.data('callee', arguments.callee); if (!scrolling) { trigger(event, true); } clearTimeout(timer); timer = setTimeout(function () { trigger(event, false); }, 50); }); }, remove: function () { $(this).off(settings.scrollevent, $(this).data.callee); } }; // This is the orientation change (largely borrowed from jQuery Mobile): var win = $(window), special_event, get_orientation, last_orientation, initial_orientation_is_landscape, initial_orientation_is_default, portrait_map = { '0': true, '180': true }; if (settings.orientation_support) { var ww = window.innerWidth || win.width(), wh = window.innerHeight || win.height(), landscape_threshold = 50; initial_orientation_is_landscape = ww > wh && (ww - wh) > landscape_threshold; initial_orientation_is_default = portrait_map[window.orientation]; if ((initial_orientation_is_landscape && initial_orientation_is_default) || (!initial_orientation_is_landscape && !initial_orientation_is_default)) { portrait_map = { '-90': true, '90': true }; } } $.event.special.orientationchange = special_event = { setup: function () { // If the event is supported natively, return false so that jQuery // will on to the event using DOM methods. if (settings.orientation_support) { return false; } // Get the current orientation to avoid initial double-triggering. last_orientation = get_orientation(); win.on('throttledresize', handler); return true; }, teardown: function () { if (settings.orientation_support) { return false; } win.off('throttledresize', handler); return true; }, add: function (handleObj) { // Save a reference to the bound event handler. var old_handler = handleObj.handler; handleObj.handler = function (event) { event.orientation = get_orientation(); return old_handler.apply(this, arguments); }; } }; // If the event is not supported natively, this handler will be bound to // the window resize event to simulate the orientationchange event. function handler() { // Get the current orientation. var orientation = get_orientation(); if (orientation !== last_orientation) { // The orientation has changed, so trigger the orientationchange event. last_orientation = orientation; win.trigger("orientationchange"); } } $.event.special.orientationchange.orientation = get_orientation = function () { var isPortrait = true, elem = document.documentElement; if (settings.orientation_support) { isPortrait = portrait_map[window.orientation]; } else { isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1; } return isPortrait ? 'portrait' : 'landscape'; }; // throttle Handler: $.event.special.throttledresize = { setup: function () { $(this).on('resize', throttle_handler); }, teardown: function () { $(this).off('resize', throttle_handler); } }; var throttle = 250, throttle_handler = function () { curr = Date.now(); diff = curr - lastCall; if (diff >= throttle) { lastCall = curr; $(this).trigger('throttledresize'); } else { if (heldCall) { window.clearTimeout(heldCall); } // Promise a held call will still execute heldCall = window.setTimeout(handler, throttle - diff); } }, lastCall = 0, heldCall, curr, diff; // Trigger a custom event: function triggerCustomEvent(obj, eventType, event, touchData) { var originalType = event.type; event.type = eventType; $.event.dispatch.call(obj, event, touchData); event.type = originalType; } // Correctly on anything we've overloaded: $.each({ scrollend: 'scrollstart', swipeup: 'swipe', swiperight: 'swipe', swipedown: 'swipe', swipeleft: 'swipe', swipeend: 'swipe', tap2: 'tap' }, function (e, srcE, touchData) { $.event.special[e] = { setup: function () { $(this).on(srcE, $.noop); } }; }); })(jQuery); /*! lightgallery - v1.7.1 - 2020-06-13 * http://sachinchoolur.github.io/lightGallery/ * Copyright (c) 2020 Sachin N; Licensed GPLv3 */ /*! lightgallery - v1.7.1 - 2020-06-13 * 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 = { mode: 'lg-slide', // Ex : 'ease' cssEasing: 'ease', //'for jquery animation' easing: 'linear', speed: 600, height: '100%', width: '100%', addClass: '', startClass: 'lg-start-zoom', backdropDuration: 150, hideBarsDelay: 6000, useLeft: false, // aria-labelledby attribute fot gallery ariaLabelledby: '', //aria-describedby attribute for gallery ariaDescribedby: '', closable: true, loop: true, escKey: true, keyPress: true, controls: true, slideEndAnimatoin: true, hideControlOnEnd: false, mousewheel: true, getCaptionFromTitleOrAlt: true, // .lg-item || '.lg-sub-html' appendSubHtmlTo: '.lg-sub-html', subHtmlSelectorRelative: false, /** * @desc number of preload slides * will exicute only after the current slide is fully loaded. * * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th * slide will be loaded in the background after the 4th slide is fully loaded.. * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... * */ preload: 1, showAfterLoad: true, selector: '', selectWithin: '', nextHtml: '', prevHtml: '', // 0, 1 index: false, iframeMaxWidth: '100%', download: true, counter: true, appendCounterTo: '.lg-toolbar', swipeThreshold: 50, enableSwipe: true, enableDrag: true, dynamic: false, dynamicEl: [], galleryId: 1 }; function Plugin(element, options) { // Current lightGallery element this.el = element; // Current jquery element this.$el = $(element); // lightGallery settings this.s = $.extend({}, defaults, options); // When using dynamic mode, ensure dynamicEl is an array if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) { throw ('When using dynamic mode, you must also define dynamicEl as an Array.'); } // lightGallery modules this.modules = {}; // false when lightgallery complete first slide; this.lGalleryOn = false; this.lgBusy = false; // Timeout function for hiding controls; this.hideBartimeout = false; // To determine browser supports for touch events; this.isTouch = ('ontouchstart' in document.documentElement); // Disable hideControlOnEnd if sildeEndAnimation is true if (this.s.slideEndAnimatoin) { this.s.hideControlOnEnd = false; } // Gallery items if (this.s.dynamic) { this.$items = this.s.dynamicEl; } else { if (this.s.selector === 'this') { this.$items = this.$el; } else if (this.s.selector !== '') { if (this.s.selectWithin) { this.$items = $(this.s.selectWithin).find(this.s.selector); } else { this.$items = this.$el.find($(this.s.selector)); } } else { this.$items = this.$el.children(); } } // .lg-item this.$slide = ''; // .lg-outer this.$outer = ''; this.init(); return this; } Plugin.prototype.init = function () { var _this = this; // s.preload should not be more than $item.length if (_this.s.preload > _this.$items.length) { _this.s.preload = _this.$items.length; } // if dynamic option is enabled execute immediately var _hash = window.location.hash; if (_hash.indexOf('lg=' + this.s.galleryId) > 0) { _this.index = parseInt(_hash.split('&slide=')[1], 10); $('body').addClass('lg-from-hash'); if (!$('body').hasClass('lg-on')) { setTimeout(function () { _this.build(_this.index); }); $('body').addClass('lg-on'); } } if (_this.s.dynamic) { _this.$el.trigger('onBeforeOpen.lg'); _this.index = _this.s.index || 0; // prevent accidental double execution if (!$('body').hasClass('lg-on')) { setTimeout(function () { _this.build(_this.index); $('body').addClass('lg-on'); }); } } else { // Using different namespace for click because click event should not unbind if selector is same object('this') _this.$items.on('click.lgcustom', function (event) { // For IE8 try { event.preventDefault(); event.preventDefault(); } catch (er) { event.returnValue = false; } _this.$el.trigger('onBeforeOpen.lg'); _this.index = _this.s.index || _this.$items.index(this); // prevent accidental double execution if (!$('body').hasClass('lg-on')) { _this.build(_this.index); $('body').addClass('lg-on'); } }); } }; Plugin.prototype.build = function (index) { var _this = this; _this.structure(); // module constructor $.each($.fn.lightGallery.modules, function (key) { _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el); }); // initiate slide function _this.slide(index, false, false, false); if (_this.s.keyPress) { _this.keyPress(); } if (_this.$items.length > 1) { _this.arrow(); setTimeout(function () { _this.enableDrag(); _this.enableSwipe(); }, 50); if (_this.s.mousewheel) { _this.mousewheel(); } } else { _this.$slide.on('click.lg', function () { _this.$el.trigger('onSlideClick.lg'); }); } _this.counter(); _this.closeGallery(); _this.$el.trigger('onAfterOpen.lg'); // Hide controllers if mouse doesn't move for some period _this.$outer.on('mousemove.lg click.lg touchstart.lg', function () { _this.$outer.removeClass('lg-hide-items'); clearTimeout(_this.hideBartimeout); // Timeout will be cleared on each slide movement also _this.hideBartimeout = setTimeout(function () { _this.$outer.addClass('lg-hide-items'); }, _this.s.hideBarsDelay); }); _this.$outer.trigger('mousemove.lg'); }; Plugin.prototype.structure = function () { var list = ''; var controls = ''; var i = 0; var subHtmlCont = ''; var template; var _this = this; $('body').append('
'); $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms'); // Create gallery items for (i = 0; i < this.$items.length; i++) { list += '
'; } // Create controlls if (this.s.controls && this.$items.length > 1) { controls = '
' + '' + '' + '
'; } if (this.s.appendSubHtmlTo === '.lg-sub-html') { subHtmlCont = '
'; } var ariaLabelledby = this.s.ariaLabelledby ? 'aria-labelledby="' + this.s.ariaLabelledby + '"' : ''; var ariaDescribedby = this.s.ariaDescribedby ? 'aria-describedby="' + this.s.ariaDescribedby + '"' : ''; template = ''; $('body').append(template); this.$outer = $('.lg-outer'); this.$outer.focus(); this.$slide = this.$outer.find('.lg-item'); if (this.s.useLeft) { this.$outer.addClass('lg-use-left'); // Set mode lg-slide if use left is true; this.s.mode = 'lg-slide'; } else { this.$outer.addClass('lg-use-css3'); } // For fixed height gallery _this.setTop(); $(window).on('resize.lg orientationchange.lg', function () { setTimeout(function () { _this.setTop(); }, 100); }); // add class lg-current to remove initial transition this.$slide.eq(this.index).addClass('lg-current'); // add Class for css support and transition mode if (this.doCss()) { this.$outer.addClass('lg-css3'); } else { this.$outer.addClass('lg-css'); // Set speed 0 because no animation will happen if browser doesn't support css3 this.s.speed = 0; } this.$outer.addClass(this.s.mode); if (this.s.enableDrag && this.$items.length > 1) { this.$outer.addClass('lg-grab'); } if (this.s.showAfterLoad) { this.$outer.addClass('lg-show-after-load'); } if (this.doCss()) { var $inner = this.$outer.find('.lg-inner'); $inner.css('transition-timing-function', this.s.cssEasing); $inner.css('transition-duration', this.s.speed + 'ms'); } setTimeout(function () { $('.lg-backdrop').addClass('in'); }); setTimeout(function () { _this.$outer.addClass('lg-visible'); }, this.s.backdropDuration); if (this.s.download) { this.$outer.find('.lg-toolbar').append(''); } // Store the current scroll top value to scroll back after closing the gallery.. this.prevScrollTop = $(window).scrollTop(); }; // For fixed height gallery Plugin.prototype.setTop = function () { if (this.s.height !== '100%') { var wH = $(window).height(); var top = (wH - parseInt(this.s.height, 10)) / 2; var $lGallery = this.$outer.find('.lg'); if (wH >= parseInt(this.s.height, 10)) { $lGallery.css('top', top + 'px'); } else { $lGallery.css('top', '0px'); } } }; // Find css3 support Plugin.prototype.doCss = function () { // check for css animation support var support = function () { var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; var root = document.documentElement; var i = 0; for (i = 0; i < transition.length; i++) { if (transition[i] in root.style) { return true; } } }; if (support()) { return true; } return false; }; /** * @desc Check the given src is video * @param {String} src * @return {Object} video type * Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } */ Plugin.prototype.isVideo = function (src, index) { var html; if (this.s.dynamic) { html = this.s.dynamicEl[index].html; } else { html = this.$items.eq(index).attr('data-html'); } if (!src) { if (html) { return { html5: true }; } else { console.error('lightGallery :- data-src is not provided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html'); return false; } } var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i); var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i); if (youtube) { return { youtube: youtube }; } else if (vimeo) { return { vimeo: vimeo }; } else if (dailymotion) { return { dailymotion: dailymotion }; } else if (vk) { return { vk: vk }; } }; /** * @desc Create image counter * Ex: 1/10 */ Plugin.prototype.counter = function () { if (this.s.counter) { $(this.s.appendCounterTo).append('
' + (parseInt(this.index, 10) + 1) + ' / ' + this.$items.length + '
'); } }; /** * @desc add sub-html into the slide * @param {Number} index - index of the slide */ Plugin.prototype.addHtml = function (index) { var subHtml = null; var subHtmlUrl; var $currentEle; if (this.s.dynamic) { if (this.s.dynamicEl[index].subHtmlUrl) { subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl; } else { subHtml = this.s.dynamicEl[index].subHtml; } } else { $currentEle = this.$items.eq(index); if ($currentEle.attr('data-sub-html-url')) { subHtmlUrl = $currentEle.attr('data-sub-html-url'); } else { subHtml = $currentEle.attr('data-sub-html'); if (this.s.getCaptionFromTitleOrAlt && !subHtml) { subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt'); } } } if (!subHtmlUrl) { if (typeof subHtml !== 'undefined' && subHtml !== null) { // get first letter of subhtml // if first letter starts with . or # get the html form the jQuery object var fL = subHtml.substring(0, 1); if (fL === '.' || fL === '#') { if (this.s.subHtmlSelectorRelative && !this.s.dynamic) { subHtml = $currentEle.find(subHtml).html(); } else { subHtml = $(subHtml).html(); } } } else { subHtml = ''; } } if (this.s.appendSubHtmlTo === '.lg-sub-html') { if (subHtmlUrl) { this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl); } else { this.$outer.find(this.s.appendSubHtmlTo).html(subHtml); } } else { if (subHtmlUrl) { this.$slide.eq(index).load(subHtmlUrl); } else { this.$slide.eq(index).append(subHtml); } } // Add lg-empty-html class if title doesn't exist if (typeof subHtml !== 'undefined' && subHtml !== null) { if (subHtml === '') { this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html'); } else { this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html'); } } this.$el.trigger('onAfterAppendSubHtml.lg', [index]); }; /** * @desc Preload slides * @param {Number} index - index of the slide */ Plugin.prototype.preload = function (index) { var i = 1; var j = 1; for (i = 1; i <= this.s.preload; i++) { if (i >= this.$items.length - index) { break; } this.loadContent(index + i, false, 0); } for (j = 1; j <= this.s.preload; j++) { if (index - j < 0) { break; } this.loadContent(index - j, false, 0); } }; /** * @desc Load slide content into slide. * @param {Number} index - index of the slide. * @param {Boolean} rec - if true call loadcontent() function again. * @param {Boolean} delay - delay for adding complete class. it is 0 except first time. */ Plugin.prototype.loadContent = function (index, rec, delay) { var _this = this; var _hasPoster = false; var _$img; var _src; var _poster; var _srcset; var _sizes; var _html; var _alt; var getResponsiveSrc = function (srcItms) { var rsWidth = []; var rsSrc = []; for (var i = 0; i < srcItms.length; i++) { var __src = srcItms[i].split(' '); // Manage empty space if (__src[0] === '') { __src.splice(0, 1); } rsSrc.push(__src[0]); rsWidth.push(__src[1]); } var wWidth = $(window).width(); for (var j = 0; j < rsWidth.length; j++) { if (parseInt(rsWidth[j], 10) > wWidth) { _src = rsSrc[j]; break; } } }; if (_this.s.dynamic) { if (_this.s.dynamicEl[index].poster) { _hasPoster = true; _poster = _this.s.dynamicEl[index].poster; } _html = _this.s.dynamicEl[index].html; _src = _this.s.dynamicEl[index].src; _alt = _this.s.dynamicEl[index].alt; if (_this.s.dynamicEl[index].responsive) { var srcDyItms = _this.s.dynamicEl[index].responsive.split(','); getResponsiveSrc(srcDyItms); } _srcset = _this.s.dynamicEl[index].srcset; _sizes = _this.s.dynamicEl[index].sizes; } else { var $currentEle = _this.$items.eq(index); if ($currentEle.attr('data-poster')) { _hasPoster = true; _poster = $currentEle.attr('data-poster'); } _html = $currentEle.attr('data-html'); _src = $currentEle.attr('href') || $currentEle.attr('data-src'); _alt = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt'); if ($currentEle.attr('data-responsive')) { var srcItms = $currentEle.attr('data-responsive').split(','); getResponsiveSrc(srcItms); } _srcset = $currentEle.attr('data-srcset'); _sizes = $currentEle.attr('data-sizes'); } //if (_src || _srcset || _sizes || _poster) { var iframe = false; if (_this.s.dynamic) { if (_this.s.dynamicEl[index].iframe) { iframe = true; } } else { if (_this.$items.eq(index).attr('data-iframe') === 'true') { iframe = true; } } var _isVideo = _this.isVideo(_src, index); if (!_this.$slide.eq(index).hasClass('lg-loaded')) { if (iframe) { _this.$slide.eq(index).prepend('
'); } else if (_hasPoster) { var videoClass = ''; if (_isVideo && _isVideo.youtube) { videoClass = 'lg-has-youtube'; } else if (_isVideo && _isVideo.vimeo) { videoClass = 'lg-has-vimeo'; } else { videoClass = 'lg-has-html5'; } _this.$slide.eq(index).prepend('
'); } else if (_isVideo) { _this.$slide.eq(index).prepend('
'); _this.$el.trigger('hasVideo.lg', [index, _src, _html]); } else { _alt = _alt ? 'alt="' + _alt + '"' : ''; _this.$slide.eq(index).prepend('
'); } _this.$el.trigger('onAferAppendSlide.lg', [index]); _$img = _this.$slide.eq(index).find('.lg-object'); if (_sizes) { _$img.attr('sizes', _sizes); } if (_srcset) { _$img.attr('srcset', _srcset); try { picturefill({ elements: [_$img[0]] }); } catch (e) { console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.'); } } if (this.s.appendSubHtmlTo !== '.lg-sub-html') { _this.addHtml(index); } _this.$slide.eq(index).addClass('lg-loaded'); } _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function () { // For first time add some delay for displaying the start animation. var _speed = 0; // Do not change the delay value because it is required for zoom plugin. // If gallery opened from direct url (hash) speed value should be 0 if (delay && !$('body').hasClass('lg-from-hash')) { _speed = delay; } setTimeout(function () { _this.$slide.eq(index).addClass('lg-complete'); _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]); }, _speed); }); // @todo check load state for html5 videos if (_isVideo && _isVideo.html5 && !_hasPoster) { _this.$slide.eq(index).addClass('lg-complete'); } if (rec === true) { if (!_this.$slide.eq(index).hasClass('lg-complete')) { _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function () { _this.preload(index); }); } else { _this.preload(index); } } //} }; /** * @desc slide function for lightgallery ** Slide() gets call on start ** ** Set lg.on true once slide() function gets called. ** Call loadContent() on slide() function inside setTimeout ** ** On first slide we do not want any animation like slide of fade ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately ** ** Else loadContent() should wait for the transition to complete. ** ** So set timeout s.speed + 50 <=> ** loadContent() will load slide content in to the particular slide ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function. ** ** preload will execute only when the previous slide is fully loaded (images iframe) ** ** avoid simultaneous image load <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value ** loadContent() <====> Preload(); * @param {Number} index - index of the slide * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag * @param {Boolean} fromThumb - true if slide function called via thumbnail click * @param {String} direction - Direction of the slide(next/prev) */ Plugin.prototype.slide = function (index, fromTouch, fromThumb, direction) { var _prevIndex = this.$outer.find('.lg-current').index(); var _this = this; // Prevent if multiple call // Required for hsh plugin if (_this.lGalleryOn && (_prevIndex === index)) { return; } var _length = this.$slide.length; var _time = _this.lGalleryOn ? this.s.speed : 0; if (!_this.lgBusy) { if (this.s.download) { var _src; if (_this.s.dynamic) { _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src); } else { _src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src')); } if (_src) { $('#lg-download').attr('href', _src); _this.$outer.removeClass('lg-hide-download'); } else { _this.$outer.addClass('lg-hide-download'); } } this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); _this.lgBusy = true; clearTimeout(_this.hideBartimeout); // Add title if this.s.appendSubHtmlTo === lg-sub-html if (this.s.appendSubHtmlTo === '.lg-sub-html') { // wait for slide animation to complete setTimeout(function () { _this.addHtml(index); }, _time); } this.arrowDisable(index); if (!direction) { if (index < _prevIndex) { direction = 'prev'; } else if (index > _prevIndex) { direction = 'next'; } } if (!fromTouch) { // remove all transitions _this.$outer.addClass('lg-no-trans'); this.$slide.removeClass('lg-prev-slide lg-next-slide'); if (direction === 'prev') { //prevslide this.$slide.eq(index).addClass('lg-prev-slide'); this.$slide.eq(_prevIndex).addClass('lg-next-slide'); } else { // next slide this.$slide.eq(index).addClass('lg-next-slide'); this.$slide.eq(_prevIndex).addClass('lg-prev-slide'); } // give 50 ms for browser to add/remove class setTimeout(function () { _this.$slide.removeClass('lg-current'); //_this.$slide.eq(_prevIndex).removeClass('lg-current'); _this.$slide.eq(index).addClass('lg-current'); // reset all transitions _this.$outer.removeClass('lg-no-trans'); }, 50); } else { this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); var touchPrev; var touchNext; if (_length > 2) { touchPrev = index - 1; touchNext = index + 1; if ((index === 0) && (_prevIndex === _length - 1)) { // next slide touchNext = 0; touchPrev = _length - 1; } else if ((index === _length - 1) && (_prevIndex === 0)) { // prev slide touchNext = 0; touchPrev = _length - 1; } } else { touchPrev = 0; touchNext = 1; } if (direction === 'prev') { _this.$slide.eq(touchNext).addClass('lg-next-slide'); } else { _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); } _this.$slide.eq(index).addClass('lg-current'); } if (_this.lGalleryOn) { setTimeout(function () { _this.loadContent(index, true, 0); }, this.s.speed + 50); setTimeout(function () { _this.lgBusy = false; _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); }, this.s.speed); } else { _this.loadContent(index, true, _this.s.backdropDuration); _this.lgBusy = false; _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); } _this.lGalleryOn = true; if (this.s.counter) { $('#lg-counter-current').text(index + 1); } } _this.index = index; }; /** * @desc Go to next slide * @param {Boolean} fromTouch - true if slide function called via touch event */ Plugin.prototype.goToNextSlide = function (fromTouch) { var _this = this; var _loop = _this.s.loop; if (fromTouch && _this.$slide.length < 3) { _loop = false; } if (!_this.lgBusy) { if ((_this.index + 1) < _this.$slide.length) { _this.index++; _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); _this.slide(_this.index, fromTouch, false, 'next'); } else { if (_loop) { _this.index = 0; _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); _this.slide(_this.index, fromTouch, false, 'next'); } else if (_this.s.slideEndAnimatoin && !fromTouch) { _this.$outer.addClass('lg-right-end'); setTimeout(function () { _this.$outer.removeClass('lg-right-end'); }, 400); } } } }; /** * @desc Go to previous slide * @param {Boolean} fromTouch - true if slide function called via touch event */ Plugin.prototype.goToPrevSlide = function (fromTouch) { var _this = this; var _loop = _this.s.loop; if (fromTouch && _this.$slide.length < 3) { _loop = false; } if (!_this.lgBusy) { if (_this.index > 0) { _this.index--; _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); _this.slide(_this.index, fromTouch, false, 'prev'); } else { if (_loop) { _this.index = _this.$items.length - 1; _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); _this.slide(_this.index, fromTouch, false, 'prev'); } else if (_this.s.slideEndAnimatoin && !fromTouch) { _this.$outer.addClass('lg-left-end'); setTimeout(function () { _this.$outer.removeClass('lg-left-end'); }, 400); } } } }; Plugin.prototype.keyPress = function () { var _this = this; if (this.$items.length > 1) { $(window).on('keyup.lg', function (e) { if (_this.$items.length > 1) { if (e.keyCode === 37) { e.preventDefault(); _this.goToPrevSlide(); } if (e.keyCode === 39) { e.preventDefault(); _this.goToNextSlide(); } } }); } $(window).on('keydown.lg', function (e) { if (_this.s.escKey === true && e.keyCode === 27) { e.preventDefault(); if (!_this.$outer.hasClass('lg-thumb-open')) { _this.destroy(); } else { _this.$outer.removeClass('lg-thumb-open'); } } }); }; Plugin.prototype.arrow = function () { var _this = this; this.$outer.find('.lg-prev').on('click.lg', function () { _this.goToPrevSlide(); }); this.$outer.find('.lg-next').on('click.lg', function () { _this.goToNextSlide(); }); }; Plugin.prototype.arrowDisable = function (index) { // Disable arrows if s.hideControlOnEnd is true if (!this.s.loop && this.s.hideControlOnEnd) { if ((index + 1) < this.$slide.length) { this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled'); } else { this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled'); } if (index > 0) { this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled'); } else { this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled'); } } }; Plugin.prototype.setTranslate = function ($el, xValue, yValue) { // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 if (this.s.useLeft) { $el.css('left', xValue); } else { $el.css({ transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' }); } }; Plugin.prototype.touchMove = function (startCoords, endCoords) { var distance = endCoords - startCoords; if (Math.abs(distance) > 15) { // reset opacity and transition duration this.$outer.addClass('lg-dragging'); // move current slide this.setTranslate(this.$slide.eq(this.index), distance, 0); // move next and prev slide with current slide this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0); this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0); } }; Plugin.prototype.touchEnd = function (distance) { var _this = this; // keep slide animation for any mode while dragg/swipe if (_this.s.mode !== 'lg-slide') { _this.$outer.addClass('lg-slide'); } this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0'); // set transition duration setTimeout(function () { _this.$outer.removeClass('lg-dragging'); if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { _this.goToNextSlide(true); } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { _this.goToPrevSlide(true); } else if (Math.abs(distance) < 5) { // Trigger click if distance is less than 5 pix _this.$el.trigger('onSlideClick.lg'); } _this.$slide.removeAttr('style'); }); // remove slide class once drag/swipe is completed if mode is not slide setTimeout(function () { if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') { _this.$outer.removeClass('lg-slide'); } }, _this.s.speed + 100); }; Plugin.prototype.enableSwipe = function () { var _this = this; var startCoords = 0; var endCoords = 0; var isMoved = false; if (_this.s.enableSwipe && _this.doCss()) { _this.$slide.on('touchstart.lg', function (e) { if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { e.preventDefault(); _this.manageSwipeClass(); startCoords = e.originalEvent.targetTouches[0].pageX; } }); _this.$slide.on('touchmove.lg', function (e) { if (!_this.$outer.hasClass('lg-zoomed')) { e.preventDefault(); endCoords = e.originalEvent.targetTouches[0].pageX; _this.touchMove(startCoords, endCoords); isMoved = true; } }); _this.$slide.on('touchend.lg', function () { if (!_this.$outer.hasClass('lg-zoomed')) { if (isMoved) { isMoved = false; _this.touchEnd(endCoords - startCoords); } else { _this.$el.trigger('onSlideClick.lg'); } } }); } }; Plugin.prototype.enableDrag = function () { var _this = this; var startCoords = 0; var endCoords = 0; var isDraging = false; var isMoved = false; if (_this.s.enableDrag && _this.doCss()) { _this.$slide.on('mousedown.lg', function (e) { if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy && !$(e.target).text().trim()) { e.preventDefault(); _this.manageSwipeClass(); startCoords = e.pageX; isDraging = true; // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 _this.$outer.scrollLeft += 1; _this.$outer.scrollLeft -= 1; // * _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); _this.$el.trigger('onDragstart.lg'); } }); $(window).on('mousemove.lg', function (e) { if (isDraging) { isMoved = true; endCoords = e.pageX; _this.touchMove(startCoords, endCoords); _this.$el.trigger('onDragmove.lg'); } }); $(window).on('mouseup.lg', function (e) { if (isMoved) { isMoved = false; _this.touchEnd(endCoords - startCoords); _this.$el.trigger('onDragend.lg'); } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { _this.$el.trigger('onSlideClick.lg'); } // Prevent execution on click if (isDraging) { isDraging = false; _this.$outer.removeClass('lg-grabbing').addClass('lg-grab'); } }); } }; Plugin.prototype.manageSwipeClass = function () { var _touchNext = this.index + 1; var _touchPrev = this.index - 1; if (this.s.loop && this.$slide.length > 2) { if (this.index === 0) { _touchPrev = this.$slide.length - 1; } else if (this.index === this.$slide.length - 1) { _touchNext = 0; } } this.$slide.removeClass('lg-next-slide lg-prev-slide'); if (_touchPrev > -1) { this.$slide.eq(_touchPrev).addClass('lg-prev-slide'); } this.$slide.eq(_touchNext).addClass('lg-next-slide'); }; Plugin.prototype.mousewheel = function () { var _this = this; _this.$outer.on('mousewheel.lg', function (e) { if (!e.deltaY) { return; } if (e.deltaY > 0) { _this.goToPrevSlide(); } else { _this.goToNextSlide(); } e.preventDefault(); }); }; Plugin.prototype.closeGallery = function () { var _this = this; var mousedown = false; this.$outer.find('.lg-close').on('click.lg', function () { _this.destroy(); }); if (_this.s.closable) { // If you drag the slide and release outside gallery gets close on chrome // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer _this.$outer.on('mousedown.lg', function (e) { if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) { mousedown = true; } else { mousedown = false; } }); _this.$outer.on('mousemove.lg', function () { mousedown = false; }); _this.$outer.on('mouseup.lg', function (e) { if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) { if (!_this.$outer.hasClass('lg-dragging')) { _this.destroy(); } } }); } }; Plugin.prototype.destroy = function (d) { var _this = this; if (!d) { _this.$el.trigger('onBeforeClose.lg'); $(window).scrollTop(_this.prevScrollTop); } /** * if d is false or undefined destroy will only close the gallery * plugins instance remains with the element * * if d is true destroy will completely remove the plugin */ if (d) { if (!_this.s.dynamic) { // only when not using dynamic mode is $items a jquery collection this.$items.off('click.lg click.lgcustom'); } $.removeData(_this.el, 'lightGallery'); } // Unbind all events added by lightGallery this.$el.off('.lg.tm'); // destroy all lightGallery modules $.each($.fn.lightGallery.modules, function (key) { if (_this.modules[key]) { _this.modules[key].destroy(); } }); this.lGalleryOn = false; clearTimeout(_this.hideBartimeout); this.hideBartimeout = false; $(window).off('.lg'); $('body').removeClass('lg-on lg-from-hash'); if (_this.$outer) { _this.$outer.removeClass('lg-visible'); } $('.lg-backdrop').removeClass('in'); setTimeout(function () { if (_this.$outer) { _this.$outer.remove(); } $('.lg-backdrop').remove(); if (!d) { _this.$el.trigger('onCloseAfter.lg'); } _this.$el.focus(); }, _this.s.backdropDuration + 50); }; $.fn.lightGallery = function (options) { return this.each(function () { if (!$.data(this, 'lightGallery')) { $.data(this, 'lightGallery', new Plugin(this, options)); } else { try { $(this).data('lightGallery').init(); } catch (err) { console.error('lightGallery has not initiated properly'); } } }); }; $.fn.lightGallery.modules = {}; })(); })); /*! lg-autoplay - v1.2.1 - 2020-06-13 * 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('
'); } // 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 = ''; // 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; })(); })); /*! lg-fullscreen - v1.2.1 - 2020-06-13 * 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 = ''; 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; })(); })); /*! lg-pager - v1.0.2 - 2017-01-22 * http://sachinchoolur.github.io/lightGallery * Copyright (c) 2017 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 exports === 'object') { // 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(jQuery); } }(this, function ($) { (function () { 'use strict'; var defaults = { pager: false }; var Pager = function (element) { this.core = $(element).data('lightGallery'); this.$el = $(element); this.core.s = $.extend({}, defaults, this.core.s); if (this.core.s.pager && this.core.$items.length > 1) { this.init(); } return this; }; Pager.prototype.init = function () { var _this = this; var pagerList = ''; var $pagerCont; var $pagerOuter; var timeout; _this.core.$outer.find('.lg').append('
'); if (_this.core.s.dynamic) { for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { pagerList += '
'; } } else { _this.core.$items.each(function () { if (!_this.core.s.exThumbImage) { pagerList += '
'; } else { pagerList += '
'; } }); } $pagerOuter = _this.core.$outer.find('.lg-pager-outer'); $pagerOuter.html(pagerList); $pagerCont = _this.core.$outer.find('.lg-pager-cont'); $pagerCont.on('click.lg touchend.lg', function () { var _$this = $(this); _this.core.index = _$this.index(); _this.core.slide(_this.core.index, false, true, false); }); $pagerOuter.on('mouseover.lg', function () { clearTimeout(timeout); $pagerOuter.addClass('lg-pager-hover'); }); $pagerOuter.on('mouseout.lg', function () { timeout = setTimeout(function () { $pagerOuter.removeClass('lg-pager-hover'); }); }); _this.core.$el.on('onBeforeSlide.lg.tm', function (e, prevIndex, index) { $pagerCont.removeClass('lg-pager-active'); $pagerCont.eq(index).addClass('lg-pager-active'); }); }; Pager.prototype.destroy = function () { }; $.fn.lightGallery.modules.pager = Pager; })(); })); /*! lg-thumbnail - v1.2.1 - 2020-06-13 * 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 = '
' + '
' + '
' + '
'; 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 += '
'; 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(''); _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; })(); })); /*! 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 = ''; } else if (isVideo.vimeo) { a = '?autoplay=' + autoplay + '&api=1'; if (this.core.s.vimeoPlayerParams) { a = a + '&' + $.param(this.core.s.vimeoPlayerParams); } video = ''; } else if (isVideo.dailymotion) { a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage'; if (this.core.s.dailymotionPlayerParams) { a = a + '&' + $.param(this.core.s.dailymotionPlayerParams); } video = ''; } 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 = ''; } 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; })(); })); /*! lg-zoom - v1.2.1 - 2020-06-13 * 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 = ''; if (_this.core.s.actualSize) { zoomIcons += ''; } 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; })(); })); /*! lg-hash - v1.0.4 - 2017-12-20 * http://sachinchoolur.github.io/lightGallery * Copyright (c) 2017 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 exports === 'object') { // 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(jQuery); } }(this, function ($) { (function () { 'use strict'; var defaults = { hash: true }; var Hash = function (element) { this.core = $(element).data('lightGallery'); this.core.s = $.extend({}, defaults, this.core.s); if (this.core.s.hash) { this.oldHash = window.location.hash; this.init(); } return this; }; Hash.prototype.init = function () { var _this = this; var _hash; // Change hash value on after each slide transition _this.core.$el.on('onAfterSlide.lg.tm', function (event, prevIndex, index) { if (history.replaceState) { history.replaceState(null, null, window.location.pathname + window.location.search + '#lg=' + _this.core.s.galleryId + '&slide=' + index); } else { window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index; } }); // Listen hash change and change the slide according to slide value $(window).on('hashchange.lg.hash', function () { _hash = window.location.hash; var _idx = parseInt(_hash.split('&slide=')[1], 10); // it galleryId doesn't exist in the url close the gallery if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) { _this.core.slide(_idx, false, false); } else if (_this.core.lGalleryOn) { _this.core.destroy(); } }); }; Hash.prototype.destroy = function () { if (!this.core.s.hash) { return; } // Reset to old hash value if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) { if (history.replaceState) { history.replaceState(null, null, this.oldHash); } else { window.location.hash = this.oldHash; } } else { if (history.replaceState) { history.replaceState(null, document.title, window.location.pathname + window.location.search); } else { window.location.hash = ''; } } this.core.$el.off('.lg.hash'); }; $.fn.lightGallery.modules.hash = Hash; })(); })); /*! lg-share - v1.2.1 - 2020-06-13 * 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 = { share: true, facebook: true, facebookDropdownText: 'Facebook', twitter: true, twitterDropdownText: 'Twitter', googlePlus: true, googlePlusDropdownText: 'GooglePlus', pinterest: true, pinterestDropdownText: 'Pinterest' }; var Share = function (element) { this.core = $(element).data('lightGallery'); this.core.s = $.extend({}, defaults, this.core.s); if (this.core.s.share) { this.init(); } return this; }; Share.prototype.init = function () { var _this = this; var shareHtml = ''; this.core.$outer.find('.lg-toolbar').append(shareHtml); this.core.$outer.find('.lg').append('
'); $('#lg-share').on('click.lg', function () { _this.core.$outer.toggleClass('lg-dropdown-active'); var ariaExpanded = $('#lg-share').attr('aria-expanded'); $('#lg-share').attr('aria-expanded', ariaExpanded === 'true' ? false : true); }); $('#lg-dropdown-overlay').on('click.lg', function () { _this.core.$outer.removeClass('lg-dropdown-active'); $('#lg-share').attr('aria-expanded', false); }); _this.core.$el.on('onAfterSlide.lg.tm', function (event, prevIndex, index) { setTimeout(function () { $('#lg-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(_this.getSahreProps(index, 'facebookShareUrl') || window.location.href))); $('#lg-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=' + _this.getSahreProps(index, 'tweetText') + '&url=' + (encodeURIComponent(_this.getSahreProps(index, 'twitterShareUrl') || window.location.href))); $('#lg-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(_this.getSahreProps(index, 'googleplusShareUrl') || window.location.href))); $('#lg-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(_this.getSahreProps(index, 'pinterestShareUrl') || window.location.href)) + '&media=' + encodeURIComponent(_this.getSahreProps(index, 'src')) + '&description=' + _this.getSahreProps(index, 'pinterestText')); }, 100); }); }; Share.prototype.getSahreProps = function (index, prop) { var shareProp = ''; if (this.core.s.dynamic) { shareProp = this.core.s.dynamicEl[index][prop]; } else { var _href = this.core.$items.eq(index).attr('href'); var _prop = this.core.$items.eq(index).data(prop); shareProp = prop === 'src' ? _href || _prop : _prop; } return shareProp; }; Share.prototype.destroy = function () { }; $.fn.lightGallery.modules.share = Share; })(); })); /*dmentalsoft*/ //const { array } = require("prop-types"); const soundEffect = new Audio(); var online = 1; //var propath = "http://t5.monmariola.com/img/p/"; var propath = "/t5/img/p/"; var prosuf = "-small_default.jpg"; //var fampath = "http://t5.monmariola.com/img/c/"; var fampath = "/t5/img/c/"; var famsuf = "-small_default.jpg"; var propagination = 1; var procurrent = 0; var contadortotal = 0; var contadorposicion = 0; var iszoom = 0; function uuidv4() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } function uuidv4_date() { thisdt = new Date(); kdt = (thisdt.getFullYear().toString().substring(2, 4) + "" + (((thisdt.getMonth() + 1) < 10) ? "0" : "") + (thisdt.getMonth() + 1) + "" + ((thisdt.getDate() < 10) ? "0" : "") + thisdt.getDate() + "" + ((thisdt.getHours() < 10) ? "0" : "") + thisdt.getHours() + "-" + ((thisdt.getMinutes() < 10) ? "0" : "") + thisdt.getMinutes() + "" + ((thisdt.getSeconds() < 10) ? "0" : "") + thisdt.getSeconds()); return (kdt + '-4xxx-yxxx-xxxxxxxxxxxx').replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } var drawpedidostimer = null; function isEmpty(val) { return (val === undefined || val == null || val.length <= 0) ? true : false; } // For todays date; Date.prototype.today = function () { return ((this.getDate() < 10) ? "0" : "") + this.getDate() + "/" + (((this.getMonth() + 1) < 10) ? "0" : "") + (this.getMonth() + 1) + "/" + this.getFullYear(); } // For the time now Date.prototype.timeNow = function () { return ((this.getHours() < 10) ? "0" : "") + this.getHours() + ":" + ((this.getMinutes() < 10) ? "0" : "") + this.getMinutes() + ":" + ((this.getSeconds() < 10) ? "0" : "") + this.getSeconds(); } // For todays date; Date.prototype.compressdt = function () { return (this.getFullYear() + "" + (((this.getMonth() + 1) < 10) ? "0" : "") + (this.getMonth() + 1) + "" + ((this.getDate() < 10) ? "0" : "") + this.getDate() + "" + ((this.getHours() < 10) ? "0" : "") + this.getHours() + "" + ((this.getMinutes() < 10) ? "0" : "") + this.getMinutes() + "" + ((this.getSeconds() < 10) ? "0" : "") + this.getSeconds()); } $(".buscador").hover( function () { $("#navbarlogo").hide(); }, function () { setTimeout(function () { $("#navbarlogo").show(); }, 500); } ); //alert(($( ".kcol" ).width()-545)/2); //$(".imgprocol").css("margin-left","96px"); var aproduct = null; var afam = null; var alb = null; var adr = null; var pref = null; var cli = null; var cartera = null; var sts = null; var tventas = null; var ashowproducts = null; var relacionadosh = 0; var relacionadosch = 0; var relacionadoscw = 0; var kanchopro = 0; var cuantoscorazones = 0; var localpedido = {}; var localcli = -1; var localag = -1; function loadImagePro(kthis, idpro) { if (kthis.attr("src") != kthis.attr("data-src")) { kthis.attr("src", kthis.attr("data-src")); xxx(); } } function moveproduct(k) { if (iszoom) { return; } if ($('#pro').is(':hidden')) { } else { $('#pro').css("opacity","0"); //$("#blanco").show(); tmpprocurrent = procurrent + k; if (tmpprocurrent < 0 || tmpprocurrent > contadortotal) { return; } procurrent = procurrent + k; if (procurrent * propagination < ashowproducts.length) { fin = procurrent * propagination; init = fin - propagination; drawproductsarray(init, fin); } } } function xxx() { console.log("xxx"); if (window.innerHeight > window.innerWidth) { //alert("Please use Landscape!"); Ordenar_Relacionados_Vertical(); } else { Ordenar_Relacionados_Horizontal(); } //$("#blanco").hide(); } var kaltoactual = "100%"; function Ordenar_Relacionados_Vertical() { /* anchocol = $(".kcol").width(); kanchopro = anchocol; ancho = $(".imgprocol").width() + $(".txtprocol").outerWidth() + parseInt($(".txtprocol").css('marginLeft')); $(".imgprocol").css('margin-left', parseInt((anchocol - ancho) / 2)) */ $(".productInfoTagContainer").css("left",$(".proright").width()-$(".productInfoTagContainer").width()-5); alto = $(".menufooter").offset().top - $("#separatorfixed").outerHeight() - 2 alto = parseInt(alto); alto = parseInt(alto * 0.38); kaltoactual = alto + "px"; $(".imgplist").css('max-height', alto); $(".relacionados").css('height', 0); relacionadosh = parseInt($(".menufooter").offset().top - ($("#pro").offset().top + $("#pro").outerHeight())); $(".relacionados").css('height', relacionadosh); if (relacionadosh < 120) { filas = 1 } else { filas = 2 } relacionadosch = parseInt((relacionadosh - 2 * filas) / filas); relacionadoscw = parseInt(($("#pro").width() - 8 * 2) / 3); //$(".soyrelacionado").css('height', relacionadosch); $(".soyrelacionado").css('width', relacionadoscw); console.log("gato" + parseInt($(".logistica").offset().top + $(".logistica").height()) - parseInt($(".menufooter").offset().top)); $(".soyrelacionado").css('width', relacionadoscw); $("#pro").css("opacity","1"); } function drawconsumos() { $(".consumoproducto").each(function (index) { //console.log(index + ": " + $(this).attr("data-id")); //console.log($(this).html()) if (!isEmpty(con)) { consumo = con[$(this).attr("data-id")]; if (consumo == null) { } else { if (con[$(this).attr("data-id")][-1] == null) { } else { $(this).find(".badge-consumo").html(formatprice(con[$(this).attr("data-id")][-1], 0)); $(this).show(); } } } }); drawcantidadpedida(); } function drawcantidadpedida() { $(".pedidoproducto").each(function (index) { ////console.log(index + ": " + $(this).attr("data-id")); consumo = aproduct[$(this).attr("data-id")]; if (consumo == null) { $(this).hide(); } else { cantidad = dimecantidad($(this).attr("data-id")); if (cantidad == 0) { $(this).hide(); } else { $(this).html(formatprice(cantidad, 0)); $(this).show(); } } }); } function LoadData(kcli, cual) { $.getJSON(cual + "/" + kcli, function (data) { localcli = kcli; if (!isEmpty(localStorage.getItem('qt' + localcli))) { localpedido = JSON.parse(localStorage.getItem('qt' + localcli)); } var items = []; aproduct = data['p']; afam = data['f']; apo = data['po']; rel = data['r']; con = data['cons_ano']; alb = data['alb']; adr = data['ad']; pref = data['pref']; cli = data['cli']; cartera = data['cartera']; sts = data['sts']; tventas = data['tv']; drawfams(); MapeoAcciones(); MapeoAcciones(); $("#login").hide(); $("#pro").hide(); $("#main").show(); $("#cat").show(); $('.namefamilia').hide(); $('.paginascount').hide(); $("#blanco").hide(); $("#clisinf").html("" + cli['idmon'] + " " + cli['nom']); }); } function drawcontador() { $(".paginascount").html((contadorposicion + 1) + "/" + contadortotal); } function Ordenar_Relacionados_Horizontal() { /* anchocol = $(".kcol").width(); kanchopro = anchocol; ancho = $(".imgprocol").width() + $(".txtprocol").outerWidth() + parseInt($(".txtprocol").css('marginLeft')); $(".imgprocol").css('margin-left', parseInt((anchocol - ancho) / 2)) */ $(".productInfoTagContainer").css("left",$(".proright").width()-$(".productInfoTagContainer").width()-5); $(".relacionados").css('height', 0); relacionadosh = parseInt($(".menufooter").offset().top - ($("#pro").offset().top)); $(".relacionados").css('height', relacionadosh); relacionadosw = parseInt(($(".relacionados").width() - 20)); if (relacionadosw < 560) { filas = 3 } else { filas = 3 } //relacionadosch=parseInt((relacionadosh-2*filas)/filas); relacionadoscw = parseInt(($(".relacionados").width() - 20) / filas); //$(".soyrelacionado").css('height', relacionadosch); $(".soyrelacionado").css('width', relacionadoscw); dif = (parseInt($(".logistica").offset().top + $(".logistica").height()) - parseInt($(".menufooter").offset().top)); kaltoactual = "100%"; if (dif > 0) { console.log("Resto imagen"); maxhimg = parseInt($(".imgplist").height()) - (dif + 10); $(".imgplist").css('max-width', maxhimg); } $("#pro").css("opacity","1"); } $(window).resize(function () { anchocol = $(".kcol").width(); if (kanchopro != anchocol) { kanchopro = anchocol; xxx(); } }); $(document).ready(function () { /* if ('serviceWorker' in navigator) { navigator.serviceWorker .register('/n/sw.js') .then(() => { console.log('Service Worker Registered'); }); } */ // make the whole serviceworker process into a promise so later on we can // listen to it and in case new content is available a toast will be shown window.isUpdateAvailable = new Promise(function (resolve, reject) { // lazy way of disabling service workers while developing if ('serviceWorker' in navigator && ['localhost', '127'].indexOf(location.hostname) === -1) { // register service worker file navigator.serviceWorker.register('sw.js') .then(reg => { reg.onupdatefound = () => { const installingWorker = reg.installing; installingWorker.onstatechange = () => { console.log(installingWorker); switch (installingWorker.state) { case 'installed': if (navigator.serviceWorker.controller) { console.log("UPDATE"); alert("Hay una actulizacion Reinicie el programa por favor"); resolve(true); } else { console.log("NOUPDATE"); // no update available resolve(false); } break; } }; }; }) .catch(err => console.error('[SW ERROR]', err)); } }); // Update: // this also can be incorporated right into e.g. your run() function in angular, // to avoid using the global namespace for such a thing. // because the registering of a service worker doesn't need to be executed on the first load of the page. /* window.addEventListener("beforeinstallprompt", function(e) { // log the platforms provided as options in an install prompt console.log(e.platforms); // e.g., ["web", "android", "windows"] e.userChoice.then(function(choiceResult) { console.log(choiceResult.outcome); // either "accepted" or "dismissed" }, handleError); }); */ /* window.addEventListener('beforeinstallprompt', (e) => { // Prevent Chrome 67 and earlier from automatically showing the prompt e.preventDefault(); // Stash the event so it can be triggered later. deferredPrompt = e; // Update UI to notify the user they can add to home screen $("#installapp").show(); $("#installapp").click(function () { $("#installapp").hide(); // Show the prompt deferredPrompt.prompt(); // Wait for the user to respond to the prompt deferredPrompt.userChoice.then((choiceResult) => { if (choiceResult.outcome === 'accepted') { console.log('User accepted the A2HS prompt'); } else { console.log('User dismissed the A2HS prompt'); } deferredPrompt = null; }); }); }); */ document.onkeydown = checkKey; $("#pro").on('swipeleft', function () { moveproduct(1); }); $("#pro").on('swiperight', function () { moveproduct(-1); }); $(document).bind( 'touchmove', function (e) { e.preventDefault(); } ); document.addEventListener("touchmove", function (event) { event.preventDefault(); }); // later on when you actually want to play a sound at any point without user interaction soundEffect.src = './sound/click.ogg'; var win = $(window); $("#buscador").submit(function (event) { console.log("busco"); buscador($('#search').val()); event.preventDefault(); }); /* // Each time the user scrolls win.scroll(function () { alert("xxx"); // End of the document reached? //$(".debug").html($(document).height() + ' ' + win.height() + ' ' + win.scrollTop() + ' ' + screen.availHeight); if (($(document).height() - win.height()) - 40 < win.scrollTop()) { if ($('#pro').is(':hidden')) { alert("fin"); } else { $('.rowpro').html(""); if (procurrent * propagination < ashowproducts.length) { procurrent = procurrent + 1; fin = procurrent * propagination; init = fin - propagination; drawproductsarray(init, fin); } } } }); */ MapeoAcciones(); }); function MapeoAcciones() { $(".action").off("click"); $(".action").click( function () { ActionClick($(this)); } ); } function draweconomia(direccion) { economia = ""; m0 = 0; m1 = 0; y0 = 0; y1 = 0; m0_0 = 0; m1_0 = 0; y0_0 = 0; y1_0 = 0; m0_2 = 0; m1_2 = 0; y0_2 = 0; y1_2 = 0; classeco = ""; if (direccion >= 0) { classeco = " ecodirect"; } sts.forEach(function (k, v) { if ((direccion >= 0 && parseInt(k['e']) == direccion) || direccion == -1) { if (k['t'] == 'M0') { m0 += parseInt(k['b']); if (parseInt(k['s']) == 0) { m0_0 += parseInt(k['b']); } else { m0_2 += parseInt(k['b']); } } if (k['t'] == 'M1') { m1 += parseInt(k['b']); if (parseInt(k['s']) == 0) { m1_0 += parseInt(k['b']); } else { m1_2 += parseInt(k['b']); } } if (k['t'] == 'Y0') { y0 += parseInt(k['b']); if (parseInt(k['s']) == 0) { y0_0 += parseInt(k['b']); } else { y0_2 += parseInt(k['b']); } } if (k['t'] == 'Y1') { y1 += parseInt(k['b']); if (parseInt(k['s']) == 0) { y1_0 += parseInt(k['b']); } else { y1_2 += parseInt(k['b']); } } } }); m = parseInt(100 * m0 / m1) - 100; y = parseInt(100 * y0 / y1) - 100; m_0 = parseInt(100 * m0_0 / m1_0) - 100; y_0 = parseInt(100 * y0_0 / y1_0) - 100; m_2 = parseInt(100 * m0_2 / m1_2) - 100; y_2 = parseInt(100 * y0_2 / y1_2) - 100; if (isNaN(m)) m = 100; if (isNaN(y)) y = 100; if (isNaN(m_0)) m_0 = 100; if (isNaN(y_0)) y_0 = 100; if (isNaN(m_2)) m_2 = 100; if (isNaN(y_0)) y_0 = 100; if (m > 0) { m = "+" + m + "%"; } else { m = "" + m + "%"; } if (y > 0) { y = "+" + y + "%"; } else { y = "" + y + "%"; } if (m_0 > 0) { m_0 = "+" + m_0 + "%"; } else { m_0 = "" + m_0 + "%"; } if (y_0 > 0) { y_0 = "+" + y_0 + "%"; } else { y_0 = "" + y_0 + "%"; } if (m_2 > 0) { m_2 = "+" + m_2 + "%"; } else { m_2 = "" + m_2 + "%"; } if (y_2 > 0) { y_2 = "+" + y_2 + "%"; } else { y_2 = "" + y_2 + "%"; } economia += ""; economia += ""; economia += ""; economia += ""; economia += ""; economia += "
SucursalMes ActualMes AnteriorAño ActualAño Anterior
PLASTICFORTE" + formatprice(m0_2, 0) + "" + formatprice(m1_2, 0) + "" + m_2 + "" + formatprice(y0_2, 0) + "" + formatprice(y1_2, 0) + "" + y_2 + "
AMAHOGAR" + formatprice(m0_0, 0) + "" + formatprice(m1_0, 0) + "" + m_0 + "" + formatprice(y0_0, 0) + "" + formatprice(y1_0, 0) + "" + y_0 + "
GENERAL" + formatprice(m0, 0) + "" + formatprice(m1, 0) + "" + m + "" + formatprice(y0, 0) + "" + formatprice(y1, 0) + "" + y + "
"; return economia; } function pad(num, size) { num = num.toString(); while (num.length < size) num = "0" + num; return num; } function findcantidadtventas(idp) { tventas[2].forEach(function (k, v) { idprotmp = productbyref(k["a"]); if (idprotmp != -1) { if (idprotmp == idp) { return k["t"]; } } }); tventas[0].forEach(function (k, v) { idprotmp = productbyref(k["a"]); if (idprotmp != -1) { if (idprotmp == idp) { return k["t"]; } } }); return; } function ActionClick(object) { att = object.attr("data-action"); $('#MenuModal').modal('hide'); if (att == "familia") { window.scrollTo(0, 0); kfam = object.attr("data-id"); $("#cat").hide(); $("#pro").hide(); $("#prolist").show(); $('#OptionModal').modal('hide'); //drawproductsfam(kfam); drawproductsfamlist(kfam); } else if (att == "login") { window.scrollTo(0, 0); $("#blanco").show(); LoadData($("#kusuario").val(), "json"); /* $("#login").hide(); $("#pro").hide(); $("#main").show(); $("#cat").show(); $('.namefamilia').hide(); $('.paginascount').hide(); */ } else if (att == "inicio") { drawfams(); $("#login").hide(); $("#pro").hide(); $("#main").show(); $("#cat").show(); $('.namefamilia').hide(); $('.paginascount').hide(); } else if (att == "logout") { window.scrollTo(0, 0); $("#login").show(); $("#pro").hide(); $("#main").hide(); $("#cat").hide(); } else if (att == "test") { alert($(document).height() + " -> " + $(window).height() + " -> " + $(window).scrollTop()); } else if (att == "plus") { moveproduct(1); } else if (att == "minus") { moveproduct(-1); } else if (att == "menu") { $('#MenuModal').modal('show'); } else if (att == "familias") { drawfams2(); } else if (att == "buscar") { $('#BuscaModal').modal('show'); } else if (att == "reload") { window.scrollTo(0, 0); $("#blanco").show(); LoadData($("#kusuario").val(), "jsonr"); } else if (att == "tools") { $("#MaxModalTitle").html("Herramientas"); $('#MaxModal').attr('data-tipo', 'herramientas'); $('#MaxModal').modal('show'); htmlres = "Espacio Ocupado:" + localStorageSpace(); htmlres += "
Chequer Espacio: " htmlres += "

"; htmlres += window.localStorage.remainingSpace; $(".maxmodalbody").html(htmlres); } else if (att == "buscador") { kbusco = $("#kbusco").val(); buscador(kbusco); } else if (att == "heart") { $("#MaxModalTitle").html("Favoritos"); $('#MaxModal').attr('data-tipo', 'favoritos'); $('#MaxModal').modal('show'); itemsheart = []; $.each(aproduct, function (key, val) { //console.log(key); //console.log(val); heart = val["cz"]; if (heart == 1) { itemsheart.push(key); } }); tittemp = ''; tittemp += " Favoritos [" + itemsheart.length + "]"; tittemp += ''; $("#MaxModalTitle").html(tittemp); htmlres = ""; $.each(itemsheart, function (key, val) { console.log(key + " <<>> " + val); htmlres += DrawProductList2(val); }); htmlres += ""; //htmlres = gettablehead('tableheart') + htmlres; htmlres = "" + htmlres; $(".maxmodalbody").html(htmlres); } else if (att == "cartera") { $("#MaxModalTitle").html("Cartera Cliente"); $('#MaxModal').attr('data-tipo', 'Cartera'); $('#MaxModal').modal('show'); hayheader = 0; htmlres = ""; moneda = "€"; importe = 0; htmlres += '
'; $(".maxmodalbody").html("No hay Cartera"); if (!isEmpty(cartera)) { cartera.forEach(function (k, v) { if (k["SUCURSAL"] == 0) { if (hayheader == 0) { htmlres += headercartera(0); hayheader = 1; } importe += parseFloat(k["IMPORTE"]); htmlres += "
"; htmlres += ""; if (k["FACTURA"] != '') { htmlres += ''; } htmlres += ""; if (!isEmpty(k["NOTAS"])) { htmlres += ""; htmlres += ""; htmlres += ""; } else { htmlres += ""; htmlres += ""; htmlres += ""; } } }); if (hayheader == 1) { htmlres += footercartera(importe, moneda, 0); htmlres += "
"; } hayheader = 0; importe = 0; moneda = "€"; cartera.forEach(function (k, v) { if (k["SUCURSAL"] == 2) { if (hayheader == 0) { htmlres += headercartera(2); hayheader = 1; } importe += parseFloat(k["IMPORTE"]); htmlres += ""; htmlres += ""; if (k["FACTURA"] != '') { htmlres += ''; } htmlres += ""; if (!isEmpty(k["NOTAS"])) { htmlres += ""; htmlres += ""; htmlres += ""; } else { htmlres += ""; htmlres += ""; htmlres += ""; } } }); if (hayheader == 1) { htmlres += footercartera(importe, moneda, 2); } htmlres += ""; htmlres += "
"; htmlres += GetDirecciones(); $(".maxmodalbody").html(htmlres); } } else if (att == "infocliente") { $("#MaxModalTitle").html("Informacion Cliente"); $('#MaxModal').modal('show'); tarifas = ""; /* Forma de pago: 1 PAGARE a 30 c Dto. Comercial: 0 d Dto. Comercial 2: 0 e Dto. Especial: 17.35 f Dto. Pronto Pago: 5 g */ tarifas += "
" + pad(k["ENVIO"], 2) + "*" + k["FECHA"] + "" + k["VENCIMIENTO"] + "" + k["FACTURA"] + "" + formatprice(k["P_DTO_ESP"], 2) + "" + formatprice(k["P_DTO_PP"], 2) + "" + formatprice(k["IMPORTE"], 2) + ""; if (k["REC"] == 1) { htmlres += ''; } htmlres += "
" + k["NOTAS"] + "
" + pad(k["ENVIO"], 2) + "*" + k["FECHA"] + "" + k["VENCIMIENTO"] + "" + k["FACTURA"] + "" + formatprice(k["P_DTO_ESP"], 2) + "" + formatprice(k["P_DTO_PP"], 2) + "" + formatprice(k["IMPORTE"], 2) + ""; if (k["REC"] == 1) { htmlres += ''; } htmlres += "
" + k["NOTAS"] + "
"; /*la tarifa solo la vera el comercial*/ /*tarifas += "";*/ tarifas += ""; tarifas += ""; tarifas += ""; tarifas += ""; tarifas += ""; tarifas += ""; tarifas += "
Tarifa:" + cli['gro'] + "
Agente:" + cli['idag'] + "
Forma de pago:" + cli['more']['c'] + "
DTO LINEA 1:" + formatprice(cli['more']['d'], 2) + " %
DTO LINEA 2:" + formatprice(cli['more']['e'], 2) + " %
Dto. Especial:" + formatprice(cli['more']['f'], 2) + " %
Dto. Pronto Pago:" + formatprice(cli['more']['g'], 2) + " %
"; facturacion = ""; /* Forma de pago: 1 PAGARE a 30 c Dto. Comercial: 0 d Dto. Comercial 2: 0 e Dto. Especial: 17.35 f Dto. Pronto Pago: 5 g */ facturacion += ""; facturacion += ""; facturacion += ""; facturacion += ""; facturacion += ""; facturacion += ""; facturacion += ""; facturacion += ""; facturacion += ""; facturacion += ""; facturacion += "
Razon Social:" + cli['nom'] + "
Nombre Comercial:" + cli['com'] + "
CIF:" + cli['cif'] + "
Direccion:" + "-" + "
Poblacion:" + cli['city'] + "
Provincia:" + "-" + "
Pais:" + "-" + "
Telefono:" + "-" + "
EMail:" + cli['mail'] + "
"; direcciones = ""; direcciones += ""; adr.forEach(function (k, v) { direcciones += ""; direcciones += ""; direcciones += ""; direcciones += ""; direcciones += ""; direcciones += ""; direcciones += ""; direcciones += ""; direcciones += ""; //direcciones += "" + k["ali"].substring(1) + "* : " + k["ad"] + ", " + k["cp"] + ", " + k["city"] + ", " + k["pais"] + "
"; }); direcciones += "
Direccion " + k["ali"].substring(1) + "
Nombre:" + k['company'] + "
Direccion:" + k['ad'] + "
CP.:" + k['cp'] + "
Ciudad:" + k['city'] + "
Pais:" + k['pais'] + "
Telefono 1:" + k['phone'] + "
Telefono 2:" + k['phone_mobile'] + "
"; economia = ""; economia += draweconomia(-1); adr.forEach(function (k, v) { economia += "
"; economia += "
DIRECCION " + k["ali"].substring(1) + " (" + k['ad'] + " " + k['cp'] + " " + k['city'] + ")
"; economia += draweconomia(parseInt(k["ali"].substring(1))); }); tv = ""; tv += ""; tventas[0].forEach(function (k, v) { //if(productbyref(k["a"])!=-1){ tv += ""; //} }); tv += "
" + k["a"] + "" + productbyref(k["a"]) + "" + k["t"] + "" + k["p"] + "
"; tv = "
"; tv += ""; tventas[2].forEach(function (k, v) { //if(productbyref(k["a"])!=-1){ tv += ""; //} }); tv += "
" + k["a"] + "" + productbyref(k["a"]) + "" + k["t"] + "" + k["p"] + "
"; tventasa = []; tventas[2].forEach(function (k, v) { idprotmp = productbyref(k["a"]); if (idprotmp != -1) { tventasa.push(idprotmp); } }); tv_2 = ""; $.each(tventasa, function (key, val) { console.log(key + " <<>> " + val); tv_2 += DrawProductList2(val); }); tv_2 += ""; //tv_2 = gettablehead('tabletv') + tv_2; htmlres = `
` + economia + `
`+ facturacion + `
`+ direcciones + `
And lastly, the placeholder content for the third and final accordion panel. This panel is hidden by default.
`; $(".maxmodalbody").html(htmlres); //$('div.plist[data-id="' + idp + '"]').find('div.listUnidades').html(formatprice(ori, 0)) /*$("table.tabletv tr").each(function () { idp=$(this).attr("data-id"); if(idp!==undefined) { $(this).find('.refaddon').html(findcantidadtventas(idp)); } }); */ tventas[2].forEach(function (k, v) { idprotmp = productbyref(k["a"]); if (idprotmp != -1) { $('table.tabletv tr[data-id="' + idprotmp + '"]').find('.refaddon').html("[" + formatprice(k['t'], 0) + "]"); } }); tventas[0].forEach(function (k, v) { idprotmp = productbyref(k["a"]); if (idprotmp != -1) { $('table.tabletv tr[data-id="' + idprotmp + '"]').find('.refaddon').html("[" + formatprice(k['t'], 0) + "]"); } }); } else if (att == "cart") { $("#MaxModalTitle").html("Pedido"); $('#MaxModal').attr('data-tipo', 'pedido'); $('#MaxModal').modal('show'); itemsheart = []; itemsheart = getlistapedidos(); tittemp = ''; tittemp += " Pedido [" + itemsheart.length + "]"; $("#MaxModalTitle").html(tittemp); htmlres = ""; totaldinero = 0; volumentotal = 0; $.each(itemsheart, function (key, val) { console.log(key + " <<>> " + val); htmlres += DrawProductList2(val); totaldinero += getTotalLinea(val); volumentotal += getVolume(val) * dimecantidad(val) / getFloatProductValue(val, 'u5'); }); htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += "TOTAL"; htmlres += "" + formatprice(totaldinero, 2) + ""; //htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += "Volumen"; htmlres += "" + formatprice(volumentotal, 2) + ""; //htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += "" + formatprice(volumentotal * 100 / 20, 1) + " %"; //htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += "" + formatprice(volumentotal * 100 / 40, 1) + " %"; //htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += "" + formatprice(volumentotal * 100 / 80, 1) + " %"; //htmlres += ""; htmlres += ""; htmlres += ""; //htmlres = gettablehead('tablepedido') + htmlres; htmlres += '
Notas
'; htmlres += '
'; htmlres += 'Nota
Pedido
'; htmlres += ''; htmlres += '
'; htmlres += '
'; htmlres += 'Nota
Interna
'; htmlres += ''; htmlres += '
'; htmlres += '
Direcciones
'; htmlres += '
'; adr.forEach(function (k, v) { htmlres += '
'; htmlres += ''; htmlres += ''; htmlres += '
'; }); htmlres += '
'; htmlres += "" $(".maxmodalbody").html(htmlres); $('#direccionespedidos div input[type=radio][name=dire]').change(function () { $('#EnvioPedido').show(); }); $('#EnvioPedido').click(function () { kdir = -1; notaped = "-1xx"; notapedint = "-1xx"; if ($("#direccionespedidos div input:checked")) { kdir = $("#direccionespedidos div input:checked").val(); } if (kdir == -1) { return; } notaped = $("#notaped").val(); notapedint = $("#notapedint").val(); //alert(notapedint); //alert(kdir); if (isEmpty(localpedido["c"])) { localpedido["c"] = {}; } newDate = new Date(); curdatetime = newDate.compressdt(); localpedido["c"].np = notaped; localpedido["c"].npi = notapedint; localpedido["c"].d = kdir; localpedido["c"].dt = curdatetime; localpedido["c"].ag = localag; localpedido["c"].cl = localcli; localpedido["c"].cln = cli['nom']; if (isEmpty(localpedido["c"].ui)) { localpedido["c"].ui = uuidv4_date(); } SaveLocalStorage(); $("#blanco").show(); var jqxhr = $.post("newpedido.php", { data: JSON.stringify(localpedido) }) .done(function (data) { if (data == localpedido["c"].ui) { DisplayPedidoOK(); } else { DisplayPedidoKO("ERROR: " + data); } }) .fail(function (xhr, status, error) { DisplayPedidoKO("error: " + xhr.status); }) .always(function (data) { }); }); } else { alert(att); } } function DisplayPedidoOK() { if (!isEmpty(localStorage.getItem('peds'))) { Globalpedids = JSON.parse(localStorage.getItem('peds')); } else { Globalpedids = []; } Globalpedids.push(localpedido); localStorage.setItem("peds", JSON.stringify(Globalpedids)); localStorage.removeItem('qt' + localcli); localizador = localpedido["c"].ui; localpedido = {}; drawpedidos(); $('#MaxModal').modal('hide'); $("#pro").hide(); $("#cat").show(); $("#MediumModalTitle").html("Envio Pedido Correcto"); $('#MediumModal').modal('show'); htmlres = "Su envio con el localizador " + localizador + " se ha realizado correctmente"; $(".mediummodalbody").html(htmlres); $("#blanco").hide(); } function DisplayPedidoKO(kerror) { alert(kerror); $("#blanco").hide(); } function getTotalLinea(idp) { ret = 0; cant = dimecantidad(idp); if (cant == 0) { return 0; } return cant * getPrice(idp); } function getVolume(idp) { vo = 0; if (!isEmpty(aproduct[idp])) { if (!isEmpty(aproduct[idp]['vo'])) { vo = aproduct[idp]['vo'] vo = parseFloat(aproduct[idp]['vo'].replace(",", ".")); } } return vo; } function getIntProductValue(idp, kvalue) { val = getProductValue(idp, kvalue); if (isEmpty(val)) { val = 0; } else { val = parseInt(val); } return val; } function getFloatProductValue(idp, kvalue) { val = getProductValue(idp, kvalue); if (isEmpty(val)) { val = 0; } else { val = parseFloat(val); } return val; } function getProductValue(idp, kvalue) { val = null; if (!isEmpty(aproduct[idp])) { if (!isEmpty(aproduct[idp][kvalue])) { val = aproduct[idp][kvalue] } } return val; } function gettablehead(kclase) { htmlreshead = ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; htmlreshead += ""; return htmlreshead; } function productbyref(ref) { ret = -1; $.each(aproduct, function (key, val) { if (val["reference"].toUpperCase() == ref.toUpperCase()) { ret = val['id']; } }); return ret; } function buscador(str) { itemsct = []; $.each(aproduct, function (key, val) { ct = val["n"].toUpperCase(); str = str.toUpperCase(); if (!isEmpty(ct) && ct.indexOf(str) !== -1) { if (aproduct[key]['ac'] == "1") { itemsct.push(key); } } else { ct = val["reference"].toUpperCase(); if (!isEmpty(ct) && ct.indexOf(str) !== -1) { if (aproduct[key]['ac'] == "1") { itemsct.push(key); } } } }); itemsheart = []; itemsheart = itemsct; htmlres = ""; $.each(itemsheart, function (key, val) { console.log(key + " <<>> " + val); htmlres += DrawProductList3(val); }); htmlres += "
Ref.TituloUds.PrecioTotal
"; htmlres = gettablehead('tablebuscador') + htmlres; $(".buscamodalbody").html(htmlres); } function getlistapedidos() { itemsct = []; $.each(aproduct, function (key, val) { ct = dimecantidad(val["id"]); if (!isEmpty(ct) && parseInt(ct) > 0) { itemsct.push(key); } }); return itemsct; } function getnumpedidos() { return getlistapedidos().length; } function drawpedidos() { ct = getnumpedidos(); if (ct > 0) { $(".ncart").html(ct); $(".ncart").show(); } else { $(".ncart").hide(); } } function findParentProduct(id) { parentproducts = []; fams = []; val = aproduct[id]; console.log(val); if (val['sh'] == "1") { parentproducts.push(id); console.log("Esta en Show"); } else { console.log("No Esta en Show"); $.each(rel, function (index, valor) { //console.log("RR" + index); $.each(valor, function (index2, valor2) { //console.log(" -> " + valor); if (valor2 == id) { if (aproduct[index]['sh'] == "1") { console.log("Encuentro parent " + index); parentproducts.push(index); } } }); }); } if (parentproducts.length == 0) { console.log("No encuentro producto parent"); } tmpfams2 = [] $.each(parentproducts, function (index, valor) { tmpval = findFamProduct(valor); $.each(tmpval, function (indexx, valorx) { //console.log(typeof tmpfams[valorx[0]]); if (typeof tmpfams2[valorx[0]] !== 'undefined') { // your code here //console.log("mal" + valorx[0]); } else { //console.log("anado" + valorx[0]); tmpfams2[valorx[0]] = valorx; } }); //tmpfams2.push(findFamProduct(valor)); }); tmpfams3 = []; $.each(tmpfams2, function (index, valor) { if (typeof valor !== 'undefined') { tmpfams3.push(valor); } }); console.log("voy1"); console.log(parentproducts); console.log(tmpfams3); return tmpfams3; } function findFamProduct(id) { tmpfams = []; $.each(apo, function (index, valor) { $.each(valor, function (index2, valor2) { //console.log(valor2); if (valor2 == id) { tmpfams.push([index, afam[index]['n'], id]); } }); }); console.log("Familias de " + id); console.log(tmpfams); return tmpfams; } function DrawProductList(id) { val = aproduct[id]; htmlres = ""; htmlres += "
"; htmlres += ' '; htmlres += '
'; htmlres += '
'; htmlres += ' ref:' + val['reference'] + ''; htmlres += '
'; htmlres += '
'; htmlres += ' ' + val['n'] + ''; htmlres += '
'; htmlres += '
'; htmlres += ' ' + getFormatPrice(val['id'], 2) + '€'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += ' '; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
' + dimecantidad(id) + '
'; htmlres += '
' + formatprice(dimecantidad(id) * val["p"], 2) + " €" + '
'; tmpparent = findParentProduct(id); if (tmpparent.length == 0) { htmlres += '
'; } else { $.each(tmpparent, function (key, val) { if (typeof val !== 'undefined') { htmlres += '
'; } }); } htmlres += '
'; htmlres += '
'; htmlres += "
"; return htmlres; } function DrawProductList2(id) { val = aproduct[id]; htmlres = ""; htmlres += "
"; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += ' REF: ' + val['reference'] + ''; htmlres += ' '; htmlres += ' ' + val['n'] + ''; htmlres += ' '; htmlres += '
'; htmlres += '
'; htmlres += '
Precio'; htmlres += ' ' + getFormatPrice(val['id'], 2); htmlres += '
'; htmlres += '
Total' + formatprice(dimecantidad(id) * val["p"], 2) + '
'; htmlres += '
Cantidad' + formatprice(dimecantidad(id), 0) + '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += ' '; htmlres += '
'; htmlres += "
"; return htmlres; } function DrawProductList5(id) { val = aproduct[id]; htmlres = ""; htmlres += ""; htmlres += ' '; htmlres += ' '; htmlres += ' '; htmlres += ' '; htmlres += ' '; htmlres += ' ' + val['reference'] + ''; htmlres += ' '; htmlres += ' '; htmlres += ' ' + val['n'] + ''; htmlres += ' '; htmlres += ' ' + formatprice(dimecantidad(id), 0) + ''; htmlres += ' '; htmlres += ' ' + getFormatPrice(val['id'], 2); htmlres += ' '; htmlres += ' ' + formatprice(dimecantidad(id) * val["p"], 2) + ''; htmlres += ' '; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += ' '; htmlres += ""; return htmlres; } function DrawProductList3(id) { val = aproduct[id]; htmlres = ""; htmlres += ""; htmlres += ' '; htmlres += ' '; htmlres += ' '; htmlres += ' '; htmlres += ' '; htmlres += ' ' + val['reference']; htmlres += ' '; htmlres += ' '; htmlres += ' ' + val['n'] + ''; htmlres += ' '; htmlres += ' ' + formatprice(dimecantidad(id), 0) + ''; htmlres += ' '; htmlres += ' ' + getFormatPrice(val['id'], 2); htmlres += ' '; htmlres += ' ' + formatprice(dimecantidad(id) * val["p"], 2) + ''; htmlres += ' '; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += '
'; htmlres += ' '; htmlres += ""; htmlres += ""; htmlres += ' '; tmpparent = findParentProduct(id); if (tmpparent.length == 0) { htmlres += '
'; } else { $.each(tmpparent, function (key, val) { if (typeof val !== 'undefined') { htmlres += '
'; } }); } htmlres += ' '; htmlres += ""; return htmlres; } function drawfams() { $('.namefamilia').hide(); $('.paginascount').hide(); resfin = ""; afamorder = []; $.each(afam, function (key, val) { afamorder[val['p']] = key; }); //$.each(afamorder, function (index, valor) { for (var index in afamorder) { res = ""; res += '
'; res += '
'; res += ' Card image'; res += '
'; res += '
'; res += '

' + afam[afamorder[index]]['n'] + '

'; res += '
'; res += '
'; res += '
'; res += '
'; resfin += res; }; //$('.rowfams').html(resfin); $('.rowfams').html(""); drawfams2(); } function drawfams2() { resfin = ""; afamorder = []; $.each(afam, function (key, val) { afamorder[val['p']] = key; }); //$.each(afamorder, function (index, valor) { resfin += ''; $("#OptionModalBody").html(resfin); $("#OptionModalTitle").html("Familias"); $('#OptionModal').modal('show'); MapeoAcciones(); } function listsumapro(id, mult) { event.stopPropagation(); val = aproduct[id]; cantidad = val['u1'] * mult; SumaProducto(id, cantidad); listrenderkcantidadvalue(id); } function listrenderkcantidadvalue(idp) { ori = dimecantidad(idp); $('div.plist[data-id="' + idp + '"]').find('div.listUnidades').html(formatprice(ori, 0)) $('tr[data-id="' + idp + '"]').find('td.tdlistUnidades').html(formatprice(ori, 0)) totalprice = formatprice(dimecantidad(idp) * aproduct[idp]["p"], 2); $('div.plist[data-id="' + idp + '"]').find('div.listtotalprice').html(totalprice + " €"); $('tr[data-id="' + idp + '"]').find('td.tdlisttotalprice').html(totalprice) } function gotoproduct(dfamilia, dproducto, dsubproducto) { $('#MaxModal').modal('hide'); $('#BuscaModal').modal('hide'); $('#OptionModal').modal('hide'); val = aproduct[dproducto]; drawproductsfam(dfamilia, 0, dproducto, dsubproducto); } function gotoproductobyidinlist(idp) { gotoproductobyid(idp,$('.idfamiliatext').html()); } function gotoproductobyid(idp, idfam=-1) { $('#MediumModal').modal('hide'); atmp = findParentProduct(idp); if(idfam>=0) { atmp2=[]; $.each(atmp, function (key, val) { if (typeof val !== 'undefined') { if(val[0]==idfam) { atmp2.push(val); } } }); atmp=atmp2; } if (atmp.length == 1) { gotoproduct(atmp[0][0], atmp[0][2], idp); } else if (atmp.length == 0) { htmlres = ""; $("#OModalTitle").html("ERROR"); $('#OptionModal').modal('show'); htmlres = "

Este producto no tiene punto de inicio

"; $(".optionmodalbody").html(htmlres); } else { htmlres = ""; $("#OptionModalTitle").html("Opciones"); $('#OptionModal').modal('show'); $.each(atmp, function (key, val) { if (typeof val !== 'undefined') { htmlres += '
'; } }); $(".optionmodalbody").html(htmlres); } } function drawproductsfam(famid, pos, idp, subproducto) { $("#cat").hide(); $("#prolist").hide(); $("#pro").show(); procurrent = 1; $('.rowpro').html(""); $('.namefamilia').show(); $('.paginascount').show(); $('.namefamiliatext').html(afam[famid]['n']); $('.idfamiliatext').html(famid); count = 0; if (isEmpty(pos)) { pos = 0; } if (isEmpty(idp)) { idp = -1; } ashowproducts = []; $.each(apo[famid], function (key, val) { if (aproduct[val] != null) { if (aproduct[val]["sh"] == "1") { //console.log(aproduct[val]); if (idp != -1 && pos == 0) { if (aproduct[val]["id"] == idp) { pos = count; procurrent = pos + 1; } } count++; ashowproducts.push(val); } else { //console.log(key + "->" + aproduct[val]["ac"]); } } // }); drawproductsarray(pos, pos + propagination); if (typeof subproducto !== 'undefined') { console.log("subproducto" + subproducto + " - " + idp); console.log($('.imgrelacionado[data-id="' + subproducto + '"]')); $('.imgrelacionado[data-id="' + subproducto + '"]').trigger("click"); } } function drawproductsfamlist(famid) { $("#cat").hide(); $("#pro").hide(); $("#prolist").show(); procurrent = 1; $('.rowpro').html(""); $('.namefamilia').show(); $('.paginascount').show(); $('.namefamiliatext').html(afam[famid]['n']); $('.idfamiliatext').html(famid); count = 0; $('.rowprolist').html(""); res=""; ashowproducts = []; $.each(apo[famid], function (key, val) { if (aproduct[val] != null) { if (aproduct[val]["sh"] == "1") { //console.log(aproduct[val]); res=""; res += '
'; res += '
'; res += drawproductolist(aproduct[val]); res += '
'; res += '
'; $('.rowprolist').append(res); count++; } else { //console.log(key + "->" + aproduct[val]["ac"]); } } // }); setTimeout( function () { $( ".asyncload" ).each(function( index ) { console.log( index + ": " + $( this ).attr("dms-src") ); $( this ).attr("src",$( this ).attr("dms-src")) }); //$(".pplus").popover(); $('.pplus').bind( "taphold", function () { //$(".popover").remove(); res=""; val = aproduct[$( this ).attr("dms-idp")]; cu=$('.kunidadlist'+$( this ).attr("dms-idp")).html(); res += '
'; res += '
Paq.
' + val['u1'] + 'ud.' + val['u1'] + '' + val['id'] + '
'; res += '
Caja
' + val['u2'] + 'ud.' + val['u2'] + '' + val['id'] + '
'; res += '
Piso
' + val['u3'] + 'ud.' + val['u3'] + '' + val['id'] + '
'; res += '
1/2 P.
' + val['u4'] + 'ud.' + val['u4'] + '' + val['id'] + '
'; res += '
Palet
' + val['u5'] + 'ud.' + val['u5'] + '' + val['id'] + '
'; res += '
' $(this).popover({title: "Unidades Venta", content: res, placement: "auto", html: true, trigger: "manual", toggle: "popover"}); $(this).popover("show"); $(".popover .kunidad").click(function(){ xu=$(this).find('.xu').html(); xidp=$(this).find('.xidp').html(); $('.kunidadlist'+xidp).html(xu); $('.pplus[dms-idp="'+ xidp +'"]').popover("dispose"); //$(".popover").remove(); }); }) } , 100); //$('.rowpro').html(res); } function drawproductsarray(init, fin) { if (fin > ashowproducts.length) { fin = ashowproducts.length; } contadortotal = ashowproducts.length - 1; contadorposicion = init; drawcontador(); for (var i = init; i < fin; i++) { renderproductlist(ashowproducts[i], ashowproducts[i + 1], ashowproducts[i - 1]); } } function openlogistica(id) { val = aproduct[id]; htmlres = ""; htmlres = ""; htmlres += ""; htmlres += ""; if (!isEmpty(val['uu']) || !isEmpty(val['ud']) || !isEmpty(val['uw']) || !isEmpty(val['uv'])) { htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; } if ((val['u1'] > 0) || !isEmpty(val['si']) || !isEmpty(val['pe']) || !isEmpty(val['pv'])) { htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; } if ((val['u2'] > 0) || !isEmpty(val['cd']) || !isEmpty(val['cw']) || !isEmpty(val['cv'])) { htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; } if ((val['u3'] > 0) || !isEmpty(val['idx']) || !isEmpty(val['iw']) || !isEmpty(val['iv'])) { htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; } if ((val['u4'] > 0) || !isEmpty(val['md']) || !isEmpty(val['mw']) || !isEmpty(val['mv'])) { htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; } if ((val['u5'] > 0) || !isEmpty(val['ld']) || !isEmpty(val['lw']) || !isEmpty(val['lv'])) { htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; htmlres += ""; } htmlres += "
" + "Un." + "" + "Cant." + "" + "" + "kgm3
Ud." + val['uu'] + "" + val['ud'] + "" + formatprice(val['uw'], 2) + "" + formatprice(val['uv'], 2) + "
" + "Paquete" + "" + val['u1'] + "" + val['si'] + "" + formatprice(val['pe'], 2) + "" + formatprice(val['pv'], 2) + "
" + "Caja" + "" + val['u2'] + "" + val['cd'] + "" + formatprice(val['cw'], 2) + "" + formatprice(val['cv'], 2) + "
" + "Piso" + "" + val['u3'] + "" + val['idx'] + "" + formatprice(val['iw'], 2) + "" + formatprice(val['iv'], 2) + "
" + "1/2 Palet" + "" + val['u4'] + "" + val['md'] + "" + formatprice(val['mw'], 2) + "" + formatprice(val['mv'], 2) + "
" + "Palet" + "" + val['u5'] + "" + val['ld'] + "" + formatprice(val['lw'], 2) + "" + formatprice(val['lv'], 2) + "
"; //$('.modal-body-logistica').html($('.logistica').html()); //$('.modal-body-spincantidad').html($('.spincantidad').html()); $('.modal-body-logistica').html($('.logistica').html() + "
" + htmlres); $('#myModal').modal('show'); $('.modal-body-logistica .kunidad').click(function (event) { if(!$(this).hasClass("disabled")) { $(".kunidad").removeClass("selected"); at = ($(this).attr('data-x')); //$(this).addClass("selected"); $('.kunidad[data-x="' + at + '"]').addClass("selected"); } }); $('#notasp' + id).bind('input propertychange', function () { savenotasproducto($(this).attr("data-id"), this.value) }); } function savenotasproducto(idp, nota) { if (isEmpty(localpedido["ped"])) { localpedido["ped"] = {}; } if (isEmpty(localpedido["ped"][idp])) { localpedido["ped"][idp] = {}; } localpedido["ped"][idp].n = nota; SaveLocalStorage(); } function SaveLocalStorage() { localStorage.setItem('qt' + localcli, JSON.stringify(localpedido)); } function getnotasproducto(idp) { nota = ""; if (!isEmpty(localpedido["ped"])) { if (!isEmpty(localpedido["ped"][idp])) { if (!isEmpty(localpedido["ped"][idp].n)) { nota = localpedido["ped"][idp].n; } } } return nota; } function getnotaPedido() { nota = ""; if (!isEmpty(localpedido["c"])) { if (!isEmpty(localpedido["c"].np)) { nota = localpedido["c"].np; } } return nota; } function getnotaPedidoI() { nota = ""; if (!isEmpty(localpedido["c"])) { if (!isEmpty(localpedido["c"].npi)) { nota = localpedido["c"].npi; } } return nota; } function displayconsumos(obj) { art = obj.attr("data-id"); htmlres = ""; htmlres += ""; alb.forEach(function (k, v) { if (k["a"] == art) { htmlres += "" } }); htmlres += "
FechaDir.Cant.Alb.
" + k["f"] + "" + k["e"] + "*" + k["c"] + "" + k["al"] + "
"; htmlres += "
"; htmlres += "
"; htmlres += GetDirecciones(); $("#MediumModalTitle").html("Consumos [" + art + "]"); $('#MediumModal').modal('show'); $(".mediummodalbody").html(htmlres); } function GetDirecciones() { htmlres = ""; adr.forEach(function (k, v) { htmlres += "" + k["ali"].substring(1) + "* : " + k["ad"] + ", " + k["cp"] + ", " + k["city"] + ", " + k["pais"] + "
"; }); return htmlres; } function displayalbaran(idalbaran) { htmlres = ""; //htmlres += ""; alb.forEach(function (k, v) { if (k["al"] == idalbaran) { namep = "nose"; if (!isEmpty(pref[k["a"]])) { idp = pref[k["a"]]; if (!isEmpty(aproduct[idp])) { namep = aproduct[idp]['n']; imgsrc = getpimg(aproduct[idp]['im']); } } if (namep != "nose") { cantidadp = dimecantidad(idp); cantidadp = cantidadp == 0 ? '' : cantidadp; htmlres += "" } } }); htmlres += "
Cod.prodCant.
" + k["a"] + "" + namep + "" + k["c"] + "" + cantidadp + "
"; $("#MediumModalTitle").html("Albaran [" + idalbaran + "]"); $('#MediumModal').modal('show'); $(".mediummodalbody").html(htmlres); } function drawproductolist(val) { res = ""; res += '
'; res += ' '; res += '
'; res += '
'; res += '
'; res += ' ' + val['reference'] + ''; res += '
' +getFormatPrice(val['id'], 2) + ' €'; res += '
'; kcant=dimecantidad(val['id']); kcantclass=""; if(kcant==0) { kcantclass="hidezero"; } res += '
'; res += '
' + val['u1'] + '
'; res += '
' + formatprice(kcant,0) +'
'; res += '
'; res += ' '; res += '
'; res += '
'; res += ' '; res += '
'; res += '
'; res += '
'; return res; } function drawproducto(val) { res = ""; res += '
'; res += '
'; //res += ' '; if (val['nw'] == 1 /*&& val['fid'] != 10*/) { res += '
'; } if (val['lq'] == 1) { res += '
'; } else if (val['lq'] == 2) { res += '
'; } else if (val['lq'] == 3) { res += '
'; } else if (val['lq'] == 4) { res += '
'; } else if (val['lq'] == 5) { res += '
'; } else if (val['lq'] == 6) { res += '
'; } res += '
'; res += '
'; res += '
'; //res += ' '; res += ' '; //res += '
+ Colors
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
' + val['n'] + '
'; res += '
'; res += '
'; res += ' '; res += ' '; res += '
'; res += '
'; res += ' Ref:' + val['reference'] + ''; res += '
'; res += '
'; res += '
' + getFormatPrice(val['id'], 2) + ' €
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
Consumido
49
'; res += '
0
0 Paq.
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
Paq.
' + val['u1'] + 'ud.
'; res += '
Caja
' + val['u2'] + 'ud.
'; res += '
Piso
' + val['u3'] + 'ud.
'; res += '
1/2 P.
' + val['u4'] + 'ud.
'; res += '
Palet
' + val['u5'] + 'ud.
'; res += '
'; //res += '
' + val['u6'] + '
'; res += '
'; res += '
'; res += '
'; res += '
'; res += '
'; return res; } function renderproductlist(id, next, prev) { console.log(id); val = aproduct[id]; console.log(val); res = ""; res += '
'; res += '
'; res += drawproducto(val); res += '
'; //res += '
'; res += '
'; res += '
'; res += ' '; res += ' '; res += ' '; res += ' '; res += '
'; $.each(rel[id], function (key, val) { //console.log("rel:" + val); rp = aproduct[val]; if (rp != null) { rimg = rp['im']; rimgurl = getpimg(rimg); if (val == id) { res += '
48
46
'; } else { res += '
47
45
'; } } }); res += '
'; res += '
'; res += '
'; if (!isEmpty(next)) { res += ''; } if (!isEmpty(prev)) { res += ''; } //$('.rowpro').append(res); $('.rowpro').html(res); setTimeout( function () { console.log($("#relacionados").innerHeight() + " -> " + $("#relacionados").height() + " -> " + $("#relacionados").outerHeight() + " -> " + ($("#relacionados")).prop('scrollHeight')); if ($("#relacionados").innerHeight() < ($("#relacionados")).prop('scrollHeight')) { $(".flecharelacionados").show(); } } , 400); drawconsumos(); $(".imgrelacionado").click( function () { console.log($(this)); renderonlyproductlist($(this).attr("data-id")); } ); $("#relacionados").scroll(function () { $(".flecharelacionados").hide(); }); $('.imgplist').click(function (event) { showgallery($(this)); }); $('.kunidad').click(function (event) { if(!$(this).hasClass("disabled")) { $(".kunidad").removeClass("selected"); at = ($(this).attr('data-x')); //$(this).addClass("selected"); $('.kunidad[data-x="' + at + '"]').addClass("selected"); } }); $('.corazon').click(function (event) { idp = $(this).attr("data-id"); cz = aproduct[idp]['cz']; if (isEmpty(cz) || cz == 0) { aproduct[idp]['cz'] = 1; $(".corazonvacio").hide(100); $(".corazonlleno").show(200); cuantoscorazones++; } else { aproduct[idp]['cz'] = 0; $(".corazonlleno").hide(100); $(".corazonvacio").show(200); cuantoscorazones--; } animocorazonfooter(); }); renderkcantidadvalue(id) /* $(".imgplist").one("load", function () { ////console.log("uno") }).each(function () { if (this.complete) { $(this).load(); // For jQuery < 3.0 // $(this).trigger('load'); // For jQuery >= 3.0 //console.log("dos"); } }); */ cz = val['cz']; if (!isEmpty(cz) && cz == 1) { $(".corazonvacio").hide(); $(".corazonlleno").show(); } } function animocorazonfooter() { $(".corazonllenofooter").show(); setTimeout(function () { $(".corazonllenofooter").hide(); }, 3000); $(".ncorazones").html(cuantoscorazones); if (cuantoscorazones > 0) { $(".ncorazones").show(); } else { $(".ncorazones").hide(); } } function renderonlyproductlist(id) { console.log(id); val = aproduct[id]; console.log(val); res = ""; res += drawproducto(val); $('.imgprocol').html(res); drawconsumos(); $(".imgrelacionado").each(function () { if ($(this).attr("data-id") == id) { $(this).parent().addClass("current"); } else { $(this).parent().removeClass("current"); } }); $('.imgplist').click(function (event) { showgallery($(this)); }); $('.kunidad').click(function (event) { if(!$(this).hasClass("disabled")) { $(".kunidad").removeClass("selected"); $(this).addClass("selected"); } }); $('.corazon').click(function (event) { idp = $(this).attr("data-id"); cz = aproduct[idp]['cz']; if (isEmpty(cz) || cz == 0) { aproduct[idp]['cz'] = 1; $(".corazonvacio").hide(100); $(".corazonlleno").show(200); cuantoscorazones++; } else { aproduct[idp]['cz'] = 0; $(".corazonlleno").hide(100); $(".corazonvacio").show(200); cuantoscorazones--; } animocorazonfooter(); }); cz = val['cz']; if (!isEmpty(cz) && cz == 1) { $(".corazonvacio").hide(); $(".corazonlleno").show(); } renderkcantidadvalue(id) } function getpimg(id,kual="-large_default.jpg") { //return "./img/noimage.gif"; if (isEmpty(id)) { return "./img/noimage.gif"; } else { if (online == 0) { return "http://127.0.0.1:7777/p/" + id + prosuf; } else { fin = ""; idx = id + ""; var i = 0; for (i = 0; i < idx.length; i++) { fin += idx.substring(i, i + 1) + "/"; } fin += id + kual; fin = propath + fin; return fin; } } } function getcimg(id) { if (isEmpty(id)) { return "./img/noimage.gif"; } else { if (online == 0) { return "http://127.0.0.1:7777/c/" + id + famsuf; } else { fin = ""; fin += id + famsuf; fin = fampath + fin; return fin; } } } function PlaySound() { //var sound = document.getElementById("audio"); //sound.play() soundEffect.play(); } function getPrice(id) { retprecio = aproduct[id]["p"]; return parseFloat(retprecio); } function getFormatPrice(id, decimales) { retprecio = aproduct[id]["p"]; return formatprice(retprecio, decimales); } function numberWithCommas(x) { var parts = x.toString().split(","); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, "."); return parts.join("."); } function formatprice(price, decimales) { if (price == undefined) { return "-"; } price = parseFloat(price.toString().replace(",", ".")).toFixed(decimales); ResultStr = price.toString();; if (ResultStr != null) { var SplitChars = '.'; if (ResultStr.indexOf(SplitChars) >= 0) { var DtlStr = ResultStr.split(SplitChars); decimaless = ""; if (decimales > 0) { decimaless = ',' + DtlStr[1] + ''; } return numberWithCommas(DtlStr[0]) + decimaless; //return 'gato'; } else { return numberWithCommas(price); } } } function dimecantidad(idp) { ori = 0; if (!isEmpty(localpedido["ped"])) { if (!isEmpty(localpedido["ped"][idp])) { if (!isEmpty(localpedido["ped"][idp].qt)) { ori = localpedido["ped"][idp].qt; } } } if (isEmpty(ori)) { ori = 0; } return ori; } function masproducto(idp, mult, eslista=0) { if(eslista==1) { cuantos = parseInt($("#prolist .kunidadlist" + idp ).html()) * parseInt(mult); } else{ cuantos = parseInt($("#pro .kunidad.selected").attr("data-c")) * parseInt(mult); } //alert(cuantos); SumaProducto(idp, cuantos); renderkcantidadvalue(idp); } function SumaProducto(idp, suma) { ori = dimecantidad(idp); tmpqt = ori + suma; if (tmpqt < 0) { tmpqt = 0; } if (tmpqt != ori) { if (isEmpty(localpedido["ped"])) { localpedido["ped"] = {}; } if (isEmpty(localpedido["ped"][idp])) { localpedido["ped"][idp] = {}; } localpedido["ped"][idp].qt = tmpqt; SaveLocalStorage(); PlaySound(); } clearTimeout(drawpedidostimer); drawpedidostimer = setTimeout(drawpedidos, 1000); } function renderkcantidadvalue(idp) { ori = dimecantidad(idp); if(ori==0) { $(".spincantidadlist" + idp).addClass('hidezero'); } else{ $(".spincantidadlist" + idp).removeClass('hidezero'); } $(".kcantidadlist" + idp).html(formatprice(ori, 0)); $(".kcantidadvalue").html(formatprice(ori, 0)); unidades = aproduct[idp]['u1']; kunidades = ori / unidades; $(".unidades").html(formatprice(kunidades, 0) + " paq."); drawcantidadpedida(); } function checkKey(e) { e = e || window.event; if (e.keyCode == '38') { // up arrow } else if (e.keyCode == '40') { // down arrow } else if (e.keyCode == '37') { moveproduct(-1); } else if (e.keyCode == '39') { moveproduct(1); } } function showgallery(obj) { iszoom = 1; //$('#bodyzoom2').html(htmlres); //$('#imgzoom2').attr("src", $(this).attr('data-img')); //$('#transition2').show(); /* jsonxx = [{ "src": '../static/img/1.jpg', 'thumb': '../static/img/thumb-1.jpg', 'subHtml': '

Fading Light

Classic view from Rigwood Jetty on Coniston Water an old archive shot similar to an old post but a little later on.

' }, { 'src': '../static/img/2.jpg', 'thumb': '../static/img/thumb-2.jpg', 'subHtml': "

Bowness Bay

A beautiful Sunrise this morning taken En-route to Keswick not one as planned but I'm extremely happy I was passing the right place at the right time....

" }, { 'src': '../static/img/3.jpg', 'thumb': '../static/img/thumb-3.jpg', 'subHtml': "

Coniston Calmness

Beautiful morning

" }]; */ jsonxx = []; timg = obj.attr("src"); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); jsonxx.push({ src: timg, 'thumb': timg }); //$('#zoomimg2').lightGallery(); obj.lightGallery({ dynamic: true, share: false, download: false, thumbnail: true, autoplayControls: false, dynamicEl: jsonxx }); obj.on('onCloseAfter.lg', function (event, index, fromTouch, fromThumb) { iszoom = 0; }); event.stopPropagation(); /*event.preventDefault(); event.stopImmediatePropagation(); return false; */ } function headercartera(curcartera) { var htmlres = ""; htmlres += ''; if (curcartera == 0) { htmlres += ''; } else if (curcartera == 2) { htmlres += ''; } /*htmlres += '';*/ htmlres += ''; htmlres += ''; return htmlres; } function footercartera(valor, moneda, curcartera) { var htmlres = ""; htmlres += ''; /*htmlres += ''; htmlres += ''; htmlres += '';*/ if (curcartera == 0) { htmlres += ''; } else if (curcartera == 2) { htmlres += ''; } //htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; if (curcartera == 0 && moneda == '€') { htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; } else if (curcartera == 0 && moneda == '£') { htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; } if (curcartera == 2 && moneda == '€') { htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; } else if (curcartera == 2 && moneda == '£') { htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; htmlres += ''; } htmlres += ""; htmlres += '
' + lan(73) + '' + lan(82) + '' + lan(103) + '' + lan(74) + 'Dto. EspDto. Pp' + lan(76) + '' + lan(75) + 'Fecha Recogida
' + 'Fecha' + '' + 'Vencimiento' + '' + 'Factura' + 'Dto. EspDto. Pp' + 'Importe' + '
' + 'Total Amahogar' + '' + 'Total Plasticforte' + '' + formatprice(parseFloat(valor), 2) + ' ' + moneda + ''; htmlres += '
' + 'BBVA, S.A.' + '' + 'IBAN: ES75 0182 5465 9102 0153 9033' + '' + 'SWIFT CODE: BBVAESMMXXX' + '
' + 'CAIXABANK, S.A.' + '' + 'IBAN: ES28 2100 2834 9002 0009 9017' + '' + 'SWIFT CODE: CAIXESBBXXX' + '
' + 'CAIXABANK, S.A.' + '' + 'IBAN: ES88 2100 8604 0772 0030 7287' + '' + 'SWIFT CODE: CAIXESBBXXX' + '
' + 'BBVA, S.A.' + '' + 'IBAN: ES27 0182 5465 9802 0153 7808' + '' + 'SWIFT CODE: BBVAESMMXXX' + '
' + 'CAIXABANK, S.A.' + '' + 'IBAN: ES35 2100 2834 9702 0009 9130' + '' + 'SWIFT CODE: CAIXESBBXXX' + '
' + 'CAIXABANK, S.A.' + '' + 'IBAN: ES54 2100 8604 0272 0030 7174' + '' + 'SWIFT CODE: CAIXESBBXXX' + '
'; return htmlres; } function localStorageSpace() { var allStrings = ''; for (var key in window.localStorage) { if (window.localStorage.hasOwnProperty(key)) { allStrings += window.localStorage[key]; } } return allStrings ? formatprice((3 + ((allStrings.length * 16) / (8 * 1024))), 2) + ' KB' : 'Empty (0 KB)'; }; function testLocalStorage() { var timeStart = Date.now(); var timeEnd, countKey, countValue, amountLeft, itemLength; var occupied = leftCount = 3; //Shurav's comment on initial overhead //create localStorage entries until localStorage is totally filled and browser issues a warning. var i = 0; while (!error) { try { //length of the 'value' was picked to be a compromise between speed and accuracy, // the longer the 'value' the quicker script and result less accurate. This one is around 2Kb localStorage.setItem('testKey' + i, '11111111112222222222333333333344444444445555555555666661111111111222222222233333333334444444444555555555566666'); } catch (e) { var error = e; } i++; } //if the warning was issued - localStorage is full. if (error) { //iterate through all keys and values to count their length for (var i = 0; i < localStorage.length; i++) { countKey = localStorage.key(i); countValue = localStorage.getItem(localStorage.key(i)); itemLength = countKey.length + countValue.length; //if the key is one of our 'test' keys count it separately if (countKey.indexOf("testKey") !== -1) { leftCount = leftCount + itemLength; } //count all keys and their values occupied = occupied + itemLength; } ; //all keys + values lenght recalculated to Mb occupied = (((occupied * 16) / (8 * 1024)) / 1024).toFixed(2); //if there are any other keys then our 'testKeys' it will show how much localStorage is left amountLeft = occupied - (((leftCount * 16) / (8 * 1024)) / 1024).toFixed(2); //iterate through all localStorage keys and remove 'testKeys' Object.keys(localStorage).forEach(function (key) { if (key.indexOf("testKey") !== -1) { localStorage.removeItem(key); } }); } //calculate execution time var timeEnd = Date.now(); var time = timeEnd - timeStart; //create message var message = 'Finished in: ' + time + 'ms \n total localStorage: ' + occupied + 'Mb \n localStorage left: ' + amountLeft + "Mb"; //put the message on the screen document.getElementById('testLocalStorage').innerText = message; //this works with Chrome,Safari, Opera, IE //document.getElementById('scene').textContent = message; //Required for Firefox to show messages }