Plus special access to select articles and other premium content with your account – free of charge.
By entering your email and pushing continue, you are agreeing to Fox News’ Terms of Use and Privacy Policy, which includes our Notice of Financial Incentive.
Please enter a valid email address.
Mary Anderson cleared glass windshields and broke glass ceilings.
Advertisement
The southern belle, born in Alabama in the immediate aftermath of the Civil War, gave the world one of its most widely used safety devices.
Anderson patented windshield wipers.
She was, in many ways, a real-life Scarlett O’Hara of “Gone with the Wind” movie fame.
MEET THE AMERICAN WHO COOKED UP KETCHUP, DR. JAMES MEASE, PATRIOT WITH PASSION FOR ‘LOVE APPLES’
Anderson was born to means on a southern plantation but raised in a society devastated by war.
Advertisement
It was also a society that suffered a tragic loss of human capital. Male capital. More than 1 in 5 military-age men (about 22%) in the Confederacy were killed in the Civil War, according to several sources.
American real estate developer, rancher and inventor of the first practical windshield wiper Mary Anderson is shown posing for a portrait circa 1900. (Michael Ochs Archives/Getty Images)
Southerners responded with indomitable spirit. Anderson was among a new era of entrepreneurs and innovators burning with determination to overcome adversity.
Many of them were women, later represented by the fictional icon O’Hara.
Anderson built apartments in Alabama, herded cattle in California and, following a winter trolley trip in New York City, devised a way to keep the world truckin’ in a tempest.
Advertisement
“She didn’t have a father; she didn’t have a husband, and she didn’t have a son.”
“She didn’t have a father; she didn’t have a husband, and she didn’t have a son,” one of her descendants, Sara-Scott Wingo, said in a 2017 interview with NPR.
“And the world was kind of run by men back then.”
Cattle calls & trolley cars
Mary Elizabeth Anderson was born on Feb. 19, 1866, on Burton Hill Plantation in Greene County, Alabama, to John C. and Rebecca Anderson.
The Civil War had ended only 10 months earlier. The conflict was followed by the economic hardship and social upheaval of the Reconstruction Era across the South.
Advertisement
Vivien Leigh as Scarlett O’Hara in “Gone with the Wind.” O’Hara is the archetype of the southern woman who was determined to help the region emerge from the devastation of the Civil War.(Getty Images)
The Anderson family suffered its own loss in 1870. Mary was just four years old when her father died.
“Mary and her sister, Fannie, and mother continued to live off the proceeds from his estate,” the late Dr. J. Fred Olive III, of the University of Alabama Birmingham, wrote for the Encyclopedia of Alabama.
MEET THE AMERICAN WHO NEVER FLINCHED IN THE FIGHT FOR INDEPENDENCE, ABIGAIL ADAMS
The Anderson women moved to Birmingham and entered the real-estate business, building the Fairmont Apartments at the corner of 21st Street and Highland Avenue.
Advertisement
Mary Anderson also sought adventure and/or fortune out west.
In 1893, at age 27, she moved to Fresno, California, where she spent several years managing a vineyard and cattle ranch before returning to Birmingham.
The Anderson women moved to Birmingham, Alabama (shown above) and entered the real-estate business.(Joe Sohm/Visions of America/Universal Images Group via Getty Images)
She also visited New York City in late 1902 and experienced northern weather, apparently for the first time.
“While riding an electric streetcar during a snowstorm, she noticed that the motorman operating the streetcar was shivering,” Charles Carey wrote in the 2002 book, “American Inventors, Entrepreneurs and Business Visionaries.”
Advertisement
“She noticed that the motorman operating the streetcar was shivering … He was constantly having to slide open the middle pane so he could wipe off the glass.”
The author also wrote, “Snow was sticking to the windshield, and he was constantly having to slide open the middle pane so he could wipe off the glass.”
MEET THE AMERICAN WHO MADE PRESCRIPTIONS SAFER, DEBORAH ADLER, INSPIRED BY HOLOCAUST SURVIVOR GRANDMA
The driver’s vision was impaired, as was his operational ability. The situation created safety hazards for both pedestrians and passengers.
The winter ride exposed to the winter elements was likely miserable for a woman who spent her life in warmth and sunshine surrounded by Alabama bougainvillea and California farmland.
Advertisement
People are shown boarding street cars in winter, New York City, circa 1900.(Hulton Archive/Getty Images)
“Upon returning to Alabama,” writes Carey, “Anderson gave much thought to the motorman’s plight.”
‘Teased and laughed at’
Anderson spent the next several months devising a way for drivers to clean their windshields while still inside their vehicles.
She appears to have possessed an innate mechanical capability. There is no indication that Anderson ever trained as a mechanic or engineer.
But she emerged with a clever mechanism that displayed many of the hallmarks of windshield wipers today. She applied for the “window cleaning device” patent in June 1903 and received it in Nov. 1903.
Advertisement
Entrepreneur Mary Anderson’s 1903 patent for a “window cleaning device.” We know it today as the windshield wiper.(U.S. Patent and Trademark Office/Public Domain)
Modern windshield wipers operate via powerful little motors that deliver high torque at low speed with the twist of a knob. Drivers, with Anderson’s original device, operated wipers manually with a lever.
“The lever caused a spring-loaded arm with a rubber blade to swing across the windshield and then back again to [its] original position, thus removing droplets of rain or flakes of snow from the windshield’s surface,” noted Lemelson-MIT, a program devoted to innovation, in its online biography of Anderson.
MEET THE AMERICAN WHO SERVED AS THE MODEL FOR HUCK FINN, ‘KIINDLY YOUNG HEATHEN’ TOM BLANKENSHIP
“It is simply necessary for [the driver] to take hold of the handle and turn it in one direction or the other to clean the pane,” reads the patent application.
Advertisement
“Similar devices had been made earlier,” Lemelson-MIT noted. But Anderson’s “was the first that actually worked.”
Anderson’s wiper worked. But it didn’t sell.
A man operates the windshield wipers on his snow-covered car at night. Circa 1955.(Harold M. Lambert/Lambert/Getty Images)
The inventor “was teased and laughed at by many people because of her idea for the windshield wipers,” said MIT-Lemelson.
Anderson ran into a stonewall of doubt and opposition from the transportation industry and auto titans.
Advertisement
“We regret to state we do not consider it to be of such commercial value as would warrant our undertaking its sale,” said one rejection letter from the Canadian firm of Dinning and Eckenstein.
Anderson “was teased and laughed at by many people because of her idea for the windshield wipers.”
“Through no fault of her own, her invention was simply ahead of its time, and other companies and entrepreneurs were able to profit off her original ideas,” reports the National Inventors Hall of Fame.
A vision with rhythm
Mary Anderson died on June 27, 1953, at her summer home in Monteagle, Tennessee.
She was 87 years old and is interred at Elmwood Cemetery in Birmingham.
Advertisement
Anderson was a “widely known Birmingham resident and owner of the Fairmont Apartments,” said her obituary in the Birmingham Post-Herald.
Mary Anderson of Alabama invented the windshield wiper after a winter trip to New York City, where she watched a trolley-car driver struggle to keep the vehicle’s windshield clean during a snowstorm. (Public Domain)
Her rights to the patent expired in 1920 – just as autos were exploding in popularity and the need to operate them safely in bad weather grew more obvious even to auto titans.
“In 1922, Cadillac began building cars with windshield wipers as a standard feature,” reports the National Inventors Hall of Fame — which inducted Anderson in 2011.
“The rest of the automotive industry followed suit not long after.”
Advertisement
Anderson lived long enough to see the world embrace the vision she had as a young woman in New York City in 1902.
Wiper blades sit on the cockpit windows of an Antonov OKB AN-70 aircraft as it stands on display prior to the opening of the Paris Air Show in Paris, France, 2013. (Balint Porneczi/Bloomberg via Getty Images)
Windshield wipers today are found on almost every vehicle in the world — planes, trains and automobiles.
They’re on boats and trolleys too.
“Windshield wipers clapping time/I was holdin’ Bobby’s hand in mine.” — “Me and Bobby McGee”
Advertisement
Windshield wipers are frontline troops in defense of public safety. They give us eyesight any time Mother Nature drops a blindfold of snow, sleet or rain around our vehicles’ window on the world.
Anderson’s invention also keeps the economy, the constant flow of goods and services, running 24/7.
CLICK HERE TO SIGN UP FOR OUR LIFESTYLE NEWSLETTER
Transportation would come to an immediate halt any time bad weather hit a city, a highway, a state or an entire region, without windshield wipers.
Anderson’s vision even keeps the beat on memorable moments in our lives and in pop culture.
Advertisement
Windshield wipers, among many other uses, provide a built-in paper-clip for parking tickets.(Lindsey Nicholson/Education Images/Universal Images Group via Getty Images)
Songwriter Kris Kristofferson captured the rhythmic reliability of windshield wipers in “Me and Bobby McGee,” his atmospheric American anthem about searching for freedom and love on a rainy night in Louisiana.
Windshield wipers are so essential to modern life we don’t even notice them — unless they’re used as a giant paper-clip for parking tickets.
“Windshield wipers clapping time/I was holdin’ Bobby’s hand in mine/We sang every song that driver knew,” Janis Joplin, and other performers, have sung in popular versions of the tune set to the beat of a windshield wiper metronome.
CLICK HERE TO GET THE FOX NEWS APP
Advertisement
Windshield wipers are so essential to modern life we don’t even notice them — unless they’re used as a giant paper-clip for parking tickets. It’s perhaps the only flaw in Mary Anderson’s essential innovation.
“We’re all really proud of her,” Sara-Scott Wingo, one of her few descendants, said in her 2017 NPR interview.
Mary Anderson, shown in center, patented the windshield wiper in 1903. Her innovation has allowed vehicles to move safely in almost any weather condition.(Karl-Josef Hildenbrand/picture alliance; Michael Ochs Archives; Fox Photo, all via Getty Images)
“I have three daughters. We talk about Mary Anderson a lot. And we all sort of feel like we want to be open and receptive to sort of our own Mary Anderson moments.”
To read more stories in this unique “Meet the American Who…” series from Fox News Digital, click here.
Advertisement
For more Lifestyle articles, visit www.foxnews.com/lifestyle.
The work to become a top three to top five defense across the board in college football for the University of Alabama starts in spring practice.
What Desmond Umeozulu will bring to the Alabama defense
Kalen DeBoer returned experience – especially in the secondary – but his coaching staff also grabbed much needed players from the NCAA transfer portal. One of those athletes looks to develop his name into a marquee edge rusher.
Advertisement
Desmond Umeozulu, a transfer from South Carolina, means a lot to Kane Wommack. The Crimson Tide’s defensive coordinator spoke highly of the Maryland native early in practice. He called Umeozulu a ‘big win’ for Alabama out the portal.
Alabama Linebacker Desmond Umeozulu (9) in action during the Scrimmage at Thomas-Drew Practice Fields in Tuscaloosa, AL on Friday, Mar 27, 2026.
“It was really fortunate for us to get Desmond Umeozulu,” Wommack said.
The 6-foot-6, 253-pounder has worked at the ‘Wolf’ position in practice.
He looks to emerge as a second edge rusher to help Yhonzae Pierre. Umeozulu has been giving the first-team offensive line a challenge. Jackson Lloyd, a redshirt freshman, has taken notice of the talented transfer.
Advertisement
“I have been going against them all for a while,” Lloyd said Monday about the challenge of facing Alabama’s pass rushers in practice. “They are all great pass rushers. Dez [Umeozulu] coming in … He has been good. He’s giving me a good look.”
Umeozulu totaled 30 tackles across 36 career games at South Carolina.
He also had 2.5 tackles for loss and 1.5 sacks in three years of developing behind names such as Bryan Thomas Jr. and Dylan Stewart. Umeozulu is part of iron sharpening iron for the Tide.
BREAKING: Former South Carolina Edge commits to Alabama
It will be interesting to watch him perform on A-Day.
Advertisement
*Get the BEST Alabama football insider information, message board access, and recruiting coverage today! SIGN UP HERE to unlock our subscriber-only content!*
Stephen M. Smith is a team writer for Touchdown Alabama Magazine. You can “like” him on Facebook or “follow” him on Twitter, via @CoachingMSmith.
Stephen Smith is a 2015 graduate of the University of Alabama.
He is a seasoned writer that has covered Alabama football for Touchdown Alabama Magazine since 2009. Smith has extensive knowledge within the program, which has made him among the most respected journalist in his field. Throughout his career, Smith has been featured on ESPN and several other marquee outlets as an analyst.
TUSCALOOSA, Ala.— Alabama football is just a few days away from an open scrimmage in front of the public for the 2026 A-Day Game, but until then, the media got one last peak at what the Crimson Tide’s been working on this spring.
The media was allowed to watch two of Alabama’s practice periods during Tuesday morning’s practice. Here are some of BamaCentral’s practice notes and observations:
Practice report
One quarterback will have to be the first one to take the field on Saturday for A-Day, but Alabama was not giving any hints on who that might be during practice. During the periods the media could see, the quarterbacks were always throwing in groups of three. Austin Mack and Keelon Russell were always part of the first group, and the freshmen QBs Tayden Evan-Kaawa and Jett Thomalla rotated in with that group.
During the drills where all three were throwing at the same time, the quarterbacks first worked on shorter routes like slants on different parts of the field. They then worked on deep routes to all segments of the field.
Based on the groupings of wide receives, it seems pretty clear that Ryan Coleman-Williams, Lotzeir Brooks and NC State transfer Noah Rogers will be Alabama’s starters at receiver with Rico Scott, Derek Meadows and Cederian Morgan also in the mix.
Alabama head coach Kalen DeBoer said at the beginning of spring practice that senior safety Bray Hubbard would be limited this spring. He was not wearing a black jersey on Tuesday and did not appear to be limited. He did not have any noticeable braces or wraps on his body.
DeBoer was keeping a watchful eye over the quarterbacks during the media viewing period.
The cornerbacks started with some press drills off the snap that also involved containing inside leverage. Red Morgan, who has moved all around the secondary the past two years between safety, HUSKY and cornerback, had a really solid rep.
The CBs then worked on a coverage in traffic drill, where two receivers lined up behind each other and one corner was lined up roughly five yards behind the other. After the ball was snapped, the receivers went in opposite directions and the CBs had to quickly decide and follow. Starter Zabien Brown handled this with ease.
Perhaps the most exciting drill from the CBs was one where they pressed against each other and went stride for stride before cutting the route and hauling in an interception. Starter Dijon Lee used his renowned 6-foot-4 frame to disrupt the pass, and his catch radius made it look easy.
Alabama defensive backs coach Maurice Linguist was animated throughout each of the drills. He commended multiple players, but also scolded a couple with hopes that their next rep is much better.
The Alabama Wolf linebackers worked on a block shedding drill. This involved a swim move on a dummy pad at the line of scrimmage and then pushing another pad downward in the backfield. It wasn’t necessarily a full-speed drill, but rather more about getting the technique down.
South Carolina transfer Desmond Umeozulu used some force in the Wolf linebacker drills. Alabama Wolf linebackers coach Christian Robinson showed his approval for Umeozulu after a couple of reps.
The Alabama offensive line spent its early portion of practice working on one-on-one blocking with improving technique and drive as the focus. The starters were difficult to tell due to this, but Jackson Lloyd led the majority of the drills along with center transfer Racin Delgatty.
The linemen rotated through drills keeping their pads low and staying under the chute. Texas transfer Nick Brooks impressed with his hands as he violently moved his men every time he got a chance to take a rep. Brooks has worked at left guard and right tackle this spring, providing new offensive line coach Adrian Klemm with an interesting chess piece.
The Alabama wolves came into view in the midst of the offensive line drills with Yhonzae Pierre leading the group. The Crimson Tide outside linebackers had Pierre, Dezmond Umeozulu, Justin HIll and Jamarion Matthews cycling through drills with Christian Robinson barking instructions, urging his group to play with violence. One of the assistants shouted for Matthews to break the blocking dummy saying the program would just buy another to replace it. Kane Wommack stood to observe the drill and smiled commending the violence and force the four were bringing to the morning practice.
Practice footage
Advertisement
Sign up to our free newsletter and follow us on Twitter/X, Facebook, YouTube, Instagram, Threads and Blue Sky for the latest news.
Tuscaloosa librarian Katy Busby named finalist for Alabama Elementary Teacher of the Year
Advertisement
WHAT INFORMATION THAT WE GIVE YOU ON OUR FREE APP AND OF COURSE ONLINE AS WELL. TUSCALOOSA EDUCATORS EARNING STATEWIDE RECOGNITION FOR HER IMPACT IN THE LIBRARY. TUSCALOOSA MAGNET SCHOOLS ELEMENTARY LIBRARIAN KATIE BUSBY IS NOW ONE OF THE TOP 16 FINALISTS FOR ALABAMA ELEMENTARY TEACHER OF THE YEAR. SHE WAS NAMED THE DISTRICT’S ELEMENTARY TEACHER OF THE YEAR LAST YEAR, BEFOR
Advertisement
Tuscaloosa librarian Katy Busby named finalist for Alabama Elementary Teacher of the Year
Updated: 8:46 PM CDT Apr 6, 2026
Editorial Standards ⓘ
Advertisement
A Tuscaloosa educator is earning statewide recognition for her impact in the library.Tuscaloosa Magnet Schools Elementary librarian Katy Busby is now one of the top 16 finalists for Alabama Elementary Teacher of the Year.Busby was named the district’s Elementary Teacher of the Year last year, before advancing to the state competition.The winner will be announced next month. Your neighborhood: Local coverage from WVTM 13
TUSCALOOSA, Ala. —
A Tuscaloosa educator is earning statewide recognition for her impact in the library.
Advertisement
Tuscaloosa Magnet Schools Elementary librarian Katy Busby is now one of the top 16 finalists for Alabama Elementary Teacher of the Year.
Busby was named the district’s Elementary Teacher of the Year last year, before advancing to the state competition.
The winner will be announced next month.
Advertisement
Your neighborhood: Local coverage from WVTM 13
Advertisement
`;
}
function refreshWeatherIframe(containerId) {
var iframeId = ‘weather-iframe-‘ + containerId;
var iframe = document.getElementById(iframeId);
if (iframe && iframe.src) {
var originalSrc = iframe.src;
iframe.src = originalSrc + (originalSrc.indexOf(‘?’) > -1 ? ‘&’ : ‘?’) + ‘t=” + Date.now();
}
}
function initializeWeatherBox(container) {
var containerId = container.getAttribute(“data-container-id’);
var isWeatherBoxV2 = containerId === ‘home-weather-v2’;
function switchWeatherTab(tabName, clickedElement) {
container.querySelectorAll(‘[data-tab-id]’).forEach(function(tab) {
tab.classList.remove(‘open’);
tab.setAttribute(‘aria-selected’, ‘false’);
});
var targetContent = container.querySelector(‘[data-content-id=”‘ + tabName + ‘”]’);
if (targetContent) {
targetContent.style.display = ‘block’;
targetContent.removeAttribute(‘hidden’);
}
}
function loadWeatherData() {
// If weather data is already being loaded, wait for it
if (window.weatherDataPromise) {
window.weatherDataPromise.then(function(data) {
if (data && data.data) {
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
}
});
return;
}
var location = { zip: window.DEFAULT_ZIPCODE };
Advertisement
try {
var storedLocations = localStorage.getItem(‘hrst.zip.history’);
if (storedLocations) {
var locations = JSON.parse(storedLocations);
if (locations && locations.length > 0) {
location = locations[0];
}
}
} catch (e) {}
var apiUrl = (window.DEWY_HOSTNAME || ”) + ‘/api/v1/weather/full/’ + location.zip;
if (window.fetch) {
window.weatherDataPromise = fetch(apiUrl)
.then(function(response) { return response.json(); })
.then(function(data) {
if (data && data.data) {
var article = container.closest(‘.article–wrapper’);
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
return data;
}
})
.catch(function(error) {
console.error(‘Error loading weather:’, error);
// Reset to unknown background on error
updateWeatherBackground(‘unknown’);
});
}
}
function updateWeatherAlertsBar(weatherData) {
var weatherWatchHeader = container.querySelector(‘.weather-watch-header’);
if (!weatherWatchHeader) return;
var weatherWatchText = weatherWatchHeader.querySelector(‘.weather-watch-text’);
var weatherWatchLink = weatherWatchHeader.querySelector(‘.weather-watch-link’);
Advertisement
if (weatherData.alerts_count > 0) {
weatherWatchHeader.className=”weather-watch-header has-alerts”;
if (weatherWatchText) {
weatherWatchText.textContent = `Weather Alerts (${weatherData.alerts_count})`;
}
if (weatherWatchLink) {
if (!weatherWatchLink.getAttribute(‘data-initial-href’)) {
weatherWatchLink.setAttribute(‘data-initial-href’, weatherWatchLink.getAttribute(‘href’));
weatherWatchLink.setAttribute(‘data-initial-onclick’, weatherWatchLink.getAttribute(‘onclick’) || ”);
}
weatherWatchLink.setAttribute(‘href’, “https://www.wvtm13.com/alerts”);
weatherWatchLink.setAttribute(‘onclick’, “return handleWeatherLinkClick(event, ‘click_alerts’, ‘click’, ‘mobile-weather’, “https://www.wvtm13.com/alerts”);”);
}
} else {
weatherWatchHeader.className=”weather-watch-header”;
if (weatherWatchText) {
weatherWatchText.textContent = containerId === ‘home-weather-v2’ ? ‘Watch Latest Forecast’ : ‘Latest Forecast’;
}
if (weatherWatchLink) {
var initialHref = weatherWatchLink.getAttribute(‘data-initial-href’);
var initialOnclick = weatherWatchLink.getAttribute(‘data-initial-onclick’);
if (initialHref) {
weatherWatchLink.setAttribute(‘href’, initialHref);
}
if (initialOnclick) {
weatherWatchLink.setAttribute(‘onclick’, initialOnclick);
}
}
}
}
function updateCurrentWeather(weatherData) {
if (weatherData.current) {
var tempValue = weatherData.current.temp_f || ”;
var skyValue = weatherData.current.sky || ”;
var feelsLikeValue = weatherData.current.feels_like_f || weatherData.current.temp_f || ”;
var tempEl = container.querySelector(‘.weather-grid–current-temp-value’);
if (tempEl) {
tempEl.textContent = tempValue;
tempEl.setAttribute(‘aria-label’, tempValue + ‘ degrees Fahrenheit’);
}
var iconEl = container.querySelector(‘.weather-grid–current-icon’);
if (iconEl && weatherData.current.icon_name) {
iconEl.className=”weather-grid–current-icon weather-current-icon icon icon-weather-” + weatherData.current.icon_name;
}
var skyEl = container.querySelector(‘.weather-grid–sky’);
if (skyEl) {
skyEl.textContent = skyValue;
skyEl.setAttribute(‘aria-label’, ‘Current condition: ‘ + skyValue);
}
Advertisement
var feelsEl = container.querySelector(‘.weather-grid–feels’);
if (feelsEl) {
feelsEl.textContent = feelsLikeValue + ‘°F’;
feelsEl.setAttribute(‘aria-label’, feelsLikeValue + ‘ degrees Fahrenheit’);
}
var weatherContainer = container.querySelector(‘.weather-temp-container’);
if (weatherContainer) {
var summary = ‘Current temperature ‘ + tempValue + ‘ degrees Fahrenheit, ‘ +
skyValue + ‘, feels like ‘ + feelsLikeValue + ‘ degrees’;
weatherContainer.setAttribute(‘aria-label’, summary);
}
function updateForecastTabs(weatherData) {
var visibleItems = isWeatherBoxV2 ? 6 : 5;
Advertisement
if (weatherData.hourly) {
var hourlyContainer = container.querySelector(‘.weather-hourly-forecast’);
if (hourlyContainer) {
var html=””;
var maxHours = Math.min(visibleItems, weatherData.hourly.length);
for (var i = 0; i 0 ? currentIndex – 1 : tabs.length – 1;
tabs[prevIndex].focus();
break;
case ‘ArrowRight’:
e.preventDefault();
var nextIndex = currentIndex
`;
}
function refreshWeatherIframe(containerId) {
var iframeId = ‘weather-iframe-‘ + containerId;
var iframe = document.getElementById(iframeId);
if (iframe && iframe.src) {
var originalSrc = iframe.src;
iframe.src = originalSrc + (originalSrc.indexOf(‘?’) > -1 ? ‘&’ : ‘?’) + ‘t=” + Date.now();
}
}
function initializeWeatherBox(container) {
var containerId = container.getAttribute(“data-container-id’);
var isWeatherBoxV2 = containerId === ‘home-weather-v2’;
Advertisement
function switchWeatherTab(tabName, clickedElement) {
container.querySelectorAll(‘[data-tab-id]’).forEach(function(tab) {
tab.classList.remove(‘open’);
tab.setAttribute(‘aria-selected’, ‘false’);
});
var targetContent = container.querySelector(‘[data-content-id=”‘ + tabName + ‘”]’);
if (targetContent) {
targetContent.style.display = ‘block’;
targetContent.removeAttribute(‘hidden’);
}
}
function loadWeatherData() {
// If weather data is already being loaded, wait for it
if (window.weatherDataPromise) {
window.weatherDataPromise.then(function(data) {
if (data && data.data) {
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
}
});
return;
}
Advertisement
var location = { zip: window.DEFAULT_ZIPCODE };
try {
var storedLocations = localStorage.getItem(‘hrst.zip.history’);
if (storedLocations) {
var locations = JSON.parse(storedLocations);
if (locations && locations.length > 0) {
location = locations[0];
}
}
} catch (e) {}
var apiUrl = (window.DEWY_HOSTNAME || ”) + ‘/api/v1/weather/full/’ + location.zip;
if (window.fetch) {
window.weatherDataPromise = fetch(apiUrl)
.then(function(response) { return response.json(); })
.then(function(data) {
if (data && data.data) {
var article = container.closest(‘.article–wrapper’);
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
return data;
}
})
.catch(function(error) {
console.error(‘Error loading weather:’, error);
// Reset to unknown background on error
updateWeatherBackground(‘unknown’);
});
}
}
function updateWeatherAlertsBar(weatherData) {
var weatherWatchHeader = container.querySelector(‘.weather-watch-header’);
if (!weatherWatchHeader) return;
Advertisement
var weatherWatchText = weatherWatchHeader.querySelector(‘.weather-watch-text’);
var weatherWatchLink = weatherWatchHeader.querySelector(‘.weather-watch-link’);
if (weatherData.alerts_count > 0) {
weatherWatchHeader.className=”weather-watch-header has-alerts”;
if (weatherWatchText) {
weatherWatchText.textContent = `Weather Alerts (${weatherData.alerts_count})`;
}
if (weatherWatchLink) {
if (!weatherWatchLink.getAttribute(‘data-initial-href’)) {
weatherWatchLink.setAttribute(‘data-initial-href’, weatherWatchLink.getAttribute(‘href’));
weatherWatchLink.setAttribute(‘data-initial-onclick’, weatherWatchLink.getAttribute(‘onclick’) || ”);
}
weatherWatchLink.setAttribute(‘href’, “https://www.wvtm13.com/alerts”);
weatherWatchLink.setAttribute(‘onclick’, “return handleWeatherLinkClick(event, ‘click_alerts’, ‘click’, ‘sidelist-weather’, “https://www.wvtm13.com/alerts”);”);
}
} else {
weatherWatchHeader.className=”weather-watch-header”;
if (weatherWatchText) {
weatherWatchText.textContent = containerId === ‘home-weather-v2’ ? ‘Watch Latest Forecast’ : ‘Latest Forecast’;
}
if (weatherWatchLink) {
var initialHref = weatherWatchLink.getAttribute(‘data-initial-href’);
var initialOnclick = weatherWatchLink.getAttribute(‘data-initial-onclick’);
if (initialHref) {
weatherWatchLink.setAttribute(‘href’, initialHref);
}
if (initialOnclick) {
weatherWatchLink.setAttribute(‘onclick’, initialOnclick);
}
}
}
}
function updateCurrentWeather(weatherData) {
if (weatherData.current) {
var tempValue = weatherData.current.temp_f || ”;
var skyValue = weatherData.current.sky || ”;
var feelsLikeValue = weatherData.current.feels_like_f || weatherData.current.temp_f || ”;
var tempEl = container.querySelector(‘.weather-grid–current-temp-value’);
if (tempEl) {
tempEl.textContent = tempValue;
tempEl.setAttribute(‘aria-label’, tempValue + ‘ degrees Fahrenheit’);
}
var iconEl = container.querySelector(‘.weather-grid–current-icon’);
if (iconEl && weatherData.current.icon_name) {
iconEl.className=”weather-grid–current-icon weather-current-icon icon icon-weather-” + weatherData.current.icon_name;
}
Advertisement
var skyEl = container.querySelector(‘.weather-grid–sky’);
if (skyEl) {
skyEl.textContent = skyValue;
skyEl.setAttribute(‘aria-label’, ‘Current condition: ‘ + skyValue);
}
var feelsEl = container.querySelector(‘.weather-grid–feels’);
if (feelsEl) {
feelsEl.textContent = feelsLikeValue + ‘°F’;
feelsEl.setAttribute(‘aria-label’, feelsLikeValue + ‘ degrees Fahrenheit’);
}
var weatherContainer = container.querySelector(‘.weather-temp-container’);
if (weatherContainer) {
var summary = ‘Current temperature ‘ + tempValue + ‘ degrees Fahrenheit, ‘ +
skyValue + ‘, feels like ‘ + feelsLikeValue + ‘ degrees’;
weatherContainer.setAttribute(‘aria-label’, summary);
}
function updateForecastTabs(weatherData) {
var visibleItems = isWeatherBoxV2 ? 6 : 5;
if (weatherData.hourly) {
var hourlyContainer = container.querySelector(‘.weather-hourly-forecast’);
if (hourlyContainer) {
var html=””;
var maxHours = Math.min(visibleItems, weatherData.hourly.length);
for (var i = 0; i 0 ? currentIndex – 1 : tabs.length – 1;
tabs[prevIndex].focus();
break;
case ‘ArrowRight’:
e.preventDefault();
var nextIndex = currentIndex