forked from JoneXiong/YouMd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.html
More file actions
76 lines (68 loc) · 2.63 KB
/
editor.html
File metadata and controls
76 lines (68 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="zh_CN">
<head>
<link rel="stylesheet" href="/static/editormd/css/editormd.min.css" />
<script src="/static/js/jquery.min.js"></script>
<script src="/static/editormd/editormd.min.js"></script>
<script src="/static/js/publish-dialog.js"></script>
<script type="text/javascript">
$(function() {
var loadicon = true;
$('#editormd textarea').val( window.localStorage.getItem('youmd_content') );
var editor = editormd("editormd", {
width: "90%",
height: 700,
emoji : true, //www.emoji-cheat-sheet.com
taskList : true,
tocm : true, // Using [TOCM]
tex : true, // 开启科学公式TeX语言支持,默认关闭 http://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.css
flowChart : true, // 开启流程图支持,默认关闭
sequenceDiagram : true, // 开启时序/序列图支持,默认关闭,
path : "/static/editormd/lib/", // Autoload modules mode, codemirror, marked... dependents libs path
imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp"],
imageUploadURL : "./upload",
onchange : function() {
window.localStorage.setItem("youmd_content",this.getValue());
},
onload : function(){
this.fullscreen();
},
toolbarIcons : function() {
if (loadicon){
window.editormd.toolbarModes.full.push("||", "publish");
loadicon = false;
}
return window.editormd.toolbarModes.full;
},
toolbarIconTexts : {
publish : "一键发布" // 如果没有图标,则可以这样直接插入内容,可以是字符串或HTML标签
},
lang : {
toolbar : {
publish : "发布到博客服务端存储",
}
},
toolbarHandlers : {
publish : function(cm, icon, cursor, selection) {
this.publishDialog();
//this.executePlugin("publishDialog", "publish-dialog");
}
}
});
/*
// or
var editor = editormd({
id : "editormd",
path : "../lib/"
});
*/
});
</script>
</head>
<body>
<div id="editormd">
<textarea style="display:none;">### Hello Editor.md !</textarea>
</div>
</body>
</html>