summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-29 22:41:35 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-29 22:41:35 +0200
commit9a328db2b102e7235ef6d3337d39d67f4e81dc76 (patch)
treea34a4f8a62c050c101af0d46e58419c60dfeba3e /index.html
parent95a64ae924ef6506dba3760ed7a334e568e96681 (diff)
downloadbridge-9a328db2b102e7235ef6d3337d39d67f4e81dc76.tar.gz
bridge-9a328db2b102e7235ef6d3337d39d67f4e81dc76.zip
make tournament & brawl API dynamic
Diffstat (limited to 'index.html')
-rw-r--r--index.html13
1 files changed, 9 insertions, 4 deletions
diff --git a/index.html b/index.html
index fbbc5b0..c0716b8 100644
--- a/index.html
+++ b/index.html
@@ -11,6 +11,8 @@
<label for="update-force">Force refresh</label>
<input type="checkbox" id="update-brawl">
<label for="update-brawl">Get Brawls</label>
+ <input type="checkbox" id="update-tournament">
+ <label for="update-tournament">Get Privates (Tournaments)</label>
<input type="submit" value="Update">
</form>
</p>
@@ -105,15 +107,18 @@
e.preventDefault();
const ign = $("#update-name").val(),
force = $("#update-force").is(":checked"),
- brawls = $("#update-brawl").is(":checked");
+ brawls = $("#update-brawl").is(":checked"),
+ tournament = $("#update-tournament").is(":checked");
if (force) {
$.post("/api/player/" + ign + "/search");
} else {
- if (!brawls)
- $.post("/api/player/" + ign + "/update");
+ if (brawls)
+ $.post("/api/player/" + ign + "/update/brawl");
+ else if (tournament)
+ $.post("/api/player/" + ign + "/update/tournament");
else
- $.post("/api/player/" + ign + "/update-brawl");
+ $.post("/api/player/" + ign + "/update");
}
});
$("#update-region-form").submit((e) => {