';
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);
}
});
});
Utah is contemplating restoring one of its great, but polluted, urban rivers - if it can find the money and leadership to do it. The Jordan River flows from Utah Lake to the Great Salt Lake, through 15 cities in three counties, writes Jeremiah Stettler of the Salt Lake Tribune. Along the way, it's been used as a dumping ground for everything from city sewers to slaughterhouses.
Now river advocates want to find a way to turn it back into a recreational and wildlife haven with bike paths, open space and clean water.
Urban restorations are notoriously difficult and complex. Look no further than Seattle's own Duwamish waterway, one of the country's largest Superfund sites, and the focus of much debate and effort over how to reclaim that historic river.
Other cities, including Los Angeles, Portland, Chicago, and San Jose have struggled with their own urban river politics.
These rivers, and there are many more like them, are important symbols. What happens to a river when it runs through a community speaks loudly about who lives there -both then, and now.