-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathjson_config.html
126 lines (123 loc) · 2.79 KB
/
json_config.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Manage JSON Dictionaries</title>
<style>
body
{
background-color: #111;
color: #CCC;
font-family: Verdana, Arial, IPAGothic, TakaoGothic, Noto Sans CJK JP Regular, Meiryo, sans-serif;
font-size: 1em;
}
option
{
opacity: 0.999;
}
option.disabled
{
opacity: 0.6;
}
div.buttons
{
display:flex;
width: 300px;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
div.buttons *
{
width: 33.3%;
}
div.buttons button.double
{
width: 50%;
}
#delete
{
margin-top: 20px;
}
div.closed
{
display: none;
}
</style>
<script src="json_config.js" charset="UTF-8"></script>
</head>
<body lang="ja" visible="5">
<div id=dict_manager>
<select id=dicts size="10" style="width: 300px; box-sizing: border-box; border: none;">
<option class=disabled>ローディング中</option>
</select>
<div class=buttons>
<button id=move_up>Move Up</button><button id=move_down>Move Down</button><button id=toggle>Toggle</button>
<button id=import class=double>Import</button><button id=export class=double>Export</button>
<button id=add class=double>Add Blank</button><button id=edit class=double>Edit</button>
<button id=delete>Delete</button>
</div>
<input type=file id=file_input style="display: none">
</div>
<div id=dict_editor class=closed>
<input type=text id=edit_name value="" style="width: 300px"><button id=edit_apply>Apply</button><button id=edit_okay>Apply & Close</button><button id=edit_cancel>Close</button>
<textarea type=text id=edit_entries value="" style="width: 100%; height:calc(100vh - 200px)"></textarea>
<div class=edit_explanation>
<p>Importing large JSON dictionaries can cause the browser to freeze for several seconds. This is normal.</p>
<pre>
Format (copy-paste-able):
[
{
"r": "つるぎ",
"s": [
""
],
"l": [
"line one of a definition",
"line two of a definition",
"etc",
"last line of a definition"
]
},
{
"r": "こだいしゅ",
"s": [
"古代種",
"古代しゅ"
],
"l": [
"the ancients"
]
}
]
Format (with comments, which break JSON parsing):
[
{ // entry one
"r": "つるぎ",
"s": [
"" // entries with no "spellings" still have a single, blank spelling
], // comma
"l": [
"line one of a definition",
"line two of a definition",
"etc",
"last line of a definition" // no comma
]
}, // comma
{ // entry two
"r": "こだいしゅ",
"s": [
"古代種",
"古代しゅ" // no comma
], // comma
"l": [
"the ancients" // no comma
]
} // last entry, so no comma
]
</pre>
</div>
</div>
</body>
</html>