From c7a0e609fc9d10aac529621211cff16a5559041c Mon Sep 17 00:00:00 2001 From: Faye Li Date: Wed, 25 Jan 2017 11:41:07 -0800 Subject: [PATCH] created a friends button for metaverse friends page --- scripts/defaultScripts.js | 1 + scripts/system/friends.js | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 scripts/system/friends.js diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index bd3131f4ff..2b52dae9b2 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -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", diff --git a/scripts/system/friends.js b/scripts/system/friends.js new file mode 100644 index 0000000000..6afef1579f --- /dev/null +++ b/scripts/system/friends.js @@ -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