"+i+"
");var j=$("#pathRenameTextarea");"split"==G.userConfig.listType&&j.css({width:j.parents(".filename").width()-32,height:j.parents(".filename").height()+1});var k=d.length;"folder"!=f&&-1!=d.indexOf(".")&&(k=d.length-f.length-1),f||0!=d.indexOf(".")?j.textSelect(0,k):j.textSelect(0,d.length);var l=function(g){"oexe"==f&&(g+=".oexe");if(g!=d)a=e+d,g=e+g,c.rname(a,g,function(a){a===!1?$(b).removeClass("file-icon-edit").find(".title").html(htmlEncode(d)):r(a)});else{var h=d;".oexe"==h.substr(-5)&&(h=h.substr(0,h.length-5)),$(b).removeClass("file-icon-edit").find(".title").html(htmlEncode(h))}};j.focus().autoTextarea(),j.keydown(function(a){13==a.keyCode&&(a.preventDefault(),stopPP(a),l(j.attr("value"))),27==a.keyCode&&("oexe"==f&&(d=d.replace(".oexe","")),$(b).removeClass("file-icon-edit").find(".title").html(d))}).unbind("blur").blur(function(){l(j.val())})}},r=function(a){ui.fileLight.clear(),ui.f5Callback(function(){j(a),core.isApp("explorer")&&ui.tree.checkIfChange(G.thisPath)})},s=function(a){var b={},c=[];a.sort(function(a,b){return a.path==b.path?0:a.path>b.path?1:-1});for(var d=function(a){for(var c=a;""!=a;){if("undefined"!=typeof b[a])return 1==b[a]?!0:c==a?(b[a]=1,!1):!0;a=core.pathFather(a)}return!1},e=0;e
1?c.zipDownload(a):$.each(a,function(){kodApp.download(this.path)})},shareEdit:function(){var a=u("path",t().path);try{var b=G.jsonData.shareList[a.sid];c.shareBox(b)}catch(d){}},shareOpenWindow:function(){var a=u("path",t().path),b="file";"folder"==a.type&&(b=1==a.codeRead?"codeRead":"folder");var c=G.appHost+"share/"+b+"&user="+G.jsonData.info.id+"&sid="+a.sid;window.open(c)},shareOpenPath:function(){var a=t(),b=u("path",a.path);if(!b||!G.jsonData.shareList)return void kodApp.open(a.path,a.type);var c=G.jsonData.shareList[b.sid],d=core.pathFather(c.path),e=core.pathThis(c.path);"folder"==c.type?ui.path.list(c.path,""):ui.path.list(d,"",function(){j(e)})},explorer:function(){core.explorer(t().path)},explorerNew:function(){window.open(G.appHost+"explorer&path="+t().path)},openProject:function(){core.explorerCode(t().path)},search:function(a,b){return a?void e(a,b):void e("",t().path)},fav:function(){var a=t(),b=ui.fileLight.fileListSelect().last();a.name=trim(b.find(".filename").text()),c.fav(a)},recycleClear:function(){c.remove([{type:"recycle-clear",path:""}],function(){ui.f5()})},remove:function(a,b,d){if(G.jsonData.info&&g()){var e=t(!0);G.jsonData.info&&G.jsonData.info.pathType==G.KOD_USER_SHARE&&G.jsonData.info.id==G.userID&&-1==trim(G.thisPath,"/").indexOf("/")&&$.each(e,function(a,b){var c=u("path",e[a].path);void 0!=c&&(e[a].type="share",e[a].path=c.sid)}),d?c.remove(e,d,a,b):c.remove(e,r,a,b)}},favRemove:function(){var a=$(".file.select .filename");a.each(function(b){var d=trim($(this).text());b!=a.length-1?c.favRemove(d,"",!0):c.favRemove(d,function(a){Tips.tips(a),ui.tree.refreshFav()},!0)})},clipboard:function(){d.clipboard()},copy:function(){g()&&d.copy(t(!0))},cute:function(){g()&&d.cute(t(!0),ui.f5)},cuteDrag:function(a){d.cuteDrag(t(!0),a,r)},copyDrag:function(a,b){d.copyDrag(t(!0),a,r,b)},copyTo:function(){core.api.pathSelect({type:"folder",title:LNG.copy_to},function(a){d.copyDrag(t(!0),a,r,!1)})},cuteTo:function(){core.api.pathSelect({type:"folder",title:LNG.cute_to},function(a){d.cuteDrag(t(!0),a,r)})},past:function(){var a=G.thisPath;"split"==G.userConfig.listType&&($containBox=$(".split-box.split-select"),1==$containBox.length&&(a=ui.fileLight.path($containBox))),d.past(a,r)},info:function(){c.info(t(!0))},newFile:function(a){void 0==a&&(a="txt"),p("file",n(LNG.newfile,a),a)},newFolder:function(){p("folder",n(LNG.newfolder),"")},shareFile:function(){var a=G.appHost+"share/file&sid="+G.sid+"&user="+G.user+"&path="+urlEncode(t().path);window.open(a)},rname:q,list:h,setSearchByStr:l,setSelectByChar:k,setSelectByFilename:j}});;define("app/path/pathOperate",["./tpl/share.html","./tpl/fileinfo/fileInfo.html","./tpl/fileinfo/pathInfo.html","./tpl/fileinfo/pathInfoMore.html","./tpl/appEdit.html"],function(a,b){var c=["/","\\",":","*","?",'"',"<",">","|"],d=["/","\\"],e=function(a){var b=function(a,b){for(var c=b.length,d=0;c>d;d++)if(a.indexOf(b[d])>0)return!0;return!1},e=d;return G.systemOS&&"windows"==G.systemOS&&(e=c),b(a,e)?(Tips.tips(LNG.path_not_allow+": "+e.join(", "),!1),!1):!0},f=function(a){for(var b=[],c=function(a){return a?a.replace(/"/g,'\\\\"'):a},d=0;d";"share"==a[0].type&&G.selfShare[a[0].path]&&(j=""+htmlEncode(G.selfShare[a[0].path].name)+""),g=a.length>1?j+' ... '+a.length+LNG.remove_item+"
"+g:j+"
"+g}var k=function(){$.ajax({url:h,type:"POST",dataType:"json",data:i,beforeSend:function(){Tips.loading()},error:core.ajaxError,success:function(c){if(Tips.close(c),ShareData.frameTop("",function(a){a.ui.f5()}),"share"==a[0].type){G.selfShare=c.info;var d=$.dialog.list["share-dialog"];d&&d.close()}e==LNG.recycle_clear?core.playSound("recycle_clear"):core.playSound("file_remove"),"function"==typeof b&&b(c)}})};c?k():$.dialog({id:"dialog-path-remove",fixed:!0,icon:"question",title:e,padding:"40px 40px",lock:!0,background:"#000",opacity:.1,content:""+g+"
",ok:k,cancel:!0})}},k=function(a){if(core.authCheck("explorer.fileDownload",!0)&&!(a.length<1)){var b=G.appHost+"explorer/zipDownload";"undefined"!=typeof G.sharePage&&(b=G.appHost+"share/zipDownload&user="+G.user+"&sid="+G.sid),$.ajax({url:b,type:"POST",dataType:"json",data:f(a),beforeSend:function(){Tips.loading(LNG.zip_download_ready)},error:core.ajaxError,success:function(a){Tips.close(a),Tips.tips(a);var b=G.appHost+"explorer/fileDownloadRemove&path="+urlEncode(a.info);b+="&accessToken="+G.accessToken,"undefined"!=typeof G.sharePage&&(b=G.appHost+"share/fileDownloadRemove&user="+G.user+"&sid="+G.sid+"&path="+urlEncode(a.info)),$.dialog({icon:"succeed",title:!1,time:2,content:LNG.download_ready+"..."}),$('').appendTo("body")}})}},l=function(a,b,c){a.length<1||(c||(c="zip"),$.ajax({url:G.appHost+"explorer/zip&fileType="+c,type:"POST",dataType:"json",data:f(a),beforeSend:function(){Tips.loading(LNG.ziping)},error:core.ajaxError,success:function(a){Tips.close(a),a.code&&core.playSound("drag_drop"),"function"==typeof b&&b(a.info)}}))},m=function(a,b,c){if(a){var d=function(a){$.ajax({url:a,beforeSend:function(){Tips.loading(LNG.unziping)},error:core.ajaxError,success:function(a){Tips.close(a),"function"==typeof b&&b(a)}})},e=G.appHost+"explorer/unzip&path="+urlEncode(a);"toThis"==c&&(e+="&toThis=1"),"toFolder"==c?core.api.pathSelect({type:"folder",title:LNG.unzip_to},function(a){e+="&pathTo="+a,d(e)}):d(e)}},n=function(a){var b=a.path,c=core.pathPre(b);if(c==G.KOD_GROUP_PATH||c==G.KOD_GROUP_SHARE||c==G.KOD_USER_SHARE)return void Tips.tips(LNG.path_can_not_share,"warning");var d="folder"==a.type?"folder":"file";b.length<1||core.authCheck("userShare.set",!0)&&$.ajax({url:G.appHost+"userShare/checkByPath&path="+urlEncode(b),dataType:"json",error:core.ajaxError,success:function(a){if(a.code)o(a.data);else{G.selfShare=a.info;var c={path:b,type:d,name:core.pathThis(b)};p(c,function(a){a.code?(G.selfShare=a.info,ui.f5(),o(a.data)):(Tips.tips(a),o(void 0,function(){$(".content-info input[name=type]").val(d),$(".content-info input[name=path]").val(b),$(".content-info input[name=name]").val(core.pathThis(b)+"(1)"),"file"==d&&($(".label-code-read").addClass("hidden"),$(".label-can-upload").addClass("hidden"))}))})}}})},o=function(b,c){0!=$(".share-dialog").length&&$(".share-dialog").shake(3,30,100),a.async(["lib/jquery.datetimepicker/jquery.datetimepicker.css","lib/jquery.datetimepicker/jquery.datetimepicker.js"],function(){q(b),void 0!=c&&c()})},p=function(a,b){$.ajax({url:G.appHost+"userShare/set",data:a,type:"POST",dataType:"json",beforeSend:function(a){$(".share-create-button").addClass("disabled")},error:function(){Tips.tips(LNG.error,!1)},success:function(a){$(".share-create-button").removeClass("disabled"),void 0!=b&&b(a)}})},q=function(b){var c=a("./tpl/share.html"),d=template.compile(c),e=d({LNG:LNG});$.dialog({id:"share-dialog",simple:!0,resize:!1,width:"425px",title:LNG.share,padding:"0",fixed:!0,content:e});var f="zh-CN"==G.lang?"ch":"en";$("#share-time").datetimepicker({format:"Y/m/d H:i",formatDate:"Y/m/d H:i",minDate:date("Y/m/d H:i",time()-86400),timepicker:!0,lang:f}),$("#share-time").unbind("blur").bind("blur",function(a){stopPP(a)});var g=function(a){if(Hook.trigger("explorer.path.share.uiInitStart"),$(".share-setting-more").addClass("hidden"),void 0==a)$(".share-has-url").addClass("hidden"),$(".share-bottom-action .share-remove-button").addClass("hidden"),$(".content-info input[name=sid]").val(""),$(".content-info input[name=type]").val(""),$(".content-info input[name=name]").val(""),$(".content-info input[name=showName]").val(""),$(".content-info input[name=path]").val(""),$(".content-info input[name=timeTo]").val(""),$(".content-info input[name=sharePassword]").val(""),$(".share-view-info").addClass("hidden");else{a.options&&(a.codeRead=a.options.codeRead,a.canUpload=a.options.canUpload,a.notDownload=a.options.notDownload),"undefined"==typeof a.canUpload&&(a.canUpload=""),b=a,a.showName||(a.showName=a.name),$(".content-info input[name=sid]").val(a.sid),$(".content-info input[name=type]").val(a.type),$(".content-info input[name=name]").val(a.name),$(".content-info input[name=showName]").val(a.showName),$(".content-info input[name=path]").val(a.path),$(".content-info input[name=timeTo]").val(a.timeTo),$(".content-info input[name=sharePassword]").val(a.sharePassword),$(".share-view-info").removeClass("hidden"),"undefined"==typeof a.numDownload&&(a.numDownload=0),"undefined"==typeof a.numView&&(a.numView=0);var c=LNG.share_view_num+a.numView+" "+LNG.share_download_num+a.numDownload;$(".share-view-info").html(c),"1"==a.codeRead?$(".content-info input[name=codeRead]").attr("checked","checked"):$(".content-info input[name=codeRead]").removeAttr("checked"),"1"==a.notDownload?$(".content-info input[name=notDownload]").attr("checked","checked"):$(".content-info input[name=notDownload]").removeAttr("checked"),"1"==a.canUpload?$(".content-info input[name=canUpload]").attr("checked","checked"):$(".content-info input[name=canUpload]").removeAttr("checked"),$(".share-has-url").removeClass("hidden"),"file"==a.type?($(".label-code-read").addClass("hidden"),$(".label-can-upload").addClass("hidden")):($(".label-code-read").removeClass("hidden"),$(".label-can-upload").removeClass("hidden"));var d=a.type;"folder"==a.type&&(d=1==a.codeRead?"codeRead":"folder");var e=G.appHost+"share/"+d+"&user="+G.userID+"&sid="+a.sid;$(".content-info .share-url").val(e),(a.timeTo||a.canUpload||a.codeRead||a.notDownload)&&$(".share-setting-more").removeClass("hidden"),$(".share-remove-button").removeClass("hidden"),$(".share-create-button").text(LNG.share_save),Hook.trigger("explorer.path.share.uiInit")}},h=function(){var a="";$(".share-dialog .content-info input[name]").each(function(){var b=urlEncode($(this).val());"checkbox"==$(this).attr("type")&&(b=$(this).attr("checked")?"1":""),a+="&"+$(this).attr("name")+"="+b}),p(a,function(a){a.code?(Tips.tips(LNG.success,!0),G.selfShare=a.info,ui.f5()):Tips.tips(a)})},i=function(){$(".share-bottom-action .share-remove-button").unbind("click").click(function(){j([{type:"share",path:b.sid}],function(){ui.f5()})}),$(".content-info .share-more-button").unbind("click").click(function(){$(".share-setting-more").toggleClass("hidden")}),$("[name=sharePassword]").unbind("click").click(function(){trim($(this).val())||$(this).val(roundString(5)),$(this).blur().textSelect()});var a=$(".share-dialog .btn.copy"),c=new ClipboardJS(a.get(0),{text:function(a){h();var b=trim($("[name=sharePassword]").val()),c=$(".share-url").val();return b.length>0&&(c=LNG.share_url+":"+c+" "+LNG.share_password+":"+b),c}});c.on("success",function(a){$("input.share-url").textSelect()}),$(".share-bottom-action .share-create-button").unbind("click").click(function(){h();var a=$.dialog.list["share-dialog"];a&&a.close()}),$(".content-info .open-window").unbind("click").bind("click",function(){h(),window.open($("input.share-url").val())}),$(".share-bottom-action .share-qrcode-button").unbind("click").bind("click",function(){core.qrcode($("input.share-url").val())});var d=$("input.share-url");d.get(0);d.unbind("hover click").bind("hover click",function(a){d.textSelect()})};g(b),i()},r=function(a){$.ajax({url:G.appHost+"setting/set&k=wall&v="+urlEncode(a),dataType:"json",success:function(a){Tips.tips(a)}})},s=function(a,b,c,d,e){if(!(a.length<1)){var f,g=G.myDesktop;d&&(g=core.pathFather(a)),f="folder"==c?"ui.path.list(hashDecode('"+hashEncode(a)+"'));":"ui.path.open(hashDecode('"+hashEncode(a)+"'));";var h=urlEncode(g+b+".oexe"),i=core.getPathIcon(a);""==i.icon&&(i.icon=c),$.ajax({url:G.appHost+"explorer/mkfile&path="+h,type:"POST",dataType:"json",data:{content:jsonEncode({type:"app_link",content:f,icon:i.icon})},success:function(a){Tips.tips(a),a.code&&(ShareData.frameTop("",function(a){a.ui.f5()}),"function"==typeof e&&e(a.info))}})}},t=function(a,b){if(!(a.length<1)){var c=core.pathThis(a),d=core.pathFather(a);jsrun="core.explorerCode('"+urlEncode(a)+"');";var e=urlEncode(d+c+"_project.oexe");$.ajax({url:G.appHost+"explorer/mkfile&path="+e,type:"POST",dataType:"json",data:'content={"type":"app_link","content":"'+jsrun+'","icon":"folder.png"}',success:function(a){a.code&&"function"==typeof b&&b(a.info)}})}},u=function(a,b,c){if(a){var d=G.appHost+"explorer/imageRotate&rotate="+b+"&path="+urlEncode(a);$.ajax({url:d,beforeSend:function(){Tips.loading(LNG.loading)},error:core.ajaxError,success:function(a){return a?(Tips.close(a),void(a.code&&"function"==typeof c&&c(a))):void Tips.close(LNG.php_env_error_gd,!1)}})}},v=function(b){var c={};c.fileInfo=a("./tpl/fileinfo/fileInfo.html"),c.pathInfo=a("./tpl/fileinfo/pathInfo.html"),c.pathInfoMore=a("./tpl/fileinfo/pathInfoMore.html"),b.length<1&&(b=[{path:G.thisPath,type:"folder"}]);var d="info";1==b.length&&(d="file"==b[0].type?core.pathExt(b[0].path):"folder"),Tips.loading(LNG.getting),core.fileInfo(f(b),function(a){if(!a.code)return void Tips.close(a);Tips.close(LNG.get_success,!0);var e="pathInfoMore",f=LNG.info;1==b.length&&(e="folder"==b[0].type?"pathInfo":"fileInfo",f=core.pathThis(b[0].path),f.length>15&&(f=f.substr(0,15)+"... "+LNG.info));var g=template.compile(c[e]),h=UUID();a.data.is_root=G.isRoot,a.data.LNG=LNG,a.data.atime=date(LNG.time_type_info,a.data.atime),a.data.ctime=date(LNG.time_type_info,a.data.ctime),a.data.mtime=date(LNG.time_type_info,a.data.mtime),a.data.sizeFriendly=pathTools.fileSize(a.data.size);var i=$.dialog({id:h,className:"pathInfo-dialog",padding:5,ico:core.iconSmall(d),fixed:!0,title:f,content:g(a.data),ok:!0}),j=15*$(".aui-outer .pathinfo").length;i.DOM.wrap.css({left:"+="+j+"px",top:"+="+j+"px"}),w(h,b)})},w=function(a,b){var c=$("."+a);c.find(".open-window").bind("click",function(){window.open(c.find("input.download-url").val())}),c.find(".qrcode").unbind("click").bind("click",function(){core.qrcode(c.find("input.download-url").val(),c.find(".qrcode").get(0))});var d=c.find(".file-md5-loading");if(1==d.length){var e=f(b);e+="&getMd5=1",core.fileInfo(e,function(a){d.removeClass("file-md5-loading"),a.code?d.html(a.data.fileMd5):d.html(LNG.error)})}var g=c.find("input.download-url"),h=g.get(0);g.unbind("hover click").bind("hover click",function(a){$(this).focus();var b=g.val().length;if($.browser.msie){var c=h.createTextRange();c.moveEnd("character",-h.value.length),c.moveEnd("character",b),c.moveStart("character",0),c.select()}else h.setSelectionRange(0,b)}),c.find(".edit-chmod").click(function(){var a=$(this).parent().find("input"),c=$(this);$.ajax({url:G.appHost+"explorer/pathChmod&mod="+a.val(),type:"POST",data:f(b),beforeSend:function(){c.text(LNG.loading)},error:function(a){c.text(LNG.button_save)},success:function(a){c.text(a.data).animate({opacity:.6},400,0).delay(1e3).animate({opacity:1},200,0,function(){c.text(LNG.button_save)}),a.code&&ui.f5()}})})},x=function(a,b,c){var d=function(){$.ajax({url:G.appHost+"fav/del&name="+urlEncode(a),dataType:"json",async:!1,success:function(a){"function"==typeof b&&b(a)}})};return c?void d():void $.dialog({id:"dialog-fav-remove",fixed:!0,icon:"question",title:LNG.fav_remove,width:200,padding:"40px 20px",content:LNG.fav_remove+"?",ok:d,cancel:!0})},y=function(a){if(a){if(-1==trim(core.pathClear(a.path),"/").indexOf("/")){var b=core.getPathIcon(a.path,a.name);""!=b.icon&&(a.ext=b.icon,a.name=b.name)}"/"==a.path&&(a.name="Home"),$.ajax({url:G.appHost+"fav/add",dataType:"json",data:a,success:function(a){Tips.tips(a),a.code&&!core.isApp("desktop")&&ui.tree.refreshFav()}})}},z=function(a){var b={};return b.type=a.find("input[type=radio]:checked").val(),b.content=a.find("textarea").val(),b.group=a.find("[name=group]").val(),a.find("input[type=text]").each(function(){var a=$(this).attr("name");b[a]=$(this).val()}),a.find("input[type=checkbox]").each(function(){var a=$(this).attr("name");b[a]="checked"==$(this).attr("checked")?1:0}),b},A=function(a){a.find(".type input").change(function(){var b=$(this).attr("apptype");a.find("[data-type]").addClass("hidden"),a.find("[data-type="+b+"]").removeClass("hidden")}),a.find(".app-edit-select-icon").unbind("click").bind("click",function(){var b=G.basicPath+"static/images/file_icon/icon_app/";G.isRoot||(b=""),core.api.pathSelect({type:"file",title:LNG.path_api_select_file,firstPath:b},function(b){var b=core.path2url(b);a.find(".app-edit-select-icon-input").val(b)})}),a.find(".size-full").unbind("click").bind("click",function(){var b=$(this).prop("checked");b?(a.find("[name=width]").val("100%"),a.find("[name=height]").val("100%")):(a.find("[name=width]").val("800"),a.find("[name=height]").val("600"))})},B=function(b,c,d){var e,f,g,h=LNG.app_create,i=UUID(),j=a("./tpl/appEdit.html"),k=template.compile(j);switch(void 0==d&&(d="userEdit"),"rootEdit"==d&&(b=b),"userEdit"==d||"rootEdit"==d?(h=LNG.app_edit,g=k({LNG:LNG,uuid:i,data:b,appType:G.settings.appType})):g=k({LNG:LNG,uuid:i,data:{},appType:G.settings.appType}),$.dialog({fixed:!0,width:450,id:i,padding:15,title:h,content:g,button:[{name:LNG.preview,callback:function(){return core.openApp(z(e)),!1}},{name:LNG.button_save,focus:!0,callback:function(){var a=z(e);switch(d){case"userAdd":var g=urlEncode(G.thisPath+a.name);f=G.appHost+"app/userApp&action=add&path="+g;break;case"userEdit":f=G.appHost+"app/userApp&path="+urlEncode(b.path);break;case"rootAdd":f=G.appHost+"app/add&name="+urlEncode(a.name);break;case"rootEdit":f=G.appHost+"app/edit&name="+urlEncode(a.name)+"&old_name="+urlEncode(b.name)}$.ajax({url:f,type:"POST",dataType:"json",data:{data:urlEncode(jsonEncode(a))},beforeSend:function(){Tips.loading()},error:core.ajaxError,success:function(a){if(Tips.close(a),a.code)if("rootEdit"==d||"rootAdd"==d){if(!a.code)return;ShareData.frameTop("Openapp_store",function(a){a.App.reload()})}else"function"==typeof c?c():ui.f5()}})}}]}),e=$("."+i),G.isRoot||$(".appbox .appline .right a.open").remove(),b.group&&e.find("option").eq(b.group).attr("selected",1),e.find(".aui-content").css("overflow","inherit"),d){case"userEdit":e.find(".name").addClass("hidden"),e.find(".desc").addClass("hidden"),e.find(".group").addClass("hidden"),e.find("option[value="+b.group+"]").attr("checked",!0),"url"!=b.type&&e.find(".appline[data-type=url]").addClass("hidden");break;case"userAdd":e.find(".desc").addClass("hidden"),e.find(".group").addClass("hidden"),e.find("[apptype=url]").attr("checked",!0),e.find("[data-type=url] input[name=resize]").attr("checked",!0),e.find("input[name=width]").attr("value","800"),e.find("input[name=height]").attr("value","600"),e.find("input[name=icon]").attr("value","oexe.png");break;case"rootAdd":e.find("[apptype=url]").attr("checked",!0),e.find("[data-type=url] input[name=resize]").attr("checked",!0),e.find("input[name=width]").attr("value","800"),e.find("input[name=height]").attr("value","600"),e.find("input[name=icon]").attr("value","oexe.png");break;case"rootEdit":e.find("option[value="+b.group+"]").attr("selected",!0),"url"!=b.type&&e.find(".appline[data-type=url]").addClass("hidden")}A(e)},C=function(){core.appStore()},D=function(a){a&&a.length<4&&"http"!=a.substring(0,4)||$.ajax({url:G.appHost+"app/getUrlTitle&url="+a,dataType:"json",beforeSend:function(){Tips.loading()},success:function(b){var c=b.data;c=c.replace(/[\/\\]/g,"_"),Tips.close(b);var d={content:a,type:"url",desc:"",group:"others",icon:"internet.png",name:c,resize:1,simple:0,height:"70%",width:"90%"},e=urlEncode(G.thisPath+c);a=G.appHost+"app/userApp&action=add&path="+e,$.ajax({url:a,type:"POST",dataType:"json",data:{data:urlEncode(jsonEncode(d))},success:function(a){Tips.close(a),a.code&&ui.f5()}})}})};return{makeJson:f,appEdit:B,appList:C,appAddURL:D,share:n,shareBox:o,setBackground:r,createLink:s,createProject:t,imageRotate:u,newFile:g,newFolder:h,rname:i,zipDownload:k,zip:l,unZip:m,info:v,remove:j,fav:y,favRemove:x}});;define("app/path/tpl/share.html",[],'\n
\n
{{LNG.share_title}}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
');;define("app/path/tpl/fileinfo/fileInfo.html",[],"\n {{if downloadPath}}\n
\n
{{LNG.download_address}}:
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n {{/if}}\n\n
\n
{{LNG.address}}:
\n
{{path |kod.window.htmlEncode}}
\n
\n
\n
\n
{{LNG.size}}:
\n
{{sizeFriendly}} {{if size>1024}}({{size.toLocaleString()}} Byte){{/if}}
\n
\n
\n\n {{if fileMd5}}\n
\n
MD5:
\n
{{fileMd5}}
\n
\n
\n {{/if}}\n\n {{if imageSize}}\n
\n
{{LNG.image_size}}:
\n
{{imageSize.width}} × {{imageSize.height}}
\n
\n
\n {{/if}}\n\n
\n\n {{if ctime}}\n
\n
{{LNG.create_time}}
\n
{{ctime}}
\n
\n
\n {{/if}}\n\n {{if mtime}}\n
\n
{{LNG.modify_time}}
\n
{{mtime}}
\n
\n
\n {{/if}}\n\n {{if atime}}\n
\n
{{LNG.last_time}}
\n
{{atime}}
\n
\n
\n {{/if}}\n\n {{if owner}}\n
\n
{{LNG.file_info_owner}}
\n
{{owner}}
\n
\n
\n {{/if}}\n\n {{if group}}\n
\n
{{LNG.file_info_group}}
\n
{{group}}
\n
\n
\n {{/if}}\n \n {{if mode && is_root==\"1\"}}\n
\n
\n
{{LNG.permission}}:
\n
{{mode}}
\n
\n
\n
\n
{{LNG.permission_edit}}:
\n
\n
\n
\n
\n {{/if}}\n
\n");;define("app/path/tpl/fileinfo/pathInfo.html",[],"\n
\n
{{LNG.address}}:
\n
{{path |kod.window.htmlEncode}}
\n
\n
\n
\n
{{LNG.size}}:
\n
{{sizeFriendly}}{{if size>1024}}({{size.toLocaleString()}} Byte){{/if}}
\n
\n
\n
\n
{{LNG.contain}}:
\n
{{fileCount}} {{LNG.file}},{{folderCount}} {{LNG.folder}}
\n
\n
\n \n
\n {{if ctime}}\n
\n
{{LNG.create_time}}
\n
{{ctime}}
\n
\n
\n {{/if}}\n\n {{if mtime}}\n
\n
{{LNG.modify_time}}
\n
{{mtime}}
\n
\n
\n {{/if}}\n\n {{if atime}}\n
\n
{{LNG.last_time}}
\n
{{atime}}
\n
\n
\n {{/if}}\n\n {{if owner}}\n
\n
{{LNG.file_info_owner}}
\n
{{owner}}
\n
\n
\n {{/if}}\n\n {{if group}}\n
\n
{{LNG.file_info_group}}
\n
{{group}}
\n
\n
\n {{/if}}\n\n\n {{if mode && is_root==\"1\"}}\n
\n
\n
{{LNG.permission}}:
\n
{{mode}}
\n
\n
\n
\n
{{LNG.permission_edit}}:
\n
\n
\n
\n
\n {{/if}}\n
\n");;define("app/path/tpl/fileinfo/pathInfoMore.html",[],"\n
\n
{{LNG.info}}:
\n
\n {{fileCount}} {{LNG.file}},{{folderCount}} {{LNG.folder}}
\n
\n
\n
\n
\n
{{LNG.size}}:
\n
{{sizeFriendly}} {{if size>1024}}({{size.toLocaleString()}} Byte){{/if}}
\n
\n
\n \n {{if mode && is_root==\"1\"}}\n
\n
\n
{{LNG.permission}}:
\n
{{mode}}
\n
\n
\n
\n
{{LNG.permission_edit}}:
\n
\n
\n
\n
\n {{/if}}\n
\n");;define("app/path/tpl/appEdit.html",[],"\n
\n
\n
{{LNG.app_desc}}
\n
\n
\n
\n
\n
{{LNG.app_icon}}
\n
\n \n
\n
\n
\n
\n
{{LNG.app_group}}
\n
\n
\n
\n
\n
\n\n
\n
{{LNG.app_display}}
\n
\n \n \n \n \n
\n
\n
\n
\n
\n
{{LNG.app_code}}
\n
{{LNG.app_code}}
\n
{{LNG.app_url}}
\n
\n
\n
\n
\n");;define("app/path/clipboard",[],function(a,b){var c=function(a){return ui.path.pathOperate.makeJson(a)},d=function(a){a.length<1||$.ajax({url:G.appHost+"explorer/pathCopy",type:"POST",dataType:"json",data:c(a),error:core.ajaxError,success:function(a){Tips.tips(a)}})},e=function(a){a.length<1||$.ajax({url:G.appHost+"explorer/pathCute",type:"POST",dataType:"json",data:c(a),error:core.ajaxError,success:function(a){Tips.tips(a)}})},f=function(a,b){a&&(Tips.loading(LNG.moving),setTimeout(function(){var c=G.appHost+"explorer/pathPast&path="+urlEncode(a);$.ajax({url:c,dataType:"json",error:core.ajaxError,success:function(a){Tips.close(a.data,a.code),"function"==typeof b&&b(a.info),g()}})},50))},g=function(){var a=ShareData.frameTop(""),b=a.$.find(".dialogExplorer iframe");0!=b.length&&(a.ui&&a.ui.f5(),$.each(b,function(a,b){var c=b.contentWindow;c!=window&&c.ui&&c.ui.f5()}))},h=function(a,b,d){b&&$.ajax({url:G.appHost+"explorer/pathCuteDrag",type:"POST",dataType:"json",data:c(a)+"&path="+urlEncode(b+"/"),beforeSend:function(){Tips.loading(LNG.moving)},error:core.ajaxError,success:function(a){Tips.close(a),a.code&&core.playSound("drag_drop"),"function"==typeof d&&d(a.info)}})},i=function(a,b,d,e){b&&(void 0==e&&(e=0),$.ajax({url:G.appHost+"explorer/pathCopyDrag",type:"POST",dataType:"json",data:c(a)+"&path="+urlEncode(b+"/")+"&filename_auto="+Number(e),beforeSend:function(){Tips.loading(LNG.moving)},error:core.ajaxError,success:function(a){Tips.close(a),a.code&&core.playSound("drag_drop"),"function"==typeof d&&d(a.info)}}))},j=function(a,b){var c="style='height:150px;border-left: 3px solid #def;overflow:auto;margin:20px;background: #f0f8ff;padding:20px;width:300px'",d=""+LNG.clipboard_null+"
";if(0!=a.length){d=""+LNG.clipboard_state+LNG[b]+"";for(var e=40,f=0;f
"+g.type+": "+h+""}d+='
"}return d},k=function(){$.ajax({url:G.appHost+"explorer/clipboard",dataType:"json",error:core.ajaxError,success:function(a){a.code&&($.dialog({id:"dialog-clipboard",title:LNG.clipboard,width:400,content:j(a.data,a.info)}),$(".clipboard-clear").one("click",function(){Tips.tips(LNG.success),$.get(G.appHost+"explorer/clipboard&clear=ok"),$.dialog.list["dialog-clipboard"].close()}))}})};return{copy:d,cute:e,past:f,cuteDrag:h,copyDrag:i,clipboard:k}});;define("app/path/search",["./tpl/search.html","./tpl/searchList.html"],function(a,b){var c=a("./tpl/search.html"),d=a("./tpl/searchList.html");return function(a,b){b||(b=G.thisPath);var e,f,g=function(){var d=trim(core.pathClear(b),"/");if(0==d.indexOf(G.KOD_USER_SHARE)&&-1==d.indexOf("/")||d==G.KOD_USER_FAV||d==G.KOD_GROUP_ROOT_ALL)return void Tips.tips(LNG.path_cannot_search,!1);template.helper("searchResultPrase",j);var g=template.compile(c);0==$(".dialog-do-search").length?(e=$.dialog({id:"dialog-do-search",padding:0,fixed:!0,ico:core.icon("search"),resize:!0,title:LNG.search,width:460,height:480,content:g({LNG:LNG})}),f=l(),f.path=b,""!=a&&(f.search=a),$("#search-path").val(f.path),$("#search-value").val(f.search),k()):($.dialog.list["dialog-do-search"].display(!0),a&&$("#search-value").val(a),$("#search-path").val(b),i())},h=function(){return f={search:$("#search-value").val(),path:$("#search-path").val(),is_content:Number($("#search-is-content").is(":checked")),is_case:Number($("#search-is-case").is(":checked")),ext:$("#search-ext").val()}},i=function(){h(),n(f)},j=function(a){var b=htmlEncode($("#search-value").val());if(a=htmlEncode(a),f.is_case)a=a.replace(b,''+b+"");else{var c=a.toLowerCase().indexOf(b.toLowerCase());a=a.substr(0,c)+''+a.substr(c,b.length)+""+a.substr(c+b.length)}return a},k=function(){$("#search-value").die("keyup").live("keyup",function(a){core.isApp("editor")||ui.path.setSearchByStr($(this).val())}),$("#search-value,#search-ext,#search-path").keyEnter(i),$(".search-header .btn").die("click").live("click",i),$(".search-result .file-item .file-info").die("click").live("click",function(a){var b=$(this).parent();return b.toggleClass("open"),b.find(".result-item").slideToggle(200),stopPP(a),!1}),$(".search-result .file-item .file-info .goto").die("click").live("click",function(a){var b=$(this).parent().parent(),c=pathHashDecode(b.attr("data-path")),d=core.pathFather(c);return core.openPath(d),setTimeout(function(){core.isApp("explorer")&&ui.path.setSelectByFilename(c)},200),stopPP(a),!1}),$(".search-result .file-item .file-info .title").die("click").live("click",function(a){var b=$(this).parent().parent(),c=pathHashDecode(b.attr("data-path"));return kodApp.setLastOpenTarget(b),kodApp.open(c,b.attr("data-ext")),stopPP(a),!1}),$(".search-result .file-item .result-info").die("click").live("click",function(a){var b=$(this).parent().parent(),c=pathHashDecode(b.attr("data-path"));$(".search-result .file-item .result-info.this").removeClass("this"),$(this).addClass("this");var d=parseInt($(this).find(".line").attr("data-line"));return ShareData.data("FILE_SEARCH_AT",{search:$("#search-value").val(),line:d,lineIndex:$(this).parent().find("[data-line="+d+"]").index($(this).find(".line"))}),kodApp.open(c,b.attr("data-ext"),"aceEditor"),stopPP(a),!1}),$(".search-header input[type=checkbox]").on("click",function(){h(),l(f)})},l=function(a){var b="box_search_config";if(void 0==a){var a=LocalData.getConfig(b);return a||(a={search:"",is_content:0,is_case:0,ext:""}),$("#search-value").val(a.search).textSelect(),a.is_content?$("#search-is-content").attr("checked","checked"):$("#search-is-content").removeAttr("checked"),a.is_case?$("#search-is-case").attr("checked","checked"):$("#search-is-case").removeAttr("checked"),$("#search-ext").val(a.ext),a}return LocalData.setConfig(b,a)},m=function(a){var b=$(".file-items"),c=$(".search-desc");if(!a.code)return c.html(a.data),void b.html("");if(0==a.data.fileList.length&&0==a.data.folderList.length)return c.html(LNG.search_null),void b.html("");var e=template.compile(d);if(b.html(e({code:a.code,data:a.data,LNG:LNG})),f.is_content){for(var g=a.data.fileList,h=0,i=0;i"+h+"(in "+g.length+" files)"),a.data.error_info&&c.html(""+LNG.seach_result_too_more+"")}else c.html(a.data.fileList.length+" "+LNG.file+", "+a.data.folderList.length+LNG.folder+".")},n=function(a){l(a),$("#search-value").textFocus();var b=$(".file-items"),c=$(".search-desc");if(!a.search||!a.path)return c.html(LNG.search_info),void b.html("");var d=G.appHost+"explorer/search";"undefined"!=typeof G.sharePage&&(d=G.appHost+"share/search&user="+G.user+"&sid="+G.sid),$.ajax({url:d,dataType:"json",type:"POST",data:a,beforeSend:function(){c.hide().html(LNG.searching+'
').fadeIn(100)},error:function(a,b,d){core.ajaxError(a,b,d),c.html(LNG.error)},success:function(a){m(a)}})};g()}});;define("app/path/tpl/search.html",[],"\n\n");;define("app/path/tpl/searchList.html",[],'\n{{each data.folderList v i}}\n \n \n \n {{\'folder\' |kod.core.icon}}\n {{v.name | searchResultPrase}}\n \n
\n \n{{/each}}\n\n\n{{each data.fileList v i}}\n {{if v.searchInfo}}\n \n \n \n {{v.ext |kod.core.icon}}\n \n {{v.name | kod.window.htmlEncode}}\n \n {{v.searchInfo.length}}\n \n
\n \n {{each v.searchInfo value index}}\n - \n {{value.line}}:\n {{@value.str | searchResultPrase}}\n
\n {{/each}}\n
\n \n {{else}}\n \n \n \n {{v.ext |kod.core.icon}}\n {{v.name | searchResultPrase}}\n \n
\n \n {{/if}}\n{{/each}}\n\n');;define("app/path/tpl/file/create.html",[],"\n {{if listType=='list'}}
{{/if}}\n
\n
\n {{if type=='folder'}}\n {{\"folder\" | kod.core.icon}}
\n {{else}}\n {{ext | kod.core.icon}}
\n {{/if}}\n \n {{if listType=='icon'}}\n \n {{else}}\n \n {{/if}}\n
\n \n
\n
\n
\n");;define("app/common/tree",["../path/pathOperate","../path/tpl/share.html","../path/tpl/fileinfo/fileInfo.html","../path/tpl/fileinfo/pathInfo.html","../path/tpl/fileinfo/pathInfoMore.html","../path/tpl/appEdit.html","../path/clipboard","../path/search","../path/tpl/search.html","../path/tpl/searchList.html"],function(a,b){var c,d,e=a("../path/pathOperate"),f=a("../path/clipboard"),g=a("../path/search"),h=!1;ui.pathOperate=e;var i=function(a,b){var c=["menu-tree-group","menu-tree-fav","menu-tree-folder-fav"];if(a&&a[0]&&-1!==$.inArray(a[0].menuType,c))return a;for(var d=[],e=[],f=0;f'+LNG.system_error+"")},success:function(a){if(!a.code)return void $("#folder-list-tree").html('
'+LNG.system_error+"
");var b=i(a.data,!0);b=j.reset(b),$.fn.zTree.init($("#folder-list-tree"),n,b),d=$.fn.zTree.getZTreeObj("folder-list-tree")}}),$(".ztree .switch").die("mouseenter").live("mouseenter",function(){$(this).addClass("switch_hover")}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("switch_hover")}),core.isApp("editor")&&(Mousetrap.bind("up",function(a){l(a,"up")}).bind("down",function(a){l(a,"down")}).bind("left",function(a){l(a,"left")}).bind("right",function(a){l(a,"right")}),Mousetrap.bind("enter",function(a){tree.open()}).bind(["del","command+backspace"],function(a){tree.remove()}).bind("f2",function(a){stopPP(a),tree.rname()}).bind(["ctrl+f","command+f"],function(a){stopPP(a),tree.search()}).bind(["ctrl+c","command+c"],function(a){tree.copy()}).bind(["ctrl+x","command+x"],function(a){tree.cute()}).bind(["ctrl+v","command+v"],function(a){tree.past()}).bind("alt+m",function(a){tree.create("folder")}).bind("alt+n",function(a){tree.create("file")}))},l=function(a,b){stopPP(a);var c=d.getSelectedNodes()[0];if(c)switch(b){case"up":var e=c.getPreNode();if(e){if(e.open&&e.children.length>0)for(;e.open&&e.children&&e.children.length>=1;)e=e.children[e.children.length-1]}else e=c.getParentNode();d.selectNode(e);break;case"down":if(c.open&&c.children.length>=1)e=c.children[0];else{var f=c,e=f.getNextNode()||f.getParentNode().getNextNode();try{for(;!e;)f=f.getParentNode(),e=f.getNextNode()||f.getParentNode().getNextNode()}catch(a){}}d.selectNode(e);break;case"left":c.isParent&&c.open?d.expandNode(c,!1):d.selectNode(c.getParentNode());break;case"right":c.open?d.selectNode(c.children[0]):d.expandNode(c,!0)}},m=function(){return core.isApp("editor")?!1:!0},n={async:{enable:!0,dataType:"json",url:function(){return G.appHost+Config.treeAjaxURL},autoParam:["ajax_path=path","tree_icon=tree_icon"],dataFilter:function(a,b,c){return c.code?i(c.data):null}},edit:{enable:!0,showRemoveBtn:!1,showRenameBtn:!1,drag:{isCopy:!1,isMove:!1}},view:{showLine:!1,selectedMulti:!1,expandSpeed:"fast",dblClickExpand:!1,addDiyDom:function(a,b){var c=15,d=$("#"+b.tId+"_switch"),e=$("#"+b.tId+"_ico");d.remove(),b.iconSkin=b.tree_icon;var f=b.tree_icon;if(b.ext?f=b.ext:b.tree_icon||(f=b.type),e.before(d).before('
'+core.iconSmall(f)+"").remove(),void 0!=b.ext&&e.attr("class","").addClass("file "+b.ext).removeAttr("style"),b.level>=1){var g="
";d.before(g)}d.before("");var h="";void 0!=b.menuType?h=b.menuType:(("file"==b.type||"oexe"==b.ext)&&(h="menu-tree-file"),"folder"==b.type&&(h="menu-tree-folder"));var i=LNG.name+":"+b.name+"\n"+LNG.size+":"+pathTools.fileSize(b.size)+"\n"+LNG.modify_time+":"+b.mtime;"file"!=b.type&&(i=b.name),d.parent().addClass(h).attr("title",i),0==b.isWriteable&&d.parent().addClass("file-not-writeable"),0==b.isReadable&&d.parent().addClass("file-not-readable"),0===b.exists&&d.parent().addClass("file-not-readable")}},callback:{onClick:function(a,b,c){if(0==c.level&&j.save(),$(a.target).hasClass("menu-item")||$(a.target).parent().hasClass("menu-item")){var e=$("#"+c.tId+"_a"),f=e.find(".menu-item");return e.contextMenu({x:f.offset().left+f.width(),y:f.offset().top}),stopPP(a)}return d.selectNode(c),core.isApp("editor")&&"folder"==c.type?void d.expandNode(c):void(core.isApp("editor")||"folder"!=c.type?(kodApp.setLastOpenTarget($("#"+c.tId)),kodApp.open(o().path)):ui.path.list(c.path))},beforeDblClick:function(){return!0},onCollapse:function(a,b,c){0==c.level&&j.save()},onExpand:function(a,b,c){0==c.level&&j.save()},onDblClick:function(a,b,c){return $(a.target).hasClass("switch")||!m()?!1:void d.expandNode(c)},beforeRightClick:function(a,b){d.selectNode(b)},beforeAsync:function(a,b){b.ajax_name=b.name,b.ajax_path=b.path,$("#"+b.tId+"_my_ico").addClass("ico_loading")},onAsyncSuccess:function(a,b,e,f){return $("#"+e.tId+"_my_ico").removeClass("ico_loading"),0==f.data.length?void d.removeChildNodes(e):void("function"==typeof c&&(c(),c=void 0))},onRename:function(a,b,f,g){var h=f.getParentNode();if(d.getNodesByParam("name",f.name,h).length>1)return Tips.tips(LNG.name_isexists,!1),void d.removeNode(f);if(f.create){var i=f.path+"/"+f.name;"folder"==f.type?e.newFolder(i,function(a){c=function(){var a=d.getNodesByParam("name",f.name,h)[0];d.selectNode(a),t()},p(h)}):e.newFile(i,function(a){c=function(){var a=d.getNodesByParam("name",f.name,h)[0];d.selectNode(a),t()},p(h)})}else{var j=rtrim(f.path,"/"),k=core.pathFather(f.path)+f.name;e.rname(j,k,function(a){f.path=a,c=function(){var a=d.getNodesByParam("name",f.name,h)[0];d.selectNode(a),t(),"folder"==f.type&&ui.path.list(f.path)},p(h)})}},beforeDrag:function(a,b){for(var c=0,d=b.length;d>c;c++)if(b[c].drag===!1)return!1;return!0},beforeDrop:function(a,b,c,d){return c?c.drop!==!1:!0},onDrop:function(a,b,c,d,e){var g="",h="",i=c[0];(i.father||i.thisPath)&&(g=i.father+urlEncode(i.name),h=d.father+urlEncode(d.name),f.cuteDrag([{path:g,type:i.type}],h,function(){p(i)}))}}},o=function(a){if(d){var b=d.getSelectedNodes()[0],c="";return b?(c=b.type,("_null_"==c||void 0==c)&&(c="folder"),"file"==c&&(c=b.ext),a?[{path:b.path,type:c,node:b}]:{path:b.path,type:c,node:b}):{path:"",type:""}}},p=function(a){return a||(a=d.getSelectedNodes()[0]),a.isParent||(a=a.getParentNode())?void d.reAsyncChildNodes(a,"refresh"):void ui.tree.init()},q=function(){s(G.KOD_USER_FAV),t()},r=function(){q(),s(G.KOD_GROUP_ROOT_SELF),s(G.KOD_GROUP_ROOT_ALL)},s=function(a){var b=d.getNodesByParam("path",a,null);p(b[0])},t=function(){core.isApp("explorer")&&ui.f5()};return{makeParam:o,treeOpenHistory:j,treeDataSort:i,init:k,refresh:p,refreshPath:s,refreshFav:q,refreshGroup:r,zTree:function(){return d},openEditor:function(){kodApp.open(o().path)},openWindow:function(){kodApp.openWindow(o().path)},share:function(){e.share(o())},download:function(){"folder"==o().type?e.zipDownload(o(!0)):kodApp.download(o().path)},setSelect:function(a){return},open:function(){if(!($(".dialog-path-remove").length>=1)){var a=o();"oexe"==a.type&&(a.path=a.node),kodApp.setLastOpenTarget($(".curSelectedNode").parent()),kodApp.open(a.path,a.type)}},fav:function(){var a=o();a.name=a.node.name,a.node="null",e.fav(a)},createLink:function(a){var b=o();e.createLink(b.path,b.node.name,b.type,a,t)},search:function(){g("",o().path)},appEdit:function(){var a=o(),b=a.node;b.path=a.path,e.appEdit(b,function(){p(a.node.getParentNode())})},info:function(){e.info(o(!0))},copy:function(){f.copy(o(!0))},cute:function(){f.cute(o(!0))},copyTo:function(){core.api.pathSelect({type:"folder",title:LNG.copy_to},function(a){f.copyDrag(o(!0),a,"",!1)})},cuteTo:function(){core.api.pathSelect({type:"folder",title:LNG.cute_to},function(a){f.cuteDrag(o(!0),a,function(){s()})})},past:function(){var a=o();a.node.isParent||(a.node=a.node.getParentNode()),f.past(a.path,function(){t(),p(a.node)})},clone:function(){var a=o();a.node.isParent||(a.node=a.node.getParentNode()),f.copyDrag(o(!0),core.pathFather(a.path),function(){t(),p("folder"==a.type?a.node.getParentNode():a.node)},!0)},favRemove:function(a){e.favRemove(o().node.name,function(a){Tips.tips(a),q()})},remove:function(){var a=o(!0),b=a[0].node.getParentNode();a[0].type=a[0].node.type,a[0].type="folder"==a[0].type?"folder":"file",e.remove(a,function(){t(),p(b)})},checkIfChange:function(a){h||(h=!0,d&&(d.getNodesByFilter(function(b){var c=b.path;return"folder"==b.type&&core.pathClear(c)==core.pathClear(a)&&p(b),!1},!0),setTimeout(function(){h=!1},500)))},explorer:function(){var a=d.getSelectedNodes();if(a.length<=0){var b=d.getNodes();d.selectNode(b[0])}var c=o().path;"folder"!=o().type&&(c=core.pathFather(c)),core.explorer(c)},openProject:function(){core.explorerCode(o().path)},create:function(a){var b=d.getSelectedNodes();if(b.length<=0){var e=d.getNodes();d.selectNode(e[0])}else"file"==b[0].type&&d.selectNode(b[0].getParentNode());var f=o(),g=f.node,h=g.getParentNode(),i=0,j="folder"==a?"":"."+a,k="folder"==a?LNG.newfolder:LNG.newfile;if(0==d.getNodesByParam("name",k+j,h).length)k+=j;else{for(;d.getNodesByParam("name",k+"("+i+")"+j,h).length>0;)i++;k=k+"("+i+")"+j}var l={name:k,ext:j,type:a,create:!0,path:f.path};if(void 0!=g.children){var m=d.addNodes(g,l)[0];d.editName(m)}else"folder"!=g.type&&(g=g.getParentNode()),c=function(){var a=d.addNodes(g,l)[0];d.editName(a)},g.isParent?d.expandNode(g):c()},showFile:function(){var a=G.appHost+"share/file&sid="+G.sid+"&user="+G.user+"&path="+o().path;window.open(a)},rname:function(){var a=d.getSelectedNodes()[0];d.editName(a),a.beforeName=a.name}}});;define("app/src/explorer/fileListResize",[],function(a,b){var c={filename:250,filetype:80,filesize:80,filetime:150,explorerTreeWidth:199,editorTreeWidth:199},d={filename:150,filetype:60,filesize:60,filetime:120,explorerTreeWidth:2,editorTreeWidth:2},e=c,f=function(){if(LocalData.get("resizeConfig"))e=jsonDecode(LocalData.get("resizeConfig"));else{"undefined"!=typeof G.userConfig.resizeConfig&&(e=jsonDecode(htmlDecode(G.userConfig.resizeConfig)));var a=jsonEncode(e);LocalData.set("resizeConfig",a)}$.each(c,function(a,b){(!e[a]||e[a]
n-8&&n+8>j&&(j=n+1),f){var o=400;k.animate({width:j},o),l.animate({left:j-5},o),m.animate({left:j},o)}else k.css("width",j),l.css("left",j-5),m.css("left",j);"undefined"!=typeof ui.setStyle&&ui.setStyle(),b&&(e=i,g())}},j=function(){return void 0!=$.getUrlParam("type")?!0:!1},k=function(a,b,c){var f=$.extend(!0,{},e);f[a]+=b,h(f),c&&(e=f,$.each(e,function(a,b){b<=d[a]&&(e[a]=d[a])}),g())},l=function(){$("#main-title").hasClass("bind-init")||(h(e),$("#main-title").addClass("bind-init"),$.each(c,function(a,b){$("#main-title ."+a+"-resize").drag({start:function(){},move:function(b,c){k(a,b,!1)},end:function(b,c){k(a,b,!0)}})}))},m=function(){var a=$(".frame-resize");a.drag({start:function(){a.addClass("active"),$(".resize-mask").css("display","block")},move:function(a,b){i(a,!1,!1)},end:function(b,c){i(b,!0,!1),a.removeClass("active"),$(".resize-mask").css("display","none")}})},n=function(){var a="fileIconSize";core.isApp("desktop")&&(a="fileIconSizeDesktop");var b=G.userConfig[a];b||(b="75"),q(b,!1),o(b)},o=function(a){$(".set-file-icon-size .file-icon-size").removeClass("selected");for(var b=[["40","box-size-smallx"],["60","box-size-small"],["80","box-size-default"],["100","box-size-big"],["120","box-size-bigx"]],c=10,d="",e=0;e=f-c&&f+c>=a){d=b[e][1];break}}""!=d&&$("."+d).addClass("selected")},p=function(a){var b="fileIconSize";core.isApp("desktop")&&(b="fileIconSizeDesktop"),G.userConfig[b]=a,o(a),$.get(G.appHost+"setting/set&k="+b+"&v="+a)},q=function(a,b){var c=a,d=105,e=30,f=250;core.isApp("desktop")&&(e=40,f=150),c=e>=c?e:c,c=c>=f?f:c;var g=(a-e)*d/(f-e),h=20,i=10,j=parseInt(c),k=j+2*h-i+5,l=j-i,m=j-i,n=.4*j,o=j+3*h-i,q=".file-list-icon div.file,.file-list-icon .flex-empty{height:"+k+"px;width:"+j+"px;}";core.isApp("desktop")&&(k-=5,q="div.file-list-icon div.file,.file-list-icon .flex-empty{height:"+k+"px;width:"+j+"px;}"),$.browser.mozilla&&(m-=4);var r="div.file-list-icon div.file{max-height:"+o+"px;}"+q+" .file-list-icon .meta-info{height:"+n+"px;width:"+n+"px; margin-right:"+.16*n+"px;margin-top:-"+1.1*n+"px;} .file-list-icon div.file .filename{width:"+j+"px;} .file-list-icon div.file .filename #pathRenameTextarea, .file-list-icon div.file .filename .newfile{width:"+j+"px;} .file-list-icon div.file .ico{padding-left:"+i/2+"px;height:"+m+"px;width:"+l+"px} .file-list-icon div.file .ico.picture{width:"+l+"px;padding-left:"+i/2+"px;overflow:hidden;display:block;} ";$.setStyle(r,"file_icon_resize"),$(".slider-handle").css("top",g),b&&p(a)},r=function(){var a,b=$(".slider-handle");$(".set-icon-size-slider").bind("click",function(a){return stopPP(a),!1});var c=function(b){var c=0,d=105,e=30,f=250,g=a+b;g=c>g?c:g,g=g>d?d:g;var h=parseInt(g/d*(f-e)+e);return q(h,!1),h};b.drag({start:function(c){b.addClass("active"),a=parseInt(b.css("top"))},move:function(a,b,d){c(b)},end:function(a,d,e){b.removeClass("active"),p(c(d),!0)}});var d=$(".slider-bg");$(".slider-bg").unbind("click").bind("click",function(b){var e=b.clientY-d.offset().top;a=0,p(c(e),!0)})},s=function(){var a=function(a,b){var c=a.parent(),d=$(".split-box").index(c),e=parseInt(c.data("before_width"))+b;if(!(150>e)){$($(".split-line").get(d)).css("width",e),c.css("width",e),$(".split-box:gt("+d+")").each(function(){$(this).hasClass("is-drag-split")||$(this).css("left",parseInt($(this).data("before_left"))+b+"px")});var f=[];$(".split-box").each(function(){f.push({left:$(this).css("left"),width:$(this).width()})}),LocalData.set("splitBoxSize",jsonEncode(f))}};$(".bodymain .file-list-split .split-drag").drag({start:function(a,b){var c=b.parent();c.addClass("is-drag-split").data("before_width",c.width()),$(".split-box,.split-line").each(function(){$(this).data("before_left",$(this).css("left"))})},move:function(b,c,d,e){a(e,b)},end:function(a,b,c,d){d.parent().removeClass("is-drag-split")}},!0),$(".file.select-split-parent").removeClass("select-split-parent"),$(".split-box").each(function(){$('.file[data-path="'+$(this).attr("data-path")+'"]').addClass("select-split-parent")}),t()},t=function(){var a=LocalData.get("splitBoxSize"),b=0;a=!a||jsonDecode(a)?[]:jsonDecode(a);var c=function(c,d){var e=a[d];e||(e={width:250,left:b}),b+=e.width+1,c.css({width:e.width+"px",left:e.left})};b=0,$(".split-box").each(function(a){c($(this),a)}),b=0,$(".split-line").each(function(a){c($(this),a)}),$(".bodymain").scrollLeft(1e5)};return{init:function(){f(),j()&&(e=c),h(e),m(),i(0,!1,!0),r()},initFileSize:n,bindSplitResize:s,bindHeaderResize:l,setFileIconSize:q}});