';
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);
}
});
});
Wildlife researchers with the U.S. Geological Survey found almost 200 dead walruses on the northwest coast of Alaska yesterday, reports Dan Joling of the Associated Press. Most of the walruses appear to be young, but age and cause of death won't be known until researchers can get on the ground to investigate.
The researchers were on their way to begin a tagging project to determine walruses foraging habits while on shore. Walruses can only swim so far, and in the past used sea ice as a diving platform, getting most of their food off the ocean floor. The recent retreat of sea ice has forced the walruses to choose between staying on sea ice in regions too deep to dive for clams, or stick to the shore. Researchers fear staying on shore could exhaust food within the walrus' swimming range, resulting in a population crash.
The yearling and calf walruses could have been crushed by a group stampede, or be suffering from changes in the species' behavior due to climate change.
U.S. Fish and Wildlife Service veterinarians are working to reach the site to determine the cause of death, as well as check other regions along the coast where walruses congregate to see if deaths are occurring at other sites.
- Emily Linroth