';
document.querySelector('#copytext').value = textContent;
modal.showModal();
});
// Modal close functionality
const modal = document.querySelector('.republish-modal');
const closeBtn = document.querySelector('.republish-modal-close');
// Close button click
closeBtn.addEventListener('click', function() {
modal.close();
});
// Close on backdrop click
modal.addEventListener('click', function(e) {
if (e.target === modal) {
modal.close();
}
});
// Close on ESC key (this is usually built-in, but adding for safety)
modal.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
modal.close();
}
});
// Copy text button functionality
document.querySelector('.copy-text-button').addEventListener('click', async function() {
const textarea = document.querySelector('#copytext');
const text = textarea.value;
try {
// Try modern Clipboard API first
if (navigator.clipboard && window.isSecureContext) {
await navigator.clipboard.writeText(text);
this.textContent = 'Copied!';
} else {
// Fallback for older browsers
textarea.select();
document.execCommand('copy');
this.textContent = 'Copied!';
}
// Reset button text after 2 seconds
setTimeout(() => {
this.textContent = 'Copy text';
}, 2000);
} catch (err) {
console.error('Failed to copy text: ', err);
// Fallback to selection if copying fails
textarea.select();
this.textContent = 'Text selected';
setTimeout(() => {
this.textContent = 'Copy text';
}, 2000);
}
});
});
More than a dozen conservation groups filed suit against the federal government this week charging Interior Secretary Ken Salazar, Energy Secretary Steven Chu and the heads of other federal land management agencies with ignoring federal laws when they designated 6,000 miles of energy corridors in New Mexico and other Western states.
The suit, filed in U.S. District Court in San Francisco Tuesday, claims the government didn't take into account the effect of the corridors on wildlife and scenic lands, including its impact on New Mexico's Sevilleta National Wildlife Refuge and Utah's Arches National Park and Grand Staircase-Escalante National Monument.
The corridors will be used by power plants fueled by coal and other fossil fuels, but the lawsuit alleges the swaths of land for the corridors were chosen without consideration for future generating stations that could use renewable energy sources. The AP's Susan Montoya Bryan explains here.