Skip to content

Commit 3a042cf

Browse files
save file
1 parent d255b5e commit 3a042cf

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

utils/misc/nodejs-terminal/v2.0/nodejs-terminal-v2.0.html

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,19 +283,44 @@
283283
var result = await mod.build({root:node,mod:mod2});
284284
await mod2.auto();
285285
var wciframe = mod2['webcontainer-iframe'];
286+
return wciframe;
286287

287288
}//niframe
288289

289290

290291
btn['snippet-editor'] = async function(){
291292

293+
var wciframe = await btn.niframe();
294+
292295
var node = document.createElement('snippet-editor');
293296
node.toggleAttribute('component',true);
294-
document.body.append(node);
297+
//document.body.append(node);
298+
wciframe.iframe.contentDocument.body.append(node);
295299
var mod2 = mod.create({mod,name:'snippet-editor'});
296300
var result = await mod.build({root:node,mod:mod2});
297-
await mod2.auto();
298301
var snippet = mod2['snippet-editor'];
302+
await mod2.auto();
303+
304+
305+
var node = document.createElement('webcontainer-fs');
306+
node.setAttribute('component','page');
307+
wciframe.iframe.contentDocument.body.append(node);
308+
var mod2 = mod.create({mod,name:'webcontainer-fs'});
309+
var result = await mod.build({root:node,mod:mod2});
310+
var wcfs = mod2['webcontainer-fs'];
311+
wcfs.initmod({filemod:snippet.filemod,ext,$,menu,source,webcontainer,log,debug,complete});
312+
313+
await wcfs.init();
314+
wcfs.initdom();
315+
316+
317+
async function source(){
318+
319+
var txt = snippet.editor.getValue();
320+
var blob = new Blob([txt]);
321+
return blob;
322+
323+
}//source
299324

300325
}//snippet-editor
301326

0 commit comments

Comments
 (0)