From: Laurent Mazet Date: Wed, 22 Jul 2020 06:04:09 +0000 (+0200) Subject: fix eslint errors X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=9ee161fd648f9ee36a18a5cfb17370c5d951138e;p=trivabble.git fix eslint errors --- diff --git a/public/trivabble.js b/public/trivabble.js index 73fcef9..00e5d66 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -1442,7 +1442,7 @@ } function highlightTile(e) { - let id = this.id; + const id = this.id; if (id === "") { return; } @@ -1466,7 +1466,7 @@ const row = letters[Math.floor(id / 15)]; sendCmds([{ cmd: "msg", - msg: _("Look at:") + " " + row + "" + col, + msg: _("Look at:") + " " + String(row) + String(col), specialMsg: { type: "highlightTile", tile: id @@ -1477,11 +1477,26 @@ function localHighlightTile(id) { const placeholder = boardCells[id].getElementsByClassName("tile-placeholder")[0]; placeholder.classList.add("highlight"); - setTimeout(function (x) { x.classList.remove("highlight"); }, 500, placeholder); - setTimeout(function (x) { x.classList.add("highlight"); }, 750, placeholder); - setTimeout(function (x) { x.classList.remove("highlight"); }, 1000, placeholder); - setTimeout(function (x) { x.classList.add("highlight"); }, 1250, placeholder); - setTimeout(function (x) { x.classList.remove("highlight"); }, 1500, placeholder); + setTimeout( + function (x) { + x.classList.remove("highlight"); + }, 500, placeholder); + setTimeout( + function (x) { + x.classList.add("highlight"); + }, 750, placeholder); + setTimeout( + function (x) { + x.classList.remove("highlight"); + }, 1000, placeholder); + setTimeout( + function (x) { + x.classList.add("highlight"); + }, 1250, placeholder); + setTimeout( + function (x) { + x.classList.remove("highlight"); + }, 1500, placeholder); } function initChat() { @@ -1707,7 +1722,7 @@ cell = document.createElement("td"); boardCells.push(cell); board.lastChild.appendChild(cell); - cell.id = i * 15 + j; + cell.id = (i * 15) + j; cell.ondblclick = highlightTile; cell.ontouchstart = highlightTile; cell.appendChild(document.createElement("div"));