X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=app.js;h=e269c5bf06f240043dba851d38bb539ad380e9c6;hb=3ec8a1313afe1e130bc9cce03a3f22b5284fa3e1;hp=a6ee234aed96c204a2d7dd1ba63a46b5a1fdaa5b;hpb=e5f9342704d2a453c3cd2f84e31b1ea384b2d03d;p=xogo.git diff --git a/app.js b/app.js index a6ee234..e269c5b 100644 --- a/app.js +++ b/app.js @@ -86,8 +86,9 @@ function cancelSeek() { if (send("cancelseek", {vname: seek_vname})) toggleVisible("newGame"); } -function sendRematch() { - if (send("rematch", {gid: gid})) toggleVisible("pendingRematch"); +function sendRematch(random) { + if (send("rematch", {gid: gid, random: !!random})) + toggleVisible("pendingRematch"); } function cancelRematch() { if (send("norematch", {gid: gid})) toggleVisible("newGame"); @@ -103,7 +104,7 @@ function showNewGameForm() { toggleVisible("newGameForm"); import(`/variants/${vname}/class.js`).then(module => { window.V = module.default; - V.Aliases.forEach(e => window[e.key] = e.val); + for (const [k, v] of Object.entries(V.Aliases)) window[k] = v; prepareOptions(); }); } @@ -448,7 +449,7 @@ function initializeGame(obj) { const options = obj.options || {}; import(`/variants/${obj.vname}/class.js`).then(module => { window.V = module.default; - V.Aliases.forEach(e => window[e.key] = e.val); + for (const [k, v] of Object.entries(V.Aliases)) window[k] = v; // Load CSS. Avoid loading twice the same stylesheet: const allIds = [].slice.call($.styleSheets).map(s => s.id); const newId = obj.vname + "_css";