Skip to content

Commit

Permalink
made single posts clickable (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
RealDekkia committed Apr 15, 2024
1 parent 9fb0ad1 commit 567edea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions thread/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ section:hover {
text-wrap: balance;
}

.statusBoxWrapper,
.statusBoxWrapper:visited {
display: contents;
color: inherit;
}

#pageFooter {
grid-row: 3;
}
11 changes: 10 additions & 1 deletion thread/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,16 @@ const threadUnroll = {
statusArr.forEach(status => {
//Only list posts from OP.
if (statusArr[0].account.url == status.account.url) {

var statusBoxWrapper = document.createElement("a");
statusBoxWrapper.className = "statusBoxWrapper";
statusBoxWrapper.href = status.url;
statusBoxWrapper.target = "_blank";
statusBoxWrapper.rel = "noopener noreferrer";

var statusBox = document.createElement("section");
statusBoxWrapper.appendChild(statusBox);

statusBox.innerHTML = status.content;

if (status.media_attachments) {
Expand Down Expand Up @@ -132,7 +141,7 @@ const threadUnroll = {
});
}

mb.appendChild(statusBox);
mb.appendChild(statusBoxWrapper);
postCnt++;
}
});
Expand Down

0 comments on commit 567edea

Please sign in to comment.