summaryrefslogtreecommitdiff
path: root/static/js/register.js
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2010-02-21 15:22:15 -0500
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2010-02-21 15:22:15 -0500
commita85f1102a74b7bb9b2adf9b21ef8c7c56dce781a (patch)
tree4011c30523a6ef744d5ffe6e9077d112789be953 /static/js/register.js
parent9db75059dc42b847876058cd2dde1957d4922087 (diff)
Added event tracking and registration codes
Diffstat (limited to 'static/js/register.js')
-rwxr-xr-xstatic/js/register.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/static/js/register.js b/static/js/register.js
index 682efcb..1739ed6 100755
--- a/static/js/register.js
+++ b/static/js/register.js
@@ -13,20 +13,25 @@ function submitRegistration() {
var email = $('#emailInput').val();
var password = $('#passwordInput').val() || "";
var code = $('#codeInput').val();
- if ($.inArray(code.toUpperCase(), ValidCodes) == -1) {
- alert("Bad registration code! Try again dude...." );
- return;
- }
- if (nick.length < 3) {
- alert("Nicks must be at least 3 characters long.");
+
+ if (nick.length < 3 || nick.length > 12) {
+ alert("Nicks must be between 3 and 12 characters long.");
return;
} else if (password.length < 5) {
alert("Password must be at least 5 characters long.");
return;
}
+ if ($.inArray(code.toUpperCase(), ValidCodes) == -1) {
+ alert("Bad registration code! Try again dude...." );
+ return;
+ }
+
var hash = hex_sha1(nick + '$' + password + '$dumpfm');
var onSuccess = function() {
+ if (typeof pageTracker !== 'undefined') {
+ pageTracker._trackEvent('User', 'Register', nick);
+ }
location.href = "/";
};