X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=client%2Fclient_OLD%2Fjavascripts%2Fcomponents%2Frules.js;fp=client%2Fclient_OLD%2Fjavascripts%2Fcomponents%2Frules.js;h=0000000000000000000000000000000000000000;hb=8d61fc4ab7373b4a576f3f9108cdf7768ae27096;hp=0f27d5327177c9f18d664869a6b024ea09dc6c37;hpb=760865ac92508676c0047b84c5ba3e12d41d7c20;p=vchess.git
diff --git a/client/client_OLD/javascripts/components/rules.js b/client/client_OLD/javascripts/components/rules.js
deleted file mode 100644
index 0f27d532..00000000
--- a/client/client_OLD/javascripts/components/rules.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// Load rules on variant page
-Vue.component('my-rules', {
- props: ["settings"],
- data: function() {
- return {
- content: "",
- display: "rules",
- mode: "computer",
- subMode: "", //'auto' for game CPU vs CPU
- gameInProgress: false,
- mycolor: "w",
- allowMovelist: true,
- fen: "",
- };
- },
- template: `
-
-
-
-
-
-
-
-
-
-
-
- `,
- mounted: function() {
- // AJAX request to get rules content (plain text, HTML)
- ajax("/rules/" + variant.name, "GET", response => {
- let replaceByDiag = (match, p1, p2) => {
- const args = this.parseFen(p2);
- return getDiagram(args);
- };
- this.content = response.replace(/(fen:)([^:]*):/g, replaceByDiag);
- });
- },
- methods: {
- parseFen(fen) {
- const fenParts = fen.split(" ");
- return {
- position: fenParts[0],
- marks: fenParts[1],
- orientation: fenParts[2],
- shadow: fenParts[3],
- };
- },
- startGame: function() {
- if (this.gameInProgress)
- return;
- this.gameInProgress = true;
- this.mode = "computer";
- this.display = "computer";
- this.fen = V.GenRandInitFen();
- },
- stopGame: function() {
- this.gameInProgress = false;
- this.mode = "analyze";
- },
- playAgainstComputer: function() {
- this.subMode = "";
- this.startGame();
- },
- watchComputerGame: function() {
- this.subMode = "auto";
- this.startGame();
- },
- },
-})