home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 June
/
ccd0605.iso
/
Software
/
Freeware
/
Programare
/
paranoia
/
ParanoiaSetup.exe
/
Gui
/
transfers.js
< prev
Wrap
Text File
|
2005-04-08
|
6KB
|
165 lines
/*
* function: OnloadShared
* Description: Loads the shared files list and sets its template
*/
function OnloadTransfers()
{
/* Start onload download settings */
ExecuteCommand("SetDownloadFilesHeaderTemplate|SEPERATOR|<table width='100%' border='0' cellpadding='0' cellspacing='0'>");
var lsCompletedDownloadTemplate = "<tr> \
<td align='left' bgcolor='#F1F1F1'><span style='width: 100%; padding: 5px;' class='CommandLink' onclick=run_file(<DownloadID>)><b><DownloadName></b></span></td>\
</tr>\
<tr >\
<td align='left' ><span style='border-bottom: 1px solid #6799FF; width: 100%;padding: 5px;'>\
<strong>Size:</strong> <span style='color:#339933'><DownloadSize></span> KB \
<strong>Completed:</strong> <span style='color:#339933'><DownloadComplete></span> \
<strong>Status:</strong> <span style='color:#339933'><DownloadStatus></span>\
</span></td>\
</tr>";
var lsCmd = "SetCompletedDownloadFilesTemplate" + "|SEPERATOR|" + lsCompletedDownloadTemplate;
ExecuteCommand(lsCmd);
var lsIncompleteDownloadTemplate = "<tr> \
<td align='left' bgcolor='#F1F1F1'><span style='width: 100%; padding: 5px;'><b><DownloadName></b></span></td>\
</tr>\
<tr >\
<td align='left' ><span style='width: 100%; padding: 5px;'>\
<strong>Size:</strong> <span style='color:#339933'><DownloadSize> KB</span> \
<strong>Speed:</strong> <span style='color:#339933'><DownloadSpeed></span> \
<strong>Completed:</strong> <span style='color:#339933'><DownloadComplete></span> \
<strong>Status:</strong> <span style='color:#339933'><DownloadStatus></span> \
<strong>Remaining:</strong> <span style='color:#339933'><DownloadETA></span>\
</span></td>\
</tr>\
<tr>\
<td ><span style='border-bottom: 1px solid #6799FF; width: 100%; padding: 5px;'>\
<span class='CommandLink' onclick=pause_resume_download(<DownloadID>)>Pause/Resume Download</span> | \
<span class='CommandLink' onclick=remove_download(<DownloadID>)>Remove Download</span> | \
<span class='CommandLink' onclick=find_more_sources(<DownloadID>)>Find more sources</span>\
</span></td>\
</tr>";
var lsCmd = "SetIncompleteDownloadFilesTemplate" + "|SEPERATOR|" + lsIncompleteDownloadTemplate;
ExecuteCommand(lsCmd);
ExecuteCommand("SetDownloadFilesFooterTemplate|SEPERATOR|</table>");
ExecuteCommand("SetDownloadID|SEPERATOR|DownloadsID");
/* End onload download settings */
/* Start onload upload settings */
ExecuteCommand("SetUploadFilesHeaderTemplate|SEPERATOR|<table width='100%' border='0' cellpadding='0' cellspacing='0'>");
var lsUploadTemplate = "<tr> \
<td align='left' bgcolor='#F1F1F1'><span style='width: 100%; padding: 5px;'><b><UploadName></b></span></td>\
</tr>\
<tr >\
<td align='left' ><span style='border-bottom: 1px solid #6799FF; width: 100%;padding: 5px;'>\
<strong>Status:</strong> <span style='color:#339933'><UploadStatus></span> \
<strong>Bytes Sent:</strong> <span style='color:#339933'><UploadBytesSent></span> \
<strong>Speed:</strong> <span style='color:#339933'><UploadSpeed></span> \
<strong>Estimated Time:</strong> <span style='color:#339933'><UploadEstimatedTime></span> \
<strong>Time:</strong> <span style='color:#339933'><UploadTime> KB</span> \
</span></td>\
</tr>";
var lsCmd = "SetUploadFilesTemplate" + "|SEPERATOR|" + lsUploadTemplate;
ExecuteCommand(lsCmd);
ExecuteCommand("SetUploadFilesFooterTemplate|SEPERATOR|</table>");
ExecuteCommand("SetUploadID|SEPERATOR|UploadsID");
/* End onload upload settings */
}
/*
* function: run_file
* Parameters:
* DownloadID - The ID of the download
* Description: Runs a file by its ID - make sure the function name is lower case,
* because the template is converted into lower case characters.
*/
function run_file(DownloadID)
{
var lsCmd;
lsCmd = "RunFile|SEPERATOR|" + DownloadID;
ExecuteCommand(lsCmd);
}
/*
* function: remove_download
* Parameters:
* DownloadID - The ID of the download
* Description: Removes a download and update the interface - make sure the function name is lower case,
* because the template is converted into lower case characters.
*/
function remove_download(DownloadID)
{
var lsCmd;
lsCmd = "RemoveDownload|SEPERATOR|" + DownloadID;
ExecuteCommand(lsCmd);
}
/*
* function: find_more_sources
* Parameters:
* DownloadID - The ID of the download
* Description: Finds more sources for the download - make sure the function name is lower case,
* because the template is converted into lower case characters.
*/
function find_more_sources(DownloadID)
{
var lsCmd;
lsCmd = "FindMoreSources|SEPERATOR|" + DownloadID;
ExecuteCommand(lsCmd);
}
/*
* function: pause_resume_download
* Parameters:
* DownloadID - The ID of the download
* Description: Depending on the download status pause or resumes the download - make sure the function name is lower case,
* because the template is converted into lower case characters.
*/
function pause_resume_download(DownloadID)
{
var lsCmd;
lsCmd = "IsStopped|SEPERATOR|" + DownloadID + "|SEPERATOR|IsStoppedID";
ExecuteCommand(lsCmd);
if(IsStoppedID.innerHTML == "1")
{
lsCmd = "StartDownload|SEPERATOR|" + DownloadID;
}else
{
lsCmd = "PauseDownload|SEPERATOR|" + DownloadID;
}
ExecuteCommand(lsCmd);
}
function ShowDownloadURI()
{
var intTop = event.clientY + document.body.scrollTop+10;
var intLeft = event.clientX + document.body.scrollLeft-10;
DownloadURIID.style.pixelTop = intTop;
DownloadURIID.style.pixelLeft = intLeft;
DownloadURIID.style.display = "inline";
}
function DownloadURI()
{
DownloadURIID.style.display = "none";
var lsCmd;
lsCmd = "DownloadURI|SEPERATOR|" + URIInput.value;
ExecuteCommand(lsCmd);
}