From: Steinar H. Gunderson Date: Sat, 13 Dec 2014 23:43:43 +0000 (+0100) Subject: Show game history under the board. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=dd6a7087b52673d6d86464e18889d6fbc94a99f7;p=remoteglot-book Show game history under the board. --- 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();