aoktox / pwm

Automatically exported from code.google.com/p/pwm
0 stars 0 forks source link

Caps Locks warning doesn't work in IE #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go on the login page
2. Activate Caps Lock
3. Type your password

What is the expected output? What do you see instead?
CapsLocks warning should be displayed if caps lock is on and a key is 
pressed
--> "Error on page" is displayed in ie8

What version of the product are you using? On what operating system?
PWM v1.4.3 b922 

Original issue reported on code.google.com by jason.br...@gmail.com on 9 Feb 2010 at 9:52

GoogleCodeExporter commented 9 years ago
In my own ie8 testing, I also do not see the caps-lock warning.  However, I 
don't see
"Error on page".  Where are you seeing that?  In the logs, on the browser 
display or
is that a javascript error?  If so, what are the details on the error?

Original comment by jrivard on 9 Feb 2010 at 9:47

GoogleCodeExporter commented 9 years ago
Well,

it seems that e.target.type is not supported by IE in pwmHelper.js :
e.target.type is null

function checkForCapsLock(e) {
    var capsLockWarningElement = getObject('capslockwarning');
    if (capsLockWarningElement == null) {
        return;
    }

    var kc = e.keyCode?e.keyCode:e.which;
    var sk = e.shiftKey?e.shiftKey:((kc == 16));
    if(((kc >= 65 && kc <= 90) && !sk)||((kc >= 97 && kc <= 122) && sk)) {
        //if (e.target.type == 'password') {
            capsLockWarningElement.style.visibility = 'visible';
        //}
    } else {
        capsLockWarningElement.style.visibility = 'hidden';
    }
}

Original comment by jason.br...@gmail.com on 11 Feb 2010 at 2:26

GoogleCodeExporter commented 9 years ago
Changing the function to the following seems to work better in IE, and so far 
doesn't
break the other browsers:

function checkForCapsLock(e) {
    var capsLockWarningElement = getObject('capslockwarning');
    if (capsLockWarningElement == null) {
        return;
    }

    var kc = e.keyCode?e.keyCode:e.which;
    var sk = e.shiftKey?e.shiftKey:((kc == 16));
    if(((kc >= 65 && kc <= 90) && !sk)||((kc >= 97 && kc <= 122) && sk)) {
        if ((e.target != null && e.target.type == 'password') || (e.srcElement !=
null && e.srcElement.type == 'password')) {
            capsLockWarningElement.style.visibility = 'visible';
        }
    } else {
        capsLockWarningElement.style.visibility = 'hidden';
    }
}

Original comment by jrivard on 16 Feb 2010 at 5:28

GoogleCodeExporter commented 9 years ago
Fix included in b945

Original comment by jrivard on 1 Jun 2010 at 8:41