diff --git a/options.html b/options.html index e658189..fd4bc1c 100644 --- a/options.html +++ b/options.html @@ -12,6 +12,7 @@
+ diff --git a/options.js b/options.js index 30fce12..6c450be 100644 --- a/options.js +++ b/options.js @@ -6,6 +6,7 @@ function restoreListeners() document.querySelector("#fixedwidth").addEventListener("change", setOptions); document.querySelector("#fixedwidthpositioning").addEventListener("change", setOptions); document.querySelector("#superborder").addEventListener("change", setOptions); + document.querySelector("#showoriginal").addEventListener("change", setOptions); } function removeListeners() { @@ -15,6 +16,7 @@ function removeListeners() document.querySelector("#fixedwidth").removeEventListener("change", setOptions); document.querySelector("#fixedwidthpositioning").removeEventListener("change", setOptions); document.querySelector("#superborder").addEventListener("change", setOptions); + document.querySelector("#showoriginal").addEventListener("change", setOptions); } async function restoreOptions() @@ -33,7 +35,8 @@ async function restoreOptions() let length = await getvar("length", 25); let fixedwidth = await getvar("fixedwidth", false); let fixedwidthpositioning = await getvar("fixedwidthpositioning", false); - let superborder = await getvar("superborder", true); + let superborder = await getvar("superborder", false); + let showoriginal = await getvar("showoriginal", true); removeListeners(); document.querySelector("#enabled").checked = enabled?true:false; document.querySelector("#compact").checked = compact?true:false; @@ -41,6 +44,7 @@ async function restoreOptions() document.querySelector("#fixedwidth").checked = fixedwidth?true:false; document.querySelector("#fixedwidthpositioning").checked = fixedwidthpositioning?true:false; document.querySelector("#superborder").checked = superborder?true:false; + document.querySelector("#showoriginal").checked = showoriginal?true:false; } catch (error){} removeListeners(); @@ -60,6 +64,7 @@ function setOptions() fixedwidth: document.querySelector("#fixedwidth").checked, fixedwidthpositioning: document.querySelector("#fixedwidthpositioning").checked, superborder: document.querySelector("#superborder").checked, + showoriginal: document.querySelector("#showoriginal").checked, }); } diff --git a/texthook.js b/texthook.js index 2eb39d6..ebded7b 100644 --- a/texthook.js +++ b/texthook.js @@ -29,6 +29,7 @@ length: 25, fixedwidth: false, fixedwidthpositioning: false, superborder: false, +showoriginal: true, }; let last_time_display = Date.now(); @@ -155,8 +156,10 @@ function build_div (text, result) ""; - //temp.innerHTML += "Looked up " + text + "
"; + if(settings.showoriginal) + temp.innerHTML += "
Looked up " + text + "
"; // lookups can have multiple results (e.g. する -> 為る, 刷る, 掏る, 剃る, 擦る) // FIXME: A bunch of code here depends on the literal text used to run the search instead of the text with which the search succeeded. // The search can convert between hiragana and katakana to find a valid match, so we should know what text it actually used. @@ -499,7 +502,8 @@ async function settings_reload() getvar("length", 25); getvar("fixedwidth", false); getvar("fixedwidthpositioning", false); - getvar("superborder", true); + getvar("superborder", false); + getvar("showoriginal", true); if(!settings.enabled && exists_div()) delete_div();