660f0be9976e56109716fed35aed292a3affb755
1 // Load rules on variant page
2 Vue
.component('my-rules', {
4 return { content: "" };
6 template: `<div v-html="content" class="section-content"></div>`,
8 // AJAX request to get rules content (plain text, HTML)
9 ajax("/rules/" + variant
, "GET", response
=> {
10 let replaceByDiag
= (match
, p1
, p2
) => {
11 const args
= self
.parseFen(p2
);
12 return getDiagram(args
);
14 self
.content
= response
.replace(/(fen:)([^:]*):/g, replaceByDiag
);
19 const fenParts
= fen
.split(" ");
21 position: fenParts
[0],
23 orientation: fenParts
[2],