';
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);
}
});
});
Funding for special housing for homeless people in Alaska is available again after being deleted in a budget forwarded to Gov. Sarah Palin's office earlier this year, reports Rena Delbridge of the Daily News-Miner. The $650,000 set aside for homeless housing was compressed into a smaller amount when it passed the governor's desk, and the mistake was overlooked by the legislature until after its session ended in April.
The money provides a resource for local agencies to fund grants for construction and support services. It's for so-called "supportive" housing that help homeless people learn how to cope with everyday tasks. As the money helps homeless people get off the street, public expenses should also go down, since fewer people on the street likely means lower costs for law enforcement and emergency medical services.
It's interesting the money showed up after another body of a homeless person was found this weekend in Anchorage, the twelfth homeless death in the region since May of this year.
– Emily Linroth