From 2fe1ceebd6287ed4835798c82498834102cb7e18 Mon Sep 17 00:00:00 2001 From: Robert Zorko Date: Wed, 14 Oct 2015 14:04:11 +0200 Subject: moved the signup to its own screen (and file) --- js/codeq/profile.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'js/codeq/profile.js') 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"); -- cgit v1.2.1