Connect with us

New Hampshire

Transgender schoolgirls are told by judge that they can flout New Hampshire state law that bans them from competing in women’s and girls’ sports

Published

on

Transgender schoolgirls are told by judge that they can flout New Hampshire state law that bans them from competing in women’s and girls’ sports


A federal judge in New Hampshire has told two transgender students they can disregard a state law that bans them from competing in women’s and girls’ sports at their public high schools. 

U.S. District Court Chief Judge Landya McCafferty allowed Parker Tirrell, 15, and Iris Turmelle, 14 – who both use the pronouns she and her – to participate in female sports after their families filed a lawsuit on Friday to overturn the ‘Fairness in Women’s Sports Act’.

Republican Governor Chris Sununu signed the new law in July, which requires students to play on sports teams that align with the sex listed on their birth certificate. 

House Bill 1205 was scheduled to go into effect on Monday – the same day Parker started soccer practice. Meanwhile, Iris hopes to soon try out for the girls track and field and tennis team at her school. 

Advertisement

Now, McCafferty, who was nominated by former President Barack Obama in 2013, has granted the teens a temporary restraining order against the New Hampshire law. 

U.S. District Court Chief Judge Landya McCafferty allowed Parker Tirrell, 15 (pictured) to participate in female sports after their families filed a lawsuit on Friday to overturn the ‘Fairness in Women’s Sports Act’ 

McCafferty also granted Iris Turmelle, 14, (pictured) to participate in girls' sports at her public high school after her and Parker's family's sued the state on Friday

McCafferty also granted Iris Turmelle, 14, (pictured) to participate in girls’ sports at her public high school after her and Parker’s family’s sued the state on Friday 

When he signed the bill into law, Sununu said it ‘ensures fairness and safety in women’s sports by maintaining integrity and competitive balance in athletic competitions.’

The judge found that Parker, whose family sought an emergency order for their child, had ‘demonstrated that she is likely to succeed on the merits of her case.’ 

The students’ legal team and the state now have two weeks to schedule a preliminary hearing order that would block the new law being enforced while the case continues. 

According to the lawsuit, the state’s new law ‘violates protections and federal laws because the teens are being denied equal educational opportunities and are being discriminated against because they are transgender.’ 

Advertisement

McCafferty went on to question how law would protect biological girls from ‘unfair competition’ given that Parker has been taking puberty blockers to prevent changes to her body. 

The judge also found that without the blockers, Parker would endure irreversible harm. 

Iris is also taking puberty-blocking medication and hormone therapy ‘to alleviate the distress of physical characteristics that conflict with their gender identity,’ the suit said. 

McCafferty, who was nominated by former President Barack Obama in 2013, has granted the teens a temporary restraining order against the New Hampshire law

McCafferty, who was nominated by former President Barack Obama in 2013, has granted the teens a temporary restraining order against the New Hampshire law

Republican Governor Chris Sununu (pictured in January) signed the new law in July, which requires students to play on a sports team that aligns with the sex listed on their birth certificate

Republican Governor Chris Sununu (pictured in January) signed the new law in July, which requires students to play on a sports team that aligns with the sex listed on their birth certificate

Michael DeGrandis, an attorney for the state, argued that even though missing soccer practice is ‘stressful’, it doesn’t mean they should be excused from the law. 

‘The law denies them the many educational, social, and physical and mental health benefits that come with playing sports, isolating them from friends and teammates while singling them out for discrimination solely because they are transgender girls,’ GLAD, an advocacy group representing the athletes, said in a statement. 

Advertisement

After the hearing, Chris Erchull, an attorney at GLAD Legal Advocates & Defenders, said that the temporary ruling was anticipated.   

‘We are very happy with the judge’s order. It is also what we expected, because we know that this law is unfair and violates the rights of transgender girls of New Hampshire,’ Erchull said. 

According to court documents, Parker, a rising senior, at Plymouth Regional High School, played for the soccer team last year and was hoping to participate again. 

‘Playing soccer with my teammates is where I feel the most free and happy. We’re there for each other, win or lose,’ Tirrell said. 

‘Not being allowed to play on my team with the other girls would disconnect me from so many of my friends and make school so much harder.

Advertisement

‘I just want to be myself and to learn, play, and support my teammates like I did last year.’ 

Iris is an incoming freshman at Pembroke Academy who was looking forward to getting into sports at their school. 

According to court documents, Parker (pictured), a rising senior, at Plymouth Regional High School, played for the soccer team last year and was hoping to participate again

According to court documents, Parker (pictured), a rising senior, at Plymouth Regional High School, played for the soccer team last year and was hoping to participate again

‘Starting high school is exciting and new. I played intramural tennis in middle school,’ Iris said. 

‘I’ve been looking forward to trying out for the tennis and track teams because it will be a way to make more friends in my new school, and I know I’ll learn a lot from it.

‘I’m a transgender girl, I’ve known that my whole life and everyone knows I’m a girl. I don’t understand why I shouldn’t get to have the same opportunities as other girls at school,’ she added. 

Advertisement

Both of their mother’s feel strongly about their children’s passions and won’t stand to see a bill get in their way. 

‘Any parent wants to know their child is healthy, happy, and feels like they belong. That is no different for my husband and me as parents of a transgender daughter,’ Sara, Parker’s mom, said. 

‘I am really worried about the harmful impact it will have on Parker’s self-esteem and wellbeing if she is told she has to start the new school year without joining her teammates on the field.’ 

Iris’s mother, Amy, explained that her daughter was bullied in middle school and that her and her husband just want to protect her. 

‘After participating in Girls on the Run she is also looking forward to a new challenge by trying out for the school track and field team,’ she said. 

Advertisement
After the hearing, Chris Erchull (pictured), an attorney at GLAD Legal Advocates & Defenders, said that the temporary ruling was anticipated

After the hearing, Chris Erchull (pictured), an attorney at GLAD Legal Advocates & Defenders, said that the temporary ruling was anticipated

In July, three transgender athletes swept the board in a 1-2-3 at a prestigious women's cycle race in the elite women's Madison at Washington's Marymoor Grand Prix

In July, three transgender athletes swept the board in a 1-2-3 at a prestigious women’s cycle race in the elite women’s Madison at Washington’s Marymoor Grand Prix

‘Iris experienced bullying at her middle school, and my husband and I just want her to be safe, feel included, and to be treated fairly so she can have a positive and happy high school experience.’ 

DailyMail.com contacted Governor Sunu, the New Hampshire Department of Education and the New Hampshire Attorney General’s Office for comment. 

The lawsuit comes as the country continues to debate about bans against transgender athletes in women’s sports. 

In July, three transgender athletes swept the board in a 1-2-3 at a prestigious women’s cycle race in the elite women’s Madison at Washington’s Marymoor Grand Prix. 

The athletes’ places left fans infuriated and female competitors in the shade. marking the first time trans women are known to have had a place on every podium spot in a race.

Advertisement

Race venue the Jerry Baker Memorial Velodrome in Redmond warned it would not tolerate ‘bullying or derogatory comments especially related to race, creed, religion, gender identity, sexual orientation, national origin, physical or mental disability.’ 



Source link

New Hampshire

General John Stark Day celebrated in NH

Published

on

General John Stark Day celebrated in NH


General John Stark Day celebrated in New Hampshire

Advertisement

TRAFFIC AND INTERDICT ILLEGAL ACTIVITY MORE EFFICIENTLY. TODAY, THE GRANITE STATE CELEBRATES THE LEGACY OF GENERAL JOHN STARK. THE SECOND MONDAY OF APRIL IS OBSERVED AS GENERAL JOHN STARK DAY. HE WAS A HERO OF THE AMERICAN REVOLUTION AND IS CREDITED WITH WRITING THE WORDS THAT BECAME NEW HAMPSHIRE’S MOTTO. HE WROTE, QUOTE, LIVE FREE OR DIE. DEATH IS NOT THE WORST OF EVILS, WHICH WAS LATER SHORTENED TO LIVE FREE OR DIE. A LOT OF PEOPLE IN OUR COUNTRY, EVERY GENERATION, MEN AND WOMEN WHO HAVE SERVED, ARE WHY WE ARE FREE. IT’S NOT JUST GENERAL STARK. HE SHOWED US THE WAY AND GENERAL WASHINGTON, BUT EVERY GENERATION OF MEN AND WOMEN WHO HAVE SERVED OUR COUNTRY HAVE ENSURED THAT FREEDOM. STARK IS MOST WELL KNOWN FOR SERVICE AT THE BATTLE OF BENNINGT

The Granite State honored the legacy of Gen. John Stark on Monday. Gen. John Stark Day is observed on the second Monday in April. Stark was a hero of the American Revolution and is credited with writing the words that became New Hampshire’s state motto. He wrote “Live Free or Die: Death is not the worst of evils,” later shortened to “Live Free or Die.”>> Download the free WMUR app to get updates on the go

The Granite State honored the legacy of Gen. John Stark on Monday.

Advertisement

Gen. John Stark Day is observed on the second Monday in April.

Stark was a hero of the American Revolution and is credited with writing the words that became New Hampshire’s state motto. He wrote “Live Free or Die: Death is not the worst of evils,” later shortened to “Live Free or Die.”

>> Download the free WMUR app to get updates on the go

Advertisement

“A lot of people in our country, every generation, men and women who have served, are why we are free,” said Gov. Kelly Ayotte. “It’s not just General John Stark. He showed us the way, and General Washington, but every generation of men and women who have served our country have ensured that freedom.”

Stark is known for his service at the Battle of Bennington in Vermont.

He retired in 1810 and died in Manchester in 1822.

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();
}
}

Advertisement

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’);
});

clickedElement.classList.add(‘open’);
clickedElement.setAttribute(‘aria-selected’, ‘true’);

container.querySelectorAll(‘[data-content-id]’).forEach(function(content) {
content.style.display = ‘none’;
content.setAttribute(‘hidden’, ‘true’);
});

var targetContent = container.querySelector(‘[data-content-id=”‘ + tabName + ‘”]’);
if (targetContent) {
targetContent.style.display = ‘block’;
targetContent.removeAttribute(‘hidden’);
}
}

Advertisement

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 };

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’);
});
}
}

Advertisement

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’);

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.wmur.com/alerts”);
weatherWatchLink.setAttribute(‘onclick’, “return handleWeatherLinkClick(event, ‘click_alerts’, ‘click’, ‘mobile-weather’, “https://www.wmur.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’);
}

Advertisement

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);
}

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);
}

updateWeatherBackground(weatherData.current.icon_name);
}
}

Advertisement

function updateWeatherBackground(iconName) {
try {
var bgPath = weatherImages.backgrounds[iconName] || weatherImages.backgrounds.unknown;
container.style.backgroundImage=”url(” + bgPath + ‘)’;
} catch (e) {
console.log(‘Error updating weather background:’, e);
}
}

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



Source link

Advertisement
Continue Reading

New Hampshire

Proposed bills to address New Hampshire’s insect crisis – Valley News

Published

on

Proposed bills to address New Hampshire’s insect crisis – Valley News


The New Hampshire Senate Committee on Energy and Natural Resources heard two ideas to address shrinking insect populations in New Hampshire during a Tuesday hearing.

One measure, House Bill 1431, would direct the state Pesticide Control Board to reclassify a group of pesticides that is particularly harmful to pollinators and wildlife as restricted use, meaning their use would be limited to professional pesticide applicators. The group of pesticides, called neonicotinoids, has been linked to ecosystem-wide effects from insect and bird population declines to cyanobacteria blooms.

Another bill, House Bill 1086, would establish a committee to study the feasibility and possible outcomes of a ban on seeds treated with neonicotinoid pesticides. Seed treatments are common in grain crops, including corn.

Advertisement

Both bills were sponsored by Rep. John MacDonald, R-Wolfeboro.

“We have to do something,” MacDonald said Tuesday. “I’m not trying to take away any powers of the Pesticide Control Board, but nobody’s doing anything. And I don’t know, I can’t figure out why.”

The windshield effect and beyond

Rosemary Malfi, director of conservation policy for the insect conservation nonprofit Xerces Society, said the decline of insects in New Hampshire is evident in the “windshield effect.”

“Do you remember, anyone who drove a car in the ’90s or early 2000s, you actually got bugs on your windshield? I think everyone here probably knows that that doesn’t happen so much anymore. Neonicotinoid insecticides, or ‘neonics,’ are a major contributor to these declines,” she said.

Forty percent of the bumblebee species historically found in New Hampshire are locally extinct or in severe decline, while about 70% of butterfly species are losing numbers, too, Malfi said. Other classes of insects, including aquatic insects, are affected as well.

Advertisement

This ripples out to affect animals higher up the food chain, including fish and birds. Beneath insects on the ecosystem ladder, meanwhile, are the microorganisms that contribute to harmful cyanobacteria blooms; this means that insect decline can allow cyanobacteria to proliferate, potentially worsening those costly problems, said Rep. Peter Bixby, D-Dover.

Learning from neighbors

As proposed, HB 1086 calls for a committee of three representatives and one senator to assess data from Quebec and New York, where bans on neonicotinoid treated seeds are in place already. They could also assess information from other areas with bans, MacDonald said.

The committee would assess whether bans in other regions have affected crop yields. Some speakers on Tuesday said studies show neonicotinoid seeds to be ineffective at increasing yields.

“We’re concerned that our agricultural community is being asked to pay for a product on seeds that isn’t necessarily helping productivity, but is having serious consequences, both to soil ecology and to water ecology,” said Carol Foss, senior adviser for science and policy with NH Audubon.

Nisa Marks, a wildlife biologist and organic farmer from Henniker, N.H., said neonicotinoids were not necessary for successful crops. But some farmers who attended said restrictions could harm them. Sarah Wrocklage, of Tecce Farm in Durham, N.H., said pests would cause losses on her farm if she could not treat them with chemicals.

Advertisement

In her testimony, Wrocklage also touched on another area that the committee would be directed to consider: Whether it would be possible for farmers to switch to untreated seeds at all. Some of the sweetcorn that Tecce Farm plants is only available in treated form, Wrocklage said.

She and another farmer, Chuck Souther of Concord’s Apple Hill Farm, called for more involvement of local farmers and New Hampshire experts, including those from the University of New Hampshire. As proposed, they said, they did not support the bill, feeling it did not adequately take into account the unique circumstances on New Hampshire farms.

“We do need to look at this, but we need to look at it under New Hampshire conditions,” Souther said.

Requiring action

Though conservationists and farmers agreed insect decline was a problem, at the Tuesday hearings, some senators and speakers questioned the necessity of the bills.

Sen. Howard Pearl, R-Loudon, who is vice chair of the Energy and Natural Resources Committee, asked if a study committee was necessary given the associated costs.

Advertisement

MacDonald said it was. The committee called for in HB 1086 would be “targeted, efficient, and time-bound,” he said. It is designed to last through the summer of 2026 and deliver a report in November.

On HB 1431, speakers, including Robert Johnson of the New Hampshire Farm Bureau Association, suggested the task of restricting neonicotinoid use should be left up to the Pesticide Control Board. Johnson said he disagreed with directing the board’s actions through legislation.

But MacDonald said he had been part of conversations and a subcommittee with the Pesticide Control Board regarding neonicotinoids and had seen no action resulting from those meetings.

“This bill provides clarity on whether action is optional or whether it’s required,” he said.

Both bills have been amended from their original form. As introduced, HB 1086 proposed a ban on seed coatings rather than a study committee, while HB 1431 originally proposed more restrictions, including prohibitions on the use of chemicals on state property and on flowering plants. It also originally sought to make the violation of these rules a misdemeanor for individuals and a felony for organizations or companies. But as amended, the bill leaves more elements of the ban in the hands of the Pesticide Control Board.

Advertisement

Rep. Jonah Wheeler, D-Peterborough, said he had favored a stricter version of both bills in committee discussions, but believed the amended legislation would be a step forward nonetheless. The legislation “deals with a really urgent issue that our constituents are begging us to tackle,” he said.

“The more that we as a society find ourselves away from … symbiosis with the environment in which we live, the natural harmony that exists on this planet, then the more we will find ourselves with problems like pest infestations,” he said.



Source link

Advertisement
Continue Reading

New Hampshire

Bomb threat reported at Pelham Post Office, no explosives found

Published

on

Bomb threat reported at Pelham Post Office, no explosives found


Bomb threat reported at Pelham Post Office, no explosives found

Advertisement

WMUR NEWS NINE TONIGHT STARTS RIGHT NOW. WE BEGIN WITH BREAKING NEWS FROM PELHAM, THE PELHAM PLAZA ON BRIDGE STREET IS BACK OPEN TONIGHT. PELHAM POLICE SAY A BOMB WAS REPORTED IN A MAILBOX IN FRONT OF THE POST OFFICE, BUT THERE WA

Advertisement

Bomb threat reported at Pelham Post Office, no explosives found

Updated: 11:07 PM EDT Apr 12, 2026

Editorial Standards

Advertisement
Pelham police investigated a bomb threat Sunday night at the Pelham Post Office. According to officials, police received a report of a bomb in a mailbox in front of the post office around 7:30 p.m. Out of an abundance of caution, all businesses in Pelham Plaza were evacuated and closed. >> Download the free WMUR app to get updates on the go

Pelham police investigated a bomb threat Sunday night at the Pelham Post Office.

According to officials, police received a report of a bomb in a mailbox in front of the post office around 7:30 p.m.

Advertisement

Out of an abundance of caution, all businesses in Pelham Plaza were evacuated and closed.

>> Download the free WMUR app to get updates on the go

New Hampshire State Police and the Nashua Police Department assisted with the investigation.

Advertisement

No explosives were found, and the shopping plaza has since reopened.

The investigation is ongoing. Anyone with information is asked to contact Lt. Adam Thistle at 603-635-2411.

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’;

Advertisement

function switchWeatherTab(tabName, clickedElement) {
container.querySelectorAll(‘[data-tab-id]’).forEach(function(tab) {
tab.classList.remove(‘open’);
tab.setAttribute(‘aria-selected’, ‘false’);
});

clickedElement.classList.add(‘open’);
clickedElement.setAttribute(‘aria-selected’, ‘true’);

container.querySelectorAll(‘[data-content-id]’).forEach(function(content) {
content.style.display = ‘none’;
content.setAttribute(‘hidden’, ‘true’);
});

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.wmur.com/alerts”);
weatherWatchLink.setAttribute(‘onclick’, “return handleWeatherLinkClick(event, ‘click_alerts’, ‘click’, ‘mobile-weather’, “https://www.wmur.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);
}

updateWeatherBackground(weatherData.current.icon_name);
}
}

function updateWeatherBackground(iconName) {
try {
var bgPath = weatherImages.backgrounds[iconName] || weatherImages.backgrounds.unknown;
container.style.backgroundImage=”url(” + bgPath + ‘)’;
} catch (e) {
console.log(‘Error updating weather background:’, e);
}
}

Advertisement

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



Source link

Advertisement
Continue Reading
Advertisement

Trending