Authored by xuqi

capslock of login page.Review by:@xuqi

@@ -211,13 +211,17 @@ $account.on('keyup', function() { @@ -211,13 +211,17 @@ $account.on('keyup', function() {
211 //密码 211 //密码
212 $password.on('blur', function() { 212 $password.on('blur', function() {
213 validatePassword(); 213 validatePassword();
  214 +
  215 + if ($capsLock.hasClass('hide')) {
  216 + return;
  217 + }
  218 +
  219 + $capsLock.addClass('hide');
214 }).on('keypress', function(e) { 220 }).on('keypress', function(e) {
215 - var code = e.which,  
216 - isShift = e.shiftKey || (code === 16) || false; 221 + var code = e.which;
217 222
218 //CapsLock检测 223 //CapsLock检测
219 - if ((!isShift && (code >= 65 && code <= 90)) ||  
220 - (isShift && (code >= 97 && code <= 122))) { 224 + if (code >= 65 && code <= 90) {
221 $capsLock.removeClass('hide'); 225 $capsLock.removeClass('hide');
222 return; 226 return;
223 } 227 }
@@ -276,7 +280,7 @@ $('#login-btn').on('click', function() { @@ -276,7 +280,7 @@ $('#login-btn').on('click', function() {
276 if (data.data) { 280 if (data.data) {
277 281
278 //防止data.data为undefined时下行语句执行出错而导致脚本不能走到complete去处理authing 282 //防止data.data为undefined时下行语句执行出错而导致脚本不能走到complete去处理authing
279 - location.href = data.data.href; 283 + location.href = data.data.session;
280 } 284 }
281 } else { 285 } else {
282 $passwordTip.removeClass('hide').children('em').text(data.message); 286 $passwordTip.removeClass('hide').children('em').text(data.message);
@@ -121,4 +121,17 @@ $third: sprite-map("passport/third/*.png"); @@ -121,4 +121,17 @@ $third: sprite-map("passport/third/*.png");
121 background: sprite($third, renren) no-repeat; 121 background: sprite($third, renren) no-repeat;
122 } 122 }
123 } 123 }
  124 +
  125 + .caps-lock {
  126 + position: absolute;
  127 + color: #666;
  128 + border: #ffe57d;
  129 + background: #fff6d2;
  130 + white-space: nowrap;
  131 + top: 8px;
  132 + left: 278px;
  133 + padding: 0 20px;
  134 + height: 27px;
  135 + line-height: 30px;
  136 + }
124 } 137 }