From f2834d7bf763a451d95354f52f5bc38d2c97c36f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 18 Jan 2011 17:18:14 -0500 Subject: [PATCH] Enter/return key submits form in the new user/password dialog --- webcit/static/authmethods.js | 17 +++++++++++++++++ webcit/static/t/get_logged_in.html | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/webcit/static/authmethods.js b/webcit/static/authmethods.js index 67018a7c2..4bb117c61 100644 --- a/webcit/static/authmethods.js +++ b/webcit/static/authmethods.js @@ -66,6 +66,23 @@ function ajax_try_username_and_password() { }); } +/* + * The user pressed a key while in the username or password box. + * Is it the enter/return key? Submit the form. + */ +function username_and_password_onkeypress(e) { + if (window.event) { /* IE */ + keynum = e.keyCode + } + else if (e.which) { /* real browsers */ + keynum = e.which + } + if (keynum == 13) { /* enter/return key */ + ajax_try_username_and_password(); + } +} + + /* * tab handler for the login box */ diff --git a/webcit/static/t/get_logged_in.html b/webcit/static/t/get_logged_in.html index 3648eee17..568f4c186 100644 --- a/webcit/static/t/get_logged_in.html +++ b/webcit/static/t/get_logged_in.html @@ -39,10 +39,10 @@

- +

- +

-- 2.30.2