X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=60aa9c430833caa145aa522d7060a9e6e3a9d91b;hb=a9f262f38d7ae9ea4c935c549309bd2f773aa6c2;hp=00cb944d62dc6e6e9c08a26104773af0f9ebc3b3;hpb=8d7e2786f5a67a1b9a77c742d7951e0efbe8747d;p=vchess.git diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index 00cb944d..60aa9c43 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -2,12 +2,14 @@ Vue.component('my-problems', { data: function () { return { problems: [], //oldest first - curIdx: 0, //index in problems array - stage: "nothing", //or "preview" after new problem is filled + myProblems: [], //same + curProblems: [], //assigned to either of the ones above + curIdx: 0, //index in (current) problems array newProblem: { fen: "", instructions: "", solution: "", + preview: false, }, }; }, @@ -27,10 +29,19 @@ Vue.component('my-problems', { skip_next - + --> OK, mais ces flèches n'ont pas la même action selon les vues + --> fetchN si liste, problème suivant/précédent sinon - if (this.mode == "problem") +board qui bouge et activé que si #hash donnant numéro du problème +deux listes : tous les problèmes sauf les miens + + les miens + + +//TODO: filter "my problems" ==> liste séparée (lors de la requête serveur) +--> bouton plutôt sous l'échiquier après soluce (sauf si anonymous) +--> puis dans la vue "my problems (listing échiquier gauche / instrus + soluce cachée à droite +if (this.mode == "problem") { // Show problem instructions elementArray.push( @@ -132,6 +143,8 @@ Vue.component('my-problems', { created: function() { // Analyse URL: if a single problem required, show it. Otherwise, // TODO: fetch most recent problems from server + // If the requested problem is in the list, just show it + this.tryNavigate(); }, methods: { translate: function(text) { @@ -217,5 +230,3 @@ Vue.component('my-problems', { // TODO: // possibilité de supprimer / éditer si peer ID reconnu comme celui du probleme (champ "uploader") -// --> côté serveur on vérifie un certain "secret" -// --> filtre possible "mes problèmes"