128 lines
2.9 KiB
HTML
128 lines
2.9 KiB
HTML
<!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="include/browser-polyfill.min.js" charset="UTF-8"></script>
|
|
<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>
|