ok this is where i am atm
Code:
plugin.loadLang();
theWebUI.tables.move =
{
obj: new dxSTable(),
columns:
[
{ text: theUILang.Name, width: "300px", id: "name", type: TYPE_STRING }
],
container: "MoveFileList",
format: theFormatter.files,
onselect: function(e,id) { theWebUI.flsSelect(e,id) }/*,
ondblclick: function(obj)
{
if(!theWebUI.settings["webui.fls.view"] && (theWebUI.dID!=""))
{
var lnk = this.getAttr(obj.id, "link");
if(lnk!=null)
{
theWebUI.dirs[theWebUI.dID].setDirectory(lnk);
this.clearRows();
theWebUI.redrawFilesMove(theWebUI.dID);
}
}
return(false);
}*/
}
theWebUI.redrawFilesMove = function(hash)
{
if(this.dID == hash)
{
var table = this.getTable("move");
for(var i in this.files[hash])
{
var sId = hash + "_f_" + i;
var file = this.files[hash];
file.percent = (file.size > 0) ? theConverter.round((file.done/file.size)*100,1): "100.0";
if(this.settings["webui.fls.view"])
{
if(!$type(table.rowdata[sId]))
table.addRowById(file, sId, file.icon, file.attr);
else
{
for(var j in file)
table.setValueById(sId, j, file[j]);
table.setIcon(sId,file.icon);
table.setAttr(sId,file.attr);
}
}
else
{
if(!$type(this.dirs[hash]))
this.dirs[hash] = new rDirectory();
this.dirs[hash].addFile(file, i);
}
}
if(!this.settings["webui.fls.view"] && this.dirs[hash])
{
var dir = this.dirs[hash].getDirectory();
for(var i in dir)
{
var entry = dir;
if(entry.link!=null)
{
if(!$type(table.rowdata))
table.addRowById(entry.data, i, entry.icon, {link : entry.link});
else
for(var j in entry.data)
table.setValueById(i, j, entry.data[j]);
}
}
for(var i in dir)
{
var entry = dir;
if(entry.link==null)
{
if(!$type(table.rowdata))
table.addRowById(entry.data, i, entry.icon, {link : null});
else
for(var j in entry.data)
table.setValueById(i, j, entry.data[j]);
}
}
}
table.Sort();
}
}
theWebUI.getFilesMove= function(hash, isUpdate)
{
var table = this.getTable("move");
if(!isUpdate)
{
table.dBody.scrollTop = 0;
$(table.tpad).height(0);
$(table.bpad).height(0);
table.clearRows();
}
if($type(this.files[hash]) && !isUpdate)
this.redrawFilesMove(hash);
else
{
if(!$type(this.files[hash]))
this.files[hash] = new Array(0);
this.request("?action=getfiles&hash=" + hash, [this.addFiles, this]);
}
}
if(plugin.enabled)
{
if(plugin.canChangeMenu())
{
plugin.createMenu = theWebUI.createMenu;
theWebUI.createMenu = function( e, id )
{
plugin.createMenu.call(this, e, id);
if(plugin.enabled)
{
//var table = this.getTable("move");
var el = theContextMenu.get( theUILang.Properties );
if( el )
theContextMenu.add([CMENU_SEP]);
theContextMenu.add( el, [theUILang.move+"...", "theWebUI.dummy('" + theWebUI.dID + "')"]);
//theDialogManager.show( "dlg_move" );
//theWebUI.redrawFilesMove.call(this,theWebUI.dID);
}
}
}
theWebUI.dummy = function(dID)
{
theDialogManager.show( "dlg_move" );
theWebUI.getFilesMove.call(this, theWebUI.dID);
}
}
plugin.onLangLoaded = function()
{
theDialogManager.make( 'dlg_move', theUILang.moveDlgCaption,
"<div class='cont fxcaret'>" +
"<fieldset>" +
"<div id='MoveFileList' class='table_tab'>" +
"</div>" +
"</fieldset>" +
"</div>"+
"<div class='aright buttons-list'>" +
"<input type='button' value='" + theUILang.ok + "' class='OK Button' id='btn_move_ok'" +
" onclick='theWebUI.sendmove(); return(false);' />" +
"<input type='button' value='"+ theUILang.Cancel + "' class='Cancel Button'/>" +
"</div>", true);
if(thePlugins.isInstalled("_getdir"))
{
var btn = new theWebUI.rDirBrowser( 'dlg_move', 'edit_move', 'btn_move_browse', 'frame_move_browse' );
theDialogManager.setHandler('dlg_move','afterHide',function()
{
btn.hide();
});
}
else
$('#btn_move_browse').remove();
}
plugin.onRemove = function()
{
theDialogManager.hide("dlg_move");
}
i created a new table (move) based on the "fls" table
i duplicated and renamed getFiles and redrawFiles ho seemed to be the responsible for the files list table.
i have now a context menu ho open (badly) a popup with the files list.
now i have to find a way to add a column with a browse button
any help?