X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=inline;f=www%2Fjs%2Fremoteglot.js;h=34e1863624ffdc7afd34a7913e54acd35bbc6028;hb=83d2eb4;hp=35683608f55fb33aac14a0e5d7b5fd16f39497c6;hpb=d74a69f327e46402ee647e2b0eba4c24e6914d27;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 3568360..34e1863 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -7,7 +7,7 @@ * @type {Number} * @const * @private */ -var SCRIPT_VERSION = 2016091401; +var SCRIPT_VERSION = 2016113002; /** * The current backend URL. @@ -1317,6 +1317,13 @@ var update_sparkline = function(data) { return format_tooltip(data, fields[0].offset + first_move_num - 1); } }); + $('#scorespark').bind('sparklineClick', function(event) { + var sparkline = event.sparklines[0]; + var region = sparkline.getCurrentRegionFields(); + if (region[0].offset !== undefined) { + show_line(0, first_move_num + region[0].offset - 1); + } + }); } else { $("#scorespark").text(""); } @@ -1411,8 +1418,9 @@ var update_clock = function() { return; } - // If either player has ten minutes or less left, add the second counters. - var show_seconds = (white_clock_ms < 60 * 10 * 1000 || black_clock_ms < 60 * 10 * 1000); + // If either player has twenty minutes or less left, add the second counters. + // This matches what DGT clocks do. + var show_seconds = (white_clock_ms < 60 * 20 * 1000 || black_clock_ms < 60 * 20 * 1000); if (color) { // See when the clock will change next, and update right after that.