Skip to content

Commit 5ac2135

Browse files
save file
1 parent 2a299e7 commit 5ac2135

1 file changed

Lines changed: 30 additions & 17 deletions

File tree

utils/misc/nodejs-terminal/html/snippet-nodejs/v1.0/snippet-nodejs-v1.0.html

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,36 @@
170170
btn.run = async function(){
171171

172172
var js = editor.get();
173+
run(js);
174+
175+
}//run
176+
177+
178+
btn.kill = async function(){
179+
180+
if(!process){
181+
term.log('no process');
182+
return;
183+
}
184+
185+
await process.kill();
186+
187+
}//kill
188+
189+
190+
btn.clear = function(){
191+
192+
term.clear();
193+
194+
}//clear
195+
196+
197+
//:
198+
199+
200+
201+
function run(js){
202+
173203
await webcontainer.fs.writeFile(tmpfile,js);
174204

175205
if(!chk.persist.checked){
@@ -201,30 +231,13 @@
201231
}//run
202232

203233

204-
btn.kill = async function(){
205-
206-
if(!process){
207-
term.log('no process');
208-
return;
209-
}
210-
211-
await process.kill();
212-
213-
}//kill
214-
215-
216-
btn.clear = function(){
217234

218-
term.clear();
219-
220-
}//clear
221235

222236

223237
//:
224238

225239

226240

227-
228241
return obj;
229242

230243
})

0 commit comments

Comments
 (0)