';
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);
}
});
});
On a hill northeast of downtown Los Angeles, walnut groves wave atop "the Heavens", a small rise providing solace to El Sereno, a working class Latino neighborhood whose future recreation just got a boost from the Los Angeles City Council.
The boost? After a 25 year debate, the council decided to buy a contested piece of property known as Elephant Hill for $9 million from a developer who had sued to build a luxury subdivision.
The goal? "A nature preserve in a community with one of the lowest parkland-to-people ratios in the city," according to the Los Angeles Times.
The next step is figuring out how to pay for it: national, state and local parks are being shuttered to stem budget woes, and the city may go into short term debt to pay for the property.
The city may also seek state funding to pay for trails, signs, picnic areas and restoring habitat -- despite California's recent spate of shutting down 278 parks during weekdays and the off-season and padlocking the bathrooms and trails.