diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-26 14:41:07 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-26 14:41:07 +0100 |
commit | d9a153dbe91a775be533869b4d80ddaa33609ca8 (patch) | |
tree | 6096cf0653a95d9ac941cbd0f4dffc5bf080bd2d /settings/js | |
parent | 84eea47991d33922345e4fb15f7e74638e2a7ccc (diff) | |
parent | 9847912257de1910f99879caac8ea925fb85caed (diff) | |
download | nextcloud-server-d9a153dbe91a775be533869b4d80ddaa33609ca8.tar.gz nextcloud-server-d9a153dbe91a775be533869b4d80ddaa33609ca8.zip |
Merge pull request #7174 from owncloud/issue/7166
Add option to change email settings in admin section
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/admin.js | 34 | ||||
-rw-r--r-- | settings/js/personal.js | 22 |
2 files changed, 34 insertions, 22 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js index e957bd68f1f..5ea6a5af2df 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -34,4 +34,38 @@ $(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').addClass('hidden'); + } else { + $('#mail_credentials').removeClass('hidden'); + } + }); + + $('#mail_smtpmode').change(function() { + if ($(this).val() !== 'smtp') { + $('#setting_smtpauth').addClass('hidden'); + $('#setting_smtphost').addClass('hidden'); + $('#mail_smtpsecure_label').addClass('hidden'); + $('#mail_smtpsecure').addClass('hidden'); + $('#mail_credentials').addClass('hidden'); + } else { + $('#setting_smtpauth').removeClass('hidden'); + $('#setting_smtphost').removeClass('hidden'); + $('#mail_smtpsecure_label').removeClass('hidden'); + $('#mail_smtpsecure').removeClass('hidden'); + if ($('#mail_smtpauth').attr('checked')) { + $('#mail_credentials').removeClass('hidden'); + } + } + }); + + $('#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); + }); + }); }); diff --git a/settings/js/personal.js b/settings/js/personal.js index 5944272067b..98bfe7132d4 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -315,25 +315,3 @@ OC.Encryption.msg={ } } }; - -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'); - } - } -}; |