aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/js/federationsettingsview.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/js/federationsettingsview.js')
-rw-r--r--apps/settings/js/federationsettingsview.js39
1 files changed, 35 insertions, 4 deletions
diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js
index 9cefaf132f2..cf7f4648905 100644
--- a/apps/settings/js/federationsettingsview.js
+++ b/apps/settings/js/federationsettingsview.js
@@ -10,6 +10,13 @@
(function(_, $, OC) {
'use strict';
+ /**
+ * Construct a new FederationScopeMenu instance
+ * @constructs FederationScopeMenu
+ * @memberof OC.Settings
+ * @param {object} options
+ * @param {bool} [options.lookupServerUploadEnabled=false] whether uploading to the lookup server is enabled
+ */
var FederationSettingsView = OC.Backbone.View.extend({
_inputFields: undefined,
@@ -24,6 +31,7 @@
} else {
this._config = new OC.Settings.UserSettings();
}
+ this.showFederationScopes = !!options.showFederationScopes;
this._inputFields = [
'displayname',
@@ -61,9 +69,31 @@
render: function() {
var self = this;
+ var fieldsWithV2Private = [
+ 'avatar',
+ 'phone',
+ 'twitter',
+ 'website',
+ 'address',
+ ];
+
_.each(this._inputFields, function(field) {
var $icon = self.$('#' + field + 'form h3 > .federation-menu');
- var scopeMenu = new OC.Settings.FederationScopeMenu({field: field});
+ var excludedScopes = []
+
+ if (fieldsWithV2Private.indexOf(field) === -1) {
+ excludedScopes.push('v2-private');
+ }
+
+ if (!self.showFederationScopes) {
+ excludedScopes.push('v2-federated');
+ excludedScopes.push('v2-published');
+ }
+
+ var scopeMenu = new OC.Settings.FederationScopeMenu({
+ field: field,
+ excludedScopes: excludedScopes,
+ });
self.listenTo(scopeMenu, 'select:scope', function(scope) {
self._onScopeChanged(field, scope);
@@ -207,15 +237,16 @@
$icon.addClass('hidden');
switch (scope) {
- case 'private':
+ case 'v2-private':
+ case 'v2-local':
$icon.addClass('icon-password');
$icon.removeClass('hidden');
break;
- case 'contacts':
+ case 'v2-federated':
$icon.addClass('icon-contacts-dark');
$icon.removeClass('hidden');
break;
- case 'public':
+ case 'v2-published':
$icon.addClass('icon-link');
$icon.removeClass('hidden');
break;