mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 03:06:20 +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;
|
||||
return httpPattern.test(str);
|
||||
return httpPattern.test(str) ? resource : "file:///" + resource;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
@ -89,9 +89,10 @@ Rectangle {
|
|||
MyAvatar.useFullAvatarURL(resource);
|
||||
break;
|
||||
case "content set":
|
||||
resource = isHttp(resource) ? resource : "file:///" + resource;
|
||||
urlHandler.handleUrl("hifi://localhost/0,0,0");
|
||||
Commerce.replaceContentSet(resource, "");
|
||||
Commerce.replaceContentSet(toUrl(resource), "");
|
||||
break;
|
||||
case "entity":
|
||||
break;
|
||||
}
|
||||
// XXX support other resource types here.
|
||||
|
|
Loading…
Reference in a new issue