您的位置:首页 > 其它

FCKEditor文字编辑控件使用有感

2008-11-21 11:18 302 查看
在一个Web2.0的项目中需要让用户对录入的文字和图片进行相关Office中Word一样的排版和编辑处理,所以使用了FCKEditor控件(版本为:2.6.1),以下为我处理的一些感想。

FCKEditor的详细设置

1 fckconfig.js中修改
FCKConfig.ToolbarSets["Default"]= [

['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],

['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],

['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],

['Link','Unlink','Anchor'],

['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],

'/',

['Style','FontFormat','FontName','FontSize'],

['TextColor','BGColor'],

['FitWindow','ShowBlocks','-','About']
// No comma for the last row.
];
还修改以下内容,适合ASP.NET使用:
FCKConfig.DefaultLanguage
= 'zh-cn';
// 'en'
var _FileBrowserLanguage
= 'aspx' ;
// asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage
= 'aspx' ;
// asp | aspx | cfm | lasso | perl | php | py
2 在项目中引入FCKEditor控件相关的DLL文件
DLL文件下载地址:
http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=137125
3 在工具栏中引入FCKEditor控件的DLL文件
4 修改/配置FCKEditor控件上传路径
在FCKeditor/editor/filemanager/connectors/aspx/config.aspx中修改

privatebool CheckAuthentication()

{

//WARNING : DO NOT simply return "true". By doing so, you are allowing

//"anyone" to upload and list the files in your server. You mustimplement

//some kind of session validation here. Even something very simple as...

//

// return ( Session["IsAuthorized" ] != null && (bool)Session["IsAuthorized" ] == true );

//

//... where Session[ "IsAuthorized" ] is set to "true" assoon as the

//user logs in your system.

returntrue;
// false;

}
在SetConfig()函数中设置
UserFilesPath =
"~/Upload/FCKEditor/"
//FCKEditor控件上传路径

我写的Demo地址如下:
http://download.csdn.net/detail/GodHeaven/794932 http://download.csdn.net/source/794932
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: