diff --git a/static/css/pit_display.css b/static/css/pit_display.css index 6ce621a..1fb56a3 100644 --- a/static/css/pit_display.css +++ b/static/css/pit_display.css @@ -14,7 +14,6 @@ body { height: 100%; background: -moz-linear-gradient(top, #003375 1%, #3C679D 100%); /* FF3.6+ */ background: -webkit-linear-gradient(top, #003375 1%, #3C679D 100%); /* Chrome10+,Safari5.1+ */ - background: -webkit-linear-gradient(top, #003375 1%, #3C679D 100%); /* Chrome10+,Safari5.1+ */ background-repeat: no-repeat; font-family: "FuturaLT"; } diff --git a/static/js/alliance_station_display.js b/static/js/alliance_station_display.js index 4209db9..226b62b 100644 --- a/static/js/alliance_station_display.js +++ b/static/js/alliance_station_display.js @@ -11,7 +11,7 @@ var websocket; // Handles a websocket message to set which alliance station this display represents. var handleAllianceStation = function(station) { allianceStation = station; -} +}; // Handles a websocket message to change which screen is displayed. var handleAllianceStationDisplayMode = function(targetScreen) { @@ -36,14 +36,14 @@ var handleAllianceStationDisplayMode = function(targetScreen) { // Handles a websocket message to update the team to display. var handleMatchLoad = function(data) { - if (allianceStation != "") { + if (allianceStation !== "") { var team = data.Teams[allianceStation]; if (team) { $("#teamNumber").text(team.Id); $("#teamNameText").attr("data-alliance-bg", allianceStation[0]).text(team.Nickname); var ranking = data.Rankings[team.Id]; - if (ranking && data.MatchType == "Qualification") { + if (ranking && data.MatchType === "Qualification") { var rankingText = ranking.Rank; $("#teamRank").attr("data-alliance-bg", allianceStation[0]).text(rankingText); } else { @@ -73,7 +73,7 @@ var handleArenaStatus = function(data) { if (!blinkInterval) { blinkInterval = setInterval(function() { var status = $("#match").attr("data-status"); - $("#match").attr("data-status", (status == "") ? allianceStation[0] : ""); + $("#match").attr("data-status", (status === "") ? allianceStation[0] : ""); }, 250); } } else { @@ -91,7 +91,7 @@ var handleArenaStatus = function(data) { var handleMatchTime = function(data) { translateMatchTime(data, function(matchState, matchStateText, countdownSec) { var countdownString = String(countdownSec % 60); - if (countdownString.length == 1) { + if (countdownString.length === 1) { countdownString = "0" + countdownString; } countdownString = Math.floor(countdownSec / 60) + ":" + countdownString; @@ -107,7 +107,7 @@ var handleRealtimeScore = function(data) { }; $(function() { - if (displayId == "") { + if (displayId === "") { displayId = Math.floor(Math.random() * 10000); window.location = "/displays/alliance_station?displayId=" + displayId; } diff --git a/static/js/announcer_display.js b/static/js/announcer_display.js index d361010..907c9ab 100644 --- a/static/js/announcer_display.js +++ b/static/js/announcer_display.js @@ -18,7 +18,7 @@ Handlebars.registerHelper("eachMapEntry", function(context, options) { // Handles a websocket message to hide the score dialog once the next match is being introduced. var handleAudienceDisplayMode = function(targetScreen) { // Hide the final results so that they aren't blocking the current teams when the announcer needs them most. - if (targetScreen == "intro" || targetScreen == "match") { + if (targetScreen === "intro" || targetScreen === "match") { $("#matchResult").modal("hide"); } }; @@ -82,7 +82,7 @@ $(function() { // Make the score blink. setInterval(function() { - var blinkOn = $("#savedMatchResult").attr("data-blink") == "true"; + var blinkOn = $("#savedMatchResult").attr("data-blink") === "true"; $("#savedMatchResult").attr("data-blink", !blinkOn); }, 500); }); diff --git a/static/js/audience_display.js b/static/js/audience_display.js index 3b6c366..57086f2 100644 --- a/static/js/audience_display.js +++ b/static/js/audience_display.js @@ -11,7 +11,7 @@ var allianceSelectionTemplate = Handlebars.compile($("#allianceSelectionTemplate // Handles a websocket message to change which screen is displayed. var handleAudienceDisplayMode = function(targetScreen) { - if (targetScreen == currentScreen) { + if (targetScreen === currentScreen) { return; } @@ -29,12 +29,12 @@ var handleAudienceDisplayMode = function(targetScreen) { // Handles a websocket message to update the teams for the current match. var handleMatchLoad = function(data) { - $("#redTeam1").text(data.Match.Red1) - $("#redTeam2").text(data.Match.Red2) - $("#redTeam3").text(data.Match.Red3) - $("#blueTeam1").text(data.Match.Blue1) - $("#blueTeam2").text(data.Match.Blue2) - $("#blueTeam3").text(data.Match.Blue3) + $("#redTeam1").text(data.Match.Red1); + $("#redTeam2").text(data.Match.Red2); + $("#redTeam3").text(data.Match.Red3); + $("#blueTeam1").text(data.Match.Blue1); + $("#blueTeam2").text(data.Match.Blue2); + $("#blueTeam3").text(data.Match.Blue3); $("#matchName").text(data.MatchName + " " + data.Match.DisplayName); }; @@ -42,7 +42,7 @@ var handleMatchLoad = function(data) { var handleMatchTime = function(data) { translateMatchTime(data, function(matchState, matchStateText, countdownSec) { var countdownString = String(countdownSec % 60); - if (countdownString.length == 1) { + if (countdownString.length === 1) { countdownString = "0" + countdownString; } countdownString = Math.floor(countdownSec / 60) + ":" + countdownString; @@ -140,7 +140,7 @@ var handleAllianceSelection = function(alliances) { // Handles a websocket message to populate and/or show/hide a lower third. var handleLowerThird = function(data) { - if (data.BottomText == "") { + if (data.BottomText === "") { $("#lowerThirdTop").hide(); $("#lowerThirdBottom").hide(); $("#lowerThirdSingle").text(data.TopText); @@ -201,7 +201,7 @@ var transitionBlankToInMatch = function(callback) { }); }); }); -} +}; var transitionInMatchToIntro = function(callback) { $(".score-number").transition({queue: false, opacity: 0}, 300, "linear"); @@ -385,7 +385,7 @@ var initializeSponsorDisplay = function() { $('.carousel#sponsor').carousel('pause'); t = setTimeout("$('.carousel#sponsor').carousel();", duration-1000); - }) + }); $('.carousel-control.right').on('click', function(){ clearTimeout(t); @@ -396,7 +396,7 @@ var initializeSponsorDisplay = function() { }); }); -} +}; $(function() { // Set up the websocket back to the server. diff --git a/static/js/cheesy-websocket.js b/static/js/cheesy-websocket.js index 4e65d48..39f9e92 100644 --- a/static/js/cheesy-websocket.js +++ b/static/js/cheesy-websocket.js @@ -6,11 +6,11 @@ var CheesyWebsocket = function(path, events) { var that = this; var protocol = "ws://"; - if (window.location.protocol == "https:") { + if (window.location.protocol === "https:") { protocol = "wss://"; } var url = protocol + window.location.hostname; - if (window.location.port != "") { + if (window.location.port !== "") { url += ":" + window.location.port; } url += path; diff --git a/static/js/fta_display.js b/static/js/fta_display.js index 634a24d..20ba4c5 100644 --- a/static/js/fta_display.js +++ b/static/js/fta_display.js @@ -28,7 +28,7 @@ var handleArenaStatus = function(data) { $("#status" + station + " .robot-status").text(""); } var lowBatteryThreshold = 6; - if (matchStates[data.MatchState] == "PRE_MATCH") { + if (matchStates[data.MatchState] === "PRE_MATCH") { lowBatteryThreshold = 12; } $("#status" + station + " .battery-status").attr("data-status-ok", diff --git a/static/js/lower_thirds.js b/static/js/lower_thirds.js index 75ca50f..127a5eb 100644 --- a/static/js/lower_thirds.js +++ b/static/js/lower_thirds.js @@ -34,7 +34,7 @@ var reorderLowerThird = function(button, moveUp) { var constructLowerThird = function(button) { return { Id: parseInt(button.form.id.value), TopText: button.form.topText.value, BottomText: button.form.bottomText.value, DisplayOrder: parseInt(button.form.displayOrder.value) } -} +}; $(function() { // Set up the websocket back to the server. diff --git a/static/js/match_play.js b/static/js/match_play.js index 12f7772..15842c4 100644 --- a/static/js/match_play.js +++ b/static/js/match_play.js @@ -73,7 +73,7 @@ var handleArenaStatus = function(data) { $("#status" + station + " .robot-status").text(""); } var lowBatteryThreshold = 6; - if (matchStates[data.MatchState] == "PRE_MATCH") { + if (matchStates[data.MatchState] === "PRE_MATCH") { lowBatteryThreshold = 12; } $("#status" + station + " .battery-status").attr("data-status-ok", @@ -138,7 +138,7 @@ var handleArenaStatus = function(data) { } $("#fieldEstop").attr("data-ready", !data.FieldEstop); - if (matchStates[data.MatchState] != "PRE_MATCH") { + if (matchStates[data.MatchState] !== "PRE_MATCH") { $("#gameSpecificData").val(data.GameSpecificData); } }; diff --git a/static/js/match_review.js b/static/js/match_review.js index ec57d26..c94e099 100644 --- a/static/js/match_review.js +++ b/static/js/match_review.js @@ -60,12 +60,12 @@ var renderResults = function(alliance) { $("input[name=" + alliance + "Team" + k + "Card][value=" + v + "]").prop("checked", true); }); } -} +}; // Converts the current form values back into JSON structures and caches them. var updateResults = function(alliance) { var result = allianceResults[alliance]; - var formData = {} + var formData = {}; $.each($("form").serializeArray(), function(k, v) { formData[v.name] = v.value; }); @@ -96,15 +96,15 @@ var updateResults = function(alliance) { $.each([result.team1, result.team2, result.team3], function(i, team) { result.cards[team] = formData[alliance + "Team" + team + "Card"]; }); -} +}; // Appends a blank foul to the end of the list. var addFoul = function(alliance) { updateResults(alliance); var result = allianceResults[alliance]; - result.score.Fouls.push({TeamId: 0, Rule: "", TimeInMatchSec: 0}) + result.score.Fouls.push({TeamId: 0, Rule: "", TimeInMatchSec: 0}); renderResults(alliance); -} +}; // Removes the given foul from the list. var deleteFoul = function(alliance, index) { @@ -112,4 +112,4 @@ var deleteFoul = function(alliance, index) { var result = allianceResults[alliance]; result.score.Fouls.splice(index, 1); renderResults(alliance); -} +}; diff --git a/static/js/pit_display.js b/static/js/pit_display.js index 4a6debd..24b6407 100644 --- a/static/js/pit_display.js +++ b/static/js/pit_display.js @@ -73,7 +73,7 @@ var cycleRankings = function() { // Updates the "Standings as of" message with the given value, or blanks it out if there is no data yet. var setHighestPlayedMatch = function(highestPlayedMatch) { - if (highestPlayedMatch == "") { + if (highestPlayedMatch === "") { $("#highestPlayedMatch").text(""); } else { $("#highestPlayedMatch").text("Standings as of Qualification Match " + highestPlayedMatch); diff --git a/static/js/referee_display.js b/static/js/referee_display.js index f8b6d59..9ed0ecb 100644 --- a/static/js/referee_display.js +++ b/static/js/referee_display.js @@ -33,11 +33,11 @@ var setFoulRule = function(ruleButton) { // Sets button styles to match the selection cached in the global variables. var setSelections = function() { $("[data-team]").each(function(i, teamButton) { - $(teamButton).attr("data-selected", $(teamButton).attr("data-team") == foulTeam); + $(teamButton).attr("data-selected", $(teamButton).attr("data-team") === foulTeam); }); $("[data-rule]").each(function(i, ruleButton) { - $(ruleButton).attr("data-selected", $(ruleButton).attr("data-rule") == foulRule); + $(ruleButton).attr("data-selected", $(ruleButton).attr("data-rule") === foulRule); }); }; @@ -58,7 +58,7 @@ var clearFoul = function() { var commitFoul = function() { websocket.send("addFoul", {Alliance: foulTeamButton.attr("data-alliance"), TeamId: parseInt(foulTeamButton.attr("data-team")), Rule: foulRuleButton.attr("data-rule"), - IsTechnical: foulRuleButton.attr("data-is-technical") == "true"}); + IsTechnical: foulRuleButton.attr("data-is-technical") === "true"}); }; // Removes the foul with the given parameters from the list. @@ -70,9 +70,9 @@ var deleteFoul = function(alliance, team, rule, isTechnical, timeSec) { // Cycles through no card, yellow card, and red card. var cycleCard = function(cardButton) { var newCard = ""; - if ($(cardButton).attr("data-card") == "") { + if ($(cardButton).attr("data-card") === "") { newCard = "yellow"; - } else if ($(cardButton).attr("data-card") == "yellow") { + } else if ($(cardButton).attr("data-card") === "yellow") { newCard = "red"; } websocket.send("card", {Alliance: $(cardButton).attr("data-alliance"), diff --git a/static/js/scoring_display.js b/static/js/scoring_display.js index 7bbf476..8f92340 100644 --- a/static/js/scoring_display.js +++ b/static/js/scoring_display.js @@ -49,7 +49,7 @@ var handleKeyPress = function(event) { // Handles a websocket message to update the match status. var handleMatchTime = function(data) { - if (matchStates[data.MatchState] == "POST_MATCH" && !scoreCommitted) { + if (matchStates[data.MatchState] === "POST_MATCH" && !scoreCommitted) { $("#commitMatchScore").show(); } else { $("#commitMatchScore").hide(); diff --git a/static/js/setup_schedule.js b/static/js/setup_schedule.js index 2faebf1..6bd1edb 100644 --- a/static/js/setup_schedule.js +++ b/static/js/setup_schedule.js @@ -32,7 +32,7 @@ var addBlock = function(startTime, numMatches, matchSpacingSec) { $("#endTimePicker" + lastBlockNumber).datetimepicker({useSeconds: true}). data("DateTimePicker").setDate(endTime); updateBlock(lastBlockNumber); -} +}; // Updates the per-block and global schedule statistics. var updateBlock = function(blockNumber) { @@ -42,7 +42,7 @@ var updateBlock = function(blockNumber) { var numMatches = Math.floor((endTime - startTime) / matchSpacingSec / 1000); var actualEndTime = moment(startTime + numMatches * matchSpacingSec * 1000).format("hh:mm:ss A"); blockMatches[blockNumber] = numMatches; - if (matchSpacingSec == "" || isNaN(numMatches) || numMatches <= 0) { + if (matchSpacingSec === "" || isNaN(numMatches) || numMatches <= 0) { numMatches = ""; actualEndTime = ""; blockMatches[blockNumber] = 0; @@ -51,7 +51,7 @@ var updateBlock = function(blockNumber) { $("#actualEndTime" + blockNumber).text(actualEndTime); updateStats(); -} +}; var updateStats = function() { // Update total number of matches. @@ -85,7 +85,7 @@ var generateSchedule = function() { field.attr("name", name); field.attr("value", value); form.append(field); - } + }; var i = 0; $.each(blockMatches, function(k, v) { addField("startTime" + i, $("#startTime" + k).val()); diff --git a/templates/edit_match_result.html b/templates/edit_match_result.html index b00a731..a51e284 100644 --- a/templates/edit_match_result.html +++ b/templates/edit_match_result.html @@ -246,7 +246,7 @@ {{define "script"}}