Got the long push for right click working.
Find out that someone added that part in app.js, but I don't know who did that.
If I look on the GitHub site of Jürgen that part is missing. No voices in that web server.
var myvoice = "";
var voices = speechSynthesis.getVoices();
/* martin/molli: for Safari we need to pick an English voice explicitly,
otherwise the system default is used */
for (i = 0; i < voices.length; i++) {
if (voices[i].lang == "en-US") {
myvoice = voices[i];
break;
}
}
function talk(text) {
var msg = new SpeechSynthesisUtterance(text);
msg.lang = "en-US";
if (myvoice != "") {
msg.voice = myvoice;
}
window.speechSynthesis.speak(msg);
}
talk("Hello, welcome to Picochess!");
function saymove(move, board) {
var pnames = {
"p": "pawn",
"n": "knight",
"b": "bishop",
"r": "rook",
"q": "queen",
"k": "king",
};
talk(pnames[move.piece] + " from " + move.from + " to " +
move.to + ".");
if (move.color == "b") {
var sidm = "Black";
} else {
var sidm = "White";
}
if (move.flags.includes("e")) {
talk("Pawn takes pawn.");
} else if (move.flags.includes("c")) {
talk(pnames[move.piece] + " takes " + pnames[move.captured] + ".");
} else if (move.flags.includes("k")) {
talk(sidm + " castles kingside.");
} else if (move.flags.includes("q")) {
talk(sidm + " castles queenside.");
}
if (board.in_checkmate()) {
talk("Checkmate!");
} else if (board.in_check()) {
talk("Check!");
}
}