Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Example: Add AT support tables from ARIA-AT #2569

Merged
merged 15 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions content/patterns/button/examples/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,27 @@ <h2 id="sc1_label">HTML Source Code</h2>
sourceCode.make();
</script>
</section>

<section id="at-support">
<h2>Assistive Technology Support</h2>
<h3>Command Button</h3>
<iframe
howard-e marked this conversation as resolved.
Show resolved Hide resolved
class="support-levels-command-button"
howard-e marked this conversation as resolved.
Show resolved Hide resolved
src="https://aria-at-app-sandbox.bocoup.com/embed/reports/command-button"
howard-e marked this conversation as resolved.
Show resolved Hide resolved
height="100"
allow="clipboard-write"
style="border-style: none; width: 100%;">
</iframe>

<h3>Toggle Button</h3>
<iframe
class="support-levels-toggle-button"
src="https://aria-at-app-sandbox.bocoup.com/embed/reports/toggle-button"
height="100"
allow="clipboard-write"
style="border-style: none; width: 100%;">
</iframe>
</section>
howard-e marked this conversation as resolved.
Show resolved Hide resolved
</main>
</body>
</html>
14 changes: 14 additions & 0 deletions content/shared/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// Rewrite links so they point to the proper spec document
window.addEventListener('DOMContentLoaded', resolveSpecLinks, false);

// Support levels iframes should not show scrollbars, so a message with the
// correct height will be posted from the iframe.
window.addEventListener('message', fixIframeHeight);

async function addExampleUsageWarning() {
// Determine we are on an example page
if (!document.location.href.match(/examples\/[^/]+\.html/)) return;
Expand Down Expand Up @@ -43,4 +47,14 @@
const fixSpecLink = specLinks({ specStatus: 'ED' });
document.querySelectorAll('a[href]').forEach(fixSpecLink);
}

function fixIframeHeight(event) {
const data = event.data;
if (!data.iframe || !data.height || isNaN(data.height)) {
return;
}
const iframe = document.querySelector(`.${data.iframe}`);
if (!iframe) return;
iframe.style.height = data.height + 'px';
}
})();
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"Hoyt",
"IDREF",
"IDREFS",
"iframes",
"imgs",
"Iskandar",
"issie",
Expand Down