From: mkanat%bugzilla.org <> Date: Tue, 24 Feb 2009 04:13:25 +0000 (+0000) Subject: Bug 479197: The mini_login Bugzilla_password box does not convert to text type or... X-Git-Tag: bugzilla-3.3.4~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51c13dbeddd73ef4dd056a2e297696abe7d9e774;p=thirdparty%2Fbugzilla.git Bug 479197: The mini_login Bugzilla_password box does not convert to text type or clear itself in IE Patch By Max Kanat-Alexander r=glob, a=mkanat --- diff --git a/js/global.js b/js/global.js index 2efa698b6c..de3d7915db 100644 --- a/js/global.js +++ b/js/global.js @@ -19,38 +19,41 @@ var mini_login_constants; function init_mini_login_form( suffix ) { var mini_login = document.getElementById('Bugzilla_login' + suffix ); var mini_password = document.getElementById('Bugzilla_password' + suffix ); - // check if the login and password are blank and if they are - // put in the text login and password and make them slightly greyed out - if( mini_login.value == "" && mini_password.value == "" ) { + var mini_dummy = document.getElementById( + 'Bugzilla_password_dummy' + suffix); + // If the login and password are blank when the page loads, we display + // "login" and "password" in the boxes + if (mini_login.value == "" && mini_password.value == "") { mini_login.value = mini_login_constants.login; - mini_password.value = mini_login_constants.password; - mini_password.type = "text"; - YAHOO.util.Dom.addClass(mini_login, "bz_mini_login_help"); - YAHOO.util.Dom.addClass(mini_password, "bz_mini_login_help"); + YAHOO.util.Dom.addClass(mini_password, 'bz_default_hidden'); + YAHOO.util.Dom.removeClass(mini_dummy, 'bz_default_hidden'); } } -function mini_login_on_focus( el ) { - if( el.name == "Bugzilla_password" ){ - if( el.type != "password" ) { - el.value = ""; - el.type = "password"; - } - } else if ( el.value == mini_login_constants.login ) { - if( el.value == mini_login_constants.login ) { - el.value = ""; - } +// Clear the words "login" and "password" from the form when you click +// in one of the boxes. We clear them both when you click in either box +// so that the browser's password-autocomplete can work. +function mini_login_on_focus( suffix ) { + var mini_login = document.getElementById('Bugzilla_login' + suffix ); + var mini_password = document.getElementById('Bugzilla_password' + suffix ); + var mini_dummy = document.getElementById( + 'Bugzilla_password_dummy' + suffix); + + YAHOO.util.Dom.removeClass(mini_login, "bz_mini_login_help"); + if (mini_login.value == mini_login_constants.login) { + mini_login.value = ''; } - YAHOO.util.Dom.removeClass(el, "bz_mini_login_help"); + YAHOO.util.Dom.removeClass(mini_password, 'bz_default_hidden'); + YAHOO.util.Dom.addClass(mini_dummy, 'bz_default_hidden'); } function check_mini_login_fields( suffix ) { var mini_login = document.getElementById('Bugzilla_login' + suffix ); var mini_password = document.getElementById('Bugzilla_password' + suffix ); - if(( mini_login.value != "" && mini_password.value != "" ) && - ( mini_login.value != mini_login_constants.login && - mini_password.value != mini_login_constants.password )) { + if( ( mini_login.value != "" && mini_password.value != "" ) && + mini_login.value != mini_login_constants.login) + { return true; } window.alert( mini_login_constants.warning ); diff --git a/skins/standard/global.css b/skins/standard/global.css index aa3b9d7581..75dc437d31 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -320,7 +320,10 @@ div#docslinks { /** End Comments **/ .bz_default_hidden, .bz_tui_hidden { - display: none; + /* We have !important because we want elements with these classes to always + * be hidden, even if there is some CSS that overrides it (we use these + * classes inside JavaScript to hide things). */ + display: none !important; } span.quote { diff --git a/template/en/default/account/auth/login-small.html.tmpl b/template/en/default/account/auth/login-small.html.tmpl index 821244cb8a..ba1d671fa7 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 @@ + [% IF Param('rememberlogin') == 'defaulton' || Param('rememberlogin') == 'defaultoff' @@ -63,12 +66,37 @@