2. ckeditor 툴바 변경



그림 2-1 ckeditor의 모든 툴바

 

각 아이템의 이름이 순서대로 나열되었으니 참조할 것.(대소문자 구별)

'-'는 세로 구분선을 나타내고 '/'는 줄바꿈을 나타낸다.


CKEDITOR.editorConfig = function( config ) {

config.toolbar = [

{ name: 'document', items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },

{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },

{ name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },

{ name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },

'/',

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

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

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

{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },

'/',

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

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

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

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

];

};


-필요한 아이콘만으로 재구성하기

config.js를 아래와 같이 수정 또는 추가한다.

CKEDITOR.editorConfig = function( config ) {

config.toolbarGroups = [

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

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

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

{ name: 'forms', groups: [ 'forms' ] },

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

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

{ name: 'links', groups: [ 'links' ] },

'/',

{ name: 'insert', groups: [ 'insert' ] },

{ name: 'colors', groups: [ 'colors' ] },

{ name: 'tools', groups: [ 'tools' ] },

{ name: 'styles', groups: [ 'styles' ] },

'/',

{ name: 'others', groups: [ 'others' ] },

{ name: 'about', groups: [ 'about' ] }

]; //여기까지는 사용되는 모든 툴바의 그룹이 설정되어 있다.

 

config.removeButtons = 'Save,NewPage,Preview,Print,Templates,Cut,Copy,Paste,PasteText,PasteFromWord,Find,Replace,SelectAll,Scayt,Form,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Strike,Subscript,Superscript,Checkbox,NumberedList,BulletedList,Indent,Outdent,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,JustifyBlock,Anchor,Flash,HorizontalRule,PageBreak,Iframe,Styles,Format,ShowBlocks,About';

}; //쓰지 않을 툴바의 이름을 여기에 적으면 된다.(대소문자 구별)

Posted by star story :

Snippet :: Code View :: "+location.href+'
'+b+"

");top.consoleRef.document.close()}$(".snippet-container").each(function(b){$(this).find("a.snippet-text").click(function(){var d=$(this).parents(".snippet-wrap").find(".snippet-formatted");var c=$(this).parents(".snippet-wrap").find(".snippet-textonly");d.toggle();c.toggle();if(c.is(":visible")){$(this).html("html")}else{$(this).html("text")}return false});$(this).find("a.snippet-window").click(function(){var c=$(this).parents(".snippet-wrap").find(".snippet-textonly").html();a(c);$(this).blur();return false})});$(".snippet-toggle").each(function(b){$(this).click(function(){$(this).parents(".snippet-container").find(".snippet-wrap").toggle()})})});