用过FckEditor的朋友都知道,它的选择图片对话框中“浏览服务器”按钮。点击该按钮可以浏览以前已经上传过的文件。不过这个按钮点击后弹出的对话框在MAXTHON浏览器下是以标签形式打开的,这样模态对话框就始终显示在了浏览文件窗口之前,要想选择文件得先关掉模态对话框。先前有朋友提出把弹出模态对话框的功能改为ShowModlessDialog,这个终究不是解决之道,现将我的解决方法写下来与大家分享:
思路就是基于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() ;
}
}
分享到:
相关推荐
fckeditor编辑器文件及dll打包 fckeditor编辑器文件及dll打包 fckeditor编辑器文件及dll打包
实际上,需要对FCKeditor编辑器文件组中的通用配置文件/fckconfig.js和ASP.NET专用文件上传管理代码文件/editor/filemanager/connectors/aspx/config.ascx进行配置。 1. 配置控件语言 FCKeditor是自动探测浏览器...
免费的FCKeditor编辑器2.63(解决无法上传文件)asp.net在线编辑器! 已经解决无法上传文件(停留在上传过程的进度条问题)!!
FCKeditor编辑器hwp363FCKeditor编辑器hwp363FCKeditor编辑器hwp363 FCKeditor编辑器hwp363FCKeditor编辑器hwp363 FCKeditor编辑器hwp363
实际上,需要对FCKeditor编辑器文件组中的通用配置文件/fckconfig.js和ASP.NET专用文件上传管理代码文件/editor/filemanager/connectors/aspx/config.ascx进行配置。 1. 配置控件语言 FCKeditor是自动探测浏览器所...
Asp.Net FCKeditor编辑器的用法详解
FckEditor在线编辑器FckEditor在线编辑器FckEditor在线编辑器
fckEditor 编辑器源码fckEditor 编辑器源码fckEditor 编辑器源码fckEditor 编辑器源码fckEditor 编辑器源码fckEditor 编辑器源码
fckeditor在线文本编辑器, 可嵌入javascript中,用于页面文字、表情编辑,上传文件等,方便实用
HTML 文本编辑器FCKeditorHTML 文本编辑器FCKeditorHTML 文本编辑器FCKeditor
fckeditor编辑器自定义按钮,弹出页面,返回数据添加到fck编辑器
FCKeditor 是目前最优秀的可见即可得网页编辑器之一,它采用JavaScript编写。具备功能强大、配置容易、跨浏览器、支持多种编程语 言、开源等特点。它非常流行,互联网上很容易找到相关技术文档,国内许多WEB项目和...
只需把文中的代码拷进去,就可实现编辑器的效果,如过不实现文件上传功能,不用导包,很实用,友情提示:刚开始弄fckeditor时,务必注意路径的配置
你也许会问为什么要设置成/test/uploads这样而不是~/uploads,因为FCKeditor使用这个值来返回你上传后的文件的相对路径到客户端,~/uploads的形式是ASP.NET在服务可以编译解释的,但是在客户端的静态就不懂这是什么...
fckeditor编辑器上传得不到路径的解决方法
fckeditor编辑器添加swfupload功能
ThinkPHP中FCKeditor编辑器的使用 前段时间一直为TP寻找好用的在线编辑器而苦恼,经过多次尝试与修改后,终于成功地将编辑器集成到Thinkphp里面。 而且可以用直接上传和ajax两种方式处理内容。为了给一些还没能成功...
fckeditor 用于web页面开发的文档编辑插件,非常方便使用。
在SSH项目中整合FCKeditor文本编辑器技术