From 58f6fbe0afb828571463a22737603a037b059909 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Thu, 7 Aug 2025 12:05:51 -0400 Subject: add imports from javascript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‘alert’ and ‘console.debug’ --- main.mjs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.mjs') diff --git a/main.mjs b/main.mjs index 086b876..d8fe63a 100644 --- a/main.mjs +++ b/main.mjs @@ -4,6 +4,7 @@ async function run() { console.debug('run'); const foo = await init(); console.debug('init done', foo); + window.calculate = _ => { console.debug('calc'); const inp1 = document.getElementById('number-input1').value; @@ -11,6 +12,11 @@ async function run() { const res = foo.add(parseInt(inp1), parseInt(inp2)); document.getElementById('result').textContent = res; } + + window.testalert = _ => { + console.debug('testalert'); + foo.test_alert('from js'); + } } document.addEventListener('DOMContentLoaded', run); -- cgit v1.3