Warning fix

This commit is contained in:
CatAClock 2025-07-13 06:49:46 -07:00
parent 9679b731c6
commit b5970b11f3
2 changed files with 10 additions and 10 deletions

View file

@ -343,6 +343,8 @@ export function ApplyFacets(record, text) {
let Hrefs = []; let Hrefs = [];
let TempText = ""; let TempText = "";
if (record.hasOwnProperty("facets")) { if (record.hasOwnProperty("facets")) {
// First minute append.
SplitAreas.push(text.length);
// First, append split areas. // First, append split areas.
for (let i of record.facets) { for (let i of record.facets) {
if (i.features[0].$type == "app.bsky.richtext.facet#link") { if (i.features[0].$type == "app.bsky.richtext.facet#link") {

View file

@ -228,7 +228,7 @@ async function PosterContainerUpdate(Direction) {
} }
MastodonLoadedFeed = await MastodonLoadedFeed.concat(TempFeed); MastodonLoadedFeed = await MastodonLoadedFeed.concat(TempFeed);
} }
// put the reblog into the regular post; Make changes as necessary. // Put the reblog into the regular post; Make changes as necessary.
if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog != "string") { if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog != "string") {
// Fix a reblog issue. // Fix a reblog issue.
let ReblogFix = MastodonLoadedFeed[CurrentThing + counter].account.acct; let ReblogFix = MastodonLoadedFeed[CurrentThing + counter].account.acct;
@ -239,7 +239,7 @@ async function PosterContainerUpdate(Direction) {
// this function is if the changes are already made. // this function is if the changes are already made.
i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )"; i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )";
} }
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.acct + i.getElementsByClassName("Username")[0].innerHTML i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.acct;
// Check for images. // Check for images.
if (MastodonLoadedFeed[CurrentThing + counter].media_attachments.length != 0) { if (MastodonLoadedFeed[CurrentThing + counter].media_attachments.length != 0) {
if (MastodonLoadedFeed[CurrentThing + counter].media_attachments[0].type == "image") { if (MastodonLoadedFeed[CurrentThing + counter].media_attachments[0].type == "image") {
@ -255,7 +255,6 @@ async function PosterContainerUpdate(Direction) {
// Content warning. Don't show the content unless clicked!!! // Content warning. Don't show the content unless clicked!!!
if (MastodonLoadedFeed[CurrentThing + counter].spoiler_text != "") { if (MastodonLoadedFeed[CurrentThing + counter].spoiler_text != "") {
i.getElementsByClassName("PostContent")[0].innerHTML += "<b>WARNING: " + MastodonLoadedFeed[CurrentThing + counter].spoiler_text + "</b>"; i.getElementsByClassName("PostContent")[0].innerHTML += "<b>WARNING: " + MastodonLoadedFeed[CurrentThing + counter].spoiler_text + "</b>";
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.username;
break; break;
} }
i.getElementsByClassName("PostContent")[0].innerHTML += MastodonLoadedFeed[CurrentThing + counter].content; i.getElementsByClassName("PostContent")[0].innerHTML += MastodonLoadedFeed[CurrentThing + counter].content;
@ -274,6 +273,12 @@ async function PosterContainerUpdate(Direction) {
} }
BlueskyLoadedFeed = await BlueskyLoadedFeed.concat(TempFeed); BlueskyLoadedFeed = await BlueskyLoadedFeed.concat(TempFeed);
} }
// Check for a reblog.
if (BlueskyLoadedFeed[CurrentThing + counter].hasOwnProperty("reason") && BlueskyLoadedFeed[CurrentThing + counter].reason.$type == "app.bsky.feed.defs#reasonRepost") {
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle + " ( R: " + BlueskyLoadedFeed[CurrentThing + counter].reason.by.handle + " )";
} else {
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle;
}
// check for "already seen" posts, then put it as a seen post. // check for "already seen" posts, then put it as a seen post.
BlueskyLoadedFeed = CheckForDups(BlueskyLoadedFeed, BlueskyPostsDup, counter); BlueskyLoadedFeed = CheckForDups(BlueskyLoadedFeed, BlueskyPostsDup, counter);
BlueskyPostsDup.push(BlueskyLoadedFeed[counter].post.uri); BlueskyPostsDup.push(BlueskyLoadedFeed[counter].post.uri);
@ -296,19 +301,12 @@ async function PosterContainerUpdate(Direction) {
// Labels // Labels
if (BlueskyLoadedFeed[CurrentThing + counter].post.labels.length != 0) { if (BlueskyLoadedFeed[CurrentThing + counter].post.labels.length != 0) {
i.getElementsByClassName("PostContent")[0].innerHTML += "<b>LABELS APPLIED: "; i.getElementsByClassName("PostContent")[0].innerHTML += "<b>LABELS APPLIED: ";
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle;
for (let lab of BlueskyLoadedFeed[CurrentThing + counter].post.labels) { for (let lab of BlueskyLoadedFeed[CurrentThing + counter].post.labels) {
i.getElementsByClassName("PostContent")[0].innerHTML += lab.val + " "; i.getElementsByClassName("PostContent")[0].innerHTML += lab.val + " ";
} }
i.getElementsByClassName("PostContent")[0].innerHTML += "</b>"; i.getElementsByClassName("PostContent")[0].innerHTML += "</b>";
break; break;
} }
// Check for a reblog.
if (BlueskyLoadedFeed[CurrentThing + counter].hasOwnProperty("reason") && BlueskyLoadedFeed[CurrentThing + counter].reason.$type == "app.bsky.feed.defs#reasonRepost") {
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle + " ( R: " + BlueskyLoadedFeed[CurrentThing + counter].reason.by.handle + " )";
} else {
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle;
}
// Apply correct facets. // Apply correct facets.
let TempText = await BlueskyAPI.ApplyFacets(BlueskyLoadedFeed[CurrentThing + counter].post.record, BlueskyLoadedFeed[CurrentThing + counter].post.record.text); let TempText = await BlueskyAPI.ApplyFacets(BlueskyLoadedFeed[CurrentThing + counter].post.record, BlueskyLoadedFeed[CurrentThing + counter].post.record.text);
TempText = TempText.replace(/\r?\n|\r/g, "<br/>"); TempText = TempText.replace(/\r?\n|\r/g, "<br/>");