add options for kanji info
This commit is contained in:
1 parent
bae24e39f5
commit
601be93b10
2 files changed
+50
-6
No files matched your search
+30
@@ -434,6 +434,36 @@ function defaults()
|
|||||||
label: "Reader font override (without trailing comma)"
|
label: "Reader font override (without trailing comma)"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// hotkeys
|
||||||
|
settings.push({
|
||||||
|
kind: "dummy",
|
||||||
|
label: "Kanji mode"
|
||||||
|
});
|
||||||
|
settings.push({
|
||||||
|
id: "kanji_show_stroke_count",
|
||||||
|
kind: "checkbox",
|
||||||
|
default: true,
|
||||||
|
label: "Show stroke count"
|
||||||
|
});
|
||||||
|
settings.push({
|
||||||
|
id: "kanji_show_readings",
|
||||||
|
kind: "checkbox",
|
||||||
|
default: true,
|
||||||
|
label: "Show jouyou readings"
|
||||||
|
});
|
||||||
|
settings.push({
|
||||||
|
id: "kanji_show_composition",
|
||||||
|
kind: "checkbox",
|
||||||
|
default: true,
|
||||||
|
label: "Show composition"
|
||||||
|
});
|
||||||
|
settings.push({
|
||||||
|
id: "kanji_show_quality_warning",
|
||||||
|
kind: "checkbox",
|
||||||
|
default: true,
|
||||||
|
label: "Show data quality warning"
|
||||||
|
});
|
||||||
|
|
||||||
// hotkeys
|
// hotkeys
|
||||||
settings.push({
|
settings.push({
|
||||||
kind: "dummy",
|
kind: "dummy",
|
||||||
|
|||||||
+20
-6
@@ -47,6 +47,10 @@ popup_requires_key: 0, // 0: none; 1: ctrl; 2: shift
|
|||||||
x_dodge: 1,
|
x_dodge: 1,
|
||||||
y_dodge: 0,
|
y_dodge: 0,
|
||||||
sticky_maxheight: 0,
|
sticky_maxheight: 0,
|
||||||
|
kanji_show_stroke_count: true,
|
||||||
|
kanji_show_readings: true,
|
||||||
|
kanji_show_composition: true,
|
||||||
|
kanji_show_quality_warning: true,
|
||||||
hotkey_mine: "m",
|
hotkey_mine: "m",
|
||||||
hotkey_close: "n",
|
hotkey_close: "n",
|
||||||
hotkey_sticky: "b",
|
hotkey_sticky: "b",
|
||||||
@@ -1182,14 +1186,19 @@ function build_div_kanji(text, kanjidata, moreText, index)
|
|||||||
composition.textContent = "Composition: " + kanjidata["z"];
|
composition.textContent = "Composition: " + kanjidata["z"];
|
||||||
|
|
||||||
info.appendChild(grade);
|
info.appendChild(grade);
|
||||||
info.appendChild(strokes);
|
if(settings.kanji_show_stroke_count)
|
||||||
if(added_readings > 0)
|
info.appendChild(strokes);
|
||||||
|
if(settings.kanji_show_readings && added_readings > 0)
|
||||||
info.appendChild(readings);
|
info.appendChild(readings);
|
||||||
info.appendChild(composition);
|
if(settings.kanji_show_composition)
|
||||||
|
info.appendChild(composition);
|
||||||
|
|
||||||
tail.appendChild(document.createTextNode("Data for non-jouyou kanji may contain errors."));
|
if(settings.kanji_show_quality_warning)
|
||||||
tail.appendChild(document.createElement("br"));
|
{
|
||||||
tail.appendChild(document.createTextNode("Composition might not render correctly if it contains obscure characters."));
|
tail.appendChild(document.createTextNode("Data for non-jouyou kanji may contain errors."));
|
||||||
|
tail.appendChild(document.createElement("br"));
|
||||||
|
tail.appendChild(document.createTextNode("Composition might not render correctly if it contains obscure characters."));
|
||||||
|
}
|
||||||
tail.style.marginBottom = "4px";
|
tail.style.marginBottom = "4px";
|
||||||
|
|
||||||
target.appendChild(head);
|
target.appendChild(head);
|
||||||
@@ -1268,6 +1277,11 @@ async function settings_init()
|
|||||||
getvar("use_selection", false);
|
getvar("use_selection", false);
|
||||||
getvar("only_selection", false);
|
getvar("only_selection", false);
|
||||||
|
|
||||||
|
getvar("kanji_show_stroke_count", true);
|
||||||
|
getvar("kanji_show_readings", true);
|
||||||
|
getvar("kanji_show_composition", true);
|
||||||
|
getvar("kanji_show_quality_warning", true);
|
||||||
|
|
||||||
if(!settings.enabled && exists_div())
|
if(!settings.enabled && exists_div())
|
||||||
delete_div();
|
delete_div();
|
||||||
if(!settings.enabled)
|
if(!settings.enabled)
|
||||||
|
|||||||
Reference in new issue
Block a user