';
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);
}
});
});
California Democrats and environmentalists didn't like the executive order signed by Gov. Arnold Schwarzenegger on Tuesday, but all the other Western states might.
Surrounded by smiling energy company executives, Schwarzenegger's decree will require California's electric utilities to draw at least a third of their power from wind, solar and other renewable resources by 2020, according to the LATimes' Marc Lifsher.
Sounds good, right?
But California Democrats and environmentalists had been slogging through crafting their own bills to that effect for nine months, and they had support from some utilities as well as labor unions.
Schwarzenegger said he slapped those bills down because they would favor alternative power produced in California at the expense of other Western states, increase the cost to consumers and compromise electric utilities' easy access to renewable power.
As of July 2009, California's unemployment rate was pressing 12 percent, but hey, we're all suffering. Send the jobs up the coast!
- K. Young