From 702510bb9567507cf346b00955c0c9ba042a3e0b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 1 Dec 2011 14:05:21 -0500 Subject: [PATCH] Pressing enter/return in the openid url box submits the form --- webcit/static/authmethods.js | 20 ++++++++++++++++++-- webcit/static/t/get_logged_in.html | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/webcit/static/authmethods.js b/webcit/static/authmethods.js index fca4cf266..8ad1e29fa 100644 --- a/webcit/static/authmethods.js +++ b/webcit/static/authmethods.js @@ -138,10 +138,10 @@ function ajax_try_newuser() { */ function newuser_onkeypress(e) { if (window.event) { /* IE */ - keynum = e.keyCode + keynum = e.keyCode; } else if (e.which) { /* real browsers */ - keynum = e.which + keynum = e.which; } if (keynum == 13) { /* enter/return key */ ajax_try_newuser(); @@ -163,4 +163,20 @@ function ajax_try_openid() { } +/* + * The user pressed a key while in the openid login box. + * Is it the enter/return key? Submit the form. + */ +function openid_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_openid(); + } +} + diff --git a/webcit/static/t/get_logged_in.html b/webcit/static/t/get_logged_in.html index 7c4573fa7..7287f0500 100644 --- a/webcit/static/t/get_logged_in.html +++ b/webcit/static/t/get_logged_in.html @@ -73,7 +73,7 @@

- +
-- 2.30.2