From 41f8c6831bb91c0b0be1219b1566e59e48673465 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 28 Nov 2015 23:57:34 -0800 Subject: Use bower, grunt and browserify instead of connect-assets --- public/js/register.js | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 public/js/register.js (limited to 'public/js/register.js') diff --git a/public/js/register.js b/public/js/register.js new file mode 100644 index 00000000..2d2b2c52 --- /dev/null +++ b/public/js/register.js @@ -0,0 +1,82 @@ +;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0](function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 2) { + return $(this).parent().removeClass('has-error'); + } else { + $(this).parent().addClass('has-error'); + return $(this).parent().after('
Username must be lowecase and have at least 3 characters
'); + } + }); + $('#password').blur(function() { + $('#confirm').blur(); + $(this).parent().next('.alert').remove(); + if ($('.progress-bar-success').length > 0) { + return $(this).parent().removeClass('has-error'); + } else { + return $(this).parent().addClass('has-error'); + } + }); + $('#confirm').blur(function() { + if ($(this).val() === '') { + return; + } + $(this).parent().next('.alert').remove(); + if ($('#password').val() === $('#confirm').val()) { + return $('#confirm').parent().removeClass('has-error'); + } else { + $('#confirm').parent().addClass('has-error'); + return $('#confirm').parent().after('
Passwords don\'t match
'); + } + }); + $('#email').blur(function() { + if ($(this).val() === '') { + return; + } + $(this).parent().next('.alert').remove(); + if (validateEmail($(this).val())) { + return $(this).parent().removeClass('has-error'); + } else { + $(this).parent().addClass('has-error'); + return $(this).parent().after('
Invalid email
'); + } + }); + return $('#register').submit(function() { + $('.form-control').blur(); + if ($('.has-error').length > 0) { + $('.has-error').effect('shake', 500); + return false; + } + }); + }); + +}).call(this); + + +},{}]},{},[1]) +; \ No newline at end of file -- cgit v1.2.3