diff --git a/src/HTTP/JS/expanded.js b/src/HTTP/JS/expanded.js
index b363232..69a98fc 100644
--- a/src/HTTP/JS/expanded.js
+++ b/src/HTTP/JS/expanded.js
@@ -19,6 +19,14 @@ let post = JSON.parse(localStorage.getItem("post"));
let ThreadedPost = [];
document.getElementsByClassName("Origin")[0].innerHTML = website;
+
+// Other post stuff.
+for (let i of document.getElementsByClassName("Handle")) {
+ i.onclick = (event) => {
+ window.location.href = "/account?website=" + website;
+ }
+}
+
GetPost();
// Fixes a bug where the interpreter sucks ass.
@@ -63,15 +71,6 @@ Reply.onclick = (event) => {
window.location.href = "/post?website=" + website;
}
-// Other post stuff.
-for (let i of document.getElementsByClassName("Regular")) {
- i.onclick = (event) => {
- if (i.classList.contains("Handle")) {
- window.location.href = "/account?website=" + website;
- }
- }
-}
-
// Threads are the thing above the post you clicked.
async function SetThreadPost(element, i) {
if (website == "Mastodon") {
@@ -114,7 +113,7 @@ async function GetPost() {
let NumberOfThreads = 0;
let TemporaryPost = post;
while (TemporaryPost.in_reply_to_id != null) {
- TemporaryPost = await MastodonThreadFunction(NumberOfThreads, TemporaryPost.in_reply_to_id);
+ TemporaryPost = await MastodonOtherFunction(NumberOfThreads, TemporaryPost.in_reply_to_id, true);
ThreadedPost.push(TemporaryPost);
// Any posts? Give them the thing :3
for (let i of document.getElementsByClassName(NumberOfThreads)) {
@@ -128,7 +127,7 @@ async function GetPost() {
// Replies, anyone?
let Context = await MastodonAPI.GetContexts(post.id);
for (let i of Context.descendants) {
- TemporaryPost = await MastodonReplyFunction(NumberOfThreads, i);
+ TemporaryPost = await MastodonOtherFunction(NumberOfThreads, i, false);
ThreadedPost.push(TemporaryPost);
// Any posts? Give them the thing :3
for (let j of document.getElementsByClassName(NumberOfThreads)) {
@@ -171,7 +170,7 @@ async function GetPost() {
let NumberOfThreads = 0;
let TemporaryPost = post;
while (TemporaryPost.hasOwnProperty("reply")) {
- TemporaryPost = await BlueskyThreadFunction(NumberOfThreads, TemporaryPost.reply.parent);
+ TemporaryPost = await BlueskyOtherFunction(NumberOfThreads, TemporaryPost.reply.parent, true);
ThreadedPost.push(TemporaryPost);
// Any posts? Give them the thing :3
for (let i of document.getElementsByClassName(NumberOfThreads)) {
@@ -185,7 +184,7 @@ async function GetPost() {
// Replies, anyone?
let Context = await BlueskyAPI.GetPostThread(post.post.uri);
for (let i of Context.thread.replies) {
- TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, i.post);
+ TemporaryPost = await BlueskyOtherFunction(NumberOfThreads, i.post, false);
ThreadedPost.push(TemporaryPost);
// Any posts? Give them the thing :3
for (let j of document.getElementsByClassName(NumberOfThreads)) {
@@ -202,8 +201,13 @@ async function GetPost() {
}
// Because of repeat code, we can put it into it's own function. It grabs posts "above" it.
-async function MastodonThreadFunction(Id, post) {
- let OtherPost = await MastodonAPI.GetStatus(post);
+async function MastodonOtherFunction(Id, post, IsThread) {
+ let OtherPost;
+ if (IsThread == true) {
+ OtherPost = await MastodonAPI.GetStatus(post);
+ } else {
+ OtherPost = post;
+ }
let ShitHTML = " " + OtherPost.account.acct + "
" + website + "