diff --git a/logos/4crg.png b/logos/4crg.png new file mode 100644 index 0000000..aeac4dc Binary files /dev/null and b/logos/4crg.png differ diff --git a/logos/animas.png b/logos/animas.png new file mode 100644 index 0000000..1bf1519 Binary files /dev/null and b/logos/animas.png differ diff --git a/logos/aurora.png b/logos/aurora.png new file mode 100644 index 0000000..dd3d8cf Binary files /dev/null and b/logos/aurora.png differ diff --git a/logos/bombs.png b/logos/bombs.png new file mode 100644 index 0000000..69ad632 Binary files /dev/null and b/logos/bombs.png differ diff --git a/logos/brawlers.png b/logos/brawlers.png new file mode 100644 index 0000000..ca47daa Binary files /dev/null and b/logos/brawlers.png differ diff --git a/logos/durango.png b/logos/durango.png new file mode 100644 index 0000000..8504179 Binary files /dev/null and b/logos/durango.png differ diff --git a/logos/moab.png b/logos/moab.png new file mode 100644 index 0000000..9c71bb0 Binary files /dev/null and b/logos/moab.png differ diff --git a/logos/rip.png b/logos/rip.png new file mode 100644 index 0000000..6d98c6b Binary files /dev/null and b/logos/rip.png differ diff --git a/logos/skate.png b/logos/skate.png new file mode 100644 index 0000000..8a63311 Binary files /dev/null and b/logos/skate.png differ diff --git a/logos/taos.png b/logos/taos.png new file mode 100644 index 0000000..b00f3d6 Binary files /dev/null and b/logos/taos.png differ diff --git a/scoreboard.js b/scoreboard.js index cbb289c..3d92982 100644 --- a/scoreboard.js +++ b/scoreboard.js @@ -1,7 +1,7 @@ /* * LADD Roller Derby Scoreboard * Copyright © 2011 Neale Pickett - * Time-stamp: <2011-11-22 22:35:40 neale> + * Time-stamp: <2011-11-22 23:22:32 neale> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,29 @@ * along with this program. If not, see . */ +/* You can only have one scoreboard per page. This limitation is mostly + * because elements need specific id= attributes, and these attribumets + * must be unique within a page. + */ + +// Preset list of teams +teams = [ + // [Long team name, shortname, logo.png] + ["Home Team", "Home"], + ["Visitor Team", "Visitor"], + ["Los Alamos M'Atom Bombs", "Bombs"], + ["Animas Valley Roller Girls", "Animas"], + ["Taos Whiplashes", "Taos"], + ["Rollergirls In Pagosa", "RIP"], + ["4 Corners Roller Girls", "4CRG"], + ["Durango Roller Girls", "DRG", "durango.png"], + ["Santa Fe Disco Brawlers", "S.Fe", "brawlers.png"], + ["Aurora High City Derby Divas", "Aurora"], + ["Moab Roller Derby", "Moab"], + ["Black Team", "Black"], + ["White Team", "White"] +]; + /* State names */ var STARTUP = 0; var JAM = 1; @@ -26,6 +49,8 @@ var BREAK = 4; var state = STARTUP; +var preset = {a:0, b:1}; + // Create a timer on [element]. // If [tenths] is true, show tenths of a second. // If [callback] is defined, call it when time runs out. @@ -115,9 +140,6 @@ function startTimer(element, tenths, callback) { } refresh(); } - - - } // Transition state machine based on state @@ -184,10 +206,6 @@ function teamname(t, v) { var name = e("name-" + t); var logo = e("logo-" + t); - if (logo.plastic) { - logo.src = v.toLowerCase() + ".png"; - logo.plastic = false; - } e("name-" + t).innerHTML = v; } @@ -206,11 +224,25 @@ function handle(event) { case "logo-a": case "logo-b": if (state == STARTUP) { - var u = prompt("Enter URL to team " + team + " logo"); + if (event.altKey) { + var u = prompt("Enter URL to team " + team + " logo"); - if (! u) return; - e.src = u; - e.plastic = false; + if (! u) return; + e.src = u; + } else { + var logo; + var t; + + preset[team] = (preset[team] + 1) % teams.length; + t = teams[preset[team]]; + + teamname(team, t[1]); + logo = t[2]; + if (! logo) { + logo = (t[1] || "skate").toLowerCase() + ".png"; + } + e.src = "logos/" + logo; + } } break; case "period": @@ -261,14 +293,7 @@ function handle(event) { function imgfail(team) { var logo = e("logo-" + team); - var url = e("name-" + team).innerHTML.toLowerCase() + ".png"; - - if (logo.plastic && (logo.src != url)) { - logo.src = url; - } else { - logo.src = "skate.png"; - logo.plastic = true; - } + logo.src = "skate.png"; } function key(e) {