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:
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 }); } }); })();
register plugin in ckeditor config.
add toolbar
sorry, can't format code
Comments
Post a Comment