Replace tabulations for spaces.

Replace tabulations for spaces in the code.
This commit is contained in:
Alezia Kurdis 2020-03-01 22:37:44 -05:00 committed by GitHub
parent 5c7e6e43c2
commit f3096ae74d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
//VERSION 2.0 //VERSION 2.0
// Modified by Alezia Kurdis on on 02/27/2020 // Modified by Alezia Kurdis on on 02/27/2020
// for "Project Athena" // for "Project Athena"
// //
// Addition of a tab mechanism instead of collapsible sections to reduce the scrolling. // Addition of a tab mechanism instead of collapsible sections to reduce the scrolling.
@ -49,7 +49,7 @@ const PROPERTY_MULTI_DISPLAY_MODE = Object.freeze({
const GROUPS = [ const GROUPS = [
{ {
id: "base", id: "base",
label: "ENTITY", label: "ENTITY",
properties: [ properties: [
{ {
label: NO_SELECTION, label: NO_SELECTION,
@ -127,7 +127,7 @@ const GROUPS = [
}, },
{ {
id: "shape", id: "shape",
label: "SHAPE", label: "SHAPE",
properties: [ properties: [
{ {
label: "Shape", label: "Shape",
@ -147,7 +147,7 @@ const GROUPS = [
}, },
{ {
id: "text", id: "text",
label: "TEXT", label: "TEXT",
properties: [ properties: [
{ {
label: "Text", label: "Text",
@ -235,7 +235,7 @@ const GROUPS = [
}, },
{ {
id: "zone", id: "zone",
label: "ZONE", label: "ZONE",
properties: [ properties: [
{ {
label: "Shape Type", label: "Shape Type",
@ -270,7 +270,7 @@ const GROUPS = [
}, },
{ {
id: "zone_key_light", id: "zone_key_light",
label: "ZONE KEY LIGHT", label: "ZONE KEY LIGHT",
properties: [ properties: [
{ {
label: "Key Light", label: "Key Light",
@ -340,12 +340,12 @@ const GROUPS = [
decimals: 2, decimals: 2,
propertyID: "keyLight.shadowMaxDistance", propertyID: "keyLight.shadowMaxDistance",
showPropertyRule: { "keyLightMode": "enabled" }, showPropertyRule: { "keyLightMode": "enabled" },
} }
] ]
}, },
{ {
id: "zone_skybox", id: "zone_skybox",
label: "ZONE SKYBOX", label: "ZONE SKYBOX",
properties: [ properties: [
{ {
label: "Skybox", label: "Skybox",
@ -364,12 +364,12 @@ const GROUPS = [
type: "string", type: "string",
propertyID: "skybox.url", propertyID: "skybox.url",
showPropertyRule: { "skyboxMode": "enabled" }, showPropertyRule: { "skyboxMode": "enabled" },
} }
] ]
}, },
{ {
id: "zone_ambient_light", id: "zone_ambient_light",
label: "ZONE AMBIENT LIGHT", label: "ZONE AMBIENT LIGHT",
properties: [ properties: [
{ {
label: "Ambient Light", label: "Ambient Light",
@ -399,12 +399,12 @@ const GROUPS = [
className: "black", onClick: copySkyboxURLToAmbientURL } ], className: "black", onClick: copySkyboxURLToAmbientURL } ],
propertyID: "copyURLToAmbient", propertyID: "copyURLToAmbient",
showPropertyRule: { "ambientLightMode": "enabled" }, showPropertyRule: { "ambientLightMode": "enabled" },
} }
] ]
}, },
{ {
id: "zone_haze", id: "zone_haze",
label: "ZONE HAZE", label: "ZONE HAZE",
properties: [ properties: [
{ {
label: "Haze", label: "Haze",
@ -488,12 +488,12 @@ const GROUPS = [
decimals: 0, decimals: 0,
propertyID: "haze.hazeGlareAngle", propertyID: "haze.hazeGlareAngle",
showPropertyRule: { "hazeMode": "enabled" }, showPropertyRule: { "hazeMode": "enabled" },
} }
] ]
}, },
{ {
id: "zone_bloom", id: "zone_bloom",
label: "ZONE BLOOM", label: "ZONE BLOOM",
properties: [ properties: [
{ {
label: "Bloom", label: "Bloom",
@ -530,24 +530,24 @@ const GROUPS = [
decimals: 3, decimals: 3,
propertyID: "bloom.bloomSize", propertyID: "bloom.bloomSize",
showPropertyRule: { "bloomMode": "enabled" }, showPropertyRule: { "bloomMode": "enabled" },
} }
] ]
}, },
{ {
id: "zone_avatar_priority", id: "zone_avatar_priority",
label: "ZONE AVATAR PRIORITY", label: "ZONE AVATAR PRIORITY",
properties: [ properties: [
{ {
label: "Avatar Priority", label: "Avatar Priority",
type: "dropdown", type: "dropdown",
options: { inherit: "Inherit", crowd: "Crowd", hero: "Hero" }, options: { inherit: "Inherit", crowd: "Crowd", hero: "Hero" },
propertyID: "avatarPriority", propertyID: "avatarPriority",
} }
] ]
}, },
{ {
id: "model", id: "model",
label: "MODEL", label: "MODEL",
properties: [ properties: [
{ {
label: "Model", label: "Model",
@ -637,7 +637,7 @@ const GROUPS = [
}, },
{ {
id: "image", id: "image",
label: "IMAGE", label: "IMAGE",
properties: [ properties: [
{ {
label: "Image", label: "Image",
@ -680,7 +680,7 @@ const GROUPS = [
}, },
{ {
id: "web", id: "web",
label: "WEB", label: "WEB",
properties: [ properties: [
{ {
label: "Source", label: "Source",
@ -725,7 +725,7 @@ const GROUPS = [
}, },
{ {
id: "light", id: "light",
label: "LIGHT", label: "LIGHT",
properties: [ properties: [
{ {
label: "Light Color", label: "Light Color",
@ -776,7 +776,7 @@ const GROUPS = [
}, },
{ {
id: "material", id: "material",
label: "MATERIAL", label: "MATERIAL",
properties: [ properties: [
{ {
label: "Material URL", label: "Material URL",
@ -850,7 +850,7 @@ const GROUPS = [
}, },
{ {
id: "grid", id: "grid",
label: "GRID", label: "GRID",
properties: [ properties: [
{ {
label: "Color", label: "Color",
@ -883,7 +883,7 @@ const GROUPS = [
}, },
{ {
id: "particles", id: "particles",
label: "PARTICLES", label: "PARTICLES",
properties: [ properties: [
{ {
label: "Emit", label: "Emit",
@ -913,7 +913,7 @@ const GROUPS = [
] ]
}, },
{ {
id: "particles_emit", id: "particles_emit",
label: "PARTICLES EMIT", label: "PARTICLES EMIT",
//isMinor: true, //isMinor: true,
properties: [ properties: [
@ -986,7 +986,7 @@ const GROUPS = [
] ]
}, },
{ {
id: "particles_size", id: "particles_size",
label: "PARTICLES SIZE", label: "PARTICLES SIZE",
//isMinor: true, //isMinor: true,
properties: [ properties: [
@ -1100,7 +1100,7 @@ const GROUPS = [
step: 0.001, step: 0.001,
decimals: 3, decimals: 3,
propertyID: "alphaSpread", propertyID: "alphaSpread",
} }
] ]
}, },
{ {
@ -1181,7 +1181,7 @@ const GROUPS = [
{ {
id: "particles_constraints", id: "particles_constraints",
label: "PARTICLES CONSTRAINTS", label: "PARTICLES CONSTRAINTS",
//isMinor: true, //isMinor: true,
properties: [ properties: [
{ {
type: "triple", type: "triple",
@ -1444,7 +1444,7 @@ const GROUPS = [
propertyID: "userData", propertyID: "userData",
} }
] ]
}, },
{ {
id: "collision", id: "collision",
label: "COLLISION", label: "COLLISION",
@ -1602,14 +1602,14 @@ const GROUPS_PER_TYPE = {
Shape: [ 'base', 'shape', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], Shape: [ 'base', 'shape', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Text: [ 'base', 'text', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], Text: [ 'base', 'text', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Zone: [ 'base', 'zone', 'zone_key_light', 'zone_skybox', 'zone_ambient_light', 'zone_haze', Zone: [ 'base', 'zone', 'zone_key_light', 'zone_skybox', 'zone_ambient_light', 'zone_haze',
'zone_bloom', 'zone_avatar_priority', 'spatial', 'behavior', 'scripts', 'physics' ], 'zone_bloom', 'zone_avatar_priority', 'spatial', 'behavior', 'scripts', 'physics' ],
Model: [ 'base', 'model', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], Model: [ 'base', 'model', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Image: [ 'base', 'image', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], Image: [ 'base', 'image', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Web: [ 'base', 'web', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], Web: [ 'base', 'web', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Light: [ 'base', 'light', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], Light: [ 'base', 'light', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Material: [ 'base', 'material', 'spatial', 'behavior', 'scripts' ], Material: [ 'base', 'material', 'spatial', 'behavior', 'scripts' ],
ParticleEffect: [ 'base', 'particles', 'particles_emit', 'particles_size', 'particles_color', ParticleEffect: [ 'base', 'particles', 'particles_emit', 'particles_size', 'particles_color',
'particles_behavior', 'particles_constraints', 'spatial', 'behavior', 'scripts', 'physics' ], 'particles_behavior', 'particles_constraints', 'spatial', 'behavior', 'scripts', 'physics' ],
PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
PolyVox: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ], PolyVox: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
@ -1882,15 +1882,15 @@ function resetServerScriptStatus() {
function showGroupsForType(type) { function showGroupsForType(type) {
if (type === "Box" || type === "Sphere") { if (type === "Box" || type === "Sphere") {
showGroupsForTypes(["Shape"]); showGroupsForTypes(["Shape"]);
showOnTheSamePage("Shape"); showOnTheSamePage("Shape");
return; return;
} }
if (type === "None"){ if (type === "None"){
showGroupsForTypes(["None"]); showGroupsForTypes(["None"]);
return; return;
} }
showGroupsForTypes([type]); showGroupsForTypes([type]);
showOnTheSamePage(type); showOnTheSamePage(type);
} }
function getGroupsForTypes(types) { function getGroupsForTypes(types) {
@ -1905,14 +1905,14 @@ function showGroupsForTypes(types) {
Object.entries(elGroups).forEach(([groupKey, elGroup]) => { Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
if (types.map(type => GROUPS_PER_TYPE[type].includes(groupKey)).every(function (hasGroup) { return hasGroup; })) { if (types.map(type => GROUPS_PER_TYPE[type].includes(groupKey)).every(function (hasGroup) { return hasGroup; })) {
elGroup.style.display = "none"; elGroup.style.display = "none";
if(types != "None"){ if(types != "None"){
document.getElementById("tab-" + groupKey).style.display = "block"; document.getElementById("tab-" + groupKey).style.display = "block";
}else{ }else{
document.getElementById("tab-" + groupKey).style.display = "none"; document.getElementById("tab-" + groupKey).style.display = "none";
} }
} else { } else {
elGroup.style.display = "none"; elGroup.style.display = "none";
document.getElementById("tab-" + groupKey).style.display = "none"; document.getElementById("tab-" + groupKey).style.display = "none";
} }
}); });
} }
@ -3730,7 +3730,7 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) {
const shownGroups = getGroupsForTypes(entityTypes); const shownGroups = getGroupsForTypes(entityTypes);
showGroupsForTypes(entityTypes); showGroupsForTypes(entityTypes);
showOnTheSamePage(entityTypes); showOnTheSamePage(entityTypes);
const lockedMultiValue = getMultiplePropertyValue('locked'); const lockedMultiValue = getMultiplePropertyValue('locked');
@ -4009,22 +4009,22 @@ function loaded() {
openEventBridge(function() { openEventBridge(function() {
let elPropertiesList = document.getElementById("properties-pages"); let elPropertiesList = document.getElementById("properties-pages");
let tabs = ""; let tabs = "";
GROUPS.forEach(function(group) { GROUPS.forEach(function(group) {
let elGroup; let elGroup;
elGroup = document.createElement('div'); elGroup = document.createElement('div');
elGroup.className = 'section ' + "major"; elGroup.className = 'section ' + "major";
elGroup.setAttribute("id", "properties-" + group.id); elGroup.setAttribute("id", "properties-" + group.id);
elPropertiesList.appendChild(elGroup); elPropertiesList.appendChild(elGroup);
if (group.label !== undefined) { if (group.label !== undefined) {
let elLegend = document.createElement('div'); let elLegend = document.createElement('div');
elLegend.className = "tab-section-header"; elLegend.className = "tab-section-header";
elLegend.appendChild(createElementFromHTML(`<div class="labelTabHeader">${group.label}</div>`)); elLegend.appendChild(createElementFromHTML(`<div class="labelTabHeader">${group.label}</div>`));
elGroup.appendChild(elLegend); elGroup.appendChild(elLegend);
tabs = tabs +'<button id="tab-'+ group.id +'" onclick="showPage(' + "'" + group.id + "'" + ');"><img src="tabs/'+ group.id +'.png"></button>'; tabs = tabs +'<button id="tab-'+ group.id +'" onclick="showPage(' + "'" + group.id + "'" + ');"><img src="tabs/'+ group.id +'.png"></button>';
} }
group.properties.forEach(function(propertyData) { group.properties.forEach(function(propertyData) {
@ -4036,7 +4036,7 @@ function loaded() {
propertyElementID = propertyElementID.replace('.', '-'); propertyElementID = propertyElementID.replace('.', '-');
let elContainer, elLabel; let elContainer, elLabel;
if (propertyData.replaceID === undefined) { if (propertyData.replaceID === undefined) {
// Create subheader, or create new property and append it. // Create subheader, or create new property and append it.
if (propertyType === "sub-header") { if (propertyType === "sub-header") {
@ -4311,7 +4311,7 @@ function loaded() {
curCollapsibleElement.addEventListener("click", toggleCollapsedEvent, true); curCollapsibleElement.addEventListener("click", toggleCollapsedEvent, true);
} }
*/ */
// Textarea scrollbars // Textarea scrollbars
let elTextareas = document.getElementsByTagName("TEXTAREA"); let elTextareas = document.getElementsByTagName("TEXTAREA");
@ -4465,16 +4465,16 @@ function loaded() {
e.target.select(); e.target.select();
}; };
} }
document.getElementById("tabs").innerHTML = tabs; document.getElementById("tabs").innerHTML = tabs;
bindAllNonJSONEditorElements(); bindAllNonJSONEditorElements();
showGroupsForType("None"); showGroupsForType("None");
showPage("base"); showPage("base");
resetProperties(); resetProperties();
disableProperties(); disableProperties();
}); });
@ -4492,21 +4492,21 @@ function loaded() {
} }
function showOnTheSamePage(entityType) { function showOnTheSamePage(entityType) {
if(GROUPS_PER_TYPE[entityType].includes(currentTab) == false){ if(GROUPS_PER_TYPE[entityType].includes(currentTab) == false){
currentTab = "base"; currentTab = "base";
} }
showPage(currentTab); showPage(currentTab);
} }
function showPage(id) { function showPage(id) {
currentTab = id; currentTab = id;
Object.entries(elGroups).forEach(([groupKey, elGroup]) => { Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
if (groupKey == id) { if (groupKey == id) {
elGroup.style.display = "block"; elGroup.style.display = "block";
document.getElementById("tab-" + groupKey).style.backgroundColor = "#2E2E2E"; document.getElementById("tab-" + groupKey).style.backgroundColor = "#2E2E2E";
} else { } else {
elGroup.style.display = "none"; elGroup.style.display = "none";
document.getElementById("tab-" + groupKey).style.backgroundColor = "#404040"; document.getElementById("tab-" + groupKey).style.backgroundColor = "#404040";
} }
}); });
} }