';
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);
}
});
});
Thank you to the Knight Digital Media Center for accepting me as a fellow for their June 2010 "Multimedia Reporting & Convergence Workshop" at UC Berkeley. I'll be honing my video editing and web design skills with Paul Grabowicz, Samantha Grant, Marilyn Pittman, Jeremy Rue, Jerry Monti and Scot Hacker from June 13 - 18.
I am going to hang around the Bay Area to do some reporting for upcoming stories. InvestigateWest members, followers: if you want to meet up or trade tips, email me at kyoung@invw.org.
Also, a shout-out to the Reynolds Center for hosting a free workshop in Portland on Friday, May 7th: “Investigative Business Journalism on a Beat,” taught by Pulitzer winner (and adjunct professor at the University of Southern California’s Annenberg School of Journalism) Gary Cohn and Northwestern University’s Medill School of Journalism Professor and former Washington Post investigative reporter Alec Klein.