From 6b457f9f2f73a99fcbba1c1e71682f8b4f52a318 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 14 Dec 2014 11:45:33 +0100 Subject: [PATCH] Make move history clickable. --- www/js/book.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); -- 2.39.2