From 0add5274acde04d5654c6bb11b44e543ff8defd9 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 15 Dec 2016 16:50:20 -0800 Subject: [PATCH] Add tabletTest.js to test adding and removing buttons from tablet UI --- scripts/developer/tests/tabletTest.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 scripts/developer/tests/tabletTest.js diff --git a/scripts/developer/tests/tabletTest.js b/scripts/developer/tests/tabletTest.js new file mode 100644 index 0000000000..6f101beb8b --- /dev/null +++ b/scripts/developer/tests/tabletTest.js @@ -0,0 +1,26 @@ +// +// tabletTest.js +// +// Created by Anthony J. Thibault on 2016-12-15 +// 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 +// + +// Adds a BAM! button to the tablet ui. + +var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var button = tablet.addButton({ + icon: "https://s3.amazonaws.com/hifi-public/tony/icons/hat-up.svg", + color: "#ff6f6f", + text: "BAM!!!" +}); + +button.clicked.connect(function () { + print("AJT: BAMM!!! CLICK from JS!"); +}); + +Script.scriptEnding.connect(function () { + tablet.removeButton(button); +});