// STRINGS TODO: make sure to seperate stuff that a user will want to input: BlueskyAppName, BlueskyPDSName. // Mastodon export const MastodonWebsite = "mastodon_website"; export const MastodonClientID = "mastodon_client_id"; export const MastodonClientSecret = "mastodon_client_secret"; export const MastodonAccessToken = "mastodon_access_token"; export const MastodonTokenType = "mastodon_token_type"; // Bluesky export const BlueskyApp = "https://bsky.app"; export const BlueskyPDS = "https://bsky.social"; export const BlueskyPKCEVerifier = "bluesky_pkce_verifier"; export const BlueskyPKCEChallenge = "bluesky_pkce_challenge"; export const BlueskyPublicKey = "bluesky_public_key"; export const BlueskyPrivateKey = "bluesky_private_key"; export const BlueskyNonce = "bluesky_nonce"; export const BlueskyAccessToken = "bluesky_access_token"; export const BlueskyRefreshToken = "bluesky_refresh_token"; // Tumblr export const TumblrWebsiteName = "https://www.tumblr.com"; // FUNCTIONS // Get the cookie from cookie storage. export function GetCookie(CookieName = "") { // Check if you put in nothing. if (CookieName == 0) { console.error("Where is the cookie name? Returning nothing..."); return ""; } // Get the cookie. let Cookie = document.cookie.split("; ").find((row) => row.startsWith(CookieName + "="))?.split("="); // If the cookie doesn't exist... if (Cookie == undefined || Cookie.length == 1) { console.log("Cookie not found. Returning nothing..."); return ""; } else { return Cookie[1]; } } // Check if a cookie is real (as in the value isn't nonexistant). export function IsCookieReal(CookieName = "") { let Cookie = GetCookie(CookieName); if (Cookie.length == 0) { return false; } return true; } // Remove the cookie. export function ExpireCookie(CookieName = "") { document.cookie = CookieName + "=nothing;samesite=strict;path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT;"; return; } // Add a new cookie (or change it's value). export function InputCookie(CookieName = "", Value = "") { if (Value == 0 || CookieName == 0) { console.error("You forgot to put in a value. Stopping..."); return; } document.cookie = CookieName + "=" + Value + ";samesite=strict;path=/;expires=Fri, 31 Dec 9999 23:59:59 GMT;" return; }