';
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);
}
});
});
Police report “tremendous growth” in gangs in Anchorage, although they admit at least part of the upsurge may be the result of better police work to identify gangs and gang members. Gang activity seems to be increasing as people from the Lower 48, facing hard economic times, move to Alaska’s largest city so they can get their annual dole from the Alaska Permanent Fund, says the story by James Halpin. However, check out these numbers: Police say they recently counted more than 125 gangs, 55 of which met the definition of a gang under Alaska law. (That’s an increase from a total of 112 suspected gangs counted as of last December.) This same count identified 354 verified gang members. Hmm, that’s only about three to six members per gang. Police say they suspect these 354 verified gang members have some 2,400 associates, up from a total of 1,000 verified gang members and associates as of December.