Kindeditorの初期化、および初期設定の編集

A、Kindeeitor
  • あなたは、指定したフォルダにダウンロードした後
    の参照
<head>
    <meta charset="UTF-8">
    <title>NewsAdd</title>
    <link href="/static/bootstrap3/css/bootstrap.css" rel="stylesheet">
    <link href="/static/plugins/sweetalert/sweetalert.css" rel="stylesheet" />
    <script type="text/javascript" src="/static/kindeditor/kindeditor-all-min.js"></script>
</head>
  • 初期化
        KindEditor.ready(function (k) {
            editor=k.create(
                "#article-content",
                {
                    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',
                             'insertfile', 'table', 'hr', 'pagebreak',
                            'anchor', 'link', 'unlink'
                    ],
                    allowPreviewEmoticons : false,
                    // 去掉远程上传的功能
                    allowImageRemote : false,
                    uploadJson : '/upload/image/',
                    afterBlur: function () { this.sync(); }
                }
            );

        });
  • 初期設定の編集
        var initInterval = setInterval(function () {
            if(articleObj!=null&&editor!=null){
                editor.html(articleObj.content.replace(/\n\t/g,''));
                editor.sync();
                clearInterval(initInterval);
            }
        },100);

おすすめ

転載: www.cnblogs.com/shiqi17/p/12343517.html