This commit is contained in:
CatAClock 2025-05-24 15:55:13 -07:00
parent cff163f6d0
commit ed3519f6c4

View file

@ -55,34 +55,29 @@ for (let i of document.getElementsByClassName("Regular")) {
// Selecting other posts. // Selecting other posts.
for (let i of document.getElementsByClassName("Parent")) { for (let i of document.getElementsByClassName("Parent")) {
i.onclick = (event) => { i.onclick = (event) => {
SetThreadPost(Parentpost); SetThreadPost(Parentpost, i);
if (i.classList.contains("Handle")) {
window.location.href = "../../HTML/account.html?website=" + website;
} else {
document.location.href = "./expanded.html?website=" + website;
}
} }
} }
for (let i of document.getElementsByClassName("GrandParent")) { for (let i of document.getElementsByClassName("GrandParent")) {
i.onclick = (event) => { i.onclick = (event) => {
SetThreadPost(GrandParentpost); SetThreadPost(GrandParentpost, i);
if (i.classList.contains("Handle")) {
window.location.href = "../../HTML/account.html?website=" + website;
} else {
document.location.href = "./expanded.html?website=" + website;
}
} }
} }
async function SetThreadPost(element) { async function SetThreadPost(element, i) {
if (website == "Mastodon") { if (website == "Mastodon") {
localStorage.setItem("post", JSON.stringify(element)); localStorage.setItem("post", JSON.stringify(element));
} else if (website == "Bluesky") { } else if (website == "Bluesky") {
let Temp = await BlueskyAPI.GetPosts(element.uri); let Temp = await BlueskyAPI.GetPosts(element.uri);
element.post = Temp.posts[0]; element.post = Temp.posts[0];
localStorage.setItem("post", JSON.stringify(element)); localStorage.setItem("post", JSON.stringify(element));
} }
if (i.classList.contains("Handle")) {
window.location.href = "../../HTML/account.html?website=" + website;
} else {
document.location.href = "./expanded.html?website=" + website;
}
} }
// Functions and things. // Functions and things.