X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Frules.js;h=02d3a0ca40ad7123db0e715f344c88a10db7b104;hp=829bf3b11754fe9c045d1e95dcd8dca3ee3ad5da;hb=8d7e2786f5a67a1b9a77c742d7951e0efbe8747d;hpb=7931e479adf93c87771ded1892a0873af72ae46d diff --git a/public/javascripts/components/rules.js b/public/javascripts/components/rules.js index 829bf3b1..02d3a0ca 100644 --- a/public/javascripts/components/rules.js +++ b/public/javascripts/components/rules.js @@ -3,10 +3,14 @@ Vue.component('my-rules', { data: function() { return { content: "" }; }, - template: `
`, + template: ` +
+
+
+ `, mounted: function() { // AJAX request to get rules content (plain text, HTML) - ajax("/rules/" + variant, "GET", response => { + ajax("/rules/" + variant.name, "GET", response => { let replaceByDiag = (match, p1, p2) => { const args = this.parseFen(p2); return getDiagram(args); @@ -21,6 +25,7 @@ Vue.component('my-rules', { position: fenParts[0], marks: fenParts[1], orientation: fenParts[2], + shadow: fenParts[3], }; }, },