Adding "Places" application

Adding "Places" application since the Explore app is supporting only a single MS and only Vircadia.
This commit is contained in:
Alezia Kurdis 2022-01-22 22:28:07 -05:00 committed by GitHub
parent 4394c2e00b
commit 7db3017490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 2515 additions and 0 deletions

View file

@ -0,0 +1,4 @@
[
{"node": "https://metaverse.vircadia.com/live"},
{"node": "http://buyanvr.org:9400"}
]

View file

@ -0,0 +1,48 @@
@font-face {
font-family: 'Roboto'
src: url('fonts/Roboto-Regular.ttf') format('truetype')
font-weight: normal
font-style: normal
}
@font-face {
font-family: 'Roboto'
src: url('fonts/Roboto-Bold.ttf') format('truetype')
font-weight: bold
font-style: normal
}
@font-face {
font-family: 'Roboto';
src: url('fonts/Roboto-Italic.ttf');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Roboto';
src: url('fonts/Roboto-BoldItalic.ttf');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'Roboto';
src: url('fonts/Roboto-Medium.ttf');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('fonts/Roboto-MediumItalic.ttf');
font-weight: 500;
font-style: italic;
}
/* Roboto-Regular.ttf 400 */
/* Roboto-Bold.ttf 700 */
/* Roboto-Italic.ttf 400 */
/* Roboto-BoldItalic.ttf 700 */
/* Roboto-Medium.ttf 500 */
/* Roboto-MediumItalic.ttf 500 */

View file

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

View file

@ -0,0 +1,915 @@
/*
//
// places.css
//
// Created by Alezia Kurdis, January 1st, 2022.
// Copyright 2022, Overte contributors.
//
// css for the ui of the Places application.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
*/
body {
font-family: Roboto;
margin: 0px;
padding: 0px;
width: 100%;
background-color: #000000;
}
.navBtn {
opacity: 0.5;
width: 24px;
height: 24px;
}
.searchBtn {
opacity: 0.5;
width: 24px;
height: 24px;
}
*:focus {
outline: none;
}
#toolbar {
background-color: rgba(0,0,0,1);
width: 100%;
text-align: center;
justify-content: center;
}
#navigationBar {
text-align: right;
padding: 3px;
}
#currentLocation {
color: #CCCCCC;
background-color: rgba(255,255,255,0);
font-size: 11px;
border: 0px;
border-top: solid 1px #555555;
padding: 3px;
width: 96%;
margin: 0px;
}
#search {
color: #ffffff;
background-color: rgba(255,255,255,0);
font-size: 16px;
border: 0px;
width: 96%;
}
#searchFrame {
background-color: rgba(255,255,255,0.5);
padding: 2px;
border: 0px;
border-radius: 10px;
width: 96%;
margin: 0 auto;
}
#searchTable {
width: 100%;
}
#searchTableExternal {
width: 100%;
}
#navigationBarContainer {
width: 100%;
}
#clearBtn:link {
font-family: Roboto, sans-serif;
text-decoration: none;
font-size: 18px;
color: #555555;
}
#clearBtn:visited {
font-family: Roboto, sans-serif;
text-decoration: none;
font-size: 18px;
color: #555555;
}
#clearBtn:hover {
font-family: Roboto, sans-serif;
text-decoration: none;
font-size: 18px;
color: #000000;
}
#clearBtn:active {
font-family: Roboto, sans-serif;
text-decoration: none;
font-size: 18px;
color: #555555;
}
::placeholder {
color: #555555;
opacity: 1;
}
#list_content {
color: #ffffff;
width: 100%;
overflow-y: scroll;
height: 550px;
background-color: #404040;
background-image: url("icons/sidewalk.png");
background-repeat: repeat-y;
background-attachment: local;
background-position: 0px 0px;
}
#filters {
width: 95%;
padding: 2px;
text-align: right;
}
#tabs {
width: 95%;
padding: 0px;
text-align: left;
}
.maturityFilter {
width: 16px;
height: 16px;
border: 0px;
}
.presenceOfLifeFilter {
width: 64px;
height: 16px;
border: 0px;
}
.overlay {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: rgba(0,0,0, 1);
overflow: hidden;
transition: 0.5s;
}
.overlay-content {
position: relative;
top: 0%;
width: 100%;
text-align: left;
margin-top: 0px;
color: #ffffff;
}
.overlay a {
padding: 8px;
text-decoration: none;
font-size: 36px;
color: #ffffff;
display: block;
transition: 0.3s;
}
.overlay a:hover, .overlay a:focus {
color: #f1f1f1;
}
.overlay .closebtn {
position: absolute;
top: 5px;
right: 5px;
font-size: 50px;
z-index: 10;
text-shadow: 1px 1px 3px #000000;
}
@media screen and (max-height: 450px) {
.overlay a {font-size: 20px}
.overlay .closebtn {
font-size: 40px;
top: 15px;
right: 35px;
}
}
.inviteForm {
background-color: #3e3e57;
color: #ffffff;
}
td.invite {
padding-top: 60px;
padding-right: 60px;
padding-bottom: 10px;
padding-left: 60px;
text-align: left;
font-weight: 700;
font-size: 18px;
}
td.rightInvite {
padding-top: 0px;
padding-right: 60px;
padding-bottom: 0px;
padding-left: 60px;
text-align: right;
}
#eventDescTextBox {
width: 100%;
font-weight: 600;
font-size: 14px;
}
#eventErrorMessage {
width: 100%;
color: #ffff00;
font-weight: 500;
font-size: 14px;
}
.makeInviteBtn {
width: 100%;
border: 3px solid rgba(0,0,0,0);
border-radius: 10px;
font-weight: 700;
color: #ffffff;
font-size: 16px;
padding: 3px 22px 3px 22px;
text-decoration: none;
margin: 3px;
}
.makeInviteBtn:hover {
background-color: #ffffff;
color: #000000;
border: 3px solid #000000;
text-decoration: none;
}
#cancelInvite {
background: #405270;
background-image: linear-gradient(to bottom, #405270, #0d1117);
border: 0px;
border-radius: 10px;
font-weight: 700;
color: #ffffff;
font-size: 16px;
padding: 3px 22px 3px 22px;
text-decoration: none;
}
#cancelInvite:hover {
background: #5d779e;
background-image: linear-gradient(to bottom, #5d779e, #0d1117);
text-decoration: none;
}
.removeInviteBtn {
background: #b00000;
background-image: linear-gradient(to bottom, #b00000, #110000);
border-radius: 8px;
font-weight: 600;
color: #ffffff;
font-size: 12px;
padding: 3px 6px 3px 6px;
border: solid #1f628d 0px;
text-decoration: none;
margin-top: 3px;
}
.removeInviteBtn:hover {
background: #c24646;
background-image: linear-gradient(to bottom, #c24646, #110000);
text-decoration: none;
margin-top: 3px;
}
#presenceOfLifeLabel {
color: #00ff00;
font-size: 10px;
padding: 0px;
}
#matuirityAdultLabel {
color: #00ff00;
font-size: 10px;
padding: 0px;
}
#matuirityMatureLabel {
color: #00ff00;
font-size: 10px;
padding: 0px;
}
#matuirityTeenLabel {
color: #00ff00;
font-size: 10px;
padding: 0px;
}
#matuirityEveryoneLabel {
color: #00ff00;
font-size: 10px;
padding: 0px;
}
#matuirityUnratedLabel{
color: #00ff00;
font-size: 10px;
padding: 0px;
}
.tabBtn {
border-radius: 9px 9px 0px 0px;
border: 0px;
font-weight: 700;
color: #808080;
font-size: 14px;
background: #404040;
padding: 5px 15px 5px 15px;
text-decoration: none;
background-image: linear-gradient(to bottom, #404040, #1c1c1c);
}
.tabBtn:disabled {
background: #404040;
color: #b0b0b0;
text-decoration: none;
}
.adultFilterOn {
background: #de1107;
color: #ffffff;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
width: 14px;
text-align: center;
}
button.adultFilterOn:hover {
border: solid #ffffff 1px;
}
.lifeFilterOn {
background: #1aa616;
color: #00FF00;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
}
button.lifeFilterOn:hover {
border: solid #00FF00 1px;
}
.matureFilterOn {
background: #e08c0d;
color: #ffffff;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
width: 14px;
text-align: center;
}
button.matureFilterOn:hover {
border: solid #ffffff 1px;
}
.teenFilterOn {
background: #d6c313;
color: #ffffff;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
width: 14px;
text-align: center;
}
button.teenFilterOn:hover {
border: solid #ffffff 1px;
}
.everyoneFilterOn {
background: #7acf1f;
color: #ffffff;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
width: 14px;
text-align: center;
}
button.everyoneFilterOn:hover {
border: solid #ffffff 1px;
}
.unratedFilterOn {
background: #b5b5b5;
color: #ffffff;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
width: 14px;
text-align: center;
}
button.unratedFilterOn:hover {
border: solid #ffffff 1px;
}
.filterOff {
background: #333333;
color: #888888;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
width: 14px;
text-align: center;
}
button.filterOff:hover {
border: solid #888888 1px;
}
.filterLifeOff {
background: #333333;
color: #888888;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
}
button.filterLifeOff:hover {
border: solid #888888 1px;
}
.placeMaturity {
width: 100%;
text-align: left;
}
div.placeEntry {
width: 85%;
height: 60px;
background: #292929;
border: 0px;
border-radius: 6px;
box-shadow: 3px 3px 5px rgba(0,0,0,0.8);
margin: 6px 0px 9px 6px;
text-align: center;
}
div.placeEntryHighlighter {
width: 85%;
height: 80px;
font-size: 14px;
font-weight: 700;
border: 0px;
border-radius: 6px;
box-shadow: 3px 3px 5px rgba(0,0,0,0.8);
margin: 6px 0px 9px 6px;
padding-top: 6px;
text-align: center;
}
.OPEN {
background: #00b7ff;
color: #ffffff;
}
.MEET {
background: #ffaa00;
color: #000000;
}
.GAME {
background: #00e32d;
color: #000000;
}
.SHOW {
background: #8000ff;
color: #ffffff;
}
.CLUB {
background: #e32d00;
color: #ffffff;
}
.LEAR {
background: #eeff00;
color: #000000;
}
div.placeEntryHighlighted {
width: 100%;
height: 60px;
background: #292929;
border: 0px;
border-radius: 6px;
text-align: center;
}
div.placeDetail-event {
width: 100%;
text-align: left;
font-size: 10px;
font-weight: 700px;
padding: 0px;
}
#listInfo {
width: 85%;
text-align: right;
color: #7a7a7a;
font-size: 13px;
font-weight: 700;
padding: 4px;
}
#loadMore {
width: 85%;
text-align: center;
padding: 8px;
}
#loadMoreBtn{
background: #a6a6a6;
background-image: linear-gradient(to bottom, #a6a6a6, #525252);
border-radius: 10px;
border: 0px;
color: #ffffff;
font-size: 14px;
font-weight: 500;
padding: 4px 30px 4px 30px;
text-decoration: none;
}
#loadMoreBtn:hover {
background: #bfbfbf;
background-image: linear-gradient(to bottom, #bfbfbf, #6e6e6e);
text-decoration: none;
}
.blur {
width: 100%;
height: 100%;
backdrop-filter: blur(6px);
padding: 0px;
border-radius: 6px;
border: 0px;
}
.placeTitle {
color: #ffffff;
font-size: 21px;
font-weight: 700;
text-decoration: none;
text-shadow: 1px 1px 3px #000000;
}
.placeTable {
width: 100%;
}
td.presenceOfLife-LIFE {
font-size: 10px;
font-weight: 700;
color: #00FF00;
text-align: right;
}
td.presenceOfLife-FULL {
font-size: 10px;
font-weight: 700;
color: #ff0000;
text-align: right;
}
td.presenceOfLife-NOBODY {
font-size: 10px;
font-weight: 700;
color: #555555;
text-align: right;
}
td.place-entry-description {
font-size: 12px;
font-weight: 600;
font-style: italic;
color: #ffffff;
text-align: left;
text-shadow: 1px 1px 2px #000000;
}
div.domainEntry {
width: 100%;
height: 40px;
background: rgba(32,0,255,0.15);
border: 0px;
text-align: left;
padding-bottom: 4px;
}
.domainTable {
width: 79%;
vertical-align: top;
}
td.domainTitle {
font-size: 20px;
font-weight: 700;
font-style: none;
color: #7366c4;
text-align: left;
}
font.domain-capacity {
font-size: 10px;
font-weight: 600;
color: #999999;
}
font.domain-nbrUser {
font-size: 18px;
font-weight: 500;
}
font.NOBODY {
color: #555555;
}
font.LIFE {
color: #00FF00;
}
font.FULL {
color: #FF0000;
}
font.domain-nbrUser_small {
font-size: 10px;
color: #999999;
}
#placeDetail-image {
width: 100%;
height: 270px;
object-fit: cover;
}
#placeDetail-placeName {
width: 95%;
font-size: 30px;
font-weight: 700;
color: #ffffff;
padding: 10px;
}
#placeDetail-description {
width: 95%;
font-size: 12px;
font-weight: 500;
color: #cccccc;
padding: 10px;
text-align: justify;
text-justify: inter-word;
}
#placeDetail-visitBtn {
background: #0000ff;
background-image: linear-gradient(to bottom, #0000ff, #000020);
border: 0px;
border-radius: 10px;
font-weight: 800;
color: #ffffff;
font-size: 20px;
padding: 3px 22px 3px 22px;
text-decoration: none;
}
#placeDetail-visitBtn:hover {
background: #057eff;
background-image: linear-gradient(to bottom, #057eff, #00090f);
text-decoration: none;
}
#placeDetail-visitBtn-container {
width: 100%;
text-align: left;
margin-bottom: 40px;
}
#placeDetail-placedata {
width: 100%;
font-size: 11px;
font-weight: 500;
color: #888888;
padding: 5px;
text-align: left;
}
#placeDetail-managers {
width: 100%;
font-size: 12px;
font-weight: 700;
color: #ffffff;
padding-left: 60px;
text-align: left;
}
#placeDetail-domain {
font-size: 13px;
font-weight: 700;
color: #cccccc;
width: 100%;
}
#placeDetail-users {
font-size: 30px;
font-weight: 600;
}
#placeDetail-capacity {
width: 100%;
}
#placeDetail-metaverse {
font-size: 10px;
font-weight: 500;
color: #cccccc;
width: 100%;
}
.fieldsSearchFilterOn {
background: #0085b5;
color: #00bbff;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
text-align: center;
}
button.fieldsSearchFilterOn:hover {
border: solid #00bbff 1px;
}
.fieldsSearchFilterOff {
background: #333333;
color: #888888;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
text-align: center;
}
button.fieldsSearchFilterOff:hover {
border: solid #888888 1px;
}
::-webkit-scrollbar {
width: 16px;
height: 10px;
}
::-webkit-scrollbar-track {
background-color: #2e2e2e;
}
::-webkit-scrollbar-thumb {
background-color: #696969;
border: 2px solid #2e2e2e;
border-radius: 8px;
}
div.warningEntry {
width: 100%;
height: 30px;
background: rgba(255,128,0,0.2);
border: 0px;
text-align: left;
padding-bottom: 4px;
}
.warningTable {
width: 79%;
vertical-align: top;
}
td.warningTitle {
font-size: 12px;
font-weight: 500;
font-style: none;
color: #ffa200;
text-align: left;
}
.metaverseTitle {
color: #ffffff;
font-size: 16px;
font-weight: 700;
text-decoration: none;
text-shadow: 1px 1px 3px #000000;
}
.metaverseRegion {
font-size: 10px;
font-style: none;
color: #ffffff;
text-align: left;
}
.region-LOCAL {
color: #ffbc00;
}
.region-FEDERATION {
color: #00ff58;
}
.region-EXTERNAL {
color: #00e2ff;
}
.filterRegionOff {
background: #333333;
color: #888888;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
}
button.filterRegionOff:hover {
border: solid #888888 1px;
}
.localFilterOn {
background: #ad8000;
color: #ffbc00;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
}
button.localFilterOn:hover {
border: solid #ffbc00 1px;
}
.federationFilterOn {
background: #00ad3c;
color: #00ff58;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
}
button.federationFilterOn:hover {
border: solid #00ff58 1px;
}
.externalFilterOn {
background: #009aad;
color: #00e2ff;
font-size: 10px;
padding: 1px 2px 1px 2px;
border: solid #000000 1px;
text-decoration: none;
}
button.externalFilterOn:hover {
border: solid #00e2ff 1px;
}

View file

@ -0,0 +1,758 @@
<!DOCTYPE html>
<!--
//
// places.html
//
// Created by Alezia Kurdis, January 1st, 2022.
// Copyright 2022, Overte contributors.
//
// html for the ui of the Places application.
//
// 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">
<title>Places</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="fonts.css">
<link rel="stylesheet" href="places.css">
<script>
var thisPageName = "places.html";
var currentPath = window.location.protocol + "//" + window.location.host + window.location.pathname;
var ROOTPATH = currentPath.replace(thisPageName, "");
var channel = "com.overte.places";
var placeList = [];
var currentLocation = "";
var warning = "";
var metaverseList = [];
var lifeOnlyFilter = false;
var localFilter = true;
var federationFilter = true;
var externalFilter = true;
var maturityFilter = ["adult", "mature", "teen", "everyone", "unrated"];
var seachedFieldsFilter = ["name", "description", "owners", "tags"];
var NUMBER_OF_RECORDS_PER_LOAD = 20;
var loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
var currentListFormat = "PLACES";
</script>
</head>
<body>
<div id="toolbar">
<table id='navigationBarContainer'>
<tr valign = 'middle'>
<td width = '20%'>
<div id='navigationBar'>
<input type='image' class='navBtn' src='icons/home.png' onClick = 'goHome();'>
<input type='image' class='navBtn' src='icons/back.png' onClick = 'goBack();'>
<input type='image' class='navBtn' src='icons/forward.png' onClick = 'goForward();'>
</div>
</td>
<td width = '80%'>
<table id='searchTableExternal'>
<tr>
<td width='90%'>
<div id='searchFrame'>
<table id='searchTable'>
<tr>
<td width='90%' align='right'><input id='search' placeholder= 'Search / Visit' type = 'text' onkeyup = 'filterSearch();'></td>
<td width='10%'><a href="javascript:void(0)" id='clearBtn' onClick = 'clearSearch();'>&times;</a></td>
</tr>
</table>
</div>
</td>
<td width='10%' align='left'><input type='image' class='searchBtn' src='icons/teleport.png' onClick = 'teleportUsingAddressBarValue(document.getElementById("search").value);'></td>
</tr>
</table>
</td>
</tr>
</table>
<div id='filters'>
<div id="searchFiltersBar">
<button title="Name" class='fieldsSearchFilterOn' id='searchFilterName' onClick = 'filterSearchFeild("name");'>NAME</button>
<button title="Description" class='fieldsSearchFilterOn' id='searchFilterDesc' onClick = 'filterSearchFeild("description");'>DESC</button>
<button title="Owners" class='fieldsSearchFilterOn' id='searchFilterOwners' onClick = 'filterSearchFeild("owners");'>OWNERS</button>
<button title="Tags" class='fieldsSearchFilterOn' id='searchFilterTags' onClick = 'filterSearchFeild("tags");'>TAGS</button>
&nbsp;&nbsp;&nbsp;
</div>
<button class='localFilterOn' id='localPlacesFilter' onClick = 'filterRegion("local");'>LOC</button>
<button class='federationFilterOn' id='fedPlacesFilter' onClick = 'filterRegion("federation");'>FED</button>
<button class='externalFilterOn' id='extPlacesFilter' onClick = 'filterRegion("external");'>EXT</button>
&nbsp;&nbsp;&nbsp;
<button class='filterLifeOff' id='presenceOfLife' onClick = 'filterLifeOnly();'>USERS</button>
&nbsp;&nbsp;&nbsp;
<button title="Adult" class='adultFilterOn' id='maturityAdult' onClick = 'filterMaturity("adult");'>A</button>
<button title="Mature" class='matureFilterOn' id='maturityMature' onClick = 'filterMaturity("mature");'>M</button>
<button title="Teen" class='teenFilterOn' id='maturityTeen' onClick = 'filterMaturity("teen");'>T</button>
<button title="Everyone" class='everyoneFilterOn' id='maturityEveryone' onClick = 'filterMaturity("everyone");'>E</button>
<button title="Unrated" class='unratedFilterOn' id='maturityUnrated' onClick = 'filterMaturity("unrated");'>U</button>
</div>
<div id='tabs'>
<button id='listFormatMetaverse' class='tabBtn' onclick='displayTab("REGIONS");' >Regions</button>
<button id='listFormatDomains' class='tabBtn' onclick='displayTab("DOMAINS");'>Domains</button>
<button id='listFormatPlaces' class='tabBtn' onclick='displayTab("PLACES");' disabled>Places</button>
</div>
</div>
<div id='list_content'><br>&nbsp;&nbsp;Loading...</div>
<div id='listInfo'></div>
<input type = 'text' readonly id='currentLocation'>
<div id="placeDetail" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeDetail();">&times;</a>
<div class="overlay-content">
<img id="placeDetail-image" onclick="closeDetail();" draggable="false">
<div id="placeDetail-placeName"></div>
<table width='100%'>
<tr valign='top'>
<td width='68%'>
<div id="placeDetail-managers"></div>
<div id="placeDetail-description"></div></td>
<td width='3%'>&nbsp;</td>
<td id="" width='29%'>
<div id="placeDetail-visitBtn-container"></div>
<div id="placeDetail-maturity"></div>
<div id="placeDetail-placedata">
DOMAIN:
<div id="placeDetail-domain"></div>
<br><br>USERS:<br>
<div id="placeDetail-users"></div>
<br><br>
<div id="placeDetail-capacity"></div>
<br><br>
REGION:
<div id="placeDetail-metaverse"></div>
<div id="placeDetail-region"></div>
</div>
</td>
</tr>
</table>
</div>
</div>
<script>
//LISTENER FROM JS FILE:
EventBridge.scriptEventReceived.connect(function (message) {
if (message.channel === channel && message.action === "PLACE_DATA") {
placeList = [];
placeList = message.data;
warning = message.warning;
metaverseList = message.metaverseServers;
generateContent();
}
if (message.channel === channel && message.action === "CURRENT_LOCATION") {
currentLocation = message.data;
displayCurrentLocation();
}
});
var goSignal = {
"channel": channel,
"action": "READY_FOR_CONTENT"
};
EventBridge.emitWebEvent(JSON.stringify(goSignal));
function reload() {
var goSignal = {
"channel": channel,
"action": "READY_FOR_CONTENT"
};
EventBridge.emitWebEvent(JSON.stringify(goSignal));
closeDetail();
}
function displayCurrentLocation() {
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
document.getElementById("currentLocation").value = currentLocation;
}
function sortDomainsOrder(a, b) {
var orderA = a.domainOrder.toUpperCase();
var orderB = b.domainOrder.toUpperCase();
if (orderA > orderB) {
return 1;
} else if (orderA < orderB) {
return -1;
}
if (a.domainOrder > b.domainOrder) {
return 1;
} else if (a.domainOrder < b.domainOrder) {
return -1;
}
return 0;
}
function generateContent() {
if (currentListFormat === "REGIONS") {
//Display metaverse page here
var formattedMetaverseList = "";
var metaverseCounter = 0;
for (var m = 0; m < metaverseList.length; m++) {
if (metaverseCounter === loadRecordsUpTo) {
//Display Load More button
formattedMetaverseList = formattedMetaverseList + "<div id='loadMore'><button id='loadMoreBtn' onClick='loadMore();'>LOAD MORE...</button></div>";
break;
}
var regionStyle = "";
if (metaverseList[m].order === "A") {
regionStyle = " style='background-color: #574000;'";
} else if (metaverseList[m].order === "F") {
regionStyle = " style='background-color: #00571e;'";
} else if (metaverseList[m].order === "Z") {
regionStyle = " style='background-color: #004d57;'";
}
formattedMetaverseList = formattedMetaverseList + "<div class = 'placeEntry' id='place-" + metaverseList[m].url + "'" + regionStyle + "><div class = 'blur'>";
formattedMetaverseList = formattedMetaverseList + "<table class='placeTable'>";
formattedMetaverseList = formattedMetaverseList + " <tr valign = 'top'>";
formattedMetaverseList = formattedMetaverseList + " <td width='2%'></td>";
formattedMetaverseList = formattedMetaverseList + " <td align='left' width='75%' ><font class= 'metaverseTitle region-" + metaverseList[m].region.toUpperCase() + "' >" + metaverseList[m].url + "</font></td>";
if (!metaverseList[m].pinned) {
formattedMetaverseList = formattedMetaverseList + " <td align='right' ><span style='padding: 0%; cursor: pointer;' onclick='pinMetaverse(" + m + ", true);'><img src='icons/notpinned.png' width='26' height='26' draggable='false'></span></td>";
} else {
formattedMetaverseList = formattedMetaverseList + " <td align='right' ><span style='padding: 0%; cursor: pointer;' onclick='pinMetaverse(" + m + ", false);'><img src='icons/pinned.png' width='26' height='26' draggable='false'></span></td>";
}
formattedMetaverseList = formattedMetaverseList + " </tr>";
formattedMetaverseList = formattedMetaverseList + "</table>";
formattedMetaverseList = formattedMetaverseList + "<table class='placeTable'>";
formattedMetaverseList = formattedMetaverseList + " <tr valign='middle'>";
formattedMetaverseList = formattedMetaverseList + " <td width='2%'></td>";
if (!metaverseList[m].fetch) {
formattedMetaverseList = formattedMetaverseList + " <td align='left' width='50%'><span style='padding: 0%; cursor: pointer;' onclick='fetchMetaverse(" + m + ", true);'><img src='icons/notfetched.png' width='40' height='16' draggable='false'></span></td>";
} else {
formattedMetaverseList = formattedMetaverseList + " <td align='left' width='50%'><span style='padding: 0%; cursor: pointer;' onclick='fetchMetaverse(" + m + ", false);'><img src='icons/fetched.png' width='40' height='16' draggable='false'></span></td>";
}
formattedMetaverseList = formattedMetaverseList + " <td align='right' width='50%' ><font class='metaverseRegion region-" + metaverseList[m].region.toUpperCase() + "'>" + metaverseList[m].region.toUpperCase() + "</font></td>";
formattedMetaverseList = formattedMetaverseList + " </tr>";
formattedMetaverseList = formattedMetaverseList + "</table>";
formattedMetaverseList = formattedMetaverseList + "</div></div>";
metaverseCounter++;
}
document.getElementById("searchFiltersBar").style.display = "none";
document.getElementById("list_content").innerHTML = formattedMetaverseList;
var metaversePageInfo = " nodes";
if (metaverseCounter <= 1) {
metaversePageInfo = " node";
}
document.getElementById("listInfo").innerHTML = metaverseCounter + metaversePageInfo + " of " + metaverseList.length + ".";
} else {
var placeRecords = placeList.slice();
if (currentListFormat === "DOMAINS") {
placeRecords.sort(sortDomainsOrder);
}
var currentDomain = "";
var counter = 0;
var formatedList = "";
if (warning !== "") {
formatedList = formatedList + "<div class='warningEntry'>";
formatedList = formatedList + "<table class='warningTable'>";
formatedList = formatedList + "<tr>";
formatedList = formatedList + "<td width='5%'>&nbsp;</td>";
formatedList = formatedList + "<td width='95%' valign='top' class='warningTitle'>" + warning + "</td>";
formatedList = formatedList + "</tr>";
formatedList = formatedList + "</table>";
formatedList = formatedList + "</div>";
}
for (var i = 0; i < placeRecords.length; i++) {
if (counter === loadRecordsUpTo) {
//Display Load More button
formatedList = formatedList + "<div id='loadMore'><button id='loadMoreBtn' onClick='loadMore();'>LOAD MORE...</button></div>";
break;
}
/*
Here's where you generate the list.
This is the data that you can use to build each portal:
placeRecords[i].order
//String (Just a sequence used to establish the current ordering.
//No expected to be use, the list is already sorted based on it for you when the page get the data.)
placeRecords[i].category
//STRING (Possible Values:
//"A" = Attraction (places that have a thumbnail to attact trafic)
//"Z" = Other (places that have no tumbnail to not attract trafic, since it's not an attraction.)
//"Z" = Utilitary things like localhost
//The ordering is already sorting the event in top of the list.
//You could also have checked if the thumbnail exist or not.
placeRecords[i].accessStatus
//String (Possible values: FULL/LIFE/NOBODY
//This indicate if there are presence of people or not, and if the domain is full capacity.
//This will be used to display "Life" indicator (green) or "Full" (red)
placeRecords[i].name
//String (This is the name of the Place. We might want a keyword filter based on this content)
placeRecords[i].description
//String (This is the description of the Place. We might want a keyword filter based on this content)
//To display in a place detail tab?
placeRecords[i].thumbnail
String (This is the url of the place picture)
placeRecords[i].maturity
String | "unrated", "adult", "mature", "teen", "everyone" (we might want a filter based on that)
placeRecords[i].address
String (This is the hifi url of the place. To make a teleporter link, use the function teleport(placeID, address))
placeRecords[i].current_attendance
Number (The number of people currently in the Domain. domain.num_users)
placeRecords[i].id
String (This is the place ID, this can be used for any external storage)
placeRecords[i].visibility
String | 'open', 'friends', 'connections', 'private'
(for now only "open" are return by the api, so nothing to do with this.
Eventually, if we could have something to know if Annonymous are allowed,
we could disply but lock the place where anonymous are not welcome, if the connected user is anonnymous.
So they might see an interest to get an account.)
placeRecords[i].capacity
Number (Would be the max number of user allowed in the targetted domain.)
placeRecords[i].tags
String: Preformated list of tags
placeRecords[i].managers
String: Preformated list of owners
placeRecords[i].domain
String: Name of the domain where the place is.
placeRecords[i].domainOrder
String: (Just a sequence used to establish the "per Domain" list).
placeRecords[i].metaverseServer
String: Metaverse server identifier (base url)
placeRecords[i].metaverseRegion
String: metaverse server regionality: local, federation, external
*/
var searchedText = document.getElementById("search").value;
if (searchedText !== "") {
displaySearchFieldsFilter();
document.getElementById("searchFiltersBar").style.display = "inline-block";
} else {
document.getElementById("searchFiltersBar").style.display = "none";
}
var lowerCasePlaceName = placeRecords[i].name.toLowerCase();
var lowerCasePlaceDescription = placeRecords[i].description.toLowerCase();
var lowerCasePlaceManagers = placeRecords[i].managers.toLowerCase();
var lowerCasePlaceTags = placeRecords[i].tags.toLowerCase();
if ((localFilter && placeRecords[i].metaverseRegion === "local") ||
(federationFilter && placeRecords[i].metaverseRegion === "federation") ||
(externalFilter && placeRecords[i].metaverseRegion === "external")) {
if ((lifeOnlyFilter && placeRecords[i].accessStatus !== "NOBODY") || !lifeOnlyFilter) {
if ( maturityFilter.indexOf(placeRecords[i].maturity) !== -1){
if ((lowerCasePlaceName.indexOf(searchedText.toLowerCase()) !== -1 && seachedFieldsFilter.indexOf("name") !== -1) ||
(lowerCasePlaceDescription.indexOf(searchedText.toLowerCase()) !== -1 && seachedFieldsFilter.indexOf("description") !== -1) ||
(lowerCasePlaceManagers.indexOf(searchedText.toLowerCase()) !== -1 && seachedFieldsFilter.indexOf("owners") !== -1) ||
(lowerCasePlaceTags.indexOf(searchedText.toLowerCase()) !== -1 && seachedFieldsFilter.indexOf("tags") !== -1) ) {
if (currentListFormat === "DOMAINS" && currentDomain !== placeRecords[i].domain) {
var capacity = "?";
if (placeRecords[i].capacity !== 0) {
capacity = placeRecords[i].capacity;
}
//display Domain section
formatedList = formatedList + "<div id='domainEntry' class='domainEntry'>";
formatedList = formatedList + "<table class='domainTable'>";
formatedList = formatedList + "<tr>";
formatedList = formatedList + "<td width='5%'>&nbsp;</td>";
formatedList = formatedList + "<td width='70%' valign='top' class='domainTitle'>" + placeRecords[i].domain + "</td>";
formatedList = formatedList + "<td width='25%' align='right' valign='top'><font class='domain-nbrUser " + placeRecords[i].accessStatus + "'><font class='domain-nbrUser_small'>USERS:</font> " + placeRecords[i].current_attendance + "</font>";
formatedList = formatedList + "<font class='domain-capacity'><br>CAPACITY: " + capacity + "</font></td>";
formatedList = formatedList + "</tr>";
formatedList = formatedList + "</table>";
formatedList = formatedList + "</div>";
currentDomain = placeRecords[i].domain;
}
var moreStyle = "";
if (placeRecords[i].category === "A") {
moreStyle = " style='background-image: url(" + placeRecords[i].thumbnail + "); background-repeat: no-repeat; background-position: 50% 50%; background-size: cover;'";
} else if (placeRecords[i].category === "Z") {
moreStyle = " style='background-color: #364a6e;'";
} else if (placeRecords[i].category === "U") { //TO REMOVE ONCE BEACONS GET REMOVED
moreStyle = " style='background-color: #38130f;'";
}
var shortenedDescription = placeRecords[i].description.substr(0, 55);
if (shortenedDescription.slice(-1) !== ".") {
shortenedDescription = shortenedDescription + "...";
}
var placeUrl = "hifi://" + placeRecords[i].name;
if (placeRecords[i].category === "U") { //TO REMOVE ONCE BEACONS GET REMOVED
placeUrl = placeRecords[i].address;
} else if (placeRecords[i].metaverseRegion !== "local") {
placeUrl = "hifi://" + placeRecords[i].address;
}
//Add the place to the list
formatedList = formatedList + "<div class = 'placeEntry' id='place-" + placeRecords[i].id + "'" + moreStyle + "><div class = 'blur'>";
formatedList = formatedList + "<table class='placeTable'>";
formatedList = formatedList + " <tr valign = 'top'>";
formatedList = formatedList + " <td width='2%'></td>";
formatedList = formatedList + " <td align='left' width='75%' onclick='teleport(" + '"' + placeRecords[i].id + '"' + ", " + '"' + placeUrl + '"' + "); return false;'><a class= 'placeTitle' href='javascript:void(0)' onclick='teleport(" + '"' + placeRecords[i].id + '"' + ", " + '"' + placeRecords[i].address + '"' + "); return false;'>" + placeRecords[i].name + "</a></td>";
if (placeRecords[i].category !== "Z") {
formatedList = formatedList + " <td align='right' ><span style='padding: 0%; cursor: pointer;' onclick='openDetail(" + '"' + placeRecords[i].id + '"' + ")'><img src='icons/info.png' width='26' height='26' draggable='false'></span></td>";
}
formatedList = formatedList + " </tr>";
formatedList = formatedList + "</table>";
if (placeRecords[i].category !== "Z") {
formatedList = formatedList + "<table class='placeTable'>";
formatedList = formatedList + " <tr>";
formatedList = formatedList + " <td width='2%'></td>";
formatedList = formatedList + " <td align='left' width='88%' class='place-entry-description' onclick='teleport(" + '"' + placeRecords[i].id + '"' + ", " + '"' + placeUrl + '"' + "); return false;'>" + shortenedDescription + "</td>";
formatedList = formatedList + " <td align='right' class='presenceOfLife-" + placeRecords[i].accessStatus + "'>&#9603;</td>";
formatedList = formatedList + " </tr>";
formatedList = formatedList + "</table>";
}
formatedList = formatedList + "</div></div>";
counter++;
}
}
}
}
}
document.getElementById("list_content").innerHTML = formatedList;
var placeInfo = " places";
if (counter <= 1) {
placeInfo = " place";
}
document.getElementById("listInfo").innerHTML = counter + placeInfo + " of " + placeRecords.length + ".";
}
}
function loadMore() {
loadRecordsUpTo = loadRecordsUpTo + NUMBER_OF_RECORDS_PER_LOAD;
generateContent();
}
function teleport(placeID, address) {
var teleportOrder = {
"channel": channel,
"action": "TELEPORT",
"placeID": placeID,
"address": address
};
EventBridge.emitWebEvent(JSON.stringify(teleportOrder));
}
function goHome() {
var message = {
"channel": channel,
"action": "GO_HOME"
};
EventBridge.emitWebEvent(JSON.stringify(message));
}
function goBack() {
var message = {
"channel": channel,
"action": "GO_BACK"
};
EventBridge.emitWebEvent(JSON.stringify(message));
}
function goForward() {
var message = {
"channel": channel,
"action": "GO_FORWARD"
};
EventBridge.emitWebEvent(JSON.stringify(message));
}
function pinMetaverse(metaverseIndex, pinned) {
var message = {
"channel": channel,
"action": "PIN_META",
"metaverseIndex": metaverseIndex,
"value": pinned
};
EventBridge.emitWebEvent(JSON.stringify(message));
sleepFor(210);
reload();
}
function fetchMetaverse(metaverseIndex, fetch) {
var message = {
"channel": channel,
"action": "FETCH_META",
"metaverseIndex": metaverseIndex,
"value": fetch
};
EventBridge.emitWebEvent(JSON.stringify(message));
sleepFor(210);
reload();
}
function filterLifeOnly() {
if (lifeOnlyFilter) {
lifeOnlyFilter = false;
document.getElementById("presenceOfLife").className = "filterLifeOff";
} else {
lifeOnlyFilter = true;
document.getElementById("presenceOfLife").className = "lifeFilterOn";
}
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
generateContent();
}
function filterRegion(region) {
if (region === "local") {
if (localFilter) {
localFilter = false;
document.getElementById("localPlacesFilter").className = "filterRegionOff";
} else {
localFilter = true;
document.getElementById("localPlacesFilter").className = "localFilterOn";
}
}
if (region === "federation") {
if (federationFilter) {
federationFilter = false;
document.getElementById("fedPlacesFilter").className = "filterRegionOff";
} else {
federationFilter = true;
document.getElementById("fedPlacesFilter").className = "federationFilterOn";
}
}
if (region === "external") {
if (externalFilter) {
externalFilter = false;
document.getElementById("extPlacesFilter").className = "filterRegionOff";
} else {
externalFilter = true;
document.getElementById("extPlacesFilter").className = "externalFilterOn";
}
}
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
generateContent();
}
function filterMaturity(targeted) {
if (maturityFilter.indexOf(targeted) === -1) {
maturityFilter.push(targeted);
} else {
maturityFilter = arrayRemove(maturityFilter, targeted);
}
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
displayMaturityFilter();
generateContent();
}
function filterSearchFeild(targeted) {
if (seachedFieldsFilter.indexOf(targeted) === -1) {
seachedFieldsFilter.push(targeted);
} else {
seachedFieldsFilter = arrayRemove(seachedFieldsFilter, targeted);
}
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
displaySearchFieldsFilter();
generateContent();
}
function arrayRemove(arr, value) {
return arr.filter(function(ele){
return ele != value;
});
}
function displayMaturityFilter() {
if (maturityFilter.indexOf("adult") === -1) {
document.getElementById("maturityAdult").className = "filterOff";
} else {
document.getElementById("maturityAdult").className = "adultFilterOn";
}
if (maturityFilter.indexOf("mature") === -1) {
document.getElementById("maturityMature").className = "filterOff";
} else {
document.getElementById("maturityMature").className = "matureFilterOn";
}
if (maturityFilter.indexOf("teen") === -1) {
document.getElementById("maturityTeen").className = "filterOff";
} else {
document.getElementById("maturityTeen").className = "teenFilterOn";
}
if (maturityFilter.indexOf("everyone") === -1) {
document.getElementById("maturityEveryone").className = "filterOff";
} else {
document.getElementById("maturityEveryone").className = "everyoneFilterOn";
}
if (maturityFilter.indexOf("unrated") === -1) {
document.getElementById("maturityUnrated").className = "filterOff";
} else {
document.getElementById("maturityUnrated").className = "unratedFilterOn";
}
}
function displaySearchFieldsFilter() {
if (seachedFieldsFilter.indexOf("name") === -1) {
document.getElementById("searchFilterName").className = "fieldsSearchFilterOff";
} else {
document.getElementById("searchFilterName").className = "fieldsSearchFilterOn";
}
if (seachedFieldsFilter.indexOf("description") === -1) {
document.getElementById("searchFilterDesc").className = "fieldsSearchFilterOff";
} else {
document.getElementById("searchFilterDesc").className = "fieldsSearchFilterOn";
}
if (seachedFieldsFilter.indexOf("owners") === -1) {
document.getElementById("searchFilterOwners").className = "fieldsSearchFilterOff";
} else {
document.getElementById("searchFilterOwners").className = "fieldsSearchFilterOn";
}
if (seachedFieldsFilter.indexOf("tags") === -1) {
document.getElementById("searchFilterTags").className = "fieldsSearchFilterOff";
} else {
document.getElementById("searchFilterTags").className = "fieldsSearchFilterOn";
}
}
function filterSearch() {
document.getElementById("clearBtn").style.display = "block";
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
generateContent();
}
function teleportUsingAddressBarValue(url) {
var finalizedUrl = url;
if (url.substr(0, 7).toLocaleLowerCase() !== "http://" &&
url.substr(0, 8).toLocaleLowerCase() !== "https://" &&
url.substr(0, 7).toLocaleLowerCase() !== "hifi://") {
finalizedUrl = "hifi://" + url;
}
teleport("", finalizedUrl);
}
function clearSearch() {
document.getElementById("search").value = "";
document.getElementById("clearBtn").style.display = "none";
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
generateContent();
}
function displayTab(tab) {
currentListFormat = tab;
if (tab === "PLACES") {
document.getElementById("listFormatPlaces").disabled = true;
document.getElementById("listFormatDomains").disabled = false;
document.getElementById("listFormatMetaverse").disabled = false;
} else if (tab === "DOMAINS") {
document.getElementById("listFormatPlaces").disabled = false;
document.getElementById("listFormatDomains").disabled = true;
document.getElementById("listFormatMetaverse").disabled = false;
} else if (tab === "REGIONS") {
document.getElementById("listFormatPlaces").disabled = false;
document.getElementById("listFormatDomains").disabled = false;
document.getElementById("listFormatMetaverse").disabled = true;
}
loadRecordsUpTo = NUMBER_OF_RECORDS_PER_LOAD;
generateContent();
}
function openDetail(placeId) {
for (var k=0; k < placeList.length; k++) {
if (placeList[k].id === placeId) {
var placeDetail = placeList[k];
break;
}
}
document.getElementById("placeDetail-image").src = "";
if (placeDetail.thumbnail === "") {
document.getElementById("placeDetail-image").src = "icons/placeholder_" + placeDetail.metaverseRegion + ".jpg";
} else {
document.getElementById("placeDetail-image").src = placeDetail.thumbnail;
}
document.getElementById("placeDetail-placeName").innerHTML = placeDetail.name;
document.getElementById("placeDetail-managers").innerHTML = "By <br>&nbsp;&nbsp;&nbsp;&nbsp;" + placeDetail.managers;
document.getElementById("placeDetail-description").innerHTML = placeDetail.description;
var placeUrl = "hifi://" + placeDetail.name;
if (placeDetail.category === "U") { //TO REMOVE ONCE BEACONS GET REMOVED
placeUrl = placeDetail.address;
} else if (placeDetail.metaverseRegion !== "local") {
placeUrl = "hifi://" + placeDetail.address;
}
document.getElementById("placeDetail-visitBtn-container").innerHTML = "<button id='placeDetail-visitBtn' onclick='teleport(" + '"' + placeDetail.id + '"' + ", " + '"' + placeUrl + '"' + "); return false;'>Visit</button>";
document.getElementById("placeDetail-maturity").innerHTML = placeDetail.maturity.toUpperCase();
document.getElementById("placeDetail-maturity").className = placeDetail.maturity + "FilterOn placeMaturity";
document.getElementById("placeDetail-domain").innerHTML = placeDetail.domain.toUpperCase();
document.getElementById("placeDetail-users").innerHTML = "<font class='" + placeDetail.accessStatus + "'>" + placeDetail.current_attendance + "</font>";
var capacity = "UNDEFINED";
if (placeDetail.capacity !== 0) {
capacity = placeDetail.capacity;
}
document.getElementById("placeDetail-capacity").innerHTML = "CAPACITY: <b>" + capacity + "</b>";
document.getElementById("placeDetail-metaverse").innerHTML = "<font class='region-" + placeDetail.metaverseRegion.toUpperCase() + "'>" + placeDetail.metaverseServer + "</font>";
document.getElementById("placeDetail-region").innerHTML = "<font class='region-" + placeDetail.metaverseRegion.toUpperCase() + "'>" + placeDetail.metaverseRegion.toUpperCase() + "</font>";
document.getElementById("placeDetail").style.width = "100%";
}
function closeDetail() {
document.getElementById("placeDetail").style.width = "0%";
}
function sleepFor( milliseconds ){
var now = new Date().getTime();
while(new Date().getTime() < now + milliseconds){ /* do nothing */ }
}
displayMaturityFilter();
document.getElementById("clearBtn").style.display = "none";
document.getElementById("searchFiltersBar").style.display = "none";
</script>
</body>
</html>

View file

@ -0,0 +1,588 @@
"use strict";
//
// places.js
//
// Created by Alezia Kurdis, January 1st, 2022.
// Copyright 2022, Overte contributors.
//
// Generate an explore app based on the differents source of placename data.
//
// 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 jsMainFileName = "places.js";
var ROOT = Script.resolvePath('').split(jsMainFileName)[0];
var metaverseServers = [];
var SETTING_METAVERSE_TO_FETCH = "placesAppMetaverseToFetch";
var SETTING_PINNED_METAVERSE = "placesAppPinnedMetaverse";
var httpRequest = null;
var placesData;
var portalList = [];
var nbrPlacesNoProtocolMatch = 0;
var nbrPlaceProtocolKnown = 0;
var APP_NAME = "PLACES";
var APP_URL = ROOT + "places.html";
var APP_ICON_INACTIVE = ROOT + "icons/appicon_i.png";
var APP_ICON_ACTIVE = ROOT + "icons/appicon_a.png";
var appStatus = false;
var channel = "com.overte.places";
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,
sortOrder: 8
});
var timestamp = 0;
var INTERCALL_DELAY = 200; //0.3 sec
var PERSISTENCE_ORDERING_CYCLE = 5 * 24 * 3600 * 1000; //5 days
function clicked(){
if (appStatus === true) {
tablet.webEventReceived.disconnect(onAppWebEventReceived);
tablet.gotoHomeScreen();
appStatus = false;
} else {
tablet.gotoWebScreen(APP_URL);
tablet.webEventReceived.connect(onAppWebEventReceived);
appStatus = true;
}
button.editProperties({
isActive: appStatus
});
}
button.clicked.connect(clicked);
function onAppWebEventReceived(message) {
var d = new Date();
var n = d.getTime();
var messageObj = JSON.parse(message);
if (messageObj.channel === channel) {
if (messageObj.action === "READY_FOR_CONTENT" && (n - timestamp) > INTERCALL_DELAY) {
d = new Date();
timestamp = d.getTime();
transmitPortalList();
sendCurrentLocationToUI();
} else if (messageObj.action === "TELEPORT" && (n - timestamp) > INTERCALL_DELAY) {
d = new Date();
timestamp = d.getTime();
if (messageObj.address.length > 0) {
Window.location = messageObj.address;
}
} else if (messageObj.action === "GO_HOME" && (n - timestamp) > INTERCALL_DELAY) {
if (LocationBookmarks.getHomeLocationAddress()) {
location.handleLookupString(LocationBookmarks.getHomeLocationAddress());
} else {
location.goToLocalSandbox();
}
} else if (messageObj.action === "GO_BACK" && (n - timestamp) > INTERCALL_DELAY) {
location.goBack();
} else if (messageObj.action === "GO_FORWARD" && (n - timestamp) > INTERCALL_DELAY) {
location.goForward();
} else if (messageObj.action === "PIN_META" && (n - timestamp) > INTERCALL_DELAY) {
d = new Date();
timestamp = d.getTime();
metaverseServers[messageObj.metaverseIndex].pinned = messageObj.value;
savePinnedMetaverseSetting();
} else if (messageObj.action === "FETCH_META" && (n - timestamp) > INTERCALL_DELAY) {
d = new Date();
timestamp = d.getTime();
metaverseServers[messageObj.metaverseIndex].fetch = messageObj.value;
saveMetaverseToFetchSetting();
}
}
}
function savePinnedMetaverseSetting() {
var pinnedServers = [];
for (var q = 0; q < metaverseServers.length; q++) {
if (metaverseServers[q].pinned) {
pinnedServers.push(metaverseServers[q].url);
}
}
Settings.setValue(SETTING_PINNED_METAVERSE, pinnedServers);
}
function saveMetaverseToFetchSetting() {
var fetchedServers = [];
for (var q = 0; q < metaverseServers.length; q++) {
if (metaverseServers[q].fetch) {
fetchedServers.push(metaverseServers[q].url);
}
}
Settings.setValue(SETTING_METAVERSE_TO_FETCH, fetchedServers);
}
function onHostChanged(host) {
sendCurrentLocationToUI();
}
location.hostChanged.connect(onHostChanged);
function sendCurrentLocationToUI() {
var currentLocationMessage = {
"channel": channel,
"action": "CURRENT_LOCATION",
"data": location.href
};
tablet.emitScriptEvent(currentLocationMessage);
}
function onScreenChanged(type, url) {
if (type == "Web" && url.indexOf(APP_URL) != -1) {
appStatus = true;
} else {
appStatus = false;
}
button.editProperties({
isActive: appStatus
});
}
function transmitPortalList() {
metaverseServers = [];
buildMetaverseServerList();
portalList = [];
nbrPlacesNoProtocolMatch = 0;
nbrPlaceProtocolKnown = 0;
var extractedData;
for (var i = 0; i < metaverseServers.length; i++ ) {
if (metaverseServers[i].fetch === true) {
extractedData = getContent(metaverseServers[i].url + "/api/v1/places?status=online" + "&acash=" + Math.floor(Math.random() * 999999));
try {
placesData = JSON.parse(extractedData);
processData(metaverseServers[i]);
} catch(e) {
placesData = {};
}
httpRequest = null;
}
}
//################### TO REMOVED ONCE NO MORE USED #####################
getDeprecatedBeaconsData();
//################### END: TO REMOVED ONCE NO MORE USED #####################
addUtilityPortals();
portalList.sort(sortOrder);
var percentProtocolRejected = Math.floor((nbrPlacesNoProtocolMatch/nbrPlaceProtocolKnown) * 100);
var warning = "";
if (percentProtocolRejected > 50) {
warning = "WARNING: " + percentProtocolRejected + "% of the places are not listed because they are running under a different protocol. Maybe consider to upgrade.";
}
var message = {
"channel": channel,
"action": "PLACE_DATA",
"data": portalList,
"warning": warning,
"metaverseServers": metaverseServers
};
tablet.emitScriptEvent(message);
};
function getFederationData() {
/*
//If federation.json is got from the Metaverse Server (not implemented yet)
var fedDirectoryUrl = AccountServices.metaverseServerURL + "/federation.json";
var extractedFedData = getContent(fedDirectoryUrl);
*/
/*
//If federation.json is got from a web storage
var fedDirectoryUrl = ROOT + "federation.json"; + "?version=" + Math.floor(Math.random() * 999999);
var extractedFedData = getContent(fedDirectoryUrl);
*/
//if federation.json is local, on the user installation
var extractedFedData = JSON.stringify(Script.require("./federation.json"));
return extractedFedData;
}
function buildMetaverseServerList () {
var extractedFedData = getFederationData();
var pinnedMetaverses = Settings.getValue(SETTING_PINNED_METAVERSE, []);
var metaversesToFetch = Settings.getValue(SETTING_METAVERSE_TO_FETCH, []);
var federation = [];
try {
federation = JSON.parse(extractedFedData);
} catch(e) {
federation = [];
}
var currentFound = false;
var region, pinned, fetch, order, metaverse;
for (var i=0; i < federation.length; i++) {
if (federation[i].node === AccountServices.metaverseServerURL) {
region = "local";
order = "A";
fetch = true;
pinned = false;
currentFound = true;
} else {
region = "federation";
order = "F";
fetch = false;
pinned = false;
}
metaverse = {
"url": federation[i].node,
"region": region,
"fetch": fetch,
"pinned": pinned,
"order": order
};
metaverseServers.push(metaverse);
}
if (!currentFound) {
metaverse = {
"url": AccountServices.metaverseServerURL,
"region": "local",
"fetch": true,
"pinned": false,
"order": "A"
};
metaverseServers.push(metaverse);
}
for (i = 0; i < pinnedMetaverses.length; i++) {
var target = pinnedMetaverses[i];
var found = false;
for (var k = 0; k < metaverseServers.length; k++) {
if (metaverseServers[k].url === target) {
metaverseServers[k].pinned = true;
found = true;
break;
}
}
if (!found) {
metaverse = {
"url": target,
"region": "external",
"fetch": false,
"pinned": true,
"order": "Z"
};
metaverseServers.push(metaverse);
}
}
for (i = 0; i < metaversesToFetch.length; i++) {
var target = metaversesToFetch[i];
for (var k = 0; k < metaverseServers.length; k++) {
if (metaverseServers[k].url === target) {
metaverseServers[k].fetch = true;
break;
}
}
}
metaverseServers.sort(sortOrder);
}
function getContent(url) {
httpRequest = new XMLHttpRequest();
httpRequest.open("GET", url, false); // false for synchronous request
httpRequest.send( null );
return httpRequest.responseText;
}
function processData(metaverseInfo){
var supportedProtocole = Window.protocolSignature();
var places = placesData.data.places;
for (var i = 0;i < places.length; i++) {
var region, category, accessStatus;
var description = (places[i].description ? places[i].description : "");
var thumbnail = (places[i].thumbnail ? places[i].thumbnail : "");
if ( places[i].domain.protocol_version === supportedProtocole ) {
region = metaverseInfo.order;
if ( thumbnail.substr(0, 4).toLocaleLowerCase() !== "http") {
category = "O"; //Other
} else {
category = "A"; //Attraction
}
if (places[i].domain.num_users > 0) {
if (places[i].domain.num_users >= places[i].domain.capacity && places[i].domain.capacity !== 0) {
accessStatus = "FULL";
} else {
accessStatus = "LIFE";
}
} else {
accessStatus = "NOBODY";
}
var portal = {
"order": category + "_" + region + "_" + getSeededRandomForString(places[i].id),
"category": category,
"accessStatus": accessStatus,
"name": places[i].name,
"description": description,
"thumbnail": thumbnail,
"maturity": places[i].maturity,
"address": places[i].address,
"current_attendance": places[i].domain.num_users,
"id": places[i].id,
"visibility": places[i].visibility,
"capacity": places[i].domain.capacity,
"tags": getListFromArray(places[i].tags),
"managers": getListFromArray(places[i].managers),
"domain": places[i].domain.name,
"domainOrder": aplphabetize(zeroPad(places[i].domain.num_users, 6)) + "_" + places[i].domain.name + "_" + places[i].name,
"metaverseServer": metaverseInfo.url,
"metaverseRegion": metaverseInfo.region
};
portalList.push(portal);
} else {
nbrPlacesNoProtocolMatch++;
}
}
nbrPlaceProtocolKnown = nbrPlaceProtocolKnown + places.length;
}
//################### CODE TO REMOVED ONCE NO MORE USED #####################
function getDeprecatedBeaconsData() {
var url = "https://metaverse.vircadia.com/interim/d-goto/app/goto.json";
httpRequest = new XMLHttpRequest();
httpRequest.open("GET", url, false); // false for synchronous request
httpRequest.send( null );
var extractedData = httpRequest.responseText;
httpRequest = null;
var places;
try {
places = JSON.parse(extractedData);
} catch(e) {
places = {};
}
for (var i = 0;i < places.length; i++) {
var category, accessStatus;
var description = "...";
var thumbnail = "";
category = "U"; //uncertain
if (places[i].People > 0) {
accessStatus = "LIFE";
} else {
accessStatus = "NOBODY";
}
var shortenName = places[i]["Domain Name"].substr(0, 24);
var portal = {
"order": category + "_Z_" + getSeededRandomForString(places[i]["Domain Name"]),
"category": category,
"accessStatus": accessStatus,
"name": shortenName,
"description": description,
"thumbnail": thumbnail,
"maturity": "unrated",
"address": places[i].Visit,
"current_attendance": places[i].People,
"id": "BEACON" + i,
"visibility": "open",
"capacity": 0,
"tags": "",
"managers": places[i].Owner,
"domain": "UNKNOWN (Beacon)",
"domainOrder": "ZZZZZZZZZZZZZUA",
"metaverseServer": "",
"metaverseRegion": "external"
};
portalList.push(portal);
}
}
//################### END::: CODE TO REMOVED ONCE NO MORE USED #####################
function addUtilityPortals() {
var localHostPortal = {
"order": "Z_Z_AAAAAA",
"category": "Z",
"accessStatus": "NOBODY",
"name": "localhost",
"description": "",
"thumbnail": "",
"maturity": "unrated",
"address": "localhost",
"current_attendance": 0,
"id": "",
"visibility": "open",
"capacity": 0,
"tags": "",
"managers": "",
"domain": "",
"domainOrder": "ZZZZZZZZZZZZZZA",
"metaverseServer": "",
"metaverseRegion": "local"
};
portalList.push(localHostPortal);
var tutorialPortal = {
"order": "Z_Z_AAAAAZ",
"category": "Z",
"accessStatus": "NOBODY",
"name": "tutorial",
"description": "",
"thumbnail": "",
"maturity": "unrated",
"address": "file:///~/serverless/tutorial.json",
"current_attendance": 0,
"id": "",
"visibility": "open",
"capacity": 0,
"tags": "",
"managers": "",
"domain": "",
"domainOrder": "ZZZZZZZZZZZZZZZ",
"metaverseServer": "",
"metaverseRegion": "local"
};
portalList.push(tutorialPortal);
}
function aplphabetize(num) {
var numbstring = num.toString();
var newChar = "JIHGFEDCBA";
var refChar = "0123456789";
var processed = "";
for (var j=0; j < numbstring.length; j++) {
processed = processed + newChar.substr(refChar.indexOf(numbstring.charAt(j)),1);
}
return processed;
}
function getListFromArray(dataArray) {
var dataList = "";
if (dataArray !== undefined && dataArray.length > 0) {
for (var k = 0; k < dataArray.length; k++) {
if (k !== 0) {
dataList += ", ";
}
dataList += dataArray[k];
}
if (dataArray.length > 1){
dataList += ".";
}
}
return dataList;
}
function sortOrder(a, b) {
var orderA = a.order.toUpperCase();
var orderB = b.order.toUpperCase();
if (orderA > orderB) {
return 1;
} else if (orderA < orderB) {
return -1;
}
if (a.order > b.order) {
return 1;
} else if (a.order < b.order) {
return -1;
}
return 0;
}
function zeroPad(num, places) {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
}
function getFrequentPlaces(list) {
var count = {};
list.forEach(function(list) {
count[list] = (count[list] || 0) + 1;
});
return count;
}
//####### seed random library ################
Math.seed = 75;
Math.seededRandom = function(max, min) {
max = max || 1;
min = min || 0;
Math.seed = (Math.seed * 9301 + 49297) % 233280;
var rnd = Math.seed / 233280;
return min + rnd * (max - min);
}
function getStringScore(str) {
var score = 0;
for (var j = 0; j < str.length; j++){
score += str.charAt(j).charCodeAt(0) + 1;
}
return score;
}
function getSeededRandomForString(str) {
var score = getStringScore(str);
var d = new Date();
var n = d.getTime();
var currentSeed = Math.floor(n / PERSISTENCE_ORDERING_CYCLE);
Math.seed = score * currentSeed;
return zeroPad(Math.floor(Math.seededRandom() * 100000),5);
}
//####### END of seed random library ################
function cleanup() {
if (appStatus) {
tablet.gotoHomeScreen();
tablet.webEventReceived.disconnect(onAppWebEventReceived);
}
tablet.screenChanged.disconnect(onScreenChanged);
tablet.removeButton(button);
}
Script.scriptEnding.connect(cleanup);
}());