aboutsummaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-03-14 16:56:11 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-04-28 23:41:35 -0300
commitc9ccdca1ec2f586b8884b41a5319e4a908888df7 (patch)
tree73a0eadd195b7e51b89cdd370a0efe286e343ebe /settings/js
parent1fc05ea53a6ed6053c0ceb90ad72a49ca314d57e (diff)
downloadnextcloud-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.js38
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();