Viewing File: /usr/local/cpanel/base/frontend/jupiter/js/filemanager.min.js
var searchDataSource,cwd,updatecallback,waitpanel,resultspanel,filesDataTable,searchDataTable,selectWindowRegion,selectStartScrollLeft,selectStartScrollTop,myContextMenu,isWpSquared=is_server_type_wp_squared||!1,homeicon='<span class="fas fa-home"></span>',EDITOR_SIZE_LIMIT=1048576,useaspx=0,inited_panels={},DDM=YAHOO.util.DDM,loaded_docroots=0,web_docroots={},usejson=1,TEXT_FIELD_FOCUS=0,CtrlKeyPressed=0,AltKeyPressed=0,SVis=0,selectedFilesCount=0,locCache={},selectedFilesCache={},lastSelectTime=0,viewportHeight=0,selectStartX=0,selectStartY=0,selectMode=0,selector=null,selectEl=null,selectorEl=null,selectOvers={},NAME_COLUMN_MINIMUM_WIDTH=200,TABLE_HEADER_HEIGHT=47,GUTTER_SPACE=12,closeButtons=[{text:"Close",handler:handleCancel}],node_labelStyle={};node_labelStyle[homedir+"/public_ftp"]="icon-publicftp",node_labelStyle[homedir+"/public_html"]="icon-publichtml",node_labelStyle[homedir+"/www"]="icon-publichtml",node_labelStyle[homedir+"/mail"]="icon-mail";var bOffset=0,osmode="unix",quirksmode="Mozilla",osCheck=navigator.userAgent.toLowerCase(),is_major=parseInt(navigator.appVersion),is_minor=parseFloat(navigator.appVersion),EVENT=YAHOO.util.Event;-1===osCheck.indexOf("win")&&-1===osCheck.indexOf("Windows")||(osmode="win32"),-1!==osCheck.indexOf("mac")&&(osmode="mac"),-1!==navigator.appVersion.indexOf("MSIE")&&(quirksmode="MSIE"),-1!==navigator.appVersion.indexOf("Safari")&&(quirksmode=is_minor>4?"Safari5":"Safari"),-1===navigator.appVersion.indexOf("Opera")&&-1===navigator.userAgent.indexOf("Opera")||(quirksmode="Opera");var isOldIE="Opera"===quirksmode||"MSIE"===quirksmode?1:0;"Opera"===quirksmode&&is_minor<9.21&&alert("Use of Opera older then 9.21 with this file manager is not recommended.");var RootFileTree,tree_area=DOM.get("subleft"),tree_area_padding=(parseFloat(DOM.getStyle(tree_area,"padding-top"))||0)+(parseFloat(DOM.getStyle(tree_area,"padding-bottom"))||0),tree_resize_listener=function(e){var t=DOM.getViewportHeight(),l=DOM.getY(tree_area);DOM.setStyle(tree_area,"height",t-l-tree_area_padding+"px")};function srcDirContainsDestDir(e,t){return"/"!==t[t.length-1]&&(t+="/"),"/"!==e[e.length-1]&&(e+="/"),t===e.slice(0,t.length)}function selectAllFiles(){filesDataTable.selectAllRows()}function unselectAllFiles(){filesDataTable.unselectAllRows()}function unselectFile(e){filesDataTable.unselectRow(e)}function selectFile(e){filesDataTable.selectRow(e)}function getRealObj(e){return e.match(/^ygtvt/)?document.getElementById(e).parentNode:document.getElementById(e)}function xmlStaterrorFunction(e){setLoading(),e&&(alert("Error: "+e.status+" "+e.statusText+" There was a problem fetching the files information: "+e.responseText),refreshFiles())}function scheduleFileOp(e,t,l,a,n,i){var o=0;if(/chmod/i.test(e)){if(!/^[0-7]{3,4}$/.test(a))return alert(LANG.chmod_error),refreshFiles(),!1;a.length<4&&(a="0"+a)}else if(/rename/i.test(e)){var s=l[0],r=filesDataTable.getRecordSet();for(o=0;o<r._records.length;o++)if(s===r._records[o]._oData.file)return alert(YAHOO.lang.substitute(LANG.rename_conflict,{file:s})),refreshFiles(),!1}else if(/unlink/i.test(e)){var c=1,d=homedir+"/.trash";if(a&&a.deleteme)a={},e="unlink";else{for(o=0;o<t.length;o++)t[o].substring(0,d.length)!==d&&(c=0);c||(e="trash")}}else/emptytrash/i.test(e)&&(t=[homedir+"/.trash"],e="unlink");var u={success:FileOpCallBack,failure:xmlStaterrorFunction,argument:{srcFileList:t,destFileList:l,fileop:e,setdata:n,metadata:a,fileList:i,selected_rows:filesDataTable.getSelectedTrEls()}},f="cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=fileop&cpanel_jsonapi_apiversion=2&filelist=1&multiform=1&doubledecode=0&op="+e+"&metadata="+a+"&";for(o=0;o<t.length;o++)f+="sourcefiles="+safeencode(t[o])+"&";for(o=0;o<l.length;o++)f+="destfiles="+safeencode(l[o])+"&";var m=CPANEL.security_token+"/json-api/cpanel";YAHOO.util.Connect.asyncRequest("POST",m,u,f)}function FileOpCallBack(e){var t=fastJsonParse(e.responseText);if(null!=t){var l,a,n,i,o=t.cpanelresult.data,s=!1,r=!1,c=function(){},d=[];cwd.length;if(0!==t.cpanelresult.event.result)if("chmod"!==e.argument.fileop){for(l=0;l<o.length;l++){var u=o[l].result,f=YAHOO.util.DataSource.parseString(o[l].src);if(!f){var m=o[l].err||"Unknown";alert("FileOp Failure (source could not be read) : "+m);break}var p=YAHOO.util.DataSource.parseString(o[l].dest);p&&(n=(a=getFileBase(p))[0],i=a[1]);var h=getFileBase(f),g=h[0],y=h[1];if(parseInt(u,10)){var b="move"===e.argument.fileop&&1===o.length&&n===cwd&&!filesDataTable.getRecordSet().getRecords().some((function(e){return e.getData("file")===i}));if(b||"rename"===e.argument.fileop){if(c=function(){nukeNode(g,1)},DDM.getDDById(e.argument.metadata.id).filePath=p,e.argument.setdata){B=filesDataTable.getRecord(e.argument.selected_rows[0]);filesDataTable.getRecordSet().updateKey(B,"file",i),filesDataTable.render()}s=!0}else if("trash"==e.argument.fileop||"unlink"==e.argument.fileop||"restorefile"==e.argument.fileop){if(d.push(y),c=function(){e.argument.srcFileList.forEach(remove_path_from_tree)},"restorefile"==e.argument.fileop)e.argument.selected_rows[l]?E=/-directory$/i.test(filesDataTable.getRecord(e.argument.selected_rows[l]).getData("mimetype")):(srcDir=RootFileTree.getNodeByProperty("path",f),srcDir&&srcDir.data&&(E=/dir/i.test(srcDir.data.type))),E&&(r=!0)}else if("compress"==e.argument.fileop){var D="";4096==(v=o[l].output).length&&(D="</pre><br /><b>Output Truncated by browser<pre>");var w=unescape(v);n==cwd&&(s=!0),c=function(){nukeNode(g,1)},show_results("Compression Results",w+D)}else if("extract"==e.argument.fileop){var v;D="";4096==(v=o[l].output).length&&(D="</pre><br /><b>Output Truncated by browser<pre>");w=unescape(v);p==cwd&&(s=!0),c=function(){nukeNode(g,1)},show_results("Extraction Results",w+D)}else if("move"==e.argument.fileop||"copy"==e.argument.fileop){var E;if(e.argument.selected_rows[l]?E=/-directory$/i.test(filesDataTable.getRecord(e.argument.selected_rows[l]).getData("mimetype")):(srcDir=RootFileTree.getNodeByProperty("path",f),srcDir&&srcDir.data&&(E=/dir/i.test(srcDir.data.type))),E){var _=RootFileTree.getNodeByProperty("path",n);_&&(_.isLeaf?(_.isLeaf=!1,_.updateIcon()):void 0!==_.hasChildren()&&(c=function(){nukeNode(_,null)})),"move"==e.argument.fileop&&remove_path_from_tree(f)}n===cwd?s=!0:"move"===e.argument.fileop&&d.push(y)}else"link"==e.argument.fileop&&p==cwd&&(s=!0)}else{m=o[l].err||o[l].error||t.cpanelresult.error||"Unknown";f?alert("FileOp Failure on: "+f+": "+m):alert("FileOp Failure : "+m),s=!0}}if(d.length){unselectAllFiles();var T,O={},F=filesDataTable.getRecordSet().getRecords();for(H=0;T=F[H];H++)O[T.getData("file")]=T;d=d.map((function(e){return filesDataTable.getTrEl(O[e])}));filesDataTable.getTbodyEl();var S=null,x=function(e){if(!e||e.recordIndex===S){var t=d.pop();S=filesDataTable.getRecordIndex(t),filesDataTable.deleteRow(t),0===d.length&&filesDataTable.removeListener("rowDeleteEvent",x)}};filesDataTable.addListener("rowDeleteEvent",x),x()}c(),waitpanel.hide(),s&&refreshFiles(),r&&refreshTree(),o=null,l=null}else{for(var C=e.argument.fileList||[e.argument.selected_rows[0]],N=0,A=[],L=t.cpanelresult.data.length,R=0;R<L;R++)for(var I=t.cpanelresult.data[R],k=I.src.replace(new RegExp("^"+cwd+"/"),""),M=0,H=0;!M&&H<C.length;){var B,P=C[H];(B=filesDataTable.getRecord(P)).getData("file")===k&&(0!==I.result?filesDataTable.updateCell(B,"nicemode",e.argument.metadata):(N=1,A.push(" • The system failed to change the permissions for "+k+" with the error: "+I.err)),M=1),H++}N&&setTimeout((function(){alert("FileOp Failure: \n"+A.join("\n"))}),0)}else alert("FileOp Failure: "+t.cpanelresult.event.reason)}else alert("There was a problem fetching the file list! Please reload and try again.")}function debug(e){window.console?window.console.log(e):console?console.log(e):alert(e)}function getFileBase(e){var t=e.split("/"),l=[];return l[0]="",l[1]=t.pop(),l[0]=t.join("/"),l}function nukeNode(e,t){if(e){e instanceof YAHOO.widget.Node||(e=RootFileTree.getNodeByProperty("path",e));var l=e.expanded;RootFileTree.removeChildren(e),(t||null===t&&l)&&e.expand()}}function refreshTree(){nukeNode(RootFileTree.getRoot().children[0],!0)}function add_path_to_tree(e,t){var l=e.replace(/\/[^\/]+$/,""),a=RootFileTree.getNodeByProperty("path",l);if(a&&(a.childrenRendered||a.isLeaf)){var n;t&&a.children.length>0&&(t=t.replace(/^.*\/([^\/]+)/,"$1"),n=RootFileTree.getNodeByProperty("path",l+"/"+t));var i=new FM_Tree_Node(e.replace(/^.*\/([^\/]+)/,"$1"),a,{isLeaf:!0});n&&i.insertBefore(n),a.isLeaf=!1,a.refresh()}}function remove_path_from_tree(e){var t,l,a=RootFileTree.getNodeByProperty("path",e);if(a)t=a.parent,l=!a.nextSibling&&!a.previousSibling,RootFileTree.removeNode(a,!0);else{var n=e.match(/^(.*)\/([^\/]+)\/?$/);if(n[1]===cwd){var i=filesDataTable.getRecordSet().getRecords();t=RootFileTree.getNodeByProperty("path",n[1]);var o=i.length;i.length>0&&(l=!0);for(var s=0;s<o;s++){var r=i[s];if(/-directory/i.test(r.getData("mimetype"))){l=!1;break}}}}if(l){t||(t=RootFileTree.getNodeByProperty("path",cwd));var c=RootFileTree.getRoot().children[0];t&&t.data.path!==c.data.path&&(t.isLeaf=!0,t.collapse(),t.updateIcon())}}EVENT.onDOMReady((function(){setTimeout(tree_resize_listener,100)})),EVENT.on(window,"resize",tree_resize_listener),YAHOO.namespace("fileman"),YAHOO.util.DDM.mode=YAHOO.util.DDM.POINT,YAHOO.fileman.DDFile=function(e,t){this.initFile(e,"files")},YAHOO.fileman.DDFile.prototype=new YAHOO.util.DDProxy,YAHOO.fileman.DDFile.TYPE="DDFile",YAHOO.fileman.DDFile.prototype.autoScroll=function(e,t,l,a){return 0},YAHOO.fileman.DDFile.prototype.initFile=function(e,t){e&&(this.init(e,t),this.initFrame(),this.isTarget=!1,this.isFile=!0,this.action="move",this.type=YAHOO.fileman.DDFile.TYPE)},YAHOO.fileman.DDFile.prototype.startDrag=function(e,t){this.getEl().id;selectedFilesCount=0;var l=filesDataTable.getRow(this.fileId);l&&!filesDataTable.isSelected(l)&&selectFile(l);var a=filesDataTable.getSelectedTrEls();selectedFilesCount=a.length;for(var n=filesDataTable.getRows(),i=n.length,o=0;o<i;o++)DDM.getDDById(n[o].id).unlock();var s=document.getElementById("filesi");selectedFilesCount>0&&(s.innerHTML=selectedFilesCount+(selectedFilesCount>1?" Files":" File"))},YAHOO.fileman.DDFile.prototype.endDrag=function(e){document.getElementById("copyi").style.display="none",document.getElementById("filesi").style.display="none";for(var t=filesDataTable.getRows(),l=t.length,a=0;a<l;a++)DDM.getDDById(t[a].id).lock();var n=filesDataTable.getSelectedTrEls(),i=n.length;for(a=0;a<i;a++)DDM.getDDById(n[a].id).unlock()},YAHOO.fileman.DDFile.prototype.onDrag=function(e,t){if(CtrlKeyPressed||e.ctrlKey||e.shiftKey||selectedFilesCount>0){var l=YAHOO.util.Event.getPageX(e),a=YAHOO.util.Event.getPageY(e);if(selectedFilesCount>0){var n=document.getElementById("filesi").style;n.display="block",n.top=a+7+"px",n.left=l+23+"px",n=null}else document.getElementById("filesi").style.visible="none";if(CtrlKeyPressed||e.ctrlKey||e.shiftKey){var i=document.getElementById("copyi").style;SVis||(i.display="block",SVis=1),i.top=a+7+"px",i.left=l+7+"px",i=null}else SVis&&(document.getElementById("copyi").style.display="none",SVis=0)}},YAHOO.fileman.DDFile.prototype.onDragDrop=function(e,t){var l=DDM.getDDById(t);if(l.action){var a=l.action;"move"==a&&(CtrlKeyPressed||e.ctrlKey||e.shiftKey)&&(a="copy");var n,i=l.filePath;if(null!=i)n=this.id.match(/^ygtvt/)||this.id.match(/^ygtvcontent/)?[this.filePath]:filesDataTable.getSelectedTrEls().map(getFilePathFromRow),"unlink"==a?(scheduleFileOp("unlink",n,[]),alert("Trash Operations are disabled because the system is in test mode!")):n.some((function(e){return e!==i&&e.replace(/\/[^\/]+$/,"")!==i}))&&("copy"==a||"move"==a||"rename"==a?scheduleFileOp(a,n,[i]):alert("Unhandled action: "+a+" from "+n.join(",")+" to "+i))}SVis=0,getRealObj(l.id).style.backgroundColor="",document.getElementById("copyi").style.display="none",document.getElementById("filesi").style.display="none"},YAHOO.fileman.DDFile.prototype.onDragEnter=function(e,t){var l=DDM.getDDById(t).filePath;l!==this.filePath&&l!==this.filePath.replace(/\/[^\/]+$/,"")&&(getRealObj(t).style.backgroundColor="#aaa")},YAHOO.fileman.DDFile.prototype.onDragOut=function(e,t){getRealObj(t).style.backgroundColor=""},YAHOO.widget.Node.prototype.get_common_ancestor=function(e){var t=this;do{var l=e;do{if(t===l)return t}while(l=l.parent)}while(t=t.parent)};var myDataSource,uriHistoryPos=0,uriHistory=[];function setupFilesTable(e,t){e||(e=this);for(var l=e.getTbodyEl().rows,a=e.getRecordSet().getLength(),n=0;n<a;n++){var i=t?DDM.getDDById(l[n].id):new YAHOO.fileman.DDFile(l[n]),o=e.getRecord(n).getData(),s=o.mimetype;s.match("-directory")||"mail"==s||"publichtml"==s||"publicftp"==s?(i.type="dir",i.isTarget=!0):i.type="file",i.action="move",i.fileId=n,i.filePath=cwd+"/"+o.file,i.lock()}t||(a>0&&e.hideTableMessage(),updatecallback&&(updatecallback(),updatecallback=null))}function handleunselectAllRowsEvent(){handleRowUnSelect({target:this.getRows()})}function xmlLoaderrorFunction(e){e&&(alert("Error: "+e.status+" "+e.statusText+" There was a problem fetching the files information: "+e.responseText),e.argument.fnLoadComplete())}function safeencode(e){for(var t=encodeURIComponent(e),l=-1,a="",n=0;n<t.length;n++)l>=0&&l++,l>=3&&(l=-1),a+=1==l||2==l?t.substring(n,n+1).toLowerCase():t.substring(n,n+1),"%"==t.substring(n,n+1)&&(l=0);return a.replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/,/g,"%2c").replace(/'/g,"%27")}function handleColumnSort(e){unselectAllFiles()}function FM_Tree_Node(e,t,l){var a={label:e,path:(t.data.path||"")+"/"+e.replace(/^\/+/,"")};l&&YAHOO.lang.augmentObject(a,l),FM_Tree_Node.superclass.constructor.call(this,a,t,!1)}function parsejsonFile(e){var t=fastJsonParse(e.responseText);if(null!=t){for(var l=e.argument.node,a={},n=t.cpanelresult.data,i=0;i<n.length;i++)if(n[i].file){n[i].file;var o=n[i].path+"/"+n[i].file,s=new FM_Tree_Node(n[i].file,l,{type:n[i].type,isLeaf:"1"==n[i].isleaf});o in node_labelStyle&&(s.labelStyle=node_labelStyle[o]),a[o]=s}e.argument.fnLoadComplete()}else alert("There was a problem fetching the json file list! Please reload and try again.")}function actionHandler(e){var t=filesDataTable.getSelectedTrEls();if(/edit/i.test(e)){if(t.length>1)return alert(LANG.tooMany),!1;if(t.length<1)return alert(LANG.tooFew),!1;if(!actionlist[e].test(t))return/htmledit/i.test(e)?alert(LANG.notValidHTML):alert(LANG.notValid),!1}return actionlist[e].test(t)&&actionlist[e].handler(t),!1}YAHOO.widget.DataTable.prototype.selectAllRows=function(){for(var e=this.getRows(),t=0;t<e.length;t++)this.selectRow(e[t]);handleRowSelect()},YAHOO.widget.DataTable.prototype.getRows=function(){return this.getTbodyEl().getElementsByTagName("tr")},YAHOO.widget.DataTable.prototype.onDataReturnSearch=function(e,t){waitpanel.hide(),show_panel("search-results"),document.getElementById("search-results-div").style.display="block",searchDataTable.clearRows(),searchDataTable.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING,YAHOO.widget.DataTable.CLASS_LOADING),this.onDataReturnInitializeTable(e,t)},YAHOO.widget.DataTable.prototype.onDataReturnReplaceRows=function(e,t){this.set("MSG_EMPTY",LANG.dir_empty),unselectAllFiles(),load_docroots(),this.onDataReturnInitializeTable(e,t)},YAHOO.lang.extend(FM_Tree_Node,YAHOO.widget.TextNode,{refresh:function(){for(var e=FM_Tree_Node.superclass.refresh.apply(this,arguments),t=this.children,l=0;l<t.length;l++)t[l].sync_dd();return e},sync_dd:function(){if(this.dd){if(this.dd.getEl()===this.getContentEl()&&DDM.verifyEl(this.getContentEl()))return;this.dd.unreg()}this.dd=new YAHOO.fileman.DDFile(this.contentElId),YAHOO.lang.augmentObject(this.dd,{type:"dir",isTarget:!0,filePath:this.data.path},!0)}}),YAHOO.widget.DataTable.prototype.clearRows=function(){this.getRecordSet().reset(),this.render()};var actionlist={unselectall:{handler:function(){unselectAllFiles()},test:function(e){return!(!e||!e[0])}},selectall:{handler:function(){selectAllFiles()},test:function(){return!0}},home:{handler:function(){updateFileList(homedir)},test:function(){return cwd!=homedir}},navup:{handler:function(){navigateUp()},test:function(){return cwd!=homedir}},navback:{handler:function(){navigateBack()},test:function(){return uriHistoryPos>0}},navnext:{handler:function(){navigateNext()},test:function(){return uriHistoryPos<uriHistory.length-1}},refresh:{handler:function(){refreshFiles()},test:function(){return!0}},upload:{handler:function(){uploadFiles()},test:function(){return!0}},newfile:{handler:function(){show_panel("newfile")},test:function(){return!0}},newfolder:{handler:function(){show_panel("newfolder")},test:function(){return!0}},copy:{handler:function(){show_panel("copy")},test:function(e){return!(!e||!e[0])}},move:{handler:function(){show_panel("move")},test:function(e){return!(!e||!e[0])}},download:{handler:function(){downloadFiles()},test:function(e){if(e&&e[0]){var t=filesDataTable.getRecord(e[0]).getData("mimetype");if(!t.match("-directory")&&"mail"!=t&&"publichtml"!=t&&"publicftp"!=t)return!0}return!1}},leechprotect:{handler:function(){dir_uri_action("../htaccess/leechprotect/dohtaccess.html?dir=")},test:function(){return!isWpSquared&&!actionlist.download.test.apply(this,arguments)}},indexmanager:{handler:function(){dir_uri_action("../indexmanager/dohtaccess.html?dir=")},test:function(){return!isWpSquared&&!actionlist.download.test.apply(this,arguments)}},dirprotect:{handler:function(e){dir_uri_action("../htaccess/dohtaccess.html?dir=")},test:function(){return!isWpSquared&&(!!webprotect_feature&&!actionlist.download.test.apply(this,arguments))}},delete:{handler:function(){srcDirContainsDestDir(cwd,homedir+"/.trash")?show_panel("delete"):show_panel("trash")},test:function(e){return!(!e||!e[0])}},restore:{handler:function(){cwd===homedir+"/.trash"&&show_panel("restore")},test:function(e){return cwd===homedir+"/.trash"&&!(!e||!e[0])}},viewtrash:{handler:function(){updateFileList(homedir+"/.trash")},test:function(){return!srcDirContainsDestDir(cwd,homedir+"/.trash")}},emptytrash:{handler:function(){show_panel("emptytrash")},test:function(){return!!srcDirContainsDestDir(cwd,homedir+"/.trash")}},rename:{handler:function(){show_panel("rename")},test:function(e){return!(!e||!e[0])}},edit:{handler:function(e){var t=filesDataTable.getRecord(e[0]).getData("file"),l="edit",a=document.getElementById("edit-charset");if(a.options&&a.options.length||populate_charset(a),self.NVData&&NVData.ignorecharencoding){init_panels(l);var n=panels[l].panel,i=n.show;n.show=function(){},show_panel(l),n.show=i,handleEdit(n)}else{show_loading(YAHOO.lang.substitute(LANG.detecting_encoding,{file_html:t.html_encode()}),"");cpanel_jsonapi2((function(e){var t=e[0].encoding;select_charset(a,t),waitpanel.hide(),show_panel(l)}),"Encoding","guess_file","file",cwd+"/"+t)}},test:function(e){if(e&&e[0]&&actionlist.download.test.apply(this,arguments))return filesDataTable.getRecord(e[0]).getData("size")<EDITOR_SIZE_LIMIT;return!1}},htmledit:{handler:function(e){var t=filesDataTable.getRecord(e[0]).getData("file"),l=document.getElementById("htmledit-urls"),a=document.getElementById("htmledit-basedir");l.options.length=0;e[0];var n=0,i=-1;for(var o in web_docroots){var s=web_docroots[o],r=cwd.substring(0,s.length),c=cwd.substring(s.length);r==s&&(i++,l.options[i]=new Option("https://"+o+c+"/"+t,"https://"+o+c),a.options[i]=new Option(s,s),o==maindomain&&(l.options[i].selected=!0,a.options[i].selected=!0,n=1))}n||(l.options.length||(i++,l.options[i]=new Option("https://"+maindomain+"/"+t,"https://"+maindomain),a.options[i]=new Option(cwd,cwd)),l.options[i].selected=!0,a.options[i].selected=!0);var d=document.getElementById("htmledit-charset");if(d.options&&d.options.length||populate_charset(d),self.NVData&&NVData.ignorecharencoding)document.getElementById("htmledit-encodings").style.display="none",show_panel("htmledit");else{show_loading(YAHOO.lang.substitute(LANG.detecting_encoding,{file_html:t.html_encode()}),""),document.getElementById("htmledit-encodings").style.display="";cpanel_jsonapi2((function(e){var t=e[0].encoding;select_charset(d,t),show_panel("htmledit"),waitpanel.hide()}),"Encoding","guess_file","file",cwd+"/"+t)}},test:function(e){if(isWpSquared)return!1;if(e&&e[0]&&actionlist.edit.test.apply(this,arguments)){var t=filesDataTable.getRecord(e[0]).getData("file");if(/\.html?$/i.test(t))return!0;var l=filesDataTable.getRecord(e[0]).getData("mimetype");if(/html/i.test(l))return!0}return!1}}};actionlist.compress={handler:function(){show_panel("compress")},test:function(e){return!(!e||!e[0])}},actionlist.extract={handler:function(){show_panel("extract")},test:function(e){if(e&&e[0]&&!e[1]){var t=filesDataTable.getRecord(e[0]).getData(),l=t.mimetype;if("application/zip"===l||/\.zip$/.test(t.file))return HAS_UNZIP;if("application/x-gzip"===l||"application/x-tar"===l||"application/x-bzip2"===l||"application/x-bzip"===l||"application/x-rar-compressed"===l)return!0;if(l.match(/package|archive|compress/i))return!0}return!1}},actionlist.chmod={handler:function(){show_panel("chmod")},test:function(e){return!(!e||!e[0])&&"link"!==filesDataTable.getRecord(e[0]).getData().type}},actionlist.view={handler:function(){viewFiles()},test:function(){return actionlist.download.test.apply(this,arguments)}};var SELECTED_TREE_NODE,contextMenuItems=[{action:"download",displayName:"Download",obj:actionlist.download,className:"fas fa-download"},{action:"view",displayName:"View",obj:actionlist.view,className:"fas fa-eye"},{action:"edit",displayName:"Edit",obj:actionlist.edit,className:"fas fa-pencil-alt"},{action:"move",displayName:"Move",obj:actionlist.move,className:"glyphicon glyphicon-move"},{action:"copy",displayName:"Copy",obj:actionlist.copy,className:"far fa-copy"},{action:"rename",displayName:"Rename",obj:actionlist.rename,className:"fas fa-file"},{action:"chmod",displayName:"Change Permissions",obj:actionlist.chmod,className:"fas fa-key"},{action:"delete",displayName:"Delete",obj:actionlist.delete,className:"glyphicon glyphicon-remove"},{action:"restore",displayName:"Restore",obj:actionlist.restore,className:"fas fa-undo"},{action:"extract",displayName:"Extract",obj:actionlist.extract,className:"glyphicon glyphicon-resize-full"},{action:"compress",displayName:"Compress",obj:actionlist.compress,className:"glyphicon glyphicon-resize-small"},{action:"dirprotect",displayName:"Password Protect",obj:actionlist.dirprotect,className:"fas fa-lock"},{action:"leechprotect",displayName:"Leech Protect",obj:actionlist.leechprotect,className:"fas fa-shield-alt"},{action:"indexmanager",displayName:"Manage Indices",obj:actionlist.indexmanager,className:"fas fa-wrench"},{action:"htmledit",displayName:"HTML Editor (Beta)",obj:actionlist.htmledit,className:"far fa-edit"}];function navigateUp(){var e=cwd.split("/");e.pop();var t=e.join("/");t.length<=homedir.length?cwd!=homedir&&updateFileList(homedir):updateFileList(t)}function navigateBack(){uriHistoryPos>0&&(uriHistoryPos--,updateFileList(uriHistory[uriHistoryPos],1))}function navigateNext(){uriHistoryPos<uriHistory.length-1&&(uriHistoryPos++,updateFileList(uriHistory[uriHistoryPos],1))}function updateFileList(e,t,l){filesDataTable.set("MSG_EMPTY",filesDataTable.get("MSG_LOADING")),filesDataTable.getRecordSet().reset(),filesDataTable.render();var a={success:filesDataTable.onDataReturnReplaceRows,failure:filesDataTable.onDataReturnReplaceRows,scope:filesDataTable,argument:filesDataTable.getState()},n=new Date;null===showhidden&&(showhidden=0),myDataSource.sendRequest("dir="+safeencode(e)+"&showdotfiles="+showhidden+"&cache_fix="+n.getTime(),a),updatecallback=l,cwd=e,refresh_selected_tree_node();var i=e.replace(new RegExp("^"+homedir.regexp_encode()),"").replace(/^\//,"");for(var o in document.getElementById("location").value=i,t||(uriHistory[uriHistory.length-1]!=cwd&&uriHistory.push(cwd),uriHistoryPos=uriHistory.length-1),selectedFilesCache)delete selectedFilesCache[o]}function refresh_selected_tree_node(){if(RootFileTree){var e=RootFileTree.getNodeByProperty("path",cwd);e&&(SELECTED_TREE_NODE&&DOM.removeClass(SELECTED_TREE_NODE.getContentEl(),"selectedNode"),DOM.addClass(e.getContentEl(),"selectedNode"),SELECTED_TREE_NODE=e)}}function uploadFiles(){document.getElementById("actionform").action="upload-ajax.html",document.getElementById("actionform_dir").value=cwd,document.getElementById("actionform").submit()}var editFile=function(e,t){var l=t.split("/"),a=l.pop(),n=l.join("/");2==e?(SetNvData("html_editor_domain",document.getElementById("actionform_baseurl").value),document.getElementById("actionform").action="./editors/html_editor.html"):document.getElementById("actionform").action="editit.html",document.getElementById("actionform_file").value=a,document.getElementById("actionform_dir").value=n;var i=document.getElementById("actionform");if(1==e){var o=document.createElement("input");o.type="hidden",o.name="edit",o.value="1",i.appendChild(o),i.submit(),i.removeChild(o)}else i.submit()};function changeCompression(){setCompressFileName(filesDataTable.getSelectedTrEls())}function setCompressFileName(e){for(var t=document.compressform.compresstype,l="zip",a=0;a<t.length;a++)if(t[a].checked){l=t[a].value;break}document.getElementById("compressfilepath").value=getRelPath(getFilePathFromRow(e[0]))+"."+l}function viewFile(e){var t=e.split("/"),l=t.pop(),a=t.join("/");document.getElementById("actionform").action="showfile.html",document.getElementById("actionform_file").value=l,document.getElementById("actionform_dir").value=a,document.getElementById("actionform").submit()}function viewFiles(){var e=filesDataTable.getSelectedTrEls();e[0]&&viewFile(getFilePathFromRow(e[0]))}function getFilePathFromRow(e){var t=filesDataTable.getRecord(e).getData();return cwd+"/"+t.file}function editFiles(e){var t=filesDataTable.getSelectedTrEls();t[0]&&editFile(e,getFilePathFromRow(t[0]))}function emptyTrash(){scheduleFileOp("emptytrash",[],[])}function deleteFiles(e){if(filesDataTable.getSelectedTrEls()[0]){scheduleFileOp("unlink",filesDataTable.getSelectedTrEls().map(getFilePathFromRow),[],e)}}function restoreFiles(){if(filesDataTable.getSelectedTrEls()[0]){scheduleFileOp("restorefile",filesDataTable.getSelectedTrEls().map(getFilePathFromRow),[])}}function downloadFiles(){var e=filesDataTable.getSelectedTrEls(),t=e.length;if(t>0){if(t>1&&!confirm(LANG.confirm_download))return;var l=e.map(getFilePathFromRow),a=setInterval((function(){l.length?downloadFile(l.shift()):clearInterval(a)}),200)}}function refreshFiles(){updateFileList(cwd)}function finishedLoading(){alert("done")}function clickFolder(e){var t=e.node;return updateFileList(t.data.path),myContextMenu.hide(),!t.expanded||(t.focus(),!1)}var myFileTree=function(){function e(e,t){var l={success:parsejsonFile,failure:xmlLoaderrorFunction,argument:{node:e,fnLoadComplete:t}};null===showhidden&&(showhidden=0);var a=new Date,n=CPANEL.security_token+"/json-api/cpanel",i="cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=listfiles&cpanel_jsonapi_apiversion=2&checkleaf=1&types=dir&dir="+safeencode(e.data.path)+"&showdotfiles="+showhidden+"&cache_fix="+a.getTime();YAHOO.util.Connect.asyncRequest("POST",n,l,i)}return{init:function(){(RootFileTree=new YAHOO.widget.TreeView("treeContainer")).setDynamicLoad(e,1),RootFileTree.subscribe("clickEvent",clickFolder);var t=RootFileTree.getRoot(),l=new FM_Tree_Node(homedir,t);RootFileTree.subscribe("expand",(function(e){!1!==e.hasChildren()&&(e.childrenRendered||this.subscribe("expandComplete",(function t(l){if(this.unsubscribe("expandComplete",t),refresh_selected_tree_node(),l===e&&e.childrenRendered)for(var a=0;a<e.children.length;a++)e.children[a].sync_dd()})))})),RootFileTree.removeNode=function(e,t){var l=e.contentElId,a=e.parent,n=YAHOO.widget.TreeView.prototype.removeNode.call(this,e);if(n){t&&a.refresh();var i=DDM.getDDById(l);i&&i.unreg()}return n},RootFileTree.removeChildren=function(e){for(var t,l=e.children.map((function(e){return e.contentElId})),a=YAHOO.widget.TreeView.prototype.removeChildren.apply(this,arguments),n={},i=0;t=e.children[i++];)n[t.contentElId]=!0;for(var o,s=0;o=l[s++];)if(!n[o]){var r=DDM.getDDById(o);r&&r.unreg()}return a},l.expand(),RootFileTree.draw(),l.getLabelEl().innerHTML=homeicon+" ("+homedir.html_encode()+")",l.sync_dd()}}}();function dirnav(){updateFileList(homedir+document.getElementById("location").value),refreshTree()}function downloadFile(e){var t=document.createElement("iframe");t.name="download_box_"+Math.random(),t.style.display="none",document.body.appendChild(t),t.src=CPANEL.security_token+"/download?skipencode=1&file="+safeencode(e);var l=setInterval((function(){document.body.removeChild(t),clearInterval(l)}),3e5)}function deactivateButton(e){var t=document.getElementById("action-"+e);if(t){var l=t.getElementsByTagName("img");if(l.length>0&&!l[0].src.match("grey")){var a=l[0].src.split("."),n=a.pop();l[0].src=a.join(".")+"_grey."+n}DOM.addClass(t,"disabled")}}function activateButton(e){var t=document.getElementById("action-"+e);if(t){var l=t.getElementsByTagName("img");l.length>0&&l[0].src.match("_grey")&&(l[0].src=l[0].src.replace("_grey","")),DOM.removeClass(t,"disabled")}}function handleSelections(e){var t=[];for(var l in selectedFilesCache)selectedFilesCache[l]&&t.push(selectedFilesCache[l]);for(var a in actionlist)actionlist[a].test(t)?!0!==actionlist[a].enabled&&(actionlist[a].enabled=!0,activateButton(a)):!1!==actionlist[a].enabled&&(actionlist[a].enabled=!1,deactivateButton(a))}function formatSearchFile(e,t,l,a){CPANEL.util.set_text_content(e,getRelPath(a))}function getMimeImageClass(e){return MimeTypesIconClasses[e]}function formatImageCellNoCheck(e,t,l,a){var n=getMimeImageClass(unescape(a));e.innerHTML='<i class="'+n+'" aria-hidden="true"></i>',YAHOO.util.Dom.addClass(e,"diricon")}function formatImageCell(e,t,l,a){var n=getMimeImageClass(unescape(a));e.innerHTML='<i class="'+n+'" aria-hidden="true"></i>',"link"===t.getData("type")&&(e.innerHTML='<i class="'+n+'" aria-hidden="true"></i><i class="fas fa-link fa-rotate-90" aria-hidden="true"></i>'),YAHOO.util.Dom.addClass(e,"diricon")}function formatTxt(e,t,l,a){CPANEL.util.set_text_content(e,a)}function handleRowSelect(){var e=filesDataTable.getSelectedRows();isLikeAnArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var l=e[t];if(l&&("object"==typeof l?(selectedFilesCache[l.id]=l,l=l.id):selectedFilesCache[l]=document.getElementById(l),l)){var a=DDM.getDDById(l);a&&(a.unlock(),a.isTarget=!1)}}2!=selectMode&&handleSelections()}function handleRowUnSelect(e){var t=e.target;isLikeAnArray(t)||(t=[t]);for(var l=0;l<t.length;l++){var a=t[l];if(a&&("object"==typeof a?(a=a.id,delete selectedFilesCache[a]):delete selectedFilesCache[a],a)){var n=DDM.getDDById(a);n&&(n.lock(),"file"!=n.type&&(n.isTarget=!0))}}2!=selectMode&&handleSelections()}function upgradeFm(){usejson=1;var e=CPANEL.cldr.datetime_format.replace("{0}",CPANEL.DateTime.time_format_short).replace("{1}",LANG.today),t=CPANEL.cldr.datetime_format.replace("{0}",CPANEL.DateTime.time_format_short).replace("{1}",LANG.yesterday),l=new Date,a=new Date(l.getFullYear(),l.getMonth(),l.getDate()).getTime()/1e3,n=new Date(l.getFullYear(),l.getMonth(),l.getDate()-1).getTime()/1e3,i=new Date(l.getFullYear(),l.getMonth(),l.getDate()+1).getTime()/1e3,o=(l=new Date).toString().match(/\(([^\)]+)\)$/),s=(o&&o[1],"Opera"==quirksmode),r=[{key:"mimename",label:" ",type:"string",sortable:!1,width:35,formatter:formatImageCell},{key:"file",label:"Name",sortable:!0,formatter:s?formatTxt:function(e,t,l,a){e.innerHTML='<span class="renameable" title="'+a.html_encode()+'">'+a.html_encode()+"</span>";var n=e.firstChild,i=this;EVENT.on(n,"dblclick",YAHOO.util.Event.stopPropagation),EVENT.on(n,"click",(function(l){if(!filesDataTable.isSelected(t))return!0;YAHOO.util.Event.stopPropagation(l);var o=document.getElementById("renameField");if(o){if(!DOM.isAncestor(e,o))return!0;o.blur()}var s=function(){CPANEL.util.set_text_content(n,a)};n.innerHTML='<input id="renameField" width="100%" value="'+a.html_encode()+'" />',TEXT_FIELD_FOCUS=1;var r=n.firstChild;r.focus(),EVENT.on(r,"blur",s),EVENT.on(r,"mousedown",YAHOO.util.Event.stopPropagation),EVENT.on(r,"dragstart",YAHOO.util.Event.stopPropagation),EVENT.on(r,"click",YAHOO.util.Event.stopPropagation),EVENT.on(r,"dblclick",YAHOO.util.Event.stopPropagation);var c=new YAHOO.util.KeyListener(r,{keys:[27,13]},(function(e,l,n){switch(l[0]){case 27:s();break;case 13:!function(){TEXT_FIELD_FOCUS=0,new_value=r.value,c.disable();var e=i.getRow(t);new_value&&new_value!=a?(scheduleFileOp("rename",[cwd+"/"+t.getData("file")],[new_value],e,1),r.disabled=!0,EVENT.removeListener(r,"blur",s),r.blur()):s()}()}}));c.enable()}))}},{key:"size",label:"Size",type:"string",sortable:!0,width:100,formatter:function(e,t,l,a){e.innerHTML=t.getData("humansize")}},{key:"mtime",label:"Last Modified",sortable:!0,formatter:function(l,o,s,r){var c;r<i&&(r>=a?c=e:r>=n&&(c=t));var d=new Date(1e3*r);"Invalid Date"!==d.toString()&&(d=d.toCpLocaleString(c)),CPANEL.util.set_text_content(l,d)},width:200},{key:"mimetype",label:"Type",width:180,sortable:!0},{key:"nicemode",label:"Permissions",width:100,type:"number",sortable:!0,editor:s?null:"textbox"}];window.COLUMN_PADDING_BORDER=1,window.NON_NAME_COLUMN_WIDTHS_TOTAL=r.reduce((function(e,t){return"width"in t?e+t.width+window.COLUMN_PADDING_BORDER:e}),1);var c=new YAHOO.util.DataSource;c.responseType=YAHOO.util.DataSource.TYPE_JSARRAY,c.responseSchema={resultNode:"file",resultsList:"files",fields:["mimename","file","humansize","size","mimetype","nicemode","mtime","type"]},(myDataSource=new YAHOO.util.DataSource(CPANEL.security_token+"/json-api/cpanel?cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=listfiles&cpanel_jsonapi_apiversion=2&needmime=1&")).doBeforeCallback=function(e,t,l){return t&&t.cpanelresult&&t.cpanelresult.data&&t.cpanelresult.data[0]&&t.cpanelresult.data[0].absdir&&(cwd=t.cpanelresult.data[0].absdir),l},myDataSource.responseType=YAHOO.util.DataSource.TYPE_JSON,myDataSource.responseSchema={resultsList:"cpanelresult.data",fields:[{key:"mimename"},{key:"file",parser:YAHOO.util.DataSource.parseString},{key:"humansize"},{key:"size",parser:Number},{key:"mimetype"},{key:"nicemode"},{key:"mtime"},{key:"type"}]};YAHOO.util.Dom.get("filesarea");var d=YAHOO.util.Dom.get("subright"),u=d.offsetHeight-DOM.get("midtoolbar").offsetHeight-DOM.get("top").offsetHeight-TABLE_HEADER_HEIGHT-bOffset+"px",f=d.offsetWidth-GUTTER_SPACE-bOffset,m=f+"px",p=f-window.COLUMN_PADDING_BORDER-window.NON_NAME_COLUMN_WIDTHS_TOTAL;p<NAME_COLUMN_MINIMUM_WIDTH&&(p=NAME_COLUMN_MINIMUM_WIDTH),r[1].width=p;var h=new YAHOO.widget.ColumnSet(r);(filesDataTable=new YAHOO.widget.DataTable("filesarea",h,c,{MSG_EMPTY:"",MSG_LOADING:CPANEL.icons.ajax+" "+LANG.loading,scrollable:!0,height:u,width:m,renderLoopSize:200})).onEventSelectRow=function(e){var t=e.target;("tr"===t.nodeName.toLowerCase()||(t=DOM.getAncestorByTagName(t,"tr")))&&(this.isSelected(t)&&1===this.getSelectedRows().length?this.unselectRow(t):arguments.callee.overridee.apply(this,arguments))},filesDataTable.onEventSelectRow.overridee=YAHOO.widget.DataTable.prototype.onEventSelectRow,filesDataTable.subscribe("postRenderEvent",setupFilesTable),EVENT.addListener(window,"resize",(function e(){if(filesDataTable&&filesDataTable.getHdContainerEl()){var t=DOM.get("subright"),l=t.offsetHeight-DOM.get("midtoolbar").offsetHeight-DOM.get("top").offsetHeight-TABLE_HEADER_HEIGHT-bOffset+"px",a=t.offsetWidth-GUTTER_SPACE-bOffset,n=a+"px",i=filesDataTable.getColumn("file"),o=a-window.COLUMN_PADDING_BORDER-window.NON_NAME_COLUMN_WIDTHS_TOTAL;o<NAME_COLUMN_MINIMUM_WIDTH&&(o=NAME_COLUMN_MINIMUM_WIDTH),filesDataTable.setColumnWidth(i,o),filesDataTable.set("width",n),filesDataTable.set("height",l),filesDataTable.validateColumnWidths()}else window.setTimeout(e,1e3)})),filesDataTable.dataSource=myDataSource;filesDataTable.subscribe("columnSortEvent",handleColumnSort),filesDataTable.subscribe("editorSaveEvent",(function(e){var t=e.editor.getColumn(),l=e.editor.getRecord().getData();if("file"==t.key){var a=[cwd+"/"+e.oldData],n=[cwd+"/"+e.newData];a[0]!=n[0]&&scheduleFileOp("rename",a,n,e.editor.cell.parentNode)}else{a=[cwd+"/"+l.file],n=[];e.oldData!=e.newData&&scheduleFileOp("chmod",a,n,e.newData)}})),filesDataTable.subscribe("cellClickEvent",filesDataTable.onEventShowCellEditor),filesDataTable.subscribe("cellClickEvent",filesDataTable.onEventSelectRow),filesDataTable.subscribe("cellClickEvent",(function(){myContextMenu.hide()})),filesDataTable.subscribe("rowDblclickEvent",(function(e){var t=EVENT.getTarget(e),l=getFilePathFromRow(t),a=filesDataTable.getRecord(t).getData("mimetype");window.setTimeout((function(){a.match("-directory")||"mail"==a||"publichtml"==a||"publicftp"==a?updateFileList(l):downloadFile(l)}),100)})),filesDataTable.subscribe("rowClickEvent",(function(e){e.target;var t=document.getElementById("renameField");t&&t.blur(),this.isSelected(e.target)?handleRowSelect():handleRowUnSelect(e)})),filesDataTable.subscribe("editorShowEvent",(function(){window.scrollTop=0})),filesDataTable.subscribe("unselectAllRowsEvent",handleunselectAllRowsEvent);myContextMenu=new YAHOO.widget.ContextMenu("mycontextmenu",{trigger:filesDataTable.getBody()});for(var g,y="",b=0,D=contextMenuItems.length;b<D;b++)y='<i class="'+contextMenuItems[b].className+'" aria-hidden="true"></i> '+contextMenuItems[b].displayName,myContextMenu.addItem(y);myContextMenu.render(document.body),myContextMenu.clickEvent.subscribe((function(e,t,l){var a=t[1];if(a){if(a.cfg.getProperty("disabled"))return;for(var n=this.contextEventTarget;"tr"!=n.tagName.toLowerCase();)if("body"==(n=n.parentNode).tagName.toLowerCase){n=null;break}if(n)if(contextMenuItems[a.index])actionHandler(contextMenuItems[a.index].action);else alert("Event not handled: index:"+a.index+" name:"+a.toString())}})),myContextMenu.triggerContextMenuEvent.subscribe((function(e,t,l){for(var a=this.contextEventTarget;"tr"!=a.tagName.toLowerCase();)if("body"==(a=a.parentNode).tagName.toLowerCase){a=null;break}if(a){filesDataTable.isSelected(a)||(unselectAllFiles(),selectFile(a));for(var n=this.getItems(),i=0,o=contextMenuItems.length;i<o;i++)contextMenuItems[i].obj.test([a])?!0!==contextMenuItems[i].obj.menabled&&(contextMenuItems[i].obj.menabled=!0,n[i].cfg.setProperty("disabled",!1),n[i].cfg.setProperty("visible",!0),n[i]._oAnchor.parentNode.style.display=""):!1!==contextMenuItems[i].obj.menabled&&(contextMenuItems[i].obj.menabled=!1,n[i].cfg.setProperty("disabled",!0),n[i]._oAnchor.parentNode.style.display="none")}})),g=workingdir?function(){updateFileList(workingdir)}:function(){updateFileList(homedir)};window.setTimeout((function(){YAHOO.util.Event.onDOMReady(g)}),50),EVENT.addListener(filesDataTable.getBody(),"mousedown",handleSelectBoxMouseDown)}function checkKeys(e){if(46==e.keyCode){if(Shown_Panel)return;if(0!=TEXT_FIELD_FOCUS)return;var t=filesDataTable.getSelectedTrEls();t&&t[0]&&(srcDirContainsDestDir(cwd,homedir+"/.trash")?show_panel("delete"):show_panel("trash"))}}function _create_new(e){var t=this.form.path.value,l=this.form.name.value,a=CPANEL.security_token+"/json-api/cpanel",n={success:function(t){try{var l=YAHOO.lang.JSON.parse(t.responseText);if(l.cpanelresult.error)alert("ERROR: "+l.cpanelresult.error);else{var a=l.cpanelresult.data[0];if(e){if(a.path!==cwd)throw"Directory changed";var n=a.name,i=cwd+"/"+n;filesDataTable.subscribe("dataReturnEvent",(function e(t){this.unsubscribe("dataReturnEvent",e);for(var l,a=t.response.results,o=0,s=a.length;o<s&&a[o].file!==n;)o++;do{o++}while((l=a[o])&&!/-directory/i.test(l.mimetype));add_path_to_tree(i,l&&l.file)}))}refreshFiles()}}catch(e){alert("AJAX error; please reload this page and try again."),window.console&&console.log(e,t&&t.responseText)}}},i="cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func="+(e?"mkdir":"mkfile")+"&path="+safeencode(t)+"&name="+safeencode(l);YAHOO.util.Connect.asyncRequest("POST",a,n,i)}function create_new_file(){_create_new.call(this)}function create_new_dir(){_create_new.call(this,!0)}function handleSubmit(){this.submit()}function handleCancel(){TEXT_FIELD_FOCUS=0,this.cancel(),waitpanel.hide()}function handleMove(e){var t=this.getData().movefilepath;return""===t&&(t="/"),scheduleFileOp("move",filesDataTable.getSelectedTrEls().map(getFilePathFromRow),[t],filesDataTable.getSelectedTrEls()[0]),this.hide(),!1}function handleDelete(e){return deleteFiles(this.getData()),this.hide(),!1}function handleEmptyTrash(){return emptyTrash(),updateFileList(homedir),this.hide(),!1}function handleRestore(e){return restoreFiles(),this.hide(),!1}function disableEncodings(e){show_panel("encodingsdisabled");var t=document.getElementById(e+"-encodings");t&&(t.style.display="none"),SetNvData("ignorecharencoding",1),handleEdit(panels.edit.panel)}function handleEdit(e){e&&e.getData||(e=this),waitpanel.hide();var t=e.getData();return document.getElementById("actionform_temp_charset").value=t.charset,editFile(1,cwd+"/"+t.file),e.hide(),!1}function handleSavePrefs(){var e=document.getElementById("prefs-ignorecharencoding").checked,t=document.getElementById("optionselect_showhidden").checked;e?NVData.ignorecharencoding||(SetNvData("ignorecharencoding",1),DOM.get("edit-charset").selectedIndex=0):SetNvData("ignorecharencoding",0),t?NVData.showhiddenfiles||(SetNvData("showhiddenfiles",1),showhidden=1):(SetNvData("showhiddenfiles",0),showhidden=0),setDefaultDirectory(),myFileTree.init(),updateFileList(cwd),this.hide()}function setDefaultDirectory(){var e=null,t=null,l=null;if(document.getElementById("dirselect_homedir").checked)t="homedir",e=homedir;else if(document.getElementById("dirselect_webroot").checked)t="webroot",e=homedir+"/public_html";else if(document.getElementById("dirselect_ftproot").checked)t="ftproot",e=homedir+"/public_ftp";else if(document.getElementById("rbtnDomainRoot").checked){t="domainrootselect";var a=document.getElementById("ddlDomainSelect"),n=a.options[a.selectedIndex].value;l=n,e=web_docroots[n]}else t="homedir",e=homedir;SetNvData("defaultdir",e),SetNvData("defaultdirtype",t),SetNvData("defaultdirdomain",l)}function handleHtmlEdit(e){var t=this.getData();return document.getElementById("actionform_charset").value=t.charset,document.getElementById("actionform_baseurl").value=t.url[0],document.getElementById("actionform_basedir").value=t.basedir[0],editFile(2,cwd+"/"+t.file),this.hide(),!1}function handleRename(e){TEXT_FIELD_FOCUS=0;var t=this.getData().newname;if(void 0!==window.force_select){var l=[window.force_select];window.force_select=void 0}else l=filesDataTable.getSelectedTrEls();return scheduleFileOp("rename",[getFilePathFromRow(l[0])],[t],l[0],1),this.hide(),!1}function handleChmod(e){var t="0"+this.getData().u+this.getData().g+this.getData().w,l=filesDataTable.getSelectedTrEls();return scheduleFileOp("chmod",l.map(getFilePathFromRow),[],t,1,l),this.hide(),!1}function handleExtract(e){var t=this.getData().extractfilepath,l=getFilePathFromRow(filesDataTable.getSelectedTrEls()[0]);return show_loading("Extracting Archive","Archive: "+homeicon+l.html_encode()+"<br />Extraction Location: "+homeicon+t.html_encode()),scheduleFileOp("extract",[l],[t]),this.hide(),!1}function handleCompress(e){var t=this.getData().compressfilepath,l=this.getData().compresstype||"zip";show_loading("Creating Archive","Archive Location: "+homeicon+t.html_encode());var a=[t];return scheduleFileOp("compress",filesDataTable.getSelectedTrEls().map(getFilePathFromRow),a,l),this.hide(),!1}function handleCopy(e){var t=[this.getData().copyfilepath];return scheduleFileOp("copy",filesDataTable.getSelectedTrEls().map(getFilePathFromRow),t),this.hide(),!1}EVENT.addListener(window,"load",myFileTree.init,myFileTree,!0);var Shown_Panel,cancel_btn_txt=LOCALE.maketext("Cancel"),panels={newfile:{onload:function(){document.getElementById("new-file-name").value=""},panel:null,targetfilepath:"new-file-path",submit:create_new_file,buttons:[{text:LOCALE.maketext("Create New File"),isDefault:!0},{text:cancel_btn_txt}]},newfolder:{panel:null,onload:function(){document.getElementById("new-folder-name").value=""},targetfilepath:"new-folder-path",submit:create_new_dir,buttons:[{text:LOCALE.maketext("Create New Folder"),isDefault:!0},{text:cancel_btn_txt}]},trash:{panel:null,filelist:"trash-filelist",submit:handleDelete,buttons:[{text:LOCALE.maketext("Confirm"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){},onload:function(){document.getElementById("deleteme").checked=!1}},emptytrash:{panel:null,submit:handleEmptyTrash,buttons:[{text:LOCALE.maketext("Empty Trash"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},delete:{panel:null,filelist:"delete-filelist",submit:handleDelete,buttons:[{text:LOCALE.maketext("Delete Files"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},restore:{panel:null,filelist:"restore-filelist",submit:handleRestore,buttons:[{text:LOCALE.maketext("Restore Files"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},extract:{panel:null,filelist:"extract-filelist",targetfilepath:"extractfilepath",submit:handleExtract,buttons:[{text:LOCALE.maketext("Extract Files"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},compress:{panel:null,filelist:"compress-filelist",displaylist:{multiple:"compress-multifile",single:"compress-singlefile"},onload:function(e){setCompressFileName(e)},submit:handleCompress,buttons:[{text:LOCALE.maketext("Compress Files"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},copy:{panel:null,filelist:"copy-filelist",hasfilelist:"copy-hasfilelist",targetfilepath:"copy-file-path",submit:handleCopy,buttons:[{text:LOCALE.maketext("Copy Files"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},"search-results":{panel:null,init:function(){var e=[{key:"mimeinfo",label:" ",type:"string",width:32,sortable:!1,formatter:formatImageCellNoCheck},{key:"file",label:"Name",sortable:!0,formatter:formatSearchFile}],t=new YAHOO.util.DataSource([{mimeinfo:"",file:""}]),l=new YAHOO.widget.ColumnSet(e),a=YAHOO.util.Dom.get("search-results-div");(searchDataTable=new YAHOO.widget.DataTable(a,l,t,{scrollable:!0,height:"280px",width:"460px"})).subscribe("rowDblclickEvent",handleSearchDblClick)},buttons:[{text:LOCALE.maketext("Close"),handler:handleCancel,isDefault:!0}],successFunc:function(e){},failFunc:function(e){},onunload:function(){document.getElementById("search-results-div").style.display="none",nukeSearchResults()}},move:{panel:null,filelist:"move-filelist",hasfilelist:"move-hasfilelist",targetfilepath:"move-file-path",submit:handleMove,buttons:[{text:LOCALE.maketext("Move Files"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},rename:{panel:null,file:"rename-file",newfile:"rename-newfile",hasfile:"rename-hasfile",singlefilelist:"rename-filelist",targetfilepath:"rename-dir",submit:handleRename,buttons:[{text:LOCALE.maketext("Rename File"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){},onload:function(){TEXT_FIELD_FOCUS=1}},edit:{panel:null,file:"edit-file",hasfile:"edit-hasfile",singlefilelist:"edit-filelist",targetfilepath:"edit-dir",submit:handleEdit,buttons:[{text:LOCALE.maketext("Edit"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},encodingsdisabled:{panel:null,submit:function(){this.cancel()},buttons:[{text:LOCALE.maketext("OK"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}},prefs:{panel:null,submit:handleSavePrefs,buttons:[{text:LOCALE.maketext("Save"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){},onload:function(){if(self.NVData)if(document.getElementById("prefs-ignorecharencoding").checked=!!NVData.ignorecharencoding,document.getElementById("optionselect_showhidden").checked=!!NVData.showhiddenfiles,null!=NVData.defaultdir)if(null!==NVData.defaultdirtype){var e=NVData.defaultdirtype;if("homedir"===e)document.getElementById("dirselect_homedir").checked=!0;else if("webroot"===e)document.getElementById("dirselect_webroot").checked=!0;else if("ftproot"===e)document.getElementById("dirselect_ftproot").checked=!0;else if("domainrootselect"===e){if(document.getElementById("rbtnDomainRoot").checked=!0,null!==NVData.defaultdirdomain)document.getElementById("ddlDomainSelect").value=NVData.defaultdirdomain}}else document.getElementById("dirselect_homedir").checked=!0;else document.getElementById("dirselect_homedir").checked=!0}},chmod:{file:"chmod-file",targetfilepath:"chmod-dir",filelist:"chmod-filelist",panel:null,submit:handleChmod,buttons:[{text:LOCALE.maketext("Change Permissions"),isDefault:!0},{text:cancel_btn_txt}],onload:function(e){if(e[0]){var t="x"+filesDataTable.getRecord(e[0]).getData("nicemode"),l=t.substr(2,1),a=t.substr(3,1),n=t.substr(4,1),i=4==l||5==l||6==l||7==l?1:0,o=2==l||3==l||6==l||7==l?1:0,s=1==l||3==l||5==l||7==l?1:0,r=4==a||5==a||6==a||7==a?1:0,c=2==a||3==a||6==a||7==a?1:0,d=1==a||3==a||5==a||7==a?1:0,u=4==n||5==n||6==n||7==n?1:0,f=2==n||3==n||6==n||7==n?1:0,m=1==n||3==n||5==n||7==n?1:0;document.fmode.ur.checked=i,document.fmode.uw.checked=o,document.fmode.ux.checked=s,document.fmode.gr.checked=r,document.fmode.gw.checked=c,document.fmode.gx.checked=d,document.fmode.wr.checked=u,document.fmode.ww.checked=f,document.fmode.wx.checked=m,calcperm()}},successFunc:function(e){refreshFiles()},failFunc:function(e){}},htmledit:{panel:null,file:"htmledit-file",hasfile:"htmledit-hasfile",singlefilelist:"htmledit-filelist",targetfilepath:"htmledit-dir",submit:handleHtmlEdit,buttons:[{text:LOCALE.maketext("Edit"),isDefault:!0},{text:cancel_btn_txt}],successFunc:function(e){},failFunc:function(e){}}};function init_panels(e){if(!inited_panels[e])for(var t in inited_panels[e]=1,panels)if(t==e){var l=document.getElementById(t);if(l){l.style.display="";for(var a,n={width:"500px",fixedcenter:!0,modal:!0,visible:!1,draggable:!0,close:!0,constraintoviewport:!0,postmethod:"manual",effect:{effect:CPANEL.animate.ContainerEffect.FADE_MODAL,duration:.25},buttons:panels[t].buttons},i=0;a=n.buttons[i];i++)"handler"in a||(a.handler=a.isDefault?handleSubmit:handleCancel);panels[t].panel=new YAHOO.widget.Dialog(t,n),panels[t].panel.callback={success:panels[t].successFunc,failure:panels[t].failFunc},"submit"in panels[t]&&panels[t].panel.manualSubmitEvent.subscribe(panels[t].submit),"edit"==t&&panels[t].panel.hideEvent.subscribe((function(){waitpanel.hide()})),panels[t].onunload&&panels[t].panel.beforeHideEvent.subscribe(panels[t].onunload,panels[t].panel,!0),panels[t].panel.beforeHideEvent.subscribe(panel_cleanup,panels[t],!0),panels[t].init&&panels[t].init(),panels[t].panel.showEvent.subscribe((function(){Shown_Panel=this})),panels[t].panel.hideEvent.subscribe((function(){Shown_Panel===this&&(Shown_Panel=void 0)}))}}}function panel_cleanup(e){this.filelist&&(document.getElementById(this.filelist).innerHTML="")}function getRelPath(e,t,l){return l||(l=0),e.substring(homedir.length+l)}function init_simple_panels(){(resultspanel=new YAHOO.widget.Dialog("resultspanel",{width:"700px",fixedcenter:!0,close:!0,draggable:!0,modal:!0,buttons:closeButtons,visible:!1})).beforeHideEvent.subscribe((function(){this.setBody("")}),resultspanel,!0),waitpanel=new YAHOO.widget.Panel("waitpanel",{fixedcenter:!0,close:!1,draggable:!1,modal:!0,visible:!1})}function show_results(e,t){resultspanel.setHeader('<div class="lt"></div><span>'+e+'</span><div class="rt"></div>'),resultspanel.setBody('<div style="height: 350px; overflow:auto;"><pre>'+t.html_encode()+"</pre></div>"),resultspanel.render(document.body),resultspanel.show()}function show_loading(e,t){waitpanel.setHeader('<div class="lt"></div><span>'+e+'</span><div class="rt"></div>');var l='<img src="img/yui/rel_interstitial_loading.gif" />';t?waitpanel.setBody(t+"<br />"+l):waitpanel.setBody(l),waitpanel.render(document.body),waitpanel.show()}function showPrefs(){show_panel("prefs")}function show_panel(e,t,l){if(init_panels(e),safecwd=cwd.substring(homedir.length),void 0!==l){var a=[l];window.force_select=l}else{a=filesDataTable.getSelectedTrEls();void 0!==typeof window.force_select&&(window.force_select=void 0)}if(panels[e].file&&a[0]){var n=getFilePathFromRow(a[0]);n=n.split("/").pop(),document.getElementById(panels[e].file).value=n,panels[e].newfile&&(document.getElementById(panels[e].newfile).value=n)}if(panels[e].targetfilepath&&(document.getElementById(panels[e].targetfilepath).value=safecwd),panels[e].singlefilelist&&a[0]){document.getElementById(panels[e].singlefilelist).innerHTML=getRelPath(getFilePathFromRow(a[0])).html_encode(),document.getElementById(panels[e].singlefilelist).className="dispfile dispfileContainer";var i=document.getElementById(panels[e].hasfile);i&&(i.style.display="block"),panels[e].panel.cfg.queueProperty("buttons",panels[e].buttons)}else panels[e].singlefilelist&&panels[e].panel.cfg.queueProperty("buttons",closeButtons);if(panels[e].filelist&&a[0]){var o,s=document.getElementById(panels[e].filelist);s.className="dispfileContainer",s.innerHTML="";for(var r=0,c=a.length,d=0;d<c;d++){var u=getRelPath(getFilePathFromRow(a[d])).html_encode(),f=document.createElement("div");f.innerHTML=u,f.className="dispfile",s.appendChild(f),r++,o||(o=f.offsetHeight)}o||(o=14);var m=o*r+2;m<200?(s.style.height=m+"px",s.style.overflow="hidden"):(s.style.height="200px",s.style.overflow="auto");var p=document.getElementById(panels[e].hasfilelist);p&&(p.style.display="block"),panels[e].panel.cfg.queueProperty("buttons",panels[e].buttons)}else panels[e].filelist&&panels[e].panel.cfg.queueProperty("buttons",closeButtons);if(panels[e].displaylist){var h=filesDataTable.getRecord(a[0]).getData("mimetype");h.match("-directory")||"mail"==h||"publichtml"==h||"publicftp"==h||a[1]?(document.getElementById(panels[e].displaylist.multiple).style.display="block",document.getElementById(panels[e].displaylist.single).style.display="none"):(document.getElementById(panels[e].displaylist.multiple).style.display="none",document.getElementById(panels[e].displaylist.single).style.display="block")}panels[e].onload&&panels[e].onload(a),t&&panels[e].panel.cfg.queueProperty("modal",!1),panels[e].panel.render(),panels[e].panel.show()}function getfilesAreaScrollableEl(){var e=filesDataTable.getBdContainerEl();return e.id||(e.id="filesarea_scrollable"),e}function handleSelectBoxMouseDown(e){var t=YAHOO.util.Event.getPageX(e),l=YAHOO.util.Event.getPageY(e),a=getfilesAreaScrollableEl();"MSIE"==quirksmode&&(document.onselectstart=new Function("return false;"));var n=document.getElementById("index");return"Safari"!=quirksmode&&"Safari5"!=quirksmode||(n.style.KhtmlUserSelect="none"),"Mozilla"==quirksmode&&(n.style.MozUserSelect="none",a.style.MozUserSelect="none"),selectWindowRegion=YAHOO.util.Region.getRegion(a),selectMode=1,selectEl=document.getElementById("select"),selectorEl=a,selector=a.id,selectStartScrollLeft=a.scrollLeft,selectStartScrollTop=a.scrollTop,selectStartX=t,selectStartY=l,EVENT.addListener(document,"mousemove",handleSelectBoxMove,this,!0),EVENT.addListener(document,"mouseup",handleSelectBoxUp,this,!0),EVENT.addListener(a,"scroll",handleSelectBoxMove,this,!0),!1}function rebuildLocCache(){locCache={};for(var e=filesDataTable.getRows(),t=0;t<e.length;t++)locCache[e[t].id]=YAHOO.util.Region.getRegion(e[t])}function handleSelectBoxUp(e){if(selectMode){2==selectMode&&handleSelections(),selectMode=0;var t=getfilesAreaScrollableEl();EVENT.removeListener(document,"mouseup",handleSelectBoxUp),EVENT.removeListener(document,"mousemove",handleSelectBoxMove),EVENT.removeListener(t,"scroll",handleSelectBoxMove);var l=document.getElementById("index");t=getfilesAreaScrollableEl();"MSIE"==quirksmode&&(document.onselectstart=new Function("return true;")),"Safari"!=quirksmode&&"Safari5"!=quirksmode||(l.style.KhtmlUserSelect=""),"Mozilla"==quirksmode&&(l.style.MozUserSelect="",t.style.MozUserSelect="");var a=document.getElementById("select");a.style.display="none",a=null}}function handleSelectBoxMove(e){if(!selectMode)return!1;if(selectEl){var t=YAHOO.util.Event.getPageX(e),l=YAHOO.util.Event.getPageY(e);if(1==selectMode&&(Math.abs(l-selectStartY)>2||Math.abs(t-selectStartX)>2))for(var a in selectMode=2,selectEl.style.left=t+"px",selectEl.style.top=l+"px",selectEl.style.width="0px",selectEl.style.height="0px",selectEl.style.display="block",myContextMenu.hide(),AltKeyPressed||unselectAllFiles(),rebuildLocCache(),viewportHeight=YAHOO.util.Dom.getViewportHeight(),selectOvers)delete selectOvers[a];if(2==selectMode){YAHOO.util.Event.preventDefault(e),0==t?t=lastX:lastX=t,0==l?l=lastY:lastY=l;var n,i,o,s,r=selectorEl,c=r.scrollLeft-selectStartScrollLeft,d=r.scrollTop-selectStartScrollTop,u=selectWindowRegion.left,f=selectWindowRegion.top,m=selectWindowRegion.right,p=selectWindowRegion.bottom;l+d>selectStartY?(n=selectStartY-d,i=l):(n=l,i=selectStartY-d),t+c>selectStartX?(o=selectStartX-c,s=t):(o=t,s=selectStartX-c);var h=i,g=n,y=o,b=s;h>p?(h=p+2,selectEl.style.borderBottom=""):selectEl.style.borderBottom="solid 2px #33c",g<f?(g=f-2,selectEl.style.borderTop=""):selectEl.style.borderTop="solid 2px #33c",y<u?(y=u-2,selectEl.style.borderLeft=""):selectEl.style.borderLeft="solid 2px #33c",b>m?(b=m+2,selectEl.style.borderRight=""):selectEl.style.borderRight="solid 2px #33c",h<g&&(h=g+2),b<y&&(b=y+2),selectEl.style.left=y+"px",selectEl.style.top=g+"px",selectEl.style.width=b-y+"px",selectEl.style.height=h-g+"px",n+=d,i+=d,o+=c,s+=c;var D,w=new YAHOO.util.Region(n,s,i,o),v={},E=[],_=[];for(var a in selectOvers){(T=selectOvers[a])&&(w.intersect(T)||E.push(a),v[a]=!0,delete selectOvers[a])}for(a in locCache){var T;(T=locCache[a])&&(w.intersect(T)&&(v[a]||_.push(a),selectOvers[a]=T))}for(D=E.length,a=0;a<D;a++)unselectFile(E[a]),handleRowUnSelect({target:E[a]});for(D=_.length,a=0;a<D;a++)selectFile(_[a],1),handleRowSelect();var O=10;if("Safari"==quirksmode||"Safari5"==quirksmode){O=38;var F=new Date,S=F.getTime();if(!(lastSelectTime+100<S))return F=null,S=null,!1;lastSelectTime=S,F=null}return setmoveEvent(),f>l?scrollDiv(r,1,O):viewportHeight-10<l&&scrollDiv(r,0,O),!1}}}function setmoveEvent(e){moveEvent=2==e?0:1}function scrollDiv(e,t,l){null==l&&(l=12);var a=0,n=e.scrollHeight-e.offsetHeight;return"MSIE"==quirksmode&&(n=e.scrollHeight),1==t?e.scrollTop>l?(e.scrollTop-=l,a=1):0==e.scrollTop?a=0:e.scrollTop=0:0==t&&(e.scrollTop<n-l?(e.scrollTop+=l,a=1):n==e.scrollTop?a=0:(e.scrollTop=n,a=1)),a}function setupKeyL(){EVENT.on(window,"keyup",(function(e){var t=e.charCode||e.keyCode;(e.metaKey||e.AltKey||224==t||18==t)&&(AltKeyPressed=0),(e.ctrlKey||e.shiftKey||17==t||16==t)&&(SVis=0,CtrlKeyPressed=0,document.getElementById("copyi").style.display="none")})),EVENT.on(window,"keydown",(function(e){var t=e.charCode||e.keyCode;(e.metaKey||e.AltKey||224==t||18==t)&&(AltKeyPressed=1),(e.ctrlKey||e.shiftKey||17==t||16==t)&&(CtrlKeyPressed=1)}))}function getRegion(e){if(("Safari"==quirksmode||"Safari5"==quirksmode)&&e.cells&&e.cells[0]){for(var t=YAHOO.util.Dom.getXY(e.cells[0]),l=t[1],a=t[0],n=0;n<e.cells.length;n++)a+=e.cells[n].offsetWidth;var i=t[1]+e.cells[0].offsetHeight,o=t[0];return new YAHOO.util.Region(l,a,i,o)}return YAHOO.util.Region.getRegion(e)}function dosearch(e,t){init_panels("search-results");var l=document.getElementById(e),a=document.getElementById(t).value,n=l.options[l.selectedIndex].value;n=getRelPath(n="$cwd"==n?cwd:homedir+"/"+n),show_loading(LOCALE.maketext("Searching Files"),LOCALE.maketext("Location")+": "+homeicon+n.html_encode()+"<br />"+LOCALE.maketext("Search Regex")+": "+a.html_encode()),searchDataSource||(searchDataSource=new YAHOO.util.DataSource(CPANEL.security_token+"/json-api/cpanel?cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=search&cpanel_jsonapi_apiversion=2&")),searchDataSource.responseType=YAHOO.util.DataSource.TYPE_JSON,searchDataSource.responseSchema={resultsList:"cpanelresult.data",fields:["mimeinfo","file"]},searchDataTable.dataSource=searchDataSource,searchDataTable.clearRows(),searchDataTable.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING,YAHOO.widget.DataTable.CLASS_LOADING),CPANEL.util.set_text_content("search-for",a),searchDataSource.sendRequest("regex="+safeencode(a)+"&dir="+safeencode(n),searchDataTable.onDataReturnSearch,searchDataTable)}function nukeSearchResults(){searchDataTable&&(searchDataTable.getRecordSet().reset(),searchDataTable.clearRows())}function getMimeTypeFromImage(e){return e.split("/").pop().replace(/\.png$/,"")}function handleSearchDblClick(e){var t=EVENT.getTarget(e),l=searchDataTable.getRecord(t).getData(),a=l.file,n=l.mimeinfo;window.setTimeout((function(){n.match("-directory")||"mail"==n||"publichtml"==n||"publicftp"==n?updateFileList(a):updateFileList(a.split("/").slice(0,-1).join("/")||"/");panels["search-results"].panel.hide()}),100)}function searchFailed(e){waitpanel.hide(),alert("There was an unknown problem during the search.")}function dir_uri_action(e){var t=filesDataTable.getSelectedTrEls();document.getElementById("actionform").action=e,document.getElementById("actionform_file").value="",document.getElementById("actionform_dir").value=getFilePathFromRow(t[0]),document.getElementById("actionform").submit()}function isLikeAnArray(e){return e.length>0&&!(!e[0]||e[0]&&1==e[0].length)}function load_docroots(){if(!loaded_docroots){cpanel_jsonapi2((function(e){for(var t=0;t<e.length;t++){var l=e[t].docroot,a=e[t].domain;web_docroots[a]=l}loaded_docroots=1}),"DomainLookup","getdocroots")}}function populate_charset(e){e.options.length=0,e.add(new Option(LANG.auto_detect,"_DETECT_"),void 0);for(var t=0;t<charmaps.length;t++)e.add(new Option(charmaps[t]),void 0)}function select_charset(e,t){var l=t.toLowerCase();/^us-?ascii$/i.test(l)?l="utf-8":/^(?:latin|iso-?8859)-?1$/i.test(l)&&(l="windows-1252");for(var a=0;a<e.options.length;a++)if(e.options[a].value==l){e.selectedIndex=a;break}}function toggleTextFieldFocus(e,t){0==t&&(TEXT_FIELD_FOCUS=0),1==t&&(TEXT_FIELD_FOCUS=1)}function initialize(){upgradeFm(),setupKeyL(),init_simple_panels(),EVENT.on(document,"keyup",checkKeys),EVENT.addFocusListener(["location","searchbox"],toggleTextFieldFocus,1),EVENT.addBlurListener(["location","searchbox"],toggleTextFieldFocus,0)}EVENT.onDOMReady(initialize);
Back to Directory
File Manager