';
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);
}
});
});
It’s easy to spot homeless people on the street. It’s not so easy to spot them in schools. And yet as Jody Lawrence-Turner of the Spokesman–Review reports, there are more homeless students than ever in Eastern Washington and Idaho.
School districts there are “well on their way to surpassing the number of homeless students enrolled last year by at least 20 percent,” she writes. The trend mirrors a nationwide rise in the number of students who have had to leave homes that were foreclosed on, who are living in shelters, or who are hopping from couch to couch.
The Spokesman-Review also put together a sortable database of homeless students by school district.
Washington ranks 12th-highest in the country for number of homeless children. Lack of stability for those kids can disrupt their learning, and their future.
U.S. Sens. Patty Murray, and Al Franken have each introduced bills that would provide more funding for transportation and outreach to help homeless kids.
-- Carol Smith