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."));
setSetting("BoardLang", value);
checkDictionaryExistance(value);
break;
- case "boardLabel":
+ case "boardLabel": {
document.getElementById("board-label").value = value;
setSetting("BoardLabel", value);
const boardArray =
boardDef.rackLength = boardArray[2];
initBoard();
break;
+ }
case "checkFirstWord":
setSetting("CheckFirstWord", value);
break;
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);
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;
// 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;
}
const oldTileCount = document.getElementById("tile-count");
newTileCount.textContent = oldTileCount.textContent;
const b = document.getElementById("bag");
- b.textContent = '';
+ b.textContent = "";
b.appendChild(svg);
tileCount = newTileCount;
};