diff --git a/Application/fileman/conf.json b/Application/fileman/conf.json index 1e78633..6662dd2 100755 --- a/Application/fileman/conf.json +++ b/Application/fileman/conf.json @@ -1,35 +1,35 @@ { - "FILES_ROOT": "/out/pictures/wysiwigpro", - "RETURN_URL_PREFIX": "", - "SESSION_PATH_KEY": "", - "THUMBS_VIEW_WIDTH": "140", - "THUMBS_VIEW_HEIGHT": "120", + "FILES_ROOT": "/out/pictures/wysiwigpro", + "RETURN_URL_PREFIX": "", + "SESSION_PATH_KEY": "", + "THUMBS_VIEW_WIDTH": "140", + "THUMBS_VIEW_HEIGHT": "120", "PREVIEW_THUMB_WIDTH": "100", - "PREVIEW_THUMB_HEIGHT": "100", - "MAX_IMAGE_WIDTH": "2000", - "MAX_IMAGE_HEIGHT": "2000", - "INTEGRATION": "custom", - "DIRLIST": "php/dirtree.php", - "CREATEDIR": "php/createdir.php", - "DELETEDIR": "php/deletedir.php", - "MOVEDIR": "php/movedir.php", - "COPYDIR": "php/copydir.php", - "RENAMEDIR": "php/renamedir.php", - "FILESLIST": "php/fileslist.php", - "UPLOAD": "php/upload.php", - "DOWNLOAD": "php/download.php", - "DOWNLOADDIR": "php/downloaddir.php", - "DELETEFILE": "php/deletefile.php", - "MOVEFILE": "php/movefile.php", - "COPYFILE": "php/copyfile.php", - "RENAMEFILE": "php/renamefile.php", - "GENERATETHUMB": "php/thumb.php", - "DEFAULTVIEW": "list", - "FORBIDDEN_UPLOADS": "zip js jsp jsb mhtml mht xhtml xht php phtml php3 php4 php5 phps phar shtml jhtml pl sh py cgi exe application gadget hta cpl msc jar vb jse ws wsf wsc wsh ps1 ps2 psc1 psc2 msh msh1 msh2 inf reg scf msp scr dll msi vbs bat com pif cmd vxd cpl htpasswd htaccess", - "ALLOWED_UPLOADS": "", - "FILEPERMISSIONS": "0644", - "DIRPERMISSIONS": "0755", - "LANG": "auto", - "DATEFORMAT": "dd.MM.yyyy HH:mm", - "OPEN_LAST_DIR": "yes" + "PREVIEW_THUMB_HEIGHT":"100", + "MAX_IMAGE_WIDTH": "1000", + "MAX_IMAGE_HEIGHT": "1000", + "INTEGRATION": "custom", + "DIRLIST": "php/dirtree.php", + "CREATEDIR": "php/createdir.php", + "DELETEDIR": "php/deletedir.php", + "MOVEDIR": "php/movedir.php", + "COPYDIR": "php/copydir.php", + "RENAMEDIR": "php/renamedir.php", + "FILESLIST": "php/fileslist.php", + "UPLOAD": "php/upload.php", + "DOWNLOAD": "php/download.php", + "DOWNLOADDIR": "php/downloaddir.php", + "DELETEFILE": "php/deletefile.php", + "MOVEFILE": "php/movefile.php", + "COPYFILE": "php/copyfile.php", + "RENAMEFILE": "php/renamefile.php", + "GENERATETHUMB": "php/thumb.php", + "DEFAULTVIEW": "list", + "FORBIDDEN_UPLOADS": "zip js jsp jsb mhtml mht xhtml xht php phtml php3 php4 php5 phps phar shtml jhtml pl sh py cgi exe application gadget hta cpl msc jar vb jse ws wsf wsc wsh ps1 ps2 psc1 psc2 msh msh1 msh2 inf reg scf msp scr dll msi vbs bat com pif cmd vxd cpl htpasswd htaccess", + "ALLOWED_UPLOADS": "", + "FILEPERMISSIONS": "0644", + "DIRPERMISSIONS": "0755", + "LANG": "auto", + "DATEFORMAT": "dd.MM.yyyy HH:mm", + "OPEN_LAST_DIR": "yes" } \ No newline at end of file diff --git a/Application/fileman/js/main.min.js b/Application/fileman/js/main.min.js index 2d9a84a..d057f7b 100755 --- a/Application/fileman/js/main.min.js +++ b/Application/fileman/js/main.min.js @@ -1,2 +1 @@ -var fileTypeIcons=new Object();fileTypeIcons["3gp"]="file_extension_3gp.png";fileTypeIcons["7z"]="file_extension_7z.png";fileTypeIcons.ace="file_extension_ace.png";fileTypeIcons.ai="file_extension_ai.png";fileTypeIcons.aif="file_extension_aif.png";fileTypeIcons.aiff="file_extension_aiff.png";fileTypeIcons.amr="file_extension_amr.png";fileTypeIcons.asf="file_extension_asf.png";fileTypeIcons.asx="file_extension_asx.png";fileTypeIcons.avi="file_extension_avi.png";fileTypeIcons.bat="file_extension_bat.png";fileTypeIcons.bin="file_extension_bin.png";fileTypeIcons.bmp="file_extension_bmp.png";fileTypeIcons.bup="file_extension_bup.png";fileTypeIcons.cab="file_extension_cab.png";fileTypeIcons.cbr="file_extension_cbr.png";fileTypeIcons.cda="file_extension_cda.png";fileTypeIcons.cdl="file_extension_cdl.png";fileTypeIcons.cdr="file_extension_cdr.png";fileTypeIcons.chm="file_extension_chm.png";fileTypeIcons.dat="file_extension_dat.png";fileTypeIcons.divx="file_extension_divx.png";fileTypeIcons.dll="file_extension_dll.png";fileTypeIcons.dmg="file_extension_dmg.png";fileTypeIcons.doc="file_extension_doc.png";fileTypeIcons.dss="file_extension_dss.png";fileTypeIcons.dvf="file_extension_dvf.png";fileTypeIcons.dwg="file_extension_dwg.png";fileTypeIcons.eml="file_extension_eml.png";fileTypeIcons.eps="file_extension_eps.png";fileTypeIcons.exe="file_extension_exe.png";fileTypeIcons.fla="file_extension_fla.png";fileTypeIcons.flv="file_extension_flv.png";fileTypeIcons.gif="file_extension_gif.png";fileTypeIcons.gz="file_extension_gz.png";fileTypeIcons.hqx="file_extension_hqx.png";fileTypeIcons.htm="file_extension_htm.png";fileTypeIcons.html="file_extension_html.png";fileTypeIcons.ifo="file_extension_ifo.png";fileTypeIcons.indd="file_extension_indd.png";fileTypeIcons.iso="file_extension_iso.png";fileTypeIcons.jar="file_extension_jar.png";fileTypeIcons.jpeg="file_extension_jpeg.png";fileTypeIcons.jpg="file_extension_jpg.png";fileTypeIcons.lnk="file_extension_lnk.png";fileTypeIcons.log="file_extension_log.png";fileTypeIcons.m4a="file_extension_m4a.png";fileTypeIcons.m4b="file_extension_m4b.png";fileTypeIcons.m4p="file_extension_m4p.png";fileTypeIcons.m4v="file_extension_m4v.png";fileTypeIcons.mcd="file_extension_mcd.png";fileTypeIcons.mdb="file_extension_mdb.png";fileTypeIcons.mid="file_extension_mid.png";fileTypeIcons.mkv="file_extension_mkv.png";fileTypeIcons.mov="file_extension_mov.png";fileTypeIcons.mp2="file_extension_mp2.png";fileTypeIcons.mp3="file_extension_mp3.png";fileTypeIcons.mp4="file_extension_mp4.png";fileTypeIcons.mpeg="file_extension_mpeg.png";fileTypeIcons.mpg="file_extension_mpg.png";fileTypeIcons.msi="file_extension_msi.png";fileTypeIcons.mswmm="file_extension_mswmm.png";fileTypeIcons.ogg="file_extension_ogg.png";fileTypeIcons.pdf="file_extension_pdf.png";fileTypeIcons.png="file_extension_png.png";fileTypeIcons.pps="file_extension_pps.png";fileTypeIcons.ps="file_extension_ps.png";fileTypeIcons.psd="file_extension_psd.png";fileTypeIcons.pst="file_extension_pst.png";fileTypeIcons.ptb="file_extension_ptb.png";fileTypeIcons.pub="file_extension_pub.png";fileTypeIcons.qbb="file_extension_qbb.png";fileTypeIcons.qbw="file_extension_qbw.png";fileTypeIcons.qxd="file_extension_qxd.png";fileTypeIcons.ram="file_extension_ram.png";fileTypeIcons.rar="file_extension_rar.png";fileTypeIcons.rm="file_extension_rm.png";fileTypeIcons.rmvb="file_extension_rmvb.png";fileTypeIcons.rtf="file_extension_rtf.png";fileTypeIcons.sea="file_extension_sea.png";fileTypeIcons.ses="file_extension_ses.png";fileTypeIcons.sit="file_extension_sit.png";fileTypeIcons.sitx="file_extension_sitx.png";fileTypeIcons.ss="file_extension_ss.png";fileTypeIcons.swf="file_extension_swf.png";fileTypeIcons.tgz="file_extension_tgz.png";fileTypeIcons.thm="file_extension_thm.png";fileTypeIcons.tif="file_extension_tif.png";fileTypeIcons.tmp="file_extension_tmp.png";fileTypeIcons.torrent="file_extension_torrent.png";fileTypeIcons.ttf="file_extension_ttf.png";fileTypeIcons.txt="file_extension_txt.png";fileTypeIcons.vcd="file_extension_vcd.png";fileTypeIcons.vob="file_extension_vob.png";fileTypeIcons.wav="file_extension_wav.png";fileTypeIcons.wma="file_extension_wma.png";fileTypeIcons.wmv="file_extension_wmv.png";fileTypeIcons.wps="file_extension_wps.png";fileTypeIcons.xls="file_extension_xls.png";fileTypeIcons.xpi="file_extension_xpi.png";fileTypeIcons.zip="file_extension_zip.png";var FileTypes=new Array();FileTypes.image=new Array("jpg","jpeg","png","gif");FileTypes.media=new Array("avi","flv","swf","wmv","mp3","wma","mpg","mpeg");FileTypes.document=new Array("doc","docx","txt","rtf","pdf","xls","mdb","html","htm","db");function RoxyUtils(){}RoxyUtils.FixPath=function(b){if(!b){return""}var a=b.replace(/\\/g,"");a=a.replace(/\/\//g,"/");a=a.replace(":/","://");return a};RoxyUtils.FormatDate=function(b){var a="";try{a=$.format.date(b,RoxyFilemanConf.DATEFORMAT)}catch(c){a=b.toString();a=a.substr(0,a.indexOf("UTC"))}return a};RoxyUtils.GetPath=function(b){var a="";b=RoxyUtils.FixPath(b);if(b.indexOf("/")>-1){a=b.substring(0,b.lastIndexOf("/"))}return a};RoxyUtils.GetUrlParam=function(d,b){var a="";if(!b){b=self.location.href}if(b.indexOf("?")>-1){b=b.substr(b.indexOf("?")+1);b=b.split("&");for(i=0;i-1){a=b.substring(b.lastIndexOf("/")+1)}return a};RoxyUtils.MakePath=function(){ret="";if(arguments&&arguments.length>0){for(var a=0;a-1){a=b.substring(b.lastIndexOf(".")+1)}return a};RoxyUtils.FileExists=function(b){var a=false;$.ajax({url:b,type:"HEAD",async:false,dataType:"text",success:function(){a=true}});return a};RoxyUtils.GetFileIcon=function(a){ret="images/filetypes/unknown.png";if(fileTypeIcons[RoxyUtils.GetFileExt(a).toLowerCase()]){ret="images/filetypes/"+fileTypeIcons[RoxyUtils.GetFileExt(a).toLowerCase()]}return ret};RoxyUtils.GetFileSize=function(b){var a=0;$.ajax({url:b,type:"HEAD",async:false,success:function(f,c,e){a=e.getResponseHeader("Content-Length")}});if(!a){a=0}return a};RoxyUtils.GetFileType=function(b){var a=RoxyUtils.GetFileExt(b).toLowerCase();if(a=="png"||a=="jpg"||a=="gif"||a=="jpeg"){a="image"}return a};RoxyUtils.IsImage=function(b){var a=false;if(RoxyUtils.GetFileType(b)=="image"){a=true}return a};RoxyUtils.FormatFileSize=function(a){var b="B";if(!a){a=0}if(a>1024){a=a/1024;b="KB"}if(a>1024){a=a/1024;b="MB"}a=new Number(a);return a.toFixed(2)+" "+b};RoxyUtils.AddParam=function(b,c,a){b+=(b.indexOf("?")>-1?"&":"?")+c+"="+encodeURIComponent(a);return b};RoxyUtils.SelectText=function(d,f,b){try{var e=document.getElementById(d);if(e.createTextRange){var a=e.createTextRange();a.collapse(true);a.moveStart("character",f);a.moveEnd("character",b-f);a.select()}else{if(e.setSelectionRange){e.setSelectionRange(f,b)}else{if(e.selectionStart){e.selectionStart=f;e.selectionEnd=b}}}e.focus()}catch(c){}};function RoxyFilemanConf(){}RoxyUtils.LoadConfig=function(){$.ajax({url:"conf.json",dataType:"json",async:false,success:function(a){RoxyFilemanConf=a},error:function(a){alert(t("E_LoadingConf"))}})};function RoxyLang(){}RoxyUtils.LoadLang=function(){var a="";if(RoxyFilemanConf.LANG&&RoxyFilemanConf.LANG.toLowerCase()=="auto"){if(RoxyUtils.GetUrlParam("langCode")){a="lang/"+RoxyUtils.GetUrlParam("langCode").substr(0,2).toLowerCase()+".json"}else{var b=window.navigator.userLanguage||window.navigator.language;a="lang/"+b.substr(0,2)+".json"}if(!RoxyUtils.FileExists(a)){a=""}}else{if(RoxyFilemanConf.LANG){a="lang/"+RoxyFilemanConf.LANG.substr(0,2).toLowerCase()+".json";if(!RoxyUtils.FileExists(a)){a=""}}}if(!a){a="lang/en.json"}$.ajax({url:a,dataType:"json",async:false,success:function(c){RoxyLang=c},error:function(c){alert("Error loading language file")}})};RoxyUtils.Translate=function(){RoxyUtils.LoadLang();$("[data-lang-t]").each(function(){var a=$(this).attr("data-lang-t");$(this).prop("title",t(a))});$("[data-lang-v]").each(function(){var a=$(this).attr("data-lang-v");$(this).prop("value",t(a))});$("[data-lang]").each(function(){var a=$(this).attr("data-lang");$(this).html(t(a))})};RoxyUtils.GetCookies=function(){var a=new Object();var b=document.cookie.replace(" ","");b=b.split(";");for(i in b){var c=b[i].split("=");if(c.length>1){a[$.trim(c[0].toString())]=decodeURIComponent($.trim(c[1].toString()))||""}}return a};RoxyUtils.GetCookie=function(b){var a=RoxyUtils.GetCookies();return a[b]||""};RoxyUtils.SetCookie=function(c,e,b,d){var a=new Date();if(b){a.setTime(a.getTime()+(b*3600*1000))}if(!d){d="/"}document.cookie=c+"="+encodeURIComponent(e)+"; path="+d+(b?"; expires="+a.toGMTString():"")};RoxyUtils.ToBool=function(b){var a=false;b=b.toString().toLowerCase();if(b=="true"||b=="on"||b=="yes"||b=="1"){a=true}return a};RoxyUtils.UnsetCookie=function(a){document.cookie=a+"=; expires=Thu, 01 Jan 1972 00:00:00 UTC"};function t(a){var b=a;if(RoxyLang&&RoxyLang[a]){b=RoxyLang[a]}return b}function File(d,a,c,b,e){this.fullPath=d;this.type=RoxyUtils.GetFileType(d);this.name=RoxyUtils.GetFilename(d);this.ext=RoxyUtils.GetFileExt(d);this.path=RoxyUtils.GetPath(d);this.icon=RoxyUtils.GetFileIcon(d);this.bigIcon=this.icon.replace("filetypes","filetypes/big");this.image=d;this.size=(a?a:RoxyUtils.GetFileSize(d));this.time=c;this.width=(b?b:0);this.height=(e?e:0);this.Show=function(){html='
  • ';html+='';html+=''+RoxyUtils.FormatDate(new Date(this.time*1000))+"";html+=''+this.name+"";html+=''+RoxyUtils.FormatFileSize(this.size)+"";html+="
  • ";$("#pnlFileList").append(html);var f=$("#pnlFileList li:last");if(RoxyFilemanConf.MOVEFILE){f.draggable({helper:makeDragFile,start:startDragFile,cursorAt:{left:10,top:10},delay:200})}f.click(function(g){selectFile(this)});f.dblclick(function(g){selectFile(this);setFile()});f.tooltip({show:{delay:700},track:true,content:tooltipContent});f.bind("contextmenu",function(h){h.stopPropagation();h.preventDefault();closeMenus("dir");selectFile(this);$(this).tooltip("close");var g=h.pageY-$("#menuFile").height();if(g<0){g=0}$("#menuFile").css({top:g+"px",left:h.pageX+"px"}).show();return false})};this.GetElement=function(){return $('li[data-path="'+this.fullPath+'"]')};this.IsImage=function(){var f=false;if(this.type=="image"){f=true}return f};this.Delete=function(){if(!RoxyFilemanConf.DELETEFILE){alert(t("E_ActionDisabled"));return}var g=RoxyUtils.AddParam(RoxyFilemanConf.DELETEFILE,"f",this.fullPath);var f=this;$.ajax({url:g,type:"POST",data:{f:this.fullPath},dataType:"json",async:false,success:function(h){if(h.res.toLowerCase()=="ok"){$('li[data-path="'+f.fullPath+'"]').remove();var j=Directory.Parse(f.path);if(j){j.files--;j.Update();j.SetStatusBar()}}else{alert(h.msg)}},error:function(h){alert(t("E_LoadingAjax")+" "+g)}})};this.Rename=function(f){if(!RoxyFilemanConf.RENAMEFILE){alert(t("E_ActionDisabled"));return false}if(!f){return false}var h=RoxyUtils.AddParam(RoxyFilemanConf.RENAMEFILE,"f",this.fullPath);h=RoxyUtils.AddParam(h,"n",f);var j=this;var g=false;$.ajax({url:h,type:"POST",data:{f:this.fullPath,n:f},dataType:"json",async:false,success:function(l){if(l.res.toLowerCase()=="ok"){var k=RoxyUtils.MakePath(this.path,f);$('li[data-path="'+j.fullPath+'"] .icon').attr("src",RoxyUtils.GetFileIcon(f));$('li[data-path="'+j.fullPath+'"] .name').text(f);$('li[data-path="'+k+'"]').attr("data-path",k);g=true}if(l.msg){alert(l.msg)}},error:function(k){alert(t("E_LoadingAjax")+" "+h)}});return g};this.Copy=function(j){if(!RoxyFilemanConf.COPYFILE){alert(t("E_ActionDisabled"));return}var g=RoxyUtils.AddParam(RoxyFilemanConf.COPYFILE,"f",this.fullPath);g=RoxyUtils.AddParam(g,"n",j);var h=this;var f=false;$.ajax({url:g,type:"POST",data:{f:this.fullPath,n:j},dataType:"json",async:false,success:function(k){if(k.res.toLowerCase()=="ok"){var l=Directory.Parse(j);if(l){l.files++;l.Update();l.SetStatusBar();l.ListFiles(true)}f=true}if(k.msg){alert(k.msg)}},error:function(k){alert(t("E_LoadingAjax")+" "+g)}});return f};this.Move=function(j){if(!RoxyFilemanConf.MOVEFILE){alert(t("E_ActionDisabled"));return}newFullPath=RoxyUtils.MakePath(j,this.name);var g=RoxyUtils.AddParam(RoxyFilemanConf.MOVEFILE,"f",this.fullPath);g=RoxyUtils.AddParam(g,"n",newFullPath);var h=this;var f=false;$.ajax({url:g,type:"POST",data:{f:this.fullPath,n:newFullPath},dataType:"json",async:false,success:function(k){if(k.res.toLowerCase()=="ok"){$('li[data-path="'+h.fullPath+'"]').remove();var l=Directory.Parse(h.path);if(l){l.files--;l.Update();l.SetStatusBar();l=Directory.Parse(j);l.files++;l.Update()}f=true}if(k.msg){alert(k.msg)}},error:function(k){alert(t("E_LoadingAjax")+" "+g)}});return f}}File.Parse=function(c){var b=false;var a=$("#pnlFileList").find('li[data-path="'+c+'"]');if(a.length>0){b=new File(a.attr("data-path"),a.attr("data-size"),a.attr("data-time"),a.attr("data-w"),a.attr("data-h"))}return b};function Directory(a,c,b){if(!a){a=""}this.fullPath=a;this.name=RoxyUtils.GetFilename(a);if(!this.name){this.name="My files"}this.path=RoxyUtils.GetPath(a);this.dirs=(c?c:0);this.files=(b?b:0);this.filesList=new Array();this.Show=function(){var d=this.GetHtml();var e=null;e=$('li[data-path="'+this.path+'"]');if(e.length==0){e=$("#pnlDirList")}else{if(e.children("ul").length==0){e.append("")}e=e.children("ul")}if(e){e.append(d);this.SetEvents()}};this.SetEvents=function(){var d=this.GetElement();if(RoxyFilemanConf.MOVEDIR){d.draggable({helper:makeDragDir,start:startDragDir,cursorAt:{left:10,top:10},delay:200})}d=d.children("div");d.click(function(f){selectDir(this)});d.bind("contextmenu",function(g){g.stopPropagation();g.preventDefault();closeMenus("file");selectDir(this);var f=g.pageY-$("#menuDir").height();if(f<0){f=0}$("#menuDir").css({top:f+"px",left:g.pageX+"px"}).show();return false});d.droppable({drop:moveObject,over:dragFileOver,out:dragFileOut});d=d.children(".dirPlus");d.click(function(f){f.stopPropagation();var g=Directory.Parse($(this).closest("li").attr("data-path"));g.Expand()})};this.GetHtml=function(){var d='
  • ';d+='
    ';d+=''+this.name+" ("+this.files+")
    ";d+="
  • ";return d};this.SetStatusBar=function(){$("#pnlStatus").html(this.files+" "+(this.files==1?t("file"):t("files")))};this.SetSelectedFile=function(e){if(e){var d=File.Parse(e);if(d){selectFile(d.GetElement())}}};this.Select=function(e){var d=this.GetElement();d.children("div").addClass("selected");$('#pnlDirList li[data-path!="'+this.fullPath+'"] > div').removeClass("selected");d.children("img.dir").prop("src","images/folder.png");this.SetStatusBar();var f=this.GetParent();while(f){f.Expand(true);f=f.GetParent()}this.Expand(true);this.ListFiles(true,e);setLastDir(this.fullPath)};this.GetElement=function(){return $('li[data-path="'+this.fullPath+'"]')};this.IsExpanded=function(){var d=this.GetElement().children("ul");return(d&&d.is(":visible"))};this.IsListed=function(){if($("#hdDir").val()==this.fullPath){return true}return false};this.GetExpanded=function(e){var d=new Array();if(!e){e=$("#pnlDirList")}e.children("li").each(function(){var f=$(this).attr("data-path");var g=new Directory(f);if(g){if(g.IsExpanded()&&f){d.push(f)}d=d.concat(g.GetExpanded(g.GetElement().children("ul")))}});return d};this.RestoreExpanded=function(e){for(i=0;ig){return -1+f}else{if(hg){return -1+f}else{if(hg){return -1+f}else{if(h0){b=new Directory(a.attr("data-path"),a.attr("data-dirs"),a.attr("data-files"))}return b};$.ajaxSetup({cache:false});function selectFile(b){$("#pnlFileList li").removeClass("selected");$(b).prop("class","selected");var a=RoxyUtils.GetFilename($(b).attr("data-path"));a+=" ("+t("Size")+": "+RoxyUtils.FormatFileSize($(b).attr("data-size"));if($(b).attr("data-w")>0){a+=", "+t("Dimensions")+":"+$(b).attr("data-w")+"x"+$(b).attr("data-h")}a+=")";$("#pnlStatus").html(a)}function getLastDir(){return RoxyUtils.GetCookie("roxyld")}function setLastDir(a){RoxyUtils.SetCookie("roxyld",a,10)}function selectDir(a){var b=Directory.Parse($(a).parent("li").attr("data-path"));if(b){b.Select()}}function startDragDir(){}function startDragFile(){selectFile(this)}function dragFileOver(){$(this).children("img.dir").attr("src","images/folder-green.png")}function dragFileOut(){$("#pnlDirList").find("img.dir").attr("src","images/folder.png")}function makeDragFile(b){var a=new File($(b.target).closest("li").attr("data-path"));return'
     '+a.name+"
    "}function makeDragDir(b){var a=new Directory($(b.target).attr("data-path")?$(b.target).attr("data-path"):$(b.target).closest("li").attr("data-path"));return'
     '+a.name+"
    "}function moveDir(f,b,d){var a=Directory.Parse(b.draggable.attr("data-path"));var c=Directory.Parse($(d).parent("li").attr("data-path"));if(c.fullPath!=a.path){a.Move(c.fullPath)}}function moveFile(g,b,c){var a=new File(b.draggable.attr("data-path"));var j=Directory.Parse($(c).parent("li").attr("data-path"));var h=Directory.Parse(a.path);if(a.path!=j.fullPath){a.Move(j.fullPath)}}function moveObject(b,a){b.stopPropagation();if(a.draggable.hasClass("directory")){moveDir(b,a,this)}else{moveFile(b,a,this)}dragFileOut()}function clickFirstOnEnter(a){$("#"+a).unbind("keypress");$(".actions input").each(function(){this.blur()});$("#"+a).keypress(function(b){if(b.keyCode==$.ui.keyCode.ENTER){b.stopPropagation();$(this).parent().find(".ui-dialog-buttonset button").eq(0).trigger("click")}})}function addDir(){var b=getSelectedDir();if(!b){return}clickFirstOnEnter("pnlDirName");$("#txtDirName").val("");var a={};a[t("CreateDir")]=function(){var c=$.trim($("#txtDirName").val());if(!c){alert(t("E_MissingDirName"))}if(b.Create(c)){$("#pnlDirName").dialog("close")}};a[t("Cancel")]=function(){$("#pnlDirName").dialog("close")};$("#pnlDirName").dialog({title:t("T_CreateDir"),modal:true,buttons:a})}var uploadFileList=new Array();function showUploadList(b){var a=$("#uploadFilesList");a.html("");clearFileField();for(i=0;i
    '+b[i].name+" ("+RoxyUtils.FormatFileSize(b[i].size)+')
    ')}if(b.length>0){$("#btnUpload").button("enable")}else{$("#btnUpload").button("disable")}}function listUploadFiles(a){if(!window.FileList){$("#btnUpload").button("enable")}else{if(a.length>0){uploadFileList=new Array();addUploadFiles(a)}}}function addUploadFiles(a){for(i=0;i99){c=99}b.find(".uploadProgress").css("width",c+"%");b.find(".progressPercent").html(" - "+c+"%")}function uploadComplete(b,a){uploadFinished(b,a,"ok")}function uploadError(b,a){setUploadError(a);uploadFinished(b,a,"error")}function setUploadError(a){var b=findUploadElement(a);b.find(".uploadProgress").css("width","100%").addClass("uploadError").removeClass("uploadComplete");b.find(".progressPercent").html(' - '+t("E_UploadingFile")+"")}function setUploadSuccess(a){var b=findUploadElement(a);b.find(".uploadProgress").css("width","100%").removeClass("uploadError").addClass("uploadComplete");b.find(".progressPercent").html(" - 100%")}function uploadCanceled(b,a){uploadFinished(b,a,"error")}function uploadFinished(g,d,c){var f=findUploadElement(d);var a=null;try{a=JSON.parse(g.target.responseText)}catch(b){}if((a&&a.res=="error")||c!="ok"){c="error";setUploadError(d)}else{c="ok";setUploadSuccess(d)}f.attr("data-ulpoad",c);checkUploadResult()}function checkUploadResult(){var b=$("#uploadFilesList .fileUpload").length;var a=$("#uploadFilesList .fileUpload[data-ulpoad]").length;var e=$('#uploadFilesList .fileUpload[data-ulpoad="ok"]').length;if(a==b){uploadFileList=new Array();var c=Directory.Parse($("#hdDir").val());c.ListFiles(true);$("#btnUpload").button("disable")}}function fileUpload(e,c){var b=new XMLHttpRequest();var a=new FormData();var d=findUploadElement(c);d.find(".removeUpload").remove();a.append("action","upload");a.append("method","ajax");a.append("d",$("#hdDir").attr("value"));a.append("files[]",e);b.upload.addEventListener("progress",function(f){updateUploadProgress(f,c)},false);b.addEventListener("load",function(f){uploadComplete(f,c)},false);b.addEventListener("error",function(f){uploadError(f,c)},false);b.addEventListener("abort",function(f){uploadCanceled(f,c)},false);b.open("POST",RoxyFilemanConf.UPLOAD,true);b.setRequestHeader("Accept","*/*");b.send(a)}function dropFiles(b,a){if(b&&b.dataTransfer&&b.dataTransfer.files){addFile();if(a){addUploadFiles(b.dataTransfer.files)}else{listUploadFiles(b.dataTransfer.files)}}else{addFile()}}function clearFileField(a){if(!a){a="#fileUploads"}try{$(a).val("");$(a).val(null)}catch(b){}}function addFileClick(){$("#uploadResult").html("");showUploadList(new Array());addFile()}function addFile(){clickFirstOnEnter("dlgAddFile");$("#uploadResult").html("");clearFileField();var a={};a[t("Upload")]={id:"btnUpload",text:t("Upload"),disabled:true,click:function(){if(!$("#fileUploads").val()&&(!uploadFileList||uploadFileList.length==0)){alert(t("E_SelectFiles"))}else{if(!RoxyFilemanConf.UPLOAD){alert(t("E_ActionDisabled"))}else{if(window.FormData&&window.XMLHttpRequest&&window.FileList&&uploadFileList&&uploadFileList.length>0){for(i=0;i0){RoxyUtils.SelectText("txtFileName",0,b.name.lastIndexOf("."))}}function getSelectedFile(){var a=null;if($("#pnlFileList .selected").length>0){a=new File($("#pnlFileList .selected").attr("data-path"))}return a}function getSelectedDir(){var a=null;if($("#pnlDirList .selected")){a=Directory.Parse($("#pnlDirList .selected").closest("li").attr("data-path"))}return a}function deleteDir(a){var b=null;if(a){b=Directory.Parse(a)}else{b=getSelectedDir()}if(b&&confirm(t("Q_DeleteFolder"))){b.Delete()}}function deleteFile(){var a=getSelectedFile();if(a&&confirm(t("Q_DeleteFile"))){a.Delete()}}function previewFile(){var a=getSelectedFile();if(a){window.open(a.fullPath)}}function downloadFile(){var b=getSelectedFile();if(b&&RoxyFilemanConf.DOWNLOAD){var a=RoxyUtils.AddParam(RoxyFilemanConf.DOWNLOAD,"f",b.fullPath);window.frames.frmUploadFile.location.href=a}else{if(!RoxyFilemanConf.DOWNLOAD){alert(t("E_ActionDisabled"))}}}function downloadDir(){var b=getSelectedDir();if(b&&RoxyFilemanConf.DOWNLOADDIR){var a=RoxyUtils.AddParam(RoxyFilemanConf.DOWNLOADDIR,"d",b.fullPath);window.frames.frmUploadFile.location.href=a}else{if(!RoxyFilemanConf.DOWNLOAD){alert(t("E_ActionDisabled"))}}}function closeMenus(a){if(!a||a=="dir"){$("#menuDir").fadeOut()}if(!a||a=="file"){$("#menuFile").fadeOut()}}function selectFirst(){var a=$("#pnlDirList li:first").children("div").first();if(a.length>0){selectDir(a)}else{window.setTimeout("selectFirst()",300)}}function tooltipContent(){if($("#menuFile").is(":visible")){return""}var a="";var b=File.Parse($(this).attr("data-path"));if($("#hdViewType").val()=="thumb"&&b.IsImage()){a=b.fullPath+'
    '+t("Size")+": "+RoxyUtils.FormatFileSize(b.size)+" "+t("Dimensions")+": "+b.width+"x"+b.height+""}else{if(b.IsImage()){if(RoxyFilemanConf.GENERATETHUMB){imgUrl=RoxyUtils.AddParam(RoxyFilemanConf.GENERATETHUMB,"f",b.fullPath);imgUrl=RoxyUtils.AddParam(imgUrl,"width",RoxyFilemanConf.PREVIEW_THUMB_WIDTH);imgUrl=RoxyUtils.AddParam(imgUrl,"height",RoxyFilemanConf.PREVIEW_THUMB_HEIGHT)}else{imgUrl=b.fullPath}a='
    '+b.name+'
    '+t("Size")+": "+RoxyUtils.FormatFileSize(b.size)+" "+t("Dimensions")+": "+b.width+"x"+b.height+""}else{a=b.fullPath+' '+t("Size")+": "+RoxyUtils.FormatFileSize(b.size)+""}}return a}function filterFiles(){var b=$("#txtSearch").val();$("#pnlSearchNoFiles").hide();if($("#pnlFileList li").length==0){return}if(!b){$("#pnlFileList li").show();return}var a=0;$("#pnlFileList li").each(function(){var c=$(this).children(".name").text();if(c.toLowerCase().indexOf(b.toLowerCase())>-1){a++;$(this).show()}else{$(this).removeClass("selected");$(this).hide()}});if(a==0){$("#pnlSearchNoFiles").show()}}function sortFiles(){var a=getSelectedDir();if(!a){return}a.ListFiles();filterFiles();switchView($("#hdViewType").val())}function switchView(a){if(a==$("#hdViewType").val()){return}if(!a){a=$("#hdViewType").val()}$(".btnView").removeClass("selected");if(a=="thumb"){$("#pnlFileList .icon").attr("src","images/blank.gif");$("#pnlFileList").addClass("thumbView");if($("#dynStyle").length==0){$("head").append('