summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-25 14:46:56 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-25 14:46:56 +0200
commit6acdebc9ced4f457975d215af9ab19811bea29d6 (patch)
treeaecbf18a19c3d89cf8a144ab62c32c322665f8fa /index.html
parent50f3131200c9cf88f26da4ef79ff965a88b3f583 (diff)
downloadbridge-6acdebc9ced4f457975d215af9ab19811bea29d6.tar.gz
bridge-6acdebc9ced4f457975d215af9ab19811bea29d6.zip
add API for crunches
Diffstat (limited to 'index.html')
-rw-r--r--index.html14
1 files changed, 10 insertions, 4 deletions
diff --git a/index.html b/index.html
index 5f191e4..26c0f5e 100644
--- a/index.html
+++ b/index.html
@@ -32,6 +32,8 @@
</p>
<p>
<form id="crunchglobal-form">
+ <input type="checkbox" id="crunch-force">
+ <label for="crunch-force">Force recrunch</label>
<input type="submit" value="Crunch global stats">
</form>
</p>
@@ -51,7 +53,7 @@
client = webstomp.over(SockJS("http://localhost:15674/stomp"));
}
- let notif = (text, color) => {
+ const notif = (text, color) => {
$("#updates").append(
$("<li>")
.text(text)
@@ -93,7 +95,7 @@
$("#update-form").submit((e) => {
e.preventDefault();
- let ign = $("#update-name").val(),
+ const ign = $("#update-name").val(),
force = $("#update-force").is(":checked"),
brawls = $("#update-brawl").is(":checked");
@@ -119,12 +121,16 @@
$("#crunch-form").submit((e) => {
e.preventDefault();
- let ign = $("#crunch-name").val();
+ const ign = $("#crunch-name").val();
$.post("/api/player/" + ign + "/crunch");
});
$("#crunchglobal-form").submit((e) => {
+ const force = $("#crunch-force").is(":checked");
e.preventDefault();
- $.post("/api/crunch");
+ if (force)
+ $.post("/api/recrunch");
+ else
+ $.post("/api/crunch");
});
</script>
</body>