Add a standalone bracket display.

This commit is contained in:
Patrick Fairbank
2022-08-20 20:29:34 -07:00
parent c75baa8210
commit 8e9999eafe
9 changed files with 187 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
// Copyright 2022 Team 254. All Rights Reserved.
// Author: pat@patfairbank.com (Patrick Fairbank)
//
// Client-side methods for the bracket display.
var websocket;
// Handles a websocket message to populate the final score data, which also triggers a bracket update.
const handleScorePosted = function(data) {
$("#bracketSvg").attr("src", "/api/bracket/svg?v=" + new Date().getTime());
};
$(function() {
// Set up the websocket back to the server.
websocket = new CheesyWebsocket("/displays/bracket/websocket", {
scorePosted: function(event) { handleScorePosted(event.data); },
});
});