';
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);
}
});
});
Are geothermal energy projects a boon for Western states or the beginnings of environmental disaster?
President Obama has heralded geothermal energy's role in the U.S. “clean energy transformation” -- funded by millions of dollars from the Department of Energy. But a series of earthquakes set off by small geothermal projects in Northern California's Lake and Sonoma Counties has residents worried that those seeking energy in the earth's depths will hit a major fault line.
Now, The New York Times reports that two federal agencies are halting a California project to break up bedrock deep in the earth to extract its geothermal energy until they review whether the project by AltaRock Energy could spawn earthquakes.
AltaRock Energy downplayed the dangers of its California deep-drilling project to tap geothermal energy by breaking up hard rock two miles deep to extract its heat. Seismologists agree that human activity can trigger quakes, which residents of Switzerland remember well.
AltaRock Energy is a renewable energy development company with headquarters in Sausalito, CA, and a technology development office in Seattle, WA.