X-Git-Url: https://git.auder.net/pieces/cr.svg?a=blobdiff_plain;f=app.js;h=21d205c409cb3263999dd9c81d3301e5acb9b481;hb=c7bf7b1b10a6d5059f75f540787aba3daaa435f7;hp=f89706233b24ef2fb380202f9cc0f59cceb24c7f;hpb=41534b92f0bcfc8ef5f58d8040706a5e7ce088c6;p=xogo.git diff --git a/app.js b/app.js index f897062..21d205c 100644 --- a/app.js +++ b/app.js @@ -110,7 +110,7 @@ function prepareOptions(Rules) { if (check.defaut) optHtml += 'checked="true"'; optHtml += '/>'; } - if (Rules.Options.styles.length >= 1) optHtml += "

"; + if (Rules.Options.styles.length >= 1) optHtml += '

'; for (let style of Rules.Options.styles) { optHtml += ` @@ -328,7 +328,7 @@ const afterPlay = (move) => { //pack into one moves array, then send start: move.start, end: move.end }); - if (vr.turn != color) { + if (vr.turn != playerColor) { toggleTurnIndicator(false); send("newmove", { gid: gid, moves: curMoves, fen: vr.getFen() }); curMoves = []; @@ -354,13 +354,13 @@ const conditionalLoadCSS = (vname) => { } }; -let vr, color; +let vr, playerColor; function initializeGame(obj) { const options = obj.options || {}; import(`/variants/${obj.vname}/class.js`).then(module => { const Rules = module.default; conditionalLoadCSS(obj.vname); - color = (sid == obj.players[0].sid ? "w" : "b"); + playerColor = (sid == obj.players[0].sid ? "w" : "b"); // Init + remove potential extra DOM elements from a previous game: document.getElementById("boardContainer").innerHTML = `

{