zoukankan      html  css  js  c++  java
  • wangEditor2 扩展(一)分割线功能

    1、找到文件

    2、菜单自定义配置的UI 处添加按钮

    hr: {
    		    normal: '<a href="#" tabindex="-1"><i class="wangeditor-menu-img-hr"></i></a>',
    		    selected: '.selected'
    		},
    

    3、添加菜单配置

     2、找到  // 语言包    添加   hr  的提示

    3、写一个// hr菜单  分割线  菜单功能函数

    // hr菜单  分割线
    _e(function (E, $) {
        E.createMenu(function (check) {
            var menuId = 'hr';
            if (!check(menuId)) {
                return;
            }
            var editor = this;
            var lang = editor.config.lang;
    
            // 创建 menu 对象
            var menu = new E.Menu({
                editor: editor,
                id: menuId,
                title: lang.hr,
                commandName: 'insertHtml',
                commandValue: 'Hr'
            });
    
            // 定义click事件
            menu.clickEvent = function (e) {
                // 自定义command事件
                function commandFn() {
                    editor.command(e, 'insertHtml','<hr/>');
                }
                // 执行自定义命令
                editor.customCommand(e, commandFn);
            };
    
            // 增加到editor对象中
            editor.menus[menuId] = menu;
        });
    
    });  

      

    函数同理bold

  • 相关阅读:
    linux tar order
    Linux驱动学习步骤(转载)
    汇编指令(转载)
    拓扑排序
    python 三维坐标图
    python 矩阵
    spring 之 IOC 依赖注入详解
    spring 下载
    Struts数据验证
    拦截器配置
  • 原文地址:https://www.cnblogs.com/qing1304197382/p/11652691.html
Copyright © 2011-2022 走看看