Annotation of /mambo/branches/4.6/mambots/editors/mostlyce/jscripts/tiny_mce/filemanager/frmfolders.html
Parent Directory
|
Revision Log
Revision 1053 - (view) (download) (as text)
| 1 : | cauld | 1053 | <!-- |
| 2 : | * FCKeditor - The text editor for internet | ||
| 3 : | * Copyright (C) 2003-2005 Frederico Caldeira Knabben | ||
| 4 : | * | ||
| 5 : | * Licensed under the terms of the GNU Lesser General Public License: | ||
| 6 : | * http://www.opensource.org/licenses/lgpl-license.php | ||
| 7 : | * | ||
| 8 : | * For further information visit: | ||
| 9 : | * http://www.fckeditor.net/ | ||
| 10 : | * | ||
| 11 : | * File Name: frmfolders.html | ||
| 12 : | * This page shows the list of folders available in the parent folder | ||
| 13 : | * of the current folder. | ||
| 14 : | * | ||
| 15 : | * File Authors: | ||
| 16 : | * Frederico Caldeira Knabben (fredck@fckeditor.net) | ||
| 17 : | --> | ||
| 18 : | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | ||
| 19 : | <html> | ||
| 20 : | <head> | ||
| 21 : | <link href="browser.css" type="text/css" rel="stylesheet"> | ||
| 22 : | <script type="text/javascript" src="js/fckxml.js"></script> | ||
| 23 : | <script type="text/javascript" src="js/common.js"></script> | ||
| 24 : | <script language="javascript"> | ||
| 25 : | |||
| 26 : | var sActiveFolder ; | ||
| 27 : | |||
| 28 : | var bIsLoaded = false ; | ||
| 29 : | var iIntervalId ; | ||
| 30 : | |||
| 31 : | var oListManager = new Object() ; | ||
| 32 : | |||
| 33 : | oListManager.Init = function() | ||
| 34 : | { | ||
| 35 : | this.Table = document.getElementById('tableFiles') ; | ||
| 36 : | this.UpRow = document.getElementById('trUp') ; | ||
| 37 : | |||
| 38 : | this.TableRows = new Object() ; | ||
| 39 : | } | ||
| 40 : | |||
| 41 : | oListManager.Clear = function() | ||
| 42 : | { | ||
| 43 : | // Remove all other rows available. | ||
| 44 : | while ( this.Table.rows.length > 1 ) | ||
| 45 : | this.Table.deleteRow(1) ; | ||
| 46 : | |||
| 47 : | // Reset the TableRows collection. | ||
| 48 : | this.TableRows = new Object() ; | ||
| 49 : | } | ||
| 50 : | |||
| 51 : | oListManager.AddItem = function( folderName, folderPath ) | ||
| 52 : | { | ||
| 53 : | // Create the new row. | ||
| 54 : | var oRow = this.Table.insertRow(-1) ; | ||
| 55 : | oRow.className = 'FolderListFolder' ; | ||
| 56 : | |||
| 57 : | // Build the link to view the folder. | ||
| 58 : | var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath + '\');return false;">' ; | ||
| 59 : | |||
| 60 : | // Add the folder icon cell. | ||
| 61 : | var oCell = oRow.insertCell(-1) ; | ||
| 62 : | oCell.width = 16 ; | ||
| 63 : | oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ; | ||
| 64 : | |||
| 65 : | // Add the folder name cell. | ||
| 66 : | oCell = oRow.insertCell(-1) ; | ||
| 67 : | oCell.noWrap = true ; | ||
| 68 : | oCell.innerHTML = ' ' + sLink + folderName + '</a>' ; | ||
| 69 : | |||
| 70 : | this.TableRows[ folderPath ] = oRow ; | ||
| 71 : | } | ||
| 72 : | |||
| 73 : | oListManager.ShowUpFolder = function( upFolderPath ) | ||
| 74 : | { | ||
| 75 : | this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' ) ; | ||
| 76 : | |||
| 77 : | if ( upFolderPath != null ) | ||
| 78 : | { | ||
| 79 : | document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function() | ||
| 80 : | { | ||
| 81 : | LoadFolders( upFolderPath ) ; | ||
| 82 : | return false ; | ||
| 83 : | } | ||
| 84 : | } | ||
| 85 : | } | ||
| 86 : | |||
| 87 : | function CheckLoaded() | ||
| 88 : | { | ||
| 89 : | if ( window.top.IsLoadedActualFolder | ||
| 90 : | && window.top.IsLoadedCreateFolder | ||
| 91 : | && window.top.IsLoadedUpload | ||
| 92 : | && window.top.IsLoadedResourcesList ) | ||
| 93 : | { | ||
| 94 : | window.clearInterval( iIntervalId ) ; | ||
| 95 : | bIsLoaded = true ; | ||
| 96 : | OpenFolder( sActiveFolder ) ; | ||
| 97 : | } | ||
| 98 : | } | ||
| 99 : | |||
| 100 : | function OpenFolder( folderPath ) | ||
| 101 : | { | ||
| 102 : | sActiveFolder = folderPath ; | ||
| 103 : | |||
| 104 : | if ( ! bIsLoaded ) | ||
| 105 : | { | ||
| 106 : | if ( ! iIntervalId ) | ||
| 107 : | iIntervalId = window.setInterval( CheckLoaded, 100 ) ; | ||
| 108 : | return ; | ||
| 109 : | } | ||
| 110 : | |||
| 111 : | // Change the style for the select row (to show the opened folder). | ||
| 112 : | for ( var sFolderPath in oListManager.TableRows ) | ||
| 113 : | { | ||
| 114 : | oListManager.TableRows[ sFolderPath ].className = | ||
| 115 : | ( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' ) ; | ||
| 116 : | } | ||
| 117 : | |||
| 118 : | // Set the current folder in all frames. | ||
| 119 : | window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ; | ||
| 120 : | window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ; | ||
| 121 : | window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ; | ||
| 122 : | |||
| 123 : | // Load the resources list for this folder. | ||
| 124 : | window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath ) ; | ||
| 125 : | } | ||
| 126 : | |||
| 127 : | function LoadFolders( folderPath ) | ||
| 128 : | { | ||
| 129 : | // Clear the folders list. | ||
| 130 : | oListManager.Clear() ; | ||
| 131 : | |||
| 132 : | // Get the parent folder path. | ||
| 133 : | var sParentFolderPath ; | ||
| 134 : | if ( folderPath != '/' ) | ||
| 135 : | sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 ) ; | ||
| 136 : | |||
| 137 : | // Show/Hide the Up Folder. | ||
| 138 : | oListManager.ShowUpFolder( sParentFolderPath ) ; | ||
| 139 : | |||
| 140 : | if ( folderPath != '/' ) | ||
| 141 : | { | ||
| 142 : | sActiveFolder = folderPath ; | ||
| 143 : | oConnector.CurrentFolder = sParentFolderPath | ||
| 144 : | oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ; | ||
| 145 : | } | ||
| 146 : | else | ||
| 147 : | { | ||
| 148 : | oListManager.ShowUpFolder( '/' ) ; | ||
| 149 : | sActiveFolder = folderPath ; | ||
| 150 : | oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ; | ||
| 151 : | } | ||
| 152 : | |||
| 153 : | } | ||
| 154 : | |||
| 155 : | function GetFoldersCallBack( fckXml ) | ||
| 156 : | { | ||
| 157 : | // Get the current folder path. | ||
| 158 : | var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ; | ||
| 159 : | var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ; | ||
| 160 : | |||
| 161 : | var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ; | ||
| 162 : | |||
| 163 : | for ( var i = 0 ; i < oNodes.length ; i++ ) | ||
| 164 : | { | ||
| 165 : | var sFolderName = oNodes[i].attributes.getNamedItem('name').value ; | ||
| 166 : | oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ; | ||
| 167 : | } | ||
| 168 : | |||
| 169 : | OpenFolder( sActiveFolder ) ; | ||
| 170 : | } | ||
| 171 : | |||
| 172 : | function SetResourceType( type ) | ||
| 173 : | { | ||
| 174 : | oConnector.ResourceType = type ; | ||
| 175 : | LoadFolders( '/' ) ; | ||
| 176 : | } | ||
| 177 : | |||
| 178 : | window.onload = function() | ||
| 179 : | { | ||
| 180 : | oListManager.Init() ; | ||
| 181 : | |||
| 182 : | if ( oConnector.ResourceType.length = 0 ) | ||
| 183 : | SetResourceType( 'File' ) ; | ||
| 184 : | else | ||
| 185 : | LoadFolders( '/' ) ; | ||
| 186 : | } | ||
| 187 : | </script> | ||
| 188 : | </head> | ||
| 189 : | <body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10"> | ||
| 190 : | <table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0"> | ||
| 191 : | <tr id="trUp" style="DISPLAY: none"> | ||
| 192 : | <td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td> | ||
| 193 : | <td nowrap width="100%"> <a id="linkUp" href="#">..</a></td> | ||
| 194 : | </tr> | ||
| 195 : | </table> | ||
| 196 : | </body> | ||
| 197 : | </html> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

