Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1921
Line 1... Line 1...
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<!--
2
<!--
3
 * FCKeditor - The text editor for internet
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
4
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
-
 
5
 *
-
 
6
 * == BEGIN LICENSE ==
5
 * 
7
 *
6
 * Licensed under the terms of the GNU Lesser General Public License:
8
 * Licensed under the terms of any of the following licenses at your
7
 * 		http://www.opensource.org/licenses/lgpl-license.php
9
 * choice:
8
 * 
10
 *
9
 * For further information visit:
11
 *  - GNU General Public License Version 2 or later (the "GPL")
10
 * 		http://www.fckeditor.net/
12
 *    http://www.gnu.org/licenses/gpl.html
11
 * 
13
 *
12
 * "Support Open Source software. What about a donation today?"
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
-
 
15
 *    http://www.gnu.org/licenses/lgpl.html
13
 * 
16
 *
14
 * File Name: frmresourceslist.html
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
15
 * 	This page shows all resources available in a folder in the File Browser.
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
16
 * 
19
 *
17
 * File Authors:
20
 * == END LICENSE ==
-
 
21
 *
18
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
22
 * This page shows all resources available in a folder in the File Browser.
19
-->
23
-->
20
<html xmlns="http://www.w3.org/1999/xhtml">
24
<html>
21
<head>
25
<head>
-
 
26
	<title>Resources</title>
22
	<link href="browser.css" type="text/css" rel="stylesheet" />
27
	<link href="browser.css" type="text/css" rel="stylesheet">
-
 
28
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
23
	<script type="text/javascript" src="js/common.js"></script>
29
	<script type="text/javascript" src="js/common.js"></script>
24
	<script type="text/javascript">
30
	<script type="text/javascript">
Line 25... Line 31...
25
 
31
 
Line 26... Line 32...
26
var oListManager = new Object() ;
32
var oListManager = new Object() ;
27
 
33
 
28
oListManager.Clear = function()
34
oListManager.Clear = function()
29
{
35
{
Line -... Line 36...
-
 
36
	document.body.innerHTML = '' ;
-
 
37
}
-
 
38
 
-
 
39
function ProtectPath(path)
-
 
40
{
-
 
41
	path = path.replace( /\\/g, '\\\\') ;
-
 
42
	path = path.replace( /'/g, '\\\'') ;
30
	document.body.innerHTML = '' ;
43
	return path ;
31
}
44
}
32
 
45
 
33
oListManager.GetFolderRowHtml = function( folderName, folderPath )
46
oListManager.GetFolderRowHtml = function( folderName, folderPath )
Line 34... Line 47...
34
{
47
{
35
	// Build the link to view the folder.
48
	// Build the link to view the folder.
36
	var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ;
49
	var sLink = '<a href="#" onclick="OpenFolder(\'' + ProtectPath( folderPath ) + '\');return false;">' ;
37
 
50
 
38
	return '<tr>' +
51
	return '<tr>' +
39
			'<td width="16">' +
52
			'<td width="16">' +
40
				sLink +
53
				sLink +
41
				'<img alt="" src="images/Folder.gif" width="16" height="16" border="0"></a>' +
54
				'<img alt="" src="images/Folder.gif" width="16" height="16" border="0"><\/a>' +
42
			'</td><td nowrap colspan="2">&nbsp;' +
55
			'<\/td><td nowrap colspan="2">&nbsp;' +
43
				sLink + 
56
				sLink +
Line 44... Line 57...
44
				folderName + 
57
				folderName +
45
				'</a>' +
58
				'<\/a>' +
46
		'</td></tr>' ;
59
		'<\/td><\/tr>' ;
47
}
60
}
Line 48... Line 61...
48
 
61
 
49
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
62
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
Line 50... Line 63...
50
{
63
{
51
	// Build the link to view the folder.
64
	// Build the link to view the folder.
52
	var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;
65
	var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( fileUrl ) + '\');return false;">' ;
53
 
66
 
54
	// Get the file icon.
67
	// Get the file icon.
55
	var sIcon = oIcons.GetIcon( fileName ) ;
68
	var sIcon = oIcons.GetIcon( fileName ) ;
56
 
69
 
57
	return '<tr>' +
70
	return '<tr>' +
58
			'<td width="16">' +
71
			'<td width="16">' +
59
				sLink + 
72
				sLink +
60
				'<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' +
73
				'<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"><\/a>' +
61
			'</td><td>&nbsp;' +
74
			'<\/td><td>&nbsp;' +
62
				sLink + 
75
				sLink +
Line 63... Line 76...
63
				fileName + 
76
				fileName +
64
				'</a>' +
77
				'<\/a>' +
65
			'</td><td align="right" nowrap>&nbsp;' +
78
			'<\/td><td align="right" nowrap>&nbsp;' +
66
				fileSize + 
79
				fileSize +
67
				' KB' +
80
				' KB' +
Line 68... Line 81...
68
		'</td></tr>' ;
81
		'<\/td><\/tr>' ;
69
}
82
}
70
 
83
 
71
function OpenFolder( folderPath )
84
function OpenFolder( folderPath )
72
{
85
{
73
	// Load the resources list for this folder.
86
	// Load the resources list for this folder.
Line 74... Line 87...
74
	window.parent.frames['frmFolders'].LoadFolders( folderPath ) ;
87
	window.parent.frames['frmFolders'].LoadFolders( folderPath ) ;
Line 98... Line 111...
98
{
111
{
99
	if ( oConnector.CheckError( fckXml ) != 0 )
112
	if ( oConnector.CheckError( fckXml ) != 0 )
100
		return ;
113
		return ;
Line 101... Line 114...
101
 
114
 
102
	// Get the current folder path.
115
	// Get the current folder path.
-
 
116
	var oFolderNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
-
 
117
	if ( oFolderNode == null )
-
 
118
	{
-
 
119
		alert( 'The server didn\'t reply with a proper XML data. Please check your configuration.' ) ;
-
 
120
		return ;
103
	var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
121
	}
104
	var sCurrentFolderPath	= oNode.attributes.getNamedItem('path').value ;
122
	var sCurrentFolderPath	= oFolderNode.attributes.getNamedItem('path').value ;
Line 105... Line 123...
105
	var sCurrentFolderUrl	= oNode.attributes.getNamedItem('url').value ;
123
	var sCurrentFolderUrl	= oFolderNode.attributes.getNamedItem('url').value ;
Line 106... Line 124...
106
 
124
 
Line 107... Line 125...
107
//	var dTimer = new Date() ;
125
//	var dTimer = new Date() ;
-
 
126
 
108
 
127
	var oHtml = new StringBuilder( '<table id="tableFiles" cellspacing="1" cellpadding="0" width="100%" border="0">' ) ;
109
	var oHtml = new StringBuilder( '<table id="tableFiles" cellspacing="1" cellpadding="0" width="100%" border="0">' ) ;
128
 
110
 
129
	// Add the Folders.
111
	// Add the Folders.	
130
	var oNodes ;
112
	var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
131
	oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
113
	for ( var i = 0 ; i < oNodes.length ; i++ )
132
	for ( var i = 0 ; i < oNodes.length ; i++ )
Line 114... Line 133...
114
	{
133
	{
115
		var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
134
		var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
116
		oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ;
135
		oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ;
117
	}
136
	}
118
 
137
 
119
	// Add the Files.	
138
	// Add the Files.
120
	var oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ;
139
	oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ;
Line 121... Line 140...
121
	for ( var i = 0 ; i < oNodes.length ; i++ )
140
	for ( var j = 0 ; j < oNodes.length ; j++ )
122
	{
141
	{
123
		var oNode = oNodes[i] ;
142
		var oNode = oNodes[j] ;
124
		var sFileName = oNode.attributes.getNamedItem('name').value ;
143
		var sFileName = oNode.attributes.getNamedItem('name').value ;
125
		var sFileSize = oNode.attributes.getNamedItem('size').value ;
144
		var sFileSize = oNode.attributes.getNamedItem('size').value ;
126
 
145
 
Line 127... Line 146...
127
		// Get the optional "url" attribute. If not available, build the url.
146
		// Get the optional "url" attribute. If not available, build the url.
128
		var oFileUrlAtt = oNodes[i].attributes.getNamedItem('url') ;
147
		var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ;
129
		var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ;
148
		var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ;
Line 130... Line 149...
130
		
149
 
Line 131... Line 150...
131
		oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ;
150
		oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ;
Line 143... Line 162...
143
{
162
{
144
	window.top.IsLoadedResourcesList = true ;
163
	window.top.IsLoadedResourcesList = true ;
145
}
164
}
146
	</script>
165
	</script>
147
</head>
166
</head>
148
<body class="FileArea" bottommargin="10" leftmargin="10" topmargin="10" rightmargin="10">
167
<body class="FileArea">
149
</body>
168
</body>
150
</html>
169
</html>