updated build + example with navigator fix
This commit is contained in:
parent
ab026ea8a1
commit
c6ee20bf01
7 changed files with 4753 additions and 10 deletions
12
dist/xrfragment.aframe.all.js
vendored
12
dist/xrfragment.aframe.all.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Fri Jul 19 03:41:31 PM UTC 2024
|
* v0.5.1 generated at Wed Jul 24 12:06:14 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -2022,6 +2022,9 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
xrf.navigator = {
|
xrf.navigator = {
|
||||||
|
opts: {
|
||||||
|
openInNewTab: true
|
||||||
|
},
|
||||||
URI: xrf.URI.parse(document.location.href)
|
URI: xrf.URI.parse(document.location.href)
|
||||||
// scheme: document.location.protocol.replace(/:$/,''),
|
// scheme: document.location.protocol.replace(/:$/,''),
|
||||||
// directory: document.location.pathname,
|
// directory: document.location.pathname,
|
||||||
|
|
@ -2156,7 +2159,12 @@ xrf.navigator.setupNavigateFallbacks = () => {
|
||||||
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
||||||
let inIframe
|
let inIframe
|
||||||
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
||||||
return inIframe ? window.parent.postMessage({ url }, '*') : window.open( url, '_blank')
|
if( inIframe ){
|
||||||
|
window.parent.postMessage({ url }, '*')
|
||||||
|
}else{
|
||||||
|
if( xrf.navigator.opts.openInNewTab ) window.open( url, '_blank')
|
||||||
|
else{ setTimeout( () => document.location.href = url, 1000) }
|
||||||
|
}
|
||||||
// in case you're running in an iframe, then use this in the parent page:
|
// in case you're running in an iframe, then use this in the parent page:
|
||||||
//
|
//
|
||||||
// window.addEventListener("message", (e) => {
|
// window.addEventListener("message", (e) => {
|
||||||
|
|
|
||||||
12
dist/xrfragment.aframe.js
vendored
12
dist/xrfragment.aframe.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Fri Jul 19 03:41:31 PM UTC 2024
|
* v0.5.1 generated at Wed Jul 24 12:06:14 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -2020,6 +2020,9 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
xrf.navigator = {
|
xrf.navigator = {
|
||||||
|
opts: {
|
||||||
|
openInNewTab: true
|
||||||
|
},
|
||||||
URI: xrf.URI.parse(document.location.href)
|
URI: xrf.URI.parse(document.location.href)
|
||||||
// scheme: document.location.protocol.replace(/:$/,''),
|
// scheme: document.location.protocol.replace(/:$/,''),
|
||||||
// directory: document.location.pathname,
|
// directory: document.location.pathname,
|
||||||
|
|
@ -2154,7 +2157,12 @@ xrf.navigator.setupNavigateFallbacks = () => {
|
||||||
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
||||||
let inIframe
|
let inIframe
|
||||||
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
||||||
return inIframe ? window.parent.postMessage({ url }, '*') : window.open( url, '_blank')
|
if( inIframe ){
|
||||||
|
window.parent.postMessage({ url }, '*')
|
||||||
|
}else{
|
||||||
|
if( xrf.navigator.opts.openInNewTab ) window.open( url, '_blank')
|
||||||
|
else{ setTimeout( () => document.location.href = url, 1000) }
|
||||||
|
}
|
||||||
// in case you're running in an iframe, then use this in the parent page:
|
// in case you're running in an iframe, then use this in the parent page:
|
||||||
//
|
//
|
||||||
// window.addEventListener("message", (e) => {
|
// window.addEventListener("message", (e) => {
|
||||||
|
|
|
||||||
10
dist/xrfragment.model-viewer.js
vendored
10
dist/xrfragment.model-viewer.js
vendored
|
|
@ -2017,6 +2017,9 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
xrf.navigator = {
|
xrf.navigator = {
|
||||||
|
opts: {
|
||||||
|
openInNewTab: true
|
||||||
|
},
|
||||||
URI: xrf.URI.parse(document.location.href)
|
URI: xrf.URI.parse(document.location.href)
|
||||||
// scheme: document.location.protocol.replace(/:$/,''),
|
// scheme: document.location.protocol.replace(/:$/,''),
|
||||||
// directory: document.location.pathname,
|
// directory: document.location.pathname,
|
||||||
|
|
@ -2151,7 +2154,12 @@ xrf.navigator.setupNavigateFallbacks = () => {
|
||||||
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
||||||
let inIframe
|
let inIframe
|
||||||
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
||||||
return inIframe ? window.parent.postMessage({ url }, '*') : window.open( url, '_blank')
|
if( inIframe ){
|
||||||
|
window.parent.postMessage({ url }, '*')
|
||||||
|
}else{
|
||||||
|
if( xrf.navigator.opts.openInNewTab ) window.open( url, '_blank')
|
||||||
|
else{ setTimeout( () => document.location.href = url, 1000) }
|
||||||
|
}
|
||||||
// in case you're running in an iframe, then use this in the parent page:
|
// in case you're running in an iframe, then use this in the parent page:
|
||||||
//
|
//
|
||||||
// window.addEventListener("message", (e) => {
|
// window.addEventListener("message", (e) => {
|
||||||
|
|
|
||||||
4701
dist/xrfragment.module.js
vendored
4701
dist/xrfragment.module.js
vendored
File diff suppressed because it is too large
Load diff
12
dist/xrfragment.three.js
vendored
12
dist/xrfragment.three.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Fri Jul 19 03:41:31 PM UTC 2024
|
* v0.5.1 generated at Wed Jul 24 12:06:14 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -2020,6 +2020,9 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
xrf.navigator = {
|
xrf.navigator = {
|
||||||
|
opts: {
|
||||||
|
openInNewTab: true
|
||||||
|
},
|
||||||
URI: xrf.URI.parse(document.location.href)
|
URI: xrf.URI.parse(document.location.href)
|
||||||
// scheme: document.location.protocol.replace(/:$/,''),
|
// scheme: document.location.protocol.replace(/:$/,''),
|
||||||
// directory: document.location.pathname,
|
// directory: document.location.pathname,
|
||||||
|
|
@ -2154,7 +2157,12 @@ xrf.navigator.setupNavigateFallbacks = () => {
|
||||||
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
||||||
let inIframe
|
let inIframe
|
||||||
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
||||||
return inIframe ? window.parent.postMessage({ url }, '*') : window.open( url, '_blank')
|
if( inIframe ){
|
||||||
|
window.parent.postMessage({ url }, '*')
|
||||||
|
}else{
|
||||||
|
if( xrf.navigator.opts.openInNewTab ) window.open( url, '_blank')
|
||||||
|
else{ setTimeout( () => document.location.href = url, 1000) }
|
||||||
|
}
|
||||||
// in case you're running in an iframe, then use this in the parent page:
|
// in case you're running in an iframe, then use this in the parent page:
|
||||||
//
|
//
|
||||||
// window.addEventListener("message", (e) => {
|
// window.addEventListener("message", (e) => {
|
||||||
|
|
|
||||||
12
dist/xrfragment.three.module.js
vendored
12
dist/xrfragment.three.module.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Fri Jul 19 03:41:31 PM UTC 2024
|
* v0.5.1 generated at Wed Jul 24 12:06:14 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -2020,6 +2020,9 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
xrf.navigator = {
|
xrf.navigator = {
|
||||||
|
opts: {
|
||||||
|
openInNewTab: true
|
||||||
|
},
|
||||||
URI: xrf.URI.parse(document.location.href)
|
URI: xrf.URI.parse(document.location.href)
|
||||||
// scheme: document.location.protocol.replace(/:$/,''),
|
// scheme: document.location.protocol.replace(/:$/,''),
|
||||||
// directory: document.location.pathname,
|
// directory: document.location.pathname,
|
||||||
|
|
@ -2154,7 +2157,12 @@ xrf.navigator.setupNavigateFallbacks = () => {
|
||||||
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){
|
||||||
let inIframe
|
let inIframe
|
||||||
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; }
|
||||||
return inIframe ? window.parent.postMessage({ url }, '*') : window.open( url, '_blank')
|
if( inIframe ){
|
||||||
|
window.parent.postMessage({ url }, '*')
|
||||||
|
}else{
|
||||||
|
if( xrf.navigator.opts.openInNewTab ) window.open( url, '_blank')
|
||||||
|
else{ setTimeout( () => document.location.href = url, 1000) }
|
||||||
|
}
|
||||||
// in case you're running in an iframe, then use this in the parent page:
|
// in case you're running in an iframe, then use this in the parent page:
|
||||||
//
|
//
|
||||||
// window.addEventListener("message", (e) => {
|
// window.addEventListener("message", (e) => {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
document.addEventListener('$menu:ready', (e) => {
|
document.addEventListener('$menu:ready', (e) => {
|
||||||
frontend.notify_links = true // shows href/src's as notifications when hovering buttons
|
|
||||||
// add your menubuttons:
|
// add your menubuttons:
|
||||||
let {$menu} = e.detail
|
let {$menu} = e.detail
|
||||||
$menu.buttons = $menu.buttons.concat([
|
$menu.buttons = $menu.buttons.concat([
|
||||||
|
|
@ -72,6 +71,9 @@
|
||||||
</a>
|
</a>
|
||||||
<br><br>
|
<br><br>
|
||||||
`,{timeout:false})
|
`,{timeout:false})
|
||||||
|
|
||||||
|
frontend.notify_links = true // shows href/src's as notifications when hovering buttons
|
||||||
|
xrf.navigator.opts.openInNewTab = false // open webpages in new tabs
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue