[CKEditor] config.js 파일 사용법 > 기술자료 | 해피정닷컴

[CKEditor] config.js 파일 사용법 > 기술자료

본문 바로가기

사이트 내 전체검색

[CKEditor] config.js 파일 사용법 > 기술자료

Editor [CKEditor] config.js 파일 사용법

페이지 정보


본문

[ CKEditor 3.x ]
ckeditor / config.js  파일을 아래의 것으로 교체합니다.

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';  
  config.docType = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
  config.font_defaultLabel = '굴림';
  config.font_names = '굴림/Gulim;돋움/Dotum;바탕/Batang;궁서/Gungsuh;Arial/Arial;Comic Sans MS/Comic Sans MS;Courier New/Courier New;Georgia/Georgia;Lucida Sans Unicode/Lucida Sans Unicode;Tahoma/Tahoma;Times New Roman/Times New Roman;Trebuchet MS/Trebuchet MS;Verdana/Verdana';
  config.fontSize_defaultLabel = '12px';
  config.fontSize_sizes = '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;';
  config.language = "ko";
  config.resize_enabled = true;
  config.enterMode = CKEDITOR.ENTER_BR;
  config.shiftEnterMode = CKEDITOR.ENTER_P;
  config.startupFocus = true;
  config.uiColor = '#eaebe7';
  config.toolbarCanCollapse = false;
  config.menu_subMenuDelay = 0;
  config.width ='100%';
  config.height ='250';
  config.toolbar = [['Font','FontSize'],['Bold','Italic','Underline','Strike','Subscript','Superscript','TextColor','BGColor','Blockquote','RemoveFormat','NumberedList','BulletedList'],'/',['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink','Find','Replace','SelectAll','-','Image','Table','Smiley','SpecialChar'],'/',['Source','Preview','Templates','Print'],['Cut','Copy','Paste','PasteText','PasteFromWord','Undo','Redo','Maximize']];
 /*
 'About','Save','Styles','ShowBlocks','Format','SpellChecker','Scayt','NewPage','Anchor','Outdent','Indent',
 '-',
 ],'/',[
 ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
 ['Flash','HorizontalRule','PageBreak'],
 */
};



[ CKEditor 4.x Full Package ]
plugin / editor / ckeditor4 / config.js 의 내용을 수정합니다.

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';
};


를 아래와 같이 수정합니다.



CKEDITOR.on('dialogDefinition', function(ev) {
    var dialogName = ev.data.name;
    var dialogDefinition = ev.data.definition;
    var dialog = dialogDefinition.dialog;
    var editor = ev.editor;

    if (dialogName=='image') {
        // memo: dialogDefinition.onShow = ... throws JS error (C.preview not defined)
        /*
        // Get a reference to the 'Link Info' tab.
        var infoTab = dialogDefinition.getContents('info');
        // Remove unnecessary widgets
        infoTab.remove( 'ratioLock' );
        infoTab.remove( 'txtHeight' );          
        infoTab.remove( 'txtWidth' );          
        infoTab.remove( 'txtBorder');
        infoTab.remove( 'txtHSpace');
        infoTab.remove( 'txtVSpace');
        infoTab.remove( 'cmbAlign' );
        */
        /*
        dialogDefinition.onLoad = function(){
            var dialog = CKEDITOR.dialog.getCurrent();
            var elem = dialog.getContentElement('info','htmlPreview');     
            elem.getElement().hide();
            dialog.hidePage('Link');
            dialog.hidePage('advanced');
            dialog.hidePage('info'); // works now (CKEditor v3.6.4)
            this.selectPage('Upload');
        };
        */

        dialogDefinition.onLoad = function(){
            dialog.getContentElement('info', 'htmlPreview').getElement().hide();     
            dialog.getContentElement('info', 'cmbAlign').getElement().hide();     
            this.hidePage('Link');
            this.hidePage('advanced');
            this.selectPage('Upload');
        };

        /*
        alt 를 넘기지 못하는 관계로 주석 처리함. 130314 kagla
        dialogDefinition.onOk = function (e) {
            var imageSrcUrl = e.sender.originalElement.$.src;
            var imgHtml = CKEDITOR.dom.element.createFromHtml('<img src=' + imageSrcUrl + ' alt="" />');
            editor.insertElement(imgHtml);

            var uploadTab = dialogDefinition.getContents('Upload');
            var uploadButton = uploadTab.get('uploadButton');
            uploadButton['filebrowser']['onSelect'] = function(fileUrl, errorMessage) {
                $("input.cke_dialog_ui_input_text").val(fileUrl);
                $(".cke_dialog_ui_button_ok span").click();
            }
        };
        */

        /*
        var uploadTab = dialogDefinition.getContents('Upload');
        var uploadButton = uploadTab.get('uploadButton');
        uploadButton['filebrowser']['onSelect'] = function(fileUrl, errorMessage) {
            $("input.cke_dialog_ui_input_text").val(fileUrl);
            $(".cke_dialog_ui_button_ok span").click();
        }
        */
    } else if (dialogName=='link') {
        dialogDefinition.removeContents('advanced');

        dialogDefinition.onShow = function(){
            dialog.getContentElement('info','anchorOptions').getElement().hide();
            dialog.getContentElement('info','emailOptions').getElement().hide();
            dialog.getContentElement('info','linkType').getElement().hide();
            dialog.getContentElement('info','protocol').disable();
        };
    }

    var infoTab = dialogDefinition.getContents('info');
    if (infoTab) {
        infoTab.remove('txtHSpace');
        infoTab.remove('txtVSpace');
        infoTab.remove('txtBorder');
        infoTab.remove('txtWidth');
        infoTab.remove('txtHeight');
        infoTab.remove('ratioLock');
    }
});

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';

    // Toolbar configuration generated automatically by the editor based on config.toolbarGroups.
    config.toolbar = [
        { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'NewPage', 'Preview' ] },
        //{ 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'], items: [ 'Find', 'Replace' ] },
        //{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
        { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak' ] },
        //{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
        //{ name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
        '/',
        { name: 'basicstyles', groups: [ 'basicstyles' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ] },
        //{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
        { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
        //{ 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: '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.font_defaultLabel = "굴림";
    config.font_names = "굴림;돋움;바탕;궁서;굴림체;돋움체;바탕체;궁서체;나눔고딕;나눔명조;"+
        "MS ゴシック;MS Pゴシック;MS 明朝;レギュラー;"+
        "宋体;新宋体;黑体;"+
        "Leelawadee;"+
        "Arial;Comic Sans MS;Courier New;Lucida Sans Unicode;monospace;sans-serif;serif;Tahoma;Times New Roman;Verdana";
    config.fontSize_defaultLabel = "10pt";
    config.fontSize_sizes = "7pt/9px;8pt/11px;9pt/12px;10pt/13px;11pt/15px;14pt/19px;18pt/24px;24pt/32px;36/48px;";

    config.enterMode = CKEDITOR.ENTER_BR;
    config.shiftEnterMode = CKEDITOR.ENTER_P;
    
    config.uiColor = '#eaebe7';

    //config.filebrowserUploadUrl = g5_editor_url+"/upload.php?type=Images";
   
    config.keystrokes=[
        // Formatting
        [ CKEDITOR.CTRL + 81 /*Q*/, 'blockquote' ],
        [ CKEDITOR.CTRL + 66 /*B*/, 'bold' ],
        [ CKEDITOR.CTRL + 56 /*8*/, 'bulletedlist' ],
        [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 56 /*8*/, 'bulletedListStyle' ],
        [ CKEDITOR.CTRL + 77 /*M*/, 'indent' ],
        [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 77 /*M*/, 'outdent' ],
        [ CKEDITOR.CTRL + 73 /*I*/, 'italic' ],
        [ CKEDITOR.CTRL + 74 /*J*/, 'justifyblock' ],
        [ CKEDITOR.CTRL + 69 /*E*/, 'justifycenter' ],
        [ CKEDITOR.CTRL + 76 /*L*/, 'justifyleft' ],
        [ CKEDITOR.CTRL + 82 /*R*/, 'justifyright' ],
        [ CKEDITOR.CTRL + 55 /*7*/, 'numberedlist' ],
        [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 55 /*7*/, 'numberedListStyle' ],
        [ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
        [ CKEDITOR.CTRL + 32 /*SPACE*/, 'removeFormat' ],
        [ CKEDITOR.CTRL + 65 /*A*/, 'selectall' ],
        [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 88 /*X*/, 'strike' ],
        [ CKEDITOR.CTRL + 188 /*COMMA*/, 'subscript' ],
        [ CKEDITOR.CTRL + 190 /*PERIOD*/, 'superscript' ],
        [ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],
        [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
        // Insert
        [ CKEDITOR.ALT + 65 /*A*/, 'anchor' ],
        [ CKEDITOR.ALT + 68 /*D*/, 'creatediv' ],
        [ CKEDITOR.ALT + CKEDITOR.SHIFT + 68 /*D*/, 'editdiv' ],
        [ CKEDITOR.ALT + 70 /*F*/, 'flash' ],
        [ CKEDITOR.ALT + 72 /*H*/, 'horizontalrule' ],
        [ CKEDITOR.CTRL + 57 /*9*/, 'image' ],
        [ CKEDITOR.ALT + 73 /*I*/, 'image' ],
        [ CKEDITOR.CTRL + 75 /*K*/, 'link' ],
        [ CKEDITOR.ALT + 76 /*L*/, 'link' ],
        [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 75 /*K*/, 'unlink' ],
        [ CKEDITOR.ALT + CKEDITOR.SHIFT + 76 /*L*/, 'unlink' ],
        [ CKEDITOR.CTRL + 13 /*ENTER*/, 'pagebreak' ],
        [ CKEDITOR.ALT + 13 /*ENTER*/, 'pagebreak' ],
        [ CKEDITOR.ALT + 69 /*E*/, 'smiley' ],
        [ CKEDITOR.ALT + 67 /*C*/, 'specialchar' ],
        [ CKEDITOR.ALT + 84 /*T*/, 'table' ],
        [ CKEDITOR.ALT + 79 /*O*/, 'templates' ],
        // Other - dialogs, views, etc.
        [ 112 /*F1*/, 'about' ],
        [ CKEDITOR.ALT + 48 /*ZERO*/, 'blur' ],
        [ CKEDITOR.ALT + 8 /*Backspace*/, 'blur' ],
        [ CKEDITOR.CTRL + 87 /*W*/, 'blur' ],
        [ CKEDITOR.ALT + 51 /*#3*/, 'colordialog' ],
        [ CKEDITOR.ALT + 77 /*M*/, 'contextMenu' ],
        [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ],
        [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 70 /*F*/, 'find' ],
        [ CKEDITOR.ALT + 88 /*X*/, 'maximize' ],
        [ CKEDITOR.CTRL + 113 /*F2*/, 'preview' ],
        [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 80 /*P*/, 'print' ],
        [ CKEDITOR.CTRL + 72 /*H*/, 'replace' ],
        [ CKEDITOR.ALT + 83 /*S*/, 'scaytcheck' ],
        [ CKEDITOR.ALT + 66 /*B*/, 'showblocks' ],
        [ CKEDITOR.ALT + CKEDITOR.SHIFT + 84 /*T*/, 'showborders' ],
        [ CKEDITOR.ALT + 90 /*Z*/, 'source' ],
        [ CKEDITOR.ALT + 48 /*ZERO*/, 'toolbarCollapse' ],
        [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
    ];
};



참고사이트
http://coterie-textcube.blogspot.com/2010/01/ckeditor-설치-및-설정.html

댓글목록

등록된 댓글이 없습니다.


Total 2,640건 1 페이지
  • RSS
기술자료 목록
2640
그누보드   33  2024-11-22 10:52 ~ 2024-11-22 11:03  
2639
호스팅   68  2024-11-19 14:41 ~ 2024-11-19 21:17  
2638
Linux   64  2024-11-18 15:45 ~ 2024-11-18 15:48  
2637
일반   71  2024-11-15 16:45 ~ 2024-11-15 16:46  
2636
Secure   123  2024-11-06 18:48 ~ 2024-11-06 18:50  
2635
영카트   260  2024-10-21 13:44 ~ 2024-10-21 19:42  
2634
전자결제   504  2024-09-05 09:30  
2633
MySQL   928  2024-03-29 14:14 ~ 2024-03-29 14:14  
2632
그누보드   1146  2024-02-23 18:40 ~ 2024-02-24 06:13  
2631
JavaScript   1253  2024-02-16 18:50 ~ 2024-02-16 20:37  
2630
Java   1190  2024-02-06 16:49  
2629
PHP   1378  2024-02-06 16:42  
2628
호스팅   1222  2024-01-29 12:54  
2627
PHP   1286  2024-01-26 11:04 ~ 2024-01-26 11:13  
2626
MySQL   1484  2024-01-08 17:37 ~ 2024-03-14 16:00  
2625
SQL   1579  2024-01-08 12:36  
2624
영카트   1651  2024-01-04 14:57  
2623
일반   2561  2023-12-15 18:33  
2622
Android   2052  2023-11-30 18:48 ~ 2023-11-30 19:41  
2621
전자결제   4000  2023-11-23 19:53  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.