File tree Expand file tree Collapse file tree
utils/editors/html-editor/v3.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,6 +225,11 @@ <h4 slot=version>v3.0</h4>
225225
226226 < button id =run title ='ctrl+enter '> run</ button >
227227
228+ < div id =host style ='display:none '>
229+ < input type =checkbox >
230+ host
231+ </ div >
232+
228233 < img id =prettier class =icon title =prettier >
229234
230235 < span class =spc > </ span >
@@ -294,6 +299,13 @@ <h4 slot=version>v3.0</h4>
294299
295300 focus ( ) ;
296301
302+
303+ if ( window . electronAPI || localStorage [ 'allow-host' ] ) {
304+ $ ( '#host' ) . style . display = '' ;
305+ }
306+ ui . host = $ . chkbox ( root , '#host' ) ;
307+
308+
297309 } //initdom
298310
299311
@@ -352,6 +364,10 @@ <h4 slot=version>v3.0</h4>
352364
353365 btn . run = function ( ) {
354366 debug ( 'btn.run' ) ;
367+ if ( ui . host . checked ) {
368+ run . srcdoc ( ) ;
369+ return ;
370+ }
355371 run . sandbox ( ) ;
356372
357373 } //run
@@ -525,8 +541,10 @@ <h4 slot=version>v3.0</h4>
525541 //:
526542
527543
528- function run ( ) {
529- debug ( 'run' ) ;
544+ var run = { } ;
545+
546+ run . srcdoc = function ( ) {
547+ debug ( 'run.srcdoc' ) ;
530548 if ( autosave . checked ) {
531549 debug ( 'autosave' ) ;
532550 filemod . save ( ) ;
@@ -541,6 +559,11 @@ <h4 slot=version>v3.0</h4>
541559
542560 run . sandbox = function ( ) {
543561 debug ( 'run.sandbox' ) ;
562+ if ( autosave . checked ) {
563+ debug ( 'autosave' ) ;
564+ filemod . save ( ) ;
565+ }
566+
544567 var html = editor . getValue ( ) ;
545568 output . sandbox ( html ) ;
546569
You can’t perform that action at this time.
0 commit comments