From 856fe9e8c74e7c8096f7fb04d7b0932171223752 Mon Sep 17 00:00:00 2001 From: r Date: Sun, 8 Nov 2020 13:13:05 +0000 Subject: Fix CSS issues - fix text wrapping on reply popup - fix margin for media links --- static/fluoride.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'static/fluoride.js') diff --git a/static/fluoride.js b/static/fluoride.js index e055b6d..c1eb06f 100644 --- a/static/fluoride.js +++ b/static/fluoride.js @@ -132,13 +132,13 @@ function isInView(el) { return false; } -function handleReplyToLink(div) { - if (!div) +function handleReplyToLink(a) { + if (!a) return; - var id = div.firstElementChild.getAttribute("href"); + var id = a.getAttribute("href"); if (!id || id[0] != "#") return; - div.firstElementChild.onmouseenter = function(event) { + a.onmouseenter = function(event) { var id = event.target.getAttribute("href"); var status = document.querySelector(id); if (!status) @@ -156,7 +156,7 @@ function handleReplyToLink(div) { event.target.parentElement.appendChild(copy); } } - div.firstElementChild.onmouseleave = function(event) { + a.onmouseleave = function(event) { var popup = document.getElementById("reply-to-popup"); if (popup) { event.target.parentElement.removeChild(popup); @@ -168,8 +168,8 @@ function handleReplyToLink(div) { } } -function handleReplyLink(div) { - div.firstElementChild.onmouseenter = function(event) { +function handleReplyLink(a) { + a.onmouseenter = function(event) { var id = event.target.getAttribute("href"); var status = document.querySelector(id); if (!status) @@ -187,7 +187,7 @@ function handleReplyLink(div) { event.target.parentElement.appendChild(copy); } } - div.firstElementChild.onmouseleave = function(event) { + a.onmouseleave = function(event) { var popup = document.getElementById("reply-popup"); if (popup) { event.target.parentElement.removeChild(popup); @@ -219,10 +219,10 @@ document.addEventListener("DOMContentLoaded", function() { var retweetForm = s.querySelector(".status-retweet"); handleRetweetForm(id, retweetForm); - var replyToLink = s.querySelector(".status-reply-to"); + var replyToLink = s.querySelector(".status-reply-to-link"); handleReplyToLink(replyToLink); - var replyLinks = s.querySelectorAll(".status-reply"); + var replyLinks = s.querySelectorAll(".status-reply-link"); for (var j = 0; j < replyLinks.length; j++) { handleReplyLink(replyLinks[j]); } -- cgit v1.2.3 From 37b1c750454a780ef31a26d19005e5c94a39ae9b Mon Sep 17 00:00:00 2001 From: r Date: Sat, 14 Nov 2020 17:58:34 +0000 Subject: Fix link targets --- static/fluoride.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'static/fluoride.js') diff --git a/static/fluoride.js b/static/fluoride.js index c1eb06f..36a374f 100644 --- a/static/fluoride.js +++ b/static/fluoride.js @@ -200,8 +200,9 @@ function handleReplyLink(a) { function handleStatusLink(a) { if (a.classList.contains("mention")) - return; - a.target = "_blank"; + a.removeAttribute("target"); + else + a.target = "_blank"; } document.addEventListener("DOMContentLoaded", function() { @@ -232,6 +233,11 @@ document.addEventListener("DOMContentLoaded", function() { handleStatusLink(links[j]); } } + + var links = document.querySelectorAll(".user-profile-decription a"); + for (var j = 0; j < links.length; j++) { + links[j].target = "_blank"; + } }); // @license-end -- cgit v1.2.3