diff --git a/src/HTTP/HTML/expanded.html b/src/HTTP/HTML/expanded.html index df124eb..565ef3c 100644 --- a/src/HTTP/HTML/expanded.html +++ b/src/HTTP/HTML/expanded.html @@ -12,29 +12,13 @@
- -Favorite!
diff --git a/src/HTTP/JS/expanded.js b/src/HTTP/JS/expanded.js index 117cec0..c718ea4 100644 --- a/src/HTTP/JS/expanded.js +++ b/src/HTTP/JS/expanded.js @@ -72,19 +72,7 @@ for (let i of document.getElementsByClassName("Regular")) { } } -// Selecting other posts. -for (let i of document.getElementsByClassName("Parent")) { - i.onclick = (event) => { - SetThreadPost(Parentpost, i); - } -} - -for (let i of document.getElementsByClassName("GrandParent")) { - i.onclick = (event) => { - SetThreadPost(GrandParentpost, i); - } -} - +// Threads are the thing above the post you clicked. async function SetThreadPost(element, i) { if (website == "Mastodon") { localStorage.setItem("post", JSON.stringify(element)); @@ -103,12 +91,12 @@ async function SetThreadPost(element, i) { // Functions and things. async function GetPost() { if (website == "Mastodon") { - document.getElementsByClassName("Handle Regular")[0].innerHTML = post.account.acct; + document.getElementsByClassName("Handle")[0].innerHTML = post.account.acct; // Check for a reblog. if (post.reblog != null) { - document.getElementsByClassName("Handle Regular")[0].innerHTML += " ( R: " + post.reblog + " )"; + document.getElementsByClassName("Handle")[0].innerHTML += " ( R: " + post.reblog + " )"; } - document.getElementsByClassName("PostText Regular")[0].innerHTML = post.content; + document.getElementsByClassName("PostText")[0].innerHTML = post.content; // Set the texts. It's opposite because "setting" causes it to switch. post = await MastodonAPI.GetStatus(post.id); FavoriteFlipper = !(post.favourited); @@ -118,7 +106,7 @@ async function GetPost() { // Show the image if it exists. if (post.media_attachments.length != 0) { for (let i of post.media_attachments) { - ApplyMedia(i, document.getElementsByClassName("Images Regular")[0]); + ApplyMedia(i, document.getElementsByClassName("Images")[0]); } } // Now time to see if there are any parents @@ -134,21 +122,28 @@ async function GetPost() { NumberOfThreads += 1; } } + // Any replies? Give them the thing :3 + for (let i of document.getElementsByClassName("body").hasAttribute("id")) { + let TempID = i.getAttribute("id"); + i.onclick = (event) => { + SetThreadPost(ThreadedPost[TempID], i); + } + } } else if (website == "Bluesky") { // Check for a reblog. if (post.hasOwnProperty("reason") && post.reason.$type == "app.bsky.feed.defs#reasonRepost") { - document.getElementsByClassName("Handle Regular")[0].innerHTML = post.post.author.handle + " ( R: " + post.reason.by.handle + " )"; + document.getElementsByClassName("Handle")[0].innerHTML = post.post.author.handle + " ( R: " + post.reason.by.handle + " )"; } else { - document.getElementsByClassName("Handle Regular")[0].innerHTML = post.post.author.handle; + document.getElementsByClassName("Handle")[0].innerHTML = post.post.author.handle; } // Text. This will be modified later. var Text = await BlueskyAPI.ApplyFacets(post.post.record, post.post.record.text); // Place the text. Text = Text.replace(/\r?\n|\r/g, "