-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
524 lines (447 loc) · 13.1 KB
/
index.html
File metadata and controls
524 lines (447 loc) · 13.1 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
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
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RM Plugin Generator</title>
<!-- monaco -->
<link rel="stylesheet" data-name="vs/editor/editor.main"
href="https://unpkg.com/monaco-editor@latest/min/vs/editor/editor.main.css" />
<script>
var require = {
paths: { vs: "https://unpkg.com/monaco-editor@latest/min/vs" },
}
</script>
<script src="https://unpkg.com/monaco-editor@latest/min/vs/loader.js"></script>
<script src="https://unpkg.com/monaco-editor@latest/min/vs/editor/editor.main.js"></script>
<!-- css -->
<style>
body {
margin: 0;
padding: 8px 0;
font-family: monospace;
font-weight: bolder;
font-size: 16px;
background-color: #0003;
}
button {
transition: all 0.15s ease-in;
border: none;
/* background-color: #0001; */
background-color: #BEBEBE;
font-family: monospace;
font-size: 1em;
font-weight: bold;
}
.root_fold {
height: 25px;
}
.fold {
height: 25px;
overflow: hidden;
}
#build_result_button {
position: fixed;
left: calc(75% + 5px);
top: 8px;
border-color: transparent;
}
button:hover,
.root_title:hover,
#root_param .param_title:hover,
#root_param .param.block .param_input_type_isarray[onHover],
#root_command .block .command_parameter_group .param_input_type_isarray[onHover],
#root_command .command_title:hover,
#root_command .command_parameter_group>.list_cell>.param_title:hover {
background-color: #000a;
color: #fff9;
}
#root_param .param_title:hover>span,
#root_command .command_title:hover>span,
#root_command .command_parameter_group>.list_cell>.param_title:hover>span {
color: #fff9;
}
.root {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
width: 50%;
margin: 0 auto;
overflow: hidden;
border: 1px solid #aaaeb3;
border-bottom: none;
box-sizing: border-box;
}
#root>#root_command,
#root>#root_display {
/* overflow: visible; */
}
.root_title {
transition: all 0.15s ease-in;
width: 100%;
height: 25px;
text-align: center;
}
.title {
line-height: 24px;
}
.root:last-of-type {
border: 1px solid #aaaeb3;
}
.block {
width: 100%;
min-height: 1.5em;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
}
.block>.title {
width: 20%;
}
.sub_title {
width: 140px;
}
.origin_name {
font-size: small;
color: #0009;
}
.data {
border: none;
flex: auto;
}
label,
button,
.title {
user-select: none;
}
input,
textarea,
select {
width: 100%;
font-size: 1em;
font-family: monospace;
border: none;
padding: 0px;
overflow: hidden;
background-color: #0001;
}
input,
select {
transition: all 0.15s ease-in;
border-color: transparent;
height: 21px;
}
input:invalid {
transition: all 0.15s ease-in;
box-sizing: border-box;
border: 1px solid #C339;
box-shadow: 0 0 4px #F339;
}
#root_param .param.block select.param_input_type,
#root_command .block .command_parameter_group select.param_input_type {
width: calc(100% - 4px - 4em);
}
#root_param .param.block .param_input_type_isarray,
#root_command .block .command_parameter_group .param_input_type_isarray {
transition: all 0.15s ease-in;
width: 4em;
height: 21px;
background-color: #0001;
user-select: none;
}
#root_param .param.block .param_input_type_isarray[checked],
#root_command .block .command_parameter_group .param_input_type_isarray[checked] {
background-color: #000a;
color: #fff9;
}
.data>textarea,
#display_plugin>textarea {
resize: vertical;
height: 70px;
}
input:focus,
textarea:focus,
select:focus {
outline: none;
}
#root_param .param_title,
#root_command .command_title,
#root_param .param_title>span,
#root_command .command_title>span,
#root_command .command_parameter_group>.list_cell>.param_title,
#root_command .command_parameter_group>.list_cell>.param_title>span {
transition: all 0.15s ease-in;
}
.list_cell {
display: flex;
flex-direction: row;
align-items: center;
gap: 4px;
height: 25px;
}
.list_cell>input,
.list_cell>select {
flex: 7;
}
.group_list_cell {
padding-left: 1em;
}
.group_list_cell>.list_cell {
margin: 0;
}
.group_list_cell.param_type_select>.list_cell>* {
flex: 1;
width: 0;
}
.group_list_cell.param_type_select>.list_cell>span {
flex: 0.9;
}
.group_list_cell.param_type_select>.list_cell>div {
flex: 0.45;
}
.group_list_cell.param_type_combo>.list_cell>* {
flex: 34px;
}
.group_list_cell.param_type_combo>.list_cell>input {
flex: 5
}
.group_list_cell.param_type_combo>.list_cell>div {
flex: none;
margin: 0 4px 0 0;
}
.after_input_list,
.before_input_list {
display: flex;
flex-direction: column;
}
#root_command .command.block .command_input_list {
width: 80%;
}
#root_command .command_parameter_group>.list_cell:nth-child(n+2) {
padding-left: 1em;
}
#root_param .root_operation,
#root_command .root_operation {
justify-content: flex-end;
align-items: center;
gap: 4px;
}
.tips {
font-size: small;
color: #0005;
display: block;
}
@media (max-width: 1400px) {
#build_result_button {
left: calc(85% + 5px);
}
.root {
width: 70%;
}
}
@media (max-width: 1019px) {
.block>.title {
width: 17%;
}
.sub_title {
width: 80px;
}
.block .origin_name {
display: none;
}
}
@media (max-width: 950px) {
.group_list_cell.param_type_select>.list_cell {
display: grid;
justify-content: start;
align-items: start;
justify-items: start;
grid-template-columns: 1fr 5fr;
gap: 0;
margin-top: 2px;
}
.group_list_cell.param_type_select>.list_cell>* {
width: 100%;
}
.group_list_cell.param_type_select>.list_cell>div {
grid-column-start: 2;
}
}
@media (max-width: 740px) {
body {
font-size: 14px;
}
}
@media (max-width: 732px) {
.group_list_cell.param_type_select>.list_cell {
grid-template-columns: 1fr 4fr;
}
}
@media (max-width: 700px) {
.sub_title {
width: 70px;
}
#build_result_button {
left: auto;
right: 5px;
}
.root {
width: 80%;
}
}
@media (max-width: 542px) {
.group_list_cell.param_type_select>.list_cell {
grid-template-columns: 1fr 3fr;
}
}
@media (max-width: 500px) {
#build_result_button {
left: auto;
right: 8px;
border: 1px solid #aaaeb3;
}
.root {
width: calc(100% - 16px);
}
#root_meta textarea {
height: 200px;
}
}
</style>
<!-- css -->
<!-- js -->
<script src="./src/editorConfig.js"></script>
<script src="./src/index.js"></script>
<!-- js -->
</head>
<body>
<button type="button" id="build_result_button" onclick="Builder.setBuildResult()">建立</button>
<div id="root">
<div id="root_meta" class="root">
<div class="root_title" onclick="onRootTitleClick('meta')">
<span class="title">Metadata</span>
</div>
<!-- target -->
<div class="target block">
<span class="target_title title">平台<span class="origin_name">(target)</span>:</span>
<div class="target_input data_input data">
<input type="checkbox" id="is_support_mz" style="width: 1em; height: 1em;">
<label for="is_support_mz">support MZ</label>
</div>
</div>
<!-- target -->
<!-- author -->
<div class="author block">
<span class="author_title title">作者<span class="origin_name">(author)</span>:</span>
<div class="author_input data_input data">
<input type="text" placeholder="Name">
</div>
</div>
<!-- author -->
<!-- url -->
<div class="url block">
<span class="url_title title">網址<span class="origin_name">(url)</span>:</span>
<div class="url_input data_input data">
<input type="text" placeholder="http://127.0.0.1">
</div>
</div>
<!-- url -->
<!-- help -->
<div class="help block">
<span class="help_title title">說明<span class="origin_name">(help)</span>:</span>
<div class="help_input data_input data">
<input type="text" placeholder="One line of descript">
</div>
</div>
<!-- help -->
<!-- desc -->
<div class="desc block">
<span class="desc_title title">概述<span class="origin_name">(plugindesc)</span>:</span>
<div class="desc_input data_input data">
<textarea placeholder="Detail of this plugin"></textarea>
</div>
</div>
<!-- desc -->
</div>
<div id="root_depen" class="root">
<div class="root_title" onclick="onRootTitleClick('depen')">
<span class="title">Dependency</span>
</div>
<!-- base -->
<div class="base block">
<span class="base_title title">依賴<span class="origin_name">(base)</span>:</span>
<div class="base_input data_input data">
<input type="text" id="" placeholder="plugin name">
</div>
</div>
<!-- base -->
<!-- after -->
<div class="after block">
<span class="after_title title">前置<span class="origin_name">(orderAfter)</span>:</span>
<div class="after_input_list data_input data">
<!-- -->
<div class="list_cell" data-id="0">
<input type="text" placeholder="plugin name">
<button type="button" class="append_order_after_plugin"
onclick="DependencyControl.useAppendAfterPluginCell(0)">Add</button>
<button type="button" class="delete_order_after_plugin"
onclick="DependencyControl.useClearInputValue('after')">Clr</button>
</div>
</div>
</div>
<!-- after -->
<!-- before -->
<div class="before block">
<span class="before_title title">後置<span class="origin_name">(orderBefore)</span>:</span>
<div class="before_input_list data_input data">
<div class="list_cell" data-id="0">
<input type="text" placeholder="plugin name">
<button type="button" class="append_order_before_plugin"
onclick="DependencyControl.useAppendBeforePluginCell(0)">Add</button>
<button type="button" class="delete_order_before_plugin"
onclick="DependencyControl.useClearInputValue('before')">Clr</button>
</div>
</div>
</div>
<!-- before -->
</div>
<div id="root_param" class="root">
<div class="root_title" onclick="onRootTitleClick('parm')">
<span class="title">Parameters</span>
</div>
<div class="param block root_operation">
<button type="button" onclick="ParameterControl.onRootAddClick()">Add</button>
<button type="button" onclick="ParameterControl.onRootDelClick()">Del_All</button>
</div>
</div>
<div id="root_command" class="root">
<div class="root_title" onclick="onRootTitleClick('comn')">
<span class="title">Program</span>
</div>
<div class="command block root_operation">
<button type="button" onclick="CommandControl.onRootAddClick()">Add_Command</button>
<button type="button" onclick="CommandControl.onRootAddCodeClick()">Add_Code</button>
<button type="button" onclick="CommandControl.onRootDelClick()">Del_All</button>
</div>
</div>
<div id="root_display" class="root">
<div class="root_title" onclick="onRootTitleClick('display')">
<span class="title">Display</span>
</div>
<!-- plugin display -->
<div id="display_plugin" class="block" style="display: block;">
<span class="tips">
請注意,如果你在此編輯器內修改了任何內容,再次建立插件時將被覆蓋
</span>
<button type="button" id="copy_result_button" onclick="Builder.setCopyToClipBoard()">複製到剪貼簿</button>
<button type="button" id="copy_result_button" onclick="Builder.onDownloadClick()">下載為程式檔</button>
<textarea placeholder="Your plugin" hidden></textarea>
<div id="monaco_build_display" style="height: 1000px;"></div>
</div>
</div>
</div>
</body>
</html>