1
0
mirror of https://github.com/GenderDysphoria/GenderDysphoria.fyi.git synced 2025-11-25 12:32:42 +00:00

Addressing issues that came up in eslint

This commit is contained in:
Jocelyn Badgley (Twipped)
2022-06-22 15:45:08 -07:00
parent 9e4868e98f
commit e229e14dca
5 changed files with 50 additions and 60 deletions

View File

@@ -1,15 +1,15 @@
function fixTweetMentions() {
document.querySelectorAll('div.tweet-text> p').forEach((p) => {
for (const node of p.childNodes) {
if (node.nodeType == Node.ELEMENT_NODE && node.tagName == "A" && node.classList.contains("mention")) {
node.classList.add("initial-mention");
} else if (node.nodeType == Node.TEXT_NODE && node.textContent.trim() == '') {
// nothing to do
} else {
// we got to the main text of the tweet and must stop
return;
}
}
});
};
function fixTweetMentions () {
document.querySelectorAll('div.tweet-text> p').forEach((p) => {
for (const node of p.childNodes) {
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === 'A' && node.classList.contains('mention')) {
node.classList.add('initial-mention');
} else if (node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '') {
// nothing to do
} else {
// we got to the main text of the tweet and must stop
return;
}
}
});
}
document.addEventListener('DOMContentLoaded', fixTweetMentions, false);