diff --git a/START_SCOREBOARD.html b/START_SCOREBOARD.html deleted file mode 100644 index 4018f09..0000000 --- a/START_SCOREBOARD.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - LADD Roller Derby Scoreboard - - - - -

LADD Scoreboard

- -

- Having problems? Try something other than Internet Explorer! - Chrome and Firefox have both been tested extensively. -

- - - -

Documentation

- - -
- Neale Pickett <neale@woozle.org> -
- - - diff --git a/classic.html b/classic.html deleted file mode 100644 index 9362253..0000000 --- a/classic.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - LADD Scoreboard - - - - - - - - -
-

- Home - - 0 - - - -

- -

- --:-- - - -:--.- - - 0 -

- -

- Vis - - 0 - - - -

-
- -
-
Power Jam
-
Grand Slam
-
Ouch
-
OMG
-
- - diff --git a/crg-nologo.html b/crg-nologo.html deleted file mode 100644 index c53813d..0000000 --- a/crg-nologo.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - LADD Scoreboard - - - - - - - -
-
-

Home

-

-

-
- -
-

Timeouts

-

0

-

0

-
- -
-

Home

-

-

-
- -
-

-

--:--

-
- -
-

- - 0 -

-

-:--

-
- -
- - diff --git a/crg.html b/crg.html deleted file mode 100644 index 89b8710..0000000 --- a/crg.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - LADD Scoreboard - - - - - - - - -
-
-

Home

- -

-

-
- -
-

Timeouts

-

0

-

0

-
- -
-

Home

- -

-

-
- -
-

-

--:--

-
- -
-

- - 0 -

-

-:--

-
- -
- - diff --git a/highvis.html b/highvis.html deleted file mode 100644 index 90fa242..0000000 --- a/highvis.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - LADD Scoreboard - - - - - - - -
-

- --:-- -

-

- - - - - - - - -

-

- -:--.- -

-
-
Power Jam
-
Grand Slam
-
Ouch!
-
OMG
-
-
- - diff --git a/index.html b/index.html deleted file mode 100644 index 60229a5..0000000 --- a/index.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - LADD Roller Derby Scoreboard - - - - -

LADD Roller Derby Scoreboard

- -

- This is a free WFTDA-rules scoreboard, created with ease-of-use - in mind. It is known to work on PC, Mac, Android, iOS, or Linux, using any - common web browser. -

- -

- -
- Try it right now: click on things - to make them change. -

- -

Features

- - - -

Themes

- - -

Documentation

-

- Watch a 5-minute video - tutorial or read the - Full documentation which comes bundled with the - download. -

- - -

Download

-

- Download - version 5.1 to your hard drive to run a scoreboard - without Internet access (recommended: - watch how). This - includes the documentation. -

- -

- If your scoreboard computer has an Internet connection, you don't - need to download anything at all. Just load up - the full-screen version from this - page and you're all set. -

- -

- You can - also browse - the source tree or clone it with git: -

git clone http://woozle.org/~neale/projects/scoreboard
-

- -

Other Derby Stuff By Me

- - - -

Contact Me

- -

- If you'd like me to add your team logo, have an idea for improvement, - or just want to say hi, please send me an email. I especially - like hearing from people who are using the software: I love knowing - I'm able to help people out. -

- -
- Neale Pickett <neale@woozle.org> -
- - - diff --git a/logos/black.png b/logos/black.png index 0cd754c..8d31ed7 100644 Binary files a/logos/black.png and b/logos/black.png differ diff --git a/logos/blue.png b/logos/blue.png index 248aeb1..849928f 100644 Binary files a/logos/blue.png and b/logos/blue.png differ diff --git a/logos/bwbs.png b/logos/bwbs.png new file mode 100644 index 0000000..3683a05 Binary files /dev/null and b/logos/bwbs.png differ diff --git a/logos/campers.png b/logos/campers.png new file mode 100644 index 0000000..f930931 Binary files /dev/null and b/logos/campers.png differ diff --git a/logos/green.png b/logos/green.png index ac41253..36aacd9 100644 Binary files a/logos/green.png and b/logos/green.png differ diff --git a/logos/logos.html b/logos/logos.html index 9fd8344..0fcaec5 100644 --- a/logos/logos.html +++ b/logos/logos.html @@ -3,6 +3,7 @@ Roller Derby Logos + - - - - -
-

- --:-- -

-

- S - -:-- -

-
- - diff --git a/penalties.html b/penalties.html deleted file mode 100644 index 93fca7d..0000000 --- a/penalties.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - LADD Scoreboard - - - - - - - - - -
-

- - 0 - - - -

- -

- --:-- - -:--.- - - 0 -

- -

- - 0 - - - -

-
- -
- - - -
- - - - - - -
-
- -
-
Power Jam
-
Grand Slam
-
Ouch
-
OMG
-
- - diff --git a/res/BadGirl.swf b/res/BadGirl.swf deleted file mode 100644 index 029f84a..0000000 Binary files a/res/BadGirl.swf and /dev/null differ diff --git a/res/FasterFaster.swf b/res/FasterFaster.swf deleted file mode 100644 index 53f9ebc..0000000 Binary files a/res/FasterFaster.swf and /dev/null differ diff --git a/res/HolyShot.swf b/res/HolyShot.swf deleted file mode 100644 index 8b91385..0000000 Binary files a/res/HolyShot.swf and /dev/null differ diff --git a/res/Ouch.swf b/res/Ouch.swf deleted file mode 100644 index 2e543d2..0000000 Binary files a/res/Ouch.swf and /dev/null differ diff --git a/res/Pow.swf b/res/Pow.swf deleted file mode 100644 index 5415073..0000000 Binary files a/res/Pow.swf and /dev/null differ diff --git a/res/Zounds.swf b/res/Zounds.swf deleted file mode 100644 index 8df8f9c..0000000 Binary files a/res/Zounds.swf and /dev/null differ diff --git a/res/adverts.js b/res/adverts.js deleted file mode 100644 index 64110e0..0000000 --- a/res/adverts.js +++ /dev/null @@ -1,30 +0,0 @@ -var advert_num = 100 -var advert_itimer - -function adverterror() { - if (advert_num > 1) { - advert_num = 1 - rotate_advert() - } else { - var e = document.getElementById("advert") - clearInterval(advert_itimer) - e.style.visibility = "hidden" - } -} - -function rotate_advert() { - var e = document.getElementById("advert") - var sn - - if (advert_num < 10) { - sn = "0" + advert_num - } else { - sn = advert_num - } - - e.src = "ads/ad" + sn + ".jpg" - - advert_num = advert_num + 1 -} - -advert_itimer = setInterval(rotate_advert, 15000) diff --git a/res/icon.png b/res/icon.png index d727820..b8f5a41 100644 Binary files a/res/icon.png and b/res/icon.png differ diff --git a/res/jammer.svg b/res/jammer.svg deleted file mode 100644 index 63a2fd2..0000000 --- a/res/jammer.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/res/kitty.svg b/res/kitty.svg index 4471cd0..d56b0c4 100644 --- a/res/kitty.svg +++ b/res/kitty.svg @@ -15,10 +15,10 @@ viewBox="-187.81991 -187.81991 1165.08 1165.222" id="svg10326" inkscape:version="0.48.4 r9939" - sodipodi:docname="hellokitty.svg" - inkscape:export-filename="/home/neale/src/scoreboard/res/icon.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> + sodipodi:docname="kitty.svg" + inkscape:export-filename="/home/neale/src/scoreboard/logos/violet.png" + inkscape:export-xdpi="299.61871" + inkscape:export-ydpi="299.61871"> @@ -40,18 +40,18 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="788" - inkscape:window-height="882" + inkscape:window-width="1077" + inkscape:window-height="805" id="namedview16" showgrid="false" inkscape:object-paths="true" - inkscape:zoom="1.03" - inkscape:cx="72.473605" - inkscape:cy="18.300614" - inkscape:window-x="0" - inkscape:window-y="14" + inkscape:zoom="4.12" + inkscape:cx="66.601148" + inkscape:cy="63.446618" + inkscape:window-x="7" + inkscape:window-y="20" inkscape:window-maximized="0" - inkscape:current-layer="svg10326" /> + inkscape:current-layer="g3123" /> + style="fill:#808080;fill-opacity:1;stroke:#000000;stroke-width:200.27253723000001173;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + style="fill:#333333;fill-opacity:1;stroke:none" /> + style="fill:#cccccc;fill-opacity:1;fill-rule:nonzero;stroke:none" /> - - + + + + diff --git a/res/others.html b/res/others.html deleted file mode 100644 index 5882d1e..0000000 --- a/res/others.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - Free Derby Scoreboard Software - - - - - -

Free Derby Scoreboard Software

- -

- This is a list of no-cost roller derby scoreboard software I have - found. Mine is at the top, because I think it's the best. I might - be wrong, though! Try the rest out and see for yourself. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameSource?PlatformWindowsNotes
LADD ScoreboardYESJavaScript (web browser)1Easy to operate, easy to read; also, I wrote it :)
POÄNG (formerly QCRG Scoreboard)YESAdobe AIR2Nice clean layout
CRD ScoreboardYESJava2Interesting cli/srv model allowing multiple operators on a LAN
Derby ScoreYESJava2Could use some visual polish, but I like the author's attitude
Thor's HammernoWindows2
JamTrackernoAdobe AIR2Busy layout
Rinxterno?Windows2If Oracle made a scoreboard, this would be it. It's massive: generates reports!
DerbyBoardnoWindows2What an incredible waste of screen real estate! I hope you play somewhere very dark.
Scoreboard PronoWindows2The author does not appear to have read WFTDA's rules.
- -
-
Source?
-
- Whether you can download and modify the source code. Important to - many nerds like myself. -
- -
Platform
-
- What you need to buy/install before you can run it. -
- -
Windows
-
-
-
1
-
- Operator interacts directly with the image on the projector. - What you see is what the audience sees. -
-
2
-
- Separate interface for operator and audience, like an old-school - 7-panel display scoreboard. What you see is a control panel; - the audience sees something different. -
-
-
-
- - -
- Neale Pickett <neale@woozle.org> -
- - - - diff --git a/res/penalties.js b/res/penalties.js deleted file mode 100644 index 19cef61..0000000 --- a/res/penalties.js +++ /dev/null @@ -1,161 +0,0 @@ -/*********************************** - * Penalties - */ -function penalties (team) { - var table = document.getElementById("penalties-" + team); - - var majors = table.getElementsByClassName("majors")[0]; - var sk8ers = table.getElementsByClassName("sk8ers")[0]; - - var majdiv = majors.getElementsByTagName("div"); - var sk8div = sk8ers.getElementsByTagName("div"); - - var ret = []; - - for (var i = 0; i < 20; i += 1) { - ret.push([sk8div[i].text, - majdiv[i].value || 0]); - } - - return ret; -} - -function penalties_save () { - var ls = localStorage || {}; - - var name_a = document.getElementById("name-a").innerHTML; - var name_b = document.getElementById("name-b").innerHTML; - - var pen_a = JSON.stringify(penalties("a")); - var pen_b = JSON.stringify(penalties("b")); - - ls["rdsb_penalties_a"] = pen_a; - ls["rdsb_penalties_b"] = pen_b; - - ls["rdsb_roster " + name_a] = pen_a; - ls["rdsb_roster " + name_b] = pen_b; -} - -function penalties_setdiv (div, value) { - if (div.text == undefined) { - div.value = value; - div.style.height = (value||0) + "em"; - div.innerHTML = value?value:""; - } else { - div.text = value; - div.innerHTML = value?"":"•"; - for (var i in value) { - var c = value[i]; - // XXX: use CSS "text-wrap: unrestricted" when supported - div.innerHTML += c + " "; - } - } -} - -function penalties_load (team, values) { - var table = document.getElementById("penalties-" + team); - - var majors = table.getElementsByClassName("majors")[0]; - var sk8ers = table.getElementsByClassName("sk8ers")[0]; - - var majdiv = majors.getElementsByTagName("div"); - var sk8div = sk8ers.getElementsByTagName("div"); - - for (var i = 0; i < values.length; i += 1) { - penalties_setdiv(sk8div[i], values[i][0]); - penalties_setdiv(majdiv[i], values[i][2]); - } -} - -function penalties_setTeamName (team, name) { - var ls = localStorage || {}; - var roster_in = ls["rdsb_roster " + name]; - var roster_out = []; - - if (roster_in) { - roster_in = JSON.parse(roster_in); - } - - for (var i = 0; i < 20; i += 1) { - if (! roster_in) { - roster_out.push(["", 0, 0]); - } else { - roster_out.push([roster_in[i][0], 0, 0]) - } - } - penalties_load(team, roster_out); -} - -function penalties_click (event) { - var element = event.currentTarget; - var pops = element.parentNode; - var div = element.getElementsByTagName("div")[0]; - var inc = event.shiftKey?-1:1; - var val; - - if (pops.className == "majors") { - val = ((div.value || 0) + inc + 9) % 9; - } else if (state == SETUP) { - val = prompt("Enter skater number", div.text); - } - - if (val != undefined) { - penalties_setdiv(div, val); - penalties_save(); - } -} - -// Remove penalties area if there are no players set -function penalties_duck () { - var pen = document.getElementById("penalties"); - var a = penalties("a"); - var b = penalties("b"); - - for (var i = 0; i < 20; i += 1) { - if (a[i][0] || b[i][0]) { - return; - } - } - - pen.style.display = "none"; -} - -function penalties_init () { - var ls = localStorage || {}; - - // Populate ALL ROWS AT ONCE because I'm crazy like that. - for (var j = 0; j < 2; j += 1) { - var team = (j==0)?"a":"b"; - - var table = document.getElementById("penalties-" + team); - var majors = table.getElementsByClassName("majors")[0]; - var sk8ers = table.getElementsByClassName("sk8ers")[0]; - - for (var i = 0; i < 20; i += 1) { - var td; - var div; - - var majdiv = document.createElement("div"); - td = document.createElement("td"); - td.onclick = penalties_click; - td.appendChild(majdiv); - majors.appendChild(td); - - - div = document.createElement("div"); - div.text = ""; - div.appendChild(document.createTextNode("•")); - td = document.createElement("td"); - td.onclick = penalties_click; - td.appendChild(div); - sk8ers.appendChild(td); - } - } - - if (ls.rdsb_penalties_a) { - penalties_load("a", JSON.parse(ls.rdsb_penalties_a)); - } - if (ls.rdsb_penalties_b) { - penalties_load("b", JSON.parse(ls.rdsb_penalties_b)); - } -} diff --git a/res/scoreboard-explained.png b/res/scoreboard-explained.png deleted file mode 100644 index 1c7a94a..0000000 Binary files a/res/scoreboard-explained.png and /dev/null differ diff --git a/res/scoreboard.css b/res/scoreboard.css index 276a392..b903a43 100644 --- a/res/scoreboard.css +++ b/res/scoreboard.css @@ -20,6 +20,16 @@ body { margin: 0; } +input { + font: inherit; +} + +input[readonly] { + color: inherit; + background: inherit; + border: inherit; +} + #scoreboard { cursor: default; font-family: sans-serif; @@ -106,11 +116,11 @@ body { position: absolute; bottom: 0em; left: 50%; - width: 3em; - margin-left: -1.5em; + width: 3.5em; + margin-left: -1.75em; } -#jamtext, #periodtext { +#jamtext, #periodtext, #preset { text-align: center; font-family: PermanentMarker, sans-serif; font-weight: normal; @@ -126,6 +136,11 @@ body { top: 1.4em; } +#preset { + top: 40%; + color: cyan; +} + #jamtext { bottom: 1.4em; } @@ -193,17 +208,16 @@ body { * Notices */ #notice { - display: none; - position: absolute; - bottom: 1.3em; - left: 50%; - width: 4em; + display: none; + position: absolute; + bottom: 1.3em; + left: 50%; + width: 4em; height: 3em; - margin-left: -2em; + margin-left: -2em; + text-align: center; } -#notice embed { - width: 100%; +#notice img { height: 100%; -} - +} \ No newline at end of file diff --git a/res/scoreboard.js b/res/scoreboard.js index 497a79e..f59bc48 100644 --- a/res/scoreboard.js +++ b/res/scoreboard.js @@ -26,13 +26,15 @@ /* Times for various rulesets */ var presets = [ - ["WFTDA", 1800, 120, 30], - ["USARS", 1800, 90, 30], - ["MADE", 900, 90, 30] + ["WFTDA", 30 * 60 * 1000, 120 * 1000, 30 * 1000, 3], + ["USARS", 30 * 60 * 1000, 90 * 1000, 30 * 1000, 3], + ["RDCL", 15 * 60 * 1000, 60 * 1000, 30 * 1000, 3], + ["MADE", 15 * 60 * 1000, 90 * 1000, 30 * 1000, 1] ]; -var period_time = presets[0][1] * 1000; -var jam_time = presets[0][2] * 1000; -var lineup_time = presets[0][3] * 1000; +var period_time; +var jam_time; +var lineup_time; +var timeouts; /* State names */ var SETUP = 0; @@ -41,10 +43,10 @@ var LINEUP = 2; var TIMEOUT = 3; var periodtext = [ - chrome.i18n.getMessage("timeToGame"), chrome.i18n.getMessage("period1"), chrome.i18n.getMessage("halftime"), - chrome.i18n.getMessage("period2") + chrome.i18n.getMessage("period2"), + chrome.i18n.getMessage("timeToGame") ]; var jamtext = [ chrome.i18n.getMessage("jam"), @@ -66,9 +68,16 @@ function update() { } } +function e(id) { + ret = document.getElementById(id); + if (! ret) { + return Array(); + } + return ret; +} + // Create a timer on [element]. -// If [callback] is defined, call it when time runs out. -function startTimer(element, callback) { +function startTimer(element) { var startTime; var running = false; var set_duration = 0; @@ -76,28 +85,30 @@ function startTimer(element, callback) { var className; // Re-calculate and update displayed time - function refresh () { - var remain = Math.abs(Math.ceil(element.remaining() / 1000)); - var min = Math.floor(remain / 60); - var sec = remain % 60; + function refresh (force) { + var remain = Math.ceil(element.remaining() / 1000); + var min = Math.floor(Math.abs(remain) / 60); + var sec = Math.abs(remain) % 60; + + if (! running) { + element.className = className + " paused"; + if (! force) { + return; + } + } // Set classes - element.className = className; if ((! className) && (remain <= 20)) { - element.className += " lowtime"; - } - if (! running) { - element.className += " paused"; + element.className = className + " lowtime"; + } else { + element.className = className; } // Has the timer run out? if ((set_duration > 0) && (remain <= 0)) { duration = 0; sec = 0; - running = false; - if (callback) { - callback(); - } + element.stop(); } sec = Math.ceil(sec); @@ -107,10 +118,22 @@ function startTimer(element, callback) { } var t = min + ":" + sec; - if (t != element.innerHTML) { - element.innerHTML = t; + if (t != element.value) { + element.value = t; } } + + function inputHandler() { + var t = element.value.split(":"); + var sec = (Number(t[0]) * 60) + Number(t[1]); + + if (isNaN(sec) || (sec <= 0) || (sec > (59 * 60))) { + // Ignore goofy values + return; + } + + element.set(sec * 1000, className); + } // Return remaining time in milliseconds element.remaining = function() { @@ -129,7 +152,8 @@ function startTimer(element, callback) { set_duration = t; duration = t; className = cn; - refresh(); + + refresh(true); } // Start timer @@ -150,6 +174,9 @@ function startTimer(element, callback) { refresh(); } + element.readOnly = true; + element.addEventListener("input", inputHandler); + timer_updates.push(refresh); } @@ -164,10 +191,6 @@ function transition(newstate) { return; } - if ((state == SETUP) && window.penalties) { - penalties_duck(); - } - state = newstate; if (state == JAM) { @@ -177,11 +200,13 @@ function transition(newstate) { jtext.innerHTML = jamtext[0]; jamno += 1; jno.innerHTML = jamno; + pt.readOnly = true; } else if (state == LINEUP) { pt.start(); jt.set(lineup_time, "lineup"); jt.start(); jtext.innerHTML = jamtext[1]; + pt.readOnly = true; } else if (state == TIMEOUT) { pt.stop(); if (pt.remaining() <= 0) { @@ -190,11 +215,13 @@ function transition(newstate) { jt.set(0, "timeout"); jt.start(); jtext.innerHTML = jamtext[2]; + pt.readOnly = false; } // Reset lead jammer indicators e("jammer-a").className = ""; e("jammer-b").className = ""; + e("preset").style.display = "none"; save(); } @@ -205,32 +232,27 @@ function transition(newstate) { * Notices */ -var notices = [ - false, - '', - '', - '', - '', - '', - '', - '', -]; +var notices = { + "banana": '' +}; var notice_timer; function notice_expire() { - var c = document.getElementById("notice"); + var c = e("notice"); c.innerHTML = ""; c.style.display = "none"; } function notice(n) { - var c = document.getElementById("notice"); + var c = e("notice"); - c.style.display = "block"; if (notices[n]) { - c.innerHTML = notices[n]; + if (c.innerHTML != notices[n]) { + c.innerHTML = notices[n]; + c.style.display = "block"; + } clearTimeout(notice_timer); notice_timer = setTimeout(function() {notice_expire()}, 8000); } else { @@ -238,16 +260,9 @@ function notice(n) { } } -function e(id) { - ret = document.getElementById(id); - if (! ret) { - return Array(); - } - return ret; -} function score(team, points) { - var te = document.getElementById("score-" + team); + var te = e("score-" + team); var ts = Number(te.innerHTML); ts += points; @@ -287,12 +302,7 @@ function handle(event) { name = t[0]; - e("name-" + team).innerHTML = name; tgt.src = "logos/" + t[1]; - - if (window.penalties) { - penalties_setTeamName(team, t[0]); - } } else { score(team, -adj); } @@ -307,7 +317,9 @@ function handle(event) { var v = Number(tgt.innerHTML); v -= adj; - if (v == -1) v = 3; + if (v == -1) { + v = timeouts; + } tgt.innerHTML = v; break; case "period": @@ -350,6 +362,9 @@ function handle(event) { score(team, adj); } break; + case "preset": + load_preset(+1); + break; case "close": window.close(); break; @@ -379,12 +394,18 @@ function key(event) { case 190: c = "."; break; - case 221: - c = e.shiftKey ? "}" : "]"; + case 191: + c = "/"; break; case 219: c = e.shiftKey ? "{" : "["; break; + case 221: + c = e.shiftKey ? "}" : "]"; + break; + case 222: + c = e.shiftKey ? "\"" : "'"; + break; default: if ((k >= 48) && (k <= 90)) { c = String.fromCharCode(k); @@ -399,19 +420,17 @@ function key(event) { bige = e; - console.log("Key " + k + " pressed: " + c + " === " + e.which); - switch (c) { case "up": if ((state == TIMEOUT) || (state == SETUP)) { - var pt = document.getElementById("period"); + var pt = e("period"); var rem = pt.remaining(); pt.set(rem + 1000); } break; case "down": if ((state == TIMEOUT) || (state == SETUP)) { - var pt = document.getElementById("period"); + var pt = e("period"); var rem = pt.remaining(); pt.set(rem - 1000); } @@ -430,15 +449,15 @@ function key(event) { case "[": score('a', 1); break; - case "b": + case "'": case "]": score('b', 1); break; - case "A": + case "z": case "{": score('a', -1); break; - case "B": + case "/": case "}": score('b', -1); break; @@ -448,19 +467,9 @@ function key(event) { case ".": leadJammer('b'); break; - case "1": - case "2": - case "3": - case "4": - case "5": - case "6": - case "7": - case "8": - case "9": - case "0": - var n = Number(c); - - window.notice(n); + case "g": + window.notice("banana"); + break; } transition(newstate); @@ -470,9 +479,7 @@ function key(event) { function save() { chrome.storage.local.set( { - "period_time": period_time, - "jam_time": jam_time, - "lineup_time": lineup_time, + "preset": e("preset").innerHTML, "logo_a": e("logo-a").src, "logo_b": e("logo-b").src, @@ -485,35 +492,64 @@ function save() { ); } +function load_preset(preset_name) { + var inc = false; + var pn = 0; + + if (preset_name == +1) { + preset_name = e("preset").innerHTML; + inc = true; + } + + for (var i in presets) { + if (presets[i][0] == preset_name) { + pn = Number(i); + break; + } + } + if (inc) { + pn = (pn + 1) % presets.length; + } + preset_name = presets[pn][0]; + period_time = presets[pn][1]; + jam_time = presets[pn][2]; + lineup_time = presets[pn][3]; + timeouts = presets[pn][4]; + + e("preset").innerHTML = preset_name; + e("jam").set(jam_time); + e("period").set(period_time); + e("timeouts-a").innerHTML = timeouts; + e("timeouts-b").innerHTML = timeouts; + e("score-a").innerHTML = 0; + e("score-b").innerHTML = 0; +} + function load() { function load_cb(state) { - period_time = state.period_time; - jam_time = state.jam_time; - lineup_time = state.lineup_time; + load_preset(state.preset); + + e("period").set((state.period_clock >= 0) ? state.period_clock : period_time); e("logo-a").src = state.logo_a; e("logo-b").src = state.logo_b; e("score-a").innerHTML = state.score_a; e("score-b").innerHTML = state.score_b; - e("timeouts-a").innerHTML = state.timeouts_a; - e("timeouts-b").innerHTML = state.timeouts_b; - var p = e("period"); - startTimer(p); - p.set(state.period_clock); + e("timeouts-a").innerHTML = (state.timeouts_a >= 0) ? state.timeouts_a : timeouts; + e("timeouts-b").innerHTML = (state.timeouts_b >= 0) ? state.timeouts_b : timeouts; + } chrome.storage.local.get({ - "period_clock": period_time, + "preset": presets[0][0], + "period_clock": -1, "score_a": 0, "score_b": 0, "logo_a": "logos/black.png", "logo_b": "logos/white.png", - "timeouts_a": 3, - "timeouts_b": 3, - "period_time": period_time, - "jam_time": jam_time, - "lineup_time": lineup_time + "timeouts_a": -1, + "timeouts_b": -1 }, load_cb); } @@ -542,14 +578,18 @@ function start() { ei("jam"); ei("prefs"); ei("close"); + ei("preset"); ei("periodtext").innerHTML = periodtext[period]; ei("jamtext").innerHTML = jamtext[3]; transition(); + var p = e("period"); + startTimer(p); + p.readOnly = false; + var j = e("jam"); startTimer(j); - j.set(jam_time); update_itimer = setInterval(update, 200); // 5 times a second diff --git a/res/screenshot.png b/res/screenshot.png deleted file mode 100644 index b79867e..0000000 Binary files a/res/screenshot.png and /dev/null differ diff --git a/res/todo.txt b/res/todo.txt deleted file mode 100644 index 9241dd3..0000000 --- a/res/todo.txt +++ /dev/null @@ -1,2 +0,0 @@ -* When period ends and jam timer is toggled, period clock should not count up -* Auto-scale (3-digit score wrapped in Taos) diff --git a/res/usage.html b/res/usage.html deleted file mode 100644 index c467782..0000000 --- a/res/usage.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - Using the LADD Roller Derby Scoreboard - - - - -

Using the LADD Roller Derby Scoreboard

- - Annotated scoreboard - -

- If you don't like reading manuals, just start clicking on things; - it's supposed to be easy to figure out. -

- -
-
Space Bar
-
Switch between Jam and Rotation
- -
T
-
Enter timeout
- -
A / Shift-A
-
Add / subtract a point on the left
- -
B / Shift-B
-
Add / subtract a point on the right
- -
F5
-
Enter Setup mode
-
- -

Setup

- -
    -
  • - When the state indicator says "Setup", you can click on almost - anything to change it. -
  • -
  • - Set the logo before you change the team name. -
  • -
  • - If your team's logo and name isn't in the - list, please email them to me so I can add them. -
  • - Reload the page (click "Reload" or type F5) to get back to Setup - mode. Scores, timeouts, and period clock time are all saved. -
  • -
  • - Type Space Bar or click the jam clock to begin the first jam. -
  • -
- - -

Running Jams

- -
    -
  • - Press Space Bar or click the jam clock to switch between 2:00 - jams and 0:30 rotations. -
  • -
  • - Type "A" or "B" to add points to a team's score. You can also - click a score to add a point. -
  • -
  • - Type "Shift+A" or "Shift+B" to remove points from a team's - score. You can also click a team logo to remove a point. -
  • -
- - -

Timeouts

- -
    -
  • - Type "T" or click the period clock to enter into a timeout. -
  • - -
  • - Click a team's timeout count to remove one from it. If it's at - 0, click it to reset it to 3. -
  • - -
  • - Click the period clock during a timeout to change the time left - in the period. -
  • - -
  • - Type Space Bar or click the jam clock to exit timeout mode and - start the next jam. -
  • -
- - -

Periods

- -
    -
  • - Go into Timeout mode to re-set the period clock to 30:00. Click - it to change it to a different time. -
  • -
  • - Click the period indicator to cycle between "Period 1", - "Halftime", "Period 2", and "Break". -
  • -
- - -

Other cases

- -
-
Halftime / Double-header break
-
-
    -
  1. Type "T" to enter timeout mode.
  2. -
  3. Click the period indicator until it says "Halftime" or - "Break"
  4. -
  5. Click the period clock.
  6. -
  7. Enter the duration of the break.
  8. -
  9. Type Space Bar to start counting down.
  10. -
  11. It's okay to let the jam clock reach 0:00.
  12. -
-
- -
20-minute periods
-
-
    -
  1. During Setup or Timeout, click the period clock.
  2. -
  3. Enter "20:00" for the new time.
  4. -
  5. Click the period indicator until it displays the - right period.
  6. -
-
-
- - -

Advanced Tips

- -
    -
  • - Hold down the "Shift" key to make counters, logos, etc. go the - other direction. -
  • -
  • - Hold down the "Ctrl" or "Alt" key while clicking a team logo in - Setup mode to provide a URL. -
  • -
  • - Hold down the "Ctrl" or "Alt" key while clicking the period - indicator to change it to any text. -
  • -
  • - Timeouts can exceed three by clicking them while holding the - "Shift" key. -
  • -
  • - You can leave off minutes or seconds if they're zero: "30:" is - the same as "30:00", and "19" is the same as "0:19". -
  • -
  • - If part of the scoreboard changes background color, click - (without shift) somewhere on the background to get it back to - normal. It changed color because your browser was selecting - that part of the page for copy and paste! -
  • -
- - -

Customizing

-

- If you use this, I want to add your logo and the logos of the - teams you play to the included set of - logos. -

- -

- The scoreboard is written in HTML5, CSS, and JavaScript, so a web - designer should be able to season to taste. Send me what you come - up with, I want to see it! -

- - -

If you have problems

-

- If something goes wrong, please email me (link below) with as much - detail as you can remember, and I'll try to fix it for you and - everybody else. For example: -

-
-

- I clicked the period timer during a timeout and the Team A logo - turned into a photo of a burrito. -

-
- -

Enjoy!

-
Neale Pickett <neale@woozle.org>
- - - diff --git a/scoreboard.html b/scoreboard.html index 39f8b8e..5a84448 100644 --- a/scoreboard.html +++ b/scoreboard.html @@ -34,9 +34,10 @@

- --:-- + - -:--.- + - +