diff options
author | r <r@freesoftwareextremist.com> | 2020-06-21 16:48:33 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2020-06-21 17:14:05 +0000 |
commit | 1936044137c244b24d9a28853355fdf4d8685951 (patch) | |
tree | b32928dba3525031a2c5f5b4948597b7d6a10e86 | |
parent | 626369c317f8fcda6491af90ac27bb68129459bb (diff) | |
download | bloat-1936044137c244b24d9a28853355fdf4d8685951.tar.gz bloat-1936044137c244b24d9a28853355fdf4d8685951.zip |
fluoride: Use target=_blank for status links
-rw-r--r-- | static/fluoride.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/static/fluoride.js b/static/fluoride.js index 700d980..a150b2b 100644 --- a/static/fluoride.js +++ b/static/fluoride.js @@ -186,6 +186,12 @@ function handleReplyLink(div) { } } +function handleStatusLink(a) { + if (a.classList.contains("mention")) + return; + a.target = "_blank"; +} + document.addEventListener("DOMContentLoaded", function() { var statuses = document.querySelectorAll(".status-container"); for (var i = 0; i < statuses.length; i++) { @@ -205,6 +211,11 @@ document.addEventListener("DOMContentLoaded", function() { for (var j = 0; j < replyLinks.length; j++) { handleReplyLink(replyLinks[j]); } + + var links = s.querySelectorAll(".status-content a"); + for (var j = 0; j < links.length; j++) { + handleStatusLink(links[j]); + } } }); |