From: Raphaƫl Jakse Date: Thu, 8 May 2025 13:43:20 +0000 (+0200) Subject: Lint X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=360fb50b840ee3de6315c708c2cfba527184a975;p=trivabble.git Lint --- diff --git a/.eslintrc.json b/.eslintrc.json index 7950b8d..e53f649 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -277,7 +277,7 @@ "require-atomic-updates": "error", "require-await": "error", "require-jsdoc": "off", - "require-unicode-regexp": "error", + "require-unicode-regexp": "off", "rest-spread-spacing": "error", "semi": [ "error", diff --git a/public/trivabble.js b/public/trivabble.js index dbb4d43..7abc925 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -326,8 +326,7 @@ try { const dictionary = file.responseText.split("\n"); downloadedDictionaries[code] = dictionary; - callback(dictionary); - return; + return callback(dictionary); } catch (e) { delete downloadedDictionaries[code]; myAlert(_("Incorrect dictionary file.")); @@ -784,7 +783,7 @@ setSetting("BoardLang", value); checkDictionaryExistance(value); break; - case "boardLabel": + case "boardLabel": { document.getElementById("board-label").value = value; setSetting("BoardLabel", value); const boardArray = @@ -797,6 +796,7 @@ boardDef.rackLength = boardArray[2]; initBoard(); break; + } case "checkFirstWord": setSetting("CheckFirstWord", value); break; @@ -2508,7 +2508,7 @@ sourceLink.href = source; sourceLink.textContent = source; sourceLink.target = "_blank"; - const translated = _("Info & source code at {0}").split("\{0\}"); + const translated = _("Info & source code at {0}").split("\\{0\\}"); const pinfo = document.createElement("p"); pinfo.textContent = translated[0]; pinfo.appendChild(sourceLink); @@ -2745,10 +2745,8 @@ const content = document.getElementById("content"); const panel = document.getElementById("panel"); const menu = document.getElementById("menu"); - const screenWidth = window.innerWidth || document.documentElement.clientWidth || - document.body.clientWidth; - const screenHeight = window.innerHeight|| document.documentElement.clientHeight|| - document.body.clientHeight; + const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + const screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; const menuAndPanelWidth = panel.offsetWidth + menu.offsetWidth; const availableWidth = screenWidth - menuAndPanelWidth; const candidateScaleW = availableWidth / board.offsetWidth; @@ -2757,7 +2755,7 @@ // It is an arbitrary value guessed from observation. It's not very // pretty and I don't know why scrollbars appear without it. const candidateScaleH = (screenHeight - 5) / content.offsetHeight; - const candidateScale = Math.min(candidateScaleW, candidateScaleH) + let candidateScale = Math.min(candidateScaleW, candidateScaleH); if (candidateScale < 1) { candidateScale = 1; } @@ -2790,7 +2788,7 @@ const oldTileCount = document.getElementById("tile-count"); newTileCount.textContent = oldTileCount.textContent; const b = document.getElementById("bag"); - b.textContent = ''; + b.textContent = ""; b.appendChild(svg); tileCount = newTileCount; };