new build
This commit is contained in:
parent
bab44bc785
commit
2f867ab93d
12 changed files with 79 additions and 3182 deletions
18
dist/xrfragment.aframe.all.js
vendored
18
dist/xrfragment.aframe.all.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Tue Apr 16 12:47:01 PM UTC 2024
|
* v0.5.1 generated at Tue Apr 16 04:44:21 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1215,6 +1215,7 @@ xrfragment_URI.parse = function(stringUrl,flags) {
|
||||||
if(url.directory == null && url.host != null) {
|
if(url.directory == null && url.host != null) {
|
||||||
url.file = url.host;
|
url.file = url.host;
|
||||||
}
|
}
|
||||||
|
url.host = "";
|
||||||
}
|
}
|
||||||
url.hash = { };
|
url.hash = { };
|
||||||
if(url.fragment != null && url.fragment.length > 0) {
|
if(url.fragment != null && url.fragment.length > 0) {
|
||||||
|
|
@ -1393,6 +1394,8 @@ xrfragment_URI.toAbsolute = function(url,newUrl) {
|
||||||
resultURI.directory = directory;
|
resultURI.directory = directory;
|
||||||
if(newURI.file != null) {
|
if(newURI.file != null) {
|
||||||
resultURI.file = newURI.file;
|
resultURI.file = newURI.file;
|
||||||
|
} else {
|
||||||
|
resultURI.file = url.file;
|
||||||
}
|
}
|
||||||
resultURI.path = resultURI.directory + resultURI.file;
|
resultURI.path = resultURI.directory + resultURI.file;
|
||||||
if(newURI.query != null) {
|
if(newURI.query != null) {
|
||||||
|
|
@ -1999,7 +2002,15 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
||||||
return mesh.geometry && !hasMaterialName && !hasTexture
|
return mesh.geometry && !hasMaterialName && !hasTexture
|
||||||
}
|
}
|
||||||
xrf.navigator = {URI:{}}
|
xrf.navigator = {
|
||||||
|
URI:{
|
||||||
|
scheme: document.location.protocol.replace(/:$/,''),
|
||||||
|
directory: document.location.pathname,
|
||||||
|
host: document.location.hostname,
|
||||||
|
port: document.location.port,
|
||||||
|
file: 'index.glb'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
xrf.navigator.to = (url,flags,loader,data) => {
|
xrf.navigator.to = (url,flags,loader,data) => {
|
||||||
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
||||||
|
|
@ -2111,7 +2122,6 @@ xrf.navigator.init = () => {
|
||||||
|
|
||||||
window.addEventListener('popstate', function (event){
|
window.addEventListener('popstate', function (event){
|
||||||
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
||||||
//xrf.navigator.to( document.location.search.substr(1) + document.location.hash )
|
|
||||||
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -2183,7 +2193,7 @@ xrf.navigator.reactifyHash = ( obj ) => {
|
||||||
toString(me){
|
toString(me){
|
||||||
let parts = []
|
let parts = []
|
||||||
Object.keys(me).map( (k) => {
|
Object.keys(me).map( (k) => {
|
||||||
parts.push( me[k] ? `${k}=${encodeURIComponent(me[k])}` : k )
|
parts.push( me[k] ? `${k}=${me[k]}` : k )
|
||||||
})
|
})
|
||||||
return parts.join('&')
|
return parts.join('&')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
dist/xrfragment.aframe.js
vendored
18
dist/xrfragment.aframe.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Tue Apr 16 12:47:01 PM UTC 2024
|
* v0.5.1 generated at Tue Apr 16 04:44:20 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1213,6 +1213,7 @@ xrfragment_URI.parse = function(stringUrl,flags) {
|
||||||
if(url.directory == null && url.host != null) {
|
if(url.directory == null && url.host != null) {
|
||||||
url.file = url.host;
|
url.file = url.host;
|
||||||
}
|
}
|
||||||
|
url.host = "";
|
||||||
}
|
}
|
||||||
url.hash = { };
|
url.hash = { };
|
||||||
if(url.fragment != null && url.fragment.length > 0) {
|
if(url.fragment != null && url.fragment.length > 0) {
|
||||||
|
|
@ -1391,6 +1392,8 @@ xrfragment_URI.toAbsolute = function(url,newUrl) {
|
||||||
resultURI.directory = directory;
|
resultURI.directory = directory;
|
||||||
if(newURI.file != null) {
|
if(newURI.file != null) {
|
||||||
resultURI.file = newURI.file;
|
resultURI.file = newURI.file;
|
||||||
|
} else {
|
||||||
|
resultURI.file = url.file;
|
||||||
}
|
}
|
||||||
resultURI.path = resultURI.directory + resultURI.file;
|
resultURI.path = resultURI.directory + resultURI.file;
|
||||||
if(newURI.query != null) {
|
if(newURI.query != null) {
|
||||||
|
|
@ -1997,7 +2000,15 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
||||||
return mesh.geometry && !hasMaterialName && !hasTexture
|
return mesh.geometry && !hasMaterialName && !hasTexture
|
||||||
}
|
}
|
||||||
xrf.navigator = {URI:{}}
|
xrf.navigator = {
|
||||||
|
URI:{
|
||||||
|
scheme: document.location.protocol.replace(/:$/,''),
|
||||||
|
directory: document.location.pathname,
|
||||||
|
host: document.location.hostname,
|
||||||
|
port: document.location.port,
|
||||||
|
file: 'index.glb'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
xrf.navigator.to = (url,flags,loader,data) => {
|
xrf.navigator.to = (url,flags,loader,data) => {
|
||||||
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
||||||
|
|
@ -2109,7 +2120,6 @@ xrf.navigator.init = () => {
|
||||||
|
|
||||||
window.addEventListener('popstate', function (event){
|
window.addEventListener('popstate', function (event){
|
||||||
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
||||||
//xrf.navigator.to( document.location.search.substr(1) + document.location.hash )
|
|
||||||
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -2181,7 +2191,7 @@ xrf.navigator.reactifyHash = ( obj ) => {
|
||||||
toString(me){
|
toString(me){
|
||||||
let parts = []
|
let parts = []
|
||||||
Object.keys(me).map( (k) => {
|
Object.keys(me).map( (k) => {
|
||||||
parts.push( me[k] ? `${k}=${encodeURIComponent(me[k])}` : k )
|
parts.push( me[k] ? `${k}=${me[k]}` : k )
|
||||||
})
|
})
|
||||||
return parts.join('&')
|
return parts.join('&')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
dist/xrfragment.js
vendored
3
dist/xrfragment.js
vendored
|
|
@ -1208,6 +1208,7 @@ xrfragment_URI.parse = function(stringUrl,flags) {
|
||||||
if(url.directory == null && url.host != null) {
|
if(url.directory == null && url.host != null) {
|
||||||
url.file = url.host;
|
url.file = url.host;
|
||||||
}
|
}
|
||||||
|
url.host = "";
|
||||||
}
|
}
|
||||||
url.hash = { };
|
url.hash = { };
|
||||||
if(url.fragment != null && url.fragment.length > 0) {
|
if(url.fragment != null && url.fragment.length > 0) {
|
||||||
|
|
@ -1386,6 +1387,8 @@ xrfragment_URI.toAbsolute = function(url,newUrl) {
|
||||||
resultURI.directory = directory;
|
resultURI.directory = directory;
|
||||||
if(newURI.file != null) {
|
if(newURI.file != null) {
|
||||||
resultURI.file = newURI.file;
|
resultURI.file = newURI.file;
|
||||||
|
} else {
|
||||||
|
resultURI.file = url.file;
|
||||||
}
|
}
|
||||||
resultURI.path = resultURI.directory + resultURI.file;
|
resultURI.path = resultURI.directory + resultURI.file;
|
||||||
if(newURI.query != null) {
|
if(newURI.query != null) {
|
||||||
|
|
|
||||||
3
dist/xrfragment.lua
vendored
3
dist/xrfragment.lua
vendored
|
|
@ -3103,6 +3103,7 @@ __xrfragment_URI.parse = function(stringUrl,flags)
|
||||||
if ((url.directory == nil) and (url.host ~= nil)) then
|
if ((url.directory == nil) and (url.host ~= nil)) then
|
||||||
url.file = url.host;
|
url.file = url.host;
|
||||||
end;
|
end;
|
||||||
|
url.host = "";
|
||||||
end;
|
end;
|
||||||
url.hash = _hx_e();
|
url.hash = _hx_e();
|
||||||
if ((url.fragment ~= nil) and (__lua_lib_luautf8_Utf8.len(url.fragment) > 0)) then
|
if ((url.fragment ~= nil) and (__lua_lib_luautf8_Utf8.len(url.fragment) > 0)) then
|
||||||
|
|
@ -3406,6 +3407,8 @@ __xrfragment_URI.toAbsolute = function(url,newUrl)
|
||||||
resultURI.directory = directory;
|
resultURI.directory = directory;
|
||||||
if (newURI.file ~= nil) then
|
if (newURI.file ~= nil) then
|
||||||
resultURI.file = newURI.file;
|
resultURI.file = newURI.file;
|
||||||
|
else
|
||||||
|
resultURI.file = url.file;
|
||||||
end;
|
end;
|
||||||
resultURI.path = Std.string(resultURI.directory) .. Std.string(resultURI.file);
|
resultURI.path = Std.string(resultURI.directory) .. Std.string(resultURI.file);
|
||||||
if (newURI.query ~= nil) then
|
if (newURI.query ~= nil) then
|
||||||
|
|
|
||||||
3153
dist/xrfragment.module.js
vendored
3153
dist/xrfragment.module.js
vendored
File diff suppressed because it is too large
Load diff
6
dist/xrfragment.plugin.frontend.js
vendored
6
dist/xrfragment.plugin.frontend.js
vendored
|
|
@ -777,10 +777,10 @@ window.frontend = (opts) => new Proxy({
|
||||||
|
|
||||||
share(opts){
|
share(opts){
|
||||||
opts = opts || {notify:true,qr:true,share:true,linkonly:false}
|
opts = opts || {notify:true,qr:true,share:true,linkonly:false}
|
||||||
if( network.meetingLink && !document.location.hash.match(/meet=/) ){
|
if( network.meetingLink && !xrf.navigator.URI.hash.meet ){
|
||||||
document.location.hash += `&meet=${network.meetingLink}`
|
xrf.navigator.URI.hash.meet = network.meetingLink
|
||||||
}
|
}
|
||||||
if( !document.location.hash.match(/pos=/) && (network.posName || network.pos) ){
|
if( !xrf.navigator.URI.hash.pos && (network.posName || network.pos) ){
|
||||||
xrf.navigator.URI.hash.pos = network.posName || network.pos
|
xrf.navigator.URI.hash.pos = network.posName || network.pos
|
||||||
}else frontend.updateHashPosition()
|
}else frontend.updateHashPosition()
|
||||||
|
|
||||||
|
|
|
||||||
3
dist/xrfragment.plugin.matrix.js
vendored
3
dist/xrfragment.plugin.matrix.js
vendored
|
|
@ -295,12 +295,11 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
createLink(opts){
|
createLink(opts){
|
||||||
let hash = document.location.hash
|
|
||||||
if( !this.link ){
|
if( !this.link ){
|
||||||
const meeting = network.getMeetingFromUrl(document.location.href)
|
const meeting = network.getMeetingFromUrl(document.location.href)
|
||||||
this.link = network.meetingLink = meeting.match("matrix://") ? meeting : ''
|
this.link = network.meetingLink = meeting.match("matrix://") ? meeting : ''
|
||||||
}
|
}
|
||||||
if( !hash.match('meet=') ) document.location.hash += `${hash.length > 1 ? '&' : '#'}meet=${this.link}`
|
if( !xrf.navigator.URI.hash.meet ) xrf.navigator.URI.hash.meet = this.link
|
||||||
},
|
},
|
||||||
|
|
||||||
reactToConnectionHrefs(){
|
reactToConnectionHrefs(){
|
||||||
|
|
|
||||||
6
dist/xrfragment.plugin.network.js
vendored
6
dist/xrfragment.plugin.network.js
vendored
|
|
@ -349,7 +349,7 @@ connectionsComponent = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// reactify component!
|
// reactify component!
|
||||||
document.addEventListener('$menu:ready', (opts) => {
|
document.addEventListener('$chat:ready', (opts) => {
|
||||||
opts = opts.detail
|
opts = opts.detail
|
||||||
document.head.innerHTML += connectionsComponent.css
|
document.head.innerHTML += connectionsComponent.css
|
||||||
window.$connections = document.createElement('div')
|
window.$connections = document.createElement('div')
|
||||||
|
|
@ -488,7 +488,7 @@ chatComponent = {
|
||||||
br.classList.add.apply(br.classList, opts.class)
|
br.classList.add.apply(br.classList, opts.class)
|
||||||
div.classList.add.apply(div.classList, opts.class.concat(["envelope"]))
|
div.classList.add.apply(div.classList, opts.class.concat(["envelope"]))
|
||||||
}
|
}
|
||||||
if( !msg.className.match(/(info|guide|ui)/) ){
|
if( msg.className.match(/(info|guide|ui)/) || !opts.from ){
|
||||||
let frag = xrf.URI.parse(document.location.hash).XRF
|
let frag = xrf.URI.parse(document.location.hash).XRF
|
||||||
opts.from = 'you'
|
opts.from = 'you'
|
||||||
if( frag.pos ) opts.pos = frag.pos.string
|
if( frag.pos ) opts.pos = frag.pos.string
|
||||||
|
|
@ -570,7 +570,7 @@ chatComponent.css = `
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin: 15px;
|
margin: 15px;
|
||||||
z-index:1500;
|
z-index:1000;
|
||||||
}
|
}
|
||||||
#videos > video{
|
#videos > video{
|
||||||
border-radius:7px;
|
border-radius:7px;
|
||||||
|
|
|
||||||
12
dist/xrfragment.plugin.p2p.js
vendored
12
dist/xrfragment.plugin.p2p.js
vendored
|
|
@ -53,14 +53,10 @@ window.trystero = (opts) => new Proxy({
|
||||||
$connections.webcam = $connections.webcam.concat([this])
|
$connections.webcam = $connections.webcam.concat([this])
|
||||||
$connections.chatnetwork = $connections.chatnetwork.concat([this])
|
$connections.chatnetwork = $connections.chatnetwork.concat([this])
|
||||||
$connections.scene = $connections.scene.concat([this])
|
$connections.scene = $connections.scene.concat([this])
|
||||||
if( localStorage.getItem("selfId") ){
|
this.selfId = selfId // selfId is a trystero global (unique per session)
|
||||||
this.selfId = localStorage.getItem("selfId")
|
|
||||||
}else{
|
|
||||||
this.selfId = String(Math.random()).substr(2)
|
|
||||||
localStorage.setItem("selfId",this.selfId)
|
|
||||||
}
|
|
||||||
this.reactToConnectionHrefs()
|
this.reactToConnectionHrefs()
|
||||||
this.nickname = localStorage.getItem("nickname") || `human${String(Math.random()).substr(5,4)}`
|
this.nickname = localStorage.getItem("nickname") || `human${String(Math.random()).substr(5,4)}`
|
||||||
|
this.names[ this.selfId ] = this.nickname
|
||||||
document.addEventListener('network.connect', (e) => this.connect(e.detail) )
|
document.addEventListener('network.connect', (e) => this.connect(e.detail) )
|
||||||
document.addEventListener('network.init', () => {
|
document.addEventListener('network.init', () => {
|
||||||
let meeting = network.getMeetingFromUrl(document.location.href)
|
let meeting = network.getMeetingFromUrl(document.location.href)
|
||||||
|
|
@ -74,7 +70,6 @@ window.trystero = (opts) => new Proxy({
|
||||||
if( !this.connected ){
|
if( !this.connected ){
|
||||||
this.connected = true
|
this.connected = true
|
||||||
frontend.emit('network.connected',{plugin:this,username: this.nickname})
|
frontend.emit('network.connected',{plugin:this,username: this.nickname})
|
||||||
this.names[ this.selfId ] = this.nickname
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -210,12 +205,11 @@ window.trystero = (opts) => new Proxy({
|
||||||
send(opts){ $chat.send({...opts, source: 'trystero'}) },
|
send(opts){ $chat.send({...opts, source: 'trystero'}) },
|
||||||
|
|
||||||
createLink(opts){
|
createLink(opts){
|
||||||
let hash = document.location.hash
|
|
||||||
if( !this.link ){
|
if( !this.link ){
|
||||||
const meeting = network.getMeetingFromUrl(document.location.href)
|
const meeting = network.getMeetingFromUrl(document.location.href)
|
||||||
this.link = network.meetingLink = meeting.match("trystero://") ? meeting : `trystero://r/${network.randomRoom()}:bittorrent`
|
this.link = network.meetingLink = meeting.match("trystero://") ? meeting : `trystero://r/${network.randomRoom()}:bittorrent`
|
||||||
}
|
}
|
||||||
if( !hash.match('meet=') ) document.location.hash += `${hash.length > 1 ? '&' : '#'}meet=${this.link}`
|
if( !xrf.navigator.URI.hash.meet ) xrf.navigator.URI.hash.meet = this.link
|
||||||
},
|
},
|
||||||
|
|
||||||
config(opts){
|
config(opts){
|
||||||
|
|
|
||||||
3
dist/xrfragment.py
vendored
3
dist/xrfragment.py
vendored
|
|
@ -2404,6 +2404,7 @@ class xrfragment_URI:
|
||||||
if (xrfragment_URI.isRelative(url) == True):
|
if (xrfragment_URI.isRelative(url) == True):
|
||||||
if ((url.directory is None) and ((url.host is not None))):
|
if ((url.directory is None) and ((url.host is not None))):
|
||||||
url.file = url.host
|
url.file = url.host
|
||||||
|
url.host = ""
|
||||||
url.hash = _hx_AnonObject({})
|
url.hash = _hx_AnonObject({})
|
||||||
if ((url.fragment is not None) and ((len(url.fragment) > 0))):
|
if ((url.fragment is not None) and ((len(url.fragment) > 0))):
|
||||||
url.XRF = xrfragment_URI.parseFragment(("#" + HxOverrides.stringOrNull(url.fragment)),flags)
|
url.XRF = xrfragment_URI.parseFragment(("#" + HxOverrides.stringOrNull(url.fragment)),flags)
|
||||||
|
|
@ -2579,6 +2580,8 @@ class xrfragment_URI:
|
||||||
resultURI.directory = directory
|
resultURI.directory = directory
|
||||||
if (newURI.file is not None):
|
if (newURI.file is not None):
|
||||||
resultURI.file = newURI.file
|
resultURI.file = newURI.file
|
||||||
|
else:
|
||||||
|
resultURI.file = url.file
|
||||||
resultURI.path = (HxOverrides.stringOrNull(resultURI.directory) + HxOverrides.stringOrNull(resultURI.file))
|
resultURI.path = (HxOverrides.stringOrNull(resultURI.directory) + HxOverrides.stringOrNull(resultURI.file))
|
||||||
if (newURI.query is not None):
|
if (newURI.query is not None):
|
||||||
resultURI.query = newURI.query
|
resultURI.query = newURI.query
|
||||||
|
|
|
||||||
18
dist/xrfragment.three.js
vendored
18
dist/xrfragment.three.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Tue Apr 16 12:47:01 PM UTC 2024
|
* v0.5.1 generated at Tue Apr 16 04:44:20 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1213,6 +1213,7 @@ xrfragment_URI.parse = function(stringUrl,flags) {
|
||||||
if(url.directory == null && url.host != null) {
|
if(url.directory == null && url.host != null) {
|
||||||
url.file = url.host;
|
url.file = url.host;
|
||||||
}
|
}
|
||||||
|
url.host = "";
|
||||||
}
|
}
|
||||||
url.hash = { };
|
url.hash = { };
|
||||||
if(url.fragment != null && url.fragment.length > 0) {
|
if(url.fragment != null && url.fragment.length > 0) {
|
||||||
|
|
@ -1391,6 +1392,8 @@ xrfragment_URI.toAbsolute = function(url,newUrl) {
|
||||||
resultURI.directory = directory;
|
resultURI.directory = directory;
|
||||||
if(newURI.file != null) {
|
if(newURI.file != null) {
|
||||||
resultURI.file = newURI.file;
|
resultURI.file = newURI.file;
|
||||||
|
} else {
|
||||||
|
resultURI.file = url.file;
|
||||||
}
|
}
|
||||||
resultURI.path = resultURI.directory + resultURI.file;
|
resultURI.path = resultURI.directory + resultURI.file;
|
||||||
if(newURI.query != null) {
|
if(newURI.query != null) {
|
||||||
|
|
@ -1997,7 +2000,15 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
||||||
return mesh.geometry && !hasMaterialName && !hasTexture
|
return mesh.geometry && !hasMaterialName && !hasTexture
|
||||||
}
|
}
|
||||||
xrf.navigator = {URI:{}}
|
xrf.navigator = {
|
||||||
|
URI:{
|
||||||
|
scheme: document.location.protocol.replace(/:$/,''),
|
||||||
|
directory: document.location.pathname,
|
||||||
|
host: document.location.hostname,
|
||||||
|
port: document.location.port,
|
||||||
|
file: 'index.glb'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
xrf.navigator.to = (url,flags,loader,data) => {
|
xrf.navigator.to = (url,flags,loader,data) => {
|
||||||
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
||||||
|
|
@ -2109,7 +2120,6 @@ xrf.navigator.init = () => {
|
||||||
|
|
||||||
window.addEventListener('popstate', function (event){
|
window.addEventListener('popstate', function (event){
|
||||||
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
||||||
//xrf.navigator.to( document.location.search.substr(1) + document.location.hash )
|
|
||||||
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -2181,7 +2191,7 @@ xrf.navigator.reactifyHash = ( obj ) => {
|
||||||
toString(me){
|
toString(me){
|
||||||
let parts = []
|
let parts = []
|
||||||
Object.keys(me).map( (k) => {
|
Object.keys(me).map( (k) => {
|
||||||
parts.push( me[k] ? `${k}=${encodeURIComponent(me[k])}` : k )
|
parts.push( me[k] ? `${k}=${me[k]}` : k )
|
||||||
})
|
})
|
||||||
return parts.join('&')
|
return parts.join('&')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
dist/xrfragment.three.module.js
vendored
18
dist/xrfragment.three.module.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* v0.5.1 generated at Tue Apr 16 12:47:01 PM UTC 2024
|
* v0.5.1 generated at Tue Apr 16 04:44:20 PM UTC 2024
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1213,6 +1213,7 @@ xrfragment_URI.parse = function(stringUrl,flags) {
|
||||||
if(url.directory == null && url.host != null) {
|
if(url.directory == null && url.host != null) {
|
||||||
url.file = url.host;
|
url.file = url.host;
|
||||||
}
|
}
|
||||||
|
url.host = "";
|
||||||
}
|
}
|
||||||
url.hash = { };
|
url.hash = { };
|
||||||
if(url.fragment != null && url.fragment.length > 0) {
|
if(url.fragment != null && url.fragment.length > 0) {
|
||||||
|
|
@ -1391,6 +1392,8 @@ xrfragment_URI.toAbsolute = function(url,newUrl) {
|
||||||
resultURI.directory = directory;
|
resultURI.directory = directory;
|
||||||
if(newURI.file != null) {
|
if(newURI.file != null) {
|
||||||
resultURI.file = newURI.file;
|
resultURI.file = newURI.file;
|
||||||
|
} else {
|
||||||
|
resultURI.file = url.file;
|
||||||
}
|
}
|
||||||
resultURI.path = resultURI.directory + resultURI.file;
|
resultURI.path = resultURI.directory + resultURI.file;
|
||||||
if(newURI.query != null) {
|
if(newURI.query != null) {
|
||||||
|
|
@ -1997,7 +2000,15 @@ xrf.hasNoMaterial = (mesh) => {
|
||||||
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
const hasMaterialName = mesh.material && mesh.material.name.length > 0
|
||||||
return mesh.geometry && !hasMaterialName && !hasTexture
|
return mesh.geometry && !hasMaterialName && !hasTexture
|
||||||
}
|
}
|
||||||
xrf.navigator = {URI:{}}
|
xrf.navigator = {
|
||||||
|
URI:{
|
||||||
|
scheme: document.location.protocol.replace(/:$/,''),
|
||||||
|
directory: document.location.pathname,
|
||||||
|
host: document.location.hostname,
|
||||||
|
port: document.location.port,
|
||||||
|
file: 'index.glb'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
xrf.navigator.to = (url,flags,loader,data) => {
|
xrf.navigator.to = (url,flags,loader,data) => {
|
||||||
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
if( !url ) throw 'xrf.navigator.to(..) no url given'
|
||||||
|
|
@ -2109,7 +2120,6 @@ xrf.navigator.init = () => {
|
||||||
|
|
||||||
window.addEventListener('popstate', function (event){
|
window.addEventListener('popstate', function (event){
|
||||||
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
if( !xrf.navigator.updateHash.active ){ // ignore programmatic hash updates (causes infinite recursion)
|
||||||
//xrf.navigator.to( document.location.search.substr(1) + document.location.hash )
|
|
||||||
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
xrf.navigator.to( document.location.href.replace(/\?/,'') )
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -2181,7 +2191,7 @@ xrf.navigator.reactifyHash = ( obj ) => {
|
||||||
toString(me){
|
toString(me){
|
||||||
let parts = []
|
let parts = []
|
||||||
Object.keys(me).map( (k) => {
|
Object.keys(me).map( (k) => {
|
||||||
parts.push( me[k] ? `${k}=${encodeURIComponent(me[k])}` : k )
|
parts.push( me[k] ? `${k}=${me[k]}` : k )
|
||||||
})
|
})
|
||||||
return parts.join('&')
|
return parts.join('&')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue