summaryrefslogtreecommitdiff
path: root/static/home.js
diff options
context:
space:
mode:
authortimb <timb@mb.home>2010-01-15 18:57:43 -0800
committertimb <timb@mb.home>2010-01-15 18:57:43 -0800
commit188f1e79227fabfd46bf0feff460516414395364 (patch)
treed2ae085f127637bab4faa3912bd7c3fb5b8d68ad /static/home.js
parentcdcc81c23c6bcc3e455345a0fc8d5ed346f17089 (diff)
fixed up the default value for the login form fields and moved most of the javascript into static/js
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