ret.appendChild(document.createTextNode(move_num + '. … '));
}
for (; i < pv.length; ++i) {
- let link = document.createElement('a');
- link.className = 'move';
- link.setAttribute('id', 'automove' + line_num + '-' + i);
- link.textContent = pv[i];
- link.href = 'javascript:show_line(' + line_num + ', ' + i + ');';
+ let prefix = '';
if (splicepos === i) {
- ret.appendChild(document.createTextNode('(TB: '));
+ prefix = '(TB: ';
in_tb = true;
}
} else if (toplay == 'W') {
if (i > opt_limit && !opt_showlast) {
if (in_tb) {
- ret.appendChild(document.createTextNode(')'));
+ prefix += ')';
}
- ret.appendChild(document.createTextNode(' (…)'));
+ ret.appendChild(document.createTextNode(prefix + ' (…)'));
return ret;
}
- ret.appendChild(document.createTextNode(' ' + move_num + '. '));
+ prefix += ' ' + move_num + '. ';
++move_num;
toplay = 'B';
} else {
- ret.appendChild(document.createTextNode(' '));
+ prefix += ' ';
toplay = 'W';
}
+ ret.appendChild(document.createTextNode(prefix));
+
+ let link = document.createElement('a');
+ link.className = 'move';
+ link.setAttribute('id', 'automove' + line_num + '-' + i);
+ link.textContent = pv[i];
+ link.href = 'javascript:show_line(' + line_num + ', ' + i + ');';
ret.appendChild(link);
}
if (in_tb) {
document.getElementById("score").textContent = "No analysis for this move";
document.getElementById("pvtitle").textContent = "PV:";
document.getElementById("pv").replaceChildren();
- document.getElementById("searchstats").textContent = " ";
+ document.getElementById("searchstats").innerHTML = " ";
document.getElementById("refutationlines").replaceChildren();
document.getElementById("whiteclock").replaceChildren();
document.getElementById("blackclock").replaceChildren();
// This matches what DGT clocks do.
let show_seconds = (white_clock_ms < 60 * 20 * 1000 || black_clock_ms < 60 * 20 * 1000);
- if (color) {
+ if (color && remaining_ms > 0) {
// See when the clock will change next, and update right after that.
let next_update_ms;
if (show_seconds) {