1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
22
* This page shows the list of folders available in the parent folder
23
* of the current folder.
27
<link href="browser.css" type="text/css" rel="stylesheet">
28
<script type="text/javascript" src="js/common.js"></script>
29
<script language="javascript">
33
var bIsLoaded = false ;
36
var oListManager = new Object() ;
38
oListManager.Init = function()
40
this.Table = document.getElementById('tableFiles') ;
41
this.UpRow = document.getElementById('trUp') ;
43
this.TableRows = new Object() ;
46
oListManager.Clear = function()
48
// Remove all other rows available.
49
while ( this.Table.rows.length > 1 )
50
this.Table.deleteRow(1) ;
52
// Reset the TableRows collection.
53
this.TableRows = new Object() ;
56
oListManager.AddItem = function( folderName, folderPath )
58
// Create the new row.
59
var oRow = this.Table.insertRow(-1) ;
60
oRow.className = 'FolderListFolder' ;
62
// Build the link to view the folder.
63
var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath + '\');return false;">' ;
65
// Add the folder icon cell.
66
var oCell = oRow.insertCell(-1) ;
68
oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ;
70
// Add the folder name cell.
71
oCell = oRow.insertCell(-1) ;
73
oCell.innerHTML = ' ' + sLink + folderName + '</a>' ;
75
this.TableRows[ folderPath ] = oRow ;
78
oListManager.ShowUpFolder = function( upFolderPath )
80
this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' ) ;
82
if ( upFolderPath != null )
84
document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
86
LoadFolders( upFolderPath ) ;
92
function CheckLoaded()
94
if ( window.top.IsLoadedActualFolder
95
&& window.top.IsLoadedCreateFolder
96
&& window.top.IsLoadedUpload
97
&& window.top.IsLoadedResourcesList )
99
window.clearInterval( iIntervalId ) ;
101
OpenFolder( sActiveFolder ) ;
105
function OpenFolder( folderPath )
107
sActiveFolder = folderPath ;
112
iIntervalId = window.setInterval( CheckLoaded, 100 ) ;
116
// Change the style for the select row (to show the opened folder).
117
for ( var sFolderPath in oListManager.TableRows )
119
oListManager.TableRows[ sFolderPath ].className =
120
( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' ) ;
123
// Set the current folder in all frames.
124
window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
125
window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
126
window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
128
// Load the resources list for this folder.
129
window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath ) ;
132
function LoadFolders( folderPath )
134
// Clear the folders list.
135
oListManager.Clear() ;
137
// Get the parent folder path.
138
var sParentFolderPath ;
139
if ( folderPath != '/' )
140
sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 ) ;
142
// Show/Hide the Up Folder.
143
oListManager.ShowUpFolder( sParentFolderPath ) ;
145
if ( folderPath != '/' )
147
sActiveFolder = folderPath ;
148
oConnector.CurrentFolder = sParentFolderPath ;
149
oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ;
155
function GetFoldersCallBack( fckXml )
157
if ( oConnector.CheckError( fckXml ) != 0 )
160
// Get the current folder path.
161
var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
162
var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
164
var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
166
for ( var i = 0 ; i < oNodes.length ; i++ )
168
var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
169
oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + '/' ) ;
172
OpenFolder( sActiveFolder ) ;
175
function SetResourceType( type )
177
oConnector.ResourceType = type ;
181
window.onload = function()
183
oListManager.Init() ;
188
<body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10">
189
<table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
190
<tr id="trUp" style="DISPLAY: none">
191
<td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td>
192
<td nowrap width="100%"> <a id="linkUp" href="#">..</a></td>
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
22
* This page shows the list of folders available in the parent folder
23
* of the current folder.
27
<link href="browser.css" type="text/css" rel="stylesheet">
28
<script type="text/javascript" src="js/common.js"></script>
29
<script language="javascript">
33
var bIsLoaded = false ;
36
var oListManager = new Object() ;
38
oListManager.Init = function()
40
this.Table = document.getElementById('tableFiles') ;
41
this.UpRow = document.getElementById('trUp') ;
43
this.TableRows = new Object() ;
46
oListManager.Clear = function()
48
// Remove all other rows available.
49
while ( this.Table.rows.length > 1 )
50
this.Table.deleteRow(1) ;
52
// Reset the TableRows collection.
53
this.TableRows = new Object() ;
56
oListManager.AddItem = function( folderName, folderPath )
58
// Create the new row.
59
var oRow = this.Table.insertRow(-1) ;
60
oRow.className = 'FolderListFolder' ;
62
// Build the link to view the folder.
63
var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath + '\');return false;">' ;
65
// Add the folder icon cell.
66
var oCell = oRow.insertCell(-1) ;
68
oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ;
70
// Add the folder name cell.
71
oCell = oRow.insertCell(-1) ;
73
oCell.innerHTML = ' ' + sLink + folderName + '</a>' ;
75
this.TableRows[ folderPath ] = oRow ;
78
oListManager.ShowUpFolder = function( upFolderPath )
80
this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' ) ;
82
if ( upFolderPath != null )
84
document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
86
LoadFolders( upFolderPath ) ;
92
function CheckLoaded()
94
if ( window.top.IsLoadedActualFolder
95
&& window.top.IsLoadedCreateFolder
96
&& window.top.IsLoadedUpload
97
&& window.top.IsLoadedResourcesList )
99
window.clearInterval( iIntervalId ) ;
101
OpenFolder( sActiveFolder ) ;
105
function OpenFolder( folderPath )
107
sActiveFolder = folderPath ;
112
iIntervalId = window.setInterval( CheckLoaded, 100 ) ;
116
// Change the style for the select row (to show the opened folder).
117
for ( var sFolderPath in oListManager.TableRows )
119
oListManager.TableRows[ sFolderPath ].className =
120
( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' ) ;
123
// Set the current folder in all frames.
124
window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
125
window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
126
window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
128
// Load the resources list for this folder.
129
window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath ) ;
132
function LoadFolders( folderPath )
134
// Clear the folders list.
135
oListManager.Clear() ;
137
// Get the parent folder path.
138
var sParentFolderPath ;
139
if ( folderPath != '/' )
140
sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 ) ;
142
// Show/Hide the Up Folder.
143
oListManager.ShowUpFolder( sParentFolderPath ) ;
145
if ( folderPath != '/' )
147
sActiveFolder = folderPath ;
148
oConnector.CurrentFolder = sParentFolderPath ;
149
oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ;
155
function GetFoldersCallBack( fckXml )
157
if ( oConnector.CheckError( fckXml ) != 0 )
160
// Get the current folder path.
161
var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
162
var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
164
var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
166
for ( var i = 0 ; i < oNodes.length ; i++ )
168
var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
169
oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + '/' ) ;
172
OpenFolder( sActiveFolder ) ;
175
function SetResourceType( type )
177
oConnector.ResourceType = type ;
181
window.onload = function()
183
oListManager.Init() ;
188
<body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10">
189
<table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
190
<tr id="trUp" style="DISPLAY: none">
191
<td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td>
192
<td nowrap width="100%"> <a id="linkUp" href="#">..</a></td>