From d2bdd7dc600424269afc21ac63493b789fe16efd Mon Sep 17 00:00:00 2001 From: yangjian Date: Tue, 26 Jan 2021 21:50:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96editor.md=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E5=9C=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app_doc/editor/tpl_editor_editormd.html | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/template/app_doc/editor/tpl_editor_editormd.html b/template/app_doc/editor/tpl_editor_editormd.html index 4c9d591..2b3d9a7 100644 --- a/template/app_doc/editor/tpl_editor_editormd.html +++ b/template/app_doc/editor/tpl_editor_editormd.html @@ -4,12 +4,20 @@ var iframe_whitelist = '{{ iframe_whitelist }}'.split(',') var md_changed = false; //初始化一个变量,用于判断编辑器是否修改 //初始化editormd - var editor = editormd("editor-md", { - width : "100%", - height : "800px", - placeholder : "道友,开始吧……", - toolbarIcons : function() { - return [ + if(screen_width.matches){ + var editormd_watch = false; + var editormd_height = window.innerHeight / 2 + 'px'; + var editormd_toobar = [ + "h2","h3", "bold", "del", "italic", "quote","kaiSpan", + "list-ul", "list-ol", "hr", "link", + "mindmap","echart","imgUpload", "attachment" ,"multimedia","code", "code-block", "htmltable", + "emoji", "pagebreak", + "watch", "preview", + ]; + }else{ + var editormd_watch = true; + var editormd_height = '800px' + var editormd_toobar = [ "undo", "redo", "|", "h2","h3","h4","h5", "bold", "del", "italic", "quote","kaiSpan", "list-ul", "list-ol", "hr", "link", "reference-link", @@ -18,6 +26,13 @@ "watch", "preview", "help" ] + } + var editor = editormd("editor-md", { + width : "100%", + height : editormd_height, + placeholder : "道友,开始吧……", + toolbarIcons : function() { + return editormd_toobar }, //自定义工具栏添加楷体按钮 toolbarIconTexts : { @@ -189,6 +204,7 @@ } }, //配置项 + watch :editormd_watch, pageBreak : true, //分页符 path : "/static/editor.md/lib/", saveHTMLToTextarea : true,