diff -r 6c7060d36a23 -r f49e3c8b638c includes/clientside/static/misc.js
--- a/includes/clientside/static/misc.js Mon Dec 03 18:45:37 2007 -0500
+++ b/includes/clientside/static/misc.js Tue Dec 11 19:15:26 2007 -0500
@@ -353,42 +353,75 @@
form_html += 'Please re-enter your login details, to verify your identity.
';
}
form_html += ' \
-
\
+ \
+ \
+ ';
ajax_auth_mb_cache.updateContent(form_html);
$('messageBox').object.nextSibling.firstChild.tabindex = '3';
if ( typeof(response.username) == 'string' )
{
$('ajaxlogin_user').object.value = response.username;
- $('ajaxlogin_pass').object.focus();
+ if ( IE )
+ {
+ setTimeout("document.forms['ajax_login_form'].password.focus();", 200);
+ }
+ else
+ {
+ $('ajaxlogin_pass').object.focus();
+ }
}
else
{
- $('ajaxlogin_user').object.focus();
+ if ( IE )
+ {
+ setTimeout("document.forms['ajax_login_form'].username.focus();", 200);
+ }
+ else
+ {
+ $('ajaxlogin_user').object.focus();
+ }
}
$('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); };
- $('ajaxlogin_pass').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); };
+ $('ajaxlogin_pass').object.onkeypress = function(e)
+ {
+ // Trigger a form submit when the password field is focused and the user presses enter
+
+ // IE doesn't give us an event object when it should - check window.event. If that
+ // still fails, give up.
+ if ( !e )
+ {
+ e = window.event;
+ }
+ if ( !e && IE )
+ {
+ return true;
+ }
+ if ( e.keyCode == 13 )
+ {
+ ajaxValidateLogin();
+ }
+ };
/*
## This causes the background image to disappear under Fx 2
if ( shown_error )