From b0d46dd599549be880a2c902df7bf0b21424e6fe Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 29 Dec 2022 10:03:32 +0100 Subject: [PATCH] Simplify print_pv(). --- www/js/remoteglot.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 5d19116..3667f59 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -754,18 +754,6 @@ function print_pv(line_num, splicepos, opt_limit, opt_showlast) { move_num += i / 2; } else if (toplay == 'B' && pv.length > 0) { ret.appendChild(document.createTextNode(move_num + '. … ')); - let move = ""; - if (splicepos === 0) { - ret.appendChild(document.createTextNode('(TB: ')); - in_tb = true; - } - link.setAttribute('id', 'automove' + line_num + '-0'); - link.href = 'javascript:show_line(' + line_num + ', ' + 0 + ');'; - link.textContent = pv[0]; - ret.appendChild(link); - toplay = 'W'; - ++i; - ++move_num; } for ( ; i < pv.length; ++i) { link = document.createElement('a'); @@ -778,7 +766,10 @@ function print_pv(line_num, splicepos, opt_limit, opt_showlast) { in_tb = true; } - if (toplay == 'W') { + if (toplay == 'B' && i == 0) { + ++move_num; + toplay = 'W'; + } else if (toplay == 'W') { if (i > opt_limit && !opt_showlast) { if (in_tb) { ret.appendChild(document.createTextNode(')')); -- 2.39.2