';
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);
}
});
});
What’s being billed as one of the world’s largest solar-power plants is to take shape on the east slope of the Cascades near Cle Elum, WA, privately held Teanaway Solar Reserve announced. The firm is headed by Howard Trott, who once managed investments for Seattle telecommunications tycoon Craig McCaw. McCaw is not involved in the project, Trott told Seattle Times reporter Sandi Doughton. The firm also is angling to attract a solar-panel manufacturer to the area to supply its needs.
Meanwhile, in Eugene, OR, Chinese immigrant Ocean Yuan is moving at light speed to sell solar panels made inexpensively in China directly to the public at retail. The horizontally integrated startup just leased a 25,000-square-foot warehouse and took delivery of $1 million worth of solar panels, according to Amy Hsuan of The Oregonian.