From: Steinar H. Gunderson Date: Wed, 27 Feb 2019 19:00:38 +0000 (+0100) Subject: Reinstate the Exo hack. X-Git-Url: https://git.sesse.net/?p=ultimatescore;a=commitdiff_plain;h=d62c9b9a3b3b221778baaae54c22156acd8d403d Reinstate the Exo hack. --- diff --git a/config.js b/config.js index b6b675f..eab21b0 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,7 @@ var ultimateconfig = { 'tournament_title': 'Battle of Oak Hill 2019', 'tournament_footer': 'ekebergsk.com | #us4', + 'exohack': true, // Share both sheets with ultimate-nm-2018@solskogen-cubemap.iam.gserviceaccount.com. 'score_sheet_id': '1DSRRcV6d6Dx9KbCZgOSFF0MX9wKRex9nHcUjjOG4DNE', diff --git a/score.js b/score.js index b25a611..ab07189 100644 --- a/score.js +++ b/score.js @@ -254,7 +254,7 @@ function update_clock() if (sec < 10) sec = "0" + sec; let text = min + ":" + sec; - if (false) { + if (ultimateconfig['exohack']) { // This is a hack around the fact that Exo has variable-width numerals. // It doesn't look fantastic, but for the clock, it's better not to have // the text jumping around. @@ -281,7 +281,22 @@ function update_clock2() if (sec < 10) sec = "0" + sec; let text = min + ":" + sec; - document.getElementById('clock2').innerHTML = text; + if (ultimateconfig['exohack']) { + // This is a hack around the fact that Exo has variable-width numerals. + // It doesn't look fantastic, but for the clock, it's better not to have + // the text jumping around. + let html = ""; + for (let i = 0; i < text.length; ++i) { + if (text.charAt(i) === ':') { + html += ':'; + } else { + html += "
" + text.charAt(i) + "
"; + } + } + document.getElementById('clock2').innerHTML = html; + } else { + document.getElementById('clock2').innerHTML = text; + } } function goalA()