Authored by xuqi

capslock of login page.Review by:@xuqi

... ... @@ -211,13 +211,17 @@ $account.on('keyup', function() {
//密码
$password.on('blur', function() {
validatePassword();
if ($capsLock.hasClass('hide')) {
return;
}
$capsLock.addClass('hide');
}).on('keypress', function(e) {
var code = e.which,
isShift = e.shiftKey || (code === 16) || false;
var code = e.which;
//CapsLock检测
if ((!isShift && (code >= 65 && code <= 90)) ||
(isShift && (code >= 97 && code <= 122))) {
if (code >= 65 && code <= 90) {
$capsLock.removeClass('hide');
return;
}
... ... @@ -276,7 +280,7 @@ $('#login-btn').on('click', function() {
if (data.data) {
//防止data.data为undefined时下行语句执行出错而导致脚本不能走到complete去处理authing
location.href = data.data.href;
location.href = data.data.session;
}
} else {
$passwordTip.removeClass('hide').children('em').text(data.message);
... ...
... ... @@ -121,4 +121,17 @@ $third: sprite-map("passport/third/*.png");
background: sprite($third, renren) no-repeat;
}
}
.caps-lock {
position: absolute;
color: #666;
border: #ffe57d;
background: #fff6d2;
white-space: nowrap;
top: 8px;
left: 278px;
padding: 0 20px;
height: 27px;
line-height: 30px;
}
}
... ...