X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2FproblemSummary.js;fp=public%2Fjavascripts%2Fcomponents%2FproblemSummary.js;h=2c9ea94ef3661ad7f56d49c1c5a6d275712e8eb3;hb=8ef618ef05070642849f50861399116c2d69a816;hp=0000000000000000000000000000000000000000;hpb=ff1d4c3f43d8333e9629a8e59606c234cb10869f;p=vchess.git diff --git a/public/javascripts/components/problemSummary.js b/public/javascripts/components/problemSummary.js new file mode 100644 index 00000000..2c9ea94e --- /dev/null +++ b/public/javascripts/components/problemSummary.js @@ -0,0 +1,36 @@ +// Preview a problem on variant page +Vue.component('my-problem-preview', { + props: ['prob','userid'], + template: ` +
+
+
+
+

+

+

{{ timestamp2date(prob.added) }}

+
+ + +
+
+
+ `, + methods: { + getDiagram: function(fen) { + const fenParsed = V.ParseFen(fen); + return getDiagram({ + position: fenParsed.position, + turn: fenParsed.turn, + // No need for flags here + }); + }, + timestamp2date(ts) { + return getDate(new Date(ts)); + }, + sendSignal: function(action) { + this.$emit(action + "-problem"); + }, + }, +})