';
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);
}
});
});
Thank goodness for non-profit journalism again. On the web page of The Tyee is an opinion piece by a Canadian environmentalist with some astounding news about how Canada severely undercounts its contribution to global warming.
The column by Sierra Club campaigner Jens Wieting finds that a huge chunk of the Great White North's greenhouse gas production is not counted and is acknowledged in what amounts to a footnote: the carbon dioxide coming out of Canadian forests because of logging and slash burning.
Wieting closely examines a report catalouging British Columbia's greenhouse gas emissions, although he says the same approach is used at the national level:
emissions from forest land remaining forest land
Normally forests are carbon sinks, places that suck up carbon dioxide. It turns out that emissions from forests are outpacing the uptake because the pine beetle infestation left the forests in such tatters.
Tyee, btw, is a localism for the king salmon. The newsite's motto: "A Feisty One!" And so it is.
-- Robert McClure