mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Convert EventSettings, Match, and MatchResult models to use Bolt DB.
This commit is contained in:
@@ -5,18 +5,19 @@
|
||||
|
||||
var scoreTemplate = Handlebars.compile($("#scoreTemplate").html());
|
||||
var allianceResults = {};
|
||||
var matchResult;
|
||||
|
||||
// Hijack the form submission to inject the data in JSON form so that it's easier for the server to parse.
|
||||
$("form").submit(function() {
|
||||
updateResults("red");
|
||||
updateResults("blue");
|
||||
|
||||
var redScoreJson = JSON.stringify(allianceResults["red"].score);
|
||||
var blueScoreJson = JSON.stringify(allianceResults["blue"].score);
|
||||
matchResult.RedScore = allianceResults["red"].score;
|
||||
matchResult.BlueScore = allianceResults["blue"].score;
|
||||
var matchResultJson = JSON.stringify(matchResult);
|
||||
|
||||
// Inject the JSON data into the form as hidden inputs.
|
||||
$("<input />").attr("type", "hidden").attr("name", "redScoreJson").attr("value", redScoreJson).appendTo("form");
|
||||
$("<input />").attr("type", "hidden").attr("name", "blueScoreJson").attr("value", blueScoreJson).appendTo("form");
|
||||
$("<input />").attr("type", "hidden").attr("name", "matchResultJson").attr("value", matchResultJson).appendTo("form");
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user