FCKEditor插件的开发指南
FCKEditor已经提供了强大功能.但有时根据业务要求,需要增加自己的工具栏按钮等等.FCKEditor提供了插件机制.可以在对既有的代码不做修改.只需要简单的配置,就可以扩展FCKEditor的功能.下面用一个例子演示.我们的需求是:在工具栏增加一个My_Find按钮.点击弹出一个对话框:1.配置:
FCKEditor所有的配置都在fckconfig.js中设置.
a.配置工具栏:
如果我们要增加一个按钮,My_Find:
FCKConfig.ToolbarSets["Default"] = [ ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'], ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], '/', ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'], '/', ['Style','FontFormat','FontName','FontSize'], ['TextColor','BGColor'], ['My_Find'] ] ; b.指定插件的位置:
[*]FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
页:
[1]