From 64b65677dbce50c97c63d6aa7e31bb141cb183b5 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 14 Dec 2014 00:13:12 +0100 Subject: [PATCH] Show move number. --- www/js/book.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/js/book.js b/www/js/book.js index d95b6e8..a489a6a 100644 --- a/www/js/book.js +++ b/www/js/book.js @@ -188,6 +188,14 @@ var show_lines = function(data, game) { var td = document.createElement("td"); tr.appendChild(td); $(td).addClass("move"); + if (line[j] !== undefined) { + if (history.length % 2 == 0) { + $(td).text(((history.length / 2) + 1) + ". "); + } else { + $(td).text(((history.length / 2) + 0.5) + ". …"); + } + } + var move_a = document.createElement("a"); move_a.href = "javascript:make_move('" + line[j] + "')"; td.appendChild(move_a); -- 2.39.2