reworked site

This commit is contained in:
2025-11-16 13:44:11 +01:00
parent 26d7c4e6b3
commit 274762c825
9 changed files with 775 additions and 816 deletions

View File

@@ -1,17 +1,6 @@
(() => {
const API_URL = 'https://fb.srv.medeba-media.de/api';
// Check if we should redirect to posts view
(function checkViewRouting() {
const params = new URLSearchParams(window.location.search);
const view = params.get('view');
if (view === 'posts') {
// Remove view parameter and keep other params
params.delete('view');
const remainingParams = params.toString();
window.location.href = 'index.html' + (remainingParams ? '?' + remainingParams : '');
}
})();
let posts = [];
let filteredPosts = [];
let currentTimeFilter = 'week';
@@ -323,21 +312,21 @@ function apiFetch(url, options = {}) {
}
function showLoading() {
const loading = document.getElementById('loading');
const loading = document.getElementById('dashboardLoading');
if (loading) {
loading.style.display = 'block';
}
}
function hideLoading() {
const loading = document.getElementById('loading');
const loading = document.getElementById('dashboardLoading');
if (loading) {
loading.style.display = 'none';
}
}
function showError(message) {
const error = document.getElementById('error');
const error = document.getElementById('dashboardError');
if (error) {
error.textContent = message;
error.style.display = 'block';
@@ -345,7 +334,7 @@ function showError(message) {
}
function hideError() {
const error = document.getElementById('error');
const error = document.getElementById('dashboardError');
if (error) {
error.style.display = 'none';
}
@@ -1579,3 +1568,4 @@ document.getElementById('refreshBtn')?.addEventListener('click', () => {
// Initialize
fetchPosts();
})();