Pressing enter/return in the openid url box submits the form
authorArt Cancro <ajc@uncensored.citadel.org>
Thu, 1 Dec 2011 19:05:21 +0000 (14:05 -0500)
committerArt Cancro <ajc@uncensored.citadel.org>
Thu, 1 Dec 2011 19:05:21 +0000 (14:05 -0500)
webcit/static/authmethods.js
webcit/static/t/get_logged_in.html

index fca4cf2664538741c0c17a17e4b0442d904b0191..8ad1e29fa14c44cb5d7bc9af8a2e29c4e3d799a3 100644 (file)
@@ -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();
+       }
+}
+
 
index 7c4573fa71db3e8e2762e720907f360ee874d2fe..7287f0500177a60980fd962b870fbafe615023c6 100644 (file)
@@ -73,7 +73,7 @@
 <h2><?_("Log in using OpenID")></h2>
 <form id="ajax_openid_form" method="POST" action="ajax_login_openid">
 <?_("OpenID URL:")>
-<input type="text" name="openid_url" id="openid_url" class="openid_urlarea">
+<input type="text" name="openid_url" id="openid_url" class="openid_urlarea" onKeyPress="openid_onkeypress(event);">
 </form>
 <div class="logbuttons"><a href="javascript:ajax_try_openid();"><?_("Log in")></a></div>
 </div>