From f77cf3197ea79fabb231b82bc4b5519b5b1a0891 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Jakse?= Date: Mon, 5 Oct 2020 20:54:33 +0200 Subject: [PATCH] Remove the "enable spell checker" checkbox I don't really see a use case requiring disabling the spell checker if available. People can just not use it. The dictionary is downloaded on first use anyway. We do want people to discover the feature with the presence of the related button by default, however. --- l10n/po/fr/trivabble.po | 3 --- l10n/pot/trivabble.pot | 3 --- public/index.html | 1 - public/trivabble.js | 28 +++++++++------------------- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/l10n/po/fr/trivabble.po b/l10n/po/fr/trivabble.po index 88b818b..bc9e000 100644 --- a/l10n/po/fr/trivabble.po +++ b/l10n/po/fr/trivabble.po @@ -190,9 +190,6 @@ msgstr "Dictionnaire incorrect." msgid "Can't load dictionary file." msgstr "Impossible de charger le dictionnaire" -msgid "Enable spell checker" -msgstr "Activer le vérificateur orthographique" - msgid "Spell checking requires Trivabble to download a dictionary. Do you confirm?" msgstr "La vérification orthographique nécessite que Trivabble télécharge un dictionnaire. Confirmez-vous ?" diff --git a/l10n/pot/trivabble.pot b/l10n/pot/trivabble.pot index 49b95e6..49ad290 100644 --- a/l10n/pot/trivabble.pot +++ b/l10n/pot/trivabble.pot @@ -190,9 +190,6 @@ msgstr "" msgid "Can't load dictionary file." msgstr "" -msgid "Enable spell checker" -msgstr "" - msgid "Spell checking requires Trivabble to download a dictionary. Do you confirm?" msgstr "" diff --git a/public/index.html b/public/index.html index 25d686e..5735712 100644 --- a/public/index.html +++ b/public/index.html @@ -57,7 +57,6 @@

-

diff --git a/public/trivabble.js b/public/trivabble.js index c1bdb32..9d77112 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -319,11 +319,6 @@ file.send(); } - function spellCheckerSettingChecked() { - setSetting("spellCheckerEnabled", document.getElementById("enable-spell-checker").checked); - initSpellChecker(); - } - function removeElem(elem) { elem.parentNode.removeChild(elem); } @@ -1998,19 +1993,11 @@ function initSpellChecker() { if (getSetting("ENABLE_SPELL_CHECKER")) { - document.getElementById("enable-spell-checker-outer").hidden = false; - } - - document.getElementById("enable-spell-checker").onclick = spellCheckerSettingChecked; - - if (!getSetting("ENABLE_SPELL_CHECKER") || !getSetting("spellCheckerEnabled")) { - document.getElementById("check-spelling").hidden = true; - document.getElementById("enable-spell-checker").checked = false; - document.getElementById("info-spell-checking").hidden = true; - } else { document.getElementById("check-spelling").hidden = false; document.getElementById("info-spell-checking").hidden = false; - document.getElementById("enable-spell-checker").checked = true; + } else { + document.getElementById("check-spelling").hidden = true; + document.getElementById("info-spell-checking").hidden = true; } } @@ -2161,8 +2148,11 @@ } function showSettings() { - const modal = document.querySelector(".modal"); - modal.classList.toggle("show-modal"); + document.querySelector(".modal").classList.add("show-modal"); + } + + function hideSettings() { + document.querySelector(".modal").classList.remove("show-modal"); } function initGlobals() { @@ -2187,7 +2177,7 @@ document.getElementById("show-rack").onclick = showRack; document.getElementById("check-spelling").onclick = checkSpellingClicked; document.getElementById("btn-settings").onclick = showSettings; - document.getElementById("btn-settings-close").onclick = showSettings; + document.getElementById("btn-settings-close").onclick = hideSettings; document.getElementById("next-help-msg").onclick = nextHelpMessage; document.body.addEventListener("keydown", function (e) { if (e.key === 'Escape') { -- 2.30.2