增加清理附件按钮,对悬空无引用的图片/附件进行清理 (#918)

* add attach_clean & change_theme

* add attach_clean & change_theme

* add

* add readme

---------

Co-authored-by: root <root@DESKTOP-L84EQPB.localdomain>
This commit is contained in:
Sharklet
2023-12-19 13:19:31 +08:00
committed by GitHub
parent 0dbb5d7967
commit 71b8e528ff
13 changed files with 200 additions and 18 deletions

View File

@@ -71,7 +71,7 @@
"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", "|",
"help", "info"
"help", "changetheme", "info"
],
simple : [
"undo", "redo", "|",
@@ -79,12 +79,12 @@
"h1", "h2", "h3", "h4", "h5", "h6", "|",
"list-ul", "list-ol", "hr", "|",
"watch", "preview", "fullscreen", "|",
"help", "info"
"help", "changetheme", "info"
],
mini : [
"undo", "redo", "|",
"watch", "preview", "|",
"help", "info"
"help", "changetheme", "info"
]
};
@@ -94,8 +94,8 @@
name : "", // Form element name
value : "", // value for CodeMirror, if mode not gfm/markdown
theme : "", // Editor.md self themes, before v1.5.0 is CodeMirror theme, default empty
editorTheme : "default", // Editor area, this is CodeMirror theme at v1.5.0
previewTheme : "", // Preview area theme, default empty
editorTheme : "pastel-on-dark", //"default", // Editor area, this is CodeMirror theme at v1.5.0
previewTheme : "dark", //"", // Preview area theme, default empty
markdown : "", // Markdown source code
appendMarkdown : "", // if in init textarea value not empty, append markdown to textarea
width : "100%",
@@ -225,6 +225,7 @@
fullscreen : "fa-arrows-alt",
clear : "fa-eraser",
help : "fa-question-circle",
changetheme : "fa-info-circle",
info : "fa-info-circle"
},
toolbarIconTexts : {},
@@ -271,6 +272,7 @@
clear : "清空",
search : "搜索",
help : "使用帮助",
changetheme : "切换编辑主题",
info : "关于" + editormd.title
},
buttons : {
@@ -322,7 +324,10 @@
},
help : {
title : "使用帮助"
}
},
changetheme : {
title : "切换编辑主题"
},
}
}
};
@@ -3385,6 +3390,11 @@
this.executePlugin("helpDialog", "help-dialog/help-dialog");
},
changetheme : function() {
this.setEditorTheme((this.settings.editorTheme=="default")?"pastel-on-dark":"default");
this.setPreviewTheme((this.settings.previewTheme=="")?"dark":"");
},
info : function() {
this.showInfoDialog();
}