Skip to content

Commit

Permalink
add IA links
Browse files Browse the repository at this point in the history
  • Loading branch information
willf committed Jan 13, 2025
1 parent 226d9b3 commit 21edf96
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3586,6 +3586,7 @@
const countySelect = document.getElementById("countySelect");
const viewReportButton = document.getElementById("viewReportButton");
const viewGitHubButton = document.getElementById("viewGitHubButton");
const viewIAButton = document.getElementById("viewIAButton");
const enabledStates = fipsCodes.filter((state) => !state.disabled);
enabledStates.forEach((state) => {
const option = document.createElement("option");
Expand Down Expand Up @@ -3616,11 +3617,13 @@
}
viewReportButton.disabled = true;
viewGitHubButton.disabled = true;
viewIAButton.disabled = true;
});

countySelect.addEventListener("change", () => {
viewReportButton.disabled = !countySelect.value;
viewGitHubButton.disabled = !countySelect.value;
viewIAButton.disabled = !countySelect.value;
});

viewReportButton.addEventListener("click", () => {
Expand Down Expand Up @@ -3655,6 +3658,22 @@
);
window.open(`https://github.com/${urlPath}`, "_blank");
});

viewIAButton.addEventListener("click", () => {
const selectedCounty = JSON.parse(countySelect.value);
const stateFips = selectedCounty.state_fips;
const state = selectedCounty.state;
const countyFips = selectedCounty.county_fips;
const county = selectedCounty.county;
const date_prefix = "99999999999999";
//https://github.com/edgi-govdata-archiving/CDC_EIJ_DATA_16_Idaho/blob/main/16001_Ada_County_Idaho.pdf
const urlPath =
`${date_prefix}/https://eji.cdc.gov/documents/data/2024/countymaps/${stateFips}_${state}/${countyFips}_${county}_${state}.pdf`.replace(
/ /g,
"_"
);
window.open(`https://web.archive.org/web/${urlPath}`, "_blank");
});
}
window.onload = loadFipsCodes;
</script>
Expand All @@ -3675,6 +3694,9 @@ <h1>
</select>
<br />
<button id="viewReportButton" disabled>View Report at CDC</button>
<button id="viewIAButton" disabled>
View Report at Internet Archive
</button>
<button id="viewGitHubButton" disabled>View Report at GitHub</button>
<p>
<strong>Note:</strong> The reports are in PDF format and will open in a
Expand Down Expand Up @@ -3702,6 +3724,11 @@ <h1>
although most states use counties, some use other administrative
divisions.
</p>
<p>
All reports should be available in the GitHub repository. It is possible
that the CDC will remove or update the reports. Internet Archive links
may or may not work.
</p>
<p>
Prepared for
<a href="https://envirodatagov.org/"
Expand Down

0 comments on commit 21edf96

Please sign in to comment.