All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.elfinder.js.elfinder4efw.min.js Maven / Gradle / Ivy

Go to download

"efw" is an Ajax framework for server site JavaScript designed and developed by Escco Co., Ltd. using a goal-oriented method. It is provided as open source free software.

There is a newer version: 4.07.023jakarta
Show newest version
/*!
 * elFinder - file manager for web
 * Version 2.1.20 (2017-01-11)
 * http://elfinder.org
 * 
 * Copyright 2009-2017, Studio 42
 * Licensed under a 3-clauses BSD license
 */
/*
 * Efw does not support commands:
 * search,resize,places,quicklook,netmount,netunmount,help,extract,chmod,archive
 * Efw Changed download upload send and so on.
 * Efw Adds setReadOnly setHome setHeight setWidth funtions to elfinder object.
 * minimized by https://jscompress.com/
 */
!function(e,t){if("function"==typeof define&&define.amd)define(["jquery","jquery-ui"],t);else if("undefined"!=typeof exports){var n,i;try{n=require("jquery"),i=require("jquery-ui")}catch(e){}module.exports=t(n)}else t(e.jQuery,e.jQuery.ui,!0)}(this,function(Ce,e,t){var a,r,o,s,l,d,n,i,c,u,h,ye=function(u,e){function k(e){var t,n,a,i,r,o,s,l={},d={};2.1<=j.api?(j.commandMap=e.options.uiCmdMap&&Object.keys(e.options.uiCmdMap).length?e.options.uiCmdMap:{},de!==JSON.stringify(j.commandMap)&&(de=JSON.stringify(j.commandMap),Object.keys(j.commandMap).length&&((n=j.getUI("contextmenu")).data("cmdMaps")||n.data("cmdMaps",{}),(t=e.cwd?e.cwd.volumeid:null)&&!n.data("cmdMaps")[t]&&(n.data("cmdMaps")[t]=j.commandMap)))):j.options.sync=0,e.init?J={}:(s=X,a="elfinder-subtree-loaded "+j.res("class","navexpand"),j.res("class","navcollapse"),i=Object.keys(J),r=function(e,t){if(!J[t])return!0;var n="directory"===J[t].mime,i=J[t].phash;(!n||l[i]||!d[i]&&Ce("#"+j.navHash2Id(J[t].hash)).is(":hidden")&&100
").append(u.contents()),R=u.attr("style"),N=u.attr("id")||"",q="elfinder-"+(N||Math.random().toString().substr(2,7)),L="mousedown."+q,W="keydown."+q,K="keypress."+q,B=!0,Y=!0,X="",$={path:"",url:"",tmbUrl:"",disabled:[],separator:"/",archives:[],extract:[],copyOverwrite:!0,uploadOverwrite:!0,uploadMaxSize:0,jpgQuality:100,tmbCrop:!1,tmb:!1},J={},V=[],G={},Q={},Z=[],ee=[],te=[],ne=[],ie=new j.command(j),ae="auto",re=400,oe="./sounds/",se=Ce(document.createElement("audio")).hide().appendTo("body")[0],le=0,de="",ce=function(e){for(var t,n={name:!0,perm:!0,date:!0,size:!0,kind:!0},i=0===j.sorters.length,a=e.length,r=0;r script[src$="js/elfinder.min.js"],script[src$="js/elfinder.full.js"]:first')).length?(n=Ce(""),Ce("head").append(n),o=o.attr("src").replace(/js\/[^\/]+$/,""),t.loadCss([o+"css/elfinder.min.css",o+"css/theme.css"]),Ce.isArray(t.options.cssAutoLoad)&&t.loadCss(t.options.cssAutoLoad),a=1e3,i=setInterval(function(){0<--a&&"hidden"!==u.css("visibility")&&(clearInterval(i),n.remove(),t.trigger("cssloaded"))},10)):t.options.cssAutoLoad=!1),this.optionProperties=["icon","csscls","tmbUrl","uiCmdMap","netkey"],e.ui&&(this.options.ui=e.ui),e.commands&&(this.options.commands=e.commands),e.uiOptions&&e.uiOptions.toolbar&&(this.options.uiOptions.toolbar=e.uiOptions.toolbar),e.uiOptions&&e.uiOptions.cwd&&e.uiOptions.cwd.listView&&e.uiOptions.cwd.listView.columns&&(this.options.uiOptions.cwd.listView.columns=e.uiOptions.cwd.listView.columns),e.uiOptions&&e.uiOptions.cwd&&e.uiOptions.cwd.listView&&e.uiOptions.cwd.listView.columnsCustomName&&(this.options.uiOptions.cwd.listView.columnsCustomName=e.uiOptions.cwd.listView.columnsCustomName),he||this.options.enableAlways||2!==Ce("body").children().length||(this.options.enableAlways=!0),this.isCORS=!1,(o=document.createElement("a")).href=e.url,e.urlUpload&&e.urlUpload!==e.url&&((r=document.createElement("a")).href=e.urlUpload),(window.location.host!==o.host||r&&window.location.host!==r.host)&&(j.isCORS=!0,Ce.isPlainObject(j.options.customHeaders)||(j.options.customHeaders={}),Ce.isPlainObject(j.options.xhrFields)||(j.options.xhrFields={}),j.options.requestType="post",j.options.customHeaders["X-Requested-With"]="XMLHttpRequest",j.options.xhrFields.withCredentials=!0),Ce.extend(this.options.contextmenu,e.contextmenu),this.requestType=/^(get|post)$/i.test(this.options.requestType)?this.options.requestType.toLowerCase():"get",this.customData=Ce.isPlainObject(this.options.customData)?this.options.customData:{},this.customHeaders=Ce.isPlainObject(this.options.customHeaders)?this.options.customHeaders:{},this.xhrFields=Ce.isPlainObject(this.options.xhrFields)?this.options.xhrFields:{},this.abortCmdsOnOpen=this.options.abortCmdsOnOpen||["tmb"],this.id=N,this.navPrefix="nav"+(ye.prototype.uniqueid||"")+"-",this.cwdPrefix=ye.prototype.uniqueid?"cwd"+ye.prototype.uniqueid+"-":"",++ye.prototype.uniqueid,this.uploadURL=e.urlUpload||e.url,this.namespace=q,this.lang=this.i18[this.options.lang]&&this.i18[this.options.lang].messages?this.options.lang:"en",e="en"==this.lang?this.i18.en:Ce.extend(!0,{},this.i18.en,this.i18[this.lang]),this.direction=e.direction,this.messages=e.messages,this.dateFormat=this.options.dateFormat||e.dateFormat,this.fancyFormat=this.options.fancyDateFormat||e.fancyDateFormat,this.today=new Date(ue.getFullYear(),ue.getMonth(),ue.getDate()).getTime()/1e3,this.yesterday=this.today-86400,ue=this.options.UTCDate?"UTC":"",this.getHours="get"+ue+"Hours",this.getMinutes="get"+ue+"Minutes",this.getSeconds="get"+ue+"Seconds",this.getDate="get"+ue+"Date",this.getDay="get"+ue+"Day",this.getMonth="get"+ue+"Month",this.getFullYear="get"+ue+"FullYear",this.cssClass="ui-helper-reset ui-helper-clearfix ui-widget ui-widget-content ui-corner-all elfinder elfinder-"+("rtl"==this.direction?"rtl":"ltr")+(this.UA.Touch?" elfinder-touch"+(this.options.resizable?" touch-punch":""):"")+(this.UA.Mobile?" elfinder-mobile":"")+" "+this.options.cssClass,this.zIndex,this.searchStatus={state:0,query:"",target:"",mime:"",mixed:!1,ininc:!1},this.storage=function(){try{return"localStorage"in window&&null!==window.localStorage?(j.UA.Safari&&(window.localStorage.setItem("elfstoragecheck",1),window.localStorage.removeItem("elfstoragecheck")),j.localStorage):j.cookie}catch(e){return j.cookie}}(),this.viewType=this.storage("view")||this.options.defaultView||"icons",this.sortType=this.storage("sortType")||this.options.sortType||"name",this.sortOrder=this.storage("sortOrder")||this.options.sortOrder||"asc",this.sortStickFolders=this.storage("sortStickFolders"),null===this.sortStickFolders?this.sortStickFolders=!!this.options.sortStickFolders:this.sortStickFolders=!!this.sortStickFolders,this.sortAlsoTreeview=this.storage("sortAlsoTreeview"),null===this.sortAlsoTreeview?this.sortAlsoTreeview=!!this.options.sortAlsoTreeview:this.sortAlsoTreeview=!!this.sortAlsoTreeview,this.sortRules=Ce.extend(!0,{},this._sortRules,this.options.sortRules),Ce.each(this.sortRules,function(e,t){"function"!=typeof t&&delete j.sortRules[e]}),this.compare=Ce.proxy(this.compare,this),this.notifyDelay=0e.pageY)||ce.pageX?n.data("autoScr",(l?"navbar":"cwd")+(t?"Up":"Down")):n.data("autoScr",(l?"cwd":"navbar")+(t?"Up":"Down")),n.data("autoScrVal",Math.pow(t?d.top-e.pageY:e.pageY-c,1.3))):n.data("autoScr")&&n.data("refreshPositions",1).data("autoScr",null),n.data("refreshPositions")&&Ce(this).elfUiWidgetInstance("draggable")&&(0
';return e&&(t=Ce(t).addClass(e.className).css("background-image","url('"+e.url+"')").get(0).outerHTML),t}var i,a,r=this.id?Ce(this):Ce(this).parents("[id]:first"),o=Ce('
');return j.draggingUiHelper&&j.draggingUiHelper.stop(!0,!0),j.trigger("dragstart",{target:r[0],originalEvent:e}),i=r.hasClass(j.res("class","cwdfile"))?j.selected():[j.navId2Hash(r.attr("id"))],o.append(n(J[i[0]])).data("files",i).data("locked",!1).data("droped",!1).data("namespace",q).data("dropover",0),1<(r=i.length)&&o.append(n(J[i[r-1]])+''+r+""),Ce(document).on(p,function(e){e=e.shiftKey||e.ctrlKey||e.metaKey;a!==e&&(a=e,o.is(":visible")&&o.data("dropover")&&!o.data("droped")&&(o.toggleClass("elfinder-drag-helper-plus",!!o.data("locked")||a),j.trigger(a?"unlockfiles":"lockfiles",{files:i,helper:o})))}),o}},this.droppable={greedy:!0,tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file,.elfinder-cwd-filename",hoverClass:this.res("class","adroppable"),classes:{"ui-droppable-hover":this.res("class","adroppable")},autoDisable:!0,drop:function(e,t){var n,i,a,r=Ce(this),o=Ce.map(t.helper.data("files")||[],function(e){return e||null}),s=[],l=[],d=[],c=t.helper.hasClass("elfinder-drag-helper-plus");if(void 0===e.button||t.helper.data("namespace")!==q||!j.insideWorkzone(e.pageX,e.pageY))return!1;for(i=r.hasClass(j.res("class","cwdfile"))?j.cwdId2Hash(r.attr("id")):r.hasClass(j.res("class","navdir"))?j.navId2Hash(r.attr("id")):X,n=o.length;n--;)((a=o[n])!=i&&J[a].phash!=i?s:c&&a!==i&&J[i].write?l:d).push(a);if(d.length)return!1;t.helper.data("droped",!0),l.length&&(t.helper.hide(),j.exec("duplicate",l)),s.length&&(t.helper.hide(),j.clipboard(s,!c),j.exec("paste",i,void 0,i).always(function(){j.clipboard([]),j.trigger("unlockfiles",{files:o})}),j.trigger("drop",{files:o}))}},this.enabled=function(){return B&&this.visible()},this.visible=function(){return u[0].elfinder&&u.is(":visible")},this.isRoot=function(e){return!(!e.isroot&&e.phash)},this.root=function(n,e){var i,t;if(n=n||X,!e&&(Ce.each(j.roots,function(e,t){if(0===n.indexOf(e))return i=t,!1}),i))return i;for(i=J[n];i&&i.phash&&(e||!i.isroot);)i=J[i.phash];if(i)return i.hash;for(;t in J&&J.hasOwnProperty(t);)if(!(i=J[t]).phash&&"directory"==!i.mime&&i.read)return i.hash;return""},this.cwd=function(){return J[X]||{}},this.option=function(n,i){var a;return i=i||X,j.optionsByHashes[i]&&void 0!==j.optionsByHashes[i][n]?j.optionsByHashes[i][n]:X!==i?(a="",Ce.each(j.volOptions,function(e,t){if(0===i.indexOf(e))return a=t[n]||"",!1}),a):$[n]||""},this.getDisabledCmds=function(e){var n=[];return Ce.isArray(e)||(e=[e]),Ce.each(e,function(e,t){t=j.option("disabled",t);t&&Ce.each(t,function(e,t){-1===Ce.inArray(t,n)&&n.push(t)})}),n},this.file=function(e){return e?J[e]:void 0},this.files=function(){return Ce.extend(!0,{},J)},this.parents=function(e){for(var t,n=[];t=this.file(e);)n.unshift(t.hash),e=t.phash;return n},this.path2array=function(e,t){for(var n,i=[];e;){if(!(n=J[e])||!n.hash){i=[];break}i.unshift(t&&n.i18?n.i18:n.name),e=n.isroot?null:n.phash}return i},this.path=function(e,t,n){var i=J[e]&&J[e].path?J[e].path:this.path2array(e,t).join($.separator);if(n&&J[e]){n=Ce.extend({notify:{type:"parents",cnt:1,hideCnt:!0}},n);function a(){j.request({data:{cmd:"parents",target:J[e].phash},notify:s,preventFail:!0}).done(d).fail(function(){o.reject()})}var r,o=Ce.Deferred(),s=n.notify,l=!1,d=function(){j.one("parentsdone",function(){""===(i=j.path(e,t))&&l?(l=!1,a()):(s&&(clearTimeout(r),s.cnt=-parseInt(s.cnt||0),j.notify(s)),o.resolve(i))})};return i?o.resolve(i):(j.ui.tree?(s&&(r=setTimeout(function(){j.notify(s)},j.notifyDelay)),d(l=!0)):a(),o)}return i},this.url=function(e){var t,n=J[e];if(!n||!n.read)return"";if("1"==n.url&&this.request({data:{cmd:"url",target:e},preventFail:!0,options:{async:!1}}).done(function(e){n.url=e.url||""}).fail(function(){n.url=""}),n.url)return n.url;if(t=0===n.hash.indexOf(j.cwd().volumeid)?$.url:this.option("url",n.hash))return t+Ce.map(this.path2array(e),function(e){return encodeURIComponent(e)}).slice(1).join("/");e=Ce.extend({},this.customData,{cmd:"file",target:n.hash});return this.oldAPI&&(e.cmd="open",e.current=n.phash),this.options.url+(-1===this.options.url.indexOf("?")?"?":"&")+Ce.param(e,!0)},this.openUrl=function(e,t){var n=J[e],i="";if(!n||!n.read)return"";if(!t)if(n.url){if(1!=n.url)return n.url}else if($.url&&0===n.hash.indexOf(j.cwd().volumeid))return $.url+Ce.map(this.path2array(e),function(e){return encodeURIComponent(e)}).slice(1).join("/");return i=(i=this.options.url)+(-1===i.indexOf("?")?"?":"&")+(this.oldAPI?"cmd=open¤t="+n.phash:"cmd=file")+"&target="+n.hash,t&&(i+="&download=1"),Ce.each(this.options.customData,function(e,t){i+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)}),i},this.tmb=function(e){var t,n="elfinder-cwd-bgurl",i="";return!(!Ce.isPlainObject(e)||((j.searchStatus.state&&0!==e.hash.indexOf(j.cwd().volumeid)?(t=j.option("tmbUrl",e.hash),j.option("tmbCrop",e.hash)):(t=$.tmbUrl,$.tmbCrop))&&(n+=" elfinder-cwd-bgurl-crop"),"self"===t&&0===e.mime.indexOf("image/")?(i=j.openUrl(e.hash),n+=" elfinder-cwd-bgself"):(j.oldAPI||t)&&e&&e.tmb&&1!=e.tmb&&(i=t+e.tmb),!i))&&{url:i,className:n}},this.selected=function(){return V.slice(0)},this.selectedFiles=function(){return Ce.map(V,function(e){return J[e]?Ce.extend({},J[e]):null})},this.fileByName=function(e,t){for(var n in J)if(J.hasOwnProperty(n)&&J[n].phash==t&&J[n].name==e)return J[n]},this.validResponse=function(e,t){return t.error||this.rules[this.rules[e]?e:"defaults"](t)},this.returnBytes=function(e){var t;return isNaN(e)?(t=(e=(e=e||"").replace(/b$/i,"")).charAt(e.length-1).toLowerCase(),e=e.replace(/[tgmk]$/i,""),"t"==t?e=1024*e*1024*1024*1024:"g"==t?e=1024*e*1024*1024:"m"==t?e=1024*e*1024:"k"==t&&(e*=1024),e=isNaN(e)?0:parseInt(e)):(e=parseInt(e))<1&&(e=0),e},this.request=function(e){function t(e){e.warning&&s.error(e.warning),h&&k(e),s.lazy(function(){e.removed&&e.removed.length&&s.remove(e),e.added&&e.added.length&&s.add(e),e.changed&&e.changed.length&&s.change(e)}).then(function(){return s.lazy(function(){s.trigger(u,e)})}).then(function(){return s.lazy(function(){s.trigger(u+"done")})}).then(function(){e.sync&&s.sync()})}function n(e,t){var n,i;switch(t){case"abort":n=e.quiet?"":["errConnect","errAbort"];break;case"timeout":n=["errConnect","errTimeout"];break;case"parsererror":n=["errResponse","errDataNotJSON"],e.responseText&&(s.debug("backend-debug",{debug:{phpErrors:[e.responseText]}}),X||e.responseText&&n.push(e.responseText));break;default:if(e.responseText)try{(i=JSON.parse(e.responseText))&&i.error&&(n=i.error)}catch(e){}if(!n)if(403==e.status)n=["errConnect","errAccess","HTTP error "+e.status];else if(404==e.status)n=["errConnect","errNotFound","HTTP error "+e.status];else{if(414==e.status&&"get"===x.type)return x.type="post",void(d.xhr=e=s.transport.send(x).fail(n).done(C));n=e.quiet?"":["errConnect","HTTP error "+e.status]}}s.trigger(u+"done"),d.reject(n,e,t)}function i(e){if(s.trigger(u+"done"),"autosync"==e.type){if("stop"!=e.data.action)return}else if(!("unload"==e.type||"destroy"==e.type||"openxhrabort"==e.type||e.data.added&&e.data.added.length))return;"pending"==r.state()&&(r.quiet=!0,r.abort(),"unload"!=e.type&&"destroy"!=e.type&&s.autoSync())}var a,r,o,s=this,l=this.options,d=Ce.Deferred(),c=Ce.extend({},l.customData,{mimes:l.onlyMimes},e.data||e),u=c.cmd,h="open"===u,p=!(e.preventDefault||e.preventFail),f=!(e.preventDefault||e.preventDone),m=Ce.extend({},e.notify),g=!!e.cancel,v=!!e.raw,b=e.syncOnFail,y=!!e.lazy,w=e.prepare,x=Ce.extend({url:l.url,async:!0,type:this.requestType,dataType:"json",cache:!1,contentType:"application/json;charset=UTF-8",data:JSON.stringify({eventId:"elfinder_cmds",lang:efw.lang,params:c}),headers:this.customHeaders,xhrFields:this.xhrFields},e.options||{}),C=function(i){if(s.currentReqCmd=u,v)return i&&i.debug&&s.debug("backend-debug",i),d.resolve(i);if(!i)return d.reject(["errResponse","errDataEmpty"],r,i);if(i.actions)(new EfwClient)._showActions("elfinder_cmds",i.actions);else{if(!Ce.isPlainObject(i))return d.reject(["errResponse","errDataNotJSON"],r,i);if(i.error)return d.reject(i.error,r,i);if(!s.validResponse(u,i))return d.reject("errResponse",r,i);function e(){function e(n){s.leafRoots[c.target]&&i[n]&&Ce.each(s.leafRoots[c.target],function(e,t){(t=s.file(t))&&i[n].push(t)})}h?e("files"):"tree"===u&&e("tree"),i=s.normalize(i),s.api||(s.api=i.api||1,"2.0"==s.api&&void 0!==i.options.uploadMaxSize&&(s.api="2.1"),s.newAPI=2<=s.api,s.oldAPI=!s.newAPI),i.options&&($=Ce.extend({},$,i.options)),i.netDrivers&&(s.netDrivers=i.netDrivers),i.maxTargets&&(s.maxTargets=i.maxTargets),h&&c.init&&(s.uplMaxSize=s.returnBytes(i.uplMaxSize),s.uplMaxFile=i.uplMaxFile?parseInt(i.uplMaxFile):20),"function"==typeof w&&w(i),d.resolve(i),i.debug&&s.debug("backend-debug",i)}y?s.lazy(e):e()}},l=function(){if(d.fail(function(e,t,n){s.trigger(u+"fail",n),e&&(p?s.error(e):s.debug("error",s.i18n(e))),b&&s.sync()}),!u)return b=!1,d.reject("errCmdReq");if(s.maxTargets&&c.targets&&c.targets.length>s.maxTargets)return b=!1,d.reject(["errMaxTargets",s.maxTargets]);if(f&&d.done(t),m.type&&m.cnt&&(g&&(m.cancel=d),a=setTimeout(function(){s.notify(m),d.always(function(){m.cnt=-(parseInt(m.cnt)||0),s.notify(m)})},s.notifyDelay),d.always(function(){clearTimeout(a)})),h){for(;o=te.pop();)"pending"==o.state()&&(o.quiet=!0,o.abort());if(X!==c.target)for(;o=ne.pop();)"pending"==o.state()&&(o.quiet=!0,o.abort())}return-1!==Ce.inArray(u,(s.cmdsToAdd+" autosync").split(" "))&&("autosync"!==u&&(s.autoSync("stop"),d.always(function(){s.autoSync()})),s.trigger("openxhrabort")),delete x.preventFail,d.xhr=r=s.transport.send(x).fail(n).done(C),h||c.compare&&"info"===u?(te.unshift(r),c.compare&&s.bind(s.cmdsToAdd+" autosync openxhrabort",i),d.always(function(){var e=Ce.inArray(r,te);c.compare&&s.unbind(s.cmdsToAdd+" autosync openxhrabort",i),-1!==e&&te.splice(e,1)})):-1!==Ce.inArray(u,s.abortCmdsOnOpen)&&(ne.unshift(r),d.always(function(){var e=Ce.inArray(r,ne);-1!==e&&ne.splice(e,1)})),s.bind("unload destroy",i),d.always(function(){s.unbind("unload destroy",i)}),d},e={opts:e,result:!0};return s.trigger("request."+u,e,!0),e.result?"object"==typeof e.result&&e.result.promise?(e.result.done(l).fail(function(){s.trigger(u+"done"),d.reject()}),d):l():(s.trigger(u+"done"),d.reject())},this.diff=function(e,n,i){var a={},r=[],o=[],s=[];return Ce.each(e,function(e,t){a[t.hash]=t}),Ce.each(J,function(e,t){a[e]||n&&t.phash!==n||o.push(e)}),Ce.each(a,function(e,t){var n=J[e];n?Ce.each(t,function(e){if((!i||-1===Ce.inArray(e,i))&&t[e]!==n[e])return s.push(t),!1}):r.push(t)}),Ce.each(o,function(e,t){var n=J[t],t=n.phash;t&&"directory"==n.mime&&-1===Ce.inArray(t,o)&&a[t]&&!function(e){for(var t=s.length;t--;)if(s[t].hash==e)return!0}(t)&&s.push(a[t])}),{added:r,removed:o,changed:s}},this.sync=function(r,n){this.autoSync("stop");var i,a,o,s=this,l=(i="",o=a=0,r&&n&&Ce.each(J,function(e,t){t.phash&&t.phash===r&&(++a,o=Math.max(o,t.ts)),i=a+":"+o}),i),d=Ce.Deferred().done(function(){s.trigger("sync")}),c=[this.request({data:{cmd:"open",reload:1,target:X,tree:!r&&this.ui.tree?1:0,compare:l},preventDefault:!0})];return r||(X!==this.root()&&c.push(this.request({data:{cmd:"parents",target:X},preventDefault:!0})),Ce.each(function(){for(var e,t=[],n=s.file(s.root(X)),i=n?n.volumeid:null,a=s.cwd().phash;a;)a=(e=s.file(a))?(0!==a.indexOf(i)&&(s.isRoot(e)||t.push({target:a,cmd:"tree"}),t.push({target:a,cmd:"parents"}),i=(n=s.file(s.root(a)))?n.volumeid:null),e.phash):null;return t}(),function(e,t){c.push(s.request({data:{cmd:t.cmd,target:t.target},preventDefault:!0}))})),Ce.when.apply(Ce,c).fail(function(e,t){n&&-1===Ce.inArray("errOpen",e)?d.reject(e&&0!=t.status?e:void 0):(d.reject(e),e&&s.request({data:{cmd:"open",target:s.lastDir("")||s.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}}))}).done(function(e){var t,n,i;if(!e.actions){if(e.cwd.compare&&l===e.cwd.compare)return d.reject();if(t={tree:[]},1<(n=arguments.length))for(i=1;i").append(e).appendTo(u).elfinderdialog(t,this),t=i.closest(".ui-dialog");return t.length&&(j.bind("resize",n),t.on("remove",function(){j.unbind("resize",n)})),i},this.toast=function(e){return Ce('
').appendTo(this.ui.toast).elfindertoast(e||{},this)},this.getUI=function(e){return this.ui[e]||u},this.getCommand=function(e){return void 0===e?this._commands:this._commands[e]},this.resize=function(e,t){u.css("width",e).height(t).trigger("resize"),this.trigger("resize",{width:u.width(),height:u.height()})},this.restoreSize=function(){this.resize(ae,re)},this.show=function(){u.show(),this.enable().trigger("show")},this.hide=function(){this.options.enableAlways&&(Y=B,B=!1),this.disable().trigger("hide"),u.hide()},this.lazy=function(e,t,i){function n(e){var t,n=u.data("lazycnt");e?(t=!u.data("lazyrepaint")&&i.repaint,n?u.data("lazycnt",++n):u.data("lazycnt",1).addClass("elfinder-processing"),t&&u.data("lazyrepaint",!0).css("display")):n&&1i.left+i.width+n||ti.top+i.height+n)},this.toFront=function(e){var t=u.children(":last");e=Ce(e),t.get(0)!==e.get(0)&&t.after(e)},this.getMaximizeCss=function(){return{width:"100%",height:"100%",margin:0,padding:0,top:0,left:0,display:"block",position:"fixed",zIndex:Math.max(j.zIndex?j.zIndex+1:0,1e3)}},function(){function i(){var i=0,a=0;Ce.each(u.children(".ui-dialog,.ui-draggable"),function(e,t){var n=Ce(t),t=n.position();t.top<0&&(n.css("top",i),i+=20),t.left<0&&(n.css("left",a),a+=20)})}he&&j.UA.Fullscreen&&(j.UA.Fullscreen=!1,pe&&void 0!==pe.attr("allowfullscreen")&&(j.UA.Fullscreen=!0));var a,t,r,o="elfinder-fullscreen",s="elfinder-fullscreen-native",l=j.UA.Fullscreen?{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 u.hasClass(o)?u.get(0):(e=u.find("."+o)).length?e.get(0):null},exitFull:function(){var e;Ce(window).off("resize."+q,c),void 0!==t&&Ce("body").css("overflow",t),t=void 0,a&&(e=a.elm,d(e),Ce(e).trigger("resize",{fullscreen:"off"})),Ce(window).trigger("resize")},toFull:function(e){return t=Ce("body").css("overflow")||"",Ce("body").css("overflow","hidden"),Ce(e).css(j.getMaximizeCss()).addClass(o).trigger("resize",{fullscreen:"on"}),i(),Ce(window).on("resize."+q,c).trigger("resize"),!0}},d=function(e){a&&a.elm==e&&(Ce(e).removeClass(o+" "+s).attr("style",a.style),a=null)},c=function(e){var t;e.target===window&&(r&&clearTimeout(r),r=setTimeout(function(){(t=l.fullElm())&&Ce(t).trigger("resize",{fullscreen:"on"})},100))};Ce(document).on("fullscreenchange."+q+" webkitfullscreenchange."+q+" mozfullscreenchange."+q+" MSFullscreenChange."+q,function(e){var t,n;j.UA.Fullscreen&&(t=l.fullElm(),n=Ce(window),r&&clearTimeout(r),null===t?(n.off("resize."+q,c),a&&(t=a.elm,d(t),Ce(t).trigger("resize",{fullscreen:"off"}))):(Ce(t).addClass(o+" "+s).attr("style","width:100%; height:100%; margin:0; padding:0;").trigger("resize",{fullscreen:"on"}),n.on("resize."+q,c),i()),n.trigger("resize"))}),j.toggleFullscreen=function(e,t){var n=Ce(e).get(0),e=null;if(e=l.fullElm()){if(e==n){if(!0===t)return e}else if(!1===t)return e;return l.exitFull(),null}return!1===t?null:!(a={elm:n,style:Ce(n).attr("style")})!==l.toFull(n)?n:a=null}}(),m="elfinder-maximized",j.toggleMaximize=function(e,t){var n=Ce(e);n.hasClass(m)?!0!==t&&(e=n,Ce(window).off("resize."+q,fe),Ce("body").css("overflow",e.data("bodyOvf")),e.removeClass(m).attr("style",e.data("orgStyle")).removeData("bodyOvf").removeData("orgStyle"),e.trigger("resize",{maximize:"off"})):!1!==t&&((n=n).data("bodyOvf",Ce("body").css("overflow")||"").data("orgStyle",n.attr("style")).addClass(m).css(j.getMaximizeCss()),Ce("body").css("overflow","hidden"),Ce(window).on("resize."+q,{elm:n},fe).trigger("resize"))},Ce.fn.selectable&&Ce.fn.draggable&&Ce.fn.droppable?u.length?this.options.url?(Ce.extend(Ce.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,CONTEXTMENU:93}),this.dragUpload=!1,this.xhrUpload=("undefined"!=typeof XMLHttpRequestUpload||"undefined"!=typeof XMLHttpRequestEventTarget)&&"undefined"!=typeof File&&"undefined"!=typeof FormData,this.transport={},this.transport.send=function(e){return Ce.ajax(e)},this.transport.upload=Ce.proxy(this.uploads.xhr,this),this.dragUpload=!0,this.decodeRawString=Ce.isFunction(this.options.rawStringDecoder)?this.options.rawStringDecoder:function(e){return function(e){for(var t,n=String.fromCharCode,i=0,a=e.length,r="";t=e[i],i>>4&3)-64,56320|(15&e[i++])<<6|63&e[i]):n(65533);return r}(function(e){var t,n,i,a=[];for("string"==typeof e&&(e=function(e){for(var t=0,n=e.length,i=[];tj.maxTargets?(n.push(e),null):J[e]?e:null}),n.length&&(j.trigger("unselectfiles",{files:n,inselect:!0}),j.toast({mode:"warning",msg:j.i18n(["errMaxTargets",j.maxTargets])}))}).error(function(e){var t={cssClass:"elfinder-dialog-error",title:j.i18n(j.i18n("error")),resizable:!1,destroyOnClose:!0,buttons:{}};t.buttons[j.i18n(j.i18n("btnClose"))]=function(){Ce(this).elfinderdialog("close")},e.data.opts&&Ce.isPlainObject(e.data.opts)&&Ce.extend(t,e.data.opts),j.dialog(''+j.i18n(e.data.error),t)}).bind("tree parents",function(e){ce(e.data.tree||[])}).bind("tmb",function(e){Ce.each(e.data.images||[],function(e,t){J[e]&&(J[e].tmb=t)})}).add(function(e){ce(e.data.added||[])}).change(function(e){Ce.each(e.data.changed||[],function(e,n){var i=n.hash;J[i]&&Ce.each(["locked","hidden","width","height"],function(e,t){J[i][t]&&!n[t]&&delete J[i][t]}),J[i]=J[i]?Ce.extend(J[i],n):n})}).remove(function(e){var t=e.data.removed||[],n=t.length,i={},a=function(n){var e=J[n];e&&("directory"===e.mime&&(i[n]&&delete j.roots[i[n]],Ce.each(J,function(e,t){t.phash==n&&a(e)})),delete J[n])};for(Ce.each(j.roots,function(e,t){i[t]=e});n--;)a(t[n])}).bind("searchstart",function(e){Ce.extend(j.searchStatus,e.data),j.searchStatus.state=1}).bind("search",function(e){j.searchStatus.state=2,ce(e.data.files||[])}).bind("searchend",function(){j.searchStatus.state=0,j.searchStatus.mixed=!1}),!0===this.options.sound&&this.bind("rm",function(e){var t=se.canPlayType&&se.canPlayType('audio/wav; codecs="1"');t&&""!=t&&"no"!=t&&Ce(se).html('')[0].play()}),Ce.each(this.options.handlers,function(e,t){j.bind(e,t)}),this.history=new this.history(this),this.commands.getfile&&("function"==typeof this.options.getFileCallback?(this.bind("dblclick",function(e){e.preventDefault(),j.exec("getfile").fail(function(){j.exec("open")})}),this.shortcut({pattern:"enter",description:this.i18n("cmdgetfile"),callback:function(){j.exec("getfile").fail(function(){j.exec("mac"==j.OS?"rename":"open")})}}).shortcut({pattern:"ctrl+enter",description:this.i18n("mac"==this.OS?"cmdrename":"cmdopen"),callback:function(){j.exec("mac"==j.OS?"rename":"open")}})):this.options.getFileCallback=null),this.roots={},this.leafRoots={},this._commands={},Ce.isArray(this.options.commands)||(this.options.commands=[]),-1!==Ce.inArray("*",this.options.commands)&&(this.options.commands=Object.keys(this.commands)),Ce.each(this.commands,function(e,t){var n,i=Ce.extend({},t.prototype);if(Ce.isFunction(t)&&!j._commands[e]&&(t.prototype.forceLoad||-1!==Ce.inArray(e,j.options.commands))){if(n=t.prototype.extendsCmd||""){if(!Ce.isFunction(j.commands[n]))return!0;t.prototype=Ce.extend({},ie,new j.commands[n],t.prototype)}else t.prototype=Ce.extend({},ie,t.prototype);j._commands[e]=new t,t.prototype=i,i=j.options.commandsOptions[e]||{},n&&j.options.commandsOptions[n]&&(i=Ce.extend(!0,{},j.options.commandsOptions[n],i)),j._commands[e].setup(e,i),j._commands[e].linkedCmds.length&&Ce.each(j._commands[e].linkedCmds,function(e,t){var n=j.commands[t];Ce.isFunction(n)&&!j._commands[t]&&(n.prototype=ie,j._commands[t]=new n,j._commands[t].setup(t,j.options.commandsOptions[t]||{}))})}}),this.commandMap={},this.volOptions={},this.optionsByHashes={},u.addClass(this.cssClass).on(L,function(){B||j.enable()}),this.ui={workzone:Ce("
").appendTo(u).elfinderworkzone(this),navbar:Ce("
").appendTo(u).elfindernavbar(this,this.options.uiOptions.navbar||{}),contextmenu:Ce("
").appendTo(u).elfindercontextmenu(this),overlay:Ce("
").appendTo(u).elfinderoverlay({show:function(){j.disable()},hide:function(){Y&&j.enable()}}),cwd:Ce("
").appendTo(u).elfindercwd(this,this.options.uiOptions.cwd||{}),notify:this.dialog("",{cssClass:"elfinder-dialog-notify",position:this.options.notifyDialog.position,absolute:!0,resizable:!1,autoOpen:!1,closeOnEscape:!1,title:" ",width:parseInt(this.options.notifyDialog.width)}),statusbar:Ce('
').hide().appendTo(u),toast:Ce('
').appendTo(u),bottomtray:Ce('
').appendTo(u)},this.uiAutoHide=[],this.one("open",function(){j.uiAutoHide.length&&setTimeout(function(){j.trigger("uiautohide")},500)}),this.bind("uiautohide",function(){j.uiAutoHide.length&&j.uiAutoHide.shift()()}),Ce.each(this.options.ui||[],function(e,t){var n="elfinder"+t,i=j.options.uiOptions[t]||{};!j.ui[t]&&Ce.fn[n]&&(j.ui[t]=Ce("<"+(i.tag||"div")+">").appendTo(u),j.ui[t][n](j,i))}),(u[0].elfinder=this).options.resizable&&Ce.fn.resizable&&u.resizable({resize:function(e,t){j.resize(t.size.width,t.size.height)},handles:"se",minWidth:300,minHeight:200}),this.options.width&&(ae=this.options.width),this.options.height&&(re=parseInt(this.options.height)),this.options.soundPath&&(oe=this.options.soundPath.replace(/\/+$/,"")+"/"),j.resize(ae,re),Ce(document).on("click."+q,function(e){!B||j.options.enableAlways||Ce(e.target).closest(u).length||j.disable()}).on(W+" "+K,function(n){var e,i=n.keyCode,a=!(!n.ctrlKey&&!n.metaKey);B&&(Ce.each(Q,function(e,t){t.type==n.type&&t.keyCode==i&&t.shiftKey==n.shiftKey&&t.ctrlKey==a&&t.altKey==n.altKey&&(n.preventDefault(),n.stopPropagation(),t.callback(n,j),j.debug("shortcut-exec",e+" : "+t.description))}),i!=Ce.ui.keyCode.TAB||Ce(n.target).is(":input")||n.preventDefault(),"keydown"===n.type&&i==Ce.ui.keyCode.ESCAPE&&(u.find(".ui-widget:visible").length||j.clipboard().length&&j.clipboard([]),Ce.ui.ddmanager&&(e=Ce.ui.ddmanager.current)&&e.helper&&e.cancel(),u.find(".ui-widget.elfinder-button-menu").hide()))}),j.options.useBrowserHistory&&Ce(window).on("popstate."+q,function(e){e=e.originalEvent.state&&e.originalEvent.state.thash;e&&!Ce.isEmptyObject(j.files())&&j.request({data:{cmd:"open",target:e,onhistory:1},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0})}),Ce(window).on("resize."+q,function(e){e.target===this&&(g&&clearTimeout(g),g=setTimeout(function(){j.trigger("resize",{width:u.width(),height:u.height()})},100))}).on("beforeunload."+q,function(e){var t,n;return u.is(":visible")&&(j.ui.notify.children().length&&-1!==Ce.inArray("hasNotifyDialog",j.options.windowCloseConfirm)?t=j.i18n("ntfsmth"):u.find("."+j.res("class","editing")).length&&-1!==Ce.inArray("editingFile",j.options.windowCloseConfirm)?t=j.i18n("editingFile"):(n=Object.keys(j.selected()).length)&&-1!==Ce.inArray("hasSelectedItem",j.options.windowCloseConfirm)?t=j.i18n("hasSelected",""+n):(n=Object.keys(j.clipboard()).length)&&-1!==Ce.inArray("hasClipboardData",j.options.windowCloseConfirm)&&(t=j.i18n("hasClipboard",""+n)),t)?e.returnValue=t:void j.trigger("unload")}),Ce(window).on("message."+q,function(e){var t,n,i=e.originalEvent||null;if(i&&0===j.uploadURL.indexOf(i.origin))try{(n=(t=JSON.parse(i.data)).data||null)&&(n.error?(t.bind&&j.trigger(t.bind+"fail",n),j.error(n.error)):(n.warning&&j.error(n.warning),n.removed&&n.removed.length&&j.remove(n),n.added&&n.added.length&&j.add(n),n.changed&&n.changed.length&&j.change(n),t.bind&&(j.trigger(t.bind,n),j.trigger(t.bind+"done")),n.sync&&j.sync()))}catch(e){j.sync()}}),j.options.enableAlways?(Ce(window).on("focus."+q,function(e){e.target===this&&j.enable()}),he&&Ce(window.top).on("focus."+q,function(){!j.enable()||pe&&!pe.is(":visible")||setTimeout(function(){Ce(window).focus()},10)})):he&&Ce(window).on("blur."+q,function(e){B&&e.target===this&&j.disable()}),v=j.getUI("navbar"),b=j.getUI("cwd").parent(),j.autoScroll={navbarUp:function(e){v.scrollTop(Math.max(0,v.scrollTop()-e))},navbarDown:function(e){v.scrollTop(v.scrollTop()+e)},cwdUp:function(e){b.scrollTop(Math.max(0,b.scrollTop()-e))},cwdDown:function(e){b.scrollTop(b.scrollTop()+e)}},j.dragUpload&&(x="native-drag-enter",C="native-drag-disable",K="class",T=j.res(K,"navdir"),j.res(K,"droppable"),j.res(K,"adroppable"),j.res(K,"navarrow"),z=j.res(K,"adroppable"),O=j.getUI("workzone"),I="ltr"===j.direction,u.on("dragenter",function(e){ge(),me(e)&&(e.preventDefault(),e.stopPropagation(),y=O.data("rectangle"))}).on("dragleave",function(e){ge(),me(e)&&(e.preventDefault(),e.stopPropagation())}).on("dragover",function(n){var i;me(n)?(n.preventDefault(),n.stopPropagation(),n.originalEvent.dataTransfer.dropEffect="none",w=w||setTimeout(function(){var e,t=y.top+y.height;((i=n.pageYt)&&(e=y.cwdEdge>n.pageX?(I?"navbar":"cwd")+(i?"Up":"Down"):(I?"cwd":"navbar")+(i?"Up":"Down"),j.autoScroll[e](Math.pow(i?y.top-n.pageY:n.pageY-t,1.3))),w=null},20)):ge()}).on("drop",function(e){ge(),me(e)&&(e.stopPropagation(),e.preventDefault())}),u.on("dragenter",".native-droppable",function(e){if(e.originalEvent.dataTransfer){var n,t=Ce(e.currentTarget),i=null;if(!(e.currentTarget.id||null)){i=j.cwd(),t.data(C,!1);try{Ce.each(e.originalEvent.dataTransfer.types,function(e,t){"elfinderfrom:"===t.substr(0,13)&&(n=t.substr(13).toLowerCase())})}catch(e){}}i&&(!i.write||n&&n===(window.location.href+i.hash).toLowerCase())?t.data(C,!0):(e.preventDefault(),e.stopPropagation(),t.data(x,!0),t.addClass(z))}}).on("dragleave",".native-droppable",function(e){var t;e.originalEvent.dataTransfer&&(t=Ce(e.currentTarget),e.preventDefault(),e.stopPropagation(),t.data(x)?t.data(x,!1):t.removeClass(z))}).on("dragover",".native-droppable",function(e){var t;e.originalEvent.dataTransfer&&(t=Ce(e.currentTarget),e.preventDefault(),e.stopPropagation(),e.originalEvent.dataTransfer.dropEffect=t.data(C)?"none":"copy",t.data(x,!1))}).on("drop",".native-droppable",function(e){var t;e.originalEvent&&e.originalEvent.dataTransfer&&(t=Ce(e.currentTarget),e.preventDefault(),e.stopPropagation(),t.removeClass(z),N=e.currentTarget.id?t.hasClass(T)?j.navId2Hash(e.currentTarget.id):j.cwdId2Hash(e.currentTarget.id):j.cwd().hash,e.originalEvent._target=N,j.exec("upload",{dropEvt:e.originalEvent,target:N},void 0,N))})),j.UA.Touch&&(P=j.getUI("navbar"),H=j.getUI("toolbar"),u.on("touchstart touchmove touchend",function(e){if("touchend"===e.type)return D=S=!1,void be();var t,n,i,a=e.originalEvent.touches||[{}],r=a[0].pageX||null,o=a[0].pageY||null,s="ltr"===j.direction;null===r||null===o||"touchstart"===e.type&&1A.left+E-M&&t+P.scrollLeft()-5<=M,S=!!t&&(F=Math.max(50,E/10),r))),H&&(U=H.height(),o-A.top<(H.is(":hidden")?50:U+30)?(D=o,Ce(document).on("touchmove."+q,ve),setTimeout(function(){be()},500)):D=!1)):(P&&!1!==S&&(n=(s?rA.left+E-20)))&&(j.getUI("navbar").trigger(n,{handleW:F}),S=!1)),H&&!1!==D&&(n=H.offset().top,Math.abs(D-o)>Math.min(45,U/3)&&("slideDown"==(i=o").append(Ce.parseHTML(t.replace(/ src=/gi," _elfsrc=")));Ce("img[_elfsrc]",e).each(function(){var e,t=Ce(this),n=t.closest("a");n&&n.attr("href")&&n.attr("href").match(/\.(?:jpe?g|gif|bmp|png)/i)&&(e=n.attr("href")),(t=t.attr("_elfsrc"))&&(e?(-1==Ce.inArray(e,a)&&a.push(e),-1==Ce.inArray(t,r)&&r.push(t)):-1==Ce.inArray(t,a)&&a.push(t))}),(f=Ce("a[href]",e)).each(function(){var e,t,n;Ce(this).text()&&(t=Ce(this).attr("href"),(n=document.createElement("a")).href=t,!(e=n).href||1!==f.length&&e.pathname.match(/(?:\.html?|\/[^\/.]*)$/i)||-1==Ce.inArray(e.href,a)&&-1==Ce.inArray(e.href,r)&&a.push(e.href))})}else for(var n,m=/(http[^<>"{}|\\^\[\]`\s]+)/gi;n=m.exec(t);)n=n[1].replace(/&/g,"&"),-1==Ce.inArray(n,a)&&a.push(n);return a},xhr:function(I,S){function D(e){i.children(".elfinder-notify-upload").children(".elfinder-notify-cancel")[e?"show":"hide"]()}function A(e){return e=e||l,setTimeout(function(){n=!0,E.notify({type:"upload",cnt:L,progress:r-o,size:e,cancel:function(){a.trigger("uploadabort"),N.resolve()}}),o=r,I.multiupload?W&&D(!0):D(W&&rS.uplMaxSize)E.error(E.i18n("errUploadFile",d.name)+" "+E.i18n("errUploadFileSize")),L--,y--;else if(!d.type||E.uploadMimeCheck(d.type,H))if(T&&k=S.uplMaxSize||g>S.uplMaxFile)&&(m=0,g=1,b++),void 0===v[b]&&(v[b]=[],P&&(v[b][0]=[],v[b][1]=[])),P?(v[b][0].push(d),v[b][1].push(t[r])):v[b].push(d),m+=i,w+=i,g++;else E.error(E.i18n("errUploadFile",d.name)+" "+E.i18n("errUploadMime")+" ("+E.escape(d.type)+")"),L--,y--}if(0==v.length)return!(I.checked=!0);if(1"),escape:function(e){return this._node.text(e).html().replace(/"/g,""").replace(/'/g,"'")},normalize:function(e){function t(n){var e,i;return n&&n.hash&&n.name&&n.mime?("application/x-empty"==n.mime&&(n.mime="text/plain"),n.options&&(l.optionsByHashes[n.hash]=n.options),n.phash&&"directory"!==n.mime||(n.volumeid&&(e=n.volumeid,l.isRoot(n)&&(l.volOptions[e]||(l.volOptions[e]={}),i=l.volOptions[e],n.options&&(i=Ce.extend(i,n.options)),n.disabled&&(i.disabled=n.disabled),n.tmbUrl&&(i.tmbUrl=n.tmbUrl),Ce.each(l.optionProperties,function(e,t){i[t]&&(n[t]=i[t])}),l.roots[e]=n.hash),s!==e&&(s=e,o=l.option("i18nFolderName",e))),!n.i18&&l.isRoot(n)&&(a="volume_"+n.name,r=l.i18n(!1,a),a!==r&&(n.i18=r)),o&&!n.i18&&(a="folder_"+n.name,r=l.i18n(!1,a),a!==r&&(n.i18=r)),l.leafRoots[n.hash]&&(n.dirs||(n.dirs=1),Ce.each(l.leafRoots[n.hash],function(){var e=l.file(this);e&&e.ts&&(n.ts||0){msg}
'.replace(/\{type\}/g,a).replace(/\{msg\}/g,r)).appendTo(o).data("cnt",0),null!=u&&s.data({progress:0,total:0}),h&&(l=Ce('").hover(function(e){Ce(this).toggleClass("ui-state-hover","mouseenter"==e.type)}),s.children("div.elfinder-notify-cancel").append(l))),0<(r=d+parseInt(s.data("cnt")))?(h&&l.length&&(Ce.isFunction(h)||"object"==typeof h&&h.promise)&&(s._esc=function(e){"keydown"==e.type&&e.keyCode!=Ce.ui.keyCode.ESCAPE||(e.preventDefault(),e.stopPropagation(),t(),h.promise?(h.xhr&&(h.xhr.quiet=!0,h.xhr.abort()),h.reject()):h(e))},l.on("click",function(e){s._esc(e)}),Ce(document).on("keydown."+this.namespace,s._esc)),e.hideCnt||s.children(".elfinder-notify-cnt").text("("+r+")"),o.is(":hidden")&&o.elfinderdialog("open",this),s.data("cnt",r),null!=u&&0<=(n=s.data("total"))&&0<=(i=s.data("progress"))&&(n+=null!=c?c:d,i+=u,null==c&&d<0&&(i+=100*d),s.data({progress:i,total:n}),null!=c&&(i*=100,n=Math.max(1,n)),u=parseInt(i/n),s.find(".elfinder-notify-progress").animate({width:(u<100?u:100)+"%"},20))):t()),this},confirm:function(e){var n,i=this,a=!1,r={cssClass:"elfinder-dialog-confirm",modal:!0,resizable:!1,title:this.i18n(e.title||"confirmReq"),buttons:{},close:function(){a||e.cancel.callback(),Ce(this).elfinderdialog("destroy")}},t=this.i18n("apllyAll");return r.buttons[this.i18n(e.accept.label)]=function(){e.accept.callback(!(!n||!n.prop("checked"))),a=!0,Ce(this).elfinderdialog("close")},e.reject&&(r.buttons[this.i18n(e.reject.label)]=function(){e.reject.callback(!(!n||!n.prop("checked"))),a=!0,Ce(this).elfinderdialog("close")}),e.buttons&&0');n=Ce(''),Ce(this).next().find(".ui-dialog-buttonset").prepend(e.append(Ce("").prepend(n)))}),e.optionsCallback&&Ce.isFunction(e.optionsCallback)&&e.optionsCallback(r),this.dialog(''+this.i18n(e.text),r)},uniqueName:function(e,t,n){var i,a,r=0,o="";if(e=this.i18n(e),t=t||this.cwd().hash,n=void 0===n?" ":n,(i=e.match(/^(.+)(\.[^.]+)$/))&&(o=i[2],e=i[1]),a=e+o,!this.fileByName(a,t))return a;for(;r<1e4;)if(a=e+n+ ++r+o,!this.fileByName(a,t))return a;return e+Math.random()+o},i18n:function(){function e(e){var t;return 0===e.indexOf("#")&&(t=r.file(e.substr(1)))?t.name:e}var n,t,i,a,r=this,o=this.messages,s=[],l=[],d=0;for(arguments.length&&!1===arguments[0]&&(a=function(e){return e},d=1),n=d;n")},mime2class:function(e){var t="elfinder-cwd-icon-";return t+(e=e.split("/"))[0]+("image"!=e[0]&&e[1]?" "+t+e[1].replace(/(\.|\+)/g,"-"):"")},mime2kind:function(e){var t,n="object"==typeof e,i=n?e.mime:e;return n&&e.alias&&"symlink-broken"!=i?t="Alias":this.kinds[i]&&(t=!n||"directory"!==i||e.phash&&!e.isroot?this.kinds[i]:"Root"),t=t||(0===i.indexOf("text")?"Text":0===i.indexOf("image")?"Image":0===i.indexOf("audio")?"Audio":0===i.indexOf("video")?"Video":0===i.indexOf("application")?"App":i),this.messages["kind"+t]?this.i18n("kind"+t):i},formatDate:function(e,t){var n,i,a,r,o,s,l,d,c,u=this,t=t||e.ts,h=u.i18;return u.options.clientFormatDate&&0=this.yesterday?this.fancyFormat:this.dateFormat).replace(/[a-z]/gi,function(e){switch(e){case"d":return 9=this.yesterday?n.replace("$1",this.i18n(t>=this.today?"Today":"Yesterday")):n):e.date?e.date.replace(/([a-z]+)\s/i,function(e,t){return u.i18n(t)+" "}):u.i18n("dateUnknown")},perms2class:function(e){var t="";return e.read||e.write?e.read?e.write||(t="elfinder-ro"):t="elfinder-wo":t="elfinder-na",e.type&&(t+=" elfinder-"+this.escape(e.type)),t},formatPermissions:function(e){var t=[];return e.read&&t.push(this.i18n("read")),e.write&&t.push(this.i18n("write")),t.length?t.join(" "+this.i18n("and")+" "):this.i18n("noaccess")},formatSize:function(e){var t=1,n="b";return"unknown"==e?this.i18n("unknown"):(1073741824').attr("src",n).one("load",function(){var t=Ce(this);try{this.contentDocument.location.reload(!0),t.one("load",function(){t.remove(),i.resolve()})}catch(e){t.attr("src","").attr("src",n).one("load",function(){t.remove(),i.resolve()})}}).appendTo("body")}catch(e){t&&t.remove(),i.reject()}return i},makeNetmountOptionOauth:function(s,e,l,d){return{vars:{},name:e,inputs:{offline:Ce('').on("change",function(){Ce(this).parents("table.elfinder-netmount-tb").find("select:first").trigger("change","reset")}),host:Ce(''),path:Ce(''),user:Ce(''),pass:Ce('')},select:function(n,e,t){var i=this.inputs,a=i.offline,r=Ce(i.host[0]),t=t||null;this.vars.mbtn=i.host.closest(".ui-dialog").children(".ui-dialog-buttonpane:first").find("button.elfinder-btncnt-0"),r.data("inrequest")||!r.find("span.elfinder-info-spinner").length&&"reset"!==t&&("winfocus"!==t||r.siblings("span.elfinder-button-icon-reload").length)?(a.closest("tr")[d||i.user.val()?"hide":"show"](),r.data("funcexpup")&&r.data("funcexpup")()):(1===a.parent().children().length&&(i.path.parent().prev().html(n.i18n("folderId")),a.attr("title",n.i18n("offlineAccess")),a.uniqueId().after(Ce("").attr("for",a.attr("id")).html(" "+n.i18n("offlineAccess")))),r.data("inrequest",!0).empty().addClass("elfinder-info-spinner").parent().find("span.elfinder-button-icon").remove(),n.request({data:{cmd:"netmount",protocol:s,host:l,user:"init",options:{id:n.id,offline:a.prop("checked")?1:0,pass:i.host[1].value}},preventDefault:!0}).done(function(e){r.removeClass("elfinder-info-spinner").html(e.body.replace(/\{msg:([^}]+)\}/g,function(e,t){return n.i18n(t,l)}))}),d&&a.closest("tr").hide()),this.vars.mbtn[Ce(i.host[1]).val()?"show":"hide"]()},done:function(n,e){var t=this.inputs,i=this.protocol,a=Ce(t.host[0]),r=Ce(t.host[1]),o=" ";if(d&&t.offline.closest("tr").hide(),"makebtn"==e.mode)a.removeClass("elfinder-info-spinner").removeData("expires").removeData("funcexpup"),t.host.find("input").hover(function(){Ce(this).toggleClass("ui-state-hover")}),r.val(""),t.path.val("root").next().remove(),t.user.val(""),t.pass.val(""),d||t.offline.closest("tr").show(),this.vars.mbtn.hide();else{if(e.expires&&(o="()",a.data("expires",e.expires)),a.html(l+o).removeClass("elfinder-info-spinner"),e.expires&&(a.data("funcexpup",function(){var e=Math.floor((a.data("expires")-+new Date/1e3)/60);e<3?a.parent().children(".elfinder-button-icon-reload").click():(a.text(a.text().replace(/\(.*\)/,"("+n.i18n(["minsLeft",e])+")")),setTimeout(function(){a.is(":visible")&&a.data("funcexpup")()},6e4))}),a.data("funcexpup")()),e.reset)return void i.trigger("change","reset");a.parent().append(Ce('').on("click",function(){r.val("reauth"),i.trigger("change","reset")})),r.val(s),this.vars.mbtn.show(),e.folders&&t.path.next().remove().end().after(Ce("
").append(Ce('