';
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);
}
});
});
Dear InvestigateWest Reader,
In our newsroom, we measure success by one yardstick: Did our reporting make a meaningful difference in the lives of the people who live here in the Pacific Northwest? By that metric, our small but mighty crew has caused sweeping legal reform, systemic change and people in power to step down. As a 100% donor-funded newsroom, it's our readers who make this work possible. And today we have an opportunity for you to triple that impact.
Consider for a moment a society where journalists are not there to hold the powerful to account. Here's a snapshot:
What happens when children in foster care turn 18? Due to a crisis within Washington’s child-welfare system, many end up homeless, incarcerated or in hospital emergency rooms.
After InvestigateWest’s reporting on these critical issues, the Washington Legislature passed six laws to help foster kids and foster parents and rolled out $48 million in new funding.
When you donate, you become part of a community that believes investigative journalism is an essential part of a healthy democracy. Starting now through December 31, donations to InvestigateWest will be TRIPLED thanks to NewsMatch and a generous local donor both matching any gift you make up to $1,000.
Your support will help us meet our goals of expanding and diversifying our staff in 2024 so we can take on even more investigations like these. If you believe in the work we’re doing, will you give today?