Save current state (unmerged, broken, not working...)
[vchess.git] / public / javascripts / components / rules.js
index 829bf3b..02d3a0c 100644 (file)
@@ -3,10 +3,14 @@ Vue.component('my-rules', {
        data: function() {
                return { content: "" };
        },
-       template: `<div v-html="content" class="section-content"></div>`,
+       template: `
+               <div class="col-sm-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
+                       <div v-html="content" class="section-content"></div>
+               </div>
+       `,
        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],
                        };
                },
        },