diff --git a/scripts/system/more/app-more.js b/scripts/system/more/app-more.js index d38befd501..99b359d9e8 100644 --- a/scripts/system/more/app-more.js +++ b/scripts/system/more/app-more.js @@ -18,7 +18,7 @@ var APP_URL = ROOT + "more.html"; var APP_ICON_INACTIVE = ROOT + "appicon_i.png"; var APP_ICON_ACTIVE = ROOT + "appicon_a.png"; - var Appstatus = false; + var appStatus = false; var lastProcessing = { "action": "", "script": "" @@ -30,24 +30,21 @@ text: APP_NAME, icon: APP_ICON_INACTIVE, activeIcon: APP_ICON_ACTIVE - }); - + }); function clicked() { - if (Appstatus) { + if (appStatus) { tablet.webEventReceived.disconnect(onMoreAppWebEventReceived); tablet.gotoHomeScreen(); - Appstatus = false; + appStatus = false; } else { - tablet.gotoWebScreen(APP_URL); - tablet.webEventReceived.connect(onMoreAppWebEventReceived); - Appstatus = true; + tablet.gotoWebScreen(APP_URL); + tablet.webEventReceived.connect(onMoreAppWebEventReceived); + appStatus = true; } - button.editProperties({ - isActive: Appstatus + isActive: appStatus }); - } button.clicked.connect(clicked); @@ -59,87 +56,63 @@ for (var j = 0; j < currentlyRunningScripts.length; j++) { runningScriptJson = currentlyRunningScripts[j].url; if (runningScriptJson.indexOf("https://kasenvr.github.io/community-apps/applications") !== -1) { - newMessage = newMessage + "_" + runningScriptJson; + newMessage += "_" + runningScriptJson; } } - tablet.emitScriptEvent(newMessage); } - function onMoreAppWebEventReceived(eventz) { - - if (typeof eventz === "string") { - 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) { - return; - } else { - ScriptDiscoveryService.loadOneScript(eventzget.script); - - lastProcessing.action = eventzget.action; - lastProcessing.script = eventzget.script; - + function onMoreAppWebEventReceived(message) { + if (typeof message === "string") { + var instruction = JSON.parse(message); + + if (instruction.action === "installScript") { + if (lastProcessing.action !== instruction.action || lastProcessing.script !== instruction.script) { + ScriptDiscoveryService.loadOneScript(instruction.script); + lastProcessing.action = instruction.action; + lastProcessing.script = instruction.script; Script.setTimeout(function() { sendRunningScriptList(); }, 1500); } } - if (eventzget.action === "uninstallScript") { - - if (lastProcessing.action === eventzget.action && lastProcessing.script === eventzget.script) { - return; - } else { - ScriptDiscoveryService.stopScript(eventzget.script, false); - - lastProcessing.action = eventzget.action; - lastProcessing.script = eventzget.script; - + if (instruction.action === "uninstallScript") { + if (lastProcessing.action !== instruction.action || lastProcessing.script !== instruction.script) { + ScriptDiscoveryService.stopScript(instruction.script, false); + lastProcessing.action = instruction.action; + lastProcessing.script = instruction.script; Script.setTimeout(function() { sendRunningScriptList(); }, 1500); - } - } + } + } - if (eventzget.action === "requestRunningScriptData") { + if (instruction.action === "requestRunningScriptData") { sendRunningScriptList(); - } - + } } - } - function onScreenChanged(type, url) { if (type === "Web" && url.indexOf(APP_URL) !== -1) { - //Active - //print("MORE... ACTIVE"); - Appstatus = true; + appStatus = true; } else { - //Inactive - //print("MORE... INACTIVE"); - Appstatus = false; - } - + appStatus = false; + } button.editProperties({ - isActive: Appstatus + isActive: appStatus }); } - - + function cleanup() { - if (Appstatus) { + if (appStatus) { tablet.gotoHomeScreen(); tablet.webEventReceived.disconnect(onMoreAppWebEventReceived); } tablet.screenChanged.disconnect(onScreenChanged); tablet.removeButton(button); } - + Script.scriptEnding.connect(cleanup); -}()); \ No newline at end of file +}()); diff --git a/scripts/system/more/css/styles.css b/scripts/system/more/css/styles.css index 4141b4927e..1f9aba0695 100644 --- a/scripts/system/more/css/styles.css +++ b/scripts/system/more/css/styles.css @@ -3,7 +3,7 @@ Created by Kalila L. on 23 Feb 2020. Copyright 2020 Project Athena and contributors. - + Distributed under the Apache License, Version 2.0. See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html */ @@ -20,7 +20,7 @@ body { text-transform: none; } -h1 { +font.mainTitle { font-family: 'Quicksand', sans-serif; font-size: 28px; color: #ffffff; @@ -33,7 +33,9 @@ h1 { } p.mainDesc { - font-size: 16px; + font-family: 'Merriweather', sans-serif; + font-size: 14px; + font-weight: 500; } p a { @@ -181,4 +183,4 @@ input.searchtextbox{ text-decoration: none; border: 0px; outline-color: #ffffff; -} \ No newline at end of file +} diff --git a/scripts/system/more/more.html b/scripts/system/more/more.html index 3bd77299ca..24435fc027 100644 --- a/scripts/system/more/more.html +++ b/scripts/system/more/more.html @@ -1,3 +1,4 @@ + - + - + -
-

Add more functionalities...

-

Want to add your own app? Read the guide!

+ + Add more functionalities...
+
@@ -153,7 +151,7 @@
@@ -164,96 +162,115 @@
-
-

+
- +
- - \ No newline at end of file +