diff options
author | Robert Zorko <robertz@gurucue.com> | 2015-10-14 14:04:11 +0200 |
---|---|---|
committer | Robert Zorko <robertz@gurucue.com> | 2015-10-14 14:04:11 +0200 |
commit | 2fe1ceebd6287ed4835798c82498834102cb7e18 (patch) | |
tree | 4ab2e83c7f5d5b08389bc6626cdc205420b09398 /js/codeq/profile.js | |
parent | 7a98e5ed234e5a7a0dc2a8e04b1ebccf7ea2fb29 (diff) |
moved the signup to its own screen (and file)
Diffstat (limited to 'js/codeq/profile.js')
-rw-r--r-- | js/codeq/profile.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/js/codeq/profile.js b/js/codeq/profile.js index 4723b4a..08a8883 100644 --- a/js/codeq/profile.js +++ b/js/codeq/profile.js @@ -4,44 +4,6 @@ (function(){
- $('#formSignUp').submit(function(event) {
- console.log($(this).serialize());
- var jqUsername = $("#modalSignUpUsername"),
- jqName = $("#modalSignUpName"),
- jqEmail = $("#modalSignUpEmail"),
- jqPassword = $("#modalSignUpPassword"),
- jqVerify = $("#modalSignUpVerify");
-
- if (jqPassword.val() != jqVerify.val()) {
- alert('Passwords do not match.');
- }
- else {
- codeq.comms.signup(jqUsername.val(), jqName.val(), jqEmail.val(), jqPassword.val())
- .then(function (data) {
- if (data.code !== 0) throw new Error('Signup failed, code: ' + data.code + ', message: ' + data.message);
-
- //back to login
- $('#modalSignUp').modal('hide');
- alert('Welcome '+ jqUsername.val() +'. Thanks for signing up.');
- $('#modalLogIn').modal('show');
- //assume user wants to sign-in with signed username
- $("#username").val(jqUsername.val());
- //clear
- jqUsername.val('');
- jqName.val('');
- jqEmail.val('');
- jqPassword.val('');
- jqVerify.val('');
- })
- .fail(function (reason) {
- codeq.log.error('Signup failed: ' + reason, reason);
- alert('Signup failed: ' + reason);
- })
- .done();
- }
- event.preventDefault(); // Prevent the form from submitting via the browser.
- });
-
$('#formChangePassword').submit(function(event) {
var jqNew = $("#modalChangePasswordNew"),
jqVerify = $("#modalChangePasswordVerify");
|