home *** CD-ROM | disk | FTP | other *** search
- /*
- * function: OnloadShared
- * Description: Loads the shared files list and sets its template
- */
- function OnloadShared()
- {
- CommonOnload();
- ExecuteCommand("SetSharedFilesHeaderTemplate|SEPERATOR|<table width='100%' border='0' cellpadding='2px' cellspacing='0'>");
- var lsSharedTemplate = "<tr> \
- <td align='left' colspan='5' bgcolor='#F1F1F1'><span class='CommandLink' onclick=runfile(<FileID>)><FileName></span></td>\
- </tr>\
- <tr >\
- <td align='left' >Size: <FileSize> KB</td>\
- <td align='left'>Type: <FileType></td>\
- <td align='left'>Searched: <FileSearhced></td>\
- <td align='left'>Uploaded: <FileUploaded></td>\
- <td align='left'>Hashed: <FileHashed></td>\
- </tr>";
- var lsCmd = "SetSharedFilesTemplate" + "|SEPERATOR|" + lsSharedTemplate;
- ExecuteCommand(lsCmd);
-
- ExecuteCommand("SetSharedFilesFooterTemplate|SEPERATOR|</table>");
-
-
- ExecuteCommand("LoadSharedList|SEPERATOR|SharedFilesID");
-
- ExecuteCommand("GetTotalFilesShared|SEPERATOR|TotalFilesSharedID");
- ExecuteCommand("GetTotalSharedSize|SEPERATOR|TotalSharedSizeID");
- ExecuteCommand("GetTotalSearched|SEPERATOR|TotalSearchedID");
- ExecuteCommand("GetTotalUploaded|SEPERATOR|TotalUploadedID");
-
-
- }
-
- /*
- * function: OnUpdate
- * Description: Fired by the application when an update to the file list occurred
- */
- function OnUpdate()
- {
- ExecuteCommand("GetTotalFilesShared|SEPERATOR|TotalFilesSharedID");
- ExecuteCommand("GetTotalSharedSize|SEPERATOR|TotalSharedSizeID");
- ExecuteCommand("GetTotalSearched|SEPERATOR|TotalSearchedID");
- ExecuteCommand("GetTotalUploaded|SEPERATOR|TotalUploadedID");
-
- ExecuteCommand("IsPaged|SEPERATOR|IsPagedID");
- if(IsPagedID.innerHTML == "1")
- PagingID.style.display = 'inline';
- else
- PagingID.style.display = 'none';
-
-
- GetStartingFileNumber();
- GetEndingFileNumber();
- }
-
- /*
- * function: runfile
- * Description: Runs a file by its file ID - make sure the function name is lower case,
- * because the template is converted into lower case characters.
- */
- function runfile(FileID)
- {
- var lsCmd;
- lsCmd = "RunFile|SEPERATOR|" + FileID;
- ExecuteCommand(lsCmd);
- }
-
- /*
- * function: SortByName
- * Description: Sorts the list by the file name and updates the GUI
- */
- function SortByName()
- {
- ExecuteCommand("SortByName");
- }
-
- /*
- * function: SortBySize
- * Description: Sorts the list by the file size and updates the GUI
- */
- function SortBySize()
- {
- ExecuteCommand("SortBySize");
- }
-
- /*
- * function: SortByType
- * Description: Sorts the list by the type size and updates the GUI
- */
- function SortByType()
- {
- ExecuteCommand("SortByType");
- }
-
- /*
- * function: SortBySearched
- * Description: Sorts the list by the number of time file was searched and updates the GUI
- */
- function SortBySearched()
- {
- ExecuteCommand("SortBySearched");
- }
-
- /*
- * function: SortByUploaded
- * Description: Sorts the list by the number of time file was uploaded and updates the GUI
- */
- function SortByUploaded()
- {
- ExecuteCommand("SortByUploaded");
- }
-
- /*
- * function: SortByHashed
- * Description: Sorts the list by hashed files and updates the GUI
- */
- function SortByHashed()
- {
- ExecuteCommand("SortByHashed");
- }
-
- /*
- * function: GoToFirstPage
- * Description: Shows the first page of the list
- */
- function GoToFirstPage()
- {
- ExecuteCommand("GoToFirstPage");
- }
-
- /*
- * function: GoToNextPage
- * Description: Shows the next page of the list
- */
- function GoToNextPage()
- {
- ExecuteCommand("GoToNextPage");
- }
-
- /*
- * function: GoToPrevPage
- * Description: Shows the previous page of the list
- */
- function GoToPrevPage()
- {
- ExecuteCommand("GoToPrevPage");
- }
-
-
- /*
- * function: GoToLastPage
- * Description: Shows the last page of the list
- */
- function GoToLastPage()
- {
- ExecuteCommand("GoToLastPage");
- }
-
- /*
- * function: GetStartingFileNumber
- * Description: Return the place in the list of the first shown file.
- */
- function GetStartingFileNumber()
- {
- ExecuteCommand("GetStartingFileNumber|SEPERATOR|FirstFileNumberID");
- }
-
- /*
- * function: GetEndingFileNumber
- * Description: Return the place in the list of the last shown file.
- */
- function GetEndingFileNumber()
- {
- ExecuteCommand("GetEndingFileNumber|SEPERATOR|EndingFileNumberID");
- }