testilo 41.0.3 → 41.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<link rel="stylesheet" href="style.css">
|
|
14
14
|
<script id="script" type="module">
|
|
15
15
|
const sortButton = document.getElementById('sortButton');
|
|
16
|
-
const
|
|
16
|
+
const sortChangeSpan = document.getElementById('sortChange');
|
|
17
17
|
const sumBody = document.getElementById('sumBody');
|
|
18
18
|
const rows = Array.from(sumBody.children);
|
|
19
19
|
const sortRowsBy = basis => {
|
|
@@ -37,12 +37,15 @@
|
|
|
37
37
|
rows.forEach(row => {
|
|
38
38
|
sumBody.appendChild(row);
|
|
39
39
|
});
|
|
40
|
-
sortBasisSpan.textContent = basis === 'score' ? 'score' : 'WCAG';
|
|
41
40
|
};
|
|
42
41
|
sortButton.addEventListener('click', event => {
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
// Add the new sorting basis to the page.
|
|
43
|
+
sortChangeSpan.textContent = sortChangeSpan.textContent === 'score to WCAG'
|
|
44
|
+
? 'WCAG to score'
|
|
45
|
+
: 'score to WCAG';
|
|
46
|
+
const newBasis = sortChangeSpan.textContent === 'score to WCAG' ? 'score' : 'wcag';
|
|
47
|
+
// Re-sort the table.
|
|
48
|
+
sortRowsBy(newBasis);
|
|
46
49
|
});
|
|
47
50
|
</script>
|
|
48
51
|
</head>
|
|
@@ -97,11 +100,9 @@
|
|
|
97
100
|
<li>You can sort this table by WCAG or score.</li>
|
|
98
101
|
</ul>
|
|
99
102
|
<h3>The summary</h3>
|
|
103
|
+
<p><button id="sortButton" type="button">Change sorting from <span id="sortChange">score to WCAG</span></button></p>
|
|
100
104
|
<table class="allBorder thirdCellRight">
|
|
101
|
-
<caption>
|
|
102
|
-
<p>How many violations each tool reported, by issue, sorted by <span id="sortBasis" role="status">score</span></p>
|
|
103
|
-
<p><button id="sortButton" type="button">Change sorting</button></p>
|
|
104
|
-
</caption>
|
|
105
|
+
<caption>How many violations each tool reported, by issue</caption>
|
|
105
106
|
<thead>
|
|
106
107
|
<tr><th>Issue</th><th>WCAG</th><th>Score</th><th>Instance counts</th></tr>
|
|
107
108
|
</thead>
|