summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-02-12 17:21:41 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-02-18 14:26:03 +0100
commit8387cd8ae35a0ad94a49a27ad8622bb7b8ed2b06 (patch)
tree30a304dcae073ea3b6ee409a279fc4946fd0a199 /settings/js
parent3699728a3a02dd17ea617a7e8f781c09e837f360 (diff)
downloadnextcloud-server-8387cd8ae35a0ad94a49a27ad8622bb7b8ed2b06.tar.gz
nextcloud-server-8387cd8ae35a0ad94a49a27ad8622bb7b8ed2b06.zip
Add option to change email settings in admin section
Fix issue #7166
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/admin.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js
index e957bd68f1f..f39f53d413a 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -34,4 +34,42 @@ $(document).ready(function(){
$('#security').change(function(){
$.post(OC.filePath('settings','ajax','setsecurity.php'), { enforceHTTPS: $('#forcessl').val() },function(){} );
});
+
+ $('#mail_smtpauth').change(function() {
+ if (!this.checked) {
+ $('#mail_credentials').toggle(false);
+ } else {
+ $('#mail_credentials').toggle(true);
+ }
+ });
+
+ $('#mail_settings').change(function(){
+ OC.msg.startSaving('#mail_settings .msg');
+ var post = $( "#mail_settings" ).serialize();
+ $.post(OC.Router.generate('settings_mail_settings'), post, function(data){
+ OC.msg.finishedSaving('#mail_settings .msg', data);
+ });
+ });
});
+
+OC.msg={
+ startSaving:function(selector){
+ $(selector)
+ .html( t('settings', 'Saving...') )
+ .removeClass('success')
+ .removeClass('error')
+ .stop(true, true)
+ .show();
+ },
+ finishedSaving:function(selector, data){
+ if( data.status === "success" ){
+ $(selector).html( data.data.message )
+ .addClass('success')
+ .stop(true, true)
+ .delay(3000)
+ .fadeOut(900);
+ }else{
+ $(selector).html( data.data.message ).addClass('error');
+ }
+ }
+};