diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-19 19:43:47 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-10-21 09:09:23 +0200 |
commit | 0b1fb180a53fc4e533e2f194977293bc509c5df3 (patch) | |
tree | d28abeb617a3eaf2bee8d97bd284fab126d4cd3f /settings/js/admin.js | |
parent | 50b6ee67cb025332f1ec7012d3705150ef5a165a (diff) | |
download | nextcloud-server-0b1fb180a53fc4e533e2f194977293bc509c5df3.tar.gz nextcloud-server-0b1fb180a53fc4e533e2f194977293bc509c5df3.zip |
Make AppConfig part of the public API
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/js/admin.js')
-rw-r--r-- | settings/js/admin.js | 31 |
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() { |