-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path1_3_5_Identify_Input_Purpose(AA).js
executable file
·80 lines (78 loc) · 2.93 KB
/
1_3_5_Identify_Input_Purpose(AA).js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
setTimeout(() => {
IdentifyInputPurpose()
}, 3000);
function IdentifyInputPurpose() {
$.fn.log = function () {
console.log.apply(console, this);
return this;
};
var inputTags = document.querySelectorAll('input')
for (var a = 0; a < inputTags.length; a++) {
if (inputTags[a].type != "hidden") {
if (inputTags[a].autocomplete == undefined || inputTags[a].autocomplete == "") {
console.log("%cRule:%cWCAG 1.3.5 (2.1,AA)",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #809FFF;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cError:%cAutoComplete is missing in input tag",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #F6976E;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cCode Snippet:",
`color: #FFF;
background-color: #333;
border-radius: 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
$(inputTags[a]).log()
console.log("%cFix:%cAdd autocomplete='INPUT PURPOSE'",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #007075;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%c-----------------------------------------------------------------------------",
`color: #FFF;
background-color: #293543;
font-weight: bolder;
border-radius: 5px;
padding: 5px 10px;
font-size: 1rem;
display: inline;`)
}
}
}
}