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");
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();
});
}
// Playing
function toggleTurnIndicator(myTurn) {
- let indicator = $.getElementById("chessboard");
+ let indicator =
+ $.getElementById("boardContainer").querySelector(".chessboard");
if (myTurn) indicator.style.outline = "thick solid green";
else indicator.style.outline = "thick solid lightgrey";
}
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";
</g>
</svg>
</div>
- <div class="resizeable" id="chessboard"></div>`;
+ <div class="resizeable chessboard"></div>`;
vr = new V({
seed: obj.seed, //may be null if FEN already exists (running game)
fen: obj.fen,
- element: "chessboard",
+ element: "boardContainer",
color: playerColor,
afterPlay: afterPlay,
options: options