[CKEditor] config.js 파일 사용법 > 온라인강의

본문 바로가기
 
 
 
오늘 1,622
어제 869
최대 2,526
전체 3,399,515

최근 방문자

1756
1706
1573
932
869
1622
21 22 23 24 25 26
비즈니스의 시작 비즈명함 ~ 가격, 품질, 배송 3가지 만족을 드리는 비즈명함 / 즉석명함 / 급행서비스 / 서울 전지역 수도권일부 3시간배송

select * from g5_menu where me_use = '1' and me_link like '%lecture%'
온라인강좌 홈 > 온라인강좌 > 온라인강좌

Editor | [CKEditor] config.js 파일 사용법 (update. 2015-05-11)

페이지 정보

작성일2012-02-07 23:32 조회24,165회 댓글0건

본문

[ 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,005건 1 페이지
온라인강의 목록
번호 제목
2005
2004
2003
2002
2001
2000
1999
1998
1997
1996
1995
1994
1993
1992
1991
1990
1989
1988
1987
1986
1985
1984
1983
1982
1981
게시물 검색
 
 
상호: 해피정닷컴 대표:정창용 사업자등록번호:119-05-36414 (08394) 서울시 구로구 디지털로 242 한화비즈메트로1차 1502호
전화: 070-7600-3500 팩스:02-865-3528 개인정보관리:정창용 mail@happyjung.com 에스크로확인
개인정보취급방침
COPYRIGHT 2001~2017 해피정닷컴. All rights reserved. 부가통신사업신고:서울체신청-1217 통신판매신고:2014-서울구로-0074
 
모바일 버전으로 보기