Skip to content

Commit ff44068

Browse files
authored
Import
From `Autodesk/pull/177`
1 parent 744ead6 commit ff44068

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/assets/js/repository.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
$(window).bind('load', function()
2+
{
3+
const queryString = new URLSearchParams(location.search);
4+
const nwo = queryString.get('nwo');
5+
6+
// Add nwo query string to all navigation links
7+
$('.navigation a').each(function()
8+
{
9+
const href = $(this).attr('href');
10+
const noNwoQuery = $(this).attr('data-no-nwo-query')
11+
12+
if (noNwoQuery === undefined) {
13+
$(this).attr('href', `${href}?nwo=${nwo}`);
14+
}
15+
});
16+
17+
// Replace all canvas data urls with repository specific urls
18+
$('[data-url]').each(function()
19+
{
20+
const dataUrl = $(this).attr('data-url');
21+
$(this).attr('data-url', dataUrl.replace('/repository', `/repository/${nwo}`));
22+
});
23+
});

0 commit comments

Comments
 (0)