X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=a95529234fbe9ebaa7766d984395661271424e9a;hb=b955c65b942d09d24b5c3bed0d755d4f2f8f71f1;hp=d9265a36fcecb7a4df65d24d88f18d7bcef6f6f8;hpb=77fa6d1fe6306f1f9dcd3c363bba8965b602d237;p=vchess.git diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index d9265a36..a9552923 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -1,115 +1,344 @@ 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, }, }; }, + // NOTE: always modals first, because otherwise "scroll to the end" undesirable effect template: ` -