correct spelling :-(
authorLaurent Mazet <mazet@softndesign.org>
Sun, 31 May 2020 23:15:30 +0000 (01:15 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Tue, 9 Jun 2020 20:25:56 +0000 (22:25 +0200)
public/trivabble.js

index fc8a816377cab3898241ecb28e3dd5dc99d35999..de8046414788c0960c0f2209dca18b7111787c99 100644 (file)
@@ -59,7 +59,7 @@
     let scoreOf;
     let bag;
     let boardLangSelect;
-    let dictionnary;
+    let dictionary;
 
     const playerLetters = [];
     let currentPlayer = "";
         }
     }
 
-    function downloadDictionnary(code) {
-        if (typeof downloadDictionnary.code === "undefined") {
-            downloadDictionnary.code = "";
-        } else if (downloadDictionnary.code === code) {
+    function downloadDictionary(code) {
+        if (typeof downloadDictionary.code === "undefined") {
+            downloadDictionary.code = "";
+        } else if (downloadDictionary.code === code) {
             return;
         }
-        downloadDictionnary.code = code;
+        downloadDictionary.code = code;
 
         const file = new XMLHttpRequest();
         file.overrideMimeType("application/json");
         file.onreadystatechange = function () {
             if ((file.readyState === 4) && (file.status == "200")) {
                 try {
-                    dictionnary = JSON.parse(file.responseText);
+                    dictionary = JSON.parse(file.responseText);
                     document.getElementById("check-spelling").disabled = false;
                 } catch (e) {
                     console.error(e);
                 localStorage.trivabbleBoardLang = value;
                 document.getElementById("board-lang").value = value;
                 document.getElementById("check-spelling").disabled = true;
-                downloadDictionnary(value);
+                downloadDictionary(value);
                 break;
         }
     }
 
         let words = searchNewWords();
 
-        /* Check if words are in dictionnary */
+        /* Check if words are in dictionary */
         let badWords = words.slice();
         for (const k of Object.keys(badWords)) {
-            if (dictionnary.includes(badWords[k])) {
+            if (dictionary.includes(badWords[k])) {
                 delete badWords[k];
             }
         }