diff --git a/note/src/main/resources/template/js/note/noteEditMarkDown.js b/note/src/main/resources/template/js/note/noteEditMarkDown.js index 1c6462d657ddf7b0ad8894a6ca8de3bfdb589f3a..39e437a419b693da1dc279011d46258b4d84e906 100644 --- a/note/src/main/resources/template/js/note/noteEditMarkDown.js +++ b/note/src/main/resources/template/js/note/noteEditMarkDown.js @@ -49,6 +49,10 @@ layui.config({ onchange : function (){ if(!initFirst){ initFirst = true; + layEditor.config({ + tocContainer : "#custom-toc-container", + tocDropdown : false + }); }else{ parent.$("#editMyNote").addClass('select'); } diff --git a/note/src/main/resources/template/tpl/note/noteEditMarkDown.html b/note/src/main/resources/template/tpl/note/noteEditMarkDown.html index 4384409e34af49ffc843126b3308a25c2d8d7181..f515446053163ffcee9227923680b9df9d80f1f0 100644 --- a/note/src/main/resources/template/tpl/note/noteEditMarkDown.html +++ b/note/src/main/resources/template/tpl/note/noteEditMarkDown.html @@ -8,11 +8,44 @@ +
+ +
+
+ 目录 +
+
+
diff --git a/web/src/main/resources/template/assets/lib/editormd/js/editormd.js b/web/src/main/resources/template/assets/lib/editormd/js/editormd.js index 42d1436c7b8fc9b3516cf7e1ef8224c1271745f3..58d81ab4bd7f3b599b26f9e21d152b13a2c4c653 100644 --- a/web/src/main/resources/template/assets/lib/editormd/js/editormd.js +++ b/web/src/main/resources/template/assets/lib/editormd/js/editormd.js @@ -61,7 +61,7 @@ layui.define(["jquery"], function(exports) { "h1", "h2", "h3", "h4", "h5", "h6", "|", "list-ul", "list-ol", "hr", "|", "link", "reference-link", "image", "code", "preformatted-text", "code-block", "table", "datetime", "emoji", "html-entities", "pagebreak", "|", - "goto-line", "watch", "preview", "fullscreen", "clear", "search" + "goto-line", "watch", "preview", "fullscreen", "clear", "search", "catalogue" ], simple : [ "undo", "redo", "|", @@ -132,6 +132,7 @@ layui.define(["jquery"], function(exports) { onfullscreenExit : function() {}, onscroll : function() {}, onpreviewscroll : function() {}, + catalogue : function() {}, imageUpload : false, imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"], @@ -210,7 +211,8 @@ layui.define(["jquery"], function(exports) { fullscreen : "fa-arrows-alt", clear : "fa-eraser", help : "fa-question-circle", - info : "fa-info-circle" + info : "fa-info-circle", + catalogue : "fa-list" }, toolbarIconTexts : {}, @@ -256,7 +258,8 @@ layui.define(["jquery"], function(exports) { clear : "清空", search : "搜索", help : "使用帮助", - info : "关于" + editormd.title + info : "关于" + editormd.title, + catalogue : "目录" }, buttons : { enter : "确定", @@ -1425,9 +1428,9 @@ layui.define(["jquery"], function(exports) { var _this = this; var editor = this.editor; var settings = this.settings; - + this.codeMirror.remove(); - + this.setCodeMirror(); if (!settings.readOnly) @@ -3167,6 +3170,14 @@ layui.define(["jquery"], function(exports) { info : function() { this.showInfoDialog(); + }, + + catalogue: function (){ + if($("#markdownFolder").is(':hidden')){ + $("#markdownFolder").show(); + }else{ + $("#markdownFolder").hide(); + } } };