summaryrefslogtreecommitdiff
path: root/web/static/dartboat.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/static/dartboat.js')
-rw-r--r--web/static/dartboat.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/web/static/dartboat.js b/web/static/dartboat.js
index 6740381..7324ad0 100644
--- a/web/static/dartboat.js
+++ b/web/static/dartboat.js
@@ -125,8 +125,24 @@ let prompt_handlers = {
},
init: {
+ append(val) {
+ let e = document.getElementById('prompt-input');
+ if (e.textContent.length < 1)
+ e.textContent += val;
+ },
+
+ backspace() {
+ _promptDeleteLast();
+ },
+
+ clear() {
+ _promptClear();
+ },
+
submit() {
- Module.ccall('start_match');
+ let v = _promptGetAndClear();
+ if (v)
+ Module.ccall('start_match', null, ['number'], [v]);
},
pre(action) {