aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-06-21 16:48:33 +0000
committerr <r@freesoftwareextremist.com>2020-06-21 17:14:05 +0000
commit1936044137c244b24d9a28853355fdf4d8685951 (patch)
treeb32928dba3525031a2c5f5b4948597b7d6a10e86 /static
parent626369c317f8fcda6491af90ac27bb68129459bb (diff)
downloadbloat-1936044137c244b24d9a28853355fdf4d8685951.tar.gz
bloat-1936044137c244b24d9a28853355fdf4d8685951.zip
fluoride: Use target=_blank for status links
Diffstat (limited to 'static')
-rw-r--r--static/fluoride.js11
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]);
+ }
}
});