|
218 | 218 | <div id=size></div> |
219 | 219 | </div> |
220 | 220 |
|
221 | | - <img id=niframe title=iframe> |
222 | | - <img id=snippet-editor title=editor> |
223 | | - <img id=snippet-console title=snippet-console> |
| 221 | + <img id=niframe title=iframe class=icon> |
| 222 | + <img id=snippet-editor title=editor class=icon> |
| 223 | + <img id=snippet-console title=snippet-console class=icon> |
224 | 224 | </div> |
225 | 225 |
|
226 | 226 | <div id=hldr> |
|
338 | 338 | btn['snippet-console'] = async function(){ |
339 | 339 |
|
340 | 340 | var viewport = await vm.new(); |
341 | | - viewport.pos({x:250,y:200}); |
| 341 | + viewport.pos({x:250,y:200,w:850,h:1100}); |
342 | 342 |
|
343 | | - var attrs = {component:true,'v2.0':true,'web-editor':'fullsize=false',exportparts:"root: inner-label"}; |
344 | | - var opts = {par:viewport.body}; |
345 | | - var snippet_console = await mod.component('snippet-console',attrs,opts); |
| 343 | + var attrs = {component:true,'v2.0':true,'web-editor':'fullsize=false',exportparts:"root: inner-label"}; |
| 344 | + var opts = {par:viewport.body}; |
| 345 | + var snippet = await mod.component('snippet-console',attrs,opts); |
346 | 346 |
|
347 | | - snippet_console.css.insert_rule([':host {height:100%;}','#root {height:100%}']); |
348 | | - snippet_console.editor.css.insert_rule([':host {flex:1}','#root {height:100%}']); |
| 347 | + snippet.css.insert_rule([':host {height:100%;}','#root {height:100%}']); |
| 348 | + snippet.editor.css.insert_rule([':host {flex:1}','#root {height:100%}']); |
349 | 349 |
|
350 | | - snippet_console.ctx = {snippet_console,webcontainer,viewport}; |
| 350 | + snippet.ctx = {snippet,webcontainer,viewport,vm}; |
| 351 | + |
| 352 | + |
| 353 | + var attrs = {component:'page'}; |
| 354 | + var opts = {par:viewport.body,auto:false}; |
| 355 | + var wcfs = await mod.component('webcontainer-fs',attrs,opts); |
| 356 | + wcfs.initmod({filemod:snippet.filemod,ext,$,menu,log,debug, |
| 357 | + webcontainer, |
| 358 | + source:snippet.source,complete:snippet.complete}); |
| 359 | + await wcfs.init(); |
| 360 | + wcfs.initdom(); |
351 | 361 |
|
352 | 362 | }//snippet-console |
353 | 363 |
|
|
0 commit comments