diff --git a/src/3rd/js/three/navigator.js b/src/3rd/js/three/navigator.js index de21129..2e60ecb 100644 --- a/src/3rd/js/three/navigator.js +++ b/src/3rd/js/three/navigator.js @@ -23,8 +23,9 @@ xrf.navigator.to = (url,flags,loader,data) => { URI.duplicatePos = URI.source == xrf.navigator.URI.source && URI.hasPos URI.hashChange = String(xrf.navigator.URI.fragment||"") != String(URI.fragment||"") let hashbus = xrf.hashbus - console.dir({URI1:xrf.navigator.URI,URI2:URI}) - debugger + + //console.dir({URI1:xrf.navigator.URI,URI2:URI}) + xrf.navigator.URI = URI let {directory,file,fragment,fileExt} = URI; diff --git a/src/3rd/js/three/xrf/src.js b/src/3rd/js/three/xrf/src.js index 849f54d..d8f60d1 100644 --- a/src/3rd/js/three/xrf/src.js +++ b/src/3rd/js/three/xrf/src.js @@ -6,18 +6,20 @@ xrf.frag.src = function(v, opts){ if( mesh.isSRC ) return // only embed src once - // correct for relative urls - if( v.string.charAt(0) != '#' && xrf.URI.isRelative( xrf.URI.parse( v.string ) ) ){ - v.string = xrf.navigator.URI.URN + v.string - } - - let url = xrf.frag.src.expandURI( mesh, v.string ) - let srcFrag = opts.srcFrag = xrfragment.URI.parse(url).XRF - opts.isLocal = v.string[0] == '#' opts.isPortal = xrf.frag.src.renderAsPortal(mesh) opts.isSRC = mesh.isSRC = true + // correct for relative urls + let url = v.string + if( v.string.charAt(0) != '#' && xrf.URI.isRelative( xrf.URI.parse( v.string ) ) ){ + url = xrf.navigator.URI.URN + v.string + } + url = xrf.frag.src.expandURI( mesh, url ) + + let srcFrag = opts.srcFrag = xrfragment.URI.parse(url).XRF + + if(xrf.debug) console.log(`src.js: instancing ${opts.isLocal?'local':'remote'} object ${url}`) if( opts.isLocal ){ diff --git a/src/xrfragment/URI.hx b/src/xrfragment/URI.hx index 9bb3f24..d7860b7 100644 --- a/src/xrfragment/URI.hx +++ b/src/xrfragment/URI.hx @@ -431,7 +431,7 @@ class URI { directory = url.directory; } - if (newURI.directory != null && newURI.source.charAt(0) != "#") + if (newURI.directory != null && newURI.source.charAt(0) != "#" && newURI.directory.length > 0) { if( newUrl.charAt(0) != '/' && newUrl.indexOf("://") == -1 ){ var stripRelative : EReg = ~/\.\/.*/; @@ -444,15 +444,12 @@ class URI { resultURI.directory = directory; - trace("1:"+newURI.file); - trace("2:"+url.file); - if (newURI.file != null) + if (newURI.file != null && newURI.file.length > 0) { resultURI.file = newURI.file; }else{ resultURI.file = url.file; } - trace("3:"+resultURI.file); resultURI.path = resultURI.directory + resultURI.file;