}
}
- var move_a = document.createElement("a");
- move_a.href = "javascript:make_move('" + line[j] + "')";
- td.appendChild(move_a);
- $(move_a).text(line[j]);
+ if (line[j] === '1-0' || line[j] === '1/2-1/2' || line[j] === '0-1') {
+ $(td).text($(td).text() + line[j]);
+ } else {
+ var move_a = document.createElement("a");
+ move_a.href = "javascript:make_move('" + line[j] + "')";
+ td.appendChild(move_a);
+ $(move_a).text(line[j]);
+ }
} else if (headings[j][1] == TYPE_INTEGER) {
add_td(tr, line[j] || 0);
} else if (headings[j][1] == TYPE_FLOAT) {
}
window['set_includetransp'] = set_includetransp;
+var set_flipboard = function(value) {
+ board.orientation(value ? 'black' : 'white');
+}
+window['set_flipboard'] = set_flipboard;
+
var make_move = function(move, do_update) {
var history = game.history({ verbose: true });
if (move_override < history.length && history[move_override].san == move) {
prev_move();
}
});
-}
+ // Seemingly the web worker is not started before we send it a message.
+ stockfish.postMessage("uci");
+}
$(document).ready(init);