From eead22ecefc480d489dabe957447c1481f59a295 Mon Sep 17 00:00:00 2001 From: Patrick Fairbank Date: Sat, 21 Mar 2015 21:30:51 -0700 Subject: [PATCH] Updated ref display for 2015 rules. --- referee_display.go | 6 ++---- static/js/referee_display.js | 18 +++--------------- templates/referee_display.html | 9 +-------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/referee_display.go b/referee_display.go index b1a4e35..5a953ee 100644 --- a/referee_display.go +++ b/referee_display.go @@ -15,9 +15,8 @@ import ( "text/template" ) -var rules = []string{"G3", "G5", "G10", "G11", "G12", "G14", "G15", "G16", "G17", "G18", "G19", "G21", "G22", - "G23", "G24", "G25", "G26", "G26-1", "G27", "G28", "G29", "G30", "G31", "G32", "G34", "G35", "G36", "G37", - "G38", "G39", "G40", "G41", "G42"} +var rules = []string{"G4", "G5", "G6", "G6-1", "G16", "G17", "G18", "G19", "G20", "G21", "G22", "G23", "G24", + "G26", "G30", "G31", "G33", "G34", } // Renders the referee interface for assigning fouls. func RefereeDisplayHandler(w http.ResponseWriter, r *http.Request) { @@ -140,7 +139,6 @@ func RefereeDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) { Alliance string TeamId int Rule string - IsTechnical bool }{} err = mapstructure.Decode(data, &args) if err != nil { diff --git a/static/js/referee_display.js b/static/js/referee_display.js index 537f2d7..dd659fb 100644 --- a/static/js/referee_display.js +++ b/static/js/referee_display.js @@ -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. diff --git a/templates/referee_display.html b/templates/referee_display.html index 49778f2..5eb113c 100644 --- a/templates/referee_display.html +++ b/templates/referee_display.html @@ -56,12 +56,6 @@ {{.Blue3.Id}} -
- Foul - Tech Foul -
{{range $rule := .Rules}} {{.foul.TeamId}} - {{if .foul.IsTechnical}}Technical {{end}}Foul {{.foul.Rule}} Delete + {{.foul.TimeInMatchSec}});">Delete {{end}} {{define "card"}}