created a friends button for metaverse friends page

This commit is contained in:
Faye Li 2017-01-25 11:41:07 -08:00
parent f8162970ec
commit c7a0e609fc
2 changed files with 34 additions and 0 deletions

View file

@ -15,6 +15,7 @@ var DEFAULT_SCRIPTS = [
"system/progress.js",
"system/away.js",
"system/users.js",
"system/friends.js",
"system/mute.js",
"system/goto.js",
"system/hmd.js",

33
scripts/system/friends.js Normal file
View file

@ -0,0 +1,33 @@
"use strict";
//
// friends.js
//
// Created by Faye Li on 25 Jan 2017.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function() { // BEGIN LOCAL_SCOPE
var FRIENDS_URL = "https://metaverse.highfidelity.com/user/friends";
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
var button = tablet.addButton({
icon: "icons/tablet-icons/people-i.svg",
text: "Friends"
});
function onClicked() {
tablet.gotoWebScreen(FRIENDS_URL);
}
button.clicked.connect(onClicked);
function cleanup() {
button.clicked.disconnect(onClicked);
tablet.removeButton(button);
}
Script.scriptEnding.connect(cleanup);
}()); // END LOCAL_SCOPE