Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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