fix eslint errors
authorLaurent Mazet <mazet@softndesign.org>
Wed, 22 Jul 2020 06:04:09 +0000 (08:04 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Wed, 22 Jul 2020 06:04:09 +0000 (08:04 +0200)
public/trivabble.js

index 73fcef952ac7a0849fd54384e704c162c8fcd997..00e5d66ab450ae36a760c79106518c8baa206d40 100644 (file)
     }
 
     function highlightTile(e) {
-        let id = this.id;
+        const id = this.id;
         if (id === "") {
             return;
         }
         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
     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() {
                 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"));