.text-center
input#fen(
v-model="curFen"
- @input="adjustFenSize()"
+ @input="adjustFenSize(); tryGotoFen()"
)
- button(@click="gotoFen()") {{ st.tr["Go"] }}
BaseGame(
:game="game"
:vr="vr"
},
vr: null, //"variant rules" object initialized from FEN
curFen: ""
- //people: [], //players + observers //TODO later: interactive analyze...
};
},
watch: {
},
created: function() {
this.gameRef.vname = this.$route.params["vname"];
- if (this.gameRef.vname == "Dark") {
- alert(this.st.tr["Analyse in Dark mode makes no sense!"]);
- history.back(); //or this.$router.go(-1)
- } else {
- this.gameRef.fen = this.$route.query["fen"].replace(/_/g, " ");
- this.initialize();
- }
+ this.gameRef.fen = this.$route.query["fen"].replace(/_/g, " ");
+ this.initialize();
},
methods: {
initialize: async function() {
let fenInput = document.getElementById("fen");
fenInput.style.width = this.curFen.length + "ch";
},
- gotoFen: function() {
- this.gameRef.fen = this.curFen;
- this.loadGame();
+ tryGotoFen: function() {
+ if (V.IsGoodFen(this.curFen))
+ {
+ this.gameRef.fen = this.curFen;
+ this.loadGame();
+ }
}
}
};