From d727f6e769ae6f3210a57f32f6c198469efaa9b8 Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Sat, 25 May 2019 22:44:04 +0200 Subject: Run with lighttpd and remove deploy.py --- WebInterface/wasm/asm-paint/src/lib.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'WebInterface/wasm/asm-paint/src') diff --git a/WebInterface/wasm/asm-paint/src/lib.rs b/WebInterface/wasm/asm-paint/src/lib.rs index 462a89d..b6a5840 100644 --- a/WebInterface/wasm/asm-paint/src/lib.rs +++ b/WebInterface/wasm/asm-paint/src/lib.rs @@ -8,20 +8,14 @@ macro_rules! console_log { extern "C" { #[wasm_bindgen(js_namespace = console)] fn log(s: &str); + + #[wasm_bindgen(js_namespace = document)] + fn write(s: &str); } #[wasm_bindgen(start)] pub fn entry() { - use web_sys; - console_log!("hello {} wasm", 42); - - let window = web_sys::window().unwrap(); - - let document = window.document().unwrap(); - - let body = document.body().unwrap(); - - //body.set_inner_html("

Hello from WASM

"); + console_log!("hello {} wasm", 44); - body.set_inner_html("oho"); + write("gooo"); } -- cgit v1.2.3-70-g09d2