不说废话;先看效果啊。。。
改进后的如下。。。
改进代码:找到这个路径 fckeditor/editor/filemanager/browser/default/frmresourceslist.html HTML文件。
然后复制一下代码:全部替换掉就OK了 。。。。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<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">
var oListManager = new Object() ;
oListManager.Clear = function()
{
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="#" οnclick="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>' ;
}
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
{
// Build the link to view the folder.
var sLink = '<a href="#" οnclick="OpenFile(/'' + ProtectPath( fileUrl ) + '/');return false;">' ;
// Get the file icon.
var sIcon = oIcons.GetIcon( fileName ) ;
return '<tr>' +
'<td width="16">' +
sLink +
'<//a>' +
'<//td><td> ' +
sLink +
fileName +
'<//a>' +
'<//td><td align="right" nowrap> <br />' +
fileSize +
' KB' +
'<//td><//tr>' ;
}
function OpenFolder( folderPath )
{
// Load the resources list for this folder.
window.parent.frames['frmFolders'].LoadFolders( folderPath ) ;
}
function OpenFile( fileUrl )
{
window.top.opener.SetUrl( encodeURI( fileUrl ).replace( '#', '%23' ) ) ;
window.top.close() ;
window.top.opener.focus() ;
}
function LoadResources( resourceType, folderPath )
{
oListManager.Clear() ;
oConnector.ResourceType = resourceType ;
oConnector.CurrentFolder = folderPath ;
oConnector.SendCommand( 'GetFoldersAndFiles', null, GetFoldersAndFilesCallBack ) ;
}
function Refresh()
{
LoadResources( oConnector.ResourceType, oConnector.CurrentFolder ) ;
}
function GetFoldersAndFilesCallBack( fckXml )
{
if ( oConnector.CheckError( fckXml ) != 0 )
return ;
// Get the current folder path.
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 imgs=new StringBuilder();
var oHtml = new StringBuilder( '<div>' ) ;
// 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 ;
oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ;
}
// Add the Files.
oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ;
var zwy;
for ( var j = 0 ; j < oNodes.length ; j++ )
{
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[j].attributes.getNamedItem('url') ;
var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ;
zwy="<img border='0' οnmοuseοver='javascript:over(this)' οnmοuseοut='javascript:out(this)' src='../../../../../.../../Upload/FCKEditor/image/"+sFileName+"' width='50px' height='50px'/><br> "+sFileName+"";
oHtml.Append( "<div style='margin-top:5px;margin-left:5px; border-left:1px solid Green; border-right:1px solid Green; border-top:1px solid Green; border-bottom:1px solid Green'>"+oListManager.GetFileRowHtml( zwy, sFileUrl, sFileSize )+"</div>" ) ;
}
oHtml.Append( '</div>' ) ;
document.body.innerHTML = oHtml.ToString();
// window.top.document.title = 'Finished processing in ' + ( ( ( new Date() ) - dTimer ) / 1000 ) + ' seconds' ;
}
window.onload = function()
{
window.top.IsLoadedResourcesList = true ;
}
function over(obj)
{
obj.style.width="100px";
obj.style.height="100px";
}
function out(obj)
{
obj.style.width="50px";
obj.style.height="50px";
}
</script>
</head>
<body class="FileArea">
</body>
</html>