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) {
update_board_highlight();
redraw_arrows();
});
+ new ResizeObserver(() => update_sparkline(displayed_analysis_data || current_analysis_data)).observe(document.getElementById('scoresparkcontainer'));
window.addEventListener('keyup', function(event) {
if (event.which == 39) { // Left arrow.
next_move();