%
-- Plugin Name: GoogleDocs
-- Description: This plugin uses Google Docs to quickly view documents online.
-- Author: wftpserver (http://www.wftpserver.com)
-- Version: 1.0
local tab = {}
tab.plugin_enabled = true
tab.extbutton_name = "GoogleDocs"
tab.extbutton_func = "show_googledocs()"
tab.extbutton_icon = "plugins/googledocs/icon.gif"
tab.need_selectfile = true
local strSessionID = _SESSION_ID or ""
tab.extjs = [[
function show_googledocs()
{
if(selectedRow == null)
{
alert("]]..LANG['error_edit']..[[");
return;
}
if(selectedRow.cells[2].innerHTML != "]]..LANG['list_directory']..[[")
{
var f_name = selectedRow.cells[0].getAttribute("name");
var filename = htmldecode(f_name);
filename = urlEncodeSpecial(f_name);
var localaddress = location.href.replace(/\#/g,"");
var downloadURL = localaddress + "?download&filename="+filename+"&UID=]]..strSessionID..[[&nowpath="+urlEncodeSpecial(now_dir)+"&r="+Math.random();
var frametag = new Date().getTime();
showMessagebox(""+f_name.substr(0,55)+(f_name.length > 55 ? "...":"")+"","",null,920,580);
}
else
{
alert("]]..LANG['error_edit']..[[");
}
}
]]
register_plugin(tab)
%>