From: Steinar H. Gunderson Date: Sun, 14 Dec 2014 10:45:33 +0000 (+0100) Subject: Make move history clickable. X-Git-Url: https://git.sesse.net/?p=remoteglot-book;a=commitdiff_plain;h=6b457f9f2f73a99fcbba1c1e71682f8b4f52a318 Make move history clickable. --- diff --git a/www/js/book.js b/www/js/book.js index 1f2ec37..47e540e 100644 --- a/www/js/book.js +++ b/www/js/book.js @@ -35,7 +35,7 @@ var update = function() { if (i == move_override) { text += '' + history[i] + ''; } else { - text += history[i]; + text += '' + history[i] + ''; } text += " "; } @@ -258,6 +258,12 @@ var next_move = function() { } window['next_move'] = next_move; +var set_move = function(n) { + move_override = n; + update(); +} +window['set_move'] = set_move; + // almost all of this stuff comes from the chessboard.js example page var onDragStart = function(source, piece, position, orientation) { var game = get_game();