diff options
Diffstat (limited to 'src/main/assets')
-rw-r--r-- | src/main/assets/embed.js | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/main/assets/embed.js b/src/main/assets/embed.js index 48473764..4c7828a3 100644 --- a/src/main/assets/embed.js +++ b/src/main/assets/embed.js @@ -334,31 +334,15 @@ export function embedLinksToX(x, beforeNodeSelector, allLinksSelector) { } } -function embedLinksToArticles() { - let beforeNodeSelector = 'nav.l'; - let allLinksSelector = 'p:not(.ir) a, pre a'; - Array.from(document.querySelectorAll('#content article')).forEach(article => { - embedLinksToX(article, beforeNodeSelector, allLinksSelector); - }); -} - -function embedLinksToPost() { - let beforeNodeSelector = '.msg-txt + *'; - let allLinksSelector = '.msg-txt a'; - Array.from(document.querySelectorAll('#content .msg-cont')).forEach(msg => { - embedLinksToX(msg, beforeNodeSelector, allLinksSelector); - }); -} - /** * Embed all the links in all messages/replies on the page. */ export function embedAll() { - if (document.querySelector('#content article[data-mid]')) { - embedLinksToArticles(); - } else { - embedLinksToPost(); - } + let beforeNodeSelector = '.msg-txt + *'; + let allLinksSelector = '.msg-txt a'; + Array.from(document.querySelectorAll('#content .msg-cont')).forEach(msg => { + embedLinksToX(msg, beforeNodeSelector, allLinksSelector); + }); } export const format = juickFormat; |