summaryrefslogtreecommitdiff
path: root/static/js/register.js
diff options
context:
space:
mode:
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 = "/";
};