InvestigateWest (investigatewest.org) is an independent news nonprofit dedicated to investigative journalism in the Pacific Northwest. Visit investigatewest.org/newsletters to sign up for weekly updates.
';
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);
}
});
});
Climate change and clean water. The future of energy in Washington state. Oil spills. Wildfire. There are fewer reporters than ever in Olympia to report what lawmakers are doing on key environmental issues.
We can fix that. But we need your help.
The Statehouse News Project is a crowdfunded way to connect citizens with elected officials in Olympia with unbiased journalism. We'll deliver in-depth reports right to your inbox, and to the front page of newspapers across the state, that help to make a stronger democracy in Washington state.
Jason was InvestigateWest's associate director. A veteran of technology projects and online strategy for the nonprofit sector, he is a graduate of Columbia University's School of International and Public Affairs and Graduate School of Journalism.
The story you just read is only possible because readers like you support our mission to uncover truths that matter. If you value this reporting, help us continue producing high-impact investigations that drive real-world change. Your donation today ensures we can keep asking tough questions and bringing critical issues to light. Join us — because fearless, independent journalism depends on you!