-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
editor.html
508 lines (474 loc) · 29.6 KB
/
editor.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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title data-i18n="page_title.editor">Echo Live 编辑器</title>
<link rel="icon" href="res/image/favicon.ico">
<link rel="stylesheet" href="lib/driver/driver.css">
<link rel="stylesheet" href="res/style/fh-ui.css">
<link rel="stylesheet" href="res/style/editor.css">
<link rel="stylesheet" href="res/style/editor-only.css">
<link rel="stylesheet" href="res/style/editor-accessibility.css">
<link rel="stylesheet" href="res/style/driver-custom.css">
<link rel="stylesheet" href="res/style/markdown.css">
<script src="lib/jquery-3.7.1.min.js"></script>
<script src="lib/driver/driver.js.iife.js"></script>
<script src="lib/markdown/marked.min.js"></script>
<script src="res/script/config-load-fail.js"></script>
<script src="config.js" onerror="configLoadFail()"></script>
<script src="app.js"></script>
<script src="res/class/EchoLiveSystem.js"></script>
<script src="res/data/root.js"></script>
<script src="lang/index.js"></script>
<script src="res/class/Translator.js"></script>
<script id="translator-init">
const translator = new Translator(config.global.language);
const $t = function(...e) {
return translator.output(...e);
};
translator.init();
</script>
<script src="res/data/palette.js"></script>
<script src="res/data/emoji.js"></script>
<script src="res/class/Icon.js"></script>
<script src="res/class/EchoLiveTools.js"></script>
<script src="res/class/SystemNotice.js"></script>
<script src="res/class/LocalStorageManager.js"></script>
<script src="res/class/EchoLiveEditor.js"></script>
<script src="res/class/EchoLiveBroadcast.js"></script>
<script src="res/class/FHUI.js"></script>
<script src="res/class/EditorConstructor.js"></script>
<script src="res/class/UniverseWindow.js"></script>
<script src="res/class/EmojiHako.js" defer></script>
<script src="res/class/Commander.js"></script>
</head>
<body>
<span class="holy-fucking-shit">如果你看到了这句话,要么就是你没解压,要么就是软件结构受到了破坏。<br>If you're seeing this, either you didn't unzip the file or the software structure is corrupted.</span>
<main>
<!-- 标签页标题 -->
<nav id="echo-editor-nav" class="tabpage-nav" data-navid="main">
<button
id="tabpage-nav-ptext"
class="tabpage-nav-item"
data-pageid="ptext"
role="tab"
aria-selected="true"
accesskey="1"
title="文本编辑器 [alt+1]"
data-i18n="editor.tabpage.editor.title"
data-i18n-title="editor.tabpage.editor.description"
>编辑器</button>
<button
class="tabpage-nav-item hide"
data-pageid="rtext"
role="tab"
aria-selected="false"
accesskey="5"
title="包含特殊样式的文本 [alt+5]"
>富文本</button>
<button
id="tabpage-nav-config"
class="tabpage-nav-item"
data-pageid="config"
role="tab"
aria-selected="false"
accesskey="2"
title="编辑配置 [alt+2]"
data-i18n="editor.tabpage.config.title"
data-i18n-title="editor.tabpage.config.description"
>配置</button>
<button
id="tabpage-nav-output"
class="tabpage-nav-item"
data-pageid="output"
role="tab"
aria-selected="false"
accesskey="3"
title="输出代码 [alt+3]"
data-i18n="editor.tabpage.output.title"
data-i18n-title="editor.tabpage.output.description"
>输出</button>
<button
class="tabpage-nav-item hide"
data-pageid="broadcast"
role="tab"
aria-selected="false"
accesskey="6"
title="广播控制 [alt+6]"
data-i18n="editor.tabpage.broadcast.title"
data-i18n-title="editor.tabpage.broadcast.description"
>广播</button>
<button
id="tabpage-nav-log"
class="tabpage-nav-item"
data-pageid="log"
role="tab"
aria-selected="false"
accesskey="4"
title="运行日志 [alt+4]"
data-i18n-title="editor.tabpage.log.description"
>
<span data-i18n="editor.tabpage.log.title">日志</span>
<span id="log-message-mark" class="hide" aria-hidden="true">1</span>
</button>
</nav>
<!-- 标签页面板 -->
<div class="tabpage-centent" data-navid="main">
<!-- 纯文本标签页 -->
<section class="tabpage-panel" role="tabpanel" data-pageid="ptext">
<h2 class="tabpage-panel-title" data-i18n="editor.tabpage.editor.title">编辑器</h2>
<div class="echo-editor-form">
<div class="echo-live-client-state hide">
<label data-i18n="editor.form.label.live_client_state">对话框状态</label>
<div class="echo-live-client-state-content">
<div class="echo-live-client-state-block"></div>
</div>
</div>
<label for="ptext-character" data-i18n="editor.form.label.character">说话人</label>
<input type="text" name="character" id="ptext-character" autocomplete="off">
<div id="ptext-editor" class="editor-container">
<div class="editor-controller disabled"></div>
<label for="ptext-content" data-i18n="editor.form.label.content">内容</label>
<textarea
name="content"
id="ptext-content"
aria-label="纯文本内容编辑框"
data-i18n-aria-label="editor.form.aria_label.content_plain_text"
></textarea>
<div class="editor-bottom-bar">
<span class="length">0 字符</span>
</div>
</div>
<div class="collapse">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" id="ptext-collapse-use-formatting-code" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text" data-i18n="editor.form.label.use_formatting_code">使用快速格式化代码</span>
<input type="hidden" name="ptext-chk-use-formatting-code" id="ptext-chk-use-formatting-code" value="0">
</button>
</div>
<div class="collapse-content hide" style="padding: 0.5em; font-size: var(--font-size-small); color: var(--text-secondary);">
<p data-i18n="editor.form.description.formatting_code_example_1"></p>
<p data-i18n="editor.form.description.formatting_code_example_2"></p>
<p><a class="fh-link" href="https://sheep-realms.github.io/Echo-Live-Doc/message/formatting-code/" target="_blank" data-i18n="editor.form.description.formatting_code_example_3"></a></p>
</div>
</div>
<div class="collapse">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text" data-i18n="editor.form.label.startup_parameter">启动参数</span>
<input type="hidden" name="ptext-chk-more" id="ptext-chk-more" value="0">
</button>
</div>
<div class="collapse-content hide">
<div class="echo-editor-form-row">
<label for="ptext-ipt-print-speed" data-i18n="editor.form.label.print_speed">打印速度</label>
<input type="number" name="print-speed" id="ptext-ipt-print-speed" class="reset" value="30" data-default="30" min="4">
</div>
<div class="echo-editor-form-checkbox-list">
<span class="echo-editor-form-input-tip" data-i18n="editor.form.description.print_speed"></span>
</div>
</div>
</div>
<div class="collapse">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text" data-i18n="editor.form.label.quote">引用符号</span>
<input type="hidden" name="ptext-chk-quote" id="ptext-chk-quote" value="0">
</button>
</div>
<div class="collapse-content hide">
<div class="echo-editor-form-row">
<label for="ptext-ipt-quote-before" data-i18n="editor.form.label.quote_before">开头</label>
<input type="text" name="quote-before" id="ptext-ipt-quote-before" class="reset" value="「" data-default="「">
</div>
<div class="echo-editor-form-row">
<label for="ptext-ipt-quote-after" data-i18n="editor.form.label.quote_after">结尾</label>
<input type="text" name="quote-after" id="ptext-ipt-quote-after" class="reset" value="」" data-default="」">
</div>
<div class="echo-editor-form-checkbox-list">
<span class="echo-editor-form-input-tip" data-i18n="editor.form.description.quote"></span>
</div>
</div>
</div>
<div class="collapse hide" id="collapse-split-message">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text" data-i18n="editor.form.label.split_message"></span>
<input type="hidden" name="ptext-chk-use-split-message" id="ptext-chk-split-message" value="0">
</button>
</div>
<div class="collapse-content hide" style="padding: 0.5em; font-size: 14px; color: var(--text-secondary);">
<p data-i18n="editor.form.description.split_message_example_1"></p>
<p data-i18n="editor.form.description.split_message_example_2"></p>
</div>
</div>
<button role="checkbox" aria-selected="false" class="checkbox hide" id="checkbox-sent-clear">
<span class="icon"></span>
<span class="text" data-i18n="editor.form.label.sent_clear"></span>
<input type="hidden" name="ptext-chk-sent-clear" id="ptext-chk-sent-clear" value="0">
</button>
<div class="editor-controller-bottom fh-flex-row fh-controller">
<button id="ptext-btn-clear" class="fh-button fh-big fh-danger" data-i18n="ui.reset">重置</button>
<button id="ptext-btn-submit" class="fh-button fh-big" data-i18n="ui.output">输出</button>
<button id="ptext-btn-send" class="fh-button fh-big hide" data-i18n="ui.send">发送</button>
</div>
</div>
</section>
<!-- 富文本标签页 -->
<section class="tabpage-panel hide" role="tabpanel" data-pageid="rtext">
<h2 class="tabpage-panel-title">富文本</h2>
<p style="color: red;">该页面正在施工中,暂不可用。</p>
<div class="echo-editor-form">
<label for="ptext-character">说话人</label>
<input type="text" name="character" id="rtext-character">
<div class="editor-text">
<div class="editor-text-item">
<label for="text">字段</label>
<div class="editor-text-title">
<span style="color: var(--text-regular);">正在编辑:<span class="editor-text-index-now">1</span></span>
<span>
<button id="rtext-btn-text-clear" class="fh-button fh-danger">清空</button>
<button id="rtext-btn-text-save" class="fh-button">暂存 →</button>
<input type="hidden" id="editor-text-index-now" name="editor-text-index-now" value="0">
</span>
</div>
<div class="editor-text-controller">
<button role="checkbox" aria-selected="false" class="checkbox">
<span class="icon"></span>
<span class="text">粗体</span>
<input type="hidden" name="editor-text-controller-bold" value="0">
</button>
<button role="checkbox" aria-selected="false" class="checkbox">
<span class="icon"></span>
<span class="text">斜体</span>
<input type="hidden" name="editor-text-controller-italic" value="0">
</button>
<button role="checkbox" aria-selected="false" class="checkbox">
<span class="icon"></span>
<span class="text">下划线</span>
<input type="hidden" name="editor-text-controller-underline" value="0">
</button>
<button role="checkbox" aria-selected="false" class="checkbox">
<span class="icon"></span>
<span class="text">颜色</span>
<input type="hidden" name="editor-text-controller-color" value="0">
</button>
<input type="text" name="" id="" style="width: 5.5em; text-align: center;" class="reset" value="#000000" data-default="#000000">
</div>
<textarea name="text" id="rtext-text" class="rtext-text" aria-label="字段编辑框"></textarea>
<div class="collapse">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text">打字模拟</span>
<input type="hidden" name="rtext-chk-typewrite" id="rtext-chk-typewrite" value="0">
</button>
</div>
<div class="collapse-content hide">
<div class="echo-editor-form-row">
<label for="typewrite">被替换的内容</label>
<input type="text" name="typewrite" class="reset" value="" data-default="">
</div>
<div class="echo-editor-form-checkbox-list">
<span class="echo-editor-form-input-tip">例如:shu'ru'fa</span>
</div>
</div>
</div>
<div class="collapse">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text">自定义样式</span>
<input type="hidden" name="rtext-chk-style" id="rtext-chk-style" value="0">
</button>
</div>
<div class="collapse-content hide">
<textarea name="style" id="rtext-style" class="rtext-style code" aria-label="CSS样式编辑框"></textarea>
<span class="echo-editor-form-input-tip">自定义内联 CSS 样式。</span>
<div class="echo-editor-form-row">
<label for="class">类</label>
<input type="text" name="class" class="reset" value="" data-default="">
</div>
<div class="echo-editor-form-checkbox-list">
<span class="echo-editor-form-input-tip">该字段的类属性,使用空格分隔。</span>
</div>
</div>
</div>
<div class="collapse">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text">杂项</span>
<input type="hidden" name="rtext-chk-misc" id="rtext-chk-misc" value="0">
</button>
</div>
<div class="collapse-content hide">
<div class="echo-editor-form-row">
<label for="pause">完成后停顿</label>
<input type="number" name="pause" id="rtext-ipt-pause" class="reset" value="10" data-default="10">
</div>
<div class="echo-editor-form-checkbox-list">
<span class="echo-editor-form-input-tip">当前字段打印完毕后的停顿循环次数。</span>
</div>
</div>
</div>
</div>
<div class="editor-text-list">
<label>字段列表</label>
<div class="editor-text-list-content">
<div class="editor-text-list-item">
<span class="index">1.</span>
<span class="text"></span>
<span class="btn">
<button class="fh-button fh-small">编辑</button>
<button class="fh-button fh-small fh-danger">删除</button>
</span>
</div>
</div>
<button id="editor-text-list-add" class="fh-button fh-ghost fh-block">新增字段</button>
</div>
</div>
<div class="collapse">
<div class="collapse-title">
<button role="checkbox" aria-selected="false" class="checkbox collapse-checkbox">
<span class="icon"></span>
<span class="text">启动参数</span>
<input type="hidden" name="rtext-chk-more" id="rtext-chk-more" value="0">
</button>
</div>
<div class="collapse-content hide">
<div class="echo-editor-form-row">
<label for="print-speed">打印速度</label>
<input type="number" name="print-speed" id="rtext-ipt-print-speed" class="reset" value="30" data-default="30">
</div>
<div class="echo-editor-form-checkbox-list">
<span class="echo-editor-form-input-tip">每个打印循环的延迟时间(毫秒),默认为 30<span class="print-speed-change hide">,您的默认配置为 <span class="print-speed-config"></span></span>。数字越大,耗时越长。中日韩字符延迟 × 2。</span>
</div>
</div>
</div>
<div class="editor-controller-bottom fh-flex-row fh-controller">
<button id="rtext-btn-clear" class="fh-button fh-big fh-danger">重置</button>
<button id="rtext-btn-submit" class="fh-button fh-big">输出</button>
</div>
</div>
</section>
<!-- 配置标签页 -->
<section class="tabpage-panel hide" role="tabpanel" data-pageid="config">
<h2 class="tabpage-panel-title" data-i18n="editor.tabpage.config.title">配置</h2>
<div class="echo-editor-form">
<label for="config-output-before" data-i18n="editor.form.label.output_before">头部内容</label>
<textarea name="output-before" id="config-output-before" class="code"></textarea>
<button role="checkbox" aria-selected="false" class="checkbox">
<span class="icon"></span>
<span class="text" data-i18n="editor.form.description.output_before">在输出内容之前插入头部内容</span>
<input type="hidden" name="config-output-use-before" id="config-output-use-before" value="0">
</button>
<label for="config-output-after" data-i18n="editor.form.label.output_after">尾部内容</label>
<textarea name="output-after" id="config-output-after" class="code"></textarea>
<button role="checkbox" aria-selected="false" class="checkbox">
<span class="icon"></span>
<span class="text" data-i18n="editor.form.description.output_before">在输出内容之后插入尾部内容</span>
<input type="hidden" name="config-output-use-after" id="config-output-use-after" value="0">
</button>
<p style="margin-top: 1rem; font-size: var(--font-size-middle);"><a class="fh-link" id="link-open-settings" href="settings.html" target="_blank" data-i18n="editor.form.description.open_settings"></a></p>
</div>
</section>
<!-- 输出标签页 -->
<section class="tabpage-panel hide" role="tabpanel" data-pageid="output">
<h2 class="tabpage-panel-title" data-i18n="editor.tabpage.output.title">输出</h2>
<!-- 嵌套 -->
<nav id="echo-editor-nav-output" class="tabpage-nav" data-navid="output">
<button
id="tabpage-nav-output-content"
class="tabpage-nav-item"
data-pageid="content"
role="tab"
aria-selected="true"
title="编辑导出代码和发送消息"
data-i18n="editor.tabpage.output_content.title"
data-i18n-title="editor.tabpage.output_content.description"
>输出内容</button>
<button
class="tabpage-nav-item"
data-pageid="history"
role="tab"
aria-selected="false"
title="已发送消息的列"
data-i18n="editor.tabpage.history.title"
data-i18n-title="editor.tabpage.history.description"
>历史记录</button>
</nav>
<div class="tabpage-centent" data-navid="output">
<!-- 输出内容标签页 -->
<section class="tabpage-panel" role="tabpanel" data-pageid="content">
<h3 class="tabpage-panel-title" data-i18n="editor.tabpage.output_content.title">输出内容</h3>
<div class="echo-editor-form">
<div class="echo-live-client-state hide">
<label data-i18n="editor.form.label.live_client_state">对话框状态</label>
<div class="echo-live-client-state-content">
<div class="echo-live-client-state-block"></div>
</div>
</div>
<label for="output-content" data-i18n="editor.form.label.output_content">输出内容</label>
<textarea
name="content"
id="output-content"
class="code"
aria-label="输出内容编辑框"
data-i18n-aria-label="editor.form.aria_label.output_content"
></textarea>
<div class="editor-controller-bottom fh-flex-row fh-controller">
<button id="output-btn-clear" class="fh-button fh-big fh-danger" data-i18n="ui.clear">清空</button>
<button id="output-btn-send" class="fh-button fh-big hide" data-i18n="ui.send">发送</button>
</div>
</div>
</section>
<!-- 历史记录标签页 -->
<section class="tabpage-panel hide" role="tabpanel" data-pageid="history">
<h3 class="tabpage-panel-title" data-i18n="editor.tabpage.history.title">历史记录</h3>
<div id="history-message-list">
</div>
<div id="history-editor-controller" class="editor-controller-bottom fh-flex-row fh-controller">
<button id="history-btn-clear" class="fh-button fh-big fh-ghost fh-danger" data-i18n="editor.history.clear">清空历史记录</button>
</div>
</section>
</div>
</section>
<!-- 广播标签页 -->
<section class="tabpage-panel hide" role="tabpanel" data-pageid="broadcast">
<h2 class="tabpage-panel-title" data-i18n="editor.tabpage.broadcast.title">广播</h2>
<p style="color: red;">该页面正在施工中,暂不可用。</p>
<p>恭喜你发现了隐藏页面:广播!</p>
<p>这里计划添加一些功能按键用于控制对话框。</p>
</section>
<!-- 日志标签页 -->
<section class="tabpage-panel hide" role="tabpanel" data-pageid="log">
<h2 class="tabpage-panel-title" data-i18n="editor.tabpage.log.title">日志</h2>
<div
id="editor-log"
aria-label="这里是日志列表,如果您听到了这句话,请注意,这里的阅读体验可能会很差。"
data-i18n-aria-label="editor.form.aria_label.log_box"
role="log"
></div>
</section>
</div>
</main>
<div id="commander-input-panel" class="hide">
<div class="commander-input-left"></div>
<textarea id="commander-input" class="code" data-i18n-aria-label="editor.form.aria_label.commander" rows="1" enterkeyhint="send"></textarea>
<div class="commander-input-right"></div>
<div class="commander-function-mode-label" data-i18n="command.common.label.function_mode"></div>
</div>
<div id="fh-notice" aria-live="polite"></div>
<script src="res/script/i18n.js" defer></script>
<script src="res/script/editor-common.js" defer></script>
<script src="res/script/editor.js" defer></script>
<script src="res/script/editor-file-picker.js" defer></script>
<script src="res/script/help/editor-help.js" defer></script>
</body>
</html>