From aae89b49a846b2c101d74db7dff9151392d6db34 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Sat, 7 Mar 2020 13:31:42 +0100 Subject: [PATCH] Experimental update: preview corr move + allow deletion of any game --- TODO | 1 + client/src/components/BaseGame.vue | 13 +- client/src/components/GameList.vue | 40 +++- client/src/components/Settings.vue | 7 + client/src/store.js | 1 + client/src/translations/en.js | 3 +- client/src/translations/es.js | 3 +- client/src/translations/fr.js | 5 +- client/src/utils/gameStorage.js | 82 +++----- client/src/views/Auth.vue | 4 - client/src/views/Game.vue | 291 +++++++++++++++++++---------- client/src/views/Logout.vue | 4 - client/src/views/MyGames.vue | 55 +++++- server/db/create.sql | 7 +- server/models/Game.js | 137 ++++++++------ server/routes/games.js | 15 +- server/sockets.js | 54 ++++-- 17 files changed, 459 insertions(+), 263 deletions(-) diff --git a/TODO b/TODO index 65bcbd11..2f909766 100644 --- a/TODO +++ b/TODO @@ -41,6 +41,7 @@ Take(a)n(d)make : if capture a piece, take its power for the last of the turn an If a pawn taken: direction of the capturer. + Maxima, Interweave, Roccoco, Dynamo, Synchrone +Synchrone Chess: allow to anticipate en-passant capture as well :) S-chess https://en.wikipedia.org/wiki/Seirawan_chess diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index ac8b3236..e7977eb2 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -87,9 +87,10 @@ export default { }; }, watch: { - // game initial FEN changes when a new game starts - "game.fenStart": function() { - this.re_setVariables(); + // game initial FEN changes when a new game starts. + // NOTE: when game ID change on Game page, fenStart may be temporarily undefined + "game.fenStart": function(fenStart) { + if (!!fenStart) this.re_setVariables(); }, }, computed: { @@ -256,11 +257,7 @@ export default { }, showEndgameMsg: function(message) { this.endgameMessage = message; - let modalBox = document.getElementById("modalEog"); - modalBox.checked = true; - setTimeout(() => { - modalBox.checked = false; - }, 2000); + document.getElementById("modalEog").checked = true; }, // Animate an elementary move animateMove: function(move, callback) { diff --git a/client/src/components/GameList.vue b/client/src/components/GameList.vue index aa361fb3..0a8bd8ce 100644 --- a/client/src/components/GameList.vue +++ b/client/src/components/GameList.vue @@ -28,6 +28,7 @@ div