diff --git a/README.md b/README.md index 67e0ede..9c71c67 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Community Apps Repository -Applications repository for Vircadia, pulled directly from GitHub. You can add or edit your app in the "More" application by opening a pull request to this repo. +Applications repository for Overte, pullable directly from GitHub. You can add or edit your app in the "More" application by opening a pull request to this repository. Direct link to run the "More..." application in the interface: -https://cdn.vircadia.com/community-apps/more/app-more.js +https://more.overte.org/more/app-more.js See all the details about adding your app here: -https://cdn.vircadia.com/community-apps/web/index.html +https://overte-org.github.io/community-apps/web/index.html ### Contributors diff --git a/more/app-more.js b/more/app-more.js index 1c31653..136360f 100644 --- a/more/app-more.js +++ b/more/app-more.js @@ -1,119 +1,120 @@ -"use strict"; - -// app-more.js -// VERSION 1.0 -// -// Created by Keb Helion, February 2020. -// Copyright 2020 Vircadia contributors. -// -// This script adds a "More Apps" selector to Vircadia 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 DEV_PARAMETER = Script.resolvePath('').split("?")[1]; - var APP_NAME = "MORE..."; - var APP_URL = (ROOT + "more.html" + (DEV_PARAMETER === "dev" ? "?dev" : "")).replace(/%5C/g, "/"); - 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) { - 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(); - var newMessage = "RSL4MOREAPP:"; - var runningScriptJson; - for (var j = 0; j < currentlyRunningScripts.length; j++) { - runningScriptJson = currentlyRunningScripts[j].url; - if (runningScriptJson.indexOf("https://cdn.vircadia.com/community-apps/applications") !== -1) { - newMessage += "_" + runningScriptJson; - } - } - tablet.emitScriptEvent(newMessage); - } - - 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.loadScript(instruction.script, true, false, false, true, false); // Force reload the script, do not use cache. - lastProcessing.action = instruction.action; - lastProcessing.script = instruction.script; - Script.setTimeout(function() { - sendRunningScriptList(); - }, 1500); - } - } - - 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 (instruction.action === "requestRunningScriptData") { - sendRunningScriptList(); - } - } - } - - function onScreenChanged(type, url) { - if (type === "Web" && url.indexOf(APP_URL) !== -1) { - appStatus = true; - } else { - 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); -}()); +"use strict"; + +// app-more.js +// VERSION 1.0 +// +// Created by Keb Helion, February 2020. +// Copyright 2020 Vircadia contributors. +// Copyright 2022 Overte e.V. +// +// This script adds a "More Apps" selector to Overte 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 DEV_PARAMETER = Script.resolvePath('').split("?")[1]; + var APP_NAME = "MORE..."; + var APP_URL = (ROOT + "more.html" + (DEV_PARAMETER === "dev" ? "?dev" : "")).replace(/%5C/g, "/"); + 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) { + 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(); + var newMessage = "RSL4MOREAPP:"; + var runningScriptJson; + for (var j = 0; j < currentlyRunningScripts.length; j++) { + runningScriptJson = currentlyRunningScripts[j].url; + if (runningScriptJson.indexOf("https://more.overte.org/applications") !== -1) { + newMessage += "_" + runningScriptJson; + } + } + tablet.emitScriptEvent(newMessage); + } + + 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.loadScript(instruction.script, true, false, false, true, false); // Force reload the script, do not use cache. + lastProcessing.action = instruction.action; + lastProcessing.script = instruction.script; + Script.setTimeout(function() { + sendRunningScriptList(); + }, 1500); + } + } + + 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 (instruction.action === "requestRunningScriptData") { + sendRunningScriptList(); + } + } + } + + function onScreenChanged(type, url) { + if (type === "Web" && url.indexOf(APP_URL) !== -1) { + appStatus = true; + } else { + 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); +}()); diff --git a/more/more.html b/more/more.html index e5e171d..0be950c 100644 --- a/more/more.html +++ b/more/more.html @@ -1,275 +1,276 @@ -<!DOCTYPE html> -<!-- -// more.html -// -// Created by Keb Helion, February 2020. -// Copyright 2020 Vircadia contributors. -// -// 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 ---> -<html> - <head> - <meta charset="UTF-8"> - <script src="jquery-3.5.1.min.js"></script> - <script> - //Defaults - var DEFAULT_PER_PAGE = 3; - var DEFAULT_OFFSET = 0; - - //Parameters - function findGetParameter(parameterName) { - var result = null, - tmp = []; - var items = location.search.substr(1).split("&"); - for (var index = 0; index < items.length; index++) { - tmp = items[index].split("="); - if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); - } - return result; - } - - var offset = findGetParameter("offset"); - if (offset === null) { - offset = DEFAULT_OFFSET; - } - offset = parseInt(offset); - - var perpage = findGetParameter("perpage"); - if (perpage === null) { - perpage = DEFAULT_PER_PAGE; - } - perpage = parseInt(perpage); - - var search = findGetParameter("search"); - if (search === null) { - search = ""; - } - - //Paths - var currentPath = window.location.protocol + "//" + window.location.host + window.location.pathname; - var developmentMode = window.location.toString().split("?")[1]; - var rootPath; - var metadataScriptSrc = "https://cdn.vircadia.com/community-apps/applications/metadata.js"; - - if (developmentMode === "dev") { // Development mode loads locally, if not, load from repo. - console.info("Setting applications to local.") - rootPath = currentPath.replace("more/more.html", "applications/"); - console.info("Loading metadata locally."); - metadataScriptSrc = "../applications/metadata.js"; - } else { - console.info("Setting applications to remote URL.") - console.info("Loading metadata remotely."); - rootPath = "https://cdn.vircadia.com/community-apps/applications/"; - } - - //Search - function doSearch(keyword) { - offset = 0; - search = keyword; - listBuilder(keyword, offset, perpage); - } - - function clearSearch() { - offset = 0; - document.searchbar.searchtextbox.value = ""; - search = ""; - listBuilder("", offset, perpage); - } - - //Running scripts - var buttonList = []; - - function requestRunningScriptData() { - var readyEvent = { - "action": "requestRunningScriptData" - }; - EventBridge.emitWebEvent(JSON.stringify(readyEvent)); - } - - EventBridge.scriptEventReceived.connect(function(message){ - //update the buttons - if (message.indexOf("RSL4MOREAPP:") !== -1){ - buttonList.forEach(function(item){ - var btn = ""; - if (message.indexOf(item.url) !== -1) { - //Means already running - btn = "<button class='uninstall' onclick='uninstall(" + '"' + item.url + '"' + ", " + '"' + item.id + '"' + ");'>Uninstall</button>"; - } else { - //Means not already installed - btn = "<button class='install' onclick='install(" + '"' + item.url + '"' + ", " + '"' + item.id + '"' + ");'>Install</button>"; - } - - document.getElementById(item.id).innerHTML = btn; - }); - } - }); - - function install(script, btnId){ - var btn = "<button class='processing' >Processing...</button>"; - document.getElementById(btnId).innerHTML = btn; - - var readyEvent = { - "action": "installScript", - "script": script - }; - - EventBridge.emitWebEvent(JSON.stringify(readyEvent)); - } - - function uninstall(script, btnId){ - var btn = "<button class='processing' >Processing...</button>"; - document.getElementById(btnId).innerHTML = btn; - - var readyEvent = { - "action": "uninstallScript", - "script": script - }; - - EventBridge.emitWebEvent(JSON.stringify(readyEvent)); - } - </script> - - <link href="https://fonts.googleapis.com/css?family=Merriweather|Quicksand:400,700&display=swap" rel="stylesheet"> - <link href="css/styles.css" rel="stylesheet"> - - </head> - <body><form name = "searchbar" onsubmit="submitForm(event);"> - <font class="mainTitle">Add more functionalities...</font><br> - <table style = "width:100%;"> - <tr > - <td style = "vertical-align:middle; text-align:left;"> - <table> - <tr> - <td style = "vertical-align:middle; text-align:left;"> - <div class = "searchbox"> - <input class = "searchtextbox" name = "searchtextbox" size = "26" maxlength="32" onkeypress="monitorEnter(event, this);"> <a href="#" onclick='clearSearch();'><img src="del-x-16.png"></a> - </div> - </td> - <td style = "vertical-align:middle; text-align:left;"> - <a href = "#" onclick = 'doSearch(document.searchbar.searchtextbox.value);'><img src="search-32.png"></a> - </td> - </tr> - </table> - </td> - <td style = "vertical-align:middle; text-align:right;"> - <div id = 'pager_top' style = "vertical-align: middle;"></div> - </td> - </tr> - </table> - </form> - <div id = "data"></div> - <div style="width:98%; text-align:right;"> - <div style = "vertical-align: middle;" id = 'pager_footer'></div> - </div> - <hr> - <p class="mainDesc">Want to contribute and add your own app?<br> - Read the <a href="https://cdn.vircadia.com/community-apps/web/index.html">guide</a>!</p> - <script> - function monitorEnter(e) { - var code = (e.keyCode ? e.keyCode : e.which); - if (code == 13) { - doSearch(document.searchbar.searchtextbox.value); - } - } - - function submitForm(event){ - event.preventDefault(); - } - - document.searchbar.searchtextbox.value = search; - var pageContent = ""; - - function displayApp(item) { - pageContent = pageContent + "<a name = '" + window.btoa(item.directory) + "'><table class='item'><tr>"; - pageContent = pageContent + "<td><div class='iconContainer'><img src='" + rootPath + item.icon + "' style='width:50px;'><br><font class = 'caption'>" + item.caption + "</font></div></td>"; - var btn = ""; - var absoluteJsFile = rootPath + item.jsfile; - - var btn = "<button class='install' onclick = 'install(" + '"' + absoluteJsFile + " ," + window.btoa(item.directory) + '"' + ");'>Install</button>"; - var btndata = { - "url": absoluteJsFile, - "id": window.btoa(item.directory) - }; - buttonList.push(btndata); - - pageContent = pageContent + "<td><font class='appname'>" + item.name + "<br></font><font class = 'appdesc'>" + item.description + "<br></font><div id = '"+ window.btoa(item.directory) +"' align='right'>" + btn + "</div></td>"; - pageContent = pageContent + "</tr></table><br>"; - } - - function listBuilder(searchKeyword, listOffset, listPerPage) { - buttonList = []; - var counterDir = -1; - var counterDisp = 0; - var index = 0; - var lowItem = ""; - var needNext = false; - pageContent = ""; - - for (index = 0; index < metadata.applications.length; index++) { - lowItem = metadata.applications[index].name.toLowerCase(); - if (lowItem.indexOf(searchKeyword.toLowerCase()) !== -1 && metadata.applications[index].isActive == true) { - counterDir = counterDir + 1; - if ((counterDir >= listOffset) && (counterDir < (listOffset + listPerPage))) { - displayApp(metadata.applications[index]); - counterDisp = counterDisp + 1; - } - if (counterDir >= (listOffset + listPerPage)) { - needNext = true; - break; - } - } - } - - var pagerPrevious = "<a href='#' onclick='pagetoPrevious();'><img src='minus-16.png'></a>"; - if (listOffset <= 0) { - pagerPrevious = "<img src='blank_minus-16.png'>"; - } - - var pagerNext = "<a href='#' onclick='pagetoNext();'><img src='plus-16.png'></a>"; - if (needNext == false) { - pagerNext = "<img src='blank_plus-16.png'>"; - } - - var countA = listOffset + 1; - - var countB = listOffset + counterDisp; - - var pagerHtml = pagerPrevious + "<font class='pager'> " + countA + " - " + countB + " </font>" + pagerNext; - - if (counterDisp > 0 ) { - document.getElementById("pager_top").innerHTML = pagerHtml; - document.getElementById("data").innerHTML = pageContent; - document.getElementById("pager_footer").innerHTML = pagerHtml; - } else { - document.getElementById("data").innerHTML = "<hr><div align='center'><font class='noresult'><br><br><br><br>Sorry, no result found.<br><br><br><br><br><br></font></div><hr>"; - } - requestRunningScriptData(); - } - - //pager - function pagetoPrevious(){ - offset = offset - perpage; - if (offset < 0) { - offset = 0; - } - listBuilder(search, offset, perpage); - } - - function pagetoNext(){ - offset = offset + perpage; - listBuilder(search, offset, perpage); - } - - $.getScript(metadataScriptSrc, function(data, textStatus, jqxhr) { - - listBuilder(search, offset, perpage); - }); - - </script> - </body> -</html> +<!DOCTYPE html> +<!-- +// more.html +// +// Created by Keb Helion, February 2020. +// Copyright 2020 Vircadia contributors. +// Copyright 2022 Overte e.V. +// +// App maintained in: https://github.com/overte-org/community-apps +// App copied to: https://github.com/overte-org/overte +// +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +--> +<html> + <head> + <meta charset="UTF-8"> + <script src="jquery-3.5.1.min.js"></script> + <script> + //Defaults + var DEFAULT_PER_PAGE = 3; + var DEFAULT_OFFSET = 0; + + //Parameters + function findGetParameter(parameterName) { + var result = null, + tmp = []; + var items = location.search.substr(1).split("&"); + for (var index = 0; index < items.length; index++) { + tmp = items[index].split("="); + if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); + } + return result; + } + + var offset = findGetParameter("offset"); + if (offset === null) { + offset = DEFAULT_OFFSET; + } + offset = parseInt(offset); + + var perpage = findGetParameter("perpage"); + if (perpage === null) { + perpage = DEFAULT_PER_PAGE; + } + perpage = parseInt(perpage); + + var search = findGetParameter("search"); + if (search === null) { + search = ""; + } + + //Paths + var currentPath = window.location.protocol + "//" + window.location.host + window.location.pathname; + var developmentMode = window.location.toString().split("?")[1]; + var rootPath; + var metadataScriptSrc = "https://more.overte.org/applications/metadata.js"; + + if (developmentMode === "dev") { // Development mode loads locally, if not, load from repo. + console.info("Setting applications to local.") + rootPath = currentPath.replace("more/more.html", "applications/"); + console.info("Loading metadata locally."); + metadataScriptSrc = "../applications/metadata.js"; + } else { + console.info("Setting applications to remote URL.") + console.info("Loading metadata remotely."); + rootPath = "https://more.overte.org/applications/"; + } + + //Search + function doSearch(keyword) { + offset = 0; + search = keyword; + listBuilder(keyword, offset, perpage); + } + + function clearSearch() { + offset = 0; + document.searchbar.searchtextbox.value = ""; + search = ""; + listBuilder("", offset, perpage); + } + + //Running scripts + var buttonList = []; + + function requestRunningScriptData() { + var readyEvent = { + "action": "requestRunningScriptData" + }; + EventBridge.emitWebEvent(JSON.stringify(readyEvent)); + } + + EventBridge.scriptEventReceived.connect(function(message){ + //update the buttons + if (message.indexOf("RSL4MOREAPP:") !== -1){ + buttonList.forEach(function(item){ + var btn = ""; + if (message.indexOf(item.url) !== -1) { + //Means already running + btn = "<button class='uninstall' onclick='uninstall(" + '"' + item.url + '"' + ", " + '"' + item.id + '"' + ");'>Uninstall</button>"; + } else { + //Means not already installed + btn = "<button class='install' onclick='install(" + '"' + item.url + '"' + ", " + '"' + item.id + '"' + ");'>Install</button>"; + } + + document.getElementById(item.id).innerHTML = btn; + }); + } + }); + + function install(script, btnId){ + var btn = "<button class='processing' >Processing...</button>"; + document.getElementById(btnId).innerHTML = btn; + + var readyEvent = { + "action": "installScript", + "script": script + }; + + EventBridge.emitWebEvent(JSON.stringify(readyEvent)); + } + + function uninstall(script, btnId){ + var btn = "<button class='processing' >Processing...</button>"; + document.getElementById(btnId).innerHTML = btn; + + var readyEvent = { + "action": "uninstallScript", + "script": script + }; + + EventBridge.emitWebEvent(JSON.stringify(readyEvent)); + } + </script> + + <link href="https://fonts.googleapis.com/css?family=Merriweather|Quicksand:400,700&display=swap" rel="stylesheet"> + <link href="css/styles.css" rel="stylesheet"> + + </head> + <body><form name = "searchbar" onsubmit="submitForm(event);"> + <font class="mainTitle">Add more functionalities...</font><br> + <table style = "width:100%;"> + <tr > + <td style = "vertical-align:middle; text-align:left;"> + <table> + <tr> + <td style = "vertical-align:middle; text-align:left;"> + <div class = "searchbox"> + <input class = "searchtextbox" name = "searchtextbox" size = "26" maxlength="32" onkeypress="monitorEnter(event, this);"> <a href="#" onclick='clearSearch();'><img src="del-x-16.png"></a> + </div> + </td> + <td style = "vertical-align:middle; text-align:left;"> + <a href = "#" onclick = 'doSearch(document.searchbar.searchtextbox.value);'><img src="search-32.png"></a> + </td> + </tr> + </table> + </td> + <td style = "vertical-align:middle; text-align:right;"> + <div id = 'pager_top' style = "vertical-align: middle;"></div> + </td> + </tr> + </table> + </form> + <div id = "data"></div> + <div style="width:98%; text-align:right;"> + <div style = "vertical-align: middle;" id = 'pager_footer'></div> + </div> + <hr> + <p class="mainDesc">Want to contribute and add your own app?<br> + Read the <a href="https://overte-org.github.io/community-apps/web/index.html">guide</a>!</p> + <script> + function monitorEnter(e) { + var code = (e.keyCode ? e.keyCode : e.which); + if (code == 13) { + doSearch(document.searchbar.searchtextbox.value); + } + } + + function submitForm(event){ + event.preventDefault(); + } + + document.searchbar.searchtextbox.value = search; + var pageContent = ""; + + function displayApp(item) { + pageContent = pageContent + "<a name = '" + window.btoa(item.directory) + "'><table class='item'><tr>"; + pageContent = pageContent + "<td><div class='iconContainer'><img src='" + rootPath + item.icon + "' style='width:50px;'><br><font class = 'caption'>" + item.caption + "</font></div></td>"; + var btn = ""; + var absoluteJsFile = rootPath + item.jsfile; + + var btn = "<button class='install' onclick = 'install(" + '"' + absoluteJsFile + " ," + window.btoa(item.directory) + '"' + ");'>Install</button>"; + var btndata = { + "url": absoluteJsFile, + "id": window.btoa(item.directory) + }; + buttonList.push(btndata); + + pageContent = pageContent + "<td><font class='appname'>" + item.name + "<br></font><font class = 'appdesc'>" + item.description + "<br></font><div id = '"+ window.btoa(item.directory) +"' align='right'>" + btn + "</div></td>"; + pageContent = pageContent + "</tr></table><br>"; + } + + function listBuilder(searchKeyword, listOffset, listPerPage) { + buttonList = []; + var counterDir = -1; + var counterDisp = 0; + var index = 0; + var lowItem = ""; + var needNext = false; + pageContent = ""; + + for (index = 0; index < metadata.applications.length; index++) { + lowItem = metadata.applications[index].name.toLowerCase(); + if (lowItem.indexOf(searchKeyword.toLowerCase()) !== -1 && metadata.applications[index].isActive == true) { + counterDir = counterDir + 1; + if ((counterDir >= listOffset) && (counterDir < (listOffset + listPerPage))) { + displayApp(metadata.applications[index]); + counterDisp = counterDisp + 1; + } + if (counterDir >= (listOffset + listPerPage)) { + needNext = true; + break; + } + } + } + + var pagerPrevious = "<a href='#' onclick='pagetoPrevious();'><img src='minus-16.png'></a>"; + if (listOffset <= 0) { + pagerPrevious = "<img src='blank_minus-16.png'>"; + } + + var pagerNext = "<a href='#' onclick='pagetoNext();'><img src='plus-16.png'></a>"; + if (needNext == false) { + pagerNext = "<img src='blank_plus-16.png'>"; + } + + var countA = listOffset + 1; + + var countB = listOffset + counterDisp; + + var pagerHtml = pagerPrevious + "<font class='pager'> " + countA + " - " + countB + " </font>" + pagerNext; + + if (counterDisp > 0 ) { + document.getElementById("pager_top").innerHTML = pagerHtml; + document.getElementById("data").innerHTML = pageContent; + document.getElementById("pager_footer").innerHTML = pagerHtml; + } else { + document.getElementById("data").innerHTML = "<hr><div align='center'><font class='noresult'><br><br><br><br>Sorry, no result found.<br><br><br><br><br><br></font></div><hr>"; + } + requestRunningScriptData(); + } + + //pager + function pagetoPrevious(){ + offset = offset - perpage; + if (offset < 0) { + offset = 0; + } + listBuilder(search, offset, perpage); + } + + function pagetoNext(){ + offset = offset + perpage; + listBuilder(search, offset, perpage); + } + + $.getScript(metadataScriptSrc, function(data, textStatus, jqxhr) { + + listBuilder(search, offset, perpage); + }); + + </script> + </body> +</html> diff --git a/web/index.html b/web/index.html index e327168..5f92040 100644 --- a/web/index.html +++ b/web/index.html @@ -3,6 +3,7 @@ // // Created by Keb Helion, February 2020. // Copyright 2020 Vircadia contributors. +// Copyright 2022 Overte e.V. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -16,13 +17,13 @@ <body> <div id="wrapper"> <div id="content"> - <h1>Vircadia Community Applications Repository</h1> + <h1>Overte Community Applications Repository</h1> <p>This repository stores optional <b>tablet applications</b> provided by the contributions of community members. - If you have created an application for Vircadia and want to offer it to the community, this is where you can do it.</p> + If you have created an application for Overte and want to offer it to the community, this is where you can do it.</p> <h2>Before going further:</h2><ol> - <li>If your application is a <b>core feature</b> that you think should be <b>installed by default for all Vircadia users</b>, you should instead consider making your contribution directly in the <b>Vircadia code repository</b>. See the <b><a href = 'https://github.com/kasenvr/project-athena'>Vircadia</a></b> repository and contact the core team.</li><br> - <li>If your application is <b>dependent on an external server or service</b> (if it has to deal in any way with servers other than a Vircadia Domain or Metaverse API), then this repository is not where you should publish your application. It will have to be published to a different source, like the <b>Marketplace</b> (when it is created) or another web site.</li> + <li>If your application is a <b>core feature</b> that you think should be <b>installed by default for all Overte users</b>, you should instead consider making your contribution directly in the <b>Overte code repository</b>. See the <b><a href = 'https://github.com/overte-org/overte'>Overte</a></b> repository and contact the core team.</li><br> + <li>If your application is <b>dependent on an external server or service</b> (if it has to deal in any way with servers other than a Overte Domain or Metaverse API), then this repository is not where you should publish your application. It will have to be published to a different source, like the <b>Marketplace</b> (when it is created) or another web site.</li> </ol> <br> <h2>Conditions for acceptance:</h2><ol> @@ -32,21 +33,21 @@ </li><br> <li>Avoid <b>spaces</b> and <b>special characters</b> in your <b>folders</b> and <b>file names</b>.<br><font class = 'greencommented' >(Stay with: "<b>a-z</b>", "<b>A-Z</b>", "<b>0-9</b>", "<b>-</b>", "<b>_</b>", "<b>.</b>")</font></li><br> - <li>Add your application in a <b>folder</b> under the "<b><a href = 'https://github.com/vircadia/community-apps/tree/master/applications'>applications</a></b>" directory.<br> + <li>Add your application in a <b>folder</b> under the "<b><a href = 'https://github.com/overte-org/community-apps/tree/master/applications'>applications</a></b>" directory.<br> <font class = 'greencommented' >(Your main js file and your icon must be directly in that folder)</font></li><br> - <li>You must add your application to the "<b>metadata.js</b>" file (in the "<b><a href = 'https://github.com/vircadia/community-apps/tree/master/applications'>applications</a></b>" directory) by generating a new one using this tool: <b><a href='metadata_js_generator.html'>Metadata Generator</a></b></li> + <li>You must add your application to the "<b>metadata.js</b>" file (in the "<b><a href = 'https://github.com/overte-org/community-apps/tree/master/applications'>applications</a></b>" directory) by generating a new one using this tool: <b><a href='metadata_js_generator.html'>Metadata Generator</a></b></li> </ol> <p><b>Submit a "<u>Pull Request</u>" to add your "<u>application folder</u>" and the new "<u>metadata.js</u>" file.</b><br> - <font class = 'greencommented' >(If you are not comfortable with these procedures, contact <b>Keb Helion</b> on Vircadia Discord.)</font></p> + <font class = 'greencommented' >(If you are not comfortable with these procedures, contact <b>the core members</b> on Overte Discord.)</font></p> <br> <h2>Guidelines for the code reviewer:</h2><ol> - <li>Test the applications in <b>Vircadia</b>.</li><br> + <li>Test the applications in <b>Overte</b>.</li><br> <li>Make sure that the <b>JSON</b> and <b>Javascript</b> contained in "<b>metadata.js</b>" are <u>valid</u> before accepting the pull request!<b> This will affect the production "More" application immediately for all users.</b></li><br> - <li>Test the "<b>More...</b>" application in <b>Vircadia</b>.</li> + <li>Test the "<b>More...</b>" application in <b>Overte</b>.</li> </ol> </div>