File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 677677 const maxResults = 12 ;
678678 if ( s ) {
679679 const regexps = s . split ( / \s / ) . filter ( s => ! ! s ) . map ( s => new RegExp ( escapeRegExp ( s ) , 'i' ) ) ;
680- const results = [ ] ;
680+ const sceneResults = [ ] ;
681681 for ( let i = 0 ; i < scenesJson . length ; i ++ ) {
682682 const site = scenesJson [ i ] ;
683683 if ( regexps . some ( regexp => regexp . test ( site . label ) || regexp . test ( site . url ) ) ) {
684- results . push ( site ) ;
685- if ( results . length >= maxResults ) {
684+ sceneResults . push ( site ) ;
685+ if ( sceneResults . length >= maxResults ) {
686686 break ;
687687 }
688688 }
689689 }
690- return results ;
690+ console . log ( "scenes.json --- sceneResults = " + sceneResults ) ;
691+ return sceneResults ;
691692 } else {
693+ console . log ( "scenes.json --- maxResults = " + maxResults ) ;
692694 return scenesJson . slice ( 0 , maxResults ) ;
693695 }
694696 } ;
37373739 method : 'saveScene' ,
37383740 html : root . outerHTML ,
37393741 } ) ;
3742+ } else if ( id === 'action-open-scene' ) {
3743+ const dom = new DOMParser ( ) . parseFromString ( url , 'text/html' ) ;
3744+ if ( dom . body . childNodes . length === 1 && dom . body . childNodes [ 0 ] . nodeName === 'XR-SITE' ) {
3745+ root . innerHTML = dom . body . childNodes [ 0 ] . innerHTML ;
3746+ } else {
3747+ console . log ( 'paste fail' ) ;
3748+ }
37403749 } else if ( href ) {
37413750 const xrIframe = document . createElement ( 'xr-iframe' ) ;
37423751 xrIframe . src = href ;
You can’t perform that action at this time.
0 commit comments