From 4eea4980fd8dc1c36d2fae53007c9e3df3f0156b Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Wed, 11 Mar 2020 14:59:35 -0400 Subject: [PATCH] Lint + fix default apps per page + fix script list loading bug. --- scripts/system/more/app-more.js | 16 +++--- scripts/system/more/more.html | 95 ++++++++++++++++++--------------- 2 files changed, 57 insertions(+), 54 deletions(-) diff --git a/scripts/system/more/app-more.js b/scripts/system/more/app-more.js index ba8f3c24c1..915ab841e7 100644 --- a/scripts/system/more/app-more.js +++ b/scripts/system/more/app-more.js @@ -6,16 +6,12 @@ // Created by Keb Helion, February 2020. // Copyright 2020 Project Athena and contributors. // -// App maintained in: https://github.com/kasenvr/community-apps -// App copied to: https://github.com/kasenvr/project-athena -// // This script adds a "More Apps" selector to "Project Athena" to allow the user to add optional functionalities to the tablet. // This application has been designed to work directly from the Github repository. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - +// (function() { var ROOT = Script.resolvePath('').split("app-more.js")[0]; var APP_NAME = "MORE..."; @@ -38,7 +34,7 @@ function clicked() { - if (Appstatus) { + if (Appstatus == true) { tablet.webEventReceived.disconnect(onMoreAppWebEventReceived); tablet.gotoHomeScreen(); Appstatus = false; @@ -64,14 +60,14 @@ function onMoreAppWebEventReceived(eventz) { if (typeof eventz === "string") { - eventzget = JSON.parse(eventz); + var eventzget = JSON.parse(eventz); //print("EVENT ACTION: " + eventzget.action); //print("EVENT SCRIPT: " + eventzget.script); if (eventzget.action === "installScript") { - if (lastProcessing.action === eventzget.action && lastProcessing.script === eventzget.script) { + if (lastProcessing.action == eventzget.action && lastProcessing.script == eventzget.script) { return; } else { ScriptDiscoveryService.loadOneScript(eventzget.script); @@ -87,7 +83,7 @@ if (eventzget.action === "uninstallScript") { - if (lastProcessing.action === eventzget.action && lastProcessing.script === eventzget.script) { + if (lastProcessing.action == eventzget.action && lastProcessing.script == eventzget.script) { return; } else { ScriptDiscoveryService.stopScript(eventzget.script, false); @@ -111,7 +107,7 @@ function onScreenChanged(type, url) { - if (type === "Web" && url.indexOf(APP_URL) !== -1) { + if (type == "Web" && url.indexOf(APP_URL) != -1) { //Active //print("MORE... ACTIVE"); Appstatus = true; diff --git a/scripts/system/more/more.html b/scripts/system/more/more.html index c93f884700..0bebaf9522 100644 --- a/scripts/system/more/more.html +++ b/scripts/system/more/more.html @@ -7,6 +7,7 @@ // App maintained in: https://github.com/kasenvr/community-apps // App copied to: https://github.com/kasenvr/project-athena // +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html --> @@ -14,20 +15,29 @@ +