Step 1: Open your browser of choice
Step 2: navigate to http://vfox-dt.thefurrycollective.ca/counties-auto.html (or wheverever this folder is located)
Step 3: Open Developer Tools or Inspect, or whatever the technical debugging part of the browser is called.
Step 4: To do a TEST for WAYNE COUNTY, put this code in:
// Simulate a "Watch" alert for Wayne County
const countyId = "Wayne"; // must match your SVG id
const fakeClass = "alert-watch"; // yellow fill
// Find the county element in the SVG
const el = getCountyElement(countyId);
// Apply the alert class if not manually overridden
if (el && !manualOverrides[countyId]) {
applyAlertClass(el, fakeClass);
}
// Also update the summary box manually
const summaryEl = document.getElementById("noaa-alert-summary");
if (summaryEl) {
summaryEl.innerHTML = `${countyId.toUpperCase()}: TEST WATCH`;
}
If you want to have it also change the LED:
// Wayne County: Watch (yellow)
const countyId = "Wayne";
const fakeClass = "alert-watch";
const el = getCountyElement(countyId);
if (el && !manualOverrides[countyId]) applyAlertClass(el, fakeClass);
// Update NOAA summary
const summaryEl = document.getElementById("noaa-alert-summary");
if (summaryEl) {
summaryEl.innerHTML = `${countyId.toUpperCase()}: TEST WATCH`;
}
// Turn NOAA LED red
showNOAALed(true);
Step 5: To do a MULTI-COUNTY MULTI-ALERT, such as a WARNING for ESSEX COUNTY and ADVISORY for CHATHAM-KENT, put this code in:
// Simulate multiple alerts at once
// Wayne County: Watch (yellow)
{
const countyId = "Wayne";
const fakeClass = "alert-watch";
const el = getCountyElement(countyId);
if (el && !manualOverrides[countyId]) applyAlertClass(el, fakeClass);
const summaryEl = document.getElementById("noaa-alert-summary");
if (summaryEl) {
summaryEl.innerHTML += `${countyId.toUpperCase()}: TEST WATCH
`;
}
}
// Essex County + Pelee Island: Warning (red)
{
const countyId = "Windsor-Essex-Pelee"; // group id in your SVG
const fakeClass = "alert-warning";
const el = getCountyElement(countyId);
if (el && !manualOverrides[countyId]) applyAlertClass(el, fakeClass);
const summaryEl = document.getElementById("ec-alert-summary");
if (summaryEl) {
summaryEl.innerHTML += `${countyId.toUpperCase()}: TEST WARNING
`;
}
}
// Chatham-Kent + Moraviantown: Advisory (blue)
{
const countyId = "Chatham-Kent-Moraviantown";
const fakeClass = "alert-advisory";
const el = getCountyElement(countyId);
if (el && !manualOverrides[countyId]) applyAlertClass(el, fakeClass);
const summaryEl = document.getElementById("ec-alert-summary");
if (summaryEl) {
summaryEl.innerHTML += `${countyId.toUpperCase()}: TEST ADVISORY
`;
}
}
If you want it to also change the LED:
// Wayne County: Watch
{
const countyId = "Wayne";
const fakeClass = "alert-watch";
const el = getCountyElement(countyId);
if (el && !manualOverrides[countyId]) applyAlertClass(el, fakeClass);
const summaryEl = document.getElementById("noaa-alert-summary");
if (summaryEl) {
summaryEl.innerHTML += `${countyId.toUpperCase()}: TEST WATCH
`;
}
showNOAALed(true); // LED red
}
// Essex County: Warning
{
const countyId = "Windsor-Essex-Pelee";
const fakeClass = "alert-warning";
const el = getCountyElement(countyId);
if (el && !manualOverrides[countyId]) applyAlertClass(el, fakeClass);
const summaryEl = document.getElementById("ec-alert-summary");
if (summaryEl) {
summaryEl.innerHTML += `${countyId.toUpperCase()}: TEST WARNING
`;
}
showECLed(true); // LED red
}
// Chatham-Kent: Advisory
{
const countyId = "Chatham-Kent-Moraviantown";
const fakeClass = "alert-advisory";
const el = getCountyElement(countyId);
if (el && !manualOverrides[countyId]) applyAlertClass(el, fakeClass);
const summaryEl = document.getElementById("ec-alert-summary");
if (summaryEl) {
summaryEl.innerHTML += `${countyId.toUpperCase()}: TEST ADVISORY
`;
}
showECLed(true); // LED red
}
Step 5: To clear all alerts, type this in to the browser console:
// Reset all counties back to "alert-none"
document.querySelectorAll('.county').forEach(el => {
// Remove any existing alert-* classes
el.classList.remove(
'alert-watch',
'alert-warning',
'alert-emergency',
'alert-advisory',
'alert-sws'
);
// Apply the neutral state
el.classList.add('alert-none');
});
// Clear summaries
const noaaSummary = document.getElementById("noaa-alert-summary");
const ecSummary = document.getElementById("ec-alert-summary");
if (noaaSummary) noaaSummary.innerHTML = `No active NOAA alerts for SE Michigan.`;
if (ecSummary) ecSummary.innerHTML = `No active EC alerts for SW Ontario.`;
// Reset LEDs
document.getElementById("noaa-led")?.classList.remove("alert-active");
document.getElementById("ec-led")?.classList.remove("alert-active");
or try this:
resetAlerts(); // clears counties, summaries, timestamps, and LEDs back to neutral
Step 5: How to test for a service outage (being unable to access NOAA.gov or weather.gc.ca):
Run these commands, seperately, into your browser console:
// Simulate NOAA fetch failure
showNOAALed(false);
const summaryEl = document.getElementById("noaa-alert-summary");
if (summaryEl) {
summaryEl.innerHTML = `Unable to fetch NOAA alerts (service error).`;
}
// Simulate EC fetch failure
showECLed(false);
const summaryEl = document.getElementById("ec-alert-summary");
if (summaryEl) {
summaryEl.innerHTML = `Unable to fetch EC alerts (service error).`;
}
to make the LEDs turn amber too....
// Simulate NOAA fetch failure
const led = document.getElementById("noaa-led");
if (led) {
led.classList.remove("alert-active", "alert-none", "alert-outage"); // clear old states
led.classList.add("alert-outage"); // amber state
}
const summaryEl = document.getElementById("noaa-alert-summary");
if (summaryEl) {
summaryEl.innerHTML = `Unable to fetch EC alerts (service error).`;
}
// Simulate EC fetch failure
const led = document.getElementById("ec-led");
if (led) {
led.classList.remove("alert-active", "alert-none", "alert-outage"); // clear old states
led.classList.add("alert-outage"); // amber state
}
const summaryEl = document.getElementById("ec-alert-summary");
if (summaryEl) {
summaryEl.innerHTML = `Unable to fetch EC alerts (service error).`;
}
or try these:
// NOAA outage
const noaaLed = document.getElementById("noaa-led");
if (noaaLed) {
noaaLed.classList.remove("alert-active");
noaaLed.classList.add("alert-outage"); // amber
}
const noaaSummary = document.getElementById("noaa-alert-summary");
if (noaaSummary) {
noaaSummary.innerHTML = `Unable to fetch NOAA alerts (service error).`;
}
// EC outage
const ecLed = document.getElementById("ec-led");
if (ecLed) {
ecLed.classList.remove("alert-active");
ecLed.classList.add("alert-outage"); // amber
}
const ecSummary = document.getElementById("ec-alert-summary");
if (ecSummary) {
ecSummary.innerHTML = `Unable to fetch EC alerts (service error).`;
}
Step 6: To refresh on command, just type this into console:
pollAlerts();
Step 7: Since we've updated a lot of code, we can run multi-alerts better, and it auto-detects where the timestamps are, to not touch them. just insert this into your browser's console:
// Mock NOAA + EC alerts (no timestamps included)
const summaryLines = [
"WAYNE COUNTY: Severe Thunderstorm Warning",
"WAYNE COUNTY: Tornado Watch",
"OAKLAND COUNTY: Flood Advisory",
"WINDSOR-ESSEX-PELEE: Tornado Watch",
"CHATHAM-KENT-MORAVIANTOWN: Severe Thunderstorm Warning",
"LAMBTON COUNTY: Flood Advisory"
];
// regroup alerts by county
const alertsByCounty = {};
summaryLines.forEach(line => {
const parts = line.split(": ");
if (parts.length < 2) return;
const [county, type] = parts;
if (!alertsByCounty[county]) alertsByCounty[county] = [];
alertsByCounty[county].push(type);
});
// build summary with bullets + color coding
let summaryHTML = "";
for (const county in alertsByCounty) {
summaryHTML += `${county}: