aboutsummaryrefslogtreecommitdiffstats
path: root/settings/js/admin.js
diff options
context:
space:
mode:
Diffstat (limited to 'settings/js/admin.js')
-rw-r--r--settings/js/admin.js41
1 files changed, 16 insertions, 25 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js
index a2a1cef531c..f5750b23790 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -24,7 +24,7 @@ $(document).ready(function(){
$(element).change(function(ev) {
var groups = ev.val || [];
groups = JSON.stringify(groups);
- OC.AppConfig.setValue('core', $(this).attr('name'), groups);
+ OCP.AppConfig.setValue('core', $(this).attr('name'), groups);
});
});
@@ -41,9 +41,9 @@ $(document).ready(function(){
if($(this).is(':checked')){
var mode = $(this).val();
if (mode === 'ajax' || mode === 'webcron' || mode === 'cron') {
- OC.AppConfig.setValue('core', 'backgroundjobs_mode', mode);
+ OCP.AppConfig.setValue('core', 'backgroundjobs_mode', mode);
// clear cron errors on background job mode change
- OC.AppConfig.deleteKey('core', 'cronErrors');
+ OCP.AppConfig.deleteKey('core', 'cronErrors');
}
}
});
@@ -59,7 +59,7 @@ $(document).ready(function(){
$('#reallyEnableEncryption').click(function() {
$('#encryptionAPI div#EncryptionWarning').toggleClass('hidden');
$('#encryptionAPI div#EncryptionSettingsArea').toggleClass('hidden');
- OC.AppConfig.setValue('core', 'encryption_enabled', 'yes');
+ OCP.AppConfig.setValue('core', 'encryption_enabled', 'yes');
$('#enableEncryption').attr('disabled', 'disabled');
});
@@ -99,7 +99,7 @@ $(document).ready(function(){
value = 'no';
}
}
- OC.AppConfig.setValue('core', $(this).attr('name'), value);
+ OCP.AppConfig.setValue('core', $(this).attr('name'), value);
});
$('#shareapiDefaultExpireDate').change(function() {
@@ -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() {