Skip to content

Commit

Permalink
Commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-montalvo authored and github-actions[bot] committed Jul 28, 2024
1 parent bd03df2 commit 0adbc07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ARIA/apg/index/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ if (enableSidebar) document.body.classList.add('has-sidebar');
<ul>
<li><a href="#examples_by_role_label">Examples by Role</a></li>
<li><a href="#examples_by_props_label">Examples by Properties and States</a></li>

</ul>
<section id="examples_by_roles">
<h2 id="examples_by_role_label">Examples by Role</h2>
Expand Down Expand Up @@ -949,6 +950,7 @@ if (enableSidebar) document.body.classList.add('has-sidebar');
</tr></tbody>
</table>
</section>

</div>


Expand Down
14 changes: 10 additions & 4 deletions content-assets/wai-aria-practices/shared/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@
// Determine we are on an example page
if (!document.location.href.match(/examples\/[^/]+\.html/)) return;

const isExperimental =
document.querySelector('main')?.getAttribute('data-content-phase') ===
'experimental';

const usageWarningLink = isExperimental
? '/templates/experimental-example-usage-warning.html'
: '/templates/example-usage-warning.html';

// Generate the usage warning link using app.js link as a starting point
const scriptSource = document
.querySelector('[src$="app.js"]')
.getAttribute('src');
const fetchSource = scriptSource.replace(
'/js/app.js',
'/templates/example-usage-warning.html'
);

const fetchSource = scriptSource.replace('/js/app.js', usageWarningLink);

// Load and parse the usage warning and insert it before the h1
const html = await (await fetch(fetchSource)).text();
Expand Down

0 comments on commit 0adbc07

Please sign in to comment.