Updated ref display for 2015 rules.

This commit is contained in:
Patrick Fairbank
2015-03-21 21:30:51 -07:00
parent 4e68720127
commit eead22ecef
3 changed files with 6 additions and 27 deletions

View File

@@ -6,7 +6,6 @@
var websocket;
var foulAlliance;
var foulTeam;
var foulIsTech;
var foulRule;
// Handles a click on a team button.
@@ -16,12 +15,6 @@ var setFoulTeam = function(teamButton) {
setSelections();
};
// Handles a click on the non-tech/tech foul buttons.
var setFoulIsTech = function(isTech) {
foulIsTech = isTech;
setSelections();
};
// Handles a click on a rule button.
var setFoulRule = function(ruleButton) {
foulRule = $(ruleButton).attr("data-rule");
@@ -34,9 +27,6 @@ var setSelections = function() {
$(teamButton).attr("data-selected", $(teamButton).attr("data-team") == foulTeam);
});
$("#foul").attr("data-selected", !foulIsTech);
$("#techFoul").attr("data-selected", foulIsTech);
$("[data-rule]").each(function(i, ruleButton) {
$(ruleButton).attr("data-selected", $(ruleButton).attr("data-rule") == foulRule);
});
@@ -47,21 +37,19 @@ var setSelections = function() {
// Resets the buttons to their default selections.
var clearFoul = function() {
foulTeam = "";
foulIsTech = false;
foulRule = "";
setSelections();
};
// Sends the foul to the server to add it to the list.
var commitFoul = function() {
websocket.send("addFoul", {Alliance: foulAlliance, TeamId: parseInt(foulTeam), Rule: foulRule,
IsTechnical: foulIsTech});
websocket.send("addFoul", {Alliance: foulAlliance, TeamId: parseInt(foulTeam), Rule: foulRule});
};
// Removes the foul with the given parameters from the list.
var deleteFoul = function(alliance, team, rule, timeSec, isTech) {
var deleteFoul = function(alliance, team, rule, timeSec) {
websocket.send("deleteFoul", {Alliance: alliance, TeamId: parseInt(team), Rule: rule,
TimeInMatchSec: timeSec, IsTechnical: isTech});
TimeInMatchSec: timeSec});
};
// Cycles through no card, yellow card, and red card.