projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Save current state (unmerged, broken, not working...)
[vchess.git]
/
public
/
javascripts
/
components
/
rules.js
diff --git
a/public/javascripts/components/rules.js
b/public/javascripts/components/rules.js
index
660f0be
..
02d3a0c
100644
(file)
--- a/
public/javascripts/components/rules.js
+++ b/
public/javascripts/components/rules.js
@@
-3,16
+3,20
@@
Vue.component('my-rules', {
data: function() {
return { content: "" };
},
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)
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) => {
let replaceByDiag = (match, p1, p2) => {
- const args =
self
.parseFen(p2);
+ const args =
this
.parseFen(p2);
return getDiagram(args);
};
return getDiagram(args);
};
-
self
.content = response.replace(/(fen:)([^:]*):/g, replaceByDiag);
- }
+
this
.content = response.replace(/(fen:)([^:]*):/g, replaceByDiag);
+ }
);
},
methods: {
parseFen(fen) {
},
methods: {
parseFen(fen) {
@@
-21,6
+25,7
@@
Vue.component('my-rules', {
position: fenParts[0],
marks: fenParts[1],
orientation: fenParts[2],
position: fenParts[0],
marks: fenParts[1],
orientation: fenParts[2],
+ shadow: fenParts[3],
};
},
},
};
},
},