summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-02-24 05:13:25 +0100
committermkanat%bugzilla.org <>2009-02-24 05:13:25 +0100
commit51c13dbeddd73ef4dd056a2e297696abe7d9e774 (patch)
tree24b44592a10e4e91be9b272b7849c065b48d6759 /template
parent7cd25dd61e33ad7d5bf1c041937e1793c55e61fd (diff)
downloadbugzilla-51c13dbeddd73ef4dd056a2e297696abe7d9e774.tar.gz
bugzilla-51c13dbeddd73ef4dd056a2e297696abe7d9e774.tar.xz
Bug 479197: The mini_login Bugzilla_password box does not convert to text type or clear itself in IE
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=glob, a=mkanat
Diffstat (limited to 'template')
-rw-r--r--template/en/default/account/auth/login-small.html.tmpl40
1 files changed, 34 insertions, 6 deletions
diff --git a/template/en/default/account/auth/login-small.html.tmpl b/template/en/default/account/auth/login-small.html.tmpl
index 821244cb8..ba1d671fa 100644
--- a/template/en/default/account/auth/login-small.html.tmpl
+++ b/template/en/default/account/auth/login-small.html.tmpl
@@ -39,13 +39,16 @@
<input id="Bugzilla_login[% qs_suffix FILTER html %]"
class="bz_login"
name="Bugzilla_login"
- onfocus="mini_login_on_focus( this )"
+ onfocus="mini_login_on_focus('[% qs_suffix FILTER js %]')"
>
<input class="bz_password"
id="Bugzilla_password[% qs_suffix FILTER html %]"
name="Bugzilla_password"
type="password"
- onfocus="mini_login_on_focus( this )"
+ >
+ <input class="bz_password bz_default_hidden bz_mini_login_help" type="text"
+ id="Bugzilla_password_dummy[% qs_suffix %]" value="password"
+ onfocus="mini_login_on_focus('[% qs_suffix FILTER js %]')"
>
[% IF Param('rememberlogin') == 'defaulton' ||
Param('rememberlogin') == 'defaultoff'
@@ -63,12 +66,37 @@
<script type="text/javascript">
mini_login_constants = {
"login" : "login",
- "password" : "password",
"warning" : "You must set the login and password before logging in."
+ };
+ [%# We need this event to fire after autocomplete, because it does
+ # something different depending on whether or not there's already
+ # data in the login and password box.
+ # However, autocomplete happens at all sorts of different times in
+ # different browsers (before or after onDOMReady, before or after
+ # window.onload, in almost all combinations you can imagine).
+ # The only good solution I found is to time the event 200
+ # milliseconds after window.onload for WebKit (doing it immediately
+ # at onload works in Chrome but not in Safari, but I can't detect
+ # them separately using YUI), and right after onDOMReady in Gecko.
+ # The WebKit solution is also fairly guaranteed to work on any
+ # browser (it's just strange, since the fields only populate 200 ms
+ # after the page loads), so it's the default. IE doesn't even
+ # recognize our forms as login forms, so I made it use the Gecko
+ # method also (since it's nicer visually). Opera never autocompletes
+ # forms without user interaction, so it also uses the Gecko method.
+ #%]
+ if (YAHOO.env.ua.gecko || YAHOO.env.ua.ie || YAHOO.env.ua.opera) {
+ YAHOO.util.Event.onDOMReady(function() {
+ init_mini_login_form('[% qs_suffix FILTER html %]');
+ });
}
- YAHOO.util.Event.onDOMReady(function() {
- init_mini_login_form('[% qs_suffix FILTER html %]');
- } );
+ else {
+ YAHOO.util.Event.on(window, 'load', function () {
+ window.setTimeout(function() {
+ init_mini_login_form('[% qs_suffix FILTER html %]');
+ }, 200);
+ });
+ }
</script>
</form>
</li>