From 0f5a83b97025eb23353d813178c27df39ca6a580 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 28 Feb 2020 01:44:54 -0500 Subject: [PATCH] Adds more app as default script w/ beta branch pulling from repo URL. --- scripts/defaultScripts.js | 2 +- scripts/system/more/app-more.js | 136 +++++++++++++++ scripts/system/more/appicon_a.png | Bin 0 -> 521 bytes scripts/system/more/appicon_i.png | Bin 0 -> 511 bytes scripts/system/more/blank_minus-16.png | Bin 0 -> 250 bytes scripts/system/more/blank_plus-16.png | Bin 0 -> 251 bytes scripts/system/more/css/styles.css | 188 +++++++++++++++++++++ scripts/system/more/del-x-16.png | Bin 0 -> 536 bytes scripts/system/more/minus-16.png | Bin 0 -> 385 bytes scripts/system/more/more.html | 225 +++++++++++++++++++++++++ scripts/system/more/plus-16.png | Bin 0 -> 393 bytes scripts/system/more/search-32.png | Bin 0 -> 1584 bytes 12 files changed, 550 insertions(+), 1 deletion(-) create mode 100644 scripts/system/more/app-more.js create mode 100644 scripts/system/more/appicon_a.png create mode 100644 scripts/system/more/appicon_i.png create mode 100644 scripts/system/more/blank_minus-16.png create mode 100644 scripts/system/more/blank_plus-16.png create mode 100644 scripts/system/more/css/styles.css create mode 100644 scripts/system/more/del-x-16.png create mode 100644 scripts/system/more/minus-16.png create mode 100644 scripts/system/more/more.html create mode 100644 scripts/system/more/plus-16.png create mode 100644 scripts/system/more/search-32.png diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index d9c84467a3..2d4e19f2e4 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -35,12 +35,12 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/miniTablet.js", "system/audioMuteOverlay.js", "system/keyboardShortcuts/keyboardShortcuts.js", - "https://kasenvr.github.io/community-apps/more/app-more.js" ]; var DEFAULT_SCRIPTS_SEPARATE = [ "system/controllers/controllerScripts.js", "communityModules/notificationCore/notificationCore.js", "simplifiedUI/ui/simplifiedNametag/simplifiedNametag.js", + {"stable": "system/more/app-more.js", "beta": "https://kasenvr.github.io/community-apps/more/app-more.js"}, {"stable": "communityModules/chat/FloofChat.js", "beta": "https://content.fluffy.ws/scripts/chat/FloofChat.js"} //"system/chat.js" ]; diff --git a/scripts/system/more/app-more.js b/scripts/system/more/app-more.js new file mode 100644 index 0000000000..91e5508a6b --- /dev/null +++ b/scripts/system/more/app-more.js @@ -0,0 +1,136 @@ +"use strict"; + +// app-more.js +// VERSION 1.0 +// +// Created by Keb Helion, February 2020. +// Copyright 2020 Project Athena and contributors. +// +// 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..."; + 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 lastProcessing = { + "action": "", + "script": "" + }; + + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet.screenChanged.connect(onScreenChanged); + var button = tablet.addButton({ + text: APP_NAME, + icon: APP_ICON_INACTIVE, + activeIcon: APP_ICON_ACTIVE + }); + + + function clicked() { + if (Appstatus == true) { + tablet.webEventReceived.disconnect(onMoreAppWebEventReceived); + tablet.gotoHomeScreen(); + Appstatus = false; + } else { + tablet.gotoWebScreen(APP_URL); + tablet.webEventReceived.connect(onMoreAppWebEventReceived); + Appstatus = true; + } + + button.editProperties({ + isActive: Appstatus + }); + + } + + button.clicked.connect(clicked); + + function sendRunningScriptList() { + var currentlyRunningScripts = ScriptDiscoveryService.getRunning(); + tablet.emitScriptEvent(JSON.stringify(currentlyRunningScripts)); + } + + function onMoreAppWebEventReceived(eventz) { + + if (typeof eventz === "string") { + 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; + + Script.setTimeout(function() { + sendRunningScriptList(); + }, 2000); + } + } + + 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; + + Script.setTimeout(function() { + sendRunningScriptList(); + }, 2000); + } + } + + if (eventzget.action === "requestRunningScriptData") { + sendRunningScriptList(); + } + + } + + } + + + function onScreenChanged(type, url) { + if (type == "Web" && url.indexOf(APP_URL) != -1) { + //Active + //print("MORE... ACTIVE"); + Appstatus = true; + } else { + //Inactive + //print("MORE... INACTIVE"); + Appstatus = false; + } + + button.editProperties({ + isActive: Appstatus + }); + } + + + function cleanup() { + 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/appicon_a.png b/scripts/system/more/appicon_a.png new file mode 100644 index 0000000000000000000000000000000000000000..b62d59774686a43d1f07bf0d0f208aa5cd8fdf98 GIT binary patch literal 521 zcmeAS@N?(olHy`uVBq!ia0y~yU@!t<4mJh`208nVjSLJ7oCO|{#S9GG!XV7ZFl&wk z0|Ns~x}&cn1H;C?n%{ww85kH8l0AZa85pWm85kOx85n;4XJBY}$-q!*z`*b-fq}tl z1_Oh5{-pS$ZVU{J^`0({Ar-fh{`~)Mf4G2wf$<2Fl7ysW=SN;;F~h3Yhq)XkG732O z@Em4gV7aj2BZmV6uXI1r%#9On$tY}>bX2XiV02*Moh`x0u^{oWU;{&vUFq-7pFbO#5lx%x%KQoK-nK(#Y!-3=_tmGH$5og7^-*{|6gC zV_?d-aRkjVA+M*uVo+#^crm9jGt7X2ML^d}*Uf4+`!^K_hKq~8dW$m%IBZ$t{_nDt zrD8G2fGJThE0JtRXS$rOYFQyQGfI~Q=F}^BfB!8n^ANu6#K562&2ieC6W?q=o?F6- z;thyF6COu}y!B*axv-&Auz^9ULt>%lcL{|CiT2Znj2jr384~ps8vA#hYh_?yVDNPH Kb6Mw<&;$To>7oe$ literal 0 HcmV?d00001 diff --git a/scripts/system/more/appicon_i.png b/scripts/system/more/appicon_i.png new file mode 100644 index 0000000000000000000000000000000000000000..e765410b50e836051e64a1064681bbc9504db3a9 GIT binary patch literal 511 zcma)2&nrW50RO!2o_V&$(}Wi5)r)tb{K`S(O~ZDu7!H0ELm4R|wU&5@-twy`$*-1> zA5m(501d6g$pIG!F5`fNgr*kPfX-?$+W}-KVAKGN`SK2c zhz?6t7ogQEpfEch4}fkqm6(8?@t(J`DF9rf#a;rqlK^QDcntwk5a><=Zt8)Y86d8G zvhJV=pt`MQQ-$lI;XM?}_jdr)K3VZR==j)l_pLtyMD{plAi% zcb_XlH@6(7Xy;2`>tTYTCp4D8zP$RFu{sIzKnu$hwxohzSz19okq4a)G(m-GXj(P^Tlw+>zMNW zn(<|%?yMcz$g?V6r4v?EMe|ufql#vaN^Q0PxLw?(8044@AqN1gg*NkcLH)odCy<&b literal 0 HcmV?d00001 diff --git a/scripts/system/more/blank_minus-16.png b/scripts/system/more/blank_minus-16.png new file mode 100644 index 0000000000000000000000000000000000000000..dfa1a828022661d728f0c4f08d715bc5db4b5370 GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0y~yU{GLSU=ZM7V_;w?XQ+*2U|`@Z@Q5sCVBk9f!i-b3 z`J@>b7+BIBeH|GXHuly04x9|qmFyAZ%fL{j%D~Xj%)s#TKLbO(lV*z71g98Ka4rZv* b1cu7*?DCh6-{@dqU|{fc^>bP0l+XkK$T343 literal 0 HcmV?d00001 diff --git a/scripts/system/more/blank_plus-16.png b/scripts/system/more/blank_plus-16.png new file mode 100644 index 0000000000000000000000000000000000000000..c40ab2044308b2fc46d528209b8652e3ca27b0d0 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0y~yU{GLSU=ZM7V_;w?XQ+*2U|`@Z@Q5sCVBk9f!i-b3 z`J@>b7+BIBeH|GXHuly04x9|qmFyAZ%fL{j%D~Xj%)s#TKLbOpF1ZP1_K>z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-j!8s8RCwBA{Qv(y10?_;fLK68XJ;p}mXJPZR#GEDaI_2q2gNkw7d9#Gnw3 z0ODLAUX7#~%`dmmvcc5CITCFawyd_!(sLA0Yk>WupU-YZ(9n2&VA{n&dVh z4ul5mN+6Cw3lk8y2Owq{KIjv&>Z=o(*2onGZAoRSj3W$$G1I-19)u5q$7wWP_K>Pq%13&;VQktCs a0t^5eg+!7ui7!6@0000uHnhXs9txXi_02ly}col#lj5PpA=oK6M zfG#SdSSrwE0$@9+odP>^qrbI_vehQm*@59)K$-x)V}SGu3={!xZlH7-Nb6Z>J*fil zX%na`@ZkN6#VU_^MuOL?cZ2ZC4@k)9RfD~f%3zS{U%Kv}eFs7?TtP;@h9etN6ijIH zlC0@JLU`e93&^*sfc{EYg@~#q0 V5~RWMciPJU literal 0 HcmV?d00001 diff --git a/scripts/system/more/more.html b/scripts/system/more/more.html new file mode 100644 index 0000000000..dfb71244e6 --- /dev/null +++ b/scripts/system/more/more.html @@ -0,0 +1,225 @@ + + + + + + + + + + + + +
+

Add more functionalities...

+

Want to add your own app? Read the guide!

+ + + + + +
+ + + + + +
+ + + +
+
+
+
+

+
+
+ + + + \ No newline at end of file diff --git a/scripts/system/more/plus-16.png b/scripts/system/more/plus-16.png new file mode 100644 index 0000000000000000000000000000000000000000..69358477577fc740e55a1eaeb1016a5ee2608ac2 GIT binary patch literal 393 zcmWm5O(=t500;2@GqVlb>$zZ|yqBF22gGFF@v<#VGr~A{O(=@_*4p&=%4djtthji7qANw=5q#tCePN9y)G_J)eDT?5*CnyYs*^ZR0UQ zczSb@XYKar$=wwJ8GB=~!gR{adPC*}OOEWlcC_iiv&k;#2bDc)`k~N=3_1=fzB`$5 z0vFKuei-LAO}8)<^`92=I@7qVU}j}#C|IecLRyx&=0ey}ohx|tXCR07YC?3U*&v|8 zPv+TIE=?IOJtqUc#n0cgo#9cp;O$KPL%y+pNf3j8WA#$3d^cauS dZNZGXI1xkvYgv84{-fg?04yct;%<>N@(0+PeTo18 literal 0 HcmV?d00001 diff --git a/scripts/system/more/search-32.png b/scripts/system/more/search-32.png new file mode 100644 index 0000000000000000000000000000000000000000..8d4bb5daa275e2eef7527df92eab589cff339940 GIT binary patch literal 1584 zcmWlYZB$eD9e{s-ZW01qlkg%YG|2S@43?2l#2Ey+2~l~MqD81q0!S*#goX)}QMpMt z5o(I81x1FE(ALsuF(9okFeIRb4hvXhf|A2~JCH)><`G1b9X>oCpD)ijPg#82-ZhRM zjsUPGGD4OB0K_Ux1_0z17XA+a9C9L(a{-)OS3yuy%LM@12a;F`KvQ|q%DbPh8tD-U zu>ghM0F(w`*#7%*g?Qs{z(!f0lB84*>m2q)c+4;7QtRn=P!1w4)#mIqP&f zfjTB8#yC1U>Ot0gD*dmSfrT!wJiVEnZ+pF*OHX#0{)mD!$sm!QnK^PiJ$*{(>-%GW zXQy;+iuKLPg^8i72gl+r1%LOfLxl~I)}U%W2?6TEXbp-K3a`id`}_NlkKcLy>cv?U zS)K)fnyRWQ#5Lky@2hLSsho*gEVfxK@FSveM$a}kH;-Joa>YlO(ta;9AcEiEtTVhz zPqeRhPq8Jb@m(t(4Q`qxzam?)4l#IK4pinSY z)aTBz{j9TtTNo9W$LD4P$Yu%(9lpVFHj+BE4HmaisI}k z>Flrlb;P=6^%5Xjzm~YLVJB2)aLL>HYuE7kzj6v*E_iks!q0FQEUosxTy1Ee!gtGL zCFagfwW_YJ&R{U0d1l2_ju_mO`f9o}AlkkX{Vm#VWI`G>JPr``_F&K7o^ zT_=pkUESP{_Vo2BN=r-S;N!1-@E}H8Q{!R6Ox{P6S~`J*CZc!1z3L-hNyF zO(#yAFxQY}Y>y&=0h9&%_q*=!*t~f&chq9x<^A@AzTN3yp4R&S1=0_p$0f-_6cB(0 zTk{tcw{j-zG!+$`;ee#xLwfIe_XjuFrfy)Pt>HBrCYR@ z*b+lQXL3RISi9$eG}TtNwxoonZfCPtj0-%X`+CaV^$WRDASn5Vjdc8c_Q1~$I@R(k zTi>OfHf-v7nCbUrw%;-9rru5I@*t~iqU(%Jl{p?JnzLfhoNA9txW^uc=`S@Bt;kN4 z@WXb14b0k~f_~$hFJ@ULWGnmHi56N0HEoTeA@;4((qzzHWNNR3trwe0Eq{9=Bpk$K{L8&Vu+~wZ`3wg!lgKblK7$Bc5 zdyD|d4t&Ap+TlDN4_7Lc_?|s`ewR8{z9&p+$FF-z?r&=tW(*niO7D;me(l;D&CMMS z9&Z7YC}4tUx literal 0 HcmV?d00001