mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:37:46 +02:00
move some more settings to content, leave places in domain settings
This commit is contained in:
parent
6240181474
commit
b0967dfc3a
5 changed files with 33 additions and 7 deletions
|
@ -55,8 +55,8 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Places / Paths",
|
"label": "Paths",
|
||||||
"html_id": "places_paths",
|
"html_id": "paths",
|
||||||
"restart": false,
|
"restart": false,
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
|
@ -64,6 +64,7 @@
|
||||||
"label": "Paths",
|
"label": "Paths",
|
||||||
"help": "Clients can enter a path to reach an exact viewpoint in your domain.<br/>Add rows to the table below to map a path to a viewpoint.<br/>The index path ( / ) is where clients will enter if they do not enter an explicit path.",
|
"help": "Clients can enter a path to reach an exact viewpoint in your domain.<br/>Add rows to the table below to map a path to a viewpoint.<br/>The index path ( / ) is where clients will enter if they do not enter an explicit path.",
|
||||||
"type": "table",
|
"type": "table",
|
||||||
|
"content_setting": true,
|
||||||
"can_add_new_rows": true,
|
"can_add_new_rows": true,
|
||||||
"key": {
|
"key": {
|
||||||
"name": "path",
|
"name": "path",
|
||||||
|
@ -1081,6 +1082,7 @@
|
||||||
"name": "attenuation_per_doubling_in_distance",
|
"name": "attenuation_per_doubling_in_distance",
|
||||||
"label": "Default Domain Attenuation",
|
"label": "Default Domain Attenuation",
|
||||||
"help": "Factor between 0 and 1.0 (0: No attenuation, 1.0: extreme attenuation)",
|
"help": "Factor between 0 and 1.0 (0: No attenuation, 1.0: extreme attenuation)",
|
||||||
|
"content_setting": true,
|
||||||
"placeholder": "0.5",
|
"placeholder": "0.5",
|
||||||
"default": "0.5",
|
"default": "0.5",
|
||||||
"advanced": false
|
"advanced": false
|
||||||
|
@ -1313,6 +1315,7 @@
|
||||||
"name": "entityEditFilter",
|
"name": "entityEditFilter",
|
||||||
"label": "Filter Entity Edits",
|
"label": "Filter Entity Edits",
|
||||||
"help": "Check all entity edits against this filter function.",
|
"help": "Check all entity edits against this filter function.",
|
||||||
|
"content_setting": true,
|
||||||
"placeholder": "url whose content is like: function filter(properties) { return properties; }",
|
"placeholder": "url whose content is like: function filter(properties) { return properties; }",
|
||||||
"default": "",
|
"default": "",
|
||||||
"advanced": true
|
"advanced": true
|
||||||
|
|
|
@ -94,9 +94,13 @@ var viewHelpers = {
|
||||||
|
|
||||||
function reloadSettings(callback) {
|
function reloadSettings(callback) {
|
||||||
$.getJSON(Settings.endpoint, function(data){
|
$.getJSON(Settings.endpoint, function(data){
|
||||||
_.extend(data, viewHelpers)
|
_.extend(data, viewHelpers);
|
||||||
|
|
||||||
$('#panels').html(Settings.panelsTemplate(data))
|
for (var spliceIndex in Settings.extraGroups) {
|
||||||
|
data.descriptions.splice(spliceIndex, 0, Settings.extraGroups[spliceIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#panels').html(Settings.panelsTemplate(data));
|
||||||
|
|
||||||
Settings.data = data;
|
Settings.data = data;
|
||||||
Settings.initialValues = form2js('settings-form', ".", false, cleanupFormValues, true);
|
Settings.initialValues = form2js('settings-form', ".", false, cleanupFormValues, true);
|
||||||
|
|
|
@ -79,6 +79,13 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
$settingsDropdown.append(makeGroupDropdownElement(group, "/settings/"));
|
$settingsDropdown.append(makeGroupDropdownElement(group, "/settings/"));
|
||||||
|
|
||||||
|
// for domain settings, we add a dummy "Places" group that we fill
|
||||||
|
// via the API - add it to the dropdown menu in the right spot
|
||||||
|
if (index == 1) {
|
||||||
|
$settingsDropdown.append("<li role='separator' class='divider'></li>");
|
||||||
|
$settingsDropdown.append(makeGroupDropdownElement({ html_id: 'places', label: 'Places' }, "/settings/"));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,14 @@ $(document).ready(function(){
|
||||||
return b;
|
return b;
|
||||||
})(window.location.search.substr(1).split('&'));
|
})(window.location.search.substr(1).split('&'));
|
||||||
|
|
||||||
|
// define extra groups to add to description, with their splice index
|
||||||
|
Settings.extraGroups = {
|
||||||
|
1: {
|
||||||
|
html_id: 'places',
|
||||||
|
label: 'Places'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Settings.afterReloadActions = function() {
|
Settings.afterReloadActions = function() {
|
||||||
// append the domain selection modal
|
// append the domain selection modal
|
||||||
appendDomainIDButtons();
|
appendDomainIDButtons();
|
||||||
|
@ -657,8 +665,7 @@ $(document).ready(function(){
|
||||||
var placesTableGroup = viewHelpers.getFormGroup('', placesTableSetting, Settings.data.values);
|
var placesTableGroup = viewHelpers.getFormGroup('', placesTableSetting, Settings.data.values);
|
||||||
|
|
||||||
// append the places table in the right place
|
// append the places table in the right place
|
||||||
$('#places_paths .panel-body').prepend(placesTableGroup);
|
$('#places .panel-body').prepend(placesTableGroup);
|
||||||
//$('#' + Settings.PLACES_TABLE_ID).append("<tr><td colspan=3></td></tr>");
|
|
||||||
|
|
||||||
var spinner = createDomainSpinner();
|
var spinner = createDomainSpinner();
|
||||||
$('#' + Settings.PLACES_TABLE_ID).after($(spinner));
|
$('#' + Settings.PLACES_TABLE_ID).after($(spinner));
|
||||||
|
|
|
@ -123,7 +123,10 @@ void DomainServerSettingsManager::splitSettingsDescription() {
|
||||||
QJsonObject settingsDropdownGroup;
|
QJsonObject settingsDropdownGroup;
|
||||||
|
|
||||||
if (!groupHidden) {
|
if (!groupHidden) {
|
||||||
settingsDropdownGroup[DESCRIPTION_NAME_KEY] = groupObject[DESCRIPTION_NAME_KEY];
|
if (groupObject.contains(DESCRIPTION_NAME_KEY)) {
|
||||||
|
settingsDropdownGroup[DESCRIPTION_NAME_KEY] = groupObject[DESCRIPTION_NAME_KEY];
|
||||||
|
}
|
||||||
|
|
||||||
settingsDropdownGroup[DESCRIPTION_GROUP_LABEL_KEY] = groupObject[DESCRIPTION_GROUP_LABEL_KEY];
|
settingsDropdownGroup[DESCRIPTION_GROUP_LABEL_KEY] = groupObject[DESCRIPTION_GROUP_LABEL_KEY];
|
||||||
|
|
||||||
static const QString DESCRIPTION_GROUP_HTML_ID_KEY = "html_id";
|
static const QString DESCRIPTION_GROUP_HTML_ID_KEY = "html_id";
|
||||||
|
@ -1383,7 +1386,9 @@ bool DomainServerSettingsManager::recurseJSONObjectAndOverwriteSettings(const QJ
|
||||||
foreach(const QJsonValue& groupValue, _descriptionArray) {
|
foreach(const QJsonValue& groupValue, _descriptionArray) {
|
||||||
// find groups with root values (they don't have a group name)
|
// find groups with root values (they don't have a group name)
|
||||||
QJsonObject groupObject = groupValue.toObject();
|
QJsonObject groupObject = groupValue.toObject();
|
||||||
|
|
||||||
if (!groupObject.contains(DESCRIPTION_NAME_KEY)) {
|
if (!groupObject.contains(DESCRIPTION_NAME_KEY)) {
|
||||||
|
|
||||||
// this is a group with root values - check if our setting is in here
|
// this is a group with root values - check if our setting is in here
|
||||||
matchingDescriptionObject = settingDescriptionFromGroup(groupObject, rootKey);
|
matchingDescriptionObject = settingDescriptionFromGroup(groupObject, rootKey);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue