<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
<!--\r
* FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben\r
*\r
* == BEGIN LICENSE ==\r
*\r
*\r
* This page shows all resources available in a folder in the File Browser.\r
-->\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
+<html>\r
<head>\r
- <link href="browser.css" type="text/css" rel="stylesheet" />\r
+ <title>Resources</title>\r
+ <link href="browser.css" type="text/css" rel="stylesheet">\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
<script type="text/javascript" src="js/common.js"></script>\r
<script type="text/javascript">\r
\r
document.body.innerHTML = '' ;\r
}\r
\r
+function ProtectPath(path)\r
+{\r
+ path = path.replace( /\\/g, '\\\\') ;\r
+ path = path.replace( /'/g, '\\\'') ;\r
+ return path ;\r
+}\r
+\r
oListManager.GetFolderRowHtml = function( folderName, folderPath )\r
{\r
// Build the link to view the folder.\r
- var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ;\r
+ var sLink = '<a href="#" onclick="OpenFolder(\'' + ProtectPath( folderPath ) + '\');return false;">' ;\r
\r
return '<tr>' +\r
'<td width="16">' +\r
sLink +\r
- '<img alt="" src="images/Folder.gif" width="16" height="16" border="0"></a>' +\r
- '</td><td nowrap colspan="2"> ' +\r
+ '<img alt="" src="images/Folder.gif" width="16" height="16" border="0"><\/a>' +\r
+ '<\/td><td nowrap colspan="2"> ' +\r
sLink +\r
folderName +\r
- '</a>' +\r
- '</td></tr>' ;\r
+ '<\/a>' +\r
+ '<\/td><\/tr>' ;\r
}\r
\r
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )\r
{\r
// Build the link to view the folder.\r
- var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;\r
+ var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( fileUrl ) + '\');return false;">' ;\r
\r
// Get the file icon.\r
var sIcon = oIcons.GetIcon( fileName ) ;\r
return '<tr>' +\r
'<td width="16">' +\r
sLink +\r
- '<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' +\r
- '</td><td> ' +\r
+ '<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"><\/a>' +\r
+ '<\/td><td> ' +\r
sLink +\r
fileName +\r
- '</a>' +\r
- '</td><td align="right" nowrap> ' +\r
+ '<\/a>' +\r
+ '<\/td><td align="right" nowrap> ' +\r
fileSize +\r
' KB' +\r
- '</td></tr>' ;\r
+ '<\/td><\/tr>' ;\r
}\r
\r
function OpenFolder( folderPath )\r
\r
function OpenFile( fileUrl )\r
{\r
- window.top.opener.SetUrl( encodeURI( fileUrl ) ) ;\r
+ window.top.opener.SetUrl( fileUrl ) ;\r
window.top.close() ;\r
window.top.opener.focus() ;\r
}\r
\r
// Get the optional "url" attribute. If not available, build the url.\r
var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ;\r
- var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ;\r
+ var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : encodeURI( sCurrentFolderUrl + sFileName ).replace( /#/g, '%23' ) ;\r
\r
oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ;\r
}\r
}\r
</script>\r
</head>\r
-<body class="FileArea" bottommargin="10" leftmargin="10" topmargin="10" rightmargin="10">\r
+<body class="FileArea">\r
</body>\r
</html>\r