';
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);
}
});
});
Is nuclear power the answer to global warming? Sen. Mark Udall, a Colorado Democrat, seemed to be a reluctant convert to that notion as he accompanied Sen. John McCain on a somber tour of a pine beetle-infested forest in Rocky Mountain National Park in Colorado.
After the tour, Udall and McCain, an Arizona Republican and 2008 Republican presidential candidate who has long supported nuclear power, held a Senate hearing taking testimony detailing the changes scientists are seeing in the park and in other national parks because of global warming and pine beetle infestation, the Denver Post reported.
"I agree with Sen. McCain that nuclear power has to be part of the mix," Udall, chairman of the Energy and Natural Resources Committee's subcommittee on National Parks, said Monday in the meadow. "It is clear that if we want to respond to climate change, nuclear power has to be part of the solution."