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 677
677
const maxResults = 12 ;
678
678
if ( s ) {
679
679
const regexps = s . split ( / \s / ) . filter ( s => ! ! s ) . map ( s => new RegExp ( escapeRegExp ( s ) , 'i' ) ) ;
680
- const results = [ ] ;
680
+ const sceneResults = [ ] ;
681
681
for ( let i = 0 ; i < scenesJson . length ; i ++ ) {
682
682
const site = scenesJson [ i ] ;
683
683
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 ) {
686
686
break ;
687
687
}
688
688
}
689
689
}
690
- return results ;
690
+ console . log ( "scenes.json --- sceneResults = " + sceneResults ) ;
691
+ return sceneResults ;
691
692
} else {
693
+ console . log ( "scenes.json --- maxResults = " + maxResults ) ;
692
694
return scenesJson . slice ( 0 , maxResults ) ;
693
695
}
694
696
} ;
3737
3739
method : 'saveScene' ,
3738
3740
html : root . outerHTML ,
3739
3741
} ) ;
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
+ }
3740
3749
} else if ( href ) {
3741
3750
const xrIframe = document . createElement ( 'xr-iframe' ) ;
3742
3751
xrIframe . src = href ;
You can’t perform that action at this time.
0 commit comments