Skip to content

Commit 2d057d7

Browse files
save file
1 parent 7292fe2 commit 2d057d7

File tree

1 file changed

+34
-23
lines changed

1 file changed

+34
-23
lines changed

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

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,15 @@
199199

200200
<editors-hdr component=grp>
201201
<img slot=title src='images/js-console.png' style='top:-10px;height:75px'>
202-
<h1 slot=seo-hdr class=visually-hidden>html editor</h1>
203-
<h4 slot=version>v3.0</h4>
204-
<time slot=date datetime=2026-01-24>24 Jan 2026</time>
202+
<h1 slot=seo-hdr class=visually-hidden>
203+
js console
204+
</h1>
205+
<h4 slot=version>
206+
v3.0
207+
</h4>
208+
<time slot=date datetime=2026-02-22>
209+
22 Feb 2026
210+
</time>
205211
</editors-hdr>
206212

207213

@@ -218,7 +224,16 @@ <h4 slot=version>v3.0</h4>
218224

219225
<publish-ui component></publish-ui>
220226

221-
<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>
222237

223238
<div id=async-root>
224239
<span>
@@ -308,8 +323,16 @@ <h4 slot=version>v3.0</h4>
308323

309324

310325
$(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+
311333
mode.async = $.chkbox(root,'#async-root');
312334

335+
313336
$(root,'#syntax-chk').onclick = btn.syntax;
314337
$(root,'#prettier').onclick = btn.prettier;
315338
$(root,'#terser').onclick = btn.terser;
@@ -326,24 +349,6 @@ <h4 slot=version>v3.0</h4>
326349

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

329-
/*
330-
await Promise.all([
331-
hdr.initdom(),
332-
mainmenu.initdom(root),
333-
filemod.initdom(root),
334-
autosave.initdom(),
335-
publish.initdom(root),
336-
editor.initdom(view,{mode:'javascript'}),
337-
output.initdom(root),
338-
log.initdom(),
339-
]);
340-
*/
341-
342-
343-
344-
//ui.setup(view);
345-
346-
347352

348353
editor.focus();
349354

@@ -571,6 +576,7 @@ <h4 slot=version>v3.0</h4>
571576
window.addEventListener('message',e=>{console.log(e);
572577

573578
var json = e.data;
579+
574580
if(json.sandbox){
575581
output.on.message(json);
576582
}
@@ -748,8 +754,13 @@ <h4 slot=version>v3.0</h4>
748754

749755
var js = editor.getValue();
750756

751-
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+
}
752762

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

754765
}//run
755766

0 commit comments

Comments
 (0)