% -- Plugin Name: Jdownload -- Description: This plugin uses jdownload applet for downloading entire folder or files. -- Author: wftpserver (http://www.wftpserver.com) -- Version: 1.5 local tab = {} tab.plugin_enabled = true local buttonname = LANG["str_app_batchdown"] or "Batch Downloader" tab.extbutton_name = buttonname tab.extbutton_func = "show_jdownload()" tab.extbutton_icon = "plugins/jdownload/icon.gif" tab.need_selectfile = false tab.singlefile = true tab.exthtml = [[
]] tab.extjs = [[ var g_LocalPath = ""; function getLocalPath() { return g_LocalPath; } function setLocalPath(savePath) { g_LocalPath = savePath; } function show_jdownload() { var dirlist = getCheckedDirlist(1); var filelist = getCheckedDirlist(0); var parameters = ""; if(dirlist == "" && filelist == "") { if(selectedRow != null) { if(selectedRow.cells[2].innerHTML == "]]..LANG['list_directory']..[[") { dirlist = selectedRow.cells[0].getAttribute("name"); } else { filelist = selectedRow.cells[0].getAttribute("name"); } var httpurl = location.protocol + "//" + location.host; parameters = "httpurl="+urlEncode(httpurl)+"&dirlist="+urlEncode(dirlist)+"&filelist="+urlEncode(filelist); unselectAll(); } else { alert("]]..LANG['no_checkbox']..[["); return false; } } else { var httpurl = location.protocol + "//" + location.host; parameters = "httpurl="+urlEncode(httpurl)+"&dirlist="+urlEncode(dirlist)+"&filelist="+urlEncode(filelist); unselectAll(); } $("jdownloadDiv_mask").style.display = ""; $("jdownloadDiv").style.display = ""; var templeft = (getBrowerWidth()-500)/2; if(templeft < 0) templeft = 0; $("jdownloadDiv").style.left = templeft +"px"; var temptop = (getBrowerHeight()-300)/2 - 30; if(temptop < 0) temptop = 0; $("jdownloadDiv").style.top = temptop +"px"; if(isIE) { $("jdownloadApplet").innerHTML = ""; } else { $("jdownloadApplet").innerHTML = "" } } function hide_jdownload() { $("jdownloadDiv_mask").style.display = "none"; $("jdownloadDiv").style.display = "none"; ajaxRequest("dir","r="+Math.random()); } ]] register_plugin(tab) %>