Skip to content

Commit feec767

Browse files
committed
Shows a warning if caps lock is on when user is at sign in page
1 parent 12162eb commit feec767

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

app/public/js/password_caps.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
document.addEventListener( 'keydown', function( event ) {
2+
var caps = event.getModifierState && event.getModifierState( 'CapsLock' );
3+
if(caps) {
4+
$("#capsLock").show();
5+
} else {
6+
$("#capsLock").hide();
7+
}
8+
});

app/resources/views/pages/signin.blade.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@extends('layouts.default', ['body_class' => 'nav-profile'])
22
@section('content')
3-
3+
<link href="/css/jquery/jquery-ui.css" rel="stylesheet" type="text/css">
4+
<script src="/css/jquery/external/jquery/jquery.js"></script>
5+
<script src="/css/jquery/jquery-ui.js"></script>
6+
<script src="/js/password_caps.js" type="text/javascript"></script>
47
<div class="sign-in">
58
<div class="text-center header">
69
<h1>Sign In</h1>
@@ -29,6 +32,8 @@ class="clean" name="email"
2932
</div>
3033
<div class="col-xs-12">
3134
<input class="clean" name="password" type="password" placeholder="Password" value="{{ old('password') }}">
35+
<div id="capsLock" class="capsLock" style="display:none;">CapsLock is on!!
36+
</div>
3237
</div>
3338

3439
<div class="col-xs-12">

0 commit comments

Comments
 (0)