From dd6a7087b52673d6d86464e18889d6fbc94a99f7 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 14 Dec 2014 00:43:43 +0100 Subject: [PATCH] Show game history under the board. --- www/book.html | 1 + www/js/book.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/www/book.html b/www/book.html index 9a760b3..cb5a07f 100644 --- a/www/book.html +++ b/www/book.html @@ -18,6 +18,7 @@

>>>

+

diff --git a/www/js/book.js b/www/js/book.js index fff27fc..2c5af12 100644 --- a/www/js/book.js +++ b/www/js/book.js @@ -27,6 +27,20 @@ var get_game = function() { } var update = function() { + var text = ""; + for (var i = 0; i < history.length; ++i) { + if (i % 2 == 0) { + text += (i/2 + 1) + ". "; + } + if (i == move_override) { + text += '' + history[i] + ''; + } else { + text += history[i]; + } + text += " "; + } + $('#gamehistory').html(text); + var game = get_game(); board.position(game.fen()); fetch_analysis(); -- 2.39.2