* @type {Number}
* @const
* @private */
-var SCRIPT_VERSION = 2016032000;
+var SCRIPT_VERSION = 2016032200;
/**
* The current backend URL.
* name: string,
* url: string,
* id: string,
+ * score: Object
* }>}
* @private
*/
/**
* @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];
} else {
$("#history").html(
'(<a class="move" href="javascript:collapse_history(true)">collapse</a>) ' +
- print_pv(0, 1, 'W'));
+ print_pv(0));
}
}
var depth_td = document.createElement("td");
tr.appendChild(depth_td);
$(depth_td).addClass("depth");
- $(depth_td).text("d" + line['depth']);
+ if (line['depth'] && line['depth'] >= 0) {
+ $(depth_td).text("d" + line['depth']);
+ } else {
+ $(depth_td).text("—");
+ }
var pv_td = document.createElement("td");
tr.appendChild(pv_td);
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);
}
}
for (var i = 0; i < current_games.length; ++i) {
if (current_games[i]['id'] === hash) {
if (backend_url !== current_games[i]['url']) {
- switch_backend(current_games[i]['url']);
+ switch_backend(current_games[i]['url'], current_games[i]['hashurl']);
}
return;
}
if (current_display_line &&
current_display_move < current_display_line.pretty_pv.length - 1 &&
- current_display_line.pretty_pv[current_display_move] === move.san) {
+ current_display_line.pretty_pv[current_display_move + 1] === move.san) {
next_move();
return;
}
}
var format_short_score = function(score) {
+ if (!score) {
+ return "???";
+ }
if (score[0] === 'm') {
if (score[2]) { // Is a bound.
return score[2] + "\u00a0M" + pad(score[1], 3);
/**
* @param {string} new_backend_url
*/
-var switch_backend = function(new_backend_url) {
+var switch_backend = function(new_backend_url, new_backend_hash_url) {
// Stop looking at historic data.
current_display_line = null;
current_display_move = null;
// Request an immediate fetch with the new backend.
backend_url = new_backend_url;
+ backend_hash_url = new_backend_hash_url;
current_analysis_data = null;
ims = 0;
request_update();