美文网首页
CKEditor 4.11.1 配置文件设置

CKEditor 4.11.1 配置文件设置

作者: 赛亚人之神 | 来源:发表于2018-11-15 16:41 被阅读274次
    /**
     * CKEditor配置文件
     * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
     * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
     */
    
    CKEDITOR.editorConfig = function (config) {
      // 皮肤设置
      config.skin = 'moono-lisa';
      // 去除图片预览
      config.image_previewText = ' ';
      // 添加行距
      // config.extraPlugins = 'lineheight';
      config.extraPlugins += (config.extraPlugins ? ',lineheight' : 'lineheight');
      // 去除左下角元素路径
      config.removePlugins = 'elementspath';
    
      // Define changes to default configuration here. For example:
      // config.language = 'en';
      config.language = 'zh-cn';
      // config.uiColor = '#F1F1F1';
      config.toolbar = 'Customer';
      config.toolbarGroups = [
        // 1. 包括源码等
        {name: 'document', groups: ['mode', 'document', 'doctools']},
        // 2. 提供复制张贴等
        {name: 'clipboard', groups: ['clipboard', 'undo']},
        // 3. 拼写检查等
        {name: 'editing', groups: ['find', 'selection', 'spellchecker', 'editing']},
        // 4. 表单信息
        {name: 'forms', groups: ['forms']},
        // 5. 插入 包括图片,表格'Table',水平线,特殊字符  表情'Smiley',分页符,'PageBreak
        {name: 'insert', groups: ['insert']},
        '/',
        // 6. 加粗 倾斜 删除线等
        {name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
        // 7. 有序 无序 引用等
        {name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi', 'paragraph']},
        // 8. 链接
        {name: 'links', groups: ['links']},
        '/',
        // 9. 输入文字风格
        {name: 'styles', groups: ['styles']},
        // 10. 颜色
        {name: 'colors', groups: ['colors']},
        // 工具  用于编辑器全屏
        {name: 'tools', groups: ['tools']},
        {name: 'others', groups: ['others']},
        // 关于功能
        {name: 'about', groups: ['about']}
      ];
      // Remove some buttons provided by the standard plugins, which are not needed in the Standard(s) toolbar.
      // config.removeButtons = 'NewPage,Preview,Print,Save,Templates,Scayt,Radio,Checkbox,TextField,Form,Textarea,Select,Button,ImageButton,HiddenField,Subscript,Superscript,NumberedList,BulletedList,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Iframe,PageBreak,SpecialChar,Maximize,ShowBlocks,About,Smiley,Flash';
    
      config.removeButtons = 'NewPage,Preview,Print,Save,ImageButton,Language,Iframe,About,Flash';
        // Set the most common block elements.
      config.format_tags = 'p;h1;h2;h3;pre';
    
      // Simplify the dialog windows.
      config.removeDialogTabs = 'image:advanced;link:advanced';
      // 工具栏的位置 设置编辑器功能位置 默认top  bottom
      config.toolbarLocation = 'top';
      // 当用户键入 TAB 时,编辑器走过的空格数,( ) 当值为0时,焦点将移出编辑框  如果不设置则无任何效果
      config.tabSpaces = 4;
      // 工具栏默认是否展开
      config.toolbarStartupExpanded = true;
      // 工具栏是否可以被收缩
      config.toolbarCanCollapse = true;
      //中文字体
      config.font_names = '宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;' + config.font_names;
      //忽略粘贴的样式
      config.forcePasteAsPlainText = false;
      config.pasteFromWordRemoveFontStyles = false;
      config.pasteFromWordRemoveStyles = false;
    
    };
    
    

    相关文章

      网友评论

          本文标题:CKEditor 4.11.1 配置文件设置

          本文链接:https://www.haomeiwen.com/subject/fmgyfqtx.html