X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=a95529234fbe9ebaa7766d984395661271424e9a;hb=9e76c73c4c4f403563e025968934f29b397b53b3;hp=594d6e648b0832e664ab01324e78ace994be1d9a;hpb=da06a6eb0237123ce43fdb01cb06246b8b57f5e5;p=vchess.git diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index 594d6e64..a9552923 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -1,81 +1,344 @@ Vue.component('my-problems', { + props: ["probId","settings"], data: function () { return { - problems: problemArray //initial value + 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: "", + preview: false, + }, }; }, + // NOTE: always modals first, because otherwise "scroll to the end" undesirable effect template: ` -