mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Adding field screenshare
Adding field screenshare to avoid conflict
This commit is contained in:
parent
9c5f8fc946
commit
e850e6fe22
1 changed files with 31 additions and 21 deletions
|
@ -67,11 +67,16 @@ const GROUPS = [
|
|||
replaceID: "placeholder-property-id",
|
||||
multiDisplayMode: PROPERTY_MULTI_DISPLAY_MODE.COMMA_SEPARATED_VALUES,
|
||||
},
|
||||
{
|
||||
/*{
|
||||
label: "Description",
|
||||
type: "string",
|
||||
propertyID: "description",
|
||||
},
|
||||
},*/
|
||||
{ //THIS IS ONLY FOR THE TEST ##########################################
|
||||
label: "Description",
|
||||
type: "multipleZonesSelection",
|
||||
propertyID: "description",
|
||||
}, // END TEST #############################
|
||||
{
|
||||
label: "Parent",
|
||||
type: "string",
|
||||
|
@ -115,11 +120,6 @@ const GROUPS = [
|
|||
lines: "Wireframe",
|
||||
},
|
||||
propertyID: "primitiveMode",
|
||||
},
|
||||
{
|
||||
label: "Render With Zones",
|
||||
type: "multipleZonesSelection",
|
||||
propertyID: "renderWithZones",
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -580,6 +580,12 @@ const GROUPS = [
|
|||
type: "dropdown",
|
||||
options: { inherit: "Inherit", crowd: "Crowd", hero: "Hero" },
|
||||
propertyID: "avatarPriority",
|
||||
},
|
||||
{
|
||||
label: "Screen-share",
|
||||
type: "dropdown",
|
||||
options: { inherit: "Inherit", disabled: "Off", enabled: "On" },
|
||||
propertyID: "screenshare",
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1897,7 +1903,7 @@ function resetProperties() {
|
|||
}
|
||||
case 'multipleZonesSelection': {
|
||||
property.elInput.classList.remove('multi-diff');
|
||||
property.elInput.value = "[]";
|
||||
property.elInput.value = "[]"; //################################## PROBABLY SOMETHING TO ADJUST HERE!
|
||||
setZonesSelectionData(property.elInput, false);
|
||||
break;
|
||||
}
|
||||
|
@ -3582,19 +3588,20 @@ function addZoneToZonesSelection(propertyId) {
|
|||
let selectedZones = JSON.parse(hiddenField.value);
|
||||
let zoneToAdd = document.getElementById("zones-select-" + propertyId).value;
|
||||
if (!selectedZones.includes(zoneToAdd)) {
|
||||
selectedZones.push(zoneToAdd);
|
||||
selectedZones.push(zoneToAdd);
|
||||
}
|
||||
hiddenField.value = JSON.stringify(selectedZones);
|
||||
displaySelectedZones(propertyId, true);
|
||||
let propertyName = propertyId.replace("property-", "");
|
||||
updateProperty(propertyName, selectedZones, false);
|
||||
updateProperty(propertyName, JSON.stringify(selectedZones), false); //FOR TEMPORARY STRING FOR TEST
|
||||
//updateProperty(propertyName, selectedZones, false); //DIRECTLY FOR ARRY
|
||||
}
|
||||
|
||||
function removeZoneFromZonesSelection(propertyId, zoneId) {
|
||||
let hiddenField = document.getElementById(propertyId);
|
||||
if(JSON.stringify(hiddenField.value) === '"undefined"') {
|
||||
hiddenField.value = "[]";
|
||||
}
|
||||
}
|
||||
let selectedZones = JSON.parse(hiddenField.value);
|
||||
let index = selectedZones.indexOf(zoneId);
|
||||
if (index > -1) {
|
||||
|
@ -3603,7 +3610,8 @@ function removeZoneFromZonesSelection(propertyId, zoneId) {
|
|||
hiddenField.value = JSON.stringify(selectedZones);
|
||||
displaySelectedZones(propertyId, true);
|
||||
let propertyName = propertyId.replace("property-", "");
|
||||
updateProperty(propertyName, selectedZones, false);
|
||||
updateProperty(propertyName, JSON.stringify(selectedZones), false); //FOR TEMPORARY STRING FOR TEST
|
||||
//updateProperty(propertyName, selectedZones, false); //DIRECTLY FOR ARRY
|
||||
}
|
||||
|
||||
function displaySelectedZones(propertyId, isEditable) {
|
||||
|
@ -3621,7 +3629,7 @@ function displaySelectedZones(propertyId, isEditable) {
|
|||
if (!isMultiple) {
|
||||
listedZoneInner += "<tr><td class='zoneItem'> </td><td> </td></tr>";
|
||||
} else {
|
||||
listedZoneInner += "<tr><td class='zoneItem'>[ WARNING: Any changes will apply to all. ]</td><td> </td></tr>";
|
||||
listedZoneInner += "<tr><td class='zoneItem'>[ WARNING: Any changes will apply to all ]</td><td> </td></tr>";
|
||||
}
|
||||
} else {
|
||||
for ( i = 0; i < selectedZones.length; i++ ) {
|
||||
|
@ -3637,10 +3645,9 @@ function displaySelectedZones(propertyId, isEditable) {
|
|||
}
|
||||
}
|
||||
if (isEditable) {
|
||||
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td><a href='#' onClick='removeZoneFromZonesSelection(" + '"' + propertyId + '"' + ", " + '"' + selectedZones[i] + '"' + ");' >";
|
||||
listedZoneInner += "<img src='../../../html/css/img/remove_icon.png'></a></td></tr>";
|
||||
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td><a href='#' onClick='removeZoneFromZonesSelection(" + '"' + propertyId + '"' + ", " + '"' + selectedZones[i] + '"' + ");' ><img src='../../../html/css/img/remove_icon.png'></a></td></tr>";
|
||||
} else {
|
||||
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td> </td></tr>";
|
||||
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td> </td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3659,7 +3666,7 @@ function createZonesSelection(property, elProperty) {
|
|||
elProperty.className = "multipleZonesSelection";
|
||||
let elInput = document.createElement('input');
|
||||
elInput.setAttribute("id", elementID);
|
||||
elInput.setAttribute("type", "hidden");
|
||||
elInput.setAttribute("type", "hidden"); // must be hidden ################################################################################# HEIL! ICITTE!
|
||||
elInput.className = "hiddenMultiZonesSelection";
|
||||
|
||||
let elZonesSelector = document.createElement('div');
|
||||
|
@ -3687,8 +3694,7 @@ function setZonesSelectionData(element, isEditable) {
|
|||
}
|
||||
zoneSelector += "<option value='" + zonesList[i].id + "'>" + name + "</option>";
|
||||
}
|
||||
zoneSelector += "</select> <a href='#' id='zones-select-add-" + element.id + "' onClick='addZoneToZonesSelection(" + '"' + element.id + '"' + ");' >";
|
||||
zoneSelector += "<img style='vertical-align:top' src='../../../html/css/img/add_icon.png'></a></div>";
|
||||
zoneSelector += "</select> <a href='#' id='zones-select-add-" + element.id + "' onClick='addZoneToZonesSelection(" + '"' + element.id + '"' + ");' ><img style='vertical-align:top' src='../../../html/css/img/add_icon.png'></a></div>";
|
||||
zoneSelector += "<div class='selected-zone-container' id='selected-zones-" + element.id + "'></div>";
|
||||
zoneSelectorContainer.innerHTML = zoneSelector;
|
||||
displaySelectedZones(element.id, isEditable);
|
||||
|
@ -4102,14 +4108,18 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) {
|
|||
break;
|
||||
}
|
||||
case 'multipleZonesSelection': {
|
||||
property.elInput.value = JSON.stringify(propertyValue);
|
||||
if (propertyValue == ""){ //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
||||
property.elInput.value = "[]"; //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
||||
} else { //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
||||
property.elInput.value = propertyValue; //JSON.stringify(propertyValue); //##### TO CHECK depending what type the value is.. expecting an array so it willbe manage as a string.
|
||||
} //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
||||
if (lockedMultiValue.isMultiDiffValue || lockedMultiValue.value) {
|
||||
setZonesSelectionData(property.elInput, false);
|
||||
} else {
|
||||
setZonesSelectionData(property.elInput, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 'icon': {
|
||||
property.elSpan.innerHTML = propertyData.icons[propertyValue];
|
||||
property.elSpan.style.display = "inline-block";
|
||||
|
|
Loading…
Reference in a new issue