mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
add privacy statement popup
This commit is contained in:
@@ -55,6 +55,11 @@
|
|||||||
closeExtensionPopup();
|
closeExtensionPopup();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const openPrivacyStatement = () => {
|
||||||
|
window.open("https://betterseqta.org/privacy", "_blank");
|
||||||
|
closeExtensionPopup();
|
||||||
|
};
|
||||||
|
|
||||||
let { standalone } = $props<{ standalone?: boolean }>();
|
let { standalone } = $props<{ standalone?: boolean }>();
|
||||||
let showColourPicker = $state<boolean>(false);
|
let showColourPicker = $state<boolean>(false);
|
||||||
|
|
||||||
@@ -101,23 +106,32 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{#if !standalone}
|
{#if !standalone}
|
||||||
|
<div class="absolute top-1 right-1 flex items-center gap-2">
|
||||||
<button
|
<button
|
||||||
onclick={openAbout}
|
onclick={openAbout}
|
||||||
class="absolute top-1 right-[62px] w-8 h-8 text-lg rounded-xl font-IconFamily bg-zinc-100 dark:bg-zinc-700"
|
class="w-8 h-8 text-lg rounded-xl font-IconFamily bg-zinc-100 dark:bg-zinc-700 flex items-center justify-center"
|
||||||
>
|
>
|
||||||
{"\ueb73"}
|
{"\ueb73"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onclick={openPrivacyStatement}
|
||||||
|
class="w-8 h-8 text-lg rounded-xl font-IconFamily bg-zinc-100 dark:bg-zinc-700 flex items-center justify-center"
|
||||||
|
aria-label="Privacy Statement"
|
||||||
|
>
|
||||||
|
{"\uecba"}
|
||||||
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onclick={openChangelog}
|
onclick={openChangelog}
|
||||||
class="absolute top-1 right-10 w-8 h-8 text-lg rounded-xl font-IconFamily bg-zinc-100 dark:bg-zinc-700"
|
class="w-8 h-8 text-lg rounded-xl font-IconFamily bg-zinc-100 dark:bg-zinc-700 flex items-center justify-center"
|
||||||
>
|
>
|
||||||
{"\ue929"}
|
{"\ue929"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onclick={openMinecraftServer}
|
onclick={openMinecraftServer}
|
||||||
class="absolute top-1 right-1 w-8 h-8 bg-zinc-100 dark:bg-zinc-700 rounded-xl p-1"
|
class="w-8 h-8 bg-zinc-100 dark:bg-zinc-700 rounded-xl p-1 flex items-center justify-center"
|
||||||
aria-label="Open Minecraft Server"
|
aria-label="Open Minecraft Server"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -248,6 +262,7 @@
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+87
-1
@@ -96,7 +96,13 @@ export async function finishLoad() {
|
|||||||
console.error("Error during loading cleanup:", err);
|
console.error("Error during loading cleanup:", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settingsState.justupdated && !document.getElementById("whatsnewbk")) {
|
// Show privacy statement notification on first open of this version (before what's new)
|
||||||
|
if (!settingsState.privacyStatementShown && !document.getElementById("privacy-notification")) {
|
||||||
|
showPrivacyNotification();
|
||||||
|
settingsState.privacyStatementShown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settingsState.justupdated && !document.getElementById("whatsnewbk") && !document.getElementById("privacy-notification")) {
|
||||||
OpenWhatsNewPopup();
|
OpenWhatsNewPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -601,6 +607,86 @@ export function showConflictPopup() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function showPrivacyNotification() {
|
||||||
|
if (document.getElementById("privacy-notification")) return;
|
||||||
|
|
||||||
|
const background = document.createElement("div");
|
||||||
|
background.id = "privacy-notification";
|
||||||
|
background.classList.add("whatsnewBackground");
|
||||||
|
background.style.zIndex = "10000001";
|
||||||
|
|
||||||
|
const container = document.createElement("div");
|
||||||
|
container.classList.add("whatsnewContainer");
|
||||||
|
container.style.height = "auto";
|
||||||
|
container.style.maxWidth = "800px";
|
||||||
|
container.style.width = "90%";
|
||||||
|
|
||||||
|
const headerHTML = /* html */ `
|
||||||
|
<div class="whatsnewHeader">
|
||||||
|
<h1>Privacy Statement</h1>
|
||||||
|
<p>Important Information</p>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
const header = stringToHTML(headerHTML).firstChild;
|
||||||
|
|
||||||
|
const textHTML = /* html */ `
|
||||||
|
<div class="whatsnewTextContainer" style="overflow-y: auto; font-size: 1.3rem; line-height: 1.6;">
|
||||||
|
<p>
|
||||||
|
It has come to our attention that several schools have expressed concerns about BetterSEQTA+. As security is at the core of everything we do, this is an issue we take very seriously, which is why we have decided to release a statement on the situation.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
To view our privacy policy, please click the <strong>shield icon</strong> in the settings menu, or<a href="https://betterseqta.org/privacy" target="_blank" rel="noopener noreferrer" id="privacy-link" style="color: inherit; text-decoration: underline; cursor: pointer; white-space: nowrap;"> click here</a>.
|
||||||
|
</p>
|
||||||
|
<p style="font-weight: bold; margin-top: 15px;">
|
||||||
|
We never collect any information from you, and aim to provide the best features possible.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
const text = stringToHTML(textHTML).firstChild;
|
||||||
|
|
||||||
|
const exitButton = document.createElement("div");
|
||||||
|
exitButton.id = "whatsnewclosebutton";
|
||||||
|
|
||||||
|
if (header) container.append(header);
|
||||||
|
if (text) container.append(text);
|
||||||
|
container.append(exitButton);
|
||||||
|
|
||||||
|
background.append(container);
|
||||||
|
|
||||||
|
document.getElementById("container")?.append(background);
|
||||||
|
|
||||||
|
if (settingsState.animations) {
|
||||||
|
animate([background as HTMLElement], { opacity: [0, 1] });
|
||||||
|
}
|
||||||
|
|
||||||
|
background.addEventListener("click", (event) => {
|
||||||
|
if (event.target === background) {
|
||||||
|
background.remove();
|
||||||
|
// Show what's new if it was waiting
|
||||||
|
if (settingsState.justupdated && !document.getElementById("whatsnewbk")) {
|
||||||
|
OpenWhatsNewPopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
exitButton.addEventListener("click", () => {
|
||||||
|
background.remove();
|
||||||
|
// Show what's new if it was waiting
|
||||||
|
if (settingsState.justupdated && !document.getElementById("whatsnewbk")) {
|
||||||
|
OpenWhatsNewPopup();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle privacy link click - ensure it opens in new tab
|
||||||
|
const privacyLink = document.getElementById("privacy-link");
|
||||||
|
if (privacyLink) {
|
||||||
|
privacyLink.addEventListener("click", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
window.open("https://betterseqta.org/privacy", "_blank", "noopener,noreferrer");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function init() {
|
export function init() {
|
||||||
const handleDisabled = () => {
|
const handleDisabled = () => {
|
||||||
waitForElm(".code", true, 50).then(AppendElementsToDisabledPage);
|
waitForElm(".code", true, 50).then(AppendElementsToDisabledPage);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export interface SettingsState {
|
|||||||
subjectfilters: Record<string, any>;
|
subjectfilters: Record<string, any>;
|
||||||
transparencyEffects: boolean;
|
transparencyEffects: boolean;
|
||||||
justupdated?: boolean;
|
justupdated?: boolean;
|
||||||
|
privacyStatementShown?: boolean;
|
||||||
timeFormat?: string;
|
timeFormat?: string;
|
||||||
animations: boolean;
|
animations: boolean;
|
||||||
defaultPage: string;
|
defaultPage: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user