Skip to content

Commit 867e513

Browse files
authored
feat: extract header disclaimer urls to urls.json (#61)
1 parent 9ce74c6 commit 867e513

File tree

3 files changed

+57
-19
lines changed

3 files changed

+57
-19
lines changed

CompendiumUI/index.html

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,36 @@
3131
<!-- Ad Hoc Prototype Disclaimer Banner -->
3232
<div id="disclaimer-banner" class="disclaimer-banner" role="banner" aria-label="Site disclaimer">
3333
<div class="disclaimer-banner__content">
34-
<a href="https://adhocteam.us" target="_blank" rel="noopener noreferrer" class="disclaimer-banner__logo" aria-label="Ad Hoc homepage">
35-
<img src="/assets/img/adhoc-brand/ad-hoc-logo-white-full-mark.svg" alt="Ad Hoc" class="disclaimer-banner__logo-img" />
34+
<a href="https://adhocteam.us" target="_blank" rel="noopener noreferrer"
35+
class="disclaimer-banner__logo ad-hoc-link" aria-label="Ad Hoc homepage">
36+
<img src="/assets/img/adhoc-brand/ad-hoc-logo-white-full-mark.svg" alt="Ad Hoc"
37+
class="disclaimer-banner__logo-img" />
3638
</a>
3739
<div class="disclaimer-banner__text-wrapper">
3840
<p class="disclaimer-banner__text disclaimer-banner__text--expanded">
3941
<strong>This is not official government information.</strong>
40-
This is a prototype built by Ad Hoc to show how AI can make government PDFs more accessible:
42+
This is a prototype built by Ad Hoc to show how AI can make government PDFs more accessible:
4143
<span class="disclaimer-banner__links">
42-
<a href="/about.html">About</a>
43-
· <a href="https://adhoc.team/URLTBD" target="_blank" rel="noopener noreferrer">Blog Post</a>
44-
· <a href="https://github.com/adhocteam/copyright-compendium" target="_blank" rel="noopener noreferrer">GitHub</a>
44+
<a href="/about.html" class="about-link">About</a>
45+
· <a href="https://adhoc.team/URLTBD" target="_blank" rel="noopener noreferrer"
46+
class="blog-post-link">Blog Post</a>
47+
· <a href="https://github.com/adhocteam/copyright-compendium" target="_blank"
48+
rel="noopener noreferrer" class="github-link">GitHub</a>
4549
</span>
4650

47-
51+
4852
· For the official Compendium, visit
49-
<a href="https://www.copyright.gov/comp3/" target="_blank" rel="noopener noreferrer">copyright.gov</a>.
50-
</p>
53+
<a href="https://www.copyright.gov/comp3/" target="_blank" rel="noopener noreferrer"
54+
class="copyright-gov-link">copyright.gov</a>.
55+
</p>
5156
<p class="disclaimer-banner__text disclaimer-banner__text--compressed">
5257
<strong>Not official government information.</strong>
5358
Prototype by Ad Hoc.
54-
<a href="/about.html">About</a>
55-
· <a href="https://adhoc.team/URLTBD" target="_blank" rel="noopener noreferrer">Blog Post</a>
56-
· <a href="https://github.com/adhocteam/copyright-compendium" target="_blank" rel="noopener noreferrer">GitHub</a>
59+
<a href="/about.html" class="about-link">About</a>
60+
· <a href="https://adhoc.team/URLTBD" target="_blank" rel="noopener noreferrer"
61+
class="blog-post-link">Blog Post</a>
62+
· <a href="https://github.com/adhocteam/copyright-compendium" target="_blank" rel="noopener noreferrer"
63+
class="github-link">GitHub</a>
5764
</p>
5865
</div>
5966
</div>
@@ -169,10 +176,11 @@ <h3 class="version-tooltip__title">About the Copyright Compendium Viewer</h3>
169176
style="display: none;">
170177
<div class="usa-alert__body">
171178
<p class="usa-alert__text">
172-
<strong>⚠️ Experimental Translation:</strong> This feature uses the browser's built-in Translation API (currently supported in Chrome 141+).
173-
Any language other than English represents automatically translated text and is not official.
179+
<strong>⚠️ Experimental Translation:</strong> This feature uses the browser's built-in Translation API
180+
(currently supported in Chrome 141+).
181+
Any language other than English represents automatically translated text and is not official.
174182
The translation may contain inaccuracies or errors. For authoritative information, please refer to the
175-
<a href="#" id="view-original-link" class="usa-link">original English version</a>.
183+
<a href="#" id="view-original-link" class="usa-link">original English version</a>.
176184
Additional languages can be added upon request.
177185
</p>
178186
</div>

CompendiumUI/script.ts

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import '@algolia/autocomplete-theme-classic/dist/theme.css'; // Import theme CSS
55

66
import { chapters } from './chapters';
77
import { version } from './package.json';
8+
import urls from './urls.json';
89

910
// --- Type Definitions ---
1011
declare global {
@@ -120,10 +121,6 @@ declare global {
120121
ai?: {
121122
translator?: TranslatorFactory;
122123
};
123-
124-
MyAppGlossary?: {
125-
refreshTooltips?: () => void;
126-
};
127124
}
128125
}
129126

@@ -555,6 +552,32 @@ document.addEventListener('DOMContentLoaded', () => {
555552
versionNumberElement.textContent = version;
556553
}
557554

555+
// Configured URLs
556+
const blogPostLinks = document.querySelectorAll('.blog-post-link');
557+
blogPostLinks.forEach((link) => {
558+
(link as HTMLAnchorElement).href = urls.blogPostUrl;
559+
});
560+
561+
const adHocLinks = document.querySelectorAll('.ad-hoc-link');
562+
adHocLinks.forEach((link) => {
563+
(link as HTMLAnchorElement).href = urls.adHocUrl;
564+
});
565+
566+
const aboutLinks = document.querySelectorAll('.about-link');
567+
aboutLinks.forEach((link) => {
568+
(link as HTMLAnchorElement).href = urls.aboutUrl;
569+
});
570+
571+
const githubLinks = document.querySelectorAll('.github-link');
572+
githubLinks.forEach((link) => {
573+
(link as HTMLAnchorElement).href = urls.githubUrl;
574+
});
575+
576+
const copyrightGovLinks = document.querySelectorAll('.copyright-gov-link');
577+
copyrightGovLinks.forEach((link) => {
578+
(link as HTMLAnchorElement).href = urls.copyrightGovUrl;
579+
});
580+
558581

559582
// --- Data ---
560583
// --- Data ---

CompendiumUI/urls.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"adHocUrl": "https://adhoc.team",
3+
"aboutUrl": "/about.html",
4+
"blogPostUrl": "https://adhoc.team/2026/02/24/from-pdf-to-platform-using-llms-to-transform-authoritative-copyright-guidance-into-a-digital-first-experience/",
5+
"githubUrl": "https://github.com/adhocteam/copyright-compendium",
6+
"copyrightGovUrl": "https://www.copyright.gov/comp3/"
7+
}

0 commit comments

Comments
 (0)