From bfb0b16554564f93929baccbab13c44698b3e857 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Thu, 5 Jun 2025 16:25:50 -0700 Subject: [PATCH 01/14] bug fix --- JS/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/JS/index.js b/JS/index.js index ece0eab..a940796 100644 --- a/JS/index.js +++ b/JS/index.js @@ -90,9 +90,12 @@ function Music() { }, 180000); } +let ArrowRunning = false; + // Clicking the next button ArrowsButton[1].onclick = (event) => { - if (!ContainerContainer.classList.contains("NextAnimation")) { + if (!ContainerContainer.classList.contains("NextAnimation") && ArrowRunning == false) { + ArrowRunning = true; UpdateOtherContainers(1); ContainerContainer.classList.add("NextAnimation"); ButtonSound.play(); @@ -100,12 +103,14 @@ ArrowsButton[1].onclick = (event) => { ContainerContainer.classList.remove("NextAnimation"); }, 1000); PosterContainerUpdate("Forward"); + ArrowRunning = false; } } // Clicking the back button ArrowsButton[0].onclick = (event) => { - if (!ContainerContainer.classList.contains("BackAnimation")) { + if (!ContainerContainer.classList.contains("BackAnimation") && ArrowRunning == false) { + ArrowRunning = true; UpdateOtherContainers(3); ContainerContainer.classList.add("BackAnimation"); ButtonSound.play(); @@ -113,6 +118,7 @@ ArrowsButton[0].onclick = (event) => { ContainerContainer.classList.remove("BackAnimation"); }, 1000); PosterContainerUpdate("Backward"); + ArrowRunning = false; } } -- 2.45.3 From 11f8b0c782296eb35bbf23be1f39645aa1c18f69 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Wed, 11 Jun 2025 16:54:26 -0700 Subject: [PATCH 02/14] Music is now given to the user. This stops them from full-out stopping sound. --- CSS/index.css | 7 +++++++ JS/index.js | 9 --------- index.html | 2 ++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CSS/index.css b/CSS/index.css index a64f9b5..9fe232a 100644 --- a/CSS/index.css +++ b/CSS/index.css @@ -180,6 +180,13 @@ html { top: 35vh; } +audio { + position: absolute; + z-index=1; + + width: max(50px, 10%); +} + .PostContainer { position: absolute; display: flex; diff --git a/JS/index.js b/JS/index.js index a940796..94a2da2 100644 --- a/JS/index.js +++ b/JS/index.js @@ -24,7 +24,6 @@ let TimeAccountButton = document.getElementsByClassName("Time")[0]; // Sounds const ButtonSound = new Audio("Audio/button-305770.mp3"); const WarningClick = new Audio("Audio/button-pressed-38129.mp3"); -const BackgroundMusic = new Audio("Audio/soft-piano-music-312509.mp3"); // Discoverability let Discover = false; @@ -77,19 +76,11 @@ Warning.onclick = (event) => { setTimeout(() => { Main.classList.remove("MainFadeInAnimation"); Main.classList.add("MainAfter"); - Music(); }, 5000); Main = document.getElementsByClassName("MainFadeInAnimation")[0]; PosterContainerUpdate(); } -function Music() { - BackgroundMusic.play(); - setTimeout(() => { - Music(); - }, 180000); -} - let ArrowRunning = false; // Clicking the next button diff --git a/index.html b/index.html index 993d7f1..ea47ce9 100644 --- a/index.html +++ b/index.html @@ -307,5 +307,7 @@

Posting

+ + -- 2.45.3 From 079badc75cf360baec4d45b344f5fdc736f30024 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Wed, 11 Jun 2025 17:46:27 -0700 Subject: [PATCH 03/14] some odd facet bug --- JS/BlueskyAPI.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/JS/BlueskyAPI.js b/JS/BlueskyAPI.js index d171abb..99eb17d 100644 --- a/JS/BlueskyAPI.js +++ b/JS/BlueskyAPI.js @@ -349,14 +349,12 @@ export function ApplyFacets(record, text) { SplitAreas.push(i.index.byteStart); SplitAreas.push(i.index.byteEnd); Hrefs.push(i.features[0].uri); - Hrefs.push(""); } } // Last minute append. SplitAreas.push(text.length); // Remove emoji regex - let EmojiRegex = /\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu; - let EmojiObjects = text.match(EmojiRegex); + let EmojiObjects = text.match(/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu); let SubtractNumber = 0; if (EmojiObjects != null) { SubtractNumber = EmojiObjects.length * 2; @@ -366,8 +364,12 @@ export function ApplyFacets(record, text) { StringArray.push(text.slice(SplitAreas[i - 1] - SubtractNumber, SplitAreas[i] - SubtractNumber)); } // Finally, we append the string with - for (let i = 1; i < StringArray.length; i += 2) { - TempText += StringArray[i - 1] + "" + StringArray[i] + ""; + for (let i = 0; i < StringArray.length; i += 2) { + if (Hrefs[(i / 2)] != undefined) { + TempText += StringArray[i] + "" + StringArray[i + 1] + ""; + } else { + TempText += StringArray[i]; + } } } if (TempText == "") { -- 2.45.3 From 43ad1b08509464834a0b958cee05970cdf1bf144 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Wed, 11 Jun 2025 18:06:14 -0700 Subject: [PATCH 04/14] Scrolling back and forth doesn't blow the stuff up --- JS/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/JS/index.js b/JS/index.js index 94a2da2..167fb9c 100644 --- a/JS/index.js +++ b/JS/index.js @@ -213,6 +213,8 @@ async function PosterContainerUpdate(Direction) { // Begin by having the website we are using get pushed to the expanded view array and clean out the HTML. WebsiteAPIType.push("Mastodon"); i.getElementsByClassName("PostContent")[0].innerHTML = ""; + i.getElementsByClassName("Username")[0].innerHTML = ""; + // Public stuff if (MastodonLoadedFeed[CurrentThing + counter + 1] == undefined) { let TempFeed; if (Discover == true) { @@ -227,15 +229,17 @@ async function PosterContainerUpdate(Direction) { MastodonLoadedFeed = await MastodonLoadedFeed.concat(TempFeed); } // put the reblog into the regular post; Make changes as necessary. - if (MastodonLoadedFeed[CurrentThing + counter].reblog != null) { - i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].reblog.account.username + " ( R: " + MastodonLoadedFeed[CurrentThing + counter].account.username + " )"; + if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog != "string") { // Fix a reblog issue. let ReblogFix = MastodonLoadedFeed[CurrentThing + counter].account.username; MastodonLoadedFeed[CurrentThing + counter] = MastodonLoadedFeed[CurrentThing + counter].reblog; MastodonLoadedFeed[CurrentThing + counter].reblog = ReblogFix; - } else { - i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.username + i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )"; + } else if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog == "string") { + // this function is if the changes are already made. + i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )"; } + i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.username + i.getElementsByClassName("Username")[0].innerHTML // Check for images. if (MastodonLoadedFeed[CurrentThing + counter].media_attachments.length != 0) { if (MastodonLoadedFeed[CurrentThing + counter].media_attachments[0].type == "image") { -- 2.45.3 From 0195462b55cf74b0890c9c10216a73663d1ad602 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Wed, 11 Jun 2025 18:11:16 -0700 Subject: [PATCH 05/14] mobile fix --- CSS/index.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CSS/index.css b/CSS/index.css index 9fe232a..035d7d3 100644 --- a/CSS/index.css +++ b/CSS/index.css @@ -184,7 +184,7 @@ audio { position: absolute; z-index=1; - width: max(50px, 10%); + width: max(60px, 10%); } .PostContainer { -- 2.45.3 From 2401f9b958c254820a052e8a79e9411f993303d8 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Wed, 11 Jun 2025 18:42:24 -0700 Subject: [PATCH 06/14] race condition potential fix --- JS/expanded.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/JS/expanded.js b/JS/expanded.js index baf7aa4..7767cc0 100644 --- a/JS/expanded.js +++ b/JS/expanded.js @@ -10,6 +10,8 @@ let Reply = document.getElementsByClassName("Reply")[0]; let FavoriteFlipper = false; let BoostFlipper = false; +let Favoritable = false; +let Boostable = false; // Variables let website = document.location.href.split("website=")[1]; @@ -25,6 +27,10 @@ let EmbedCounter = 0; // Button stuff Favorite.onclick = (event) => { + if (Favoritable == false) { + return; + } + Favoritable = false; if (website == "Mastodon") { MastodonAPI.CreateFavorite(post.id, post.favourited); } else if (website == "Bluesky") { @@ -34,6 +40,10 @@ Favorite.onclick = (event) => { } Boost.onclick = (event) => { + if (Boostable == false) { + return; + } + Boostable = false; if (website == "Mastodon") { MastodonAPI.CreateReblog(post.id, post.reblogged); } else if (website == "Bluesky") { @@ -271,6 +281,7 @@ function SetFavorite() { } else { Favorite.innerHTML = "Unfavorite..."; } + Favoritable = true; } function SetBoost() { @@ -280,6 +291,7 @@ function SetBoost() { } else { Boost.innerHTML = "Unboost..."; } + Boostable = true; } // Functions stolen form elsewhere -- 2.45.3 From a0bd84d84499bf5c3abf448b8f3966f8edc2df0a Mon Sep 17 00:00:00 2001 From: CatAClock Date: Thu, 12 Jun 2025 21:34:08 -0700 Subject: [PATCH 07/14] fixed --- JS/expanded.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/JS/expanded.js b/JS/expanded.js index 7767cc0..2d49263 100644 --- a/JS/expanded.js +++ b/JS/expanded.js @@ -30,11 +30,15 @@ Favorite.onclick = (event) => { if (Favoritable == false) { return; } + Favoritee(); +} + +async function Favoritee() { Favoritable = false; if (website == "Mastodon") { - MastodonAPI.CreateFavorite(post.id, post.favourited); + await MastodonAPI.CreateFavorite(post.id, post.favourited); } else if (website == "Bluesky") { - BlueskyAPI.CreateLike(localStorage.getItem(Variables.BlueskyDID), post.post.uri, post.post.cid); + await BlueskyAPI.CreateLike(localStorage.getItem(Variables.BlueskyDID), post.post.uri, post.post.cid); } SetFavorite(); } @@ -43,11 +47,15 @@ Boost.onclick = (event) => { if (Boostable == false) { return; } + Boostee(); +} + +async function Boostee() { Boostable = false; if (website == "Mastodon") { - MastodonAPI.CreateReblog(post.id, post.reblogged); + await MastodonAPI.CreateReblog(post.id, post.reblogged); } else if (website == "Bluesky") { - BlueskyAPI.CreateRepost(localStorage.getItem(Variables.BlueskyDID), post.post.uri, post.post.cid); + await BlueskyAPI.CreateRepost(localStorage.getItem(Variables.BlueskyDID), post.post.uri, post.post.cid); } SetBoost(); } -- 2.45.3 From 3d1d7651e82bc01425b3b63f66dca1ec6e802edb Mon Sep 17 00:00:00 2001 From: CatAClock Date: Fri, 13 Jun 2025 16:25:23 -0700 Subject: [PATCH 08/14] header fix --- CSS/account.css | 4 ++++ CSS/index.css | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CSS/account.css b/CSS/account.css index 396ec81..ebe8e6a 100644 --- a/CSS/account.css +++ b/CSS/account.css @@ -2,6 +2,10 @@ html { background: linear-gradient(to right, #00FFFF, #dcdcdc, #dcdcdc, #dcdcdc, #dcdcdc, #dcdcdc, #00FFFF); } +h2 { + word-wrap: break-word; +} + .Button { margin-top: 30px; diff --git a/CSS/index.css b/CSS/index.css index 035d7d3..b0cfb47 100644 --- a/CSS/index.css +++ b/CSS/index.css @@ -231,6 +231,8 @@ audio { font-size: min(2vw, 2ch); margin-top: max(-5px, -0.5vw); + + word-wrap: break-word; } .PostContent { -- 2.45.3 From 3772dbffc9e93801960d5333ab3623d174a701c0 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Fri, 13 Jun 2025 16:34:00 -0700 Subject: [PATCH 09/14] made it make sense --- JS/account.js | 2 +- JS/expanded.js | 5 ++--- JS/index.js | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/JS/account.js b/JS/account.js index 30d9e84..c436050 100644 --- a/JS/account.js +++ b/JS/account.js @@ -86,7 +86,7 @@ async function GetAccount() { Blocking = !(Relations[0].blocking); SetFollow(); SetBlock(); - AccountName.innerHTML = post.account.username; + AccountName.innerHTML = post.account.acct; AccountDescription.innerHTML = post.account.note; AccountImage.setAttribute("src", post.account.avatar); // Build the fields diff --git a/JS/expanded.js b/JS/expanded.js index 2d49263..3c7f6eb 100644 --- a/JS/expanded.js +++ b/JS/expanded.js @@ -104,11 +104,10 @@ async function SetThreadPost(element, i) { // Functions and things. async function GetPost() { if (website == "Mastodon") { + document.getElementsByClassName("Handle Regular")[0].innerHTML = post.account.acct; // Check for a reblog. if (post.reblog != null) { - document.getElementsByClassName("Handle Regular")[0].innerHTML = post.account.username + " ( R: " + post.reblog + " )"; - } else { - document.getElementsByClassName("Handle Regular")[0].innerHTML = post.account.username; + document.getElementsByClassName("Handle Regular")[0].innerHTML += " ( R: " + post.reblog + " )"; } document.getElementsByClassName("PostText Regular")[0].innerHTML = post.content; // Set the texts. It's opposite because "setting" causes it to switch. diff --git a/JS/index.js b/JS/index.js index 167fb9c..0468882 100644 --- a/JS/index.js +++ b/JS/index.js @@ -231,7 +231,7 @@ async function PosterContainerUpdate(Direction) { // put the reblog into the regular post; Make changes as necessary. if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog != "string") { // Fix a reblog issue. - let ReblogFix = MastodonLoadedFeed[CurrentThing + counter].account.username; + let ReblogFix = MastodonLoadedFeed[CurrentThing + counter].account.acct; MastodonLoadedFeed[CurrentThing + counter] = MastodonLoadedFeed[CurrentThing + counter].reblog; MastodonLoadedFeed[CurrentThing + counter].reblog = ReblogFix; i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )"; @@ -239,7 +239,7 @@ async function PosterContainerUpdate(Direction) { // this function is if the changes are already made. i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )"; } - i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.username + i.getElementsByClassName("Username")[0].innerHTML + i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.acct + i.getElementsByClassName("Username")[0].innerHTML // Check for images. if (MastodonLoadedFeed[CurrentThing + counter].media_attachments.length != 0) { if (MastodonLoadedFeed[CurrentThing + counter].media_attachments[0].type == "image") { -- 2.45.3 From 9185e649beb5b9819fd871169abe7e0e14118f4d Mon Sep 17 00:00:00 2001 From: CatAClock Date: Fri, 13 Jun 2025 16:53:45 -0700 Subject: [PATCH 10/14] Facets. It's specific to bsky at the moment. --- JS/BlueskyAPI.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/JS/BlueskyAPI.js b/JS/BlueskyAPI.js index 99eb17d..bf7048b 100644 --- a/JS/BlueskyAPI.js +++ b/JS/BlueskyAPI.js @@ -350,6 +350,11 @@ export function ApplyFacets(record, text) { SplitAreas.push(i.index.byteEnd); Hrefs.push(i.features[0].uri); } + if (i.features[0].$type == "app.bsky.richtext.facet#tag") { + SplitAreas.push(i.index.byteStart); + SplitAreas.push(i.index.byteEnd); + Hrefs.push("https://bsky.app/hashtag/" + i.features[0].tag); + } } // Last minute append. SplitAreas.push(text.length); @@ -365,8 +370,8 @@ export function ApplyFacets(record, text) { } // Finally, we append the string with for (let i = 0; i < StringArray.length; i += 2) { - if (Hrefs[(i / 2)] != undefined) { - TempText += StringArray[i] + "" + StringArray[i + 1] + ""; + if (Hrefs[(i / 2)] != undefined && Hrefs[(i / 2)].split("https://").length != 1) { + TempText += StringArray[i] + "" + StringArray[i + 1] + ""; } else { TempText += StringArray[i]; } -- 2.45.3 From 918a2b97f07aae8e4fd2697ff35203ec13c631e0 Mon Sep 17 00:00:00 2001 From: CatAClock Date: Sat, 14 Jun 2025 15:26:49 -0700 Subject: [PATCH 11/14] bug fix --- CSS/expanded.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CSS/expanded.css b/CSS/expanded.css index 89534d2..a644b6b 100644 --- a/CSS/expanded.css +++ b/CSS/expanded.css @@ -23,6 +23,8 @@ body { /* Classes */ .Handle { background-color: white; + + word-wrap: break-word; } .Origin { -- 2.45.3 From ff26fd2faed6c11a787564ad4a2dee7ccb20456f Mon Sep 17 00:00:00 2001 From: CatAClock Date: Sat, 14 Jun 2025 15:29:52 -0700 Subject: [PATCH 12/14] fix the account profile not showing --- JS/account.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JS/account.js b/JS/account.js index c436050..cff9871 100644 --- a/JS/account.js +++ b/JS/account.js @@ -133,7 +133,7 @@ async function GetAccount() { } else { FollowButton.setAttribute("hidden", ""); BlockButton.setAttribute("hidden", ""); - AlternateAccountImage.setAttribute("hidden", false); + AlternateAccountImage.removeAttribute("hidden"); // This is meant for the regular account. A big ol' you :3 let Token = localStorage.getItem(Variables.MastodonAccessToken); if (Token != null) { -- 2.45.3 From f88e50bb1f1abac1dc8815d00976dc64aafffbcc Mon Sep 17 00:00:00 2001 From: CatAClock Date: Sat, 14 Jun 2025 15:36:49 -0700 Subject: [PATCH 13/14] now it makes more sense. Sort of --- JS/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/JS/index.js b/JS/index.js index 0468882..6f8f158 100644 --- a/JS/index.js +++ b/JS/index.js @@ -283,6 +283,10 @@ async function PosterContainerUpdate(Direction) { i.getElementsByClassName("PostContent")[0].innerHTML += "This post has an image!
"; } else if (BlueskyLoadedFeed[CurrentThing + counter].post.record.embed.$type == "app.bsky.embed.video") { i.getElementsByClassName("PostContent")[0].innerHTML += "This post has a video!
"; + } else if (BlueskyLoadedFeed[CurrentThing + counter].post.record.embed.$type == "app.bsky.embed.record") { + i.getElementsByClassName("PostContent")[0].innerHTML += "This post has an embeded record!
"; + } else if (BlueskyLoadedFeed[CurrentThing + counter].post.record.embed.$type == "app.bsky.embed.recordWithMedia") { + i.getElementsByClassName("PostContent")[0].innerHTML += "This post has an image and an embeded record!
"; } } // Check for a thread. -- 2.45.3 From d02e104fbf4b760ba96c562495ebd04f6dc8c3ae Mon Sep 17 00:00:00 2001 From: CatAClock Date: Sat, 28 Jun 2025 19:24:01 -0700 Subject: [PATCH 14/14] fixed two bugs: Warning messages still popped up images & The full account name wasn't visible in threads --- JS/expanded.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/JS/expanded.js b/JS/expanded.js index 3c7f6eb..86aa9db 100644 --- a/JS/expanded.js +++ b/JS/expanded.js @@ -175,15 +175,14 @@ async function GetPost() { async function MastodonReplylFunction(ClassName, post) { let OtherPost = await MastodonAPI.GetStatus(post); document.getElementsByClassName("Origin " + ClassName)[0].innerHTML = website; - document.getElementsByClassName("Handle " + ClassName)[0].innerHTML = OtherPost.account.username; + document.getElementsByClassName("Handle " + ClassName)[0].innerHTML = post.account.acct; if (OtherPost.spoiler_text != "") { document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = "WARNING: " + OtherPost.spoiler_text; } else { document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = OtherPost.content; - } - if (OtherPost.media_attachments.length != 0) { - for (let i of OtherPost.media_attachments) { - ApplyMedia(i, document.getElementsByClassName("Images " + ClassName)[0]); + if (OtherPost.media_attachments.length != 0) { + for (let i of OtherPost.media_attachments) { + ApplyMedia(i, document.getElementsByClassName("Images " + ClassName)[0]); } } return OtherPost; -- 2.45.3