aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/public/js/views/signup.js
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-03-20 12:43:33 +0100
committerDennis Eriksen <dennis.se@gmail.com>2013-03-20 12:43:33 +0100
commit266767e6b31d4799b218a7dc9ffd0d6f2eca92a8 (patch)
treee3e68b3acdfb276cadcc23d0028a6c1dd3bc8f21 /public/js/views/signup.js
parentEdited "Sign in" button - for fun (diff)
downloadDivid-266767e6b31d4799b218a7dc9ffd0d6f2eca92a8.tar.gz
login screen
Diffstat (limited to 'public/js/views/signup.js')
-rw-r--r--public/js/views/signup.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/public/js/views/signup.js b/public/js/views/signup.js
new file mode 100644
index 0000000..52de197
--- /dev/null
+++ b/public/js/views/signup.js
@@ -0,0 +1,39 @@
+
+$(document).ready(function(){
+
+ var av = new AccountValidator();
+ var sc = new SignupController();
+
+ $('#account-form').ajaxForm({
+ beforeSubmit : function(formData, jqForm, options){
+ return av.validateForm();
+ },
+ success : function(responseText, status, xhr, $form){
+ if (status == 'success') $('.modal-alert').modal('show');
+ },
+ error : function(e){
+ if (e.responseText == 'email-taken'){
+ av.showInvalidEmail();
+ } else if (e.responseText == 'username-taken'){
+ av.showInvalidUserName();
+ }
+ }
+ });
+ $('#name-tf').focus();
+
+// customize the account signup form //
+
+ $('#account-form h1').text('Signup');
+ $('#account-form #sub1').text('Please tell us a little about yourself');
+ $('#account-form #sub2').text('Choose your username & password');
+ $('#account-form-btn1').html('Cancel');
+ $('#account-form-btn2').html('Submit');
+ $('#account-form-btn2').addClass('btn-primary');
+
+// setup the alert that displays when an account is successfully created //
+
+ $('.modal-alert').modal({ show : false, keyboard : false, backdrop : 'static' });
+ $('.modal-alert .modal-header h3').text('Success!');
+ $('.modal-alert .modal-body p').html('Your account has been created.</br>Click OK to return to the login page.');
+
+}) \ No newline at end of file