Connect with us

Iowa

Iowa Supreme Court lifts injunction on abortion law, allowing enforcement of six week ban • Nebraska Examiner

Published

on

Iowa Supreme Court lifts injunction on abortion law, allowing enforcement of six week ban • Nebraska Examiner


Most abortions will soon be illegal in Iowa after six weeks of pregnancy following the Iowa Supreme Court’s decision Friday to overturn a lower court’s block on the 2023 abortion law.

The 4-3 decision allows enforcement of the law that was previously blocked by a temporary injunction in a case challenging Iowa’s law restricting most abortions after six weeks of pregnancy.

Abortion remains legal in Iowa for now, until the case returns to the district court for further proceedings, according to American Civil Liberties Union of Iowa. That will take at least 21 days under Iowa court rules, according to ACLU of Iowa, and abortion will remain legal during that time.

The law bans abortions after cardiac activity can be detected in an embryo, with exceptions in cases of rape, incest, and when the medical procedure is necessary to save the life of the mother. To qualify for an exception to the law, people must report the rape resulting in pregnancy within 45 days to law enforcement or a public health agency or doctor, and within 140 for cases of incest.

Advertisement

Embryonic cardiac activity can typically be detected as early as six weeks of gestation. Reproductive health care advocates have argued that many women do not know they are pregnant at six weeks, and that the law would effectively make most abortions illegal in Iowa. Abortions were previously legal in Iowa up to 20 weeks of pregnancy.

The lawsuit was brought forward by Planned Parenthood of the Heartland, the Emma Goldman Clinic — both health care providers that perform abortions — as well as Dr. Sarah Traxler and ACLU of Iowa.

The ruling states that the Iowa law is serving a legitimate state interest, and thus can be upheld legally.

“Every ground the State identifies is a legitimate interest for the legislature to pursue, and the restrictions on abortion in the fetal heartbeat statute are rationally related to advancing them,” Justice Matthew McDermott wrote in the majority opinion. “As a result, Planned Parenthood’s substantive due process challenge fails. The district court thus erred in granting the temporary injunction.”

Governor praises decision

Gov. Kim Reynolds, a supporter of the measure, alongside Senate Majority Leader Jack Whitver and House Speaker Pat Grassley, praised the court decision in a news release Friday.

Advertisement

“There is no right more sacred than life, and nothing more worthy of our strongest defense than the innocent unborn,” Reynolds said in a statement. “Iowa voters have spoken clearly through their elected representatives, both in 2018 when the original heartbeat bill was passed and signed into law, and again in 2023 when it passed by an even larger margin. I’m glad that the Iowa Supreme Court has upheld the will of the people of Iowa.”

Iowa Democratic Party Chair Rita Hart wrote in a statement that the decision strips Iowa women of “reproductive rights that they have maintained for more than 50 years.”

“It’s obvious Kim Reynolds and Iowa Republicans do not trust women to make their own decisions regarding their own medical care or for doctors to use their best judgment while treating their patients,” Hart said in a statement. “Republicans went too far with this abortion ban, and Iowa voters will hold them accountable this November.”

Reynolds signed the six-week abortion ban into law after convening the Legislature for a special session in July 2023. That session followed a state Supreme Court decision in June of the same year to uphold the injunction on the 2018 so-called “fetal heartbeat” law, a similar measure.

Justices were split in a 3-3 decision on the case, upholding a lower court’s decision to enjoin the law. The 2018 abortion law was previously ruled unconstitutional, but Reynolds challenged the decision following major changes to abortion law at both the state and federal levels. In June 2022, the U.S. Supreme Court ruled in Dobbs v. Jackson Women’s Health Organization that there was no constitutional right to an abortion, overturning the 1973 Roe v. Wade precedent and allowing states to enact abortion restrictions.

Advertisement

Since the U.S. constitutional protections for abortion lifted, multiple states have enacted restrictions or total bans on abortion. Most states surrounding Iowa have enacted laws limiting the procedure since 2022, according to information compiled by the Guttmacher Institute. South Dakota and Missouri have near total abortion bans with limited exceptions. Nebraska has restricted abortion at 12 weeks of gestation, and in Kansas and Wisconsin, abortions are currently legal up to 22 weeks of pregnancy.

Minnesota and Illinois have the fewest restrictions, allowing abortions to be performed until “fetal viability” — when a fetus is able to survive outside the uterus, typically around 25 weeks of pregnancy. Exceptions are granted for this limit in cases where the procedure is necessary to save the life of the woman, or if their health is at risk.

Days prior to the U.S. Supreme Court’s Dobbs decision, the Iowa Supreme Court found there is no state constitutional right to an abortion. That decision came in a case on the state law requiring a 24-hour waiting period and ultrasound for patients seeking an abortion.

While the state Supreme Court overturned the strict scrutiny legal standard for abortion laws — a test requiring a law serves a “compelling state interest” and uses the least restrictive means possible — Iowa Supreme Court Justice Edward Mansfield wrote that “we do not at this time decide what constitutional standard should replace it.”

‘Strict scrutiny’ legal standards

The arguments made in court about the 2018 abortion ban largely centered around what legal standard should replace “strict scrutiny” for Iowa abortion laws. But in the decision upholding the injunction, the Iowa Supreme Court did not put forward a new standard.

Advertisement

During oral arguments in April, attorneys representing Iowa and reproductive health care providers and advocates argued for what legal standard should replace “strict scrutiny” for Iowa abortion laws.

Eric Wessen, representing the state, called for the “rational basis” test to be used  — a lower standard that means a law is constitutional if the state has a legitimate reason to enact it. Attorney Peter Im, representing Planned Parenthood and the ACLU of Iowa, argued for the “undue burden” test, a standard higher than “rational basis” that requires laws not be too burdensome or restrictive of an individual’s fundamental rights.

The court sided with the state in the case, with McDermott writing that the Supreme Court holds “that abortion restrictions alleged to violate the due process clause are subject to the rational basis test.”

“Employing that test here, we conclude that the fetal heartbeat statute is rationally related to the state’s legitimate interest in protecting unborn life,” McDermott wrote.

The case was returned to the district court to “dissolve the temporary injunction and continue with further proceedings,” he wrote.

Advertisement

Chief justice dissents

In a dissenting opinion, Chief Justice Susan Christensen wrote that she “cannot stand by this decision,” holding there is no fundamental right to terminate a pregnancy under the state constitution.

“The majority’s rigid approach relies heavily on the male-dominated history and traditions of the 1800s, all the while ignoring how far women’s rights have come since the Civil War era,” Christensen wrote. “It is a bold assumption to think that the drafters of our state constitution intended for their interpretation to stand still while we move forward as a society. Instead, we should interpret our constitution through a modern lens that recognizes how our lives have changed with the passage of time.”

Christiansen wrote in the opinion that the majority opinion was too reliant on the state constitutional text adopted in 1857, during a time when women were not granted the same rights as men in the state. In the decision concluding abortion is not a fundamental right under the state constitution, Christiansen wrote “the majority perpetuates the gendered hierarchies of old when women were second-class citizens.”

Mansfield: Rule ‘gives no weight to a woman’s autonomy over her body’

Justice Edward Mansfield also wrote a dissenting opinion, reflecting on his dissent in 2018 to a ruling on the state’s 72-hour abortion waiting period that found abortion was protected by the state constitution and subject regulations to “strict scrutiny” review.

In that decision, Mansfield wrote that both sides are seeking to address important issues – “a woman’s autonomy over her body” as well as preserving “human life.”

Advertisement

“I remain of that view,” Mansfield wrote in the dissent published Friday. “But the court around me has shifted. So, instead of a constitutional rule that gives no weight to the State’s interest in human life, we now have in Iowa a constitutional rule that gives no weight to a woman’s autonomy over her body.”

He wrote that the “rational basis” test is not an appropriate measure for determining the constitutionality of abortion laws.

“I believe that subjecting a near-total ban on abortion to a rational basis test — the same test we apply to traffic cameras, and a more forgiving test than the one we apply to a law not allowing county auditors to correct defective absentee ballot applications — disserves the people of Iowa and their constitution,” Mansfield wrote.

Potential effects beyond abortion

State regulations on abortion following the 2022 Dobbs decision have caused challenges for people seeking to access other reproductive health care, like in vitro fertilization (IVF), in some states. The Alabama Supreme Court’s February ruling that found frozen embryos outside the womb are “children” caused multiple providers to cease IVF services until the governor signed a law providing certain protections to clinics and manufacturers of products used in IVF treatments.

The Alabama decision cited a 2018 state constitutional amendment stating “it is the public policy of this state to recognize and support the sanctity of unborn life and the rights of unborn children, including the right to life.” Reproductive health care advocates rallied against states enacting so-called “unborn personhood” language, often supported by anti-abortion proponents, in the wake of the decision because of concerns over the language’s impact on IVF access.

Advertisement

In March, Iowa House lawmakers passed a bill to raise penalties for the nonconsensual ending of a pregnancy that would have changed the language on these crimes from referring to the termination of a “human pregnancy” to the “death of an unborn person.” The legislation was tabled by Senate Republicans over concerns about the bill’s “unintended consequences” related to IVF access, Sen. Brad Zaun, R-Urbandale told reporters.

Reynolds said in a Friday statement that as the six week abortion law takes effect, she and GOP leaders will “continue to develop policies that encourage strong families, which includes promoting adoption and protecting in vitro fertilization (IVF).”

“As the heartbeat bill finally becomes law, we are deeply committed to supporting women in planning for motherhood, and promoting fatherhood and its importance in parenting,” Reynolds said in a statement Friday. “… Families are the cornerstone of society, and it’s what will keep the foundation of our state and country strong for generations to come.”

Access to abortion medication has also been questioned following the 2022 Dobbs ruling. However, the U.S. Supreme Court ruled earlier in June that mifepristone, a pharmaceutical that can be used to terminate pregnancies, can remain available under the U.S. Food and Drug Administration’s prescribing guidelines.

This article first appeared in the Iowa Capital Dispatch, a sister site of the Nebraska Examiner in the States Newsroom network.

Advertisement



Source link

Iowa

Iowa State basketball lands Northern Iowa transfer Leon Bond III

Published

on

Iowa State basketball lands Northern Iowa transfer Leon Bond III


play

The name’s Bond — Leon Bond III — and he’s Iowa State men’s basketball’s first transfer portal commit of the 2026 cycle.

Bond was one of several reported to be visiting Ames this weekend, and he announced his commitment on Friday, April 10. He will have one year of eligibility remaining.

Advertisement

Bond, a 6-foot-5, 200-pound guard from Wauwatosa, Wisconsin, spent the last two seasons at Northern Iowa, after originally starting his collegiate career at Virginia.

Bond is coming off of a career-best year with the Panthers. He averaged 11.9 points, 4.7 rebounds and 1.5 assists, while shooting 47.3% overall, 36.2% from 3-point range and 75% from the free-throw line. He earned All-Defensive Team honors in the Missouri Valley Conference and was one of the key players in helping Northern Iowa win the conference tournament and make its first NCAA Tournament appearance in a decade.

Across his two seasons in Cedar Falls with the Panthers, he appeared in 59 games with 57 starts and averaged 11 points and 4.6 rebounds per game. Before that, he played one season for former coach Tony Bennett at Virginia in 2023-24, where he played 24 games off the bench, averaging 4.1 points over 12.3 minutes per game.

Offensively, he’s a solid athlete capable of getting to the basket and making plays above the rim, while showing an improved perimeter jumper that he’s worked on over the years. Defensively, he provides versatility and an ability to guard multiple positions. His length, athleticism and motor bode well for him as he transitions into Iowa State’s system.

Advertisement

As the first transfer commit for Iowa State, Bond is helping replenish the Cyclones’ roster after the graduations of Tamin Lipsey, Joshua Jefferson, Nate Heise, Dominick Nelson and Eric Mulder.

They also saw Mason Williams and Cade Kelderman enter the portal since it first opened on April 7. College basketball players will have until April 21 to decide if they are staying with their current schools or entering the transfer portal.

Eugene Rapay covers Iowa State athletics for the Des Moines Register. Contact Eugene at erapay@gannett.com. Follow him on Twitter at @erapay5.





Source link

Advertisement
Continue Reading

Iowa

Iowa wrestling taps Jacob Warner as new assistant coach

Published

on

Iowa wrestling taps Jacob Warner as new assistant coach


play

Iowa wrestling will bring in a familiar face to fill out its coaching staff, tapping five-time NCAA All-American Jacob Warner to join as an assistant coach.

Advertisement

The Hawkeye wrestling program announced the decision on April 10. He replaces Bobby Telford, who took a position outside of wrestling after the 2025-26 season ended.

With Warner’s hire, all four official coaching positions at Iowa are held by former Hawkeye wrestlers — head coach Tom Brands, associate head coach Terry Brands, assistant coach Ryan Morningstar and Warner. (Telford also wrestled for the Hawkeyes.)

While Warner does not have official coaching experience, being in the Hawkeye Wrestling Club allowed him to help sharpen athletes still competing in the college ranks. Warner has been credited by several wrestlers in the program for helping their development, none bigger than national champion Stephen Buchanan.

“Jacob knows what it takes to compete at the highest level, both on and off the mat,” Tom Brands said in a release. “He represents everything Iowa wrestling stands for. His toughness, discipline and relentless work ethic will be a tremendous asset to our staff and our student-athletes.”

Advertisement

As a wrestler, Warner had a career record of 97-28 in a Hawkeye singlet. He took seventh at the NCAA Championships in 2019 as a redshirt freshman, earned All-American honors for the canceled 2020 NCAA Championships, then was fourth in 2021, an NCAA runner-up in 2022 and finished his career in fifth place in 2023. Warner also has experience on the major World stages. He won a bronze medal at the 2016 Cadet World Championships and was on the 2018 Junior World team for the United States.

The Hawkeyes have a pivotal 2026-27 season ahead, following a fourth-place finish at the NCAA Championships and a regular season to forget. Time will tell whether Warner’s official addition to the staff can help spark better results as the Hawkeyes look to return to their championship ways.

“Our fans, I see them on the street, I see them here, I see them there, I say, ‘We got to do better for you,’” Tom Brands said after the NCAA Championships. “We know that.”

Eli McKown covers high school sports and wrestling for the Des Moines Register. Contact him at Emckown@gannett.com. Follow him on Twitter at @EMcKown23.

Advertisement





Source link

Continue Reading

Iowa

Iowa State women’s basketball team adds transfer guard from Kent State

Published

on

Iowa State women’s basketball team adds transfer guard from Kent State


Iowa State women’s basketball team adds transfer guard from Kent State

Advertisement

ROUND PICK. WE’LL BE PULLING FOR HIM. THE DRAFT STARTS THURSDAY, APRIL 23RD. CYCLE IN. WOMEN LOST NEARLY THEIR ENTIRE ROSTER THURSDAY. THEY GOT ONE BACK. MAYA BABBITT IS COMING OVER FROM KENT STATE. SHE LED THAT TEAM AT 16 POINTS PE

Advertisement

Iowa State women’s basketball team adds transfer guard from Kent State

Updated: 10:40 PM CDT Apr 9, 2026

Editorial Standards

Advertisement

Iowa State got a strong start on its 2026 transfer class Thursday.Kent State guard Mya Babbitt announced her commitment to Iowa State.Babbitt, a 5’8″ guard from Papillion, Nebraska, has been a two-year starter for the Golden Flashes and earned second-team All-MAC honors in 2025-26 after averaging 16.1 points and 4.0 rebounds per game. She also set the Kent State record for 3-pointers in a season as a sophomore, making 83 3-pointers at a 41.5% clip.Babbitt is the first incoming transfer to announce her commitment to Iowa State this offseason. She will have one year of eligibility remaining.The Cyclones are tasked with replacing nearly the entire roster from 2025-26 after nine players entered the transfer portal.Senior-to-be Arianna Jackson has announced her return, as has reserve guard Freya Jensen. Iowa State also brings in highly touted recruit Macy Comito. Comito led Carlisle High School to its first state title this winter.» Subscribe to KCCI’s YouTube page» Download the free KCCI app to get updates on the go: Apple | Google Play

Iowa State got a strong start on its 2026 transfer class Thursday.

Advertisement

Kent State guard Mya Babbitt announced her commitment to Iowa State.

Babbitt, a 5’8″ guard from Papillion, Nebraska, has been a two-year starter for the Golden Flashes and earned second-team All-MAC honors in 2025-26 after averaging 16.1 points and 4.0 rebounds per game. She also set the Kent State record for 3-pointers in a season as a sophomore, making 83 3-pointers at a 41.5% clip.

This content is imported from Twitter.
You may be able to find the same content in another format, or you may be able to find more information, at their web site.

Advertisement

Babbitt is the first incoming transfer to announce her commitment to Iowa State this offseason. She will have one year of eligibility remaining.

The Cyclones are tasked with replacing nearly the entire roster from 2025-26 after nine players entered the transfer portal.

Senior-to-be Arianna Jackson has announced her return, as has reserve guard Freya Jensen. Iowa State also brings in highly touted recruit Macy Comito. Comito led Carlisle High School to its first state title this winter.

» Subscribe to KCCI’s YouTube page

» Download the free KCCI app to get updates on the go: Apple | Google Play

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

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

Advertisement

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

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

Advertisement

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

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

Advertisement

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

var feelsEl = container.querySelector(‘.weather-grid–feels’);
if (feelsEl) {
feelsEl.textContent = feelsLikeValue + ‘°F’;
feelsEl.setAttribute(‘aria-label’, feelsLikeValue + ‘ degrees Fahrenheit’);
}

Advertisement

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

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

Advertisement

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

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

Advertisement

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

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

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

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

Loading more articles…



Source link

Advertisement
Continue Reading

Trending