-
Score: 0 - 0, out of 1
+
Score: 0 - 0, out of 1
Moves: 0
@@ -571,6 +573,7 @@
moves: p.querySelector("[data-moves]"),
score: p.querySelector("[data-score]"),
target: p.querySelector("[data-target]"),
+ scoreLine: p.querySelector(".score"),
delay: p.querySelector("[data-delay]"),
fill: p.querySelector("[data-fill]"),
dnum: p.querySelector("[data-dnum]")
@@ -579,6 +582,7 @@
var btnPlay = document.getElementById("playpause");
var btnSound = document.getElementById("sound");
var btnReset = document.getElementById("reset");
+ var btnScore = document.getElementById("score");
var sheet = document.getElementById("sheet");
var scoreSheet = document.getElementById("scoresheet");
var scrim = document.getElementById("scrim");
@@ -890,6 +894,17 @@
swWrap.appendChild(b);
});
+ // a single game has no match score, so the score line and the sheet that
+ // edits it are both out of the way until the match is longer than a point
+ function paintMatchChrome(){
+ var many = cfg.points > 1;
+ function show(node){
+ if(many) node.removeAttribute("hidden"); else node.setAttribute("hidden", "");
+ }
+ show(btnScore);
+ el.forEach(function(e){ show(e.scoreLine); });
+ }
+
function clock(ms){ // m:ss, for copy rather than the big readout
var s = Math.round(ms / 1000);
return Math.floor(s / 60) + ":" + ("0" + (s % 60)).slice(-2);
@@ -905,6 +920,7 @@
? "Reserve time per point."
: "Reserve time per point. " + cfg.points + " × " + clock(cfg.base) +
" = " + clock(matchTime()) + " each.";
+ paintMatchChrome();
document.getElementById("t-sound").setAttribute("aria-checked", cfg.sound ? "true" : "false");
btnSound.setAttribute("aria-pressed", cfg.sound ? "true" : "false");
showIcon(btnSound, "on", cfg.sound);
diff --git a/public_html/sw.js b/public_html/sw.js
index f927c1b..33dd73b 100644
--- a/public_html/sw.js
+++ b/public_html/sw.js
@@ -1,5 +1,5 @@
/* Cache-first: once installed the clock never touches the network again. */
-const CACHE = "bgclock-v4";
+const CACHE = "bgclock-v5";
const FILES = [
"./",
"./index.html",