分类: Java
2008-04-02 13:22:18
: | ||||
function OpenFileBrowser( url, width, height )
{
// oEditor must be defined.
var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ;
var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
var sOptions = "toolbar=no,status=no,resizable=no,dependent=yes,scrollbars=yes" ;
sOptions += ",width=" + width ;
sOptions += ",height=" + height ;
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
// The "PreserveSessionOnFileBrowser" because the above code could be
// blocked by popup blockers.
if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
{
// The following change has been made otherwise IE will open the file
// browser on a different server session (on some cases):
//
// by Simone Chiaretta.
var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
if ( oWindow )
{
// Detect Yahoo popup blocker.
try
{
var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
oWindow.opener = window ;
}
catch(e)
{
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
}
else
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
else
{
//这里是修改部分
if(oEditor.FCKBrowserInfo.IsIE)
{
window.showModalDialog(url+"&rdm="+new Date(),window,"status:false;dialogWidth:"+width+"px;dialogHeight:"+height+"px\"");
}
else
{
window.open( url, 'FCKBrowseWindow', sOptions ) ;
}
}
}