File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 20
20
let parser_images = window . wasmBindings . previews ( array ) ;
21
21
for ( const [ key , images ] of Object . entries ( parser_images ) ) {
22
22
const container = D . createElement ( "preview-area" ) ;
23
- container . innerHTML = `<h3 >${ key } </h3 >`
23
+ container . innerHTML = `<h2 >${ key } </h2 >`
24
24
images . forEach ( src => container . appendChild ( new PreviewItem ( src ) ) ) ;
25
25
wrapper . appendChild ( container ) ;
26
26
}
54
54
shadow . appendChild ( fragment ) ;
55
55
}
56
56
onClick ( ) {
57
- $ ( '#width' ) . value = this . img . width ;
57
+ let width = this . img . width ;
58
+ let parser = $ ( 'h2' , this . parentElement ) . innerText ;
59
+ $ ( '#width' ) . value = width ;
60
+ $ ( '#parser' ) . value = parser
61
+ //alert(window.wasmBindings.tile_previews(parser, width));
58
62
}
59
63
}
60
64
customElements . define ( "preview-item" , PreviewItem ) ;
Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ pub fn previews(data: &[u8]) -> JsValue {
34
34
JsValue :: from_serde ( & hm) . unwrap ( )
35
35
}
36
36
37
+ // #[wasm_bindgen]
38
+ // pub fn tile_previews(data: &[u8], parser: String, width: usize) -> String {
39
+ // format!("{} {}", parser, width)
40
+ // }
41
+
37
42
pub fn preview ( data : & Raw , parser : ParserType ) -> Vec < String > {
38
43
let palette = parser. image_type ( ) . default_color_palette ( ) ;
39
44
data. width_previews ( parser)
You can’t perform that action at this time.
0 commit comments