diff options
| author | Brian Cully <bjc@spork.org> | 2025-08-22 13:38:47 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-08-22 14:42:36 -0400 |
| commit | 79441128958669b16ce8dfe39a3684069921f604 (patch) | |
| tree | 4112092916e7bf568cc67e6bcd0621779e2d6eae /main.mjs | |
| parent | 4f7bbbf4ee269ef6638c69fc5982b0dfe4b8b947 (diff) | |
| download | automathon-79441128958669b16ce8dfe39a3684069921f604.tar.gz automathon-79441128958669b16ce8dfe39a3684069921f604.zip | |
make compile button actually compile
Diffstat (limited to 'main.mjs')
| -rw-r--r-- | main.mjs | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -1,21 +1,22 @@ -import init from './pkg/automathon.js'; +import init, { compile, run, tick } from './pkg/automathon.js'; async function loaded() { console.debug('running init'); const mod = await init(); console.debug('init done', mod); - document.querySelector("#compile").onclick = e => { - console.debug("compile clicked", e); - mod.compile(); + document.querySelector('#compile').onclick = e => { + console.debug('compile clicked', e); + let text = document.querySelector('textarea').textContent; + compile(text); }; - document.querySelector("#tick").onclick = e => { - console.debug("tick clicked", e); - mod.tick(); + document.querySelector('#tick').onclick = e => { + console.debug('tick clicked', e); + tick(); }; - document.querySelector("#run").onclick = e => { - console.debug("run clicked", e); - mod.run(); + document.querySelector('#run').onclick = e => { + console.debug('run clicked', e); + run(); }; } |
