forked from pauljadam/bookmarklets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheadings.html
66 lines (66 loc) · 3.68 KB
/
headings.html
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
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Headings Bookmarklet for Accessibility Testing</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
</head>
<body>
<p><a href="index.html"><span aria-hidden="true"><</span> Back to Bookmarklets for Accessibility Testing</a></p>
<h1>Headings Bookmarklet for Accessibility Testing </h1>
<p>Headings Bookmarklet for Accessibility Testing inserts a black on yellow opening and closing tag into the DOM around each H1-H6 and WAI-ARIA role=heading aria-level=1-6</p>
<h2>Installation</h2>
<p><a href="javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/headings.js';var iframes=document.getElementsByTagName('iframe');for(i=0;i<iframes.length;i++) {iframes[i].contentDocument.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/headings.js';}})();">Headings Bookmarklet</a> (drag link to bookmarks bar)</p>
<h2>Test Content</h2>
<h1>This is a heading level 1.</h1>
<p>This is another paragraph.</p>
<h2>This is a heading level 2.</h2>
<p>This is another paragraph.</p>
<h3>This is a heading level 3.</h3>
<p>This is another paragraph.</p>
<h4>This is a heading level 4.</h4>
<p>This is another paragraph.</p>
<h5>This is a heading level 5.</h5>
<p>This is another paragraph.</p>
<h6>This is a heading level 6.</h6>
<p>This is another paragraph.</p>
<b role="heading" aria-level="1">This is a role=heading aria-level=1.</b>
<p>This is another paragraph.</p>
<b role="heading" aria-level="2">This is a role=heading aria-level=2.</b>
<p>This is another paragraph.</p>
<b role="heading" aria-level="3">This is a role=heading aria-level=3.</b>
<p>This is another paragraph.</p>
<b role="heading" aria-level="4">This is a role=heading aria-level=4.</b>
<p>This is another paragraph.</p>
<b role="heading" aria-level="5">This is a role=heading aria-level=5.</b>
<p>This is another paragraph.</p>
<b role="heading" aria-level="6">This is a role=heading aria-level=6.</b>
<p>This is another paragraph.</p>
<iframe src="http://pauljadam.com/bookmarklets/"></iframe>
<iframe src="http://pauljadam.com/demos/"></iframe>
<h2>Bookmarklet Demo</h2>
<script type="application/javascript">
function loadJS(file) {
// DOM: Create the script element
var jsElm = document.createElement("script");
// set the type attribute
jsElm.type = "application/javascript";
// make the script element load file
jsElm.src = file;
// finally insert the element to the body element in order to load the script
document.body.appendChild(jsElm);
var iframes = document.getElementsByTagName('iframe');
for (i=0; i<iframes.length; i++) {
var jsElm2 = document.createElement("script");
jsElm2.type = "application/javascript";
jsElm2.src = file;
iframes[i].contentDocument.body.appendChild(jsElm2);
}
}
</script>
<button onclick="loadJS('http://pauljadam.com/bookmarklets/headings.js');">Show Headings</button>
<h4><a href="iosinstall.html">Not so easy installation method</a></h4>
<label for="jscode">Copy/Paste JavaScript Bookmarklet URL Code</label><br>
<textarea id="jscode" rows="4" cols="40">javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/headings.js';var iframes=document.getElementsByTagName('iframe');for(i=0;i<iframes.length;i++) {iframes[i].contentDocument.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/headings.js';}})();</textarea>
</body>
</html>