summaryrefslogtreecommitdiff
path: root/web/static/dartboat.js
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-23 21:11:50 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-23 21:11:50 -0700
commite2fe11469394c9827a0cdea9966188c833d93197 (patch)
tree9efcd1651e92bc7db4d63f0e0953343ed35b91ca /web/static/dartboat.js
parent2cd3bddfa34929411737ebae1f2e99fcb0cb25e2 (diff)
downloaddartboat-e2fe11469394c9827a0cdea9966188c833d93197.tar.gz
dartboat-e2fe11469394c9827a0cdea9966188c833d93197.tar.xz
web: implement prompt-aware keypad
Diffstat (limited to 'web/static/dartboat.js')
-rw-r--r--web/static/dartboat.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/static/dartboat.js b/web/static/dartboat.js
index 7324ad0..016742b 100644
--- a/web/static/dartboat.js
+++ b/web/static/dartboat.js
@@ -124,6 +124,12 @@ let prompt_handlers = {
}
},
+ match_over: {
+ submit() {
+ Module.ccall('match_init');
+ },
+ },
+
init: {
append(val) {
let e = document.getElementById('prompt-input');
@@ -153,6 +159,14 @@ let prompt_handlers = {
function setPromptHandler(ptr) {
prompt_handler = prompt_handlers[UTF8ToString(ptr)];
+
+ if (UTF8ToString(ptr) === "init") {
+ document.querySelectorAll('.keypad').forEach(e => e.style.display = 'none');
+ document.getElementById('keypad-init').style.removeProperty('display');
+ } else {
+ document.querySelectorAll('.keypad').forEach(e => e.style.display = 'none');
+ document.getElementById('keypad-default').style.removeProperty('display');
+ }
}
function promptHandle(action, ...args) {