From 2cd3bddfa34929411737ebae1f2e99fcb0cb25e2 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 23 Apr 2022 20:30:36 -0700 Subject: web: support two-player scoreboard mode --- web/static/dartboat.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'web/static/dartboat.js') 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) { -- cgit v1.2.3-70-g09d2