{{ curProb.instructions }}
++ {{ translate("Show solution") }} +
+{{ curProb.solution }}
+X-Git-Url: https://git.auder.net/pieces/Cwda/n_black_bishop.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=d1ec9a215685151fabfde982eb66c47b4bcab878;hb=97da8720d3f33cb0c29079baf42c52ed047c3049;hp=ef017e5953798eaa17513de7b40907b5080e92a3;hpb=6b5517b4cdd12d7480b811c94c134982c16d3814;p=vchess.git diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index ef017e59..d1ec9a21 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -1,129 +1,326 @@ Vue.component('my-problems', { + props: ["probId","settings"], data: function () { return { - problems: problemArray, //initial value - newProblem: { + userId: user.id, + problems: [], //oldest first + myProblems: [], //same, but only mine + singletons: [], //requested problems (using #num) + display: "others", //or "mine" + curProb: null, //(reference to) current displayed problem (if any) + showSolution: false, + nomoreMessage: "", + mode: "analyze", //for game component + pbNum: 0, //to navigate directly to some problem + // New problem (to upload), or existing problem to edit: + modalProb: { + id: 0, //defined if it's an edit + uid: 0, //...also fen: "", instructions: "", solution: "", - stage: "nothing", //or "preview" after new problem is filled + preview: false, }, }; }, template: `
{{ curProb.instructions }}
+{{ curProb.solution }}
+