diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-23 20:30:36 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-23 20:31:15 -0700 |
commit | 2cd3bddfa34929411737ebae1f2e99fcb0cb25e2 (patch) | |
tree | a6fde63a357537e7976122b415d700cddf0099d3 /web/static/dartboat.js | |
parent | c345340c022fce046d70ca67059c2b4dc648bc1e (diff) | |
download | dartboat-2cd3bddfa34929411737ebae1f2e99fcb0cb25e2.tar.gz dartboat-2cd3bddfa34929411737ebae1f2e99fcb0cb25e2.tar.xz |
web: support two-player scoreboard mode
Diffstat (limited to 'web/static/dartboat.js')
-rw-r--r-- | web/static/dartboat.js | 18 |
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) { |