X-Git-Url: https://git.auder.net/assets/%7B%7B%20path%28%27mixstore_store_package_view%27%2C%20%7B%20id:%20newsItem.id%20%7D%29%20%7D%7D?a=blobdiff_plain;f=base_rules.js;h=d609a5609fcf16ab86d8b23a4072fde25225eb9f;hb=c9a20f4f198e1877bd260a610b1692b3d65d0eba;hp=cdce2a17cc02a968528aa85cb49d5e5673e2c376;hpb=0adfbdb55452c79532875beb8eed61b1ed4c6cd2;p=xogo.git diff --git a/base_rules.js b/base_rules.js index cdce2a1..d609a56 100644 --- a/base_rules.js +++ b/base_rules.js @@ -220,11 +220,13 @@ export default class ChessRules { ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'r'], { between: {p1: 'k', p2: 'r'}, - diffCol: ['b'] + diffCol: ['b'], + flags: ['r'] } ); return { - fen: s.b + "/pppppppp/8/8/8/8/PPPPPPPP/" + s.w, + fen: s.b.join("") + "/pppppppp/8/8/8/8/PPPPPPPP/" + + s.w.join("").toUpperCase(), o: {flags: s.flags} }; } @@ -356,9 +358,6 @@ export default class ChessRules { if (this.options[opt.variable] === undefined) this.options[opt.variable] = opt.defaut; }); - if (o.genFenOnly) - // This object will be used only for initial FEN generation - return; // Some variables this.playerColor = o.color; @@ -965,7 +964,7 @@ export default class ChessRules { // TODO: onpointerdown/move/up ? See reveal.js /controllers/touch.js } - // NOTE: not called if isDiagram, or genFenOnly + // NOTE: not called if isDiagram removeListeners() { let container = document.getElementById(this.containerId); this.windowResizeObs.unobserve(container); @@ -2641,6 +2640,7 @@ export default class ChessRules { let container = document.getElementById(this.containerId); if (document.hidden) { document.onvisibilitychange = () => { + // TODO here: page reload ?! (some issues if tab changed...) document.onvisibilitychange = undefined; checkDisplayThenAnimate(700); };