summaryrefslogtreecommitdiff
path: root/static/home.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/home.js')
-rwxr-xr-xstatic/home.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/static/home.js b/static/home.js
deleted file mode 100755
index 7ced9da..0000000
--- a/static/home.js
+++ /dev/null
@@ -1,36 +0,0 @@
-function ifEnter(fn) {
- return function(e) {
- if (e.keyCode == 13) { fn(); }
- };
-}
-
-function initHome() {
- $('#passwordInput').keyup(ifEnter(login));
- $('#loginSubmit').click(login);
-}
-
-function login() {
- $('#passwordInput, #loginSubmit').blur();
- var nick = $('#nickInput').val();
- var password = $('#passwordInput').val();
- var hash = hex_sha1(nick + '$' + password + '$dumpfm');
-
- var onSuccess = function(json) {
- location.href = "/chat";
- };
-
- var onError = function(resp, textStatus, errorThrown) {
- alert("Error logging in!");
- };
-
- $.ajax({
- type: 'GET',
- timeout: 5000,
- url: 'login',
- data: {'nick': nick, ts: '', 'hash': hash },
- cache: false,
- dataType: 'json',
- success: onSuccess,
- error: onError
- });
-}; \ No newline at end of file