如何自定义editor.md的工具栏
2024-09-19 广告
<script type="text/javascript">
var testEditor;
$(function() {
testEditor = editormd("test-editormd", {
width : "90%",
height : 640,
syncScrolling : "single",
path : "./editormd/lib/",
//打开上传图片
imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "./uploadfile",
saveHTMLToTextarea : true,
toolbarIcons : function() {
// Or return editormd.toolbarModes[name]; // full, simple, mini
// Using "||" set icons align right.
//显示到工具栏的项目
return ["undo", "redo", "|", "bold", "del", "italic", "hr", "image", "table", "datetime", "|", "preview", "watch", "|", "fullscreen", ];
},
//下面这一行将使用dark主题
editorTheme: "pastel-on-dark",
theme: "gray",
previewTheme : "dark"
});
});
</script>
return后参数,不理解含义的可以和官网对应每个意思