X-Git-Url: https://git.auder.net/pieces/Cwda/n_white_knight.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=49e72b67343aa2351cb9be705317322e71280466;hb=6b519a847765bb99c97ef1eba0eaa50a0fa61279;hp=558f0bada06f9099d41ed895d76882c05c9561bd;hpb=26b8e4f7c71030d49e44fe1d89632ef91b886d67;p=vchess.git diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index 558f0bad..49e72b67 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -1,229 +1,330 @@ Vue.component('my-problems', { + props: ["probId","settings"], data: function () { return { + userId: user.id, problems: [], //oldest first - myProblems: [], //same - curIdx: 0, //index in problems array - stage: "nothing", //or "preview" after new problem is filled - newProblem: { + 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: "", + preview: false, }, }; }, + // NOTE: always modals first, because otherwise "scroll to the end" undesirable effect template: `