diff --git a/.domains b/.domains
index a5ef603..80222b4 100644
--- a/.domains
+++ b/.domains
@@ -1,2 +1 @@
-https://fedikirche.de
-https://www.fedikirche.de
+csett86.codeberg.page
\ No newline at end of file
diff --git a/src/components/postwall.js b/src/components/postwall.js
index 5f3b3ea..53705ed 100644
--- a/src/components/postwall.js
+++ b/src/components/postwall.js
@@ -3,15 +3,8 @@ import { checkConsent, showConsentPopup, setUserConsent } from '../components/co
export async function loadPostwall() {
const container = document.getElementById('postswall-container');
- // Überprüfe, ob Consent erteilt wurde
- if (!checkConsent()) {
- // Consent nicht erteilt – alternative Kachel anzeigen
- renderConsentRequest();
- return; // Beende die Funktion, kein weiterer Datenabruf
- }
-
// Mastodon API-URL für Hashtag-Suche
- const apiUrl = 'https://libori.social/api/v1/timelines/tag/fedikirche?limit=20';
+ const apiUrl = 'https://kirche.social/api/v1/timelines/tag/fedikirche?limit=20';
// Posts laden
async function fetchPosts() {
@@ -106,54 +99,6 @@ export async function loadPostwall() {
fetchPosts();
}
-// Alternative Kachel anzeigen, wenn kein Consent erteilt wurde
-function renderConsentRequest() {
- const container = document.getElementById('postswall-container');
- container.innerHTML = ''; // Vorherige Inhalte leeren
-
- const consentCard = document.createElement('div');
- consentCard.classList.add('post'); // Verwendet die Post-Klasse für Konsistenz
-
- consentCard.innerHTML = `
-
-
-
-
Du musst zuerst zustimmen, um Inhalte anzuzeigen.
-
-
- `;
-
- container.appendChild(consentCard);
-
- // Event-Listener für Button zum erneuten Anzeigen des Consent-Popups
- document.getElementById('open-consent-popup').addEventListener('click', () => {
- showConsentPopup(
- () => {
- setUserConsent(true); // Zustimmung speichern
- loadPostwall(); // Nachträglich Posts laden
- },
- () => {
- setUserConsent(false); // Ablehnung speichern
- console.log('Consent abgelehnt');
- }
- );
- });
-}
-
// Zeitberechnung für Posts
function getTimeAgo(date) {
const now = new Date();
@@ -177,7 +122,7 @@ function getTimeAgo(date) {
function addReadMoreButton() {
const container = document.getElementById('postswall-container');
const readMoreButton = document.createElement('a');
- readMoreButton.href = 'https://libori.social/tags/fedikirche';
+ readMoreButton.href = 'https://kirche.social/tags/fedikirche';
readMoreButton.target = '_blank';
readMoreButton.rel = 'noopener noreferrer';
readMoreButton.classList.add('read-more-button');
diff --git a/src/main.js b/src/main.js
index f4b2235..53276e4 100644
--- a/src/main.js
+++ b/src/main.js
@@ -2,24 +2,10 @@ 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';
-import { checkConsent, setUserConsent, showConsentPopup } from './components/consentManager.js';
document.addEventListener('DOMContentLoaded', async function () {
// Starte sofort den Seitenaufbau
initializeSite();
-
- // Überprüfe parallel den Consent-Status
- const consent = checkConsent();
- if (!consent) {
- showConsentPopup(
- () => {
- setUserConsent(true);
- },
- () => {
- setUserConsent(false);
- }
- );
- }
});
async function initializeSite() {
diff --git a/src/utils/instances.js b/src/utils/instances.js
index 3664e54..66d85e3 100644
--- a/src/utils/instances.js
+++ b/src/utils/instances.js
@@ -10,7 +10,7 @@ export function getServerClass(instance) {
export function extractHostname(url) {
try {
- const hostname = url.match(/^https?:\/\/([^\/]+)/i)[1]; // Regex: extrahiert den Hostnamen
+ const hostname = url.split('@')[1];
return hostname;
} catch (error) {
console.error('Fehler beim Extrahieren des Hostnamens:', error, 'URL:', url);
diff --git a/src/utils/profile-utils.js b/src/utils/profile-utils.js
index 487d2c4..ba3eb63 100644
--- a/src/utils/profile-utils.js
+++ b/src/utils/profile-utils.js
@@ -1,37 +1,16 @@
import { getServerClass } from './instances.js';
-export async function fetchProfile(profileUrl, options = {}) {
- const { updateElement = null, createCard = false } = options;
+export async function fetchProfile(handle, options = {}) {
+ const { returnData = null, createCard = false } = options;
try {
- const url = new URL(profileUrl);
+ const data = await fetchProfileViaMastodon(handle);
- // Schritt 1: Plattform-Erkennung
- const platform = await detectPlatform(url);
-
- // Schritt 2: Profil-Daten abrufen
- let data;
- if (platform === 'mastodon') {
- data = await fetchMastodonProfile(url);
- } else if (platform === 'wordpress') {
- data = await fetchWordpressProfile(url);
- } else {
- throw new Error('Unbekannte Plattform');
- }
-
- // Schritt 3: Ausgabe vorbereiten
- if (updateElement) {
- updateElement.textContent = data.display_name || data.name || data.username;
-
- const avatarImage = document.createElement('img');
- avatarImage.classList.add('account-avatar');
- avatarImage.alt = data.display_name || data.name || 'Profilbild nicht verfügbar';
- avatarImage.src = data.avatar || data.icon?.url || '';
-
- updateElement.prepend(avatarImage);
+ if (returnData) {
return data;
} else if (createCard) {
- const card = createAccountCard(data, profileUrl, url.hostname);
+ const url = new URL(data.url);
+ const card = createAccountCard(data, data.url, url.hostname);
return { card, data };
}
} catch (error) {
@@ -40,81 +19,14 @@ export async function fetchProfile(profileUrl, options = {}) {
}
}
-async function detectPlatform(url) {
- // Test auf Mastodon-API
- try {
- const mastodonTest = await fetch(`${url.origin}/api/v1/instance`);
- if (mastodonTest.ok) return 'mastodon';
- } catch (error) {
- console.warn('Fehler beim Mastodon-Test:', error);
- }
-
- // Test auf WordPress-ActivityPub
- try {
- const wpTest = await fetch(`${url.origin}/wp-json/activitypub/1.0/actors/1`, {
- headers: { Accept: 'application/activity+json' }
- });
- if (wpTest.ok) return 'wordpress';
- } catch (error) {
- console.warn('Fehler beim WordPress-Test:', error);
- }
-
- // Fallback, wenn kein Test erfolgreich war
- return 'unknown';
-}
-
-async function fetchMastodonProfile(url) {
- const handle = url.pathname.split('/')[1].substring(1);
- const lookupUrl = `https://${url.hostname}/api/v1/accounts/lookup?acct=${handle}`;
+async function fetchProfileViaMastodon(handle) {
+ const lookupUrl = `https://kirche.social/api/v1/accounts/lookup?acct=${handle}`;
const response = await fetch(lookupUrl);
- if (!response.ok) throw new Error('Mastodon-Profil nicht gefunden');
+ if (!response.ok) throw new Error(`Mastodon-Profil ${handle} nicht gefunden`);
return await response.json();
}
-async function fetchWordpressProfile(url) {
- const actorId = url.pathname.split('/').pop(); // ID aus der URL extrahieren
- const lookupUrl = `${url.origin}/${actorId}`;
-
- const response = await fetch(lookupUrl, {
- headers: { Accept: 'application/activity+json' }
- });
- if (!response.ok) throw new Error('WordPress-Profil nicht gefunden');
- const data = await response.json();
-
- // Letzten Post aus der Outbox holen
- const lastPostDate = await fetchWordpressLastPost(data.outbox);
-
- // Kompatibilität herstellen
- return {
- username: data.preferredUsername,
- display_name: data.name,
- avatar: data.icon?.url,
- note: data.summary,
- followers_count: data.followers ? data.followers.length : 0,
- last_status_at: lastPostDate || data.published,
- };
-}
-
-async function fetchWordpressLastPost(outboxUrl) {
- try {
- const response = await fetch(`${outboxUrl}?page=1`, {
- headers: { Accept: 'application/activity+json' }
- });
-
- if (!response.ok) throw new Error('Outbox konnte nicht geladen werden');
- const data = await response.json();
-
- if (data.orderedItems && data.orderedItems.length > 0) {
- const latestPost = data.orderedItems[0];
- return latestPost.published || latestPost.object.published;
- }
- } catch (error) {
- console.warn('Fehler beim Abrufen des letzten Beitrags:', error);
- }
- return null;
-}
-
export function createAccountCard(data, href, instance) {
const serverClass = getServerClass(instance);
const link = document.createElement('a');
diff --git a/src/utils/recommendations-utils.js b/src/utils/recommendations-utils.js
index 31c6efb..ca1cba9 100644
--- a/src/utils/recommendations-utils.js
+++ b/src/utils/recommendations-utils.js
@@ -1,6 +1,5 @@
import { fetchProfile } from './profile-utils.js';
import { extractHostname, getServerClass } from './instances.js';
-import { checkConsent } from '../components/consentManager.js';
export function createRecommendationPopup(accounts, title, authors, description) {
const template = document.getElementById('popup-template').content.cloneNode(true);
@@ -115,34 +114,27 @@ export function populateAuthorsContainer(authorsContainer, authors) {
const additionalAuthorsCount = authors.length - authorsToShow.length;
authorsToShow.forEach(author => {
- const authorLink = document.createElement('a');
- authorLink.href = author;
+ const authorLink = document.createElement('a');
authorLink.classList.add('account');
authorLink.target = '_blank'; // Link öffnet neues Fenster
- // Consent prüfen
- if (checkConsent()) {
- // Consent erteilt - Profilbild laden
- fetchProfile(author, { updateElement: authorLink }).then(() => {
- const avatarImage = authorLink.querySelector('.account-avatar');
- if (avatarImage) {
- authorLink.textContent = '';
- authorLink.appendChild(avatarImage);
+ fetchProfile(author, { returnData: true }).then((data) => {
+ authorLink.href = data.url;
- // Server-Klasse für Avatar hinzufügen
- const hostname = extractHostname(author);
- const serverClass = getServerClass(hostname);
- if (serverClass) {
- avatarImage.classList.add(serverClass);
- }
- }
- });
- } else {
- // Kein Consent – Skeleton-Loader anzeigen
- const skeletonAvatar = document.createElement('div');
- skeletonAvatar.classList.add('skeleton', 'avatar-skeleton', 'account-avatar');
- authorLink.appendChild(skeletonAvatar);
- }
+ const avatarImage = document.createElement('img');
+ avatarImage.classList.add('account-avatar');
+ avatarImage.alt = data.display_name || data.name || 'Profilbild nicht verfügbar';
+ avatarImage.src = data.avatar || '';
+
+ authorLink.appendChild(avatarImage);
+
+ // Server-Klasse für Avatar hinzufügen
+ const hostname = extractHostname(author);
+ const serverClass = getServerClass(hostname);
+ if (serverClass) {
+ avatarImage.classList.add(serverClass);
+ }
+ });
authorsContainer.appendChild(authorLink);
});
diff --git a/src/utils/starterkit-utils.js b/src/utils/starterkit-utils.js
index 93ff38b..9a5e245 100644
--- a/src/utils/starterkit-utils.js
+++ b/src/utils/starterkit-utils.js
@@ -1,5 +1,4 @@
import { createRecommendationPopup, populateAuthorsContainer } from './recommendations-utils.js';
-import { checkConsent, showConsentPopup, setUserConsent } from '../components/consentManager.js';
// StarterKit-Element erstellen
export function createStarterKitElement(kit) {
@@ -23,6 +22,7 @@ export function createStarterKitElement(kit) {
populateAuthorsContainer(authorsContainer, kit.authors);
kitElement.dataset.accounts = JSON.stringify(kit.accounts);
+ kitElement.dataset.authors = JSON.stringify(kit.authors);
return kitElement;
}
@@ -40,21 +40,7 @@ export function enhanceStarterKits() {
// StarterKit-Klick behandeln
function handleStarterKitClick(kit) {
- if (checkConsent()) {
- // Zustimmung vorhanden – StarterKit-Popup öffnen
- loadStarterKitProfiles(kit);
- } else {
- // Keine Zustimmung – Consent-Popup anzeigen
- showConsentPopup(
- () => {
- setUserConsent(true); // Zustimmung speichern
- loadStarterKitProfiles(kit); // Nachträglich StarterKit-Popup öffnen
- },
- () => {
- console.log('Consent wurde abgelehnt. StarterKit-Popup wird nicht geöffnet.');
- }
- );
- }
+ loadStarterKitProfiles(kit);
}
// StarterKit-Profile laden
@@ -62,7 +48,7 @@ function loadStarterKitProfiles(kit) {
const title = kit.querySelector('h3').textContent;
const description = kit.querySelector('p').textContent;
const accounts = JSON.parse(kit.dataset.accounts || '[]');
- const authors = Array.from(kit.querySelectorAll('.authors-container .account')).map(author => author.href);
+ const authors = JSON.parse(kit.dataset.authors || '[]');
const popup = createRecommendationPopup(accounts, title, authors, description);
document.body.appendChild(popup);
diff --git a/starterkits/sk-100-morgen-wald.json b/starterkits/sk-100-morgen-wald.json
index 77ba702..9544fd1 100644
--- a/starterkits/sk-100-morgen-wald.json
+++ b/starterkits/sk-100-morgen-wald.json
@@ -2,19 +2,19 @@
"name": "100 Morgen Wald",
"description": "Bildung, viel Bildung.\n",
"authors": [
- "https://kirche.social/@frau_sanders"
+ "frau_sanders@kirche.social"
],
"accounts": [
- "https://social.tchncs.de/@kuketzblog",
- "https://mastodon.social/@bahnkundenv",
- "https://sueden.social/@BlumeEvolution",
- "https://artikel91.eu/@fxneumann",
- "https://social.bund.de/@DLR",
- "https://mastodon.social/@sundogplanets",
- "https://linuxhotel.social/@linuxhotel",
- "https://mastodon.art/@Fuchskind",
- "https://chaos.social/@leah",
- "https://hostsharing.coop/@Pflege42",
- "https://chaos.social/@irgendwiejuna"
+ "kuketzblog@social.tchncs.de",
+ "bahnkundenv@mastodon.social",
+ "BlumeEvolution@sueden.social",
+ "fxneumann@artikel91.eu",
+ "DLR@social.bund.de",
+ "sundogplanets@mastodon.social",
+ "linuxhotel@linuxhotel.social",
+ "Fuchskind@mastodon.art",
+ "leah@chaos.social",
+ "Pflege42@hostsharing.coop",
+ "irgendwiejuna@chaos.social"
]
}
\ No newline at end of file
diff --git a/starterkits/sk-daily-impulse.json b/starterkits/sk-daily-impulse.json
index 9d95d78..b60db27 100644
--- a/starterkits/sk-daily-impulse.json
+++ b/starterkits/sk-daily-impulse.json
@@ -2,7 +2,7 @@
"name": "tägliche Impulse",
"description": "Tägliche spirituelle Impulse – Inspiration und Besinnung für deinen Alltag.",
"authors": [
- "https://kirche.social/@frau_sanders"
+ "frau_sanders@kirche.social"
],
"accounts": [
"https://kirche.social/@morgengebet",
diff --git a/starterkits/sk-eb-paderborn.json b/starterkits/sk-eb-paderborn.json
index 4d5a8c0..3c576b2 100644
--- a/starterkits/sk-eb-paderborn.json
+++ b/starterkits/sk-eb-paderborn.json
@@ -2,7 +2,7 @@
"name": "Erzbistum Paderborn",
"description": "Menschen, Institutionen und Initiativen aus dem Erzbistum Paderborn.",
"authors": [
- "https://libori.social/@alex"
+ "alex@libori.social"
],
"accounts": [
"https://libori.social/@news_erzbistum_paderborn",
diff --git a/starterkits/sk-fedikirche.json b/starterkits/sk-fedikirche.json
index ff7e3af..55bc1bc 100644
--- a/starterkits/sk-fedikirche.json
+++ b/starterkits/sk-fedikirche.json
@@ -2,7 +2,7 @@
"name": "#FediKirche",
"description": "Accounts rund um #FediKirche – engagiert für die Stärkung der kirchlichen Community im Fediverse.",
"authors": [
- "https://libori.social/@alex"
+ "alex@libori.social"
],
"accounts": [
"https://reliverse.social/@comenius",
diff --git a/starterkits/sk-inklusion.json b/starterkits/sk-inklusion.json
index cceff0d..f0dcff2 100644
--- a/starterkits/sk-inklusion.json
+++ b/starterkits/sk-inklusion.json
@@ -2,7 +2,7 @@
"name": "Inklusion",
"description": "Dickes Brett. Hier bohren schon einige.\nEs geht um Gerechtigkeit, Freiheit und Bildung. Es geht um Inklusion. Für alle.",
"authors": [
- "https://kirche.social/@frau_sanders"
+ "frau_sanders@kirche.social"
],
"accounts": [
"https://mastodon.cloud/@RaulKrauthausen",
diff --git a/starterkits/sk-katholisch.json b/starterkits/sk-katholisch.json
index 90a5485..1398f86 100644
--- a/starterkits/sk-katholisch.json
+++ b/starterkits/sk-katholisch.json
@@ -2,7 +2,7 @@
"name": "katholisch",
"description": "Eine vielseitige Auswahl aus dem katholischen Umfeld – von engagierten Gläubigen und theologischen Stimmen bis hin zu verschiedenen Bistümern, Institutionen und Einrichtungen.",
"authors": [
- "https://libori.social/@alex"
+ "alex@libori.social"
],
"accounts": [
"https://libori.social/@news_erzbistum_paderborn",
diff --git a/starterkits/sk-nachrichten-analysen.json b/starterkits/sk-nachrichten-analysen.json
index b1072f6..5dab1ef 100644
--- a/starterkits/sk-nachrichten-analysen.json
+++ b/starterkits/sk-nachrichten-analysen.json
@@ -2,7 +2,7 @@
"name": "Nachrichten, Meinungen & Analysen",
"description": "Redaktionen mit eigenen Inhalten – von Nachrichten und Analysen bis hin zu Meinungsbeiträgen und Hintergrundberichten. Ideal für alle, die fundierte Informationen und journalistische Perspektiven aus erster Hand schätzen.",
"authors": [
- "https://libori.social/@alex"
+ "alex@libori.social"
],
"accounts": [
"https://mastodon.social/@eulemagazin",
diff --git a/starterkits/sk-religionsbezogene-bildung.json b/starterkits/sk-religionsbezogene-bildung.json
index 7e53cb1..66620fe 100644
--- a/starterkits/sk-religionsbezogene-bildung.json
+++ b/starterkits/sk-religionsbezogene-bildung.json
@@ -2,7 +2,7 @@
"name": "religionsbezogene Bildung",
"description": "Eine bunte Auswahl an Profilen zur religionsbezogenen Bildung – von pädagogischen Konzepten und theologischen Impulsen bis zu Projekten, die Dialog und Lernen über Religion fördern.",
"authors": [
- "https://reliverse.social/@joerglohrer"
+ "joerglohrer@reliverse.social"
],
"accounts": [
"https://reliverse.social/@heller",
diff --git a/starterkits/sk-vereine-initiativen.json b/starterkits/sk-vereine-initiativen.json
index 528e1dc..d61f9f5 100644
--- a/starterkits/sk-vereine-initiativen.json
+++ b/starterkits/sk-vereine-initiativen.json
@@ -2,7 +2,7 @@
"name": "Vereine und Initiativen",
"description": "Kirchliche Vereine und Initiativen – von Bibelprojekten und Gemeindegründungen bis hin zu ökumenischen Projekten und Linux in der Kirche. Entdecke Vielfalt und Engagement!",
"authors": [
- "https://libori.social/@alex"
+ "alex@libori.social"
],
"accounts": [
"https://kirche.social/@offenebibel",
diff --git a/starterkits/sp-evangelisch.json b/starterkits/sp-evangelisch.json
index e0a6a03..93f923f 100644
--- a/starterkits/sp-evangelisch.json
+++ b/starterkits/sp-evangelisch.json
@@ -2,7 +2,7 @@
"name": "Evangelische Kirchengemeinden, Dekanate und Kirchspiele",
"description": "Eine Liste von evangelischen Kirchengemeinden, Dekanaten und Kirchspielen.\nFehlt etwas? Wir sind für Info dankbar.",
"authors": [
- "https://kirche.social/@onlinekirche"
+ "onlinekirche@kirche.social"
],
"accounts": [
"https://kirche.social/@campusgemeinde",
diff --git a/starterkits/sp-gemeinden-und-so.json b/starterkits/sp-gemeinden-und-so.json
index f4beff4..1b2ce1a 100644
--- a/starterkits/sp-gemeinden-und-so.json
+++ b/starterkits/sp-gemeinden-und-so.json
@@ -2,7 +2,7 @@
"name": "Gemeinden und so",
"description": "Kirche auf Feldebene, katholisch und evangelisch: Pfarr-/Kirchengemeinden, Kirchspiele, Pastoralverbünde, pastorale Räume etc.",
"authors": [
- "https://katholisch.social/@pvpv"
+ "pvpv@katholisch.social"
],
"accounts": [
"https://libori.social/@attendorn_katholisch",