From 38bd57dd648c75283a90ca382ef00d23e3ca51be Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Sun, 20 Oct 2013 08:59:23 -0400 Subject: [PATCH] Update mobile control page to use team alternate name if set Add entry to operator page alternate name edit popup for mobile alt name --- html/controls/mobile.css | 5 +++ html/controls/mobile.html | 78 +++++++++++++++++++++++++++++++-------- html/controls/mobile.js | 14 ++++++- html/controls/operator.js | 1 + 4 files changed, 81 insertions(+), 17 deletions(-) diff --git a/html/controls/mobile.css b/html/controls/mobile.css index e064a6def..ca6cb5740 100644 --- a/html/controls/mobile.css +++ b/html/controls/mobile.css @@ -14,6 +14,11 @@ span.ClockBubble.Running { background: rgba(0, 255, 0, 0.5); } /* END ClockBubbles */ +/* Alternate Names */ + .HasAlternateName>.Name { display: none; } + :not(.HasAlternateName)>.AlternateName { display: none; } +/* END Alternate Names */ + /* JamControlPage */ #JamControlPage div { text-align: center; } diff --git a/html/controls/mobile.html b/html/controls/mobile.html index a93203fd2..6903fda69 100644 --- a/html/controls/mobile.html +++ b/html/controls/mobile.html @@ -119,14 +119,20 @@

Jam Control

- +
-
+
-
+

Period @@ -165,8 +171,16 @@

Team Score

@@ -178,14 +192,20 @@

Set Team Score

-
+
+ + +
-
+
+ + +
@@ -204,7 +224,10 @@

Both Team Score

-

+

+ + +

@@ -247,7 +270,10 @@

-

+

+ + +

@@ -292,6 +318,7 @@

+
@@ -334,6 +361,7 @@

+
@@ -377,7 +405,10 @@

-
+
+ + +
@@ -411,7 +442,10 @@

-
+
+ + +
@@ -453,11 +487,18 @@

Score -

Score

+

+ + + Score +

-
+
+ + +
@@ -497,11 +538,18 @@

Score

Score -

Score

+

+ + + Score +

-
+
+ + +
diff --git a/html/controls/mobile.js b/html/controls/mobile.js index c75fbe024..eb03469d1 100644 --- a/html/controls/mobile.js +++ b/html/controls/mobile.js @@ -16,6 +16,12 @@ $sb(function() { setupPeriodTimePage(); setupTeamScorePage(); setupPenaltyTimePage(); + + $.each( [ "1", "2" ], function(i, t) { + $sb("ScoreBoard.Team("+t+").AlternateName(mobile).Name").$sbBindAndRun("sbchange", function(event, val) { + $(".Team"+t+".AlternateName").parent().toggleClass("HasAlternateName", val != ""); + }); + }); }); function setupJamControlPage() { @@ -23,10 +29,12 @@ function setupJamControlPage() { $sb("ScoreBoard.StopJam").$sbControl("#JamControlPage button.StopJam").val(true); $sb("ScoreBoard.Timeout").$sbControl("#JamControlPage button.Timeout").val(true); $sb("ScoreBoard.Team(1).Timeout").$sbControl("#JamControlPage div.Timeout button.Team1").val(true); - $sb("ScoreBoard.Team(1).Name").$sbElement("#JamControlPage div.Timeout button.Team1>a.Name") + $sb("ScoreBoard.Team(1).Name").$sbElement("#JamControlPage div.Timeout button.Team1>span.Name"); + $sb("ScoreBoard.Team(1).AlternateName(mobile).Name").$sbElement("#JamControlPage div.Timeout button.Team1>span.AlternateName"); $sb("ScoreBoard.Timeout").$sbControl("#JamControlPage div.Timeout button.Official").val(true); $sb("ScoreBoard.Team(2).Timeout").$sbControl("#JamControlPage div.Timeout button.Team2").val(true); - $sb("ScoreBoard.Team(2).Name").$sbElement("#JamControlPage div.Timeout button.Team2>a.Name") + $sb("ScoreBoard.Team(2).Name").$sbElement("#JamControlPage div.Timeout button.Team2>span.Name"); + $sb("ScoreBoard.Team(2).AlternateName(mobile).Name").$sbElement("#JamControlPage div.Timeout button.Team2>span.AlternateName"); $.each( [ "Period", "Jam", "Timeout" ], function(i, clock) { $sb("ScoreBoard.Clock("+clock+").Running").$sbBindAndRun("sbchange", function(event, value) { @@ -122,9 +130,11 @@ function setupTeamScorePage() { var score = team.$sb("Score"); team.$sb("Name").$sbElement("#TeamScorePage span.Team"+n+".Name"); + team.$sb("AlternateName(mobile).Name").$sbElement("#TeamScorePage span.Team"+n+".AlternateName"); $.each([ "#Team"+n+"ScorePage", "#TeamSetScorePage", "#TeamBothScorePage" ], function(ii, e) { team.$sb("Name").$sbElement(e+" .Team"+n+".Name"); + team.$sb("AlternateName(mobile).Name").$sbElement(e+" .Team"+n+".AlternateName"); score.$sbElement(e+" a.Team"+n+".Score"); score.$sbControl(e+" button.Team"+n+".ScoreDown", { sbcontrol: { sbSetAttrs: { change: true } diff --git a/html/controls/operator.js b/html/controls/operator.js index 08df3ec4e..dffb31507 100644 --- a/html/controls/operator.js +++ b/html/controls/operator.js @@ -1147,6 +1147,7 @@ function createAlternateNamesDialog(team) { newIdInput.autocomplete({ minLength: 0, source: [ + { label: "mobile (Mobile Control)", value: "mobile" }, { label: "overlay (Video Overlay)", value: "overlay" }, { label: "twitter (Twitter)", value: "twitter" } ]