미채택 완료

CKediter4에서 툴바에 플러그인추가가 안되는데~~

2020-05-13 (수) 22:17:13 2,625

에디터툴바에 플러그인을 추가하려는데 아래코드와같은방법으로는 안되는데 아시는분계신가요?

  

Copy
/**

 * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.

 * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license

 */

 

CKEDITOR.editorConfig = function( config ) {

// Toolbar configuration generated automatically by the editor based on config.toolbarGroups.

config.toolbar = [

    { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', '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: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },

    '/',

    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat' ] },

    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] },

    { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },

    { name: 'insert', items: [ 'codesnippet', 'Table'] },

    '/',

    { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },

    { name: 'colors', items: [ 'TextColor', 'BGColor' ] },

    { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },

    { name: 'others', items: [ '-' ] },

    { name: 'about', items: [ 'About' ] }

];

 

// Toolbar groups configuration.

config.toolbarGroups = [

    { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },

    { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },

    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },

    { name: 'forms' },

    '/',

    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },

    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },

    { name: 'links' },

    { name: 'insert' },

    '/',

    { name: 'styles' },

    { name: 'colors' },

    { name: 'tools' },

    { name: 'others' },

    { name: 'about' }

];

config.extraPlugins = 'codesnippet'; //추가하려는 플러그인

};
|

답변 1개

https://ckeditor.com/cke4/addon/codesnippet

요기서 소스를 다운받으셔서 플러그인 폴더에 넣고

사용하시면 될겁니다.

답변을 작성하려면 로그인이 필요합니다.