X-Git-Url: https://git.auder.net/images/pieces/%22%20%20%20VariantRules.getPpath%28board%5Bi%5D%5Bj%5D%29%20%20%20%22.svg?a=blobdiff_plain;f=app.js;h=e269c5bf06f240043dba851d38bb539ad380e9c6;hb=cae17481021b89a75bf5e0c0a41a1fd449ac68bd;hp=d8719404449b07742cdd54656f354814782a6c0a;hpb=f8b43ef764be4e90761aa20d99af79a7e1c32bdd;p=xogo.git diff --git a/app.js b/app.js index d871940..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,6 +104,7 @@ function showNewGameForm() { toggleVisible("newGameForm"); import(`/variants/${vname}/class.js`).then(module => { window.V = module.default; + for (const [k, v] of Object.entries(V.Aliases)) window[k] = v; prepareOptions(); }); } @@ -447,6 +449,7 @@ function initializeGame(obj) { const options = obj.options || {}; import(`/variants/${obj.vname}/class.js`).then(module => { window.V = module.default; + 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";