diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-25 14:46:56 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-25 14:46:56 +0200 |
| commit | 6acdebc9ced4f457975d215af9ab19811bea29d6 (patch) | |
| tree | aecbf18a19c3d89cf8a144ab62c32c322665f8fa /index.html | |
| parent | 50f3131200c9cf88f26da4ef79ff965a88b3f583 (diff) | |
| download | bridge-6acdebc9ced4f457975d215af9ab19811bea29d6.tar.gz bridge-6acdebc9ced4f457975d215af9ab19811bea29d6.zip | |
add API for crunches
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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> |
