导航

使用FCKeditor 编辑器。

Posted on 2008-09-27 18:47  Niko  阅读(390)  评论(0)    收藏  举报

今天有用到FCKeditor, 只是简单的使用,没有深入研究。

1。 下载FCKeditorhttp://www.fckeditor.net/demo), 解压后将fckeditor拷贝到你的项目中(当然你可以单独放在一个地方),

2。 下载用户控件包FCKeditor.Net或FCKeditor.Java。解压后将bin->release下的dll添加到你的项目中, 同时添加到工具栏中, 现在你就可以像使用其他控件一样适用它了.

  <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="~/FCKeditor/"> //注意要加这个path
        </FCKeditorV2:FCKeditor>

3. 现在你运行你的项目, 就可以看到边记起了,我们可以改变语言和工具栏的设置,

fckconfig.js

FCKConfig.AutoDetectLanguage = false ;//如果为true 会是本地语言 ,如果是false 你可以自己设置DefaultLanguage  = 'en' ;
FCKConfig.DefaultLanguage  = 'en' ;
FCKConfig.ContentLangDirection = 'ltr' ;

 

//选择那些工具栏
FCKConfig.ToolbarSets["Default"] = [
 ['Style','FontFormat','FontName','FontSize'],
 ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
 ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'],
 ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck']
 //,
// ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
// 
// ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
// ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
// '/',
// 
// 
// ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
// ['Link','Unlink','Anchor'],
// ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
// '/',
// 
// ['TextColor','BGColor'],
// ['FitWindow','ShowBlocks','-','About']  // No comma for the last row.
] ;

 

设置工具栏的背景色

skins->default->fck_edit.css or skins->office2003->fck_edit.css or skins->silver->fck_edit.css

.TB_ToolbarSet, .TB_Expand, .TB_Collapse
{
    cursor: default;
 background-color: #E8EEF7;
}