From 0273884be04f5b352d17053c96c631044b5d3570 Mon Sep 17 00:00:00 2001 From: Dekkia Date: Mon, 15 Apr 2024 19:32:11 +0200 Subject: [PATCH] media files now also open in a new tab when clicked (#2) --- thread/js/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/thread/js/main.js b/thread/js/main.js index 9a01c55..dc453d2 100644 --- a/thread/js/main.js +++ b/thread/js/main.js @@ -112,7 +112,12 @@ const threadUnroll = { if (status.media_attachments) { status.media_attachments.forEach(media => { - var mediaBox = document.createElement("figure"); + var mediaBox = document.createElement("a"); + mediaBox.className = "statusBoxWrapper"; + mediaBox.href = media.url; + mediaBox.target = "_blank"; + mediaBox.rel = "noopener noreferrer"; + var mediaContent = undefined; if (media.type == "image") { mediaContent = document.createElement("img");