';
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);
}
});
});
Those Aspen bears mean business. They aren't just toying with author Susan Orleans' Aspen retreat as we wrote about recently. Wildlife officials in the Colorado resort town euthanized another bear in Aspen last weekend, and another in nearby Glenwood Springs, in a season that could be among the most deadly for bears "lured by human food and irresponsibility," writes Janet Urquhart in The Aspen Times. To date this season, two bears have been euthanized in Aspen and two have been relocated. Wildlife officials have killed three bears in Glenwood Springs and relocated one, and two bears have been killed in the Vail area. The bear that was killed Sunday had been breaking into homes with her three cubs, teaching them the tricks of the trade. (The cubs were given a reprieve.)
"I heard she was totally not afraid of people," said Colorado Division of Wildlife spokesman Randy Hampton. "People had habituated her with their trash and birdfeeders and all that stuff."