From 56540be75467a6ddc109eed63edd914011379394 Mon Sep 17 00:00:00 2001 From: wareya Date: Tue, 12 Dec 2017 00:27:06 -0500 Subject: [PATCH] fix length option default and adjective past --- background-script.js | 1 + options.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/background-script.js b/background-script.js index cbef676..ddc769b 100644 --- a/background-script.js +++ b/background-script.js @@ -272,6 +272,7 @@ rules.push({type: "stdrule", dec_end:"", con_end:"さ", dec_tag:"stem-adj-base", rules.push({type: "stdrule", dec_end:"", con_end:"た", dec_tag:"stem-ren-less", con_tag:"stem-past", detail:"past"}); rules.push({type: "stdrule", dec_end:"", con_end:"だ", dec_tag:"stem-ren-less-v", con_tag:"stem-past", detail:"past"}); //rules.push({type: "stdrule", dec_end:"", con_end:"て", dec_tag:"stem-ren", con_tag:"stem-te", detail:"(te form)"}); // unusual but real but don't necessarily want it yet +rules.push({type: "stdrule", dec_end:"", con_end:"った", dec_tag:"stem-ka", con_tag:"stem-past", detail:"past"}); // we want some te forms to only apply to verbs, not adjectives // FIXME: need a way to not break ~ないでください, ~ないでいく, etc diff --git a/options.js b/options.js index dce246b..8928b8b 100644 --- a/options.js +++ b/options.js @@ -36,11 +36,14 @@ async function restoreOptions() function setOptions() { + let length = parseInt(document.querySelector("#length").value, 10); + if(!length) // NaN is falsy + length = 25; browser.storage.local.set( { enabled: document.querySelector("#enabled").checked, compact: document.querySelector("#compact").checked, - length: parseInt(document.querySelector("#length").value), + length: length, }); }