CKeditor富文本编辑器使用技巧之添加自定义插件的(2)

/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or */ CKEDITOR.editorConfig = function( config ) { config.toolbarGroups = [ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, { name: 'links' }, { name: 'insert' }, { name: 'forms' }, { name: 'tools' }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'others' }, 'https://www.jb51.net/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, { name: 'styles' }, { name: 'colors' }, { name: 'about' }, { name: 'extent', items: ["qchoice"] } ]; config.toolbar_Full = [ ['Source','-','Save','NewPage','Preview','-','Templates'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker', 'Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select','Button', 'ImageButton', 'HiddenField'], 'https://www.jb51.net/', ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'], 'https://www.jb51.net/', ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ["qchoice"] ]; config.image_previewText=' '; config.filebrowserImageUploadUrl = 'uploadFiles'; // config.extraPlugins = 'justify'; config.extraPlugins += (config.extraPlugins ? ',justify' : 'justify'); config.extraPlugins += (config.extraPlugins ? ',qchoice' : 'qchoice'); // config.extraPlugins="linkbutton"; // // config.extraPlugins="ilink"; // // config.extraPlugins="ijuzi"; // config.extraPlugins="iti"; config.removeButtons = 'Underline,Subscript,Superscript'; // Set the most common block elements. config.format_tags = 'p;h1;h2;h3;pre'; // Simplify the dialog windows. config.removeDialogTabs = 'image:advanced;link:advanced'; config.image_previewText=' '; config.entities = false; };

好啦,到这里,自定义插件就算是放入成功了。咱们自定义的插件主要的逻辑结构就是在qchoice.js文件中,可以改变它的内容,来实现不同的功能。

好啦,本次记录就到这里了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/7762ca54179ea35792e9dbd0f4333224.html