X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FAnalyse.vue;h=eb36422d0f7541c4d900da6a38124572e1226ab9;hb=70c9745d34b705eb8a4dc72b6e4655739d31347c;hp=bc88c7573f0292f8556ebf958f66277923869a67;hpb=26d8a01a40dc198b633ae86f698b1ae82415e5e1;p=vchess.git diff --git a/client/src/views/Analyse.vue b/client/src/views/Analyse.vue index bc88c757..eb36422d 100644 --- a/client/src/views/Analyse.vue +++ b/client/src/views/Analyse.vue @@ -7,7 +7,8 @@ main ) .card label.modal-close(for="modalRules") - h4#variantNameInAnalyze(@click="gotoRules()") {{ game.vname }} + a#variantNameInAnalyze(:href="'/#/variants/'+game.vname") + | {{ game.vname }} div(v-html="rulesContent") .row .col-sm-12 @@ -28,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 @@ -99,20 +101,12 @@ export default { }) .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); - }, - gotoRules: function() { - this.$router.push("/variants/" + this.gameRef.vname); + 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; @@ -149,11 +143,13 @@ export default {