summaryrefslogtreecommitdiffstats
path: root/settings/js/admin.js
diff options
context:
space:
mode:
Diffstat (limited to 'settings/js/admin.js')
-rw-r--r--settings/js/admin.js31
1 files changed, 11 insertions, 20 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js
index a2a1cef531c..430947e5956 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -114,31 +114,22 @@ $(document).ready(function(){
});
var savePublicShareDisclaimerText = _.debounce(function(value) {
- var data = {
- app:'core',
- key:'shareapi_public_link_disclaimertext'
+ var options = {
+ success: function() {
+ OC.msg.finishedSuccess('#publicShareDisclaimerStatus', t('core', 'Saved'));
+ },
+ error: function() {
+ OC.msg.finishedError('#publicShareDisclaimerStatus', t('core', 'Not saved'));
+ }
};
+
+ OC.msg.startSaving('#publicShareDisclaimerStatus');
if (_.isString(value) && value !== '') {
- data['action'] = 'setValue';
- data['value'] = value;
+ OCP.AppConfig.setValue('core', 'shareapi_public_link_disclaimertext', value, options);
} else {
- data['action'] = 'deleteKey';
$('#publicShareDisclaimerText').val('');
+ OCP.AppConfig.deleteKey('core', 'shareapi_public_link_disclaimertext', options);
}
-
- OC.msg.startSaving('#publicShareDisclaimerStatus');
- $.post(
- OC.AppConfig.url,
- data,
- function(result){
- if(result.status === 'success'){
- OC.msg.finishedSuccess('#publicShareDisclaimerStatus', t('core', 'Saved'))
- } else {
- OC.msg.finishedError('#publicShareDisclaimerStatus', t('core', 'Not saved'))
- }
- },
- 'json'
- );
}, 500);
$('#publicShareDisclaimerText').on('change, keyup', function() {