Persist personal settings federated sharing scopes Show new settings fields in read-only mode too Insert values on page load Return updated values; show inline success feedback Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>pull/1946/head
parent
c42d977185
commit
20739c93a6
@ -0,0 +1,47 @@ |
||||
/* global OC */ |
||||
|
||||
/** |
||||
* Copyright (c) 2016, Christoph Wurst <christoph@owncloud.com> |
||||
* |
||||
* This file is licensed under the Affero General Public License version 3 or later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
(function() { |
||||
'use strict'; |
||||
|
||||
/** |
||||
* Model for storing and saving user settings |
||||
* |
||||
* @class UserSettings |
||||
*/ |
||||
var UserSettings = OC.Backbone.Model.extend({ |
||||
url: OC.generateUrl('/settings/users/{id}/settings', {id: OC.currentUser}), |
||||
parse: function(data) { |
||||
if (_.isUndefined(data)) { |
||||
return null; |
||||
} |
||||
if (_.isUndefined(data.data)) { |
||||
return null; |
||||
} |
||||
data = data.data; |
||||
|
||||
var ignored = [ |
||||
'userId', |
||||
'message' |
||||
]; |
||||
|
||||
_.each(ignored, function(ign) { |
||||
if (!_.isUndefined(data[ign])) { |
||||
delete data[ign]; |
||||
} |
||||
}); |
||||
|
||||
return data; |
||||
} |
||||
}); |
||||
|
||||
OC.Settings = OC.Settings || {}; |
||||
|
||||
OC.Settings.UserSettings = UserSettings; |
||||
})(); |
||||
Loading…
Reference in new issue