From 3caec36fba44232e0d9157aadb9c06fdc4634c02 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Fri, 3 Dec 2021 08:23:30 +0100 Subject: [PATCH] Fix last fix :) --- app.js | 4 ++-- base_rules.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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}; } ///////////////////////// -- 2.44.0