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