summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-25 10:57:48 +0200
committerGitHub <noreply@github.com>2016-10-25 10:57:48 +0200
commit890f752a6b57598ee6b2088a615c41f60d697847 (patch)
tree191c38b854d23f34a285b6fab711c82b2d5ed1f7 /settings
parent79706e0ddc6ab970d5709e89b8d0caec4d34662b (diff)
parent2aca56f207048e6dff44983fe4cd7af834e70b42 (diff)
downloadnextcloud-server-890f752a6b57598ee6b2088a615c41f60d697847.tar.gz
nextcloud-server-890f752a6b57598ee6b2088a615c41f60d697847.zip
Merge pull request #1452 from nextcloud/appconfig-endpoint
Appconfig endpoint
Diffstat (limited to 'settings')
-rw-r--r--settings/js/admin.js41
-rw-r--r--settings/js/users/users.js20
2 files changed, 26 insertions, 35 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() {
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index d25f9d92db2..3a357c0e9c4 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -875,10 +875,10 @@ $(document).ready(function () {
$('#CheckboxStorageLocation').click(function() {
if ($('#CheckboxStorageLocation').is(':checked')) {
$("#userlist .storageLocation").show();
- OC.AppConfig.setValue('core', 'umgmt_show_storage_location', 'true');
+ OCP.AppConfig.setValue('core', 'umgmt_show_storage_location', 'true');
} else {
$("#userlist .storageLocation").hide();
- OC.AppConfig.setValue('core', 'umgmt_show_storage_location', 'false');
+ OCP.AppConfig.setValue('core', 'umgmt_show_storage_location', 'false');
}
});
@@ -889,10 +889,10 @@ $(document).ready(function () {
$('#CheckboxLastLogin').click(function() {
if ($('#CheckboxLastLogin').is(':checked')) {
$("#userlist .lastLogin").show();
- OC.AppConfig.setValue('core', 'umgmt_show_last_login', 'true');
+ OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'true');
} else {
$("#userlist .lastLogin").hide();
- OC.AppConfig.setValue('core', 'umgmt_show_last_login', 'false');
+ OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'false');
}
});
@@ -903,10 +903,10 @@ $(document).ready(function () {
$('#CheckboxEmailAddress').click(function() {
if ($('#CheckboxEmailAddress').is(':checked')) {
$("#userlist .mailAddress").show();
- OC.AppConfig.setValue('core', 'umgmt_show_email', 'true');
+ OCP.AppConfig.setValue('core', 'umgmt_show_email', 'true');
} else {
$("#userlist .mailAddress").hide();
- OC.AppConfig.setValue('core', 'umgmt_show_email', 'false');
+ OCP.AppConfig.setValue('core', 'umgmt_show_email', 'false');
}
});
@@ -917,10 +917,10 @@ $(document).ready(function () {
$('#CheckboxUserBackend').click(function() {
if ($('#CheckboxUserBackend').is(':checked')) {
$("#userlist .userBackend").show();
- OC.AppConfig.setValue('core', 'umgmt_show_backend', 'true');
+ OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'true');
} else {
$("#userlist .userBackend").hide();
- OC.AppConfig.setValue('core', 'umgmt_show_backend', 'false');
+ OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'false');
}
});
@@ -931,10 +931,10 @@ $(document).ready(function () {
$('#CheckboxMailOnUserCreate').click(function() {
if ($('#CheckboxMailOnUserCreate').is(':checked')) {
$("#newemail").show();
- OC.AppConfig.setValue('core', 'umgmt_send_email', 'true');
+ OCP.AppConfig.setValue('core', 'umgmt_send_email', 'true');
} else {
$("#newemail").hide();
- OC.AppConfig.setValue('core', 'umgmt_send_email', 'false');
+ OCP.AppConfig.setValue('core', 'umgmt_send_email', 'false');
}
});