';
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);
}
});
});
Western states are preparing to face a looming and expensive battle over a tiny creature with devastating potential, writes Les Blumenthal of McClatchy Newspapers.
Zebra mussels and quagga mussels, which began infiltrating Midwest waters in the 1980s, are predicted to arrive in the Northwest within five years. They have already been found in California, Nevada and Utah. Among the most fast-spreading invasive species, the mussels can produce up to one million eggs a year, with young larvae hitching rides on passing watercraft. While they threaten the region's sensitive aquatic ecosystems, particularly endangered salmon, many are concerned that the mussels' biggest threat is their knack for clogging dams and irrigation systems.
The mussels could jeopardize the region's position as a leader in hydroelectric power, and in particular the Grand Coulee Dam, which not only produces copious amounts of electricity, but also irrigates vast stretches of agricultural land.
These little buggers are costly too -- with mitigation efforts in already invaded states running nearly $5 billion a year, according to the Coast Guard.
Idaho has enacted one of the most thorough prevention campaigns, forcing every boat that enters the state to be washed before settling in state waters. The cost of each boat-washing station is estimated at $150,000, which some believe pales in comparison to the costs of controlling them once they've arrived. Oregon has begun preparations too, with the Legislature currently toiling over bills that would provide emergency invasive species response funds, as well as boat-checking stations.
Let's hope prevention efforts are fruitful, since the techniques most used elsewhere to kill the mussels post-invasion (such as antifouling paint) often have a list of detrimental affects themselves.
For a U.S. Geological Survey map of current sightings, click here.