';
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);
}
});
});
Farmers, urbanites and environmentalists were behind the California Legislature's proposed sweeping water reforms, but lawmakers balked at the $12 billion price tag and deferred the vote until the next session.
The bond would have paid for new water infrastructure, ecosystem restoration and supply projects such as water recycling and desalination, according to Bettina Boxall's article in the Los Angeles Times.
Still, there may be some hope for healing the convergence of two rivers in the Sacramento-San Joaquin Delta east of San Francisco. As the West Coast's largest estuary, the rivers are home to delta smelt and provide a route both for salmon and for water shipped to Central Valley farms and Southern California cities.
Democrats said they would ask California Gov. Arnold Schwarzenegger to hold a special session on water this fall.
The delta is crumpling due to past excessive pumping of water to fill federal and state aqueducts, which has been temporarily curtailed to protect the smelt. That, in turn, has amplifying the drought's effect on farmers and cities.