From: Benjamin Auder Date: Tue, 19 Nov 2019 16:04:27 +0000 (+0100) Subject: Fix bugs on variant page + update packages X-Git-Url: https://git.auder.net/variants/img/pieces/css/doc/pieces/cq.svg?a=commitdiff_plain;h=2c6cb25eb12074af1f0fb29383eef8a175abb0f0;p=vchess.git Fix bugs on variant page + update packages --- diff --git a/client/package-lock.json b/client/package-lock.json index 64c76177..f3af3150 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -7091,7 +7091,8 @@ "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true }, "lodash.defaultsdeep": { "version": "4.6.1", diff --git a/client/package.json b/client/package.json index ba416996..4f8c8a96 100644 --- a/client/package.json +++ b/client/package.json @@ -8,7 +8,6 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "lodash": "^4.17.15", "vue": "^2.6.10", "vue-router": "^3.1.3" }, @@ -21,6 +20,7 @@ "eslint": "^5.16.0", "eslint-plugin-vue": "^5.2.3", "lint-staged": "^8.2.1", + "lodash": "^4.17.15", "node-sass": "^4.13.0", "pug": "^2.0.4", "pug-loader": "^2.4.0", diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index b5a82dfb..9f4b6df8 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -249,9 +249,8 @@ export default { this.showEndgameMsg(score + " . " + message); } } - if (!this.analyze) { console.log("EMIT NEWMOVE"); + if (!this.analyze) this.$emit("newmove", move); //post-processing (e.g. computer play) - } }, undo: function(move) { const navigate = !move; diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index f69e1e6c..9f8e1a30 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -87,31 +87,24 @@ export default { fenStart: this.gameInfo.fen, players: players, mycolor: mycolor, + score: "*", }); this.compWorker.postMessage(["init",this.gameInfo.fen]); if (mycolor != "w" || this.gameInfo.mode == "auto") this.playComputerMove(); }, playComputerMove: function() { - -console.log("call comp move"); - this.timeStart = Date.now(); this.compWorker.postMessage(["askmove"]); }, // TODO: do not process if game is over (check score ?) processMove: function(move) { -console.log("play move"); - console.log(move); // Send the move to web worker (including his own moves) this.compWorker.postMessage(["newmove",move]); // subTurn condition for Marseille (and Avalanche) rules if ((!this.vr.subTurn || this.vr.subTurn <= 1) && (this.gameInfo.mode == "auto" || this.vr.turn != this.game.mycolor)) { - -console.log("ask new comp move"); - this.playComputerMove(); } }, diff --git a/client/src/views/Rules.vue b/client/src/views/Rules.vue index 701d56a7..f626cc9e 100644 --- a/client/src/views/Rules.vue +++ b/client/src/views/Rules.vue @@ -72,6 +72,9 @@ export default { // (AJAX) Request to get rules content (plain text, HTML) this.content = require("raw-loader!@/rules/" + vname + "/" + this.st.lang + ".pug") + // Next two lines fix a weird issue after last update (2019-11) + .replace(/\\[n"]/g, " ") + .replace('module.exports = "', '').replace(/"$/, "") .replace(/(fen:)([^:]*):/g, replaceByDiag); }, startGame: function(mode) { diff --git a/server/package-lock.json b/server/package-lock.json index 7613b0d7..0e1d37c2 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -4107,9 +4107,9 @@ "dev": true }, "postcss": { - "version": "7.0.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.21.tgz", - "integrity": "sha512-uIFtJElxJo29QC753JzhidoAhvp/e/Exezkdhfmt8AymWT6/5B7W1WmponYWkHk2eg6sONyTch0A3nkMPun3SQ==", + "version": "7.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.23.tgz", + "integrity": "sha512-hOlMf3ouRIFXD+j2VJecwssTwbvsPGJVMzupptg+85WA+i7MwyrydmQAgY3R+m0Bc0exunhbJmijy8u8+vufuQ==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1",