]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Unbreak history uncollapsing.
[remoteglot] / www / js / remoteglot.js
index bff8e9cd75aac0691bd9c95acbefbc36977a23d6..e478fb88225f37bd5559fdbdb971e6b03d961399 100644 (file)
@@ -7,7 +7,7 @@
  * @type {Number}
  * @const
  * @private */
-var SCRIPT_VERSION = 2016032000;
+var SCRIPT_VERSION = 2016032200;
 
 /**
  * The current backend URL.
@@ -48,6 +48,7 @@ var displayed_analysis_data = null;
  *      name: string,
  *      url: string,
  *      id: string,
+ *      score: Object
  * }>}
  * @private
  */
@@ -644,8 +645,8 @@ var add_pv = function(start_fen, pretty_pv, move_num, toplay, score, start_displ
 
 /**
  * @param {number} line_num
- * @param {number=} opt_limit
- * @param {boolean=} opt_showlast
+ * @param {number=} opt_limit If set, show at most this number of moves.
+ * @param {boolean=} opt_showlast If limit is set, show the last moves instead of the first ones.
  */
 var print_pv = function(line_num, opt_limit, opt_showlast) {
        var display_line = display_lines[line_num];
@@ -731,7 +732,7 @@ var update_history = function() {
        } else {
                $("#history").html(
                        '(<a class="move" href="javascript:collapse_history(true)">collapse</a>) ' +
-                       print_pv(0, 1, 'W'));
+                       print_pv(0));
        }
 }
 
@@ -895,6 +896,10 @@ var update_game_list = function(games) {
                        game_a.appendChild(game_name);
                        game_span.appendChild(game_a);
                }
+
+               var score = " (" + format_short_score(game['score']) + ")";
+               game_span.appendChild(document.createTextNode(score));
+
                games_div.appendChild(game_span);
        }
 }