X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=www%2Fjs%2Fbook.js;h=a489a6a3ed3c1a1dc0ef199789b870274ee42032;hb=64b65677dbce50c97c63d6aa7e31bb141cb183b5;hp=d95b6e8acdd6e3f1040b76d78ac80b05ed55c274;hpb=ef20c7b10b72bf9dbad4e2507e994b19229701ea;p=remoteglot-book 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);