aboutsummaryrefslogtreecommitdiff
path: root/src/main/assets
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-02-02 11:07:04 +0300
committerGravatar Vitaly Takmazov2020-02-02 11:07:04 +0300
commit6ff3ceb4268a9285bfc6cc987b01132bfd85de83 (patch)
tree35ef2e80585445e464c56aff99f6a8520359eb43 /src/main/assets
parent3db482e11fc3cd7b299909d847e39f7f9ed88064 (diff)
Fix embeds
Diffstat (limited to 'src/main/assets')
-rw-r--r--src/main/assets/embed.js26
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;