/*! * Copyright 2008-2022 | Fabrice Creuzot (luigifab) * https://www.luigifab.fr/apijs - 6.8.2 * This program is free software, you can redistribute it or modify * it under the terms of the GNU General Public License (GPL). */ Array.prototype.has||(Array.prototype.has=function(t,e){if(t instanceof Array){for(e in t)if(t.hasOwnProperty(e)&&this.has(t[e]))return!0}else for(e in this)if(this.hasOwnProperty(e)&&this[e]===t)return!0;return!1}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,e,i){for(e=e||window,i=0;i1+e.scroll)&&(e.scroll=i,s=0=i.body.offsetHeight-1||!e&&i.defaultView.pageYOffset<=0)&&(t.preventDefault(),t.stopPropagation())},this.onKey=function(t){var e=apijs.dialog,i=e.media;e.has("progress","waiting","lock")?(t.ctrlKey&&[81,87,82,115,116].has(t.keyCode)||t.altKey&&115===t.keyCode||[27,116].has(t.keyCode))&&t.preventDefault():e.has("photo","video")&&122===t.keyCode?(t.preventDefault(),apijs.requestFullscreen(e.t1)):e.has("slideshow")?27===t.keyCode?(t.preventDefault(),e.actionClose()):35===t.keyCode?(t.preventDefault(),apijs.slideshow.actionLast()):36===t.keyCode?(t.preventDefault(),apijs.slideshow.actionFirst()):37===t.keyCode?(t.preventDefault(),apijs.slideshow.actionPrev()):39===t.keyCode&&(t.preventDefault(),apijs.slideshow.actionNext()):27===t.keyCode&&(t.preventDefault(),e.actionClose()),e.has("video")&&!e.has("videoiframe")&&(32===t.keyCode||80===t.keyCode?(t.preventDefault(),[1,2].has(i.networkState)&&(i.ended||i.paused?i.play():i.pause())):38===t.keyCode||33===t.keyCode?(t.preventDefault(),[1,2].has(i.networkState)&&i.duration!==1/0&&!isNaN(i.duration)&&i.currentTime/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.t2.appendChild(this.a)),0/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.a.querySelectorAll("a.popup").forEach(function(t){t.addEventListener("click",apijs.openTab)}),this.t2.appendChild(this.a)),this},this.htmlBtnOk=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","confirm"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(102)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnConfirm=function(t,e){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type",t),this.b.setAttribute("class","confirm"),"submit"!==t&&this.b.setAttribute("onclick",e),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(104)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","cancel"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(103)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnNavigation=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","navigation noplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","prev"),this.b.setAttribute("id","apijsPrev"),this.b.setAttribute("onclick","apijs.slideshow.actionPrev();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","next"),this.b.setAttribute("id","apijsNext"),this.b.setAttribute("onclick","apijs.slideshow.actionNext();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnClose=function(t){return!1!==t&&(this.a=document.createElement("div"),this.a.setAttribute("class","close noplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","close"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(105)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a)),this},this.htmlUpload=function(t,e){return this.a=document.createElement("div"),this.a.setAttribute("class","btns upload"),this.b=document.createElement("input"),this.b.setAttribute("type","file"),this.b.setAttribute("name",t),this.b.setAttribute("id","apijsFile"),e&&this.b.setAttribute("multiple","multiple"),this.b.setAttribute("onchange","apijs.upload.actionChoose(this);"),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","browse"),this.b.setAttribute("onclick","this.previousSibling.click();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(e?109:108)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("div"),this.b.setAttribute("class","filenames scrollable"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgProgress=function(){return this.a=document.createElement("span"),this.a.setAttribute("class","info"),this.t2.appendChild(this.a),this.a=document.createElement("svg"),this.a.setAttribute("id","apijsProgress"),this.b=document.createElement("rect"),this.b.setAttribute("class","auto"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgLoader=function(t){return this.a=document.createElementNS(this.ns,"svg"),this.a.setAttribute("class","loader"),this.b=document.createElementNS(this.ns,"path"),!1!==t&&this.b.setAttribute("style","opacity:0;"),this.b.setAttribute("d","M75.4 126.63a11.43 11.43 0 0 1-2.1-22.65 40.9 40.9 0 0 0 30.5-30.6 11.4 11.4 0 1 1 22.27 4.87h.02a63.77 63.77 0 0 1-47.8 48.05v-.02a11.38 11.38 0 0 1-2.93.37z"),this.c=document.createElementNS(this.ns,"animateTransform"),this.c.setAttribute("attributeName","transform"),this.c.setAttribute("type","rotate"),this.c.setAttribute("from","0 64 64"),this.c.setAttribute("to","360 64 64"),this.c.setAttribute("dur","5s"),this.c.setAttribute("repeatCount","indefinite"),this.b.appendChild(this.c),this.c=document.createElementNS(this.ns,"animate"),this.c.setAttribute("attributeName","opacity"),this.c.setAttribute("to","1"),this.c.setAttribute("dur","0.01s"),this.c.setAttribute("begin","1s"),this.c.setAttribute("fill","freeze"),!1!==t&&this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlMedia=function(t,e,i,s){var a;return this.a=document.createElement("dl"),this.a.setAttribute("class","media"),this.b=document.createElement("dt"),this.has("photo")?(this.media=document.createElement("img"),this.media.setAttribute("alt",s.replace('"',""))):0'+(e+1)+"":"")+''+t.name+''+apijs.i18n.translate(166,i)+"","*"===this.exts.join()||this.exts.has(t.name.slice(t.name.lastIndexOf(".")+1).toLowerCase())?t.size>1048576*this.onemax?i+=''+apijs.i18n.translate(168)+"":t.size<=0?i+=''+apijs.i18n.translate(169)+"":(i+="",this.files.push(t)):i+=''+apijs.i18n.translate(167)+"",s.push(""+i+""),a+=t.size/1048576},this),0=this.allmax&&s.push(''+apijs.i18n.translate(166,apijs.formatNumber(a))+''+apijs.i18n.translate(168)+""),apijs.html("div.filenames").innerHTML=""+s.join("")+"
",apijs.html("div.filenames .err")?e.setAttribute("disabled","disabled"):(e.removeAttribute("disabled"),e.focus()))},this.actionConfirm=function(){var s,e,t;return 0=this.end+2?(this.end=r,0<(e=Math.floor(100*t.loaded/t.total))&&e<100&&(this.updateTitle(e),r=100*(n=r-this.start)/e+10,24