diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-26 23:29:00 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-26 23:29:00 -0700 |
commit | a273e90b445ec82a04f92187adfe610cd0703dba (patch) | |
tree | b018db0f04b99b5aa62201e1d947166e6e82cda3 /web/dartboat_wasm.c | |
parent | 44384cf8e219b40d8f204d2f8714cacc3690070a (diff) | |
download | dartboat-a273e90b445ec82a04f92187adfe610cd0703dba.tar.gz dartboat-a273e90b445ec82a04f92187adfe610cd0703dba.tar.xz |
web: rid HTML of inline JS
Maybe I'll change this to use targeted event listeners when I'm not
lazy.
Diffstat (limited to 'web/dartboat_wasm.c')
-rw-r--r-- | web/dartboat_wasm.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/web/dartboat_wasm.c b/web/dartboat_wasm.c index 4c9973b..7c06849 100644 --- a/web/dartboat_wasm.c +++ b/web/dartboat_wasm.c @@ -485,7 +485,7 @@ char *prompt_get() return (char *)EM_ASM_INT({return promptGet()}); } -void prompt_handle_pre(char *action) +void prompt_handle_pre(char *command) { if (pm == PM_NONE) return; @@ -493,13 +493,13 @@ void prompt_handle_pre(char *action) EM_ASM(clearOi()); if ((pm == PM_VISIT || pm == PM_NUM_DARTS || pm == PM_END_MATCH) && - strcmp(action, "undo")) + strcmp(command, "undo")) deactivate_key("undo"); - if (pm == PM_END_MATCH && strcmp(action, "rem")) + if (pm == PM_END_MATCH && strcmp(command, "rem")) deactivate_key("rem"); - if (pm == PM_END_MATCH && strcmp(action, "submit")) + if (pm == PM_END_MATCH && strcmp(command, "submit")) deactivate_key("submit"); } @@ -610,21 +610,21 @@ void prompt_handle_undo() toggle_key("undo"); } -EMSCRIPTEN_KEEPALIVE void prompt_handle(char *action, char *data) +EMSCRIPTEN_KEEPALIVE void prompt_handle(char *command, char *data) { - prompt_handle_pre(action); + prompt_handle_pre(command); - if (!strcmp(action, "append")) + if (!strcmp(command, "append")) prompt_handle_append(data); - else if (!strcmp(action, "backspace")) + else if (!strcmp(command, "backspace")) prompt_handle_backspace(); - else if (!strcmp(action, "clear")) + else if (!strcmp(command, "clear")) prompt_handle_clear(); - else if (!strcmp(action, "submit")) + else if (!strcmp(command, "submit")) prompt_handle_submit(); - else if (!strcmp(action, "rem")) + else if (!strcmp(command, "rem")) prompt_handle_rem(); - else if (!strcmp(action, "undo")) + else if (!strcmp(command, "undo")) prompt_handle_undo(); } |