mirror of
https://codeberg.org/kirche-im-netz/Startodon-Hub.git
synced 2025-08-16 07:48:03 +02:00
Datenschutzeinstellungen-Hinweis neu erstellt (noch funktionslos)
This commit is contained in:
parent
e85e4d9742
commit
5a76a237bf
3 changed files with 65 additions and 48 deletions
44
src/main.js
44
src/main.js
|
@ -2,21 +2,28 @@ import { createStarterKitElement, enhanceStarterKits } from './utils/starterkit-
|
|||
import { seededShuffleChildren } from './utils/shuffle-utils.js';
|
||||
import { initializeCreateStarterKitPopup } from './utils/create-starterkit.js';
|
||||
import { loadPostwall } from './components/postwall.js';
|
||||
|
||||
|
||||
let userConsent = null;
|
||||
export { userConsent };
|
||||
|
||||
async function loadTemplates() {
|
||||
const response = await fetch('src/template/template.html');
|
||||
const templateHTML = await response.text();
|
||||
|
||||
const templateContainer = document.createElement('div');
|
||||
templateContainer.innerHTML = templateHTML;
|
||||
document.body.appendChild(templateContainer);
|
||||
}
|
||||
import { checkConsent, setUserConsent, showConsentPopup } from './utils/consent-utils.js';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
// Überprüfe Consent, bevor Inhalte geladen werden
|
||||
const consent = checkConsent();
|
||||
if (!consent) {
|
||||
showConsentPopup(
|
||||
() => {
|
||||
setUserConsent(true);
|
||||
initializeApp();
|
||||
},
|
||||
() => {
|
||||
setUserConsent(false);
|
||||
initializeApp();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
initializeApp();
|
||||
}
|
||||
});
|
||||
|
||||
async function initializeApp() {
|
||||
await loadTemplates();
|
||||
|
||||
initializeCreateStarterKitPopup();
|
||||
|
@ -50,4 +57,13 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||
enhanceStarterKits();
|
||||
})
|
||||
.catch(error => console.error('Fehler beim Laden der StarterKits:', error));
|
||||
});
|
||||
}
|
||||
|
||||
async function loadTemplates() {
|
||||
const response = await fetch('src/template/template.html');
|
||||
const templateHTML = await response.text();
|
||||
|
||||
const templateContainer = document.createElement('div');
|
||||
templateContainer.innerHTML = templateHTML;
|
||||
document.body.appendChild(templateContainer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue