X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FProblems.vue;h=a55126fa10c12c202360f4d1468fe56930e09584;hb=70c9745d34b705eb8a4dc72b6e4655739d31347c;hp=b989fbcb19024006b4d9366733acf016fdd9970f;hpb=ad16f8397b0d8a22897537e2f76b4388182a84af;p=vchess.git diff --git a/client/src/views/Problems.vue b/client/src/views/Problems.vue index b989fbcb..a55126fa 100644 --- a/client/src/views/Problems.vue +++ b/client/src/views/Problems.vue @@ -47,14 +47,14 @@ main @input="adjustHeight('instructions')" v-model="curproblem.instruction" ) - p(v-html="parseHtml(curproblem.instruction)") + .instructions(v-html="parseHtml(curproblem.instruction)") fieldset textarea.solution-edit( :placeholder="st.tr['Solution']" @input="adjustHeight('solution')" v-model="curproblem.solution" ) - p(v-html="parseHtml(curproblem.solution)") + .solution(v-html="parseHtml(curproblem.solution)") button(@click="sendProblem()") {{ st.tr["Send"] }} #dialog.text-center {{ st.tr[infoMsg] }} .row(v-if="showOne") @@ -70,12 +70,12 @@ main | {{ st.tr["Previous_p"] }} button.nomargin(@click="gotoPrevNext(curproblem,-1)") | {{ st.tr["Next_p"] }} - p.oneInstructions.clickable( + .instructions.oneInstructions.clickable( v-html="parseHtml(curproblem.instruction)" @click="curproblem.showSolution=!curproblem.showSolution" ) | {{ st.tr["Show solution"] }} - p( + .solution( v-show="curproblem.showSolution" v-html="parseHtml(curproblem.solution)" ) @@ -131,6 +131,7 @@ import params from "@/parameters"; import { getDiagram, replaceByDiag } from "@/utils/printDiagram"; import { processModalClick } from "@/utils/modalClick"; import { ArrayFun } from "@/utils/array"; +import afterRawLoad from "@/utils/afterRawLoad"; import BaseGame from "@/components/BaseGame.vue"; export default { name: "my-problems", @@ -313,19 +314,13 @@ export default { this.loadedVar = vid; cb(); }); - // (AJAX) Request to get rules content (plain text, HTML) this.rulesContent = - require( - "raw-loader!@/translations/rules/" + - variant.name + "/" + - 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/" + variant.name + "/" + + this.st.lang + ".pug" + ).default + ).replace(/(fen:)([^:]*):/g, replaceByDiag); }, trySetDiagram: function(prob) { // Problem edit: FEN could be wrong or incomplete, @@ -513,9 +508,13 @@ export default {