dwz和 kindeditor整合的问题

开发一个新项目需要用到dwz

但是dwz的编辑器太8888了所以想着整合一下kindeditor

网上查了一下.

最后改动一下

搞出一个稍微完善的方案

 

$("textarea.kindeditor", $p).each(function () {
        $this = $(this);
        var tools = $this.attr('tools');
        var items;
        if(tools=='smple'){
            items = ['undo', 'redo', '|', 'justifycenter', 'justifyright','justifyfull', 'indent', 'outdent','bold','italic', 'underline', 'strikethrough', 'removeformat'];
        }else if(tools=='full'){
            items = ['source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright','justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript','superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/','formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold','italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
        'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap','anchor', 'link', 'unlink'];
        }else if(tools=='basic'){
            items = ['source', '|', 'undo', 'redo', '|', 'plainpaste', 'wordpaste', '|', 'justifycenter', 'justifyright','justifyfull', 'indent', 'outdent','clearhtml', 'quickformat', '|','formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold','italic', 'underline', 'strikethrough', 'lineheight', 'removeformat','image', 'multiimage', 'link', 'unlink', 'fullscreen'];
        }else if(tools=='copyright'){
            items = ['source','undo', 'redo', '|', 'justifycenter', 'justifyright','justifyfull', 'indent', 'outdent', 'forecolor', 'bold','italic','removeformat'];
        }
        $.getScript('data/static/kindeditor/kindeditor-min.js', function () {
            KindEditor.basePath = 'data/static/kindeditor/';
            var editor = KindEditor.create('.kindeditor', {
                uploadJson: 'data/static/kindeditor/php/upload_json.php',
                fileManagerJson: 'data/static/kindeditor/php/file_manager_json.php',
                allowFileManager: true,
                items : items,
                afterBlur: function () { editor.sync(); },
            });
        });
    });   

转载于:https://www.cnblogs.com/xiaoziwuzui/p/3898738.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值