summaryrefslogtreecommitdiff
path: root/static/register.js
diff options
context:
space:
mode:
authorsostler <sbostler@gmail.com>2009-11-23 00:18:13 -0500
committersostler <sbostler@gmail.com>2009-11-23 00:18:13 -0500
commit40a57a474294244832a6023a10592a38a6178b91 (patch)
treed54ed4c460428ad391a1ed4f39990d2e8d20f868 /static/register.js
parentf6f4074a5a49f50e8ace54e88d199fa7ad8868b7 (diff)
parent2c13339226f73621c9c539fbe93c8ac6333bbf48 (diff)
Registration
Diffstat (limited to 'static/register.js')
-rwxr-xr-xstatic/register.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/static/register.js b/static/register.js
new file mode 100755
index 0000000..d60f223
--- /dev/null
+++ b/static/register.js
@@ -0,0 +1,30 @@
+function submitRegistration() {
+ var nick = $('#nickInput').val();
+ var email = $('#emailInput').val();
+ var password = $('#passwordInput').val();
+ var hash = hex_sha1(nick + '$' + password + '$dumpfm');
+
+ var onSuccess = function() {
+ location.href = "/";
+ };
+
+ var onError = function() {
+ alert("Unable to register!");
+ };
+
+ $.ajax({
+ type: 'GET',
+ timeout: 5000,
+ url: 'submit-registration',
+ data: {'nick': nick, 'email': email, 'hash': hash },
+ cache: false,
+ dataType: 'json',
+ success: onSuccess,
+ error: onError
+
+ });
+}
+
+function initRegister() {
+ $('#submit').click(submitRegistration);
+} \ No newline at end of file