Skip to content

Commit 2cb9266

Browse files
committed
add scenes to open
2 parents f3ca5f7 + 2489285 commit 2cb9266

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

app.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3420,6 +3420,7 @@
34203420
for (let i = 1; i <= text.length; i++) {
34213421
const {width} = ctx.measureText('[' + text.slice(0, i) + ']');
34223422
urlMeasures.push(width - barWidth*2);
3423+
<<<<<<< HEAD
34233424
}
34243425
};
34253426
_updateUrlMeasures();
@@ -3432,6 +3433,20 @@
34323433
sceneMeasures.push(width - barWidth*2);
34333434
}
34343435
};
3436+
=======
3437+
}
3438+
};
3439+
_updateUrlMeasures();
3440+
const _updateSceneMeasures = () => {
3441+
sceneMeasures.length = 0;
3442+
sceneMeasures.push(0);
3443+
const {width: barWidth} = ctx.measureText('[');
3444+
for (let i = 1; i <= sceneText.length; i++) {
3445+
const {width} = ctx.measureText('[' + sceneText.slice(0, i) + ']');
3446+
sceneMeasures.push(width - barWidth*2);
3447+
}
3448+
};
3449+
>>>>>>> 248928539ae00ef1ce1813956532a8987a33c9f2
34353450
_updateSceneMeasures();
34363451

34373452
const urlInputPadding = [40, 53];
@@ -3729,6 +3744,13 @@
37293744
} else {
37303745
console.log('paste fail');
37313746
}
3747+
} else if (id === 'action-open-scene') {
3748+
const dom = new DOMParser().parseFromString(url, 'text/html');
3749+
if (dom.body.childNodes.length === 1 && dom.body.childNodes[0].nodeName === 'XR-SITE') {
3750+
root.innerHTML = dom.body.childNodes[0].innerHTML;
3751+
} else {
3752+
console.log('paste fail');
3753+
}
37323754
} else if (id === 'action-load-scene') {
37333755
window.parentPostMessage({
37343756
method: 'loadScene',

interface.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,21 @@ <h3>{{label}}</h3>
330330
{{/sceneResults}}
331331
</ul>
332332
</div>
333+
<div class=results>
334+
<ul>
335+
{{#searchResults}}
336+
<li>
337+
<a href="{{{url}}}" name="{{{label}}}">
338+
<img src="{{{icon}}}">
339+
<div class=wrap>
340+
<h3>{{label}}</h3>
341+
<p>{{{url}}}</p>
342+
</div>
343+
</a>
344+
</li>
345+
{{/searchResults}}
346+
</ul>
347+
</div>
333348
{{/tab2}}
334349
{{#tab4}}
335350
<div class=channels>

0 commit comments

Comments
 (0)