main: minor bugfix
This commit is contained in:
parent
0a931a8242
commit
ec1e583c11
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ){
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue