From fc78d0582ec250f24c9413e4c1d9689caa04acb1 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 28 Sep 2018 10:18:00 +1200 Subject: [PATCH] Tidying --- .../{assets/images => html/img}/expand.svg | 0 scripts/system/html/js/miniTablet.js | 9 ------- scripts/system/html/miniTablet.html | 2 +- scripts/system/miniTablet.js | 26 ++----------------- 4 files changed, 3 insertions(+), 34 deletions(-) rename scripts/system/{assets/images => html/img}/expand.svg (100%) diff --git a/scripts/system/assets/images/expand.svg b/scripts/system/html/img/expand.svg similarity index 100% rename from scripts/system/assets/images/expand.svg rename to scripts/system/html/img/expand.svg diff --git a/scripts/system/html/js/miniTablet.js b/scripts/system/html/js/miniTablet.js index e44a454a80..c48201cef5 100644 --- a/scripts/system/html/js/miniTablet.js +++ b/scripts/system/html/js/miniTablet.js @@ -32,7 +32,6 @@ // Work around buttons staying hovered when mini tablet is replaced by tablet proper then subsequently redisplayed. isUnhover = true; - // #region Utilites ======================================================================================================== function setUnhover() { if (!isUnhover) { @@ -50,9 +49,6 @@ } } - // #endregion - - // #region Communications ================================================================================================== function onScriptEventReceived(data) { var message; @@ -127,9 +123,6 @@ EventBridge.scriptEventReceived.disconnect(onScriptEventReceived); } - // #endregion - - // #region Set-up and tear-down ============================================================================================ function onUnload() { disconnectEventBridge(); @@ -161,6 +154,4 @@ onLoad(); - // #endregion - }()); diff --git a/scripts/system/html/miniTablet.html b/scripts/system/html/miniTablet.html index f0ef7cd609..69703f6d2e 100644 --- a/scripts/system/html/miniTablet.html +++ b/scripts/system/html/miniTablet.html @@ -24,7 +24,7 @@ See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.
- +
diff --git a/scripts/system/miniTablet.js b/scripts/system/miniTablet.js index 8436e36087..0893108109 100644 --- a/scripts/system/miniTablet.js +++ b/scripts/system/miniTablet.js @@ -32,7 +32,6 @@ tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"), DEBUG = false; - // #region Utilities ======================================================================================================= function debug(message) { if (!DEBUG) { @@ -75,9 +74,6 @@ return hand === LEFT_HAND ? RIGHT_HAND : LEFT_HAND; } - // #endregion - - // #region UI ============================================================================================================== UI = function () { @@ -511,9 +507,6 @@ }; - // #endregion - - // #region State Machine =================================================================================================== State = function () { @@ -535,8 +528,6 @@ STATE_MACHINE, miniState = MINI_DISABLED, miniHand, - updateTimer = null, - UPDATE_INTERVAL = 25, // Mini tablet scaling. MINI_SCALE_DURATION = 250, @@ -572,10 +563,7 @@ function enterMiniDisabled() { // Stop updates. - if (updateTimer !== null) { - Script.clearTimeout(updateTimer); - updateTimer = null; - } + Script.update.disconnect(updateState); // Stop monitoring mute changes. Audio.mutedChanged.disconnect(ui.updateMutedStatus); @@ -593,7 +581,7 @@ Audio.mutedChanged.connect(ui.updateMutedStatus); // Start updates. - updateTimer = Script.setTimeout(updateState, UPDATE_INTERVAL); + Script.update.connect(updateState); } function shouldShowMini(hand) { @@ -943,7 +931,6 @@ if (STATE_MACHINE[STATE_STRINGS[miniState]].update) { STATE_MACHINE[STATE_STRINGS[miniState]].update(); } - updateTimer = Script.setTimeout(updateState, UPDATE_INTERVAL); } function create() { @@ -966,7 +953,6 @@ MINI_VISIBLE: MINI_VISIBLE, MINI_EXPANDING: MINI_EXPANDING, TABLET_OPEN: TABLET_OPEN, - updateState: updateState, setState: setState, getState: getState, getHand: getHand, @@ -974,9 +960,6 @@ }; }; - // #endregion - - // #region External Events ================================================================================================= function onMessageReceived(channel, data, senderID, localOnly) { var message, @@ -1021,9 +1004,6 @@ } } - // #endregion - - // #region Set-up and tear-down ============================================================================================ function setUp() { miniState = new State(); @@ -1054,6 +1034,4 @@ setUp(); Script.scriptEnding.connect(tearDown); - // #endregion - }());