130130
131131
132132 # item # values , # item2 # values
133- {display : grid;grid-template-columns : 300 px 300 px 1fr ;gap : 0.5 rem 1rem }
133+ {display : grid;grid-template-columns : max-content max-content 1fr ;gap : 1rem 2 rem }
134134
135135 # item : hover , # item2 : hover
136136 {background : # f7f7f7 }
148148
149149
150150 # url
151- {font-weight : bold}
151+ {font-weight : bold; margin-bottom : 10 px }
152152
153153 # values
154154 {white-space : pre}
@@ -309,18 +309,19 @@ <h3>
309309 process . script = function ( src ) {
310310 console . log ( 'process.script' , src ) ;
311311
312- var nitem = item . cloneNode ( true ) ;
313-
314- //var $=nitem.querySelector.bind(nitem);
315- var $ = ( root , css ) => ( ! css && ( css = root , root = nitem ) , root . querySelector ( css ) ) ;
316-
317- $ ( '#url' ) . textContent = src ;
318- var values = $ ( '#values' ) ;
319- values . remove ( ) ;
320- var nvalues ;
321- var clone = ( ) => ( nvalues = values . cloneNode ( true ) , nitem . append ( nvalues ) , nvalues ) ;
312+ var nitem = item . cloneNode ( true ) ;
313+ $ ( nitem , '#url' ) . textContent = src ;
322314 output . append ( nitem ) ;
323315
316+ var values = $ ( nitem , '#values' ) ;
317+ var ui = { } ;
318+ ui . name = $ ( values , '#name' ) ;
319+ ui . name . remove ( ) ;
320+ ui . type = $ ( values , '#type' ) ;
321+ ui . type . remove ( ) ;
322+ ui . desc = $ ( values , '#desc' ) ;
323+ ui . desc . remove ( ) ;
324+
324325 var iframe = document . createElement ( 'iframe' ) ;
325326 iframe . onload = onload ;
326327 document . body . append ( iframe ) ;
@@ -343,19 +344,17 @@ <h3>
343344 console . log ( 'window.onerror' ) ;
344345 console . log ( arguments ) ;
345346 console . error ( err ) ;
346- clone ( ) ;
347- nvalues . textContent = err ;
348- nvalues . classList . add ( 'error' ) ;
347+ values . textContent = err ;
348+ values . classList . add ( 'error' ) ;
349349
350350 } //onerror
351351
352352
353353 win . onunhandledrejection = function ( e ) {
354354 console . warn ( `UNHANDLED PROMISE REJECTION: ${ e . reason } ` ) ;
355355 console . log ( arguments ) ;
356- clone ( ) ;
357- nvalues . textContent = e . reason ;
358- nvalues . classList . add ( 'error' ) ;
356+ values . textContent = e . reason ;
357+ values . classList . add ( 'error' ) ;
359358
360359 } //onunhandledrejection
361360
364363 console . log ( 'script.onerror' ) ;
365364 console . log ( arguments ) ;
366365 console . error ( err ) ;
367- clone ( ) ;
368- nvalues . textContent = err . toString ( ) ;
369- nvalues . classList . add ( 'error' ) ;
366+ values . textContent = err . toString ( ) ;
367+ values . classList . add ( 'error' ) ;
370368
371369 } //onerror
372370
@@ -380,22 +378,21 @@ <h3>
380378 var str = '' ;
381379 added . forEach ( key => {
382380
383- clone ( ) ;
384-
385381 var dtype = datatype ( win [ key ] ) ;
386382 var type = typeof win [ key ] ;
387383 var desc = tostring ( win [ key ] ) ;
388384
389- $ ( nvalues , '#name' ) . textContent = key ;
390- $ ( nvalues , '#type' ) . textContent = dtype + `( ${ type } )` ;
391- $ ( nvalues , '#desc' ) . textContent = desc ;
385+ var nname = ui . name . cloneNode ( true ) ;
386+ nname . textContent = key ;
387+ values . append ( nname ) ;
392388
393- /*
394- var str = `window.${key} [ ${typeof win[key]} ] : ${s1}`+'\n';
389+ var ntype = ui . type . cloneNode ( true ) ;
390+ ntype . textContent = dtype + `( ${ type } )` ;
391+ values . append ( ntype ) ;
395392
396- nvalues.textContent = str ;
397- console.log(`window.${key} =`,win[key]) ;
398- */
393+ var ndesc = ui . desc . cloneNode ( true ) ;
394+ ndesc . textContent = desc ;
395+ values . append ( ndesc ) ;
399396
400397 } ) ;
401398
0 commit comments