项目地址
http://git.oschina.net/plusman/configs/tree/master/jstools/ckeditor
文章参考
CKEditor 3 系列开发博客
不是很有参考价值,http://www.cnblogs.com/sonce/archive/2011/06/12/2078729.html
最新官方文档 (推荐)
最新版本的开发文档,还是看英文原版吧,http://docs.ckeditor.com/#!/guide/widget_sdk_tutorial_1,官方的,蛮简洁的 需要翻墙 ,程序员必备技能
手把手的官方教程
Part1: <http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_1>
Part2: <http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_2>
plugin和widget的区别
Plugin
首先官方文档中,图标就不一样啊!
简介:
Plugins are the most important building blocks of CKEditor. They provide all editor features, including user interface rendering, text manipulation, data input and output, etc. They are built on top of the base which is called the CKEditor Core, represented the CKEditor Core API.
Widget
简介:
Widgets are special rich content units in that they are groups of elements which are treated as a single entity inside the editor.
总结
简单的说,Plugin的权限负责到,把内容送到编辑框内后,就不能再做更多了。
Widget把内容送到编辑框后,还可以继续对文本内容按照格式继续操作,Widget如下图。
关于CKEditor菜单栏的配置
这里有完整的关于CKeditor的配置,http://ckeditor.com/latest/samples/plugins/toolbar/toolbar.html
贴上我的配置
<!-- lang: js -->
// 拓展自定义插件
config.extraPlugins = 'txvideo';
config.language = 'zh-cn';
// Toolbar configuration generated automatically by the editor based on config.toolbarGroups.
config.toolbar = [
{ name: 'document', groups: [ 'mode', 'doctools'], items: [ 'Source','-','Templates' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align'], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote','-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'Iframe','Txvideo'] },
{ name: 'styles', items: [ 'Format', 'Font', 'FontSize' ] },
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
{ name: 'tools', items: [ 'Maximize'] },
{ name: 'others', items: [ '-' ] },
{ name: 'about', items: [ 'About' ] }
];
插件依赖于 Iframe ,所以 Iframe 一定要加载。