+ watch: {
+ // fenStart changes when a new game starts
+ "gameInfo.fenStart": function() {
+ // Reset all variables
+ this.endgameMessage = "";
+ this.orientation = this.gameInfo.mycolor || "w";
+ this.score = "*";
+ this.moves = [];
+ this.cursor = -1;
+ this.lastMove = null;
+ },
+ analyze: function() {
+ if (this.analyze)
+ {
+ // Switched to analyze mode: game is over
+ this.endGame("*");
+ }
+ },
+ },