b0y-101 Mini Shell


Current Path : E:/www/pl/media/sigplus/engines/boxplusx/js/
File Upload :
Current File : E:/www/pl/media/sigplus/engines/boxplusx/js/boxplusx.min.js

(function(){/*
boxplusx: a versatile lightweight pop-up window engine
@author  Levente Hunyadi
@version 1.0
@remarks Copyright (C) 2009-2017 Levente Hunyadi
@remarks Licensed under GNU/GPLv3, see http://www.gnu.org/licenses/gpl-3.0.html
@see     http://hunyadi.info.hu/projects/boxplusx
*/
'use strict';var qa="function"==typeof Object.defineProperties?Object.defineProperty:function(h,t,v){h!=Array.prototype&&h!=Object.prototype&&(h[t]=v.value)};function ra(h){h=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,h];for(var t=0;t<h.length;++t){var v=h[t];if(v&&v.Math==Math)return v}throw Error("Cannot find global object");}var sa=ra(this);
function ta(h,t){if(t){var v=sa;h=h.split(".");for(var q=0;q<h.length-1;q++){var y=h[q];y in v||(v[y]={});v=v[y]}h=h[h.length-1];q=v[h];t=t(q);t!=q&&null!=t&&qa(v,h,{configurable:!0,writable:!0,value:t})}}var ua="function"==typeof Object.assign?Object.assign:function(h,t){for(var v=1;v<arguments.length;v++){var q=arguments[v];if(q)for(var y in q)Object.prototype.hasOwnProperty.call(q,y)&&(h[y]=q[y])}return h};ta("Object.assign",function(h){return h||ua});
var va={id:null,slideshow:0,autostart:!1,loop:!1,preferredWidth:800,preferredHeight:600,useDevicePixelRatio:!0,navigation:"bottom",controls:"below",captions:"below",contextmenu:!0,metadata:!1,dir:"ltr"};
function wa(h,t){function v(){q=!1}var q=!1,y=0,O=0,T=["auto","scroll"];h.addEventListener("mousedown",function(D){var G=window.getComputedStyle(t);if(0<=T.indexOf(G.overflowX)||0<=T.indexOf(G.overflowY))y=D.clientX,O=D.clientY,q=!0,D.preventDefault()});h.addEventListener("mouseup",v);h.addEventListener("mouseout",v);h.addEventListener("mousemove",function(D){q&&(t.scrollLeft-=D.clientX-y,t.scrollTop-=D.clientY-O,y=D.clientX,O=D.clientY)})}
(function(){function h(a){this.T(a)}function t(){}function v(a){var b={};1<a.length&&a.substr(1).split("&").forEach(function(c){var d=c.indexOf("="),f=0<=d?c.substr(d+1):"";b[decodeURIComponent(0<=d?c.substr(0,d):c)]=decodeURIComponent(f)});return b}function q(a){return document.createElement(a)}function y(a){var b=q("a");b.href=a;a=b.hash.indexOf("!");return{protocol:b.protocol,host:b.host,hostname:b.hostname,port:b.port,pathname:b.pathname,search:b.search,W:v(b.search),hash:b.hash,id:b.hash.substr(1,
(0<=a?a:b.hash.length)-1),V:v(b.hash.substr(Math.max(0,a)))}}function O(a){a=y(a);var b=y(location.href);return a.protocol===b.protocol&&a.host===b.host&&a.pathname===b.pathname&&a.search===b.search}function T(a){return Object.keys(a).map(function(b){return encodeURIComponent(b)+"="+encodeURIComponent(a[b])}).join("&")}function D(a,b){a=a||{};for(var c in JSON.parse(JSON.stringify(b)))Object.prototype.hasOwnProperty.call(a,c)||(a[c]=b[c]);return a}function G(a,b){return a.hasAttribute(b)?a.getAttribute(b):
null}function w(a,b){b?a.classList.remove("boxplusx-hidden"):a.classList.add("boxplusx-hidden")}function J(a){return!a.classList.contains("boxplusx-hidden")}function u(a,b,c){var d=q("div");d.classList.add("boxplusx-"+a);b&&d.classList.add("boxplusx-hidden");c&&c.forEach(function(f){d.appendChild(f)});return d}function W(a){return a.map(function(b){return u(b)})}function xa(a,b){if(/\.jpe?g$/i.test(a)){var c=new XMLHttpRequest;c.open("get",a);c.responseType="blob";c.onload=function(){ya(c.response,
b)};c.onerror=function(){b(-1)};c.send()}else b(-2)}function ya(a,b){var c=new FileReader;c.onload=function(){var d=new DataView(c.result);if(65496!=d.getUint16(0))b(-2);else{for(var f=d.byteLength,e=2;e<f;){var g=d.getUint16(e);e+=2;if(65505==g){if(1165519206!=d.getUint32(e+=2)){b(-1);return}g=18761==d.getUint16(e+=6);e+=d.getUint32(e+4,g);var k=d.getUint16(e,g);e+=2;for(var n=0;n<k;n++)if(274==d.getUint16(e+12*n,g))return b(d.getUint16(e+12*n+8,g))}else if(65280!=(g&65280))break;else e+=d.getUint16(e)}return b(-1)}};
c.readAsArrayBuffer(a)}function za(a){return[].slice.call(a).map(function(b){a:{if(null!==b&&"a"===b.tagName.toLowerCase()){var c=G(b,"data-title");if(null!==c)break a;if(c=b.querySelector("img"))if(c=G(c,"alt"),null!==c)break a}c=""}a:{if(null!==b&&"a"===b.tagName.toLowerCase()){var d=G(b,"data-summary");if(null!==d)break a;d=G(b,"title");if(null!==d)break a}d=""}c===d&&(d="");var f="";null!==b&&"a"===b.tagName.toLowerCase()&&(f=b.href);var e=b.dataset&&b.dataset.download||"",g;b=b.getElementsByTagName("img");
0<b.length&&(g=b[0]);return{url:f,image:g,title:c,description:d,download:e}})}function H(a,b){a=this.f.querySelectorAll(".boxplusx-"+a);for(var c=0;c<a.length;++c)b(a[c])}function X(a,b){var c=this;Object.keys(b).forEach(function(d){H.call(c,d,function(f){f.addEventListener(a,b[d].bind(c),!1)})})}function da(a){switch(a){case 0:case 1:return!1}return!0}function I(a){function b(d){switch(d){case 0:return"unavailable";case 1:return"image";case 2:return"video";case 3:return"embed";case 4:return"document";
case 5:return"frame";default:return"none"}}var c=this.s.classList;c.remove("boxplusx-"+b(this.D));c.remove("boxplusx-interactive");this.D=a;c.add("boxplusx-"+b(a));da(a)&&c.add("boxplusx-interactive")}function Y(){var a=this,b=E.call(this),c=0==b,d=this.i,f=b>=d.length-1,e=this.a.loop&&!(c&&f),g=0<this.a.slideshow;H.call(this,"previous",function(k){w(k,e||!c)});H.call(this,"next",function(k){w(k,e||!f)});H.call(this,"start",function(k){w(k,g&&!a.l&&!f)});H.call(this,"stop",function(k){w(k,g&&a.l)});
H.call(this,"download",function(k){w(k,!!d[b].download)});H.call(this,"metadata",function(k){var n;if(n=a.a.metadata)n=!!a.f.querySelector(".boxplusx-detail");w(k,n)})}function ea(){w(this.F,(this.c>this.v.clientWidth||this.g>this.v.clientHeight)&&!da(this.D));var a=this.F.classList;this.m?a.remove("boxplusx-collapse"):a.add("boxplusx-collapse");a=this.F.classList;this.m?a.add("boxplusx-expand"):a.remove("boxplusx-expand")}function fa(){Z.call(this);aa.call(this);I.call(this,-1);for(var a=this.b;a.hasChildNodes();)a.removeChild(a.lastChild);
w(this.C,!1);w(this.h,!1)}function E(){return this.j[this.j.length-1]}function K(a,b,c){function d(){J(k.h)&&(n.setProperty("max-width",g),Z.call(k),w(k.H,!1),E.call(k)>=k.i.length-1&&(k.l=!1),Y.call(k),w(k.C,!0),ha.call(k),ea.call(k),k.l&&ia.call(k))}this.B=a;var f=window.getComputedStyle(this.f);b=b||f.getPropertyValue("width");c=c||f.getPropertyValue("height");Z.call(this);w(this.C,!0);var e=this.v.classList;e.remove("boxplusx-fixedaspect");e.remove("boxplusx-draggable");1===a||2===a?(a=this.K.style,
a.setProperty("width",this.c+"px"),a.setProperty("padding-top",100*this.g/this.c+"%"),e.add("boxplusx-fixedaspect")):4===a?e.add("boxplusx-draggable"):3===a&&(a=this.s.style,a.setProperty("width",this.c+"px"),a.setProperty("max-height",this.g+"px"));ja.call(this);a=f.getPropertyValue("width");e=f.getPropertyValue("height");var g=f.getPropertyValue("max-width"),k=this,n=this.f.style;b!=a||c!=e?(w(this.C,!1),n.removeProperty("max-width"),n.setProperty("width",b),n.setProperty("height",c),this.f.classList.add("boxplusx-animation"),
f=Math.max.apply(null,f.getPropertyValue("transition-duration").split(",").map(function(A){var r=parseFloat(A);return/\ds$/.test(A)?1E3*r:r})),window.setTimeout(d,f)):d();n.setProperty("width",a);n.setProperty("height",e)}function Z(){this.f.classList.remove("boxplusx-animation");var a=this.f.style;a.removeProperty("width");a.removeProperty("height")}function ka(a,b,c){function d(A){c(A);return f.f.offsetHeight}var f=this,e=this.h.clientHeight,g=d(b);if(g<=e)return b;g=d(a);if(g>=e)return c(b),b;
for(var k=1;10>k;++k){g=(a+b)/2|0;var n=d(g);n<e?(a=g,g=n):(b=g,g=n)}c(a);return a}function ja(){if(2===this.B){var a=this.f.style;ka.call(this,0,1E3,function(d){a.setProperty("max-width",d/10+"%")})}else if(4===this.B||3===this.B){var b=this.s.style;b.removeProperty("max-height");var c=ka.call(this,0,window.innerHeight,function(d){b.setProperty("height",d+"px")});b.removeProperty("height");b.setProperty("max-height",Math.min(c,this.g)+"px")}}function Aa(a,b){var c=a.src;if(/^file:/.test(c))b(-3);
else{var d=window.EXIF;this.a.metadata&&d?d.getData(a,function(){var f=0,e=Object.assign({},a.iptcdata,a.exifdata);if(0<Object.keys(e).length){var g=e;(e=e.Orientation)&&(f=+e)}b(f,g)}):xa(c,function(f){b(f)})}}function ba(a){var b=this,c=this.i[a];this.j.push(a);var d=window.getComputedStyle(this.f),f=d.getPropertyValue("width"),e=d.getPropertyValue("height");U.call(this);w(this.H,!0);var g=c.title,k=c.description;c=c.url;d=y(c);var n=d.pathname,A=Object.assign({},d.W,d.V);this.c=parseInt(A.width,
10)||this.a.preferredWidth;this.g=parseInt(A.height,10)||this.a.preferredHeight;if(O(c))(a=document.getElementById(d.id?d.id:A.target))?(a=a.cloneNode(!0),P.call(this,a,g,k),I.call(this,4),K.call(this,3,f,e)):ca.call(this);else if(/\.(gif|jpe?g|png|svg)$/i.test(n)){var r=q("img");r.addEventListener("load",function(){Aa.call(b,r,function(B,l){var L=document.createDocumentFragment(),C=q("div"),F=q("div");0<B&&F.classList.add("boxplusx-orientation-"+B);var m=F.style;m.setProperty("background-image",
'url("'+r.src+'")');var p=b.a.useDevicePixelRatio?window.devicePixelRatio||1:1,z=Math.floor(r.naturalHeight/p);p=Math.floor(r.naturalWidth/p);5<=B&&8>=B?(b.c=z,b.g=p,m.setProperty("width",100*p/z+"%"),m.setProperty("height",100*z/p+"%")):(b.c=p,b.g=z,m.removeProperty("width"),m.removeProperty("height"));b.m||(B=C.style,B.setProperty("width",b.c+"px"),B.setProperty("height",b.g+"px"));C.appendChild(F);L.appendChild(C);if(l){C=u("detail",!0);F=q("table");B=Object.keys(l);m=B.length;B.sort();for(z=0;z<
m;++z){p=B[z];var M=q("tr"),la=q("td");la.innerText=p;var ma=q("td");ma.innerText=l[p];M.appendChild(la);M.appendChild(ma);F.appendChild(M)}C.appendChild(F);L.appendChild(C)}P.call(b,L,g,k);b.I.style.setProperty("max-width",b.c+"px");I.call(b,1);K.call(b,b.m?2:4,f,e)})},!1);r.addEventListener("error",ca.bind(this),!1);r.src=c;a<b.i.length-1&&(a=b.i[a+1].url,c=y(a),/\.(gif|jpe?g|png|svg)$/i.test(c.pathname)&&(q("img").src=a))}else if(/\.(mov|mpe?g|mp4|ogg|webm)$/i.test(n)){var x=q("video"),N=u("play"),
Q=u("video",!1,[x,N]);x.addEventListener("loadedmetadata",function(){P.call(b,Q,g,k);I.call(b,2);b.c=x.videoWidth;b.g=x.videoHeight;K.call(b,2,f,e)},!1);x.addEventListener("error",ca.bind(this),!1);x.src=c;N.addEventListener("click",function(){w(N,!1);x.controls=!0;x.play()})}else/\.pdf$/.test(n)?(a=q("embed"),a.src=c,a.type="application/pdf",P.call(b,a,g,k),I.call(b,3),K.call(b,2,f,e)):(a=/^https?:\/\/(?:www\.)youtu(?:\.be|be\.com)\/(?:embed\/|watch\?v=|v\/|)([-_0-9A-Z]{11,})/i.exec(c),null!==a?
na.call(this,"https://www.youtube.com/embed/"+a[1]+"?"+T({rel:"0",controls:"1",X:"0"}),g,k):na.call(this,c,g,k))}function aa(){for(var a=this.s;a.hasChildNodes();)a.removeChild(a.lastChild);a=this.f.style;var b=this.K.style,c=this.s.style;b.removeProperty("padding-top");b.removeProperty("width");c.removeProperty("width");a.removeProperty("max-width");c.removeProperty("max-height");this.M.innerHTML="";this.L.innerHTML=""}function P(a,b,c){aa.call(this);this.s.appendChild(a);this.I.style.removeProperty("max-width");
this.M.innerHTML=b;this.L.innerHTML=c}function ca(){aa.call(this);I.call(this,0);K.call(this,2)}function na(a,b,c){var d=this,f=q("iframe");f.width=""+this.c;f.height=""+this.g;f.src=a;P.call(this,f,b,c);var e=!1;f.addEventListener("load",function(){e||(e=!0,I.call(d,5),K.call(d,1))},!1)}function ia(){U.call(this);this.w=window.setTimeout(this.A.bind(this),this.a.slideshow)}function U(){this.w&&(window.clearTimeout(this.w),this.w=null)}function R(a){switch(this.a.dir){case "rtl":return a.offsetParent.offsetWidth-
a.offsetWidth-a.offsetLeft;default:return a.offsetLeft}}function V(a,b){var c=this.b.style;c.setProperty("rtl"==this.a.dir?"right":"left",-a+"px");c.setProperty("transition-duration",0<b?5*b+"ms":"")}function ha(){if(J(this.u)){for(var a=0;a<this.b.childNodes.length;++a)this.b.childNodes[a].classList.remove("boxplusx-current");a=E.call(this);var b=Math.max(this.b.offsetWidth-this.u.offsetWidth,0),c=this.b.childNodes[a];c.classList.add("boxplusx-current");a=-R.call(this,this.b);var d=R.call(this,c);
b=Math.min(b,d);a>b&&(a=b);b=Math.max(0,d-this.u.offsetWidth+c.offsetWidth);a<b&&(a=b);V.call(this,a,0)}}function oa(){var a=Math.max(this.b.offsetWidth-this.u.offsetWidth,0),b=a- -R.call(this,this.b);V.call(this,0,a-b)}function pa(){var a=Math.max(this.b.offsetWidth-this.u.offsetWidth,0),b=-R.call(this,this.b);V.call(this,a,a-b)}function S(){V.call(this,-R.call(this,this.b),0)}window.BoxPlusXDialog=h;t.prototype.O="boxplusx";h.prototype.bind=function(a){function b(f){c.P(d,f)}var c=this;a=[].slice.call(a);
var d=za(a);a.forEach(function(f,e){f.addEventListener("click",function(g){g.preventDefault();b(e)},!1)});return b};h.prototype.T=function(a){function b(){if(l.c>l.v.clientWidth||l.g>l.v.clientHeight){l.m=!l.m;var m=E.call(l);ba.call(l,m)}}this.a=D(a,va);a=u("aspect");var c=u("content"),d=u("expander"),f=u("navbar"),e=u("navigation",!1,[f].concat(W(["rewind","forward"]))),g=u("viewport",!1,[a,c,d].concat(W(["previous","next"]))),k=u("controls",!1,W("previous next close start stop download metadata".split(" "))),
n=u("title"),A=u("description"),r=u("caption",!1,[n,A]),x=u("wrapper",!1,[g,e]);x=u("wrapper",!1,[x,k]);x=u("wrapper",!0,[x,r]);var N=u("progress",!0),Q=u("dialog",!1,[x,N]),B=u("container",!0,[Q]);this.a.id&&(B.id=this.a.id);r.classList.add("boxplusx-"+this.a.captions);k.classList.add("boxplusx-"+this.a.controls);e.classList.add("boxplusx-"+this.a.navigation);document.body.appendChild(B);this.h=B;this.f=Q;this.C=x;this.v=g;this.I=r;this.M=n;this.L=A;this.K=a;this.s=c;this.F=d;this.u=e;this.b=f;this.H=
N;this.i=[];this.j=[];this.w=null;this.l=!1;this.B=2;this.c=this.a.c;this.g=this.a.g;this.D=-1;this.m=!0;var l=this;this.h.addEventListener("click",function(m){m.target===l.h&&l.close.call(l)},!1);X.call(this,"click",{previous:this.G,next:this.A,close:this.close,start:this.start,stop:this.S,metadata:this.U,download:this.download,rewind:S,forward:S});X.call(this,"mouseover",{rewind:oa,forward:pa});X.call(this,"mouseout",{rewind:S,forward:S});this.a.contextmenu||Q.addEventListener("contextmenu",function(m){m.preventDefault()});
var L=this.a.dir;this.h.dir=L;new wa(g,c);d.addEventListener("click",b);g.addEventListener("dblclick",b);c.addEventListener("mousewheel",function(m){var p="hidden"!=window.getComputedStyle(c).overflowY,z=c.scrollHeight-c.clientHeight;if(p&&0<z){p=c.scrollTop;var M=m.deltaY;(p===z&&0<M||0===p&&0>M)&&m.preventDefault()}});window.addEventListener("keydown",function(m){var p;if(p=J(l.h)){p=m.target;var z=["input","select","textarea"];p=!(null!==p&&0<=z.indexOf(p.tagName.toLowerCase()))}if(p){p=[27,36,
35];switch(L){case "ltr":p.push(37,39);break;case "rtl":p.push(39,37)}p=p.indexOf(m.which||m.keyCode);0<=p&&([l.close,l.J,l.N,l.G,l.A][p].call(l),m.preventDefault())}},!1);var C,F=0;g.addEventListener("touchstart",function(m){C=m.changedTouches[0].pageX});g.addEventListener("touchend",function(m){var p=(new Date).getTime(),z=p-F;0<z&&500>z?m.preventDefault():l.m&&(m=m.changedTouches[0].pageX,50<=m-C?l.G.call(l):50<=C-m&&l.A.call(l));F=p});f.addEventListener("touchstart",function(m){C=m.changedTouches[0].pageX;
S.call(l)});f.addEventListener("touchend",function(m){m=m.changedTouches[0].pageX;50<=m-C?oa.call(l):50<=C-m&&pa.call(l)});window.addEventListener("popstate",function(){if(J(l.h))if(l.j.pop(),0<l.j.length){window.history.pushState({O:"boxplusx"},"");var m=E.call(l);l.j.pop();ba.call(l,m)}else fa.call(l)},!1);window.addEventListener("resize",function(){J(l.h)&&(ja.call(l),ha.call(l),ea.call(l))})};h.prototype.P=function(a,b){this.i=a;var c=this,d=1<a.length&&"hidden"!=this.a.navigation;w(this.u,d);
d&&a.forEach(function(f,e){var g=u("aspect"),k=u("navimage"),n=u("navitem",!1,[g,k]),A=!0;n.addEventListener("touchstart",function(){c.b.style.getPropertyValue("transition-duration")&&(A=!1)});n.addEventListener("click",function(){A&&c.o.call(c,e);A=!0});var r=f.image;r&&(f=function(){var x=g.style;x.setProperty("width",r.naturalWidth+"px");x.setProperty("padding-top",100*r.naturalHeight/r.naturalWidth+"%");k.style.setProperty("background-image",'url("'+r.src+'")')},r.src&&r.complete?f():(r.addEventListener("load",
f),r.preloader&&(f=r.preloader,f.load&&f.load())));k.innerText=e+1+"";c.b.appendChild(n)});this.R(b)};h.prototype.R=function(a){this.j=[];window.history.state&&"boxplusx"===window.history.state.O?window.history.replaceState(new t,""):window.history.pushState(new t,"");this.a.autostart&&0<this.a.slideshow&&(this.l=!0);w(this.h,!0);w(this.H,!0);this.o(a)};h.prototype.close=function(){U.call(this);fa.call(this);this.j=[];window.history.go(-1)};h.prototype.o=function(a){var b=E.call(this);a!=b&&ba.call(this,
a)};h.prototype.J=function(){this.o(0)};h.prototype.G=function(){var a=E.call(this);0<a?this.o(a-1):this.a.loop&&this.N()};h.prototype.A=function(){var a=E.call(this);a<this.i.length-1?this.o(a+1):this.a.loop&&this.J()};h.prototype.N=function(){this.o(this.i.length-1)};h.prototype.start=function(){0<this.a.slideshow&&(this.l=!0,ia.call(this),Y.call(this))};h.prototype.S=function(){0<this.a.slideshow&&(this.l=!1,U.call(this),Y.call(this))};h.prototype.U=function(){var a=this.f.querySelector(".boxplusx-detail");
a&&w(a,!J(a))};h.prototype.download=function(){var a=E.call(this),b=q("a");b.href=this.i[a].download;document.body.appendChild(b);b.click();document.body.removeChild(b)};h.discover=function(a,b,c){b=b||"boxplusx";var d=new h(c),f=function(e){var g={};[].forEach.call(e,function(k){var n=k.getAttribute("rel");Object.prototype.hasOwnProperty.call(g,n)||(g[n]=[]);g[n].push(k)});return g}(document.querySelectorAll("a[href][rel^="+b+"]:not([rel="+b+"])"));Object.keys(f).forEach(function(e){d.bind(f[e])});
[].filter.call(document.querySelectorAll("a[href][rel="+b+"]"),function(e){d.bind([e])});a||[].filter.call(document.querySelectorAll("a[href]:not([rel^="+b+"])"),function(e){return/\.(gif|jpe?g|png|svg|mov|mpe?g|ogg|webm)$/i.test(e.pathname)&&!e.target}).forEach(function(e){d.bind([e])})}})();}).call(this);

Copyright © 2019 by b0y-101