This commit is contained in:
CatAClock 2025-07-16 18:15:56 -07:00
parent 650fa74f0e
commit 602a1a551b

View file

@ -174,17 +174,17 @@ async function GetPost() {
} }
// Because of repeat code, we can put it into it's own function. Hell, more of a thread can be added later. // Because of repeat code, we can put it into it's own function. Hell, more of a thread can be added later.
async function MastodonReplylFunction(Name, post) { async function MastodonReplylFunction(Id, post) {
let OtherPost = await MastodonAPI.GetStatus(post); let OtherPost = await MastodonAPI.GetStatus(post);
let ShitHTML = "<header> <h1 name=" + Name + " class=\"Handle\"> " + website + "</h1> <h1 name=" + Name + " class=\"Origin\"> " + OtherPost.account.acct + "</h1> </header> <p name=" + Name + " class=\"PostText\"></p> <div name=" + Name + " class=\"Images\"></div> <hr/>"; let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + website + "</h1> <h1 class=\"Origin " + Id + "\"> " + OtherPost.account.acct + "</h1> </header> <p class=\"PostText " + Id + "\"></p> <div class=\"Images " + Id + "\"></div> <hr/>";
document.getElementsByTagName("body")[0].innerHTML = ShitHTML + document.getElementsByTagName("body")[0].innerHTML; document.getElementsByTagName("body")[0].innerHTML = ShitHTML + document.getElementsByTagName("body")[0].innerHTML;
if (OtherPost.spoiler_text != "") { if (OtherPost.spoiler_text != "") {
document.getElementsByClassName("PostText")[0].getElementsByName(Name)[0].innerHTML = "WARNING: " + OtherPost.spoiler_text; document.getElementsByClassName("PostText " + Id)[0].innerHTML = "WARNING: " + OtherPost.spoiler_text;
} else { } else {
document.getElementsByClassName("PostText")[0].getElementsByName(Name)[0].innerHTML = OtherPost.content; document.getElementsByClassName("PostText " + Id)[0].innerHTML = OtherPost.content;
if (OtherPost.media_attachments.length != 0) { if (OtherPost.media_attachments.length != 0) {
for (let i of OtherPost.media_attachments) { for (let i of OtherPost.media_attachments) {
ApplyMedia(i, document.getElementsByClassName("Images").getElementsByName(Name)[0]); ApplyMedia(i, document.getElementsByClassName("Images " + Id));
} }
} }
} }