浏览 3012 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-10-26
思路就是基于IE内核的浏览器采用模态对话框弹出浏览服务器窗口,其他的仍然window.open不变1:修改\fckeditor\editor\dialog\common\fck_dialog_common.js 1 function OpenFileBrowser( url, width, height )
2 { 3 // oEditor must be defined. 4 5 var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ; 6 var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ; 7 8 var sOptions = "toolbar=no,status=no,resizable=no,dependent=yes,scrollbars=yes" ; 9 sOptions += ",width=" + width ; 10 sOptions += ",height=" + height ; 11 sOptions += ",left=" + iLeft ; 12 sOptions += ",top=" + iTop ; 13 14 // The "PreserveSessionOnFileBrowser" because the above code could be 15 // blocked by popup blockers. 16 if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE ) 17 { 18 // The following change has been made otherwise IE will open the file 19 // browser on a different server session (on some cases): 20 // http://support.microsoft.com/default.aspx?scid=kb;en-us;831678 21 // by Simone Chiaretta. 22 var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ; 23 24 if ( oWindow ) 25 { 26 // Detect Yahoo popup blocker. 27 try 28 { 29 var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user. 30 oWindow.opener = window ; 31 } 32 catch(e) 33 { 34 alert( oEditor.FCKLang.BrowseServerBlocked ) ; 35 } 36 } 37 else 38 alert( oEditor.FCKLang.BrowseServerBlocked ) ; 39 } 40 else 41 { //这里是修改部分 42 if(oEditor.FCKBrowserInfo.IsIE) 43 { 44 window.showModalDialog(url+"&rdm="+new Date(),window,"status:false;dialogWidth:"+width+"px;dialogHeight:"+height+"px\""); 45 } 46 else 47 { 48 window.open( url, 'FCKBrowseWindow', sOptions ) ; 49 } 50 } 51 } 2:修改\fckeditor\editor\filemanager\browser\default\frmresourceslist.html function OpenFile( fileUrl )
{ if( window.dialogArguments) { window.dialogArguments.SetUrl( fileUrl ) ; window.close() ; window.dialogArguments.focus() ; } else { window.top.opener.SetUrl( fileUrl ) ; window.top.close() ; window.top.opener.focus() ; } } 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-10-26
修改之后对于其他浏览器受不受不影响???
|
|
返回顶楼 | |