diff --git a/css/elfinder.full.css b/css/elfinder.full.css index 5ca4468f4d..ecc25ad877 100644 --- a/css/elfinder.full.css +++ b/css/elfinder.full.css @@ -1,6 +1,6 @@ /*! * elFinder - file manager for web - * Version 2.1.54 (2.1-src Nightly: 27fc9d5) (2020-03-18) + * Version 2.1.55 (2.1-src Nightly: c97a077) (2020-03-18) * http://elfinder.org * * Copyright 2009-2020, Studio 42 diff --git a/css/elfinder.min.css b/css/elfinder.min.css index db4f293b07..f984981cc2 100644 --- a/css/elfinder.min.css +++ b/css/elfinder.min.css @@ -1,6 +1,6 @@ /*! * elFinder - file manager for web - * Version 2.1.54 (2.1-src Nightly: 27fc9d5) (2020-03-18) + * Version 2.1.55 (2.1-src Nightly: c97a077) (2020-03-18) * http://elfinder.org * * Copyright 2009-2020, Studio 42 diff --git a/js/elfinder.full.js b/js/elfinder.full.js index e56d764ce3..a479208aca 100644 --- a/js/elfinder.full.js +++ b/js/elfinder.full.js @@ -1,6 +1,6 @@ /*! * elFinder - file manager for web - * Version 2.1.54 (2.1-src Nightly: 27fc9d5) (2020-03-18) + * Version 2.1.55 (2.1-src Nightly: c97a077) (2020-03-18) * http://elfinder.org * * Copyright 2009-2020, Studio 42 @@ -10717,7 +10717,7 @@ if (!window.cancelAnimationFrame) { * * @type String **/ -elFinder.prototype.version = '2.1.54 (2.1-src Nightly: 27fc9d5)'; +elFinder.prototype.version = '2.1.55 (2.1-src Nightly: c97a077)'; diff --git a/js/elfinder.min.js b/js/elfinder.min.js index baef0514db..efa2473d41 100644 --- a/js/elfinder.min.js +++ b/js/elfinder.min.js @@ -1,6 +1,6 @@ /*! * elFinder - file manager for web - * Version 2.1.54 (2.1-src Nightly: 27fc9d5) (2020-03-18) + * Version 2.1.55 (2.1-src Nightly: c97a077) (2020-03-18) * http://elfinder.org * * Copyright 2009-2020, Studio 42 @@ -10,7 +10,7 @@ data:{cmd:"parents",target:j},preventDefault:!0})),e.each(c(),function(e,t){l.push(a.request({data:{cmd:t.cmd,target:t.target},preventDefault:!0}))})),e.when.apply(e,l).fail(function(t,o){i=o&&200!=o.status,n&&e.inArray("errOpen",t)===-1?s.reject(t&&0!=o.status?t:void 0):(s.reject(t),a.parseError(t)&&a.request({data:{cmd:"open",target:a.lastDir("")||a.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}}))}).done(function(e){var n,i,o;if(e.cwd.compare&&r===e.cwd.compare)return s.reject();if(n={tree:[]},i=arguments.length,i>1)for(o=1;o0?a:a.charCodeAt(0):a>0?a:e.ui.keyCode[a],a&&!U[i]&&(U[i]={keyCode:a,altKey:e.inArray("ALT",r)!=-1,ctrlKey:e.inArray("CTRL",r)!=-1,shiftKey:e.inArray("SHIFT",r)!=-1,type:t.type||"keydown",callback:t.callback,description:t.description,pattern:i});return this},this.shortcuts=function(){var t=[];return e.each(U,function(e,n){t.push([n.pattern,u.i18n(n.description)])}),t},this.clipboard=function(t,n){var i=function(){return e.map(P,function(e){return e.hash})};return void 0!==t&&(P.length&&this.trigger("unlockfiles",{files:i()}),q={},P=e.map(t||[],function(e){var t=I[e];return t?(q[e]=!0,{hash:e,phash:t.phash,name:t.name,mime:t.mime,read:t.read,locked:t.locked,cut:!!n}):null}),this.trigger("changeclipboard",{clipboard:P.slice(0,P.length)}),n&&this.trigger("lockfiles",{files:i()})),P.slice(0,P.length)},this.isCommandEnabled=function(e,t){var n,i,a=u.cwd().volumeid||"";return!t&&u.searchStatus.state>1&&u.selected().length&&(t=u.selected()[0]),n=!t||a&&0===t.indexOf(a)?O.disabledFlip:u.option("disabledFlip",t),i=this._commands[e],!!i&&(i.alwaysEnabled||!n[e])},this.exec=function(t,n,i,a){var o,r;return!a&&this.commandMap[t]&&"hidden"!==this.commandMap[t]&&(t=this.commandMap[t]),"open"===t&&((this.searchStatus.state||this.searchStatus.ininc)&&this.trigger("searchend",{noupdate:!0}),this.autoSync("stop")),!a&&n&&(e.isArray(n)?n.length&&(a=n[0]):a=n),o=this._commands[t]&&this.isCommandEnabled(t,a)?this._commands[t].exec(n,i):e.Deferred().reject("errUnknownCmd"),r=typeof o,"object"===r&&o.promise||(u.debug("warning",'"cmd.exec()" should be returned "$.Deferred" but cmd "'+t+'" returned "'+r+'"'),o=e.Deferred().resolve()),this.trigger("exec",{dfrd:o,cmd:t,files:n,opts:i,dstHash:a}),o},this.dialog=function(t,n){var i=e("
").append(t).appendTo(m).elfinderdialog(n,u),a=i.closest(".ui-dialog"),o=function(){!i.data("draged")&&i.is(":visible")&&i.elfinderdialog("posInit")};return a.length&&(u.bind("resize",o),a.on("remove",function(){u.unbind("resize",o)})),i},this.toast=function(t){return e('
').appendTo(this.ui.toast).elfindertoast(t||{},this)},this.getUI=function(t){return t?this.ui[t]||e():m},this.getCommand=function(e){return void 0===e?this._commands:this._commands[e]},this.resize=function(t,n){var i,a=function(){for(var e=m.outerHeight(!0)-m.innerHeight(),t=m;t.get(0)!==W.get(0)&&(t=t.parent(),e+=t.outerHeight(!0)-t.innerHeight(),t.parent().length););return e},o=!m.hasClass("ui-resizable"),r=m.data("resizeSize")||{w:0,h:0},s={};W&&W.data("resizeTm")&&clearTimeout(W.data("resizeTm")),"string"==typeof n&&(i=n.match(/^([0-9.]+)%$/))&&(W&&W.length||(W=e(window)),W.data("marginToMyNode")||W.data("marginToMyNode",a()),W.data("fitToBaseFunc")||W.data("fitToBaseFunc",function(e){var t=W.data("resizeTm");e.preventDefault(),e.stopPropagation(),t&&cancelAnimationFrame(t),m.hasClass("elfinder-fullscreen")||u.UA.Mobile&&W.data("rotated")===u.UA.Rotated||(W.data("rotated",u.UA.Rotated),W.data("resizeTm",requestAnimationFrame(function(){u.restoreSize()})))}),"undefined"==typeof W.data("rotated")&&W.data("rotated",u.UA.Rotated),n=W.height()*(i[1]/100)-W.data("marginToMyNode"),W.off("resize."+u.namespace,W.data("fitToBaseFunc")),o&&W.on("resize."+u.namespace,W.data("fitToBaseFunc"))),m.css({width:t,height:parseInt(n)}),s.w=Math.round(m.width()),s.h=Math.round(m.height()),m.data("resizeSize",s),s.w===r.w&&s.h===r.h||(m.trigger("resize"),this.trigger("resize",{width:s.w,height:s.h}))},this.restoreSize=function(){this.resize(N,L)},this.show=function(){m.show(),this.enable().trigger("show")},this.hide=function(){this.options.enableAlways&&(T=z,z=!1),this.disable(),this.trigger("hide"),m.hide()},this.lazy=function(t,n,i){var a=function(e){var t,n=m.data("lazycnt");e?(t=!m.data("lazyrepaint")&&i.repaint,n?m.data("lazycnt",++n):m.data("lazycnt",1).addClass("elfinder-processing"),t&&m.data("lazyrepaint",!0).css("display")):n&&n>1?m.data("lazycnt",--n):(t=m.data("lazyrepaint"),m.data("lazycnt",0).removeData("lazyrepaint").removeClass("elfinder-processing"),t&&m.css("display"),u.trigger("lazydone"))},o=e.Deferred(),r=function(){o.resolve(t.call(o)),a(!1)};return n=n||0,i=i||{},a(!0),n?setTimeout(r,n):requestAnimationFrame(r),o},this.destroy=function(){m&&m[0].elfinder&&(m.hasClass("elfinder-fullscreen")&&u.toggleFullscreen(m),this.options.syncStart=!1,this.autoSync("forcestop"),this.trigger("destroy").disable(),P=[],F=[],D={},U={},e(window).off("."+y),e(document).off("."+y),u.trigger=function(){},e(K).remove(),m.off().removeData().empty().append(v.contents()).attr("class",v.attr("class")).attr("style",v.attr("style")),delete m[0].elfinder,e.each(g,function(t,n){e.each(n,function(e,t){m.on(t.type+(t.namespace?"."+t.namespace:""),t.selector,t.handler)})}))},this.autoSync=function(t){var n;if(u.options.sync>=1e3){if(r&&(clearTimeout(r),r=null,u.trigger("autosync",{action:"stop"})),"stop"===t?++X:X=Math.max(0,--X),X||"forcestop"===t||!u.options.syncStart)return;n=function(t){var i;O.syncMinMs&&(t||r)&&(t&&u.trigger("autosync",{action:"start"}),i=Math.max(u.options.sync,O.syncMinMs),r&&clearTimeout(r),r=setTimeout(function(){var t,a=!0,o=j;O.syncChkAsTs&&I[o]&&(t=I[o].ts)?u.request({data:{cmd:"info",targets:[o],compare:t,reload:1},preventDefault:!0}).done(function(e){var i;a=!0,e.compare&&(i=e.compare,i==t&&(a=!1)),a?u.sync(o).always(function(){i&&(I[o].ts=i),n()}):n()}).fail(function(t,a){var o=u.parseError(t);o&&0!=a.status?(u.error(o),Array.isArray(o)&&e.inArray("errOpen",o)!==-1&&u.request({data:{cmd:"open",target:u.lastDir("")||u.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}})):r=setTimeout(function(){n()},i)}):u.sync(j,!0).always(function(){n()})},i))},n(!0)}},this.insideWorkzone=function(e,t,n){var i=this.getUI("workzone").data("rectangle");return n=n||1,!(ei.left+i.width+n||ti.top+i.height+n)},this.toFront=function(t){var n=m.children(".ui-front").removeClass("elfinder-frontmost"),i=n.last();n.css("z-index",""),e(t).addClass("ui-front elfinder-frontmost").css("z-index",i.css("z-index")+1)},this.toHide=function(t,n){var i,a=e(t);!n&&a.hide(),a.hasClass("elfinder-frontmost")&&(a.removeClass("elfinder-frontmost"),i=m.children(".ui-front:visible:not(.elfinder-frontmost)").last(),i.length&&requestAnimationFrame(function(){m.children(".elfinder-frontmost:visible").length||(u.toFront(i),i.trigger("frontmost"))}))},this.getMaximizeCss=function(){return{width:"100%",height:"100%",margin:0,top:0,left:0,display:"block",position:"fixed",zIndex:Math.max(u.zIndex?u.zIndex+1:0,1e3),maxWidth:"",maxHeight:""}},function(){re&&u.UA.Fullscreen&&(u.UA.Fullscreen=!1,se&&"undefined"!=typeof se.attr("allowfullscreen")&&(u.UA.Fullscreen=!0));var t,n,i,a,o="elfinder-fullscreen",r="elfinder-fullscreen-native",s=function(){var t=0,n=0;e.each(m.children(".ui-dialog,.ui-draggable"),function(i,a){var o=e(a),r=o.position();r.top<0&&(o.css("top",t),t+=20),r.left<0&&(o.css("left",n),n+=20)})},l=function(){var i=u.storage("useFullscreen");a=u.UA.Fullscreen&&(i?i>0:"screen"===u.options.commandsOptions.fullscreen.mode)?{fullElm:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null},exitFull:function(){return document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():void 0},toFull:function(e){return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():!!e.msRequestFullscreen&&e.msRequestFullscreen()}}:{fullElm:function(){var e;return m.hasClass(o)?m.get(0):(e=m.find("."+o),e.length?e.get(0):null)},exitFull:function(){var i;e(window).off("resize."+y,d),void 0!==n&&e("body").css("overflow",n),n=void 0,t&&(i=t.elm,c(i),e(i).trigger("resize",{fullscreen:"off"})),e(window).trigger("resize")},toFull:function(t){return n=e("body").css("overflow")||"",e("body").css("overflow","hidden"),e(t).css(u.getMaximizeCss()).addClass(o).trigger("resize",{fullscreen:"on"}),s(),e(window).on("resize."+y,d).trigger("resize"),!0}}},c=function(n){t&&t.elm==n&&(e(n).removeClass(o+" "+r).attr("style",t.style),t=null)},d=function(t){var n;t.target===window&&(i&&cancelAnimationFrame(i),i=requestAnimationFrame(function(){(n=a.fullElm())&&e(n).trigger("resize",{fullscreen:"on"})}))};l(),e(document).on("fullscreenchange."+y+" webkitfullscreenchange."+y+" mozfullscreenchange."+y+" MSFullscreenChange."+y,function(n){if(u.UA.Fullscreen){var l=a.fullElm(),p=e(window);i&&cancelAnimationFrame(i),null===l?(p.off("resize."+y,d),t&&(l=t.elm,c(l),e(l).trigger("resize",{fullscreen:"off"}))):(e(l).addClass(o+" "+r).attr("style","width:100%; height:100%; margin:0; padding:0;").trigger("resize",{fullscreen:"on"}),p.on("resize."+y,d),s()),p.trigger("resize")}}),u.toggleFullscreen=function(n,i){var o=e(n).get(0),r=null;if(r=a.fullElm()){if(r==o){if(i===!0)return r}else if(i===!1)return r;return a.exitFull(),null}return i===!1?null:(l(),t={elm:o,style:e(o).attr("style")},a.toFull(o)!==!1?o:(t=null,null))}}(),function(){var t,n="elfinder-maximized",i=function(e){if(e.target===window&&e.data&&e.data.elm){var n=e.data.elm;t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){n.trigger("resize",{maximize:"on"})})}},a=function(t){e(window).off("resize."+y,i),e("body").css("overflow",t.data("bodyOvf")),t.removeClass(n).attr("style",t.data("orgStyle")).removeData("bodyOvf").removeData("orgStyle"),t.trigger("resize",{maximize:"off"})},o=function(t){t.data("bodyOvf",e("body").css("overflow")||"").data("orgStyle",t.attr("style")).addClass(n).css(u.getMaximizeCss()),e("body").css("overflow","hidden"),e(window).on("resize."+y,{elm:t},i),t.trigger("resize",{maximize:"on"})};u.toggleMaximize=function(t,i){var r=e(t),s=r.hasClass(n);if(s){if(i===!0)return;a(r)}else{if(i===!1)return;o(r)}}}(),Object.assign(e.ui.keyCode,{F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,DIG0:48,DIG1:49,DIG2:50,DIG3:51,DIG4:52,DIG5:53,DIG6:54,DIG7:55,DIG8:56,DIG9:57,NUM0:96,NUM1:97,NUM2:98,NUM3:99,NUM4:100,NUM5:101,NUM6:102,NUM7:103,NUM8:104,NUM9:105,CONTEXTMENU:93,DOT:190}),this.dragUpload=!1,this.xhrUpload=("undefined"!=typeof XMLHttpRequestUpload||"undefined"!=typeof XMLHttpRequestEventTarget)&&"undefined"!=typeof File&&"undefined"!=typeof FormData,this.transport={},"object"==typeof this.options.transport&&(this.transport=this.options.transport,"function"==typeof this.transport.init&&this.transport.init(this)),"function"!=typeof this.transport.send&&(this.transport.send=function(t){return u.UA.IE||(t._xhr=new XMLHttpRequest,t.xhr=function(){return t.progress&&t._xhr.addEventListener("progress",t.progress),t._xhr}),e.ajax(t)}),"iframe"==this.transport.upload?this.transport.upload=e.proxy(this.uploads.iframe,this):"function"==typeof this.transport.upload?this.dragUpload=!!this.options.dragUploadAllow:this.xhrUpload&&this.options.dragUploadAllow?(this.transport.upload=e.proxy(this.uploads.xhr,this),this.dragUpload=!0):this.transport.upload=e.proxy(this.uploads.iframe,this),this.decodeRawString=function(e){var t=function(e){var t,n,i;for(t=0,n=e.length,i=[];t=55296&&a<=56319?o.push((1023&a)+64<<10|1023&e[++n]):o.push(a);return o},i=function(e){var t,n,i,a,o=String.fromCharCode;for(t=0,n=e.length,a="";i=e[t],t=194?o((31&i)<<6|63&e[++t]):i<=239&&i>=224?o((15&i)<<12|(63&e[++t])<<6|63&e[++t]):i<=247&&i>=240?o(55296|((7&i)<<8|(63&e[++t])<<2|e[++t]>>>4&3)-64,56320|(15&e[t++])<<6|63&e[t]):o(65533);return a};return i(n(e))},this.getContents=function(t,n,i){var a,o,r=this,s=e.Deferred(),l=n||"arraybuffer";return s.fail(function(){o&&"pending"===o.state()&&o.reject()}),a=r.openUrl(t),r.isSameOrigin(a)||(a=r.openUrl(t,!0)),o=r.request(Object.assign({data:{cmd:"get"},options:{url:a,type:"get",cache:!0,dataType:"binary",responseType:l,processData:!1},notify:{type:"file",cnt:1,hideCnt:!0},cancel:!0},i||{})).fail(function(){s.reject()}).done(function(e){s.resolve(e)}),s},this.getBinaryByUrl=function(t,n,i){var a,o=this,r=e.Deferred();return r.fail(function(){a&&"pending"===a.state()&&a.reject()}),a=o.request(Object.assign({data:{cmd:"get"},options:Object.assign({type:"get",cache:!0,dataType:"binary",responseType:"blob",processData:!1},t)},i||{})).fail(function(){r.reject()}).done(function(e){n&&n(e),r.resolve(e)}),r},this.getMimetype=function(e,t){var n,i,a=t;return i=(e+"").match(/\.([^.]+)$/),i&&(n=i[1])&&(o||(o=u.arrayFlip(u.mimeTypes)),(a=o[n.toLowerCase()])||(a=t)),a},u.hashCheckers=[],function(t){var n={};window.Worker&&window.ArrayBuffer&&(t.options.cdns.sparkmd5&&(n.SparkMD5=!0,t.hashCheckers.push("md5")),t.options.cdns.jssha&&(n.jsSHA=!0,t.hashCheckers=t.hashCheckers.concat(["sha1","sha224","sha256","sha384","sha512","sha3-224","sha3-256","sha3-384","sha3-512","shake128","shake256"]))),t.getContentsHashes=function(i,a,o,r){var s,l=e.Deferred(),c=t.arrayFlip(a||["md5"],!0),d=[],p={},u=o?o:{shake128len:256,shake256len:512};return l.fail(function(){s&&s.reject()}),Object.keys(n).length?s=t.getContents(i,"arraybuffer",r).done(function(a){c.md5&&n.SparkMD5&&d.push(function(){var o=e.Deferred();try{var r=t.getWorker();o.fail(function(){r&&r.terminate()}),r.onmessage=function(e){if(r&&r.terminate(),e.data.hash){var n;p.md5=e.data.hash,(n=t.file(i))&&(n.md5=p.md5)}else e.data.error&&(p.md5=e.data.error);l.notify(p),o.resolve()},r.onerror=function(e){o.reject()},r.postMessage({scripts:[t.options.cdns.sparkmd5,t.getWorkerUrl("calcfilehash.js")],data:{type:"md5",bin:a}}),l.fail(function(){o.reject()})}catch(s){o.reject(),delete n.SparkMD5}return o}()),n.jsSHA&&e.each(["1","224","256","384","512","3-224","3-256","3-384","3-512","ke128","ke256"],function(o,r){c["sha"+r]&&d.push(function(){var o=e.Deferred();try{var s=t.getWorker();o.fail(function(){s&&s.terminate()}),s.onmessage=function(e){if(s&&s.terminate(),e.data.hash){var n;p["sha"+r]=e.data.hash,(n=t.file(i))&&(n["sha"+r]=p["sha"+r])}else e.data.error&&(p["sha"+r]=e.data.error);l.notify(p),o.resolve()},s.onerror=function(e){o.reject()},s.postMessage({scripts:[t.options.cdns.jssha,t.getWorkerUrl("calcfilehash.js")],data:{type:r,bin:a,hashOpts:u}}),l.fail(function(){o.reject()})}catch(c){o.reject(),delete n.jsSHA}return o}())}),d.length?e.when.apply(null,d).always(function(){l.resolve(p)}):l.reject()}).fail(function(){l.reject()}):l.reject(),l}}(this),this.parseError=function(t){var n=t;return e.isPlainObject(n)&&(n=n.error),n},this.error=function(){var e,t=arguments[0],n=arguments[1]||null;return 1==arguments.length&&"function"==typeof t?u.bind("error",t):(e=this.parseError(t),e!==!0&&e?u.trigger("error",{error:e,opts:n}):this)},e.each(A,function(t,n){u[n]=function(){var t=arguments[0];return 1==arguments.length&&"function"==typeof t?u.bind(n,t):u.trigger(n,e.isPlainObject(t)?t:{})}}),this.enable(function(){!z&&u.api&&u.visible()&&u.ui.overlay.is(":hidden")&&!m.children(".elfinder-dialog."+u.res("class","editing")+":visible").length&&(z=!0,document.activeElement&&document.activeElement.blur(),m.removeClass("elfinder-disabled"))}).disable(function(){T=z,z=!1,m.addClass("elfinder-disabled")}).open(function(){F=[]}).select(function(t){var n=0,i=[];F=e.grep(t.data.selected||t.data.value||[],function(e){return i.length||u.maxTargets&&++n>u.maxTargets?(i.push(e),!1):!!I[e]}),i.length&&(u.trigger("unselectfiles",{files:i,inselect:!0}),u.toast({mode:"warning",msg:u.i18n(["errMaxTargets",u.maxTargets])}))}).error(function(t){var n,i,a={cssClass:"elfinder-dialog-error",title:u.i18n("error"),resizable:!1,destroyOnClose:!0,buttons:{}},o=u.getUI(),r=o.children(".elfinder-dialog-error").length;r'+u.i18n(t.data.error),a)):(n=o.children(".elfinder-dialog-error:last").children(".ui-dialog-content:first"),i=n.children(".elfinder-error-counter"),i.length?i.data("cnt",parseInt(i.data("cnt"))+1).html(u.i18n(["moreErrors",i.data("cnt")])):(i=e(''+u.i18n(["moreErrors",1])+"").data("cnt",1),n.append("
",i)))}).bind("tmb",function(t){e.each(t.data.images||[],function(e,t){I[e]&&(I[e].tmb=t)})}).bind("searchstart",function(e){Object.assign(u.searchStatus,e.data),u.searchStatus.state=1}).bind("search",function(e){u.searchStatus.state=2}).bind("searchend",function(){u.searchStatus.state=0,u.searchStatus.ininc=!1,u.searchStatus.mixed=!1}).bind("canMakeEmptyFile",function(t){var n=t.data,i={};n&&Array.isArray(n.mimes)&&(n.unshift||(i=u.mimesCanMakeEmpty),e.each(n.mimes,function(){i[this]||(i[this]=u.mimeTypes[this])}),n.unshift&&(u.mimesCanMakeEmpty=Object.assign(i,u.mimesCanMakeEmpty)))}).bind("themechange",function(){requestAnimationFrame(function(){u.trigger("uiresize")})}),!0===this.options.sound&&this.bind("playsound",function(t){var n=K.canPlayType&&K.canPlayType('audio/wav; codecs="1"'),i=t.data&&t.data.soundFile;n&&i&&""!=n&&"no"!=n&&e(K).html('')[0].play()}),e.each(this.options.handlers,function(e,t){u.bind(e,t)}),this.history=new this.history(this),this.roots={},this.leafRoots={},this.volumeExpires={},this._commands={},Array.isArray(this.options.commands)||(this.options.commands=[]),e.inArray("*",this.options.commands)!==-1&&(this.options.commands=Object.keys(this.commands)),this.commandMap={},this.volOptions={},this.hasVolOptions=!1,this.trashes={},this.optionsByHashes={},this.uiAutoHide=[],this.one("open",function(){u.uiAutoHide.length&&setTimeout(function(){u.trigger("uiautohide")},500)}),this.bind("uiautohide",function(){u.uiAutoHide.length&&u.uiAutoHide.shift()()}),this.options.width&&(N=this.options.width),this.options.height&&(L=this.options.height),this.options.heightBase&&(W=e(this.options.heightBase)),B=this.options.soundPath?this.options.soundPath.replace(/\/+$/,"")+"/":this.baseUrl+B,this.options.parrotHeaders&&Array.isArray(this.options.parrotHeaders)&&this.options.parrotHeaders.length?(this.parrotHeaders=this.options.parrotHeaders,e.each(this.parrotHeaders,function(e,t){var n=u.sessionStorage("core-ph:"+t);n&&(u.customHeaders[t]=n)})):this.parrotHeaders=[],u.one("opendone",function(){var t;e(document).on("click."+y,function(t){z&&!u.options.enableAlways&&!e(t.target).closest(m).length&&u.disable()}).on(x+" "+k+" "+C+" "+w,ae),u.options.useBrowserHistory&&e(window).on("popstate."+y,function(t){var n,i,a=t.originalEvent.state||{},o=!!a.thash,r=m.find(".elfinder-frontmost:visible"),s=m.find(".elfinder-navbar-dir,.elfinder-cwd-filename").find("input,textarea");o||(a={thash:u.cwd().hash},e("html,body").animate({scrollTop:m.offset().top})),r.length||s.length?(history.pushState(a,null,location.pathname+location.search+"#elf_"+a.thash),r.length?r.hasClass(u.res("class","preventback"))||(r.hasClass("elfinder-contextmenu")?e(document).trigger(e.Event("keydown",{keyCode:e.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1})):r.hasClass("elfinder-dialog")?r.elfinderdialog("close"):r.trigger("close")):s.trigger(e.Event("keydown",{keyCode:e.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))):o?!e.isEmptyObject(u.files())&&u.request({data:{cmd:"open",target:a.thash,onhistory:1},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0}):(n=function(){i.trigger("click")},u.one("open",n,!0),i=u.toast({msg:u.i18n("pressAgainToExit"),onHidden:function(){u.unbind("open",n),history.pushState(a,null,location.pathname+location.search+"#elf_"+a.thash)}}))}),e(window).on("resize."+y,function(e){e.target===this&&(t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){var e=m.data("resizeSize")||{w:0,h:0},t={w:Math.round(m.width()),h:Math.round(m.height())};m.data("resizeSize",t),t.w===e.w&&t.h===e.h||(m.trigger("resize"),u.trigger("resize",{width:t.w,height:t.h}))}))}).on("beforeunload."+y,function(t){var n,i;if(!u.pauseUnloadCheck()){if(m.is(":visible")&&(u.ui.notify.children().length&&e.inArray("hasNotifyDialog",u.options.windowCloseConfirm)!==-1?n=u.i18n("ntfsmth"):m.find("."+u.res("class","editing")).length&&e.inArray("editingFile",u.options.windowCloseConfirm)!==-1?n=u.i18n("editingFile"):(i=Object.keys(u.selected()).length)&&e.inArray("hasSelectedItem",u.options.windowCloseConfirm)!==-1?n=u.i18n("hasSelected",""+i):(i=Object.keys(u.clipboard()).length)&&e.inArray("hasClipboardData",u.options.windowCloseConfirm)!==-1&&(n=u.i18n("hasClipboard",""+i)),n))return t.returnValue=n,n;u.trigger("unload")}}),e(window).on("message."+y,function(e){var t,n,i=e.originalEvent||null;if(i&&(0===u.convAbsUrl(u.options.url).indexOf(i.origin)||0===u.convAbsUrl(u.uploadURL).indexOf(i.origin)))try{t=JSON.parse(i.data),n=t.data||null,n&&(n.error?(t.bind&&u.trigger(t.bind+"fail",n),u.error(n.error)):(n.warning&&u.error(n.warning),u.updateCache(n),n.removed&&n.removed.length&&u.remove(n),n.added&&n.added.length&&u.add(n),n.changed&&n.changed.length&&u.change(n),t.bind&&(u.trigger(t.bind,n),u.trigger(t.bind+"done")),n.sync&&u.sync()))}catch(e){u.sync()}}),u.options.enableAlways?(e(window).on("focus."+y,function(e){e.target===this&&u.enable()}),re&&e(window.top).on("focus."+y,function(){!u.enable()||se&&!se.is(":visible")||requestAnimationFrame(function(){e(window).trigger("focus")})})):re&&e(window).on("blur."+y,function(e){z&&e.target===this&&u.disable()}),re&&m.on("click",function(t){e(window).trigger("focus")}),u.options.enableByMouseOver&&m.on("mouseenter touchstart",function(t){re&&e(window).trigger("focus"),!u.enabled()&&u.enable()}),e(window).on("visibilitychange."+y,function(e){var t=document.hidden||document.webkitHidden||document.msHidden;u.options.syncStart&&u.autoSync(t?"stop":void 0)})}),m[0].elfinder=this,h.push(function(){var t=u.lang,n=u.i18nBaseUrl+"elfinder."+t+".js",i=e.Deferred().done(function(){u.i18[t]&&(u.lang=t),u.trigger("i18load"),c="en"===u.lang?u.i18.en:e.extend(!0,{},u.i18.en,u.i18[u.lang])});return u.i18[t]?i.resolve():(u.lang="en",u.hasRequire?require([n],function(){i.resolve()},function(){i.resolve()}):u.loadScript([n],function(){i.resolve()},{loadType:"tag",error:function(){i.resolve()}})),i}()),d=function(){var t;return u.messages=c.messages,e.fn.selectable&&e.fn.draggable&&e.fn.droppable&&e.fn.resizable&&e.fn.button&&e.fn.slider?m.length?u.options.url?(t=Object.assign({name:u.i18n("name"),perm:u.i18n("perms"),date:u.i18n("modify"),size:u.i18n("size"),kind:u.i18n("kind"),modestr:u.i18n("mode"),modeoct:u.i18n("mode"),modeboth:u.i18n("mode")},u.options.uiOptions.cwd.listView.columnsCustomName),u.getColumnName=function(e){return t[e]||u.i18n(e)},u.direction=c.direction,u.dateFormat=u.options.dateFormat||c.dateFormat,u.fancyFormat=u.options.fancyDateFormat||c.fancyDateFormat,u.nonameDateFormat=(u.options.nonameDateFormat||c.nonameDateFormat).replace(/[\/\\]/g,"_"),u.cssClass="ui-helper-reset ui-helper-clearfix ui-widget ui-widget-content ui-corner-all elfinder elfinder-"+("rtl"==u.direction?"rtl":"ltr")+(u.UA.Touch?" elfinder-touch"+(u.options.resizable?" touch-punch":""):"")+(u.UA.Mobile?" elfinder-mobile":"")+(u.UA.iOS?" elfinder-ios":"")+" "+u.options.cssClass,m.addClass(u.cssClass).on(w,function(){!z&&u.enable()}),function(){var t,n,i,a,o,r=x+"draggable keyup."+y+"draggable";u.draggable={appendTo:m,addClasses:!1,distance:4,revert:!0,refreshPositions:!1,cursor:"crosshair",cursorAt:{left:50,top:47},scroll:!1,start:function(r,s){var l,c,d=s.helper,p=e.grep(d.data("files")||[],function(e){return!!e&&(q[e]=!0,!0)}),h=!1;for(o=m.attr("style"),m.width(m.width()).height(m.height()),t="ltr"===u.direction,n=u.getUI("workzone").data("rectangle"),i=n.top+n.height,a=i-u.getUI("navdock").outerHeight(!0),u.draggingUiHelper=d,l=p.length;l--;)if(c=p[l],I[c].locked){h=!0,d.data("locked",!0);break}!h&&u.trigger("lockfiles",{files:p}),d.data("autoScrTm",setInterval(function(){d.data("autoScr")&&u.autoScroll[d.data("autoScr")](d.data("autoScrVal"))},50))},drag:function(o,r){var s,l,c,d=r.helper;((l=n.top>o.pageY)||ao.pageX?(t?"navbar":"cwd")+(l?"Up":"Down"):(t?"cwd":"navbar")+(l?"Up":"Down"),l||("cwd"===s.substr(0,3)?i0?(e(this).draggable("option",{refreshPositions:!0,elfRefresh:!0}),d.data("refreshPositions",-1)):(e(this).draggable("option",{refreshPositions:!1,elfRefresh:!1}),d.data("refreshPositions",null)))},stop:function(t,n){var i,a=n.helper;e(document).off(r),e(this).elfUiWidgetInstance("draggable")&&e(this).draggable("option",{refreshPositions:!1}),u.draggingUiHelper=null,u.trigger("focus").trigger("dragstop"),a.data("droped")||(i=e.grep(a.data("files")||[],function(e){return!!e}),u.trigger("unlockfiles",{files:i}),u.trigger("selectfiles",{files:u.selected()})),u.enable(),m.attr("style",o),a.data("autoScrTm")&&clearInterval(a.data("autoScrTm"))},helper:function(t,n){var i,a,o,s=this.id?e(this):e(this).parents("[id]:first"),l=e('
'),c=function(t){var n,i=t.mime,a=u.tmb(t);return n='
',a?n=e(n).addClass(a.className).css("background-image","url('"+a.url+"')").get(0).outerHTML:t.icon&&(n=e(n).css(u.getIconStyle(t,!0)).get(0).outerHTML),t.csscls&&(n='
'+n+"
"),n};return u.draggingUiHelper&&u.draggingUiHelper.stop(!0,!0),u.trigger("dragstart",{target:s[0],originalEvent:t},!0),i=s.hasClass(u.res("class","cwdfile"))?u.selected():[u.navId2Hash(s.attr("id"))],l.append(c(I[i[0]])).data("files",i).data("locked",!1).data("droped",!1).data("namespace",y).data("dropover",0),(a=i.length)>1&&l.append(c(I[i[a-1]])+''+a+""),e(document).on(r,function(e){var t=e.shiftKey||e.ctrlKey||e.metaKey;o!==t&&(o=t,l.is(":visible")&&l.data("dropover")&&!l.data("droped")&&(l.toggleClass("elfinder-drag-helper-plus",!!l.data("locked")||o),u.trigger(o?"unlockfiles":"lockfiles",{files:i,helper:l})))}),l}}}(),u.commands.getfile&&("function"==typeof u.options.getFileCallback?(u.bind("dblclick",function(e){e.preventDefault(),u.exec("getfile").fail(function(){u.exec("open",e.data&&e.data.file?[e.data.file]:void 0)})}),u.shortcut({pattern:"enter",description:u.i18n("cmdgetfile"),callback:function(){u.exec("getfile").fail(function(){u.exec("mac"==u.OS?"rename":"open")})}}).shortcut({pattern:"ctrl+enter",description:u.i18n("mac"==u.OS?"cmdrename":"cmdopen"),callback:function(){u.exec("mac"==u.OS?"rename":"open")}})):u.options.getFileCallback=null),e.each(u.commands,function(t,n){var i,a,o=Object.assign({},n.prototype);if(e.isFunction(n)&&!u._commands[t]&&(n.prototype.forceLoad||e.inArray(t,u.options.commands)!==-1)){if(i=n.prototype.extendsCmd||""){if(!e.isFunction(u.commands[i]))return!0;n.prototype=Object.assign({},_,new u.commands[i],n.prototype)}else n.prototype=Object.assign({},_,n.prototype);u._commands[t]=new n,n.prototype=o,a=u.options.commandsOptions[t]||{},i&&u.options.commandsOptions[i]&&(a=e.extend(!0,{},u.options.commandsOptions[i],a)),u._commands[t].setup(t,a),u._commands[t].linkedCmds.length&&e.each(u._commands[t].linkedCmds,function(t,n){var i=u.commands[n];e.isFunction(i)&&!u._commands[n]&&(i.prototype=_,u._commands[n]=new i,u._commands[n].setup(n,u.options.commandsOptions[n]||{}))})}}),u.ui={workzone:e("
").appendTo(m).elfinderworkzone(u),navbar:e("
").appendTo(m).elfindernavbar(u,u.options.uiOptions.navbar||{}),navdock:e("
").appendTo(m).elfindernavdock(u,u.options.uiOptions.navdock||{}),contextmenu:e("
").appendTo(m).elfindercontextmenu(u),overlay:e("
").appendTo(m).elfinderoverlay({show:function(){u.disable()},hide:function(){T&&u.enable()}}),cwd:e("
").appendTo(m).elfindercwd(u,u.options.uiOptions.cwd||{}),notify:u.dialog("",{cssClass:"elfinder-dialog-notify"+(u.options.notifyDialog.canClose?"":" elfinder-titlebar-button-hide"),position:u.options.notifyDialog.position,absolute:!0,resizable:!1,autoOpen:!1,allowMinimize:!0,closeOnEscape:!!u.options.notifyDialog.canClose,title:" ",width:u.options.notifyDialog.width?parseInt(u.options.notifyDialog.width):null,minHeight:null,minimize:function(){u.ui.notify.trigger("minimize")}}),statusbar:e('
').hide().appendTo(m),toast:e('
').appendTo(m),bottomtray:e('
').appendTo(m),progressbar:e('
').appendTo(m)},u.trigger("uiready"),e.each(u.options.ui||[],function(t,n){var i="elfinder"+n,a=u.options.uiOptions[n]||{};!u.ui[n]&&e.fn[i]&&(u.ui[n]=e("<"+(a.tag||"div")+"/>").appendTo(m),u.ui[n][i](u,a))}),u.ui.progressbar.appendTo(u.ui.workzone),u.ui.notify.prev(".ui-dialog-titlebar").append('
'),u.resize(N,L),u.options.resizable&&(m.resizable({resize:function(e,t){u.resize(t.size.width,t.size.height)},handles:"se",minWidth:300,minHeight:200}),u.UA.Touch&&m.addClass("touch-punch")),function(){var e=u.getUI("navbar"),t=u.getUI("cwd").parent();u.autoScroll={navbarUp:function(t){e.scrollTop(Math.max(0,e.scrollTop()-t))},navbarDown:function(t){e.scrollTop(e.scrollTop()+t)},cwdUp:function(e){t.scrollTop(Math.max(0,t.scrollTop()-e))},cwdDown:function(e){t.scrollTop(t.scrollTop()+e)}}}(),u.UA.Touch&&!function(){var e,t,n,i,a,o,r,s,l,c=u.getUI("navbar"),d=u.getUI("toolbar"),p="touchmove.stopscroll",h=function(e){var n=e.originalEvent.touches||[{}],i=n[0].pageY||null;(!t||i1||("touchstart"===s.type?(n=m.offset(),i=m.width(),c&&(e=!1,c.is(":hidden")?(l||(l=Math.max(50,i/10)), (A?z-n.left:i+n.left-z)n.left+i-o,y?(l=Math.max(50,i/10),e=z):e=!1)),d&&(t=!1,s.originalEvent._preventSwipeY||(r=d.height(),a=n.top,T-a<(d.is(":hidden")?v:r+30)&&(t=T,m.on(p,d.is(":hidden")?f:h))))):(c&&e!==!1&&(b=(A?e>z:e.6*o||w>("navhide"===b?o/3:45)&&("navshow"===b||(A?zn.left+i-20)))&&(u.getUI("navbar").trigger(b,{handleW:l}),e=!1)),d&&t!==!1&&(x=d.offset().top,Math.abs(t-T)>Math.min(45,r/3)&&(k=t>T?"slideUp":"slideDown",("slideDown"===k||x+20>T)&&(d.is("slideDown"===k?":hidden":":visible")&&d.stop(!0,!0).trigger("toggle",{duration:100,handleH:v}),t=!1)))))})}(),u.dragUpload&&!function(){var t,n,i=function(t){return"TEXTAREA"!==t.target.nodeName&&"INPUT"!==t.target.nodeName&&0===e(t.target).closest("div.ui-dialog-content").length},a="native-drag-enter",o="native-drag-disable",r="class",s=u.res(r,"navdir"),l=(u.res(r,"droppable"),u.res(r,"adroppable"),u.res(r,"navarrow"),u.res(r,"adroppable")),c=u.getUI("workzone"),d="ltr"===u.direction,p=function(){n&&cancelAnimationFrame(n),n=null};m.on("dragenter",function(e){p(),i(e)&&(e.preventDefault(),e.stopPropagation(),t=c.data("rectangle"))}).on("dragleave",function(e){p(),i(e)&&(e.preventDefault(),e.stopPropagation())}).on("dragover",function(e){var a;i(e)?(e.preventDefault(),e.stopPropagation(),e.originalEvent.dataTransfer.dropEffect="none",n||(n=requestAnimationFrame(function(){var i,o=t.top+t.height,r=o-u.getUI("navdock").outerHeight(!0);((a=e.pageYr)&&(i=t.cwdEdge>e.pageX?(d?"navbar":"cwd")+(a?"Up":"Down"):(d?"cwd":"navbar")+(a?"Up":"Down"),a||"cwd"===i.substr(0,3)&&(o=11,IE:document.uniqueID,Firefox:window.sidebar,Opera:window.opera,Webkit:e,Chrome:t,Edge:!(!t||!window.msCredentials),Safari:e&&!window.chrome,Mobile:"undefined"!=typeof window.orientation,Touch:"undefined"!=typeof window.ontouchstart,iOS:navigator.platform.match(/^iP(?:[ao]d|hone)/),Mac:navigator.platform.match(/^Mac/),Fullscreen:"undefined"!=typeof(document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen),Angle:0,Rotated:!1,CSS:function(){var e,t=document.createElement("a").style,n=document.createElement("p").style;return e="position:sticky;position:-webkit-sticky;",e+="width:-webkit-max-content;width:-moz-max-content;width:-ms-max-content;width:max-content;",t.cssText=e,{positionSticky:t.position.indexOf("sticky")!==-1,widthMaxContent:t.width.indexOf("max-content")!==-1,flex:"undefined"!=typeof n.flex}}()};return n}(),cookieEnabled:function(){var e=!1,t="elftest=";return document.cookie=t+"1",e=2===document.cookie.split(t).length,document.cookie=t+";max-age=0",e}(),hasRequire:"function"==typeof define&&define.amd,currentReqCmd:"",keyState:{},i18:{en:{translator:"",language:"English",direction:"ltr",dateFormat:"d.m.Y H:i",fancyDateFormat:"$1 H:i",nonameDateFormat:"ymd-His",messages:{}},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["msJan","msFeb","msMar","msApr","msMay","msJun","msJul","msAug","msSep","msOct","msNov","msDec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},kinds:{unknown:"Unknown",directory:"Folder",group:"Selects",symlink:"Alias","symlink-broken":"AliasBroken","application/x-empty":"TextPlain","application/postscript":"Postscript","application/vnd.ms-office":"MsOffice","application/msword":"MsWord","application/vnd.ms-word":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"MsWord","application/vnd.ms-word.document.macroEnabled.12":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"MsWord","application/vnd.ms-word.template.macroEnabled.12":"MsWord","application/vnd.ms-excel":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"MsExcel","application/vnd.ms-excel.sheet.macroEnabled.12":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"MsExcel","application/vnd.ms-excel.template.macroEnabled.12":"MsExcel","application/vnd.ms-excel.sheet.binary.macroEnabled.12":"MsExcel","application/vnd.ms-excel.addin.macroEnabled.12":"MsExcel","application/vnd.ms-powerpoint":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.presentation":"MsPP","application/vnd.ms-powerpoint.presentation.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"MsPP","application/vnd.ms-powerpoint.slideshow.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.template":"MsPP","application/vnd.ms-powerpoint.template.macroEnabled.12":"MsPP","application/vnd.ms-powerpoint.addin.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slide":"MsPP","application/vnd.ms-powerpoint.slide.macroEnabled.12":"MsPP","application/pdf":"PDF","application/xml":"XML","application/vnd.oasis.opendocument.text":"OO","application/vnd.oasis.opendocument.text-template":"OO","application/vnd.oasis.opendocument.text-web":"OO","application/vnd.oasis.opendocument.text-master":"OO","application/vnd.oasis.opendocument.graphics":"OO","application/vnd.oasis.opendocument.graphics-template":"OO","application/vnd.oasis.opendocument.presentation":"OO","application/vnd.oasis.opendocument.presentation-template":"OO","application/vnd.oasis.opendocument.spreadsheet":"OO","application/vnd.oasis.opendocument.spreadsheet-template":"OO","application/vnd.oasis.opendocument.chart":"OO","application/vnd.oasis.opendocument.formula":"OO","application/vnd.oasis.opendocument.database":"OO","application/vnd.oasis.opendocument.image":"OO","application/vnd.openofficeorg.extension":"OO","application/x-shockwave-flash":"AppFlash","application/flash-video":"Flash video","application/x-bittorrent":"Torrent","application/javascript":"JS","application/rtf":"RTF","application/rtfd":"RTF","application/x-font-ttf":"TTF","application/x-font-otf":"OTF","application/x-rpm":"RPM","application/x-web-config":"TextPlain","application/xhtml+xml":"HTML","application/docbook+xml":"DOCBOOK","application/x-awk":"AWK","application/x-gzip":"GZIP","application/x-bzip2":"BZIP","application/x-xz":"XZ","application/zip":"ZIP","application/x-zip":"ZIP","application/x-rar":"RAR","application/x-tar":"TAR","application/x-7z-compressed":"7z","application/x-jar":"JAR","text/plain":"TextPlain","text/x-php":"PHP","text/html":"HTML","text/javascript":"JS","text/css":"CSS","text/rtf":"RTF","text/rtfd":"RTF","text/x-c":"C","text/x-csrc":"C","text/x-chdr":"CHeader","text/x-c++":"CPP","text/x-c++src":"CPP","text/x-c++hdr":"CPPHeader","text/x-shellscript":"Shell","application/x-csh":"Shell","text/x-python":"Python","text/x-java":"Java","text/x-java-source":"Java","text/x-ruby":"Ruby","text/x-perl":"Perl","text/x-sql":"SQL","text/xml":"XML","text/x-comma-separated-values":"CSV","text/x-markdown":"Markdown","image/x-ms-bmp":"BMP","image/jpeg":"JPEG","image/gif":"GIF","image/png":"PNG","image/tiff":"TIFF","image/x-targa":"TGA","image/vnd.adobe.photoshop":"PSD","image/xbm":"XBITMAP","image/pxm":"PXM","audio/mpeg":"AudioMPEG","audio/midi":"AudioMIDI","audio/ogg":"AudioOGG","audio/mp4":"AudioMPEG4","audio/x-m4a":"AudioMPEG4","audio/wav":"AudioWAV","audio/x-mp3-playlist":"AudioPlaylist","video/x-dv":"VideoDV","video/mp4":"VideoMPEG4","video/mpeg":"VideoMPEG","video/x-msvideo":"VideoAVI","video/quicktime":"VideoMOV","video/x-ms-wmv":"VideoWM","video/x-flv":"VideoFlash","video/x-matroska":"VideoMKV","video/ogg":"VideoOGG"},mimeTypes:{},rules:{defaults:function(e){return!(!e||e.added&&!Array.isArray(e.added)||e.removed&&!Array.isArray(e.removed)||e.changed&&!Array.isArray(e.changed))},open:function(t){return t&&t.cwd&&t.files&&e.isPlainObject(t.cwd)&&Array.isArray(t.files)},tree:function(e){return e&&e.tree&&Array.isArray(e.tree)},parents:function(e){return e&&e.tree&&Array.isArray(e.tree)},tmb:function(t){return t&&t.images&&(e.isPlainObject(t.images)||Array.isArray(t.images))},upload:function(t){return t&&(e.isPlainObject(t.added)||Array.isArray(t.added))},search:function(e){return e&&e.files&&Array.isArray(e.files)}},commands:{},cmdsToAdd:"archive duplicate extract mkdir mkfile paste rm upload",parseUploadData:function(t){var n,i=this;if(!e.trim(t))return{error:["errResponse","errDataEmpty"]};try{n=JSON.parse(t)}catch(a){return{error:["errResponse","errDataNotJSON"]}}return n=i.normalize(n),i.validResponse("upload",n)?(n.removed=e.merge(n.removed||[],e.map(n.added||[],function(e){return i.file(e.hash)?e.hash:null})),n):{error:n.norError||["errResponse"]}},iframeCnt:0,uploads:{xhrUploading:!1,failSyncTm:null,chunkfailReq:{},checkExists:function(t,n,i,a){var o,r=e.Deferred(),s=[],l={},c=function(){for(var e=t.length;--e>-1;)t[e]._remove=!0},d=function(){r.resolve(s,l)},p=function(){var r=[],p=[],u=n!==i.cwd().hash?i.path(n,!0)+i.option("separator",n):"",h=function(e){var n=e==p.length-1,o={cssClass:"elfinder-confirm-upload",title:i.i18n("cmdupload"),text:["errExists",u+p[e].name,"confirmRepl"],all:!n,accept:{label:"btnYes",callback:function(t){n||t?d():h(++e)}},reject:{label:"btnNo",callback:function(i){var a;if(i)for(a=p.length;e0&&delete o.reject,i.confirm(o)};return i.file(n).read?(o=e.map(t,function(e,t){return!e.name||i.UA.iOS&&"image.jpg"===e.name?null:{i:t,name:e.name}}),void i.request({data:{cmd:"ls",target:n,intersect:e.map(o,function(e){return e.name})},notify:{type:"preupload",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(t){var a,s;t&&(t.error?c():i.options.overwriteUploadConfirm&&i.option("uploadOverwrite",n)&&t.list&&(Array.isArray(t.list)?r=t.list||[]:(a=[],r=e.map(t.list,function(e){return"string"==typeof e?e:(a=a.concat(e),!1)}),a.length&&(r=r.concat(a)),l=t.list),p=e.grep(o,function(t){return e.inArray(t.name,r)!==-1}),p.length&&r.length&&n==i.cwd().hash&&(s=e.map(i.files(n),function(e){return e.name}),e.grep(r,function(t){return e.inArray(t,s)===-1}).length&&i.sync()))),p.length>0?h(0):d()}).fail(function(e){c(),d(),e&&i.error(e)})):void d()};return i.api>=2.1&&"object"==typeof t[0]?p():d(),r},checkFile:function(t,n,i){if(t.checked||"files"==t.type)return t.files;if("data"==t.type){var a,o,r=e.Deferred(),s=e.Deferred(),l=[],c=[],d=0,p=[],u=!1,h=function(e){return Array.prototype.slice.call(e||[],0)},f=function(e){var t,i,a=n.options.folderUploadExclude[n.OS]||null,o=e.length,r=function(){--d<1&&"pending"===s.state()&&s.resolve()},m=function(e){a&&e.name.match(a)||(c.push(t.fullPath||""),l.push(e)),r()},i=function(e){var t=[],n=function(){e.readEntries(function(e){if(u||!e.length){for(var i=0;i=2.1&&(d++,p.push(t.fullPath),i(t.createReader())))}return r(),s};return a=e.map(t.files.items,function(e){return e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry()}),e.each(a,function(e,t){if(t.isDirectory)return o=!0,!1}),a.length>0?(n.uploads.checkExists(a,i,n,o).done(function(o,s){var d=[];n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",i)&&(null===o&&(t.overwrite=0,o=[]),a=e.grep(a,function(t){var a,r,l,c;return t.isDirectory&&o.length&&(a=e.inArray(t.name,o),a!==-1&&(o.splice(a,1),r=n.uniqueName(t.name+n.options.backupSuffix,null,""),e.each(s,function(e,n){if(t.name==n)return l=e,!1}),l||(l=n.fileByName(t.name,i).hash),n.lockfiles({files:[l]}),c=n.request({data:{cmd:"rename",target:l,name:r},notify:{type:"rename",cnt:1}}).fail(function(){t._remove=!0,n.sync()}).always(function(){n.unlockfiles({files:[l]})}),d.push(c))),!t._remove})),e.when.apply(e,d).done(function(){var e,t,i=+new Date;a.length>0?(t=n.escape(a[0].name),a.length>1&&(t+=" ... "+a.length+n.i18n("items")),e=setTimeout(function(){n.notify({type:"readdir",id:i,cnt:1,hideCnt:!0,msg:n.i18n("ntfreaddir")+" ("+t+")",cancel:function(){u=!0}})},n.options.notifyDelay),f(a).done(function(){e&&clearTimeout(e),n.notify({type:"readdir",id:i,cnt:-1}),u?r.reject():r.resolve([l,c,o,s,p])}).fail(function(){r.reject()})):r.reject()})}),r.promise()):r.reject()}var m=[],g=[],v=t.files[0];if("html"==t.type){var b,y=e("").append(e.parseHTML(v.replace(/ src=/gi," _elfsrc=")));e("img[_elfsrc]",y).each(function(){var n,i,a=e(this),o=a.closest("a");o&&o.attr("href")&&o.attr("href").match(/\.(?:jpe?g|gif|bmp|png)/i)&&(i=o.attr("href")),n=a.attr("_elfsrc"),n&&(i?(e.inArray(i,m)==-1&&m.push(i),e.inArray(n,g)==-1&&g.push(n)):e.inArray(n,m)==-1&&m.push(n)),1===m.length&&m[0].match(/^data:image\/png/)&&(t.clipdata=!0)}),b=e("a[href]",y),b.each(function(){var t,n,i=function(e){var t=document.createElement("a");return t.href=e,t};(t=e(this).text())&&(n=i(e(this).attr("href")),n.href&&n.href.match(/^(?:ht|f)tp/i)&&(1===b.length||!n.pathname.match(/(?:\.html?|\/[^\/.]*)$/i)||e.trim(t).match(/\.[a-z0-9-]{1,10}$/i))&&e.inArray(n.href,m)==-1&&e.inArray(n.href,g)==-1&&m.push(n.href))})}else{var w,x,k;for(w=/((?:ht|f)tps?:\/\/[-_.!~*\'()a-z0-9;\/?:\@&=+\$,%#\*\[\]]+)/gi;x=w.exec(v);)k=x[1].replace(/&/g,"&"),e.inArray(k,m)==-1&&m.push(k)}return m},xhr:function(t,n){var i=n?n:this,a=i.getUI(),o=new XMLHttpRequest,r=null,s=null,l=null,c=t.checked,d=t.isDataType||"data"==t.type,p=t.target||i.cwd().hash,u=t.dropEvt||null,h=t.extraData||null,f=i.option("uploadMaxConn",p)!=-1,m=Math.min(5,Math.max(1,i.option("uploadMaxConn",p))),g=1e4,v=30,b=0,y=function(t){var n=e.Deferred();return t.promise?t.always(function(e){n.resolve(Array.isArray(e)&&e.length?d?e[0][0]:e[0]:{})}):n.resolve(t.length?d?t[0][0]:t[0]:{}),n},w=e.Deferred().fail(function(e){var t,a=i.parseError(e);"userabort"===a&&(t=!0,a=void 0),k&&(i.uploads.xhrUploading||t)?y(k).done(function(e){t||H(a,e),e._cid?i.uploads.chunkfailReq[e._cid]||(i.uploads.chunkfailReq[e._cid]=!0,setTimeout(function(){n.request({data:{cmd:"upload",target:p,chunk:e._chunk,cid:e._cid,upload:["chunkfail"],mimes:"chunkfail"},options:{type:"post",url:i.uploadURL},preventDefault:!0}).always(function(){delete i.uploads.chunkfailReq[e._chunk]})},1e3)):(i.uploads.failSyncTm&&clearTimeout(i.uploads.failSyncTm),i.uploads.failSyncTm=setTimeout(function(){i.sync(p)},1e3))}):H(a),!t&&i.sync(),i.uploads.xhrUploading=!1,k=null}).done(function(t){i.uploads.xhrUploading=!1,k=null,t&&(i.currentReqCmd="upload",t.warning&&H(t.warning),i.updateCache(t),t.removed&&t.removed.length&&i.remove(t),t.added&&t.added.length&&i.add(t),t.changed&&t.changed.length&&i.change(t),i.trigger("upload",t,!1),i.trigger("uploaddone"),t.toasts&&Array.isArray(t.toasts)&&e.each(t.toasts,function(){this.msg&&i.toast(this)}),t.sync&&i.sync(),t.debug&&(i.responseDebug(t),n.debug("backend-debug",t)))}).always(function(){i.abortXHR(o),a.off("uploadabort",D),e(window).off("unload",D),r&&clearTimeout(r),s&&clearTimeout(s),l&&clearTimeout(l),c&&!t.multiupload&&F()&&i.notify({type:"upload",cnt:-C,progress:0,size:0}),s&&M&&i.notify({type:"chunkmerge",cnt:-C}),B&&O.children(".elfinder-notify-chunkmerge").length&&i.notify({type:"chunkmerge",cnt:-1})}),x=new FormData,k=t.input?t.input.files:i.uploads.checkFile(t,i,p),C=t.checked&&d?k[0].length:k.length,z=!1,T=0,A=0,j=0,S=!1,O=i.ui.notify,I=!0,M=!1,E=!1,F=function(){return!S&&($=O.children(".elfinder-notify-upload")).length&&(S=!0),S},D=function(e,t){E=!0,i.abortXHR(o,{quiet:!0,abort:!0}),w.reject(t),F()&&i.notify({type:"upload",cnt:$.data("cnt")*-1,progress:0,size:0})},U=function(e,t){$.children(".elfinder-notify-cancel")[e?"show":"hide"](),I=e},P=function(e){return e||(e=j),setTimeout(function(){S=!0,i.notify({type:"upload",cnt:C,progress:T-A,size:e,cancel:function(){a.trigger("uploadabort","userabort")}}),$=O.children(".elfinder-notify-upload"),A=T,t.multiupload?I&&U(!0):U(I&&T=2.1029&&(e=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),"function"==typeof x["delete"]&&x["delete"]("reqid"),x.append("reqid",e),o._requestId=e),o.send(x))},g)):a.trigger("uploadabort",["errAbort","errTimeout"])},R=function(){S&&w.notifyWith($,[{cnt:$.data("cnt"),progress:$.data("progress"),total:$.data("total")}])},H=function(e,t,n){e&&i.trigger("xhruploadfail",{error:e,file:t}),n?e&&(N=i.options.maxErrorDialogs&&(_=_.concat("moreErrors",N-i.options.maxErrorDialogs)),i.error(_)),_=[],N=0)},_=[],N=0,L=t.renames||null,W=t.hashes||null,B=!1,$=e();if(a.one("uploadabort",D),e(window).one("unload."+n.namespace,D),!B&&(A=T),!d&&!C)return w.reject(["errUploadNoFiles"]);o.addEventListener("error",function(){0==o.status?E?w.reject():!d&&t.files&&e.grep(t.files,function(e){return!e.type&&e.size===(i.UA.Safari?1802:0)}).length?w.reject(["errAbort","errFolderUpload"]):t.input&&e.grep(t.input.files,function(e){return!e.type&&e.size===(i.UA.Safari?1802:0)}).length?w.reject(["errUploadNoFiles"]):q():a.trigger("uploadabort","errConnect")},!1),o.addEventListener("load",function(e){var n,s,c=o.status,p=0,u="";if(i.setCustomHeaderByXhr(o),c>=400?u=c>500?"errResponse":["errResponse","errServerError"]:o.responseText||(u=["errResponse","errDataEmpty"]),u&&(a.trigger("uploadabort"),y(k||{}).done(function(e){return w.reject(e._cid?null:u)})),T=j,F()&&(p=T-A)&&(i.notify({type:"upload",cnt:0,progress:p,size:0}),R()),n=i.parseUploadData(o.responseText),n._chunkmerged){x=new FormData;var h=[{_chunkmerged:n._chunkmerged,_name:n._name,_mtime:n._mtime}];return B=!0,a.off("uploadabort",D),l=setTimeout(function(){i.notify({type:"chunkmerge",cnt:1})},i.options.notifyDelay),void(d?V(h,k[1]):V(h))}n._multiupload=!!t.multiupload,n.error?(s={cmd:"upload",err:n,xhr:o,rc:o.status},i.trigger("uploadfail",n),i.trigger("requestError",s),s._getEvent&&s._getEvent().isDefaultPrevented()&&(n.error=""),n._chunkfailure||n._multiupload?(E=!0,i.uploads.xhrUploading=!1,r&&clearTimeout(r),$.length?(i.notify({type:"upload",cnt:-C,progress:0,size:0}),w.reject(n)):w.reject()):w.reject(n)):w.resolve(n)},!1),o.upload.addEventListener("loadstart",function(e){!B&&e.lengthComputable&&(T=e.loaded,b&&(T=0),j=e.total,T||(T=parseInt(.05*j)),F()&&(i.notify({type:"upload",cnt:0,progress:T-A,size:t.multiupload?0:j}),A=T,R()))},!1),o.upload.addEventListener("progress",function(e){var n;e.lengthComputable&&!B&&o.readyState<2&&(T=e.loaded,!t.checked&&T>0&&!r&&(r=P(o._totalSize-T)),j||(j=e.total,T||(T=parseInt(.05*j))),n=T-A,F()&&n/e.total>=.05&&(i.notify({type:"upload",cnt:0,progress:n,size:0}),A=T,R()),!M&&T>=j&&!z&&(M=!0,s=setTimeout(function(){i.notify({type:"chunkmerge",cnt:C})},i.options.notifyDelay)),I&&!t.multiupload&&T>=j&&F()&&U(!1))},!1);var V=function(a,s){var l,g,v,b,y,k,T,A,j,S,O,M,D,q,R,N=0,B=1,$=[],V=0,K=C,X=0,J=[],G=(new Date).getTime().toString().substr(-9),Y=Math.min((n.uplMaxSize?n.uplMaxSize:2097152)-8190,n.options.uploadMaxChunkSize),Q=!f&&"",Z=function(a,o){var s,l,c,h=[],f=0;if(!E){for(;a.length&&h.length=2.1&&("slice"in j?Q="slice":"mozSlice"in j?Q="mozSlice":"webkitSlice"in j&&(Q="webkitSlice")))}catch(te){C--,K--;continue}if(l&&g>l||!Q&&n.uplMaxSize&&g>n.uplMaxSize)H(["errUploadFile",j.name,"errUploadFileSize"],j,!0),C--,K--;else if(!j.type||i.uploadMimeCheck(j.type,p))if(Q&&g>Y){for(k=0,T=Y,A=-1,K=Math.floor((g-1)/Y),v=j.lastModified?Math.round(j.lastModified/1e3):0,b=t.clipdata?n.date(n.nonameDateFormat)+".png":j.name,X+=g,J[G]=0;kn.uplMaxSize||B>n.uplMaxFile)&&(N=0,B=1,V++),"undefined"==typeof $[V]&&($[V]=[],d&&($[V][0]=[],$[V][1]=[])),d?($[V][0].push(j),$[V][1].push(s[y])):$[V].push(j),N+=g,X+=g,B++;else H(["errUploadFile",j.name,"errUploadMime","("+j.type+")"],j,!0),C--,K--}if(_.length&&H(),0==$.length)return t.checked=!0,!1;if($.length>1)return r=P(X),O=[],M=0,D=$.length,q=[],ee(),!0;d?(a=$[0][0],s=$[0][1]):a=$[0]}return c||(n.UA.Safari&&t.files?o._totalSize=X:r=P(X)),c=!0,a.length||w.reject(["errUploadNoFiles"]),o.open("POST",i.uploadURL,!0),n.customHeaders&&e.each(n.customHeaders,function(e){o.setRequestHeader(e,this)}),n.xhrFields&&e.each(n.xhrFields,function(e){e in o&&(o[e]=this)}),i.api>=2.1029&&(R=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),x.append("reqid",R),o._requestId=R),x.append("cmd","upload"),x.append(i.newAPI?"target":"current",p),L&&L.length&&(e.each(L,function(e,t){x.append("renames[]",t)}),x.append("suffix",n.options.backupSuffix)),W&&e.each(W,function(e,t){x.append("hashes["+e+"]",t)}),e.each(i.customData,function(e,t){x.append(e,t)}),e.each(i.options.onlyMimes,function(e,t){x.append("mimes[]",t)}),e.each(a,function(e,i){var a,o;i._chunkmerged?(x.append("chunk",i._chunkmerged),x.append("upload[]",i._name),x.append("mtime[]",i._mtime),t.clipdata&&x.append("overwrite",0),z=!0):(i._chunkfail?(x.append("upload[]","chunkfail"),x.append("mimes","chunkfail")):(t.clipdata?i._chunk||(t.overwrite=0,a=n.date(n.nonameDateFormat)+".png"):i.name&&(a=i.name,n.UA.iOS&&(a.match(/^image\.jpe?g$/i)?(t.overwrite=0,a=n.date(n.nonameDateFormat)+".jpg"):a.match(/^capturedvideo\.mov$/i)&&(t.overwrite=0,a=n.date(n.nonameDateFormat)+".mov")),o=(i.webkitRelativePath||i.relativePath||i._relativePath||"").replace(/[^\/]+$/,""),a=o+a),a?x.append("upload[]",i,a):x.append("upload[]",i)),i._chunk?(x.append("chunk",i._chunk),x.append("cid",i._cid),x.append("range",i._range),x.append("mtime[]",i._mtime),z=!0):x.append("mtime[]",i.lastModified?Math.round(i.lastModified/1e3):0))}),d&&e.each(s,function(e,t){x.append("upload_path[]",t)}),0===t.overwrite&&x.append("overwrite",0),u&&x.append("dropWith",parseInt((u.altKey?"1":"0")+(u.ctrlKey?"1":"0")+(u.metaKey?"1":"0")+(u.shiftKey?"1":"0"),2)),h&&e.each(h,function(e,t){x.append(e,t)}),o.send(x),!0};if(d)c?V(k[0],k[1]):k.done(function(t){if(L=[],C=t[0].length){if(t[4]&&t[4].length)return void n.request({data:{cmd:"mkdir",target:p,dirs:t[4]},notify:{type:"mkdir",cnt:t[4].length},preventFail:!0}).fail(function(e){e=e||["errUnknown"],"errCmdParams"===e[0]?m=1:(m=0,w.reject(e))}).done(function(n){var i=!1;n.hashes||(n.hashes={}),t[1]=e.map(t[1],function(e,a){return t[0][a]._relativePath=e.replace(/^\//,""),e=e.replace(/\/[^\/]*$/,""),""===e?p:n.hashes[e]?n.hashes[e]:(i=!0,t[0][a]._remove=!0,null)}),i&&(t[0]=e.grep(t[0],function(e){return!e._remove}))}).always(function(e){m&&(L=t[2],W=t[3],V(t[0],t[1]))});t[1]=e.map(t[1],function(){return p}),L=t[2],W=t[3],V(t[0],t[1])}else w.reject(["errUploadNoFiles"])}).fail(function(){w.reject()});else if(k.length>0)if(t.clipdata||null!=L)V(k)||w.reject();else{var K=[],X=[],J=n.options.folderUploadExclude[n.OS]||null;e.each(k,function(t,n){var i,a,o=n.webkitRelativePath||n.relativePath||"";return!!o&&(J&&n.name.match(J)?(n._remove=!0,o=void 0):(o="/"+o.replace(/\/[^\/]*$/,"").replace(/^\//,""),o&&e.inArray(o,K)===-1&&(K.push(o),i=o.substr(1).indexOf("/"),i!==-1&&(a=o.substr(0,i+1))&&e.inArray(a,K)===-1&&K.unshift(a))),void X.push(o))}),L=[],W={},K.length?!function(){var t=e.map(K,function(e){return e.substr(1).indexOf("/")===-1?{name:e.substr(1)}:null}),i=[];n.uploads.checkExists(t,p,n,!0).done(function(a,o){var r,s,l,c=[];n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",p)&&(i=e.map(t,function(e){return e._remove?e.name:null}),t=e.grep(t,function(e){return!e._remove})),i.length&&e.each(X.concat(),function(t,n){0===e.inArray(n,i)&&(k[t]._remove=!0,X[t]=void 0)}),k=e.grep(k,function(e){return!e._remove}),X=e.grep(X,function(e){return void 0!==e}),t.length?(r=e.Deferred(),a.length?e.each(a,function(t,i){s=n.uniqueName(i+n.options.backupSuffix,null,""),e.each(o,function(e,t){if(a[0]==t)return l=e,!1}),l||(l=n.fileByName(a[0],p).hash),n.lockfiles({files:[l]}),c.push(n.request({data:{cmd:"rename",target:l,name:s},notify:{type:"rename",cnt:1}}).fail(function(e){w.reject(e),n.sync()}).always(function(){n.unlockfiles({files:[l]})}))}):c.push(null),e.when.apply(e,c).done(function(){n.request({data:{cmd:"mkdir",target:p,dirs:K},notify:{type:"mkdir",cnt:K.length},preventFail:!0}).fail(function(e){e=e||["errUnknown"],"errCmdParams"===e[0]?m=1:(m=0,w.reject(e))}).done(function(t){var n=!1;t.hashes||(t.hashes={}),X=e.map(X.concat(),function(e,i){return"/"===e?p:t.hashes[e]?t.hashes[e]:(n=!0,k[i]._remove=!0,null)}),n&&(k=e.grep(k,function(e){return!e._remove}))}).always(function(e){m&&(d=!0,V(k,X)||w.reject())})})):w.reject()})}():n.uploads.checkExists(k,p,n).done(function(i,a){n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",p)&&(W=a,null===i?t.overwrite=0:L=i,k=e.grep(k,function(e){return!e._remove})),C=k.length,C>0?V(k)||w.reject():w.reject()})}else w.reject();return w},iframe:function(t,n){var i,a,o,r,s=n?n:this,l=!!t.input&&t.input,c=!l&&s.uploads.checkFile(t,s),d=e.Deferred().fail(function(e){e&&s.error(e)}),p="iframe-"+n.namespace+ ++s.iframeCnt,u=e('
'),h=this.UA.IE,f=function(){r&&clearTimeout(r),o&&clearTimeout(o),a&&s.notify({type:"upload",cnt:-i}),setTimeout(function(){h&&e('