mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 13:53:38 +02:00
Refactor
This commit is contained in:
parent
5445d6f670
commit
afa8e44e66
1 changed files with 5 additions and 4 deletions
|
@ -55,9 +55,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isHttp(str) {
|
function toUrl(resource) {
|
||||||
var httpPattern = /^http/i;
|
var httpPattern = /^http/i;
|
||||||
return httpPattern.test(str);
|
return httpPattern.test(str) ? resource : "file:///" + resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
@ -89,9 +89,10 @@ Rectangle {
|
||||||
MyAvatar.useFullAvatarURL(resource);
|
MyAvatar.useFullAvatarURL(resource);
|
||||||
break;
|
break;
|
||||||
case "content set":
|
case "content set":
|
||||||
resource = isHttp(resource) ? resource : "file:///" + resource;
|
|
||||||
urlHandler.handleUrl("hifi://localhost/0,0,0");
|
urlHandler.handleUrl("hifi://localhost/0,0,0");
|
||||||
Commerce.replaceContentSet(resource, "");
|
Commerce.replaceContentSet(toUrl(resource), "");
|
||||||
|
break;
|
||||||
|
case "entity":
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// XXX support other resource types here.
|
// XXX support other resource types here.
|
||||||
|
|
Loading…
Reference in a new issue