zoukankan      html  css  js  c++  java
  • 定制ckeditor的菜单

    修改配置文件config.js来定制cheditor的菜单,需要以下步骤:

      1、找到ckeditor安装目录的config.js文件

      2、记下要使用的功能名,以下的"-"代表分隔符,"/"代表换行

          ['Source','-','Save','NewPage','Preview','-','Templates'],
          ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
          ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
          ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
          '/',
          ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
          ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
          ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
          ['Link','Unlink','Anchor'],
          ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
          '/',
          ['Styles','Format','Font','FontSize'],
          ['TextColor','BGColor'],
          ['Maximize', 'ShowBlocks','-','About']

      3、修改config.js文件,假设以下是config.js的全部内容

     1     CKEDITOR.editorConfig = function( config )
     2     {
     3         config.toolbar = 'Mycustom';//此处选择哪种配置。现在是选择了Mycustom配置项,不是Mycustom2配置项
     4         config.toolbar_Mycustom =
     5         [
     6              ['Bold','Italic','-','Image','Link','Unlink']//这里的菜单有粗体、斜体、图片管理、超链接、取消超链接功能
     7         ]
     8 
     9         config.toolbar_Mycustom2 =
    10         [
    11              ['Bold','Italic']//这里的菜单有粗体、斜体功能
    12         ]
    13     };

        如果要在Mycutom中新增Flash、Cut、Copy的功能,则在里面添加即可,代码如下:

     1     CKEDITOR.editorConfig = function( config )
     2     {
     3         config.toolbar = 'Mycustom';
     4         config.toolbar_Mycustom =
     5         [
     6              ['Bold','Italic','-','Image','Link','Unlink','Flash','Cut','Copy']//这里新增了Flash、Cut、Copy的功能
     7         ]
     8 
     9         config.toolbar_Mycustom2 =
    10         [
    11              ['Bold','Italic']
    12         ]
    13     };

         

  • 相关阅读:
    SpringXML方式配置bean的懒加载lazy-init
    jQuery实现select三级联动
    jQuery实现导航栏
    jQuery实现点击式选项卡
    jQuery对象和dom对象
    jQuery插件
    Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project Resource: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
    Java、Apache Tomcat下载与安装及环境变量配置
    Notepad++怎么增加整行删除快捷键?添加/取消区块注释?
    org.apache.catalina.core.DefaultInstanceManager cannot be cast to org.apache.tomcat.InstanceManager
  • 原文地址:https://www.cnblogs.com/sustudy/p/4193714.html
Copyright © 2011-2022 走看看