ckeditor 스타일 관련
Posted by Albert 4841Day 13Hour 38Min 31Sec ago [2012-01-18]
1 toolbar 감추기
ckeditor/ckeditor.js => toolbarStartupExpanded 를 false 로 하면 감춰지고 true 로 설정시 나타난다
2. toolbar 항목 설정함수
{ 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 : [ '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','-','About' ] }
적용방법: 자바스크립트 태그않에
var editor = CKEDITOR.replace("content", {skin : 'office2003',width:'100%',height:'500',toolbar:[['Styles','Format','Font','FontSize','TextColor','BGColor','-'],['Source','Print','Find','Undo','Redo','Bold','Italic','Underline','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','BidiLtr','BidiRtl','Link','Unlink','Image','Table','Maximize', 'ShowBlocks','-']]} );
CKFinder.SetupCKEditor(editor, '/ckfinder/');
항목을 넣으면 된다. '-' 는 내리막 줄 []는 줄바꾸기 할때 사용된다. ^^
참고 주소
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar