diff options
| -rwxr-xr-x | static/js/register.js | 12 | ||||
| -rw-r--r-- | static/register.html | 93 |
2 files changed, 53 insertions, 52 deletions
diff --git a/static/js/register.js b/static/js/register.js index 35fcc8a..c767e92 100755 --- a/static/js/register.js +++ b/static/js/register.js @@ -31,10 +31,15 @@ function submitRegistration() { if (typeof pageTracker !== 'undefined') { pageTracker._trackEvent('User', 'Register', nick); } - location.href = "/"; + if (window.history && history.length > 1) + history.go(-1); + else + location.href = '/'; }; var onError = function(resp) { + $('#register-spinner').hide(); + $('input').removeAttr('disabled'); var respText = resp.responseText ? resp.responseText.trim() : false; if (respText == 'NICK_TAKEN') { alert("That nick is already taken! Please choose another."); @@ -44,11 +49,12 @@ function submitRegistration() { alert("Unable to register!"); } }; - + $('input').attr('disabled', 'disabled'); + $('#register-spinner').show(); $.ajax({ type: 'POST', timeout: 5000, - url: 'submit-registration', + url: '/submit-registration', data: {'nick': nick, 'email': email, 'hash': hash }, cache: false, dataType: 'json', diff --git a/static/register.html b/static/register.html index a39610a..9bf03f4 100644 --- a/static/register.html +++ b/static/register.html @@ -1,4 +1,5 @@ -<html><head> +<html> + <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="/static/js/underscore-min.js"></script> <script type="text/javascript" src="/static/js/register.js"></script> @@ -6,62 +7,56 @@ $(document).ready(initRegister); </script> <link rel="stylesheet" type="text/css" href="static/css/index.css"> - - <link rel="shortcut icon" href="static/favicon.ico"> + <link rel="shortcut icon" href="static/favicon.ico"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <META NAME="keywords" CONTENT="dump.fm, image chat, realtime, internet 3.0, dump, dump fm, image dump, pictures, image links, image board"> <META NAME="description" CONTENT="Talk with pictures!"> <title>dump.fm - register</title></head> -<body> - -<div id="rapper"></div> -<div id="content" style="z-index:77;"> + <body> -<div id="main" align="center"> + <div id="rapper"></div> + <div id="content" style="z-index:77;"> - <div id="passwordreset"> - <img src="/static/img/furie3.png" id="furie3" /> - <div id="passwordreset"> - <div id="logo-and-text"> - <a href="/"><img src="/static/img/dumppixellarge3.png"></a> - <div align="center"> - <label style="text-align:left;margin-bottom:-8px;">username</label> - <input type="text" class="field"id="nickInput" /> - <br> - - <label style="text-align:left;margin-bottom:-8px;">password</label> - <input type="password" class="field" id="passwordInput" /> - <br> - <label style="text-align:left;margin-bottom:-8px;">password2x</label> - <input type="password" class="field" id="passwordInput2" /> - - <label style="text-align:left;margin-bottom:-8px;">email</label> - <input type="text" class="field"id="emailInput" /> - </h1> + <div id="main" align="center"> - </form> - - <br> - - - <div align="center"> - <input type="submit" class="submit" id="submit" value="Register!" /> + <div id="passwordreset"> + <img src="/static/img/furie3.png" id="furie3" /> + <div id="passwordreset"> + <div id="logo-and-text"> + <a href="/"><img src="/static/img/dumppixellarge3.png"></a> + <div align="center"> + <label style="text-align:left;margin-bottom:-8px;">username</label> + <input type="text" class="field" id="nickInput" /> + <br> + + <label style="text-align:left;margin-bottom:-8px;">password</label> + <input type="password" class="field" id="passwordInput" /> + <br> + <label style="text-align:left;margin-bottom:-8px;">password2x</label> + <input type="password" class="field" id="passwordInput2" /> + + <label style="text-align:left;margin-bottom:-8px;">email</label> + <input type="text" class="field" id="emailInput" /> + <br> + + <div align="center"> + <input type="submit" class="submit" id="submit" value="Register!" /> + </div> + <img id="register-spinner" src="/static/img/spinner.gif"> + </div> + </div> + </div> </div> - </div> - </div> - </div> -</div> -<script type="text/javascript"> -var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); -document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> -try { -var pageTracker = _gat._getTracker("UA-12364576-1"); -pageTracker._trackPageview(); -} catch(err) {}</script> + <script type="text/javascript"> + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); + </script> + <script type="text/javascript"> + try { + var pageTracker = _gat._getTracker("UA-12364576-1"); + pageTracker._trackPageview(); + } catch(err) {}</script> -</body> + </body> </html> |
