diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-03-14 16:56:11 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-28 23:41:35 -0300 |
commit | c9ccdca1ec2f586b8884b41a5319e4a908888df7 (patch) | |
tree | 73a0eadd195b7e51b89cdd370a0efe286e343ebe /settings/js | |
parent | 1fc05ea53a6ed6053c0ceb90ad72a49ca314d57e (diff) | |
download | nextcloud-server-c9ccdca1ec2f586b8884b41a5319e4a908888df7.tar.gz nextcloud-server-c9ccdca1ec2f586b8884b41a5319e4a908888df7.zip |
add verification dialog
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/personal.js | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index 52ab2f23f87..d5b9b7911a0 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -201,6 +201,42 @@ $(document).ready(function () { } }); + var showVerifyDialog = function(howToVerify, verificationCode) { + var dialog = document.getElementById('verification-dialog'); + $(".verification-dialog-content span.explainVerification").text(howToVerify); + $(".verification-dialog-content span.verificationCode").text(verificationCode); + dialog.style.display = "block"; + }; + + $(".verify").click(function () { + var account = $(this).attr('id'); + + // Add: make call to get content for verify dialog + + $.ajax( + OC.generateUrl('/settings/users/{account}/verify', {account: account}), + {method: 'GET'} + ).done(function(data) { + showVerifyDialog(data.msg, data.code); + }); + + }); + + // When the user clicks on <span> (x), close the modal + $("#verify-dialog-close").click(function() { + var dialog = document.getElementById('verification-dialog'); + dialog.style.display = "none"; + }); + + // When the user clicks anywhere outside of the modal, close it + window.onclick = function(event) { + var dialog = document.getElementById('verification-dialog'); + if (event.target === dialog) { + dialog.style.display = "none"; + } + }; + + var federationSettingsView = new OC.Settings.FederationSettingsView({ el: '#personal-settings' }); @@ -334,7 +370,7 @@ $(document).ready(function () { $('#removeavatar').removeClass('hidden').addClass('inlineblock'); } }); - + // Show token views var collection = new OC.Settings.AuthTokenCollection(); |