projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some improvements + simplify TODOs
[xogo.git]
/
app.js
diff --git
a/app.js
b/app.js
index
0a1fffe
..
676b895
100644
(file)
--- a/
app.js
+++ b/
app.js
@@
-86,8
+86,9
@@
function cancelSeek() {
if (send("cancelseek", {vname: seek_vname})) toggleVisible("newGame");
}
if (send("cancelseek", {vname: seek_vname})) toggleVisible("newGame");
}
-function sendRematch() {
- if (send("rematch", {gid: gid})) toggleVisible("pendingRematch");
+function sendRematch(random) {
+ if (send("rematch", {gid: gid, random: !!random}))
+ toggleVisible("pendingRematch");
}
function cancelRematch() {
if (send("norematch", {gid: gid})) toggleVisible("newGame");
}
function cancelRematch() {
if (send("norematch", {gid: gid})) toggleVisible("newGame");
@@
-397,7
+398,8
@@
connectToWSS();
// Playing
function toggleTurnIndicator(myTurn) {
// Playing
function toggleTurnIndicator(myTurn) {
- let indicator = $.getElementById("chessboard");
+ let indicator =
+ $.getElementById("boardContainer").querySelector(".chessboard");
if (myTurn) indicator.style.outline = "thick solid green";
else indicator.style.outline = "thick solid lightgrey";
}
if (myTurn) indicator.style.outline = "thick solid green";
else indicator.style.outline = "thick solid lightgrey";
}
@@
-479,11
+481,11
@@
function initializeGame(obj) {
</g>
</svg>
</div>
</g>
</svg>
</div>
- <div class="resizeable
" id="
chessboard"></div>`;
+ <div class="resizeable
chessboard"></div>`;
vr = new V({
seed: obj.seed, //may be null if FEN already exists (running game)
fen: obj.fen,
vr = new V({
seed: obj.seed, //may be null if FEN already exists (running game)
fen: obj.fen,
- element: "
chessboard
",
+ element: "
boardContainer
",
color: playerColor,
afterPlay: afterPlay,
options: options
color: playerColor,
afterPlay: afterPlay,
options: options