-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.html
338 lines (321 loc) · 14.5 KB
/
edit.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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Web Page Editor</title>
</head>
<body>
<!-- Bootstrap -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"/>
<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin-ext"/>
<!-- The application -->
<div class="d-flex p-1" style="height: 100vh">
<div class="d-flex flex-column w-50">
<nav>
<ul class="nav nav-tabs" id="left-pane-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link" id="head-tab" data-toggle="tab" href="#head" role="tab">Options</a>
</li>
</ul>
</nav>
<div class="tab-content flex-grow-1 position-relative border-left" id="left-pane" style="border-right-style: ridge;">
<form class="tab-pane p-3 w-100 full-height" id="head" role="tabpanel" aria-labelledby="head-tab">
<h2>Title</h2>
<fieldset class="container-fluid">
<div class="form-group row">
<label for="opt-h1-title" class="col-lg-3 col-md-12 col-form-label">
Document Title
</label>
<div class="col-lg-9 col-md-12">
<input id="opt-h1-title" class="form-control"/>
</div>
</div>
<div class="form-group row">
<label for="opt-head-title" class="col-lg-3 col-md-12 col-form-label">
Tab Name
</label>
<div class="col-lg-9 col-md-12">
<input id="opt-head-title" disabled class="form-control"/>
</div>
</div>
<div class="form-group row">
<div class="col-3">
</div>
<div class="col-lg-9 col-md-12">
<div class="form-check">
<input type="checkbox" id="opt-sync-title" checked class="form-check-input"/>
<label for="opt-sync-title" class="form-check-label">Synchronize with document title</label>
</div>
</div>
</div>
</fieldset>
<h2>Libraries & Toolkits</h2>
<div class="container-fluid">
<table class="table">
<tr id="opt-jquery">
<th>jQuery</th>
<td>
<label class="m-0">
<input type="radio" name="jquery" value="none" id="opt-jquery-none" checked/>
None
</label>
</td>
<td>
<label class="m-0">
<input type="radio" name="jquery" value="jQuerySlim" id="opt-jquery-slim"/>
Slim
</label>
</td>
<td>
<label class="m-0">
<input type="radio" name="jquery" value="jQuery"/>
Full
</label>
</td>
</tr>
<tr id="opt-bootstrap">
<th>Bootstrap</th>
<td>
<label class="m-0">
<input type="radio" name="bootstrap" value="none" checked/>
None
</label>
</td>
<td>
<label class="m-0">
<input type="radio" name="bootstrap" value="bootstrap"/>
Core CSS
</label>
</td>
<td>
<label class="m-0">
<input type="radio" name="bootstrap" value="bootstrapFull"/>
CSS + JS
</label>
</td>
</tr>
<tr>
<th>Other</th>
<td colspan="3">
<div class="form-check">
<input type="checkbox" id="opt-popper" class="form-check-input"/>
<label for="opt-popper" class="form-check-label">Popper.js</label>
</div>
<div class="form-check">
<input type="checkbox" id="opt-mathjax" class="form-check-input"/>
<label for="opt-mathjax" class="form-check-label">MathJax (LaTeX math)</label>
</div>
</td>
</tr>
</table>
</div>
</form>
</div>
</div>
<div class="d-flex flex-column w-50">
<nav>
<ul class="nav nav-tabs" id="right-pane-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link" id="preview-tab" data-toggle="tab" href="#preview" role="tab">Preview</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="help-tab" data-toggle="tab" href="#help" role="tab" aria-selected="true">Help</a>
</li>
</ul>
</nav>
<div class="tab-content flex-grow-1 position-relative border-left border-right" id="right-pane">
<div class="tab-pane w-100 full-height d-flex flex-column" role="tabpanel" aria-labelledby="preview-tab" id="preview">
<header class="network-header">
<h1 id="title"></h1>
</header>
<iframe class="flex-grow-1" id="preview-frame" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-scripts"></iframe>
<!-- Don't allow: Payment API, modals, screen orientation lock, same-origin, top navigation -->
</div>
<iframe class="tab-pane show active w-100 full-height" id="help" role="tabpanel" aria-labelledby="help-tab" src="help/index.html#content"></iframe>
</div>
</div>
</div>
<div hidden>
<div id="html-toolbar" class="toolbar-area bg-light">
<div class="btn-toolbar p-1" role="toolbar">
<div class="btn-group btn-group-sm" role="group" aria-label="HTML tag insertion">
<button type="button" class="btn btn-secondary" id="insert-button" data-toggle="modal" data-target="#insert-modal" title="Insert new content"><></button>
</div>
</div>
</div>
</div>
<div id="insert-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="insert-modal-heading" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="insert-modal-heading">Insert a HTML Tag</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body d-flex p-0 bg-dark">
<nav class="bg-light">
<ul class="list-group list-group-flush" role="tablist" aria-orientation="vertical">
<li>
<a class="list-group-item list-group-item-action" id="insert-heading-tab" data-toggle="list" href="#insert-heading" role="tab" aria-controls="insert-heading" aria-selected="false">Headings</a>
</li>
<li>
<a class="list-group-item list-group-item-action active" id="insert-paragraph-tab" data-toggle="list" href="#insert-paragraph" role="tab" aria-controls="insert-paragraph" aria-selected="true">Paragraphs</a>
</li>
<li>
<a class="list-group-item list-group-item-action" id="insert-break-tab" data-toggle="list" href="#insert-break" role="tab" aria-controls="insert-break" aria-selected="false">Breaks</a>
</li>
<li>
<a class="list-group-item list-group-item-action" id="insert-list-tab" data-toggle="list" href="#insert-list" role="tab" aria-controls="insert-list">Lists</a>
</li>
</ul>
</nav>
<div class="tab-content p-3" id="insert-modal-content">
<div class="tab-pane" id="insert-heading" role="tabpanel" aria-labelledby="insert-heading-tab">
<div class="button-menu">
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('h2')">
<div class="menu-button-name">Heading</div>
<div><span class="badge badge-pill badge-info"><h2></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('h3')">
<div class="menu-button-name">Subheading</div>
<div><span class="badge badge-pill badge-info"><h3></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('h4')">
<div class="menu-button-name">Sub-Subheading</div>
<div><span class="badge badge-pill badge-info"><h4></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('h5')">
<div class="menu-button-name">Paragraph Title</div>
<div><span class="badge badge-pill badge-info"><h5></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('h6')">
<div class="menu-button-name">Subparagraph</div>
<div><span class="badge badge-pill badge-info"><h6></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('h1')">
<div class="menu-button-name">Chapter Title</div>
<div><span class="badge badge-pill badge-info"><h1></span></div>
</button>
</div>
</div>
<div class="tab-pane show active" id="insert-paragraph" role="tabpanel" aria-labelledby="insert-paragraph-tab">
<div class="button-menu">
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('p')">
<div class="menu-button-name">Paragraph</div>
<div><span class="badge badge-pill badge-info"><p></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('address')">
<div class="menu-button-name">Contact Address</div>
<div><span class="badge badge-pill badge-info"><address></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('pre')">
<div class="menu-button-name">Pre-Formatted Text</div>
<div><span class="badge badge-pill badge-info"><pre></span></div>
</button>
</div>
</div>
<div class="tab-pane show" id="insert-break" role="tabpanel" aria-labelledby="insert-break-tab">
<div class="button-menu">
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('br')">
<div class="menu-button-name">New Line</div>
<div><span class="badge badge-pill badge-info"><br></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" onclick="insertHTML('hr')">
<div class="menu-button-name">New Theme</div>
<div><span class="badge badge-pill badge-info"><hr></span></div>
</button>
</div>
</div>
<div class="tab-pane show" id="insert-list" role="tabpanel" aria-labelledby="insert-list-tab">
<form class="button-menu">
<button class="btn btn-light d-flex justify-content-between" type="button" onclick="insertHTML('ul')">
<div class="menu-button-name">Bullet Points</div>
<div><span class="badge badge-pill badge-info"><ul></span></div>
</button>
<fieldset class="form-group bg-secondary text-light p-3">
<div class="form-group">
<button class="btn btn-light d-flex justify-content-between w-100" type="button" onclick="insertHTML('ol', 'insert-list-start', 'insert-list-direction')">
<div class="menu-button-name">Numbered List</div>
<div><span class="badge badge-pill badge-info"><ol></span></div>
</button>
</div>
<div class="form-group form-inline ml-4">
<label for="insert-list-start" class="form-label-sm">
From
</label>
<input class="form-control form-control-sm" id="insert-list-start" type="number" value="1" step="1" style="width: 4em"/>
<label for="insert-list-direction" class="form-label-sm">
counting
</label>
<select class="form-control form-control-sm" id="insert-list-direction">
<option value="up">up</option>
<option value="down">down</option>
</select>
</div>
</fieldset>
<button class="btn btn-light d-flex justify-content-between" type="button" onclick="insertHTML('dl')">
<div class="menu-button-name">Glossary</div>
<div><span class="badge badge-pill badge-info"><dl></span></div>
</button>
<button class="btn btn-light d-flex justify-content-between" type="button" onclick="insertHTML('nav')">
<div class="menu-button-name">Navigation Links</div>
<div><span class="badge badge-pill badge-info"><nav></span></div>
</button>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- CodeMirror framework core -->
<link rel="stylesheet" href="lib/codemirror/codemirror.css"/>
<link rel="stylesheet" href="lib/codemirror/theme/eclipse.css"/>
<script src="lib/codemirror/codemirror.js"></script>
<!-- CodeMirror Add-ons -->
<!-- Autocomplete -->
<link rel="stylesheet" href="lib/codemirror/addon/hint/show-hint.css"/>
<script src="lib/codemirror/addon/hint/show-hint.js"></script>
<script src="lib/codemirror/addon/hint/css-hint.js"></script>
<script src="lib/codemirror/addon/hint/javascript-hint.js"></script>
<script src="lib/codemirror/addon/hint/xml-hint.js"></script>
<script src="lib/codemirror/addon/hint/html-hint.js"></script>
<!-- Folding -->
<script src="lib/codemirror/addon/fold/xml-fold.js"></script>
<!-- Editing -->
<script src="lib/codemirror/addon/edit/closebrackets.js"></script>
<script src="lib/codemirror/addon/edit/closetag.js"></script>
<script src="lib/codemirror/addon/edit/matchbrackets.js"></script>
<!-- Markdown -->
<script src="lib/codemirror/addon/edit/continuelist.js"></script>
<!-- Search -->
<script src="lib/codemirror/addon/scroll/annotatescrollbar.js"></script>
<link rel="stylesheet" href="lib/codemirror/addon/scroll/simplescrollbars.css"/>
<script src="lib/codemirror/addon/scroll/simplescrollbars.js"></script>
<script src="lib/codemirror/addon/search/searchcursor.js"></script>
<link rel="stylesheet" href="lib/codemirror/addon/search/matchesonscrollbar.css"/>
<script src="lib/codemirror/addon/search/matchesonscrollbar.js"></script>
<!-- Highlighting modes -->
<script src="lib/codemirror/mode/css/css.js"></script>
<script src="lib/codemirror/mode/javascript/javascript.js"></script>
<script src="lib/codemirror/mode/markdown/markdown.js"></script>
<script src="lib/codemirror/mode/xml/xml.js"></script>
<script src="lib/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<!-- The application -->
<link rel="stylesheet" href="network.css"/>
<link rel="stylesheet" href="site.css"/>
<link rel="stylesheet" href="edit.css"/>
<script src="util.js"></script>
<script src="jquery-extensions.js"></script>
<script src="edit.js"></script>
</body>
</html>