From: Benjamin Auder Date: Fri, 3 Dec 2021 07:23:30 +0000 (+0100) Subject: Fix last fix :) X-Git-Url: https://git.auder.net/variants/Chakart/doc/scripts/pieces/cp.svg?a=commitdiff_plain;h=3caec36fba44232e0d9157aadb9c06fdc4634c02;p=xogo.git Fix last fix :) --- diff --git a/app.js b/app.js index a6ee234..0a1fffe 100644 --- a/app.js +++ b/app.js @@ -103,7 +103,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 +448,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"; diff --git a/base_rules.js b/base_rules.js index 9444e7b..34f0e7e 100644 --- a/base_rules.js +++ b/base_rules.js @@ -8,7 +8,7 @@ import Move from "/utils/Move.js"; export default class ChessRules { static get Aliases() { - return [{'C': ChessRules}]; + return {'C': ChessRules}; } /////////////////////////