1,25 → 1,31 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- |
* FCKeditor - The text editor for internet |
* Copyright (C) 2003-2006 Frederico Caldeira Knabben |
* |
* Licensed under the terms of the GNU Lesser General Public License: |
* http://www.opensource.org/licenses/lgpl-license.php |
* |
* For further information visit: |
* http://www.fckeditor.net/ |
* |
* "Support Open Source software. What about a donation today?" |
* |
* File Name: frmresourceslist.html |
* This page shows all resources available in a folder in the File Browser. |
* |
* File Authors: |
* Frederico Caldeira Knabben (fredck@fckeditor.net) |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
* |
* == BEGIN LICENSE == |
* |
* Licensed under the terms of any of the following licenses at your |
* choice: |
* |
* - GNU General Public License Version 2 or later (the "GPL") |
* http://www.gnu.org/licenses/gpl.html |
* |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
* http://www.gnu.org/licenses/lgpl.html |
* |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
* http://www.mozilla.org/MPL/MPL-1.1.html |
* |
* == END LICENSE == |
* |
* This page shows all resources available in a folder in the File Browser. |
--> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<html> |
<head> |
<link href="browser.css" type="text/css" rel="stylesheet" /> |
<title>Resources</title> |
<link href="browser.css" type="text/css" rel="stylesheet"> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<script type="text/javascript" src="js/common.js"></script> |
<script type="text/javascript"> |
|
30,26 → 36,33 |
document.body.innerHTML = '' ; |
} |
|
function ProtectPath(path) |
{ |
path = path.replace( /\\/g, '\\\\') ; |
path = path.replace( /'/g, '\\\'') ; |
return path ; |
} |
|
oListManager.GetFolderRowHtml = function( folderName, folderPath ) |
{ |
// Build the link to view the folder. |
var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ; |
var sLink = '<a href="#" onclick="OpenFolder(\'' + ProtectPath( folderPath ) + '\');return false;">' ; |
|
return '<tr>' + |
'<td width="16">' + |
sLink + |
'<img alt="" src="images/Folder.gif" width="16" height="16" border="0"></a>' + |
'</td><td nowrap colspan="2"> ' + |
sLink + |
folderName + |
'</a>' + |
'</td></tr>' ; |
'<img alt="" src="images/Folder.gif" width="16" height="16" border="0"><\/a>' + |
'<\/td><td nowrap colspan="2"> ' + |
sLink + |
folderName + |
'<\/a>' + |
'<\/td><\/tr>' ; |
} |
|
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize ) |
{ |
// Build the link to view the folder. |
var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ; |
var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( fileUrl ) + '\');return false;">' ; |
|
// Get the file icon. |
var sIcon = oIcons.GetIcon( fileName ) ; |
56,16 → 69,16 |
|
return '<tr>' + |
'<td width="16">' + |
sLink + |
'<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' + |
'</td><td> ' + |
sLink + |
fileName + |
'</a>' + |
'</td><td align="right" nowrap> ' + |
fileSize + |
sLink + |
'<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"><\/a>' + |
'<\/td><td> ' + |
sLink + |
fileName + |
'<\/a>' + |
'<\/td><td align="right" nowrap> ' + |
fileSize + |
' KB' + |
'</td></tr>' ; |
'<\/td><\/tr>' ; |
} |
|
function OpenFolder( folderPath ) |
76,7 → 89,7 |
|
function OpenFile( fileUrl ) |
{ |
window.top.opener.SetUrl( fileUrl ) ; |
window.top.opener.SetUrl( encodeURI( fileUrl ).replace( '#', '%23' ) ) ; |
window.top.close() ; |
window.top.opener.focus() ; |
} |
100,16 → 113,22 |
return ; |
|
// Get the current folder path. |
var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ; |
var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ; |
var sCurrentFolderUrl = oNode.attributes.getNamedItem('url').value ; |
var oFolderNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ; |
if ( oFolderNode == null ) |
{ |
alert( 'The server didn\'t reply with a proper XML data. Please check your configuration.' ) ; |
return ; |
} |
var sCurrentFolderPath = oFolderNode.attributes.getNamedItem('path').value ; |
var sCurrentFolderUrl = oFolderNode.attributes.getNamedItem('url').value ; |
|
// var dTimer = new Date() ; |
|
var oHtml = new StringBuilder( '<table id="tableFiles" cellspacing="1" cellpadding="0" width="100%" border="0">' ) ; |
|
// Add the Folders. |
var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ; |
// Add the Folders. |
var oNodes ; |
oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ; |
for ( var i = 0 ; i < oNodes.length ; i++ ) |
{ |
var sFolderName = oNodes[i].attributes.getNamedItem('name').value ; |
116,23 → 135,23 |
oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ; |
} |
|
// Add the Files. |
var oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ; |
for ( var i = 0 ; i < oNodes.length ; i++ ) |
// Add the Files. |
oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ; |
for ( var j = 0 ; j < oNodes.length ; j++ ) |
{ |
var oNode = oNodes[i] ; |
var oNode = oNodes[j] ; |
var sFileName = oNode.attributes.getNamedItem('name').value ; |
var sFileSize = oNode.attributes.getNamedItem('size').value ; |
|
// Get the optional "url" attribute. If not available, build the url. |
var oFileUrlAtt = oNodes[i].attributes.getNamedItem('url') ; |
var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ; |
var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ; |
|
|
oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ; |
} |
|
oHtml.Append( '</table>' ) ; |
|
oHtml.Append( '<\/table>' ) ; |
|
document.body.innerHTML = oHtml.ToString() ; |
|
// window.top.document.title = 'Finished processing in ' + ( ( ( new Date() ) - dTimer ) / 1000 ) + ' seconds' ; |
145,6 → 164,6 |
} |
</script> |
</head> |
<body class="FileArea" bottommargin="10" leftmargin="10" topmargin="10" rightmargin="10"> |
<body class="FileArea"> |
</body> |
</html> |