|
|
@ -51,11 +51,11 @@ 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) => {
|
|
|
|
return element.button({
|
|
|
|
return element.button({
|
|
|
|
textContent: "Copy",
|
|
|
|
textContent: "Copy",
|
|
|
|
className: "copy_button",
|
|
|
|
className: "copy_button",
|
|
|
|
onclick: () => copyToClipboard(join_link)
|
|
|
|
onclick: () => copyToClipboard(join_link)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onLoad(timestamp) {
|
|
|
|
function onLoad(timestamp) {
|
|
|
@ -77,8 +77,8 @@ function hideQRModal(communityID) {
|
|
|
|
function createJoinLinkButtons() {
|
|
|
|
function createJoinLinkButtons() {
|
|
|
|
const join_URLs = dom.join_urls();
|
|
|
|
const join_URLs = dom.join_urls();
|
|
|
|
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
|
|
|
|
// Data attributes are more idiomatic and harder to change by accident in the DOM.
|
|
|
|
const join_link = a_href.getAttribute("href"); // get link
|
|
|
|
const join_link = td_url.getAttribute('data-url');
|
|
|
|
td_url.append(transformJoinURL(join_link)); // add interactive content
|
|
|
|
td_url.append(transformJoinURL(join_link)); // add interactive content
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -101,7 +101,7 @@ function hideBadCommunities() {
|
|
|
|
* Removes an element by its ID and returns the number of elements removed.
|
|
|
|
* Removes an element by its ID and returns the number of elements removed.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function hideElementByID(id) {
|
|
|
|
function hideElementByID(id) {
|
|
|
|
const element = document.getElementById(id);
|
|
|
|
const element = document.getElementById(id);
|
|
|
|
element?.remove();
|
|
|
|
element?.remove();
|
|
|
|
return element ? 1 : 0;
|
|
|
|
return element ? 1 : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -289,3 +289,4 @@ Object.assign(window, {
|
|
|
|
onLoad, sortTable, displayQRModal,
|
|
|
|
onLoad, sortTable, displayQRModal,
|
|
|
|
hideQRModal, copyToClipboard
|
|
|
|
hideQRModal, copyToClipboard
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|