|
|
@ -17,7 +17,7 @@
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
dom, COLUMN, COLUMN_LITERAL, COMPARISON, ATTRIBUTES,
|
|
|
|
dom, COLUMN, COLUMN_LITERAL, COMPARISON, ATTRIBUTES,
|
|
|
|
columnAscendingByDefault, columnIsSortable, columnNeedsCasefold,
|
|
|
|
columnAscendingByDefault, columnIsSortable, columnNeedsCasefold,
|
|
|
|
columnIsNumeric
|
|
|
|
columnIsNumeric, element
|
|
|
|
} from './js/constants.js';
|
|
|
|
} from './js/constants.js';
|
|
|
|
|
|
|
|
|
|
|
|
// Hidden communities for transparency.
|
|
|
|
// Hidden communities for transparency.
|
|
|
@ -50,12 +50,13 @@ const filteredCommunities = {
|
|
|
|
|
|
|
|
|
|
|
|
// This can be achieved with `text-overflow: ellipsis` instead
|
|
|
|
// This can be achieved with `text-overflow: ellipsis` instead
|
|
|
|
// and generated entirely server-side.
|
|
|
|
// and generated entirely server-side.
|
|
|
|
const transformJoinURL = (join_link) =>
|
|
|
|
const transformJoinURL = (join_link) => {
|
|
|
|
`${join_link.substring(0, 31)}...
|
|
|
|
return element.button({
|
|
|
|
<button class="copy_button" onclick="copyToClipboard('${join_link}')">
|
|
|
|
textContent: "Copy",
|
|
|
|
Copy
|
|
|
|
className: "copy_button",
|
|
|
|
</button>
|
|
|
|
onclick: () => copyToClipboard(join_link)
|
|
|
|
`.trim();
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onLoad(timestamp) {
|
|
|
|
function onLoad(timestamp) {
|
|
|
|
setLastChecked(timestamp);
|
|
|
|
setLastChecked(timestamp);
|
|
|
@ -78,7 +79,7 @@ function createJoinLinkButtons() {
|
|
|
|
Array.from(join_URLs).forEach((td_url) => {
|
|
|
|
Array.from(join_URLs).forEach((td_url) => {
|
|
|
|
const a_href = td_url.querySelector('a'); // get first (only) <a> element
|
|
|
|
const a_href = td_url.querySelector('a'); // get first (only) <a> element
|
|
|
|
const join_link = a_href.getAttribute("href"); // get link
|
|
|
|
const join_link = a_href.getAttribute("href"); // get link
|
|
|
|
td_url.innerHTML = transformJoinURL(join_link); // add interactive content
|
|
|
|
td_url.append(transformJoinURL(join_link)); // add interactive content
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -131,7 +132,7 @@ function setLastChecked(last_checked) {
|
|
|
|
const time_passed_in_minutes =
|
|
|
|
const time_passed_in_minutes =
|
|
|
|
Math.floor(time_passed_in_seconds / 60); // time in minutes, rounded down
|
|
|
|
Math.floor(time_passed_in_seconds / 60); // time in minutes, rounded down
|
|
|
|
const timestamp_element = dom.last_checked();
|
|
|
|
const timestamp_element = dom.last_checked();
|
|
|
|
timestamp_element.innerText = `${time_passed_in_minutes} minutes`;
|
|
|
|
timestamp_element.innerText = `${time_passed_in_minutes} minutes ago`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -279,6 +280,9 @@ function sortTable(column) {
|
|
|
|
setSortState(table, { ascending, column });
|
|
|
|
setSortState(table, { ascending, column });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// html.js for styling purposes
|
|
|
|
|
|
|
|
window.document.documentElement.classList.add("js");
|
|
|
|
|
|
|
|
|
|
|
|
// Crude way to export from module script due to inline event handlers.
|
|
|
|
// Crude way to export from module script due to inline event handlers.
|
|
|
|
// Ideally, all handlers would be attached from JS via addEventListener.
|
|
|
|
// Ideally, all handlers would be attached from JS via addEventListener.
|
|
|
|
Object.assign(window, {
|
|
|
|
Object.assign(window, {
|
|
|
|