';
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);
}
});
});
In the wake of two recent inmate escapes, Washington State has called for a full-scale review of security measures for the handling of mentally unstable criminals, reports Christine Clarridge of the Seattle Times.
Two state hospitals have faced intense scrutiny in the last week over the escape of two patients, though both were taken back into custody. Phillip A. Paul, who was convicted of killing a woman 22 years ago and had escaped from state custody once before, fled from Eastern State Hospital staff at the Spokane County International Fair last Thursday. Just the day before, a patient being held in a high-security criminal forensics facility at Western State Hospital escaped for two hours.
Those who oversee the state's three mental institutions -- Washington's Department of Corrections and Department of Social and Health Services -- have called the breaches inexcusable. Some question whether mentally ill criminals should be allowed out of hospitals in the first place. Susan Dreyfus, head of the social-services department, has indefinitely suspended all outings for patients committed as a result of criminal offenses. The security review is expected to be completed within 15 days.
-- Natasha Walker