From: Raphaël Jakse Date: Mon, 5 Oct 2020 18:54:33 +0000 (+0200) Subject: Remove the "enable spell checker" checkbox X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=f77cf3197ea79fabb231b82bc4b5519b5b1a0891;p=trivabble.git 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. --- 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') {