File tree Expand file tree Collapse file tree
utils/misc/nodejs-terminal/v2.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5151 console . log ( ) ;
5252 console . json = v => console . log ( JSON . stringify ( v , null , 4 ) ) ;
5353 var version = 'v2.0' ;
54- var df = true
55- ;
54+ var df = true ;
55+
5656
5757 var ext ;
5858 var $ ;
198198 </ div >
199199 </ div >
200200
201+ < div >
202+ < input value =test type =button >
203+ </ div >
201204
202205 < log-mod component > </ log-mod >
203206
214217 var shell ;
215218
216219
217-
220+ var btn = { } ;
218221 var ui = { } ;
219222 var complete = { } ;
220223
234237 $ ( '#hldr' ) . style . background = theme . light . background ;
235238
236239
240+ $ ( '[value=test]' ) . onlclick = btn . test ;
237241
238242 log . initdom ( ) ;
239243
240244
241245 } //initdom
242246
243247
248+ //:
249+
250+
251+ btn . test = async function ( ) { console . log ( 'test' ) ;
252+
253+ console . log ( await webcontainer . fs . readdir ( '/' ) ) ;
254+ console . log ( await webcontainer . fs . readdir ( '~' ) ) ;
255+
256+ } //test
257+
258+
244259 //:
245260
246261
386401 import ( 'https://cdn.jsdelivr.net/npm/@webcontainer/api/+esm' )
387402 ] ) ;
388403
389- /*
390- var [{Terminal} = await import('https://cdn.jsdelivr.net/npm/@xterm/xterm/+esm');
391- var {FitAddon} = await import('https://cdn.jsdelivr.net/npm/@xterm/addon-fit/+esm');
392- var {WebContainer} = await import('https://cdn.jsdelivr.net/npm/@webcontainer/api/+esm');
393- */
394-
395404 var term = new Terminal ( {
396405
397406 fontFamily : 'monospace' ,
398407 fontSize : 16 ,
399408 lineHeight : 1.0 ,
400409
401-
402410 theme : theme . light ,
403411 rendererType : 'dom' ,
404412
421429 //term.resize();
422430 term . focus ( ) ;
423431
432+ console . log ( await webcontainer . fs . readdir ( '/' ) ) ;
424433 mod . stack . complete ;
425434
426435 } ) ( ) ;
You can’t perform that action at this time.
0 commit comments