阅读(2415) (1)

添加公式、思维导图

2023-02-10 16:17:59 更新

1.在百度编辑器工具栏模式合适的位置添加​​​kityformula​、​kityminder​即可,比如我想让新闻插件在pc端中使用,并且想将公式和思维导图按钮放在从草稿箱加载后面,就可以是:

simple: [

        ['fullscreen','undo', 'redo', '|','paragraph', 'fontfamily', 'fontsize','|', 'bold', 'italic',

                'underline', 'strikethrough', '|', 'forecolor', 'backcolor',  '|', 

'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain','|', 'inserttable', 'insertcharts','charts','|',

'insertorderedlist', 'insertunorderedlist', 'indent',

                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',

'insertcode', 'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage','scrawl', '|',

                 'link', 'unlink','simpleupload', 'insertvideo','attachment','dzzfile','emotion','|','drafts','kityformula', 'kityminder'

        ]

    ],

2.在百度编辑器样式中添加css代码

.edui-default  .edui-for-kityformula .edui-icon {

    background-position: -747px -77px;

}

.edui-default  .edui-for-kityminder .edui-icon {

    background-position: -766px -77px;

}

3.在百度编辑器语言中的​labelMap​段添加按钮名称​'kityformula':'插入公式','kityminder':'插入思维导图'​

4. 在百度编辑器打包文件中配置插件

​第一步在​​var iframeUrlMap = {​​段添加插件文件地址

'kityformula':'~/dialogs/kityformula/kityFormulaDialog.html',
'kityminder':'~/dialogs/kityminder/kityMinderDialog.html',
第二步设置插件窗口
var dialogBtns = {        noOk:['searchreplace', 'help', 'spechars', 'webapp','preview'],
        ok:['attachment', 'anchor', 'link', 'insertimage', 'map', 'gmap', 'insertframe', 'wordimage',
            'insertvideo', 'insertframe', 'edittip', 'edittable', 'edittd', 'scrawl', 'template', 'music', 'background', 'charts', 'kityminder', 'kityformula']
    };
第三步设置插件全屏

if (iframeUrl) {

                            dialog = new editorui.Dialog(utils.extend({

                                iframeUrl:editor.ui.mapUrl(iframeUrl),

                                editor:editor,

                                className:'edui-for-' + cmd,

                                title:title,

                                holdScroll: cmd === 'insertimage',

                                fullscreen: /charts|preview|kityminder|kityformula/.test(cmd),

第四步应用//注释
case 'img':
                        //todo base64暂时去掉,后边做远程图片上传后,干掉这个
//                        if (val = node.getAttr('src')) {
//                            if (/^data:/.test(val)) {
//                                node.parentNode.removeChild(node);
//                                break;
//                            }
//                        }

5.将下图替换至dzz\system\ueditor\themes\default\images\icons.png


 6.放置插件文件

下载链接:https://hlc.lanzouo.com/b01k7xlzi 密码:xiaohu 公式文件:kityformula.7z 思维导图文件: kityminder.7z

下载解压后将kityformula、kityminder放置dzz\system\ueditor\dialogs下

 7.最后清理浏览器缓存即可