projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some fixes, wrote some rules, implemented Wormhole variant
[vchess.git]
/
client
/
src
/
views
/
Analyse.vue
diff --git
a/client/src/views/Analyse.vue
b/client/src/views/Analyse.vue
index
5d22306
..
23515c6
100644
(file)
--- a/
client/src/views/Analyse.vue
+++ b/
client/src/views/Analyse.vue
@@
-3,9
+3,14
@@
main
.row
.col-sm-12
.text-center
.row
.col-sm-12
.text-center
- input#fen(v-model="curFen" @input="adjustFenSize()")
- button(@click="gotoFen()") {{ st.tr["Go"] }}
- BaseGame(:game="game" :vr="vr")
+ input#fen(
+ v-model="curFen"
+ @input="adjustFenSize(); tryGotoFen()"
+ )
+ BaseGame(
+ :game="game"
+ :vr="vr"
+ )
</template>
<script>
</template>
<script>
@@
-31,7
+36,6
@@
export default {
},
vr: null, //"variant rules" object initialized from FEN
curFen: ""
},
vr: null, //"variant rules" object initialized from FEN
curFen: ""
- //people: [], //players + observers //TODO later: interactive analyze...
};
},
watch: {
};
},
watch: {
@@
-44,13
+48,8
@@
export default {
},
created: function() {
this.gameRef.vname = this.$route.params["vname"];
},
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() {
},
methods: {
initialize: async function() {
@@
-73,9
+72,12
@@
export default {
let fenInput = document.getElementById("fen");
fenInput.style.width = this.curFen.length + "ch";
},
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();
+ }
}
}
};
}
}
};