Remove the "enable spell checker" checkbox
authorRaphaël Jakse <raphael.trivabble@jakse.fr>
Mon, 5 Oct 2020 18:54:33 +0000 (20:54 +0200)
committerRaphaël Jakse <raphael.trivabble@jakse.fr>
Mon, 5 Oct 2020 18:54:33 +0000 (20:54 +0200)
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
l10n/pot/trivabble.pot
public/index.html
public/trivabble.js

index 88b818ba8075c3720d2ebe63ae0cc71b8d368895..bc9e000024ec7a41365d5995b8371d631840b5ef 100644 (file)
@@ -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 ?"
 
index 49b95e6f3178f470da66a7c2e86e5e416bdc2b8e..49ad290c1872bc2e8269dc6f5a69d5f2cc10824b 100644 (file)
@@ -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 ""
 
index 25d686ef7c2dae6bee0adcd14752e80e3085cd26..573571204f1d062a7b1af9cf73efad2c9d81717b 100644 (file)
@@ -57,7 +57,6 @@
                 <div id="prefs">
                     <p><label><input type="checkbox" id="tiles-sound" /><span data-l10n="text-content">Sound of the tiles</span></label></p>
                     <p><label><input type="checkbox" id="msg-sound" /><span data-l10n="text-content">Sound of messages</span></label></p>
-                    <p id="enable-spell-checker-outer" hidden="true"><label><input type="checkbox" id="enable-spell-checker" /> <span data-l10n="text-content">Enable spell checker</span></label></p>
                            <p><label><span data-l10n="text-content">(fast)</span><input type="range" min="0" max="0" id="double-tap-duration"/><span data-l10n="text-content">(slow)</span><br/><span data-l10n="text-content">Double tap duration</span></label></p>
                            <p><label><span data-l10n="text-content">(fast)</span><input type="range" min="0" max="0" id="flash-light-duration"/><span data-l10n="text-content">(slow)</span><br/><span data-l10n="text-content">Flash light duration</span></label></p>
                     <p id="flash-light-color-p"><label><input type="color" size="6" id="flash-light-color" /> <span data-l10n="text-content">Flash light color</span></label></p>
index c1bdb327f7ab95e4bacdd62c476d12092ccd75ba..9d77112c63e1a8fcde6913197848e887aa4e8b93 100644 (file)
         file.send();
     }
 
-    function spellCheckerSettingChecked() {
-        setSetting("spellCheckerEnabled", document.getElementById("enable-spell-checker").checked);
-        initSpellChecker();
-    }
-
     function removeElem(elem) {
         elem.parentNode.removeChild(elem);
     }
 
     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;
         }
     }
 
     }
 
     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() {
         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') {