Updated announcer display for 2015 game.

This commit is contained in:
Patrick Fairbank
2015-08-19 22:58:50 -07:00
parent d35ffaca13
commit cd55cd070d
3 changed files with 35 additions and 15 deletions

View File

@@ -6,6 +6,14 @@
var websocket;
var teamTemplate = Handlebars.compile($("#teamTemplate").html());
var matchResultTemplate = Handlebars.compile($("#matchResultTemplate").html());
Handlebars.registerHelper("eachMapEntry", function(context, options) {
var ret = "";
$.each(context, function(key, value) {
var entry = {"key": key, "value": value};
ret = ret + options.fn(entry);
});
return ret;
});
// Handles a websocket message to hide the score dialog once the next match is being introduced.
var handleSetAudienceDisplay = function(targetScreen) {
@@ -42,10 +50,11 @@ var handleRealtimeScore = function(data) {
// Handles a websocket message to populate the final score data.
var handleSetFinalScore = function(data) {
console.log(data);
$("#scoreMatchName").text(data.MatchType + " Match " + data.MatchDisplayName);
$("#redScoreDetails").html(matchResultTemplate({score: data.RedScoreSummary, fouls: data.RedFouls}));
$("#blueScoreDetails").html(matchResultTemplate({score: data.BlueScoreSummary, fouls: data.BlueFouls}));
$("#redScoreDetails").html(matchResultTemplate({score: data.RedScoreSummary, fouls: data.RedFouls,
cards: data.RedCards}));
$("#blueScoreDetails").html(matchResultTemplate({score: data.BlueScoreSummary, fouls: data.BlueFouls,
cards: data.BlueCards}));
$("#matchResult").modal("show");
};