+ computed: {
+ sortedProblems: function() {
+ // Newest problem first
+ return problems.sort((p1,p2) => { return p2.added - p1.added; });
+ },
+ mailErrProblem: function() {
+ return "mailto:contact@vchess.club?subject=[" + variant + " problems] error";
+ },
+ },
+ methods: {
+ fetchProblems: function(direction) {
+ // TODO: ajax call return list of max 10 problems
+ // Do not do anything if no older problems (and store this result in cache!)
+ // TODO: ajax call return list of max 10 problems
+ // Do not do anything if no newer problems
+ },
+ showProblem: function(prob) {
+ //TODO: send event with object prob.fen, prob.instructions, prob.solution
+ //Event should propagate to game, which set mode=="problem" + other variables
+ //click on a problem ==> land on variant page with mode==friend, FEN prefilled... ok
+ // click on problem ==> masque problems, affiche game tab, launch new game Friend with
+ // FEN + turn + flags + rappel instructions / solution on click sous l'échiquier
+ },
+ showNewproblemModal: function() {
+ document.getElementById("modal-newproblem").checked = true;
+ },
+ postNewProblem: function() {
+ const fen = document.getElementById("newpbFen").value;
+ const instructions = document.getElementById("newpbInstructions").value;
+ const solution = document.getElementById("newpbSolution").value;
+
+ },
+ },