FCKEditor工具条定制

FCkEditor确实是一个非常优秀的HTML在线编辑器,它的功能确实很强大,而且也非常的灵活,具有很强的定制性。

FCKEditor默认的工具栏项目很多,我们完全可以对其进行自定制,以满足自己的需求。

网上也有很多介绍定制工具栏的方法。下面就是其中的一种:

在fckconfig.js中找到 FCKConfig.ToolbarSets 段,默认有两个工具条样式,一个是Default,一个是Basic(我的版本是2.5)。

增加如下一段:
 1 FCKConfig.ToolbarSets[ " Custom " =  [
 2     [ ' FontFormat','FontName','FontSize'],
 3     [ ' Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
 4     [ ' OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
 5     [ ' JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
 6     [ ' Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
 7     [ ' Link','Unlink','Anchor'],
 8     [ ' TextColor','BGColor'],'/'
 9     [ ' Cut','Copy','Paste','PasteText','PasteWord'],
10     [ ' Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
11     [ ' FitWindow','ShowBlocks','-','Source','About']        // No comma for the last row.
12 ] ;


然后再调用代码中做如下更改

注意第7行是新增的,指定所要使用的工具栏

 1 < %
 2      Dim  oFCKeditor
 3      Set  oFCKeditor  =   New  FCKeditor
 4     oFCKeditor.BasePath     =   " edit/ "
 5     oFCKeditor.Value     =   ""
 6     oFCKeditor.Config( " SkinPath " ) = " /website/manage/edit/editor/skins/silver/ "
 7     oFCKeditor.ToolbarSet  =   " Custom "
 8     oFCKeditor.Create  " txtcontent "
 9 % >
10


其定制语法很简单
[]  表示一个工具条,
[]  中的短横线'-'表示一个垂直分割线
''  两个单引号中间加一个标识符表示一个工具栏按钮,具体的对应关系可以自己找。
'/' 作用类似于一个回车。使该符号后面的工具栏新起一行排列。

我最终的定制效果如下:


转载于:https://www.cnblogs.com/antistone/archive/2008/03/16/1108548.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值