码迷,mamicode.com
首页 > 其他好文 > 详细

dwz和 kindeditor整合的问题

时间:2014-08-08 12:02:45      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:color   io   for   ar   问题   cti   html   line   

开发一个新项目需要用到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(); },
            });
        });
    });   

dwz和 kindeditor整合的问题,布布扣,bubuko.com

dwz和 kindeditor整合的问题

标签:color   io   for   ar   问题   cti   html   line   

原文地址:http://www.cnblogs.com/xiaoziwuzui/p/3898738.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!