diff options
Diffstat (limited to 'public/js/views')
-rw-r--r-- | public/js/views/home.js | 49 | ||||
-rw-r--r-- | public/js/views/login.js | 51 | ||||
-rw-r--r-- | public/js/views/reset.js | 27 | ||||
-rw-r--r-- | public/js/views/signup.js | 39 |
4 files changed, 0 insertions, 166 deletions
diff --git a/public/js/views/home.js b/public/js/views/home.js deleted file mode 100644 index eda246a..0000000 --- a/public/js/views/home.js +++ /dev/null @@ -1,49 +0,0 @@ - -$(document).ready(function(){ - - var hc = new HomeController(); - var av = new AccountValidator(); - - $('#account-form').ajaxForm({ - beforeSubmit : function(formData, jqForm, options){ - if (av.validateForm() == false){ - return false; - } else{ - // push the disabled username field onto the form data array // - formData.push({name:'user', value:$('#user-tf').val()}) - return true; - } - }, - success : function(responseText, status, xhr, $form){ - if (status == 'success') hc.onUpdateSuccess(); - }, - error : function(e){ - if (e.responseText == 'email-taken'){ - av.showInvalidEmail(); - } else if (e.responseText == 'username-taken'){ - av.showInvalidUserName(); - } - } - }); - $('#name-tf').focus(); - $('#github-banner').css('top', '41px'); - -// customize the account settings form // - - $('#account-form h1').text('Account Settings'); - $('#account-form #sub1').text('Here are the current settings for your account.'); - $('#user-tf').attr('disabled', 'disabled'); - $('#account-form-btn1').html('Delete'); - $('#account-form-btn1').addClass('btn-danger'); - $('#account-form-btn2').html('Update'); - -// setup the confirm window that displays when the user chooses to delete their account // - - $('.modal-confirm').modal({ show : false, keyboard : true, backdrop : true }); - $('.modal-confirm .modal-header h3').text('Delete Account'); - $('.modal-confirm .modal-body p').html('Are you sure you want to delete your account?'); - $('.modal-confirm .cancel').html('Cancel'); - $('.modal-confirm .submit').html('Delete'); - $('.modal-confirm .submit').addClass('btn-danger'); - -})
\ No newline at end of file diff --git a/public/js/views/login.js b/public/js/views/login.js deleted file mode 100644 index 27fe31d..0000000 --- a/public/js/views/login.js +++ /dev/null @@ -1,51 +0,0 @@ - -$(document).ready(function(){ - - var lv = new LoginValidator(); - var lc = new LoginController(); - -// main login form // - - $('#login-form').ajaxForm({ - beforeSubmit : function(formData, jqForm, options){ - if (lv.validateForm() == false){ - return false; - } else{ - // append 'remember-me' option to formData to write local cookie // - formData.push({name:'remember-me', value:$("input:checkbox:checked").length == 1}) - return true; - } - }, - success : function(responseText, status, xhr, $form){ - if (status == 'success') window.location.href = '/home'; - }, - error : function(e){ - lv.showLoginError('Login Failure', 'Please check your username and/or password'); - } - }); - $('#user-tf').focus(); - -// login retrieval form via email // - - var ev = new EmailValidator(); - - $('#get-credentials-form').ajaxForm({ - url: '/lost-password', - beforeSubmit : function(formData, jqForm, options){ - if (ev.validateEmail($('#email-tf').val())){ - ev.hideEmailAlert(); - return true; - } else{ - ev.showEmailAlert("<b> Error!</b> Please enter a valid email address"); - return false; - } - }, - success : function(responseText, status, xhr, $form){ - ev.showEmailSuccess("Check your email on how to reset your password."); - }, - error : function(){ - ev.showEmailAlert("Sorry. There was a problem, please try again later."); - } - }); - -})
\ No newline at end of file diff --git a/public/js/views/reset.js b/public/js/views/reset.js deleted file mode 100644 index c6a6166..0000000 --- a/public/js/views/reset.js +++ /dev/null @@ -1,27 +0,0 @@ - -$(document).ready(function(){ - - var rv = new ResetValidator(); - - $('#set-password-form').ajaxForm({ - beforeSubmit : function(formData, jqForm, options){; - rv.hideAlert(); - if (rv.validatePassword($('#pass-tf').val()) == false){ - return false; - } else{ - return true; - } - }, - success : function(responseText, status, xhr, $form){ - rv.showSuccess("Your password has been reset."); - setTimeout(function(){ window.location.href = '/'; }, 3000); - }, - error : function(){ - rv.showAlert("I'm sorry something went wrong, please try again."); - } - }); - - $('#set-password').modal('show'); - $('#set-password').on('shown', function(){ $('#pass-tf').focus(); }) - -});
\ No newline at end of file diff --git a/public/js/views/signup.js b/public/js/views/signup.js deleted file mode 100644 index 52de197..0000000 --- a/public/js/views/signup.js +++ /dev/null @@ -1,39 +0,0 @@ - -$(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 |