finish space-saving options
This commit is contained in:
1 parent
ab03140336
commit
12baab7168
2 files changed
+22
-8
No files matched your search
+7
-1
@@ -40,7 +40,13 @@ function defaults()
|
|||||||
id: "space_saver",
|
id: "space_saver",
|
||||||
kind: "checkbox",
|
kind: "checkbox",
|
||||||
default: false,
|
default: false,
|
||||||
label: "Space saver (removes brackets from readings, 'Also:' from alternative spellings)"
|
label: "Space saver (removes extra formatting from readings and other spellings)"
|
||||||
|
});
|
||||||
|
settings.push({
|
||||||
|
id: "hide_deconj",
|
||||||
|
kind: "checkbox",
|
||||||
|
default: false,
|
||||||
|
label: "Hide deconjugations"
|
||||||
});
|
});
|
||||||
settings.push({
|
settings.push({
|
||||||
id: "popup_follows_mouse",
|
id: "popup_follows_mouse",
|
||||||
|
|||||||
+15
-7
@@ -24,6 +24,7 @@ fixedwidthpositioning: false,
|
|||||||
superborder: false,
|
superborder: false,
|
||||||
disableborder: false,
|
disableborder: false,
|
||||||
space_saver: false,
|
space_saver: false,
|
||||||
|
hide_deconj: false,
|
||||||
showoriginal: true,
|
showoriginal: true,
|
||||||
definitions_mode: 0,
|
definitions_mode: 0,
|
||||||
normal_definitions_in_mining: false,
|
normal_definitions_in_mining: false,
|
||||||
@@ -778,7 +779,10 @@ function build_div_inner(text, result, moreText, index, first_of_many = false)
|
|||||||
|
|
||||||
temptag.appendChild(document.createElement("wbr"));
|
temptag.appendChild(document.createElement("wbr"));
|
||||||
let e_readings = document.createElement("span");
|
let e_readings = document.createElement("span");
|
||||||
e_readings.appendChild(makespan("《"));
|
if(!settings.space_saver)
|
||||||
|
e_readings.appendChild(makespan("《"));
|
||||||
|
else
|
||||||
|
e_readings.appendChild(makespan(" "));
|
||||||
e_readings.className = "nazeka_readings";
|
e_readings.className = "nazeka_readings";
|
||||||
for(let j = 0; j < readings.length; j++)
|
for(let j = 0; j < readings.length; j++)
|
||||||
{
|
{
|
||||||
@@ -804,7 +808,10 @@ function build_div_inner(text, result, moreText, index, first_of_many = false)
|
|||||||
e_readings.appendChild(makespan("、"));
|
e_readings.appendChild(makespan("、"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e_readings.appendChild(makespan("》"));
|
if(!settings.space_saver)
|
||||||
|
e_readings.appendChild(makespan("》"));
|
||||||
|
else
|
||||||
|
e_readings.appendChild(makespan(" "));
|
||||||
temptag.appendChild(e_readings);
|
temptag.appendChild(e_readings);
|
||||||
|
|
||||||
// list alternatives
|
// list alternatives
|
||||||
@@ -814,7 +821,7 @@ function build_div_inner(text, result, moreText, index, first_of_many = false)
|
|||||||
alternatives.push(term.k_ele[j]);
|
alternatives.push(term.k_ele[j]);
|
||||||
|
|
||||||
if(alternatives.length > 0)
|
if(alternatives.length > 0)
|
||||||
temptag.appendChild(makespan((settings.space_saver)?("("):(" (also ")));
|
temptag.appendChild(makespan((settings.space_saver)?(" ("):(" (also ")));
|
||||||
for(let j = 0; j < alternatives.length; j++)
|
for(let j = 0; j < alternatives.length; j++)
|
||||||
{
|
{
|
||||||
let subkeb = document.createElement("span");
|
let subkeb = document.createElement("span");
|
||||||
@@ -843,7 +850,7 @@ function build_div_inner(text, result, moreText, index, first_of_many = false)
|
|||||||
// deconjugations
|
// deconjugations
|
||||||
|
|
||||||
|
|
||||||
if(term.deconj)
|
if(term.deconj && !settings.hide_deconj)
|
||||||
{
|
{
|
||||||
let deconj = "";
|
let deconj = "";
|
||||||
let first = true;
|
let first = true;
|
||||||
@@ -890,7 +897,7 @@ function build_div_inner(text, result, moreText, index, first_of_many = false)
|
|||||||
main_reb.className = "nazeka_main_reb";
|
main_reb.className = "nazeka_main_reb";
|
||||||
main_reb.textContent = term.found.reb;
|
main_reb.textContent = term.found.reb;
|
||||||
temptag.appendChild(main_reb);
|
temptag.appendChild(main_reb);
|
||||||
if(term.deconj)
|
if(term.deconj && !settings.hide_deconj)
|
||||||
{
|
{
|
||||||
let deconj = "";
|
let deconj = "";
|
||||||
let first = true;
|
let first = true;
|
||||||
@@ -946,8 +953,8 @@ function build_div_inner(text, result, moreText, index, first_of_many = false)
|
|||||||
if(term.r_ele[j].reb != text)
|
if(term.r_ele[j].reb != text)
|
||||||
alternatives.push(term.r_ele[j]);
|
alternatives.push(term.r_ele[j]);
|
||||||
|
|
||||||
if(alternatives.length > 0 && !settings.space_saver)
|
if(alternatives.length > 0)
|
||||||
temptag.appendChild(makespan((settings.space_saver)?("("):(" (also ")));
|
temptag.appendChild(makespan((settings.space_saver)?(" ("):(" (also ")));
|
||||||
for(let j = 0; j < alternatives.length; j++)
|
for(let j = 0; j < alternatives.length; j++)
|
||||||
{
|
{
|
||||||
temptag.appendChild(makespan(alternatives[j].reb));
|
temptag.appendChild(makespan(alternatives[j].reb));
|
||||||
@@ -1207,6 +1214,7 @@ async function settings_init()
|
|||||||
getvar("superborder", false);
|
getvar("superborder", false);
|
||||||
getvar("disableborder", false);
|
getvar("disableborder", false);
|
||||||
getvar("space_saver", false);
|
getvar("space_saver", false);
|
||||||
|
getvar("hide_deconj", false);
|
||||||
getvar("showoriginal", true);
|
getvar("showoriginal", true);
|
||||||
|
|
||||||
getvar("bgcolor", "#111111");
|
getvar("bgcolor", "#111111");
|
||||||
|
|||||||
Reference in new issue
Block a user