Permalink
Browse files

finish merging soccer stuff

  • Loading branch information...
1 parent 71368a2 commit 8874b9c5a0d62213e8253f0a4235aa492e1811af @asquared asquared committed Feb 13, 2013
Showing with 25 additions and 772 deletions.
  1. +11 −2 public_html/scoreboard.html
  2. +14 −7 public_html/scoreboard.js
  3. +0 −763 public_html/scoreboard_soccer.js
@@ -166,13 +166,16 @@
<td><input type="text" id="shotsOnGoal" style="width:5em; text-align:right" /></td>
<td><button id="shotOnGoal">Shot +1</button></td>
</tr>
- <tr><td>Empty Net</td><td><input type="checkbox" id="emptyNet" /></td></tr>
- <tr><td>Delayed Penalty</td><td><input type="checkbox" id="delayedPenalty" /></td></tr>
+ <tr>
+ <td>Team Status</td>
+ <td colspan="2"><input type="text" id="status" style="width: 5em" /></td>
+ </tr>
</table>
<button id="lockControl">Lock Controls</button>
<button id="unlockControl">Unlock Controls</button><br/><br/>
+ <!-- penalty queue buttons -->
Player&nbsp;&nbsp;<input type="text" id="penaltyPlayer" /><br/>
Penalty&nbsp;&nbsp;<input type="text" id="penaltyPenalty" /><br/>
Add: <button id="minorPenalty">Minor</button>
@@ -181,6 +184,12 @@
<button id="clearPenalties">Clear Penalties</button>
<button id="editPenalties">Edit Penalties</button>
+ <!-- team status buttons -->
+ <button id="emptyNet">Empty Net</button>
+ <button id="delayedPenalty">Delayed Penalty</button>
+ <button id="timeout">Timeout</button>
+ <button id="clearStatus">Clear Status</button>
+
<div id="penalty_queue_dialog" class="dialog">
<div class="penalty_queue" id="pq1">
<label for="start">Start Time</label>
View
@@ -179,16 +179,21 @@ jQuery.fn.buildTeamControl = function() {
$(elem).find("#clearPenalties").click(clearPenalties);
$(this).team().penaltyDialog().find("#clearAllPenalties").click(clearPenalties);
$(elem).find("#editPenalties").click(editPenalties);
- $(elem).find("#emptyNet").click(emptyNet);
+ // FIXME: all these subroutines are overkill
+ // generic team status buttons
+ $(elem).find("#timeout").click(timeout);
- // generic team status stuff for soccer
+ // some specific stuff for soccer
$(elem).find("#yellowCard").click(yellowCard);
$(elem).find("#redCard").click(redCard);
$(elem).find("#substitution").click(substitution);
- $(elem).find("#timeout").click(timeout);
$(elem).find("#clearStatus").click(clearTeamStatus);
+ // and hockey
+ $(elem).find("#emptyNet").click(emptyNet);
+ $(elem).find("#emptyNet").click(delayedPenalty);
+
$(elem).find("input,select").change(function() { $(this).team().putTeamData() });
$(elem).find(".penalty_list").sortable({
@@ -263,9 +268,6 @@ function newPenalty(time) {
// add to the shorter of the two penalty queues
$(this).team().queuePenalty(penaltyDiv);
- // clear out any delayed penalty
- $(this).team().find('#delayedPenalty').removeAttr('checked');
-
// sync team data
$(this).team().putTeamData();
}
@@ -564,11 +566,16 @@ function shotTaken() {
}
function emptyNet() {
- // what happened here????? it was tied in with penalties FIXME
+ // once upon a time, this was tied in with penalties. FIXME
$(this).team().find("#status").val("EMPTY NET");
$(this).team().putTeamData();
}
+function delayedPenalty() {
+ $(this).team().find("#status").val("DELAYED PENALTY");
+ $(this).team().putTeamData();
+}
+
function yellowCard() {
$(this).team().find("#status").val("YELLOW CARD");
$(this).team().putTeamData( );
Oops, something went wrong.

0 comments on commit 8874b9c

Please sign in to comment.