Skip to content

Commit 7292fe2

Browse files
save file
1 parent 90baee9 commit 7292fe2

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

utils/editors/js-console/v3.0/js-console-v3.0.html

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,16 @@ <h4 slot=version>
224224

225225
<publish-ui component></publish-ui>
226226

227-
<button id=run title='ctrl+enter'>run</button>
227+
<button id=run title='ctrl+enter'>
228+
run
229+
</button>
230+
231+
<div id=run-opts style='display:none'>
232+
<span id=host>
233+
host
234+
<input type=checkbox>
235+
</span>
236+
</div>
228237

229238
<div id=async-root>
230239
<span>
@@ -314,8 +323,16 @@ <h4 slot=version>
314323

315324

316325
$(root,'#run').onclick = run;
326+
327+
var r = $('#run-opts');
328+
if(window.electronAPI){
329+
$('#run-opts').style.display = '';
330+
}
331+
ui.host = $.chkbox(r,'#host');
332+
317333
mode.async = $.chkbox(root,'#async-root');
318334

335+
319336
$(root,'#syntax-chk').onclick = btn.syntax;
320337
$(root,'#prettier').onclick = btn.prettier;
321338
$(root,'#terser').onclick = btn.terser;
@@ -332,24 +349,6 @@ <h4 slot=version>
332349

333350
slider.node = $.slider('web-editor','#page-slider','output-console',slider,ui);
334351

335-
/*
336-
await Promise.all([
337-
hdr.initdom(),
338-
mainmenu.initdom(root),
339-
filemod.initdom(root),
340-
autosave.initdom(),
341-
publish.initdom(root),
342-
editor.initdom(view,{mode:'javascript'}),
343-
output.initdom(root),
344-
log.initdom(),
345-
]);
346-
*/
347-
348-
349-
350-
//ui.setup(view);
351-
352-
353352

354353
editor.focus();
355354

@@ -577,6 +576,7 @@ <h4 slot=version>
577576
window.addEventListener('message',e=>{console.log(e);
578577

579578
var json = e.data;
579+
580580
if(json.sandbox){
581581
output.on.message(json);
582582
}
@@ -754,8 +754,13 @@ <h4 slot=version>
754754

755755
var js = editor.getValue();
756756

757-
output.run.iframe2(js,{async:mode.async.checked});
757+
if(ui.host.checked){
758+
debug('host');
759+
output.run.host(js,{async:mode.async.checked});
760+
return;
761+
}
758762

763+
output.run.iframe(js,{async:mode.async.checked});
759764

760765
}//run
761766

0 commit comments

Comments
 (0)