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.
for (let i of document.getElementsByClassName("Parent")) {
i.onclick = (event) => {
SetThreadPost(Parentpost);
if (i.classList.contains("Handle")) {
window.location.href = "../../HTML/account.html?website=" + website;
} else {
document.location.href = "./expanded.html?website=" + website;
}
SetThreadPost(Parentpost, i);
}
}
for (let i of document.getElementsByClassName("GrandParent")) {
i.onclick = (event) => {
SetThreadPost(GrandParentpost);
if (i.classList.contains("Handle")) {
window.location.href = "../../HTML/account.html?website=" + website;
} else {
document.location.href = "./expanded.html?website=" + website;
}
SetThreadPost(GrandParentpost, i);
}
}
async function SetThreadPost(element) {
async function SetThreadPost(element, i) {
if (website == "Mastodon") {
localStorage.setItem("post", JSON.stringify(element));
} else if (website == "Bluesky") {
let Temp = await BlueskyAPI.GetPosts(element.uri);
element.post = Temp.posts[0];
localStorage.setItem("post", JSON.stringify(element));
}
localStorage.setItem("post", JSON.stringify(element));
} else if (website == "Bluesky") {
let Temp = await BlueskyAPI.GetPosts(element.uri);
element.post = Temp.posts[0];
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.