';
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);
}
});
});
Fires and beetle infestations are devastating northern forestsin a cycle that is both caused by and promoting climate change, reports Charles J. Hanley of the Associated Press. As the climate warms, forests in Siberia, Europe, Alaska and northern Canada will grow weaker while pests grow stronger with milder winters. These boreal forests are key in absorbing carbon dioxide, but as they succumb to warming, they would become a source of greenhouse gases as they decay and burn.
Change is already happening in western North America, where a mountain pine beetle epidemic has killed 6.5 million acres of forest from Colorado to Washington and 35 million acres in British Columbia. The spruce bark beetle has already consumed 1 million acres in the Yukon during a 15-year epidemic. Scientists say these unprecedented epidemics are signs the climate is already changing, especially in the north.
Plant life in the north is also shifting, as warmer temperatures double the amount of shrubs and grasses on tundra, according to Bob Weber of the Canadian Press. Because the shrubby vegetation is darker, it would absorb more solar energy, possibly increasing the rate of global warming even more.
– Emily Linroth