';
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);
}
});
});
Sometimes it takes a drastic situation to produce a solution. That's the case for Anchorage, where legislators are scrambling to make Seward Highway safer to drive after a string of accidents this summer, reports Sean Cockerham of the Anchorage Daily News. Although the number of fatal crashes statewide is down – 38 this year, compared to 56 in 2008 – eight people have died on Seward Highway since May.
Four major roadways in southcentral Alaska have been dubbed Traffic Safety Corridors, requiring extra attention, reports Jeff Richardson in the Fairbanks Daily News-Miner. Offenses in safety corridors lead to double fines. One problem with these roads could be that they haven't grown along with the rest of the state, and need upgrades.
Officials are looking for affordable solutions. The number of state trooper cars patrolling the areas is up. The Department of Transportation plans to install rumble strips dividing lanes and new reflective markers on corners. The state also could change speed limits, put in concrete barriers, or add more turnout areas for slow cars to pull off. Adding double-yellow lines to make the areas no-passing zones might frustrate drivers who get stuck behind a slow vehicle, causing them to make risky decisions, the state says. The most expensive option would be to widen stretches of highways from two to four lanes, but with budget tightening, this isn't likely to happen, officials say.
The most common cause of accidents on Seward Highway is by head-on collisions, reports James Halpin of the Anchorage Daily News. Officials worry simply designating areas as safety corridors isn't enough, and they may have to try some new tactics to get drivers' attention.
– Emily Linroth