Fix bugs on variant page + update packages
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 19 Nov 2019 16:04:27 +0000 (17:04 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 19 Nov 2019 16:04:27 +0000 (17:04 +0100)
client/package-lock.json
client/package.json
client/src/components/BaseGame.vue
client/src/components/ComputerGame.vue
client/src/views/Rules.vue
server/package-lock.json

index 64c7617..f3af315 100644 (file)
     "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",
index ba41699..4f8c8a9 100644 (file)
@@ -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",
index b5a82df..9f4b6df 100644 (file)
@@ -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;
index f69e1e6..9f8e1a3 100644 (file)
@@ -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();
       }
     },
index 701d56a..f626cc9 100644 (file)
@@ -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) {
index 7613b0d..0e1d37c 100644 (file)
       "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",