|
8 | 8 | */ |
9 | 9 |
|
10 | 10 | /* jshint shadow: true, unused: false, laxbreak:true, laxcomma:true, asi: true, eqeqeq: false, strict: implied, jquery: true */ |
11 | | -/* global require, updateReferences */ |
| 11 | +/* global require, updateReferences, ariaAttributeReferences */ |
12 | 12 |
|
13 | 13 | var roleInfo = {}; |
14 | 14 |
|
15 | | -require(['core/pubsubhub'], function (respecEvents) { |
16 | | - const button = respecUI.addCommand( |
17 | | - 'Save roles as JSON', |
18 | | - showAriaSave, |
19 | | - null, |
20 | | - '☁️' |
21 | | - ); |
22 | | - |
23 | | - function showAriaSave() { |
24 | | - const json = JSON.stringify(roleInfo, null, ' '); |
25 | | - const href = 'data:text/html;charset=utf-8,' + encodeURIComponent(json); |
26 | | - const ariaUI = document.createElement('div'); |
27 | | - ariaUI.classList.add('respec-save-buttons'); |
28 | | - ariaUI.innerHTML = ` |
29 | | - <a href="${href}" download="roleInfo.json" class="respec-save-button">Save JSON</a> |
30 | | - `; |
31 | | - respecUI.freshModal('Save Aria roles as JSON', ariaUI, button); |
32 | | - ariaUI.querySelector('a').focus(); |
33 | | - } |
34 | | - |
35 | | - respecEvents.sub('end', function (msg) { |
36 | | - if (msg == 'w3c/conformance') { |
| 15 | +function ariaAttributeReferences() { |
| 16 | + { |
37 | 17 | var propList = {}; |
38 | 18 | var globalSP = []; |
39 | 19 |
|
@@ -766,5 +746,31 @@ require(['core/pubsubhub'], function (respecEvents) { |
766 | 746 |
|
767 | 747 | updateReferences(document); |
768 | 748 | } |
| 749 | + } |
| 750 | + |
| 751 | +require(['core/pubsubhub'], function (respecEvents) { |
| 752 | + const button = respecUI.addCommand( |
| 753 | + 'Save roles as JSON', |
| 754 | + showAriaSave, |
| 755 | + null, |
| 756 | + '☁️' |
| 757 | + ); |
| 758 | + |
| 759 | + function showAriaSave() { |
| 760 | + const json = JSON.stringify(roleInfo, null, ' '); |
| 761 | + const href = 'data:text/html;charset=utf-8,' + encodeURIComponent(json); |
| 762 | + const ariaUI = document.createElement('div'); |
| 763 | + ariaUI.classList.add('respec-save-buttons'); |
| 764 | + ariaUI.innerHTML = ` |
| 765 | + <a href="${href}" download="roleInfo.json" class="respec-save-button">Save JSON</a> |
| 766 | + `; |
| 767 | + respecUI.freshModal('Save Aria roles as JSON', ariaUI, button); |
| 768 | + ariaUI.querySelector('a').focus(); |
| 769 | + } |
| 770 | + respecEvents.sub('end', function (msg) { |
| 771 | + if (msg == 'w3c/conformance') { |
| 772 | + ariaAttributeReferences(); |
| 773 | + } |
769 | 774 | }); |
770 | 775 | }); |
| 776 | + |
0 commit comments