-
Notifications
You must be signed in to change notification settings - Fork 136
/
index.html
217 lines (200 loc) · 7.64 KB
/
index.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!doctype html>
<html>
<head>
<base href="./" >
<meta charset="utf-8">
<title>HyperMD Playground</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body>
<link rel="stylesheet" href="./demo/style.css">
<div id="loadSplash">
<h1>HyperMD</h1>
<p><b>Breaks the Wall</b> between <i>writing</i> and <i>preview</i>, in a Markdown Editor.</p>
<p>A WYSIWYG Markdown editor provided by <a href="https://laobubu.net">laobubu</a></p>
<p><a href="https://github.com/laobubu/hypermd/">[View on GitHub]</a></p>
<p> </p>
<div id="loadErrorSplash" style="display: none">
<p>Failed to load modules. <a href="#" onclick="location.reload()">Click here to Retry »</a></p>
<ul id="loadErrorList"></ul>
</div>
<p style="font-size:1.8em;text-align:center"><b><i>Loading...</i></b></p>
<p style="font-size:0.9em;text-align:center"><i id="loadingFileName"></i></p>
<p> </p>
</div>
<div id="math-preview" class="float-win float-win-hidden">
<div class="float-win-title">
<button class="float-win-close"><svg class="icon icon-cross"><use xlink:href="./demo/svgicon/symbol-defs.svg#icon-cross"></use></svg></button>
Math Preview
</div>
<div class="float-win-content" id="math-preview-content"></div>
</div>
<div id="winLab" class="float-win float-win-hidden">
<div class="float-win-title">
<button class="float-win-close"><svg class="icon icon-cross"><use xlink:href="./demo/svgicon/symbol-defs.svg#icon-cross"></use></svg></button>
Lab
</div>
<div class="float-win-content" style="column-count: 2">
<fieldset>
<legend>Behavior</legend>
<p>
<label lab-bind="Hover.enabled">
<input type="checkbox"><em>Hover</em>
<span class="opt-tip">hmdHover.enabled</span>
</label>
</p>
<p>
<label lab-bind="Click.enabled">
<input type="checkbox"><em>Click</em>
<span class="opt-tip">hmdClick.enabled</span>
</label>
</p>
<p>
<em>InsertFile</em> by
<label lab-bind="InsertFile.byPaste">
<input type="checkbox">Paste
<span class="opt-tip">hmdInsertFile.byPaste</span>
</label>
<label lab-bind="InsertFile.byDrop">
<input type="checkbox">Drag'n'Drop
<span class="opt-tip">hmdInsertFile.byDrop</span>
</label>
</p>
</fieldset>
<fieldset>
<legend><em>ReadLink</em></legend>
<p>
Resolve relative URL with <br>
<label lab-bind="ReadLink.baseURI">BaseURI
<input type="text" style="width: 250px">
<span class="opt-tip">hmdReadLink.BaseURI</span>
</label>
</p>
</fieldset>
<fieldset>
<legend>Appearance</legend>
<p>
<label lab-bind="TableAlign.enabled">
<input type="checkbox"><em>TableAlign</em>
<span class="opt-tip">hmdTableAlign.enabled</span>
</label>
</p>
<p>
<label lab-bind="HideToken.enabled">
<input type="checkbox"><em>HideToken</em>
<span class="opt-tip">hmdHideToken.enabled</span>
</label>
</p>
</fieldset>
<fieldset>
<legend><em>Fold</em></legend>
<p>
<label lab-bind lab-bind-fold="image">
<input type="checkbox">image
<span class="opt-tip">hmdFold.image</span>
</label>
<label lab-bind lab-bind-fold="link">
<input type="checkbox">link
<span class="opt-tip">hmdFold.link</span>
</label>
<label lab-bind lab-bind-fold="math">
<input type="checkbox">math
<span class="opt-tip">
<em>(Requires fold-math Addon)</em><br>
hmdFold.math
</span>
</label>
<label lab-bind lab-bind-fold="html">
<input type="checkbox">html
<span class="opt-tip at-right">
<em>(Requires fold-html Addon)</em><br>
hmdFold.html
</span>
</label>
<label lab-bind lab-bind-fold="emoji">
<input type="checkbox">emoji
<span class="opt-tip at-right">
<em>(Requires fold-emoji Addon)</em><br>
hmdFold.emoji
</span>
</label>
</p>
</fieldset>
<fieldset>
<legend><em>Demo Page</em> Features</legend>
<p><small>These features only work on current page.</small></p>
<p>
<label lab-bind lab-bind-demo="directOpen">
<input type="checkbox">directOpen
<span class="opt-tip">Click to open links, without alt / ctrl</span>
</label>
<label lab-bind lab-bind-demo="mathPreview">
<input type="checkbox">mathPreview
<span class="opt-tip at-right">Display a preview while writing TeX formula</span>
</label>
</p>
</fieldset>
</div>
</div>
<div id="editor_area">
<div id="toc"></div>
<textarea id="demo" style="display:none"></textarea>
</div>
<!-- for powerpack/fold-math-with-mathjax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX", "output/HTML-CSS","output/NativeMML","output/SVG"],
extensions: ["MathMenu.js","MathZoom.js", "AssistiveMML.js", "a11y/accessibility-menu.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
}
});
</script>
<!-- using require.js to solve the dependencies -->
<script src="./demo/vendor/require.js"></script>
<script src="./goods/patch-requirejs.js"></script>
<script src="./demo/requirejs_packages.js"></script>
<script src="./demo/index.js"></script>
<!-- for this demo only -->
<script src="./demo/float-win.js"></script>
<script src="./demo/math-preview.js"></script>
<script src="./demo/toc.js"></script>
<script src="./demo/lab.js"></script>
<!-- some useless test stuff -->
<div id="test-box">
<div class="test-item">
<button onclick="HyperMD.switchToNormal(editor)">
<svg class="icon icon-code"><use xlink:href="./demo/svgicon/symbol-defs.svg#icon-code"></use></svg> Normal
</button>
<div class="test-tooltip">Use default theme provided by CodeMirror, disable HyperMD's visual tricks.</div>
</div>
<div class="test-item">
<button onclick="HyperMD.switchToHyperMD(editor)">
<svg class="icon icon-magic"><use xlink:href="./demo/svgicon/symbol-defs.svg#icon-magic"></use></svg> HyperMD Mode
</button>
<div class="test-tooltip">Revert previous button's change.</div>
</div>
<div class="right test-item">
<button onclick="window.open('https://github.com/laobubu/hypermd/')">
<svg class="icon icon-github"><use xlink:href="./demo/svgicon/symbol-defs.svg#icon-github"></use></svg> <span class="phone-hidden">GitHub</span>
</button>
<div class="test-tooltip">View HyperMD on GitHub</div>
</div>
<div class="right test-item">
<button onclick="window.open(demo_page_baseurl + 'docs')">
<svg class="icon icon-book"><use xlink:href="./demo/svgicon/symbol-defs.svg#icon-book"></use></svg> <span class="phone-hidden">Documentation</span>
</button>
<div class="test-tooltip">Documentation</div>
</div>
<div class="test-item">
<button onclick="winLab.show(true)">
<svg class="icon icon-lab"><use xlink:href="./demo/svgicon/symbol-defs.svg#icon-lab"></use></svg> <span class="phone-hidden">Lab</span>
</button>
<div class="test-tooltip">Inspect editor (and demo page) options</div>
</div>
</div>
<script src="./demo/index2.js"></script>
<link rel="stylesheet" href="./demo/svgicon/style.css">
<script defer src="./demo/svgicon/svgxuse.js"></script>
</body>
</html>