overte/scripts/system/quickGoto.js

37 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

2019-02-06 11:22:23 -08:00
"use strict";
//
// quickGoto.js
// scripts/system/
//
// Created by Dante Ruiz
// Copyright 2016 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
//
/* globals Tablet, Toolbars, Script, HMD, DialogsManager */
(function() { // BEGIN LOCAL_SCOPE
function addGotoButton(destination) {
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
button = tablet.addButton({
icon: "icons/tablet-icons/goto-i.svg",
activeIcon: "icons/tablet-icons/goto-a.svg",
text: destination
});
var buttonDestination = destination;
button.clicked.connect(function() {
Window.location = "hifi://" + buttonDestination;
});
Script.scriptEnding.connect(function () {
tablet.removeButton(button);
});
}
addGotoButton("hub.daleglass.net");
2020-08-19 16:47:04 -07:00
addGotoButton("file:///~/serverless/tutorial.json");
2019-02-06 11:22:23 -08:00
}()); // END LOCAL_SCOPE