projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Benedict rules for flipped colors when castling: seems more logical now
[vchess.git]
/
client
/
src
/
views
/
Game.vue
diff --git
a/client/src/views/Game.vue
b/client/src/views/Game.vue
index
b39e7d2
..
cb1b720
100644
(file)
--- a/
client/src/views/Game.vue
+++ b/
client/src/views/Game.vue
@@
-89,7
+89,7
@@
main
)
img(src="/images/icons/resign.svg")
button.tooltip(
)
img(src="/images/icons/resign.svg")
button.tooltip(
- v-else
-if="!!game.mycolor"
+ v-else
@click="clickRematch()"
:class="{['rematch-' + rematchOffer]: true}"
:aria-label="st.tr['Rematch']"
@click="clickRematch()"
:class="{['rematch-' + rematchOffer]: true}"
:aria-label="st.tr['Rematch']"
@@
-216,9
+216,10
@@
export default {
},
mounted: function() {
document.addEventListener('visibilitychange', this.visibilityChange);
},
mounted: function() {
document.addEventListener('visibilitychange', this.visibilityChange);
- document
- .getElementById("chatWrap")
- .addEventListener("click", processModalClick);
+ ["chatWrap", "infoDiv"].forEach(eltName => {
+ document.getElementById(eltName)
+ .addEventListener("click", processModalClick);
+ });
if ("ontouchstart" in window) {
// Disable tooltips on smartphones:
document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => {
if ("ontouchstart" in window) {
// Disable tooltips on smartphones:
document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => {
@@
-757,7
+758,7
@@
export default {
drawSent: this.drawOffer == "sent",
rematchSent: this.rematchOffer == "sent",
score: this.game.score,
drawSent: this.drawOffer == "sent",
rematchSent: this.rematchOffer == "sent",
score: this.game.score,
- score: this.game.scoreMsg,
+ score
Msg
: this.game.scoreMsg,
movesCount: L,
initime: this.game.initime[1 - myIdx] //relevant only if I played
};
movesCount: L,
initime: this.game.initime[1 - myIdx] //relevant only if I played
};
@@
-937,14
+938,9
@@
export default {
if (game.score == "*") {
// Set clocks + initime
game.initime = [0, 0];
if (game.score == "*") {
// Set clocks + initime
game.initime = [0, 0];
- if (L >= 1) {
- const gameLastupdate = game.moves[L-1].played;
- game.initime[L % 2] = gameLastupdate;
- if (L >= 2) {
- game.clocks[L % 2] =
- tc.mainTime - (Date.now() - gameLastupdate) / 1000;
- }
- }
+ if (L >= 1) game.initime[L % 2] = game.moves[L-1].played;
+ // NOTE: game.clocks shouldn't be computed right now:
+ // job will be done in re_setClocks() called soon below.
}
// Sort chat messages from newest to oldest
game.chats.sort((c1, c2) => {
}
// Sort chat messages from newest to oldest
game.chats.sort((c1, c2) => {
@@
-1040,11
+1036,8
@@
export default {
},
game,
);
},
game,
);
- if (this.gameIsLoading)
- // Re-load game because we missed some moves:
- // artificially reset BaseGame (required if moves arrived in wrong order)
- this.$refs["basegame"].re_setVariables();
- else {
+ this.$refs["basegame"].re_setVariables(this.game);
+ if (!this.gameIsLoading) {
// Initial loading:
this.gotMoveIdx = game.moves.length - 1;
// If we arrive here after 'nextGame' action, the board might be hidden
// Initial loading:
this.gotMoveIdx = game.moves.length - 1;
// If we arrive here after 'nextGame' action, the board might be hidden