X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FAnalyse.vue;h=06ef790146907e0a592299bc215ffc4410c0a84f;hb=0fb43db7c2858201e8410670b90f95ad8b138964;hp=9dcf033aab37ae5b0efadda7a3fbb8c95137dc6e;hpb=1c15969ecec2a86ee7dffe570e53dfd61fd06b22;p=vchess.git diff --git a/client/src/views/Analyse.vue b/client/src/views/Analyse.vue index 9dcf033a..06ef7901 100644 --- a/client/src/views/Analyse.vue +++ b/client/src/views/Analyse.vue @@ -29,6 +29,7 @@ import BaseGame from "@/components/BaseGame.vue"; import { processModalClick } from "@/utils/modalClick"; import { replaceByDiag } from "@/utils/printDiagram"; import { store } from "@/store"; +import afterRawLoad from "@/utils/afterRawLoad"; export default { name: "my-analyse", // TODO: game import ==> require some adjustments, like @@ -98,19 +99,14 @@ export default { this.alertAndQuit("Analysis disabled for this variant"); else this.loadGame(orientation); }) - .catch((err) => { this.alertAndQuit("Mispelled variant name", true); }); + //.catch((err) => { this.alertAndQuit("Mispelled variant name", true); }); this.rulesContent = - require( - "raw-loader!@/translations/rules/" + - this.gameRef.vname + "/" + - this.st.lang + ".pug" - ) - // Next two lines fix a weird issue after last update (2019-11) - .replace(/\\n/g, " ") - .replace(/\\"/g, '"') - .replace('module.exports = "', "") - .replace(/"$/, "") - .replace(/(fen:)([^:]*):/g, replaceByDiag); + afterRawLoad( + require( + "raw-loader!@/translations/rules/" + + this.gameRef.vname + "/" + this.st.lang + ".pug" + ).default + ).replace(/(fen:)([^:]*):/g, replaceByDiag); }, loadGame: function(orientation) { this.game.vname = this.gameRef.vname;