1.0.4 • Published 7 years ago

plus-editor.md v1.0.4

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

plus-editor.md

Markdown Editor for ThinkSNS+

Usage

<!-- iconfont -->
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
<!-- css -->
<link rel="stylesheet" href="./dist/pluseditor.css">
<!-- node -->
<textarea id="editor" style="display: none"></textarea>
<!-- js -->
<script src='./dist/pluseditor.js'></script>
var options = {
    element: document.querySelector('#editor'),
    /**
     * 自定义 MD 解析, FilesPatch
     * @type {String}
     */
    fileApiPath: "http://localhost/api/v2/files/",
    /**
     * 自定义文件上传
     * @param  {Object}   file
     * @param  {Function} cb
     */
    uploadFile: function(file, cb){
        console.log(file);
        cb(ID);
    }
}
var editor = new PlusEditor(options);

语法高亮需要添加 editor.gui.sideBySide.classList.add('markdown-body');

Get/set the content

editor.value();
editor.value("This text will appear in the editor");
1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago