javascript - CKeditor Toolbar : AddButton (3.6) -


i want add custom button toolbar.

based on information here : http://docs.cksource.com/ckeditor_3.x/developers_guide/toolbar have config.js :

 config.toolbar = 'mytoolbar';  config.toolbar_mytoolbar = [     { name: 'document', items: ['source', '-', 'save', 'newpage', 'docprops', 'preview', 'print', '-', 'templates'] },     { name: 'clipboard', items: ['cut', 'copy', 'paste', 'pastetext', 'pastefromword', '-', 'undo', 'redo'] },     { name: 'editing', items: ['find', 'replace', '-', 'selectall', '-', 'spellchecker', 'scayt'] },     {         name: 'forms', items: ['form', 'checkbox', 'radio', 'textfield', 'textarea', 'select', 'button', 'imagebutton',           'hiddenfield']     },     '/',     { name: 'basicstyles', items: ['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', '-', 'removeformat'] },     {         name: 'paragraph', items: ['numberedlist', 'bulletedlist', '-', 'outdent', 'indent', '-', 'blockquote', 'creatediv',         '-', 'justifyleft', 'justifycenter', 'justifyright', 'justifyblock', '-', 'bidiltr', 'bidirtl']     },     { name: 'links', items: ['link', 'unlink', 'anchor'] },     { name: 'insert', items: ['customimage', 'flash', 'table', 'horizontalrule', 'smiley', 'specialchar', 'pagebreak', 'iframe'] },     '/',     { name: 'styles', items: ['styles', 'format', 'font', 'fontsize'] },     { name: 'colors', items: ['textcolor', 'bgcolor'] },     { name: 'tools', items: ['maximize', 'showblocks', '-', 'about'] } ];   config.extraplugins = 'customimage'; 

but toolbar not changed. stays default.

if want add button ckeditor, have 3 steps:

  1. write own plugin button thing this:

    (function () { // function when click button var = { exec: function (editor) { action when click button } }, b = 'videomanager'; ckeditor.plugins.add(b, { init: function (editor) { editor.addcommand(b, a); editor.ui.addbutton('videomanager', { label: 'video manager', icon: this.path + 'videomanager.png', command: b }); } }); })();

  2. register plugin in ckeditor config.

  3. add toolbar

sorry, can't format code


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -