@@ -265,10 +265,6 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
265265 var set = { } ;
266266
267267
268-
269- //:
270-
271-
272268 async function initdom ( rootnode ) { //c
273269 debug ( 'initdom' ) ;
274270 root = rootnode ;
@@ -280,7 +276,7 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
280276
281277
282278
283- $ ( '#run' ) . onclick = run ;
279+ $ ( '#run' ) . onclick = btn . run ;
284280 $ ( root , '#prettier' ) . onclick = btn . prettier ;
285281
286282 $ ( '#horiz' ) . onclick = horiz ;
@@ -295,7 +291,7 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
295291
296292
297293
298- editor . focus ( ) ;
294+ focus ( ) ;
299295
300296
301297 } //initdom
@@ -343,6 +339,13 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
343339 } //save
344340
345341
342+ btn . run = function ( ) {
343+
344+ run ( ) ;
345+
346+ } //run
347+
348+
346349 btn . prettier = function ( ) {
347350
348351 var js = editor . getvalue ( ) ;
@@ -397,13 +400,6 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
397400 } //change
398401
399402
400- set . title = function ( title ) {
401-
402- document . title = title ;
403-
404- } //title
405-
406-
407403 //:
408404
409405
@@ -440,13 +436,7 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
440436
441437 complete . load = async function ( file , blob ) {
442438
443- var txt ;
444- if ( typeof blob == 'string' ) {
445- txt = blob ;
446- } else {
447- txt = await blob . text ( ) ;
448- }
449-
439+ var txt = await blob . text ( ) ;
450440 editor . clear ( ) ;
451441 output . kill ( ) ;
452442 editor . setValue ( txt , - 1 ) ;
@@ -466,23 +456,6 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
466456 } //save
467457
468458
469- //:
470-
471- /*
472- window.onmessage = function(e){
473-
474-
475- var json = JSON.parse(e.data);
476-
477- var txt = json.code||json.text||json.txt;
478- if(txt){
479- editor.setValue(txt,-1);
480- }
481-
482- }//onmessage
483- */
484-
485-
486459 //:
487460
488461
@@ -498,9 +471,6 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
498471 } //setup
499472
500473
501- //:
502-
503-
504474 function horiz ( ) {
505475
506476 //localStorage.setItem('orientation','horiz');
@@ -571,6 +541,13 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
571541 } //favicon
572542
573543
544+ set . title = function ( title ) {
545+
546+ document . title = title ;
547+
548+ } //title
549+
550+
574551 //:
575552
576553
@@ -587,47 +564,7 @@ <h1 slot=seo-hdr class=visually-hidden>html editor</h1>
587564 } //debug
588565
589566
590- /*
591- function debug(){
592-
593- if(!df)return;
594-
595- var str = [...arguments].join(' ');
596-
597- console.groupCollapsed(`[ ${did} ]`,str);
598- console.trace();
599- console.groupEnd();
600-
601- //console.log('[ https-file ]',str);
602-
603- }//debug
604-
605-
606- debug.log = function(){
607-
608- if(!df)return;
609-
610- console.log.apply(console,arguments);
611-
612- if(debug.trace){
613- console.trace();
614- }
615- delete debug.trace;
616-
617- }//log
618-
619-
620- debug.log.trace = function(){
621-
622- debug.trace = true;
623- debug.log.apply(null,arguments);
624-
625- }//trace
626- */
627-
628-
629567 </ script >
630568
631-
632569</ html >
633570
0 commit comments