From cc4cebdb45109347e7fe1d6b814460762d0ed935 Mon Sep 17 00:00:00 2001 From: Caroline Schulte Date: Sun, 19 Jul 2026 21:16:54 +0200 Subject: [PATCH 1/4] . --- .idea/dataSources.local.xml | 2 +- content/showArticle.php | 12 ++++++++++++ css/main.css | 30 ++++++++++++++++++++++++++++ js/comments.js | 39 ++++++++++++++++++++++++++++++++++++- 4 files changed, 81 insertions(+), 2 deletions(-) diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index b341a8a..707e2b3 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + " diff --git a/content/showArticle.php b/content/showArticle.php index c5152c1..9501cab 100644 --- a/content/showArticle.php +++ b/content/showArticle.php @@ -457,6 +457,18 @@ if ($replyAuthor === null) { + + + + +
diff --git a/content/showCategory.php b/content/showCategory.php index 2f8a4a9..0ad05eb 100644 --- a/content/showCategory.php +++ b/content/showCategory.php @@ -113,6 +113,17 @@ $resultCount = count($results);

+ +
diff --git a/css/search-results.css b/css/search-results.css index a89817c..fbf630a 100644 --- a/css/search-results.css +++ b/css/search-results.css @@ -271,4 +271,33 @@ CSS für die Suchergebnis-Seite align-items: flex-start; } } +/* Ladeanzeige beim Nachladen von Such- und Kategorieergebnissen */ +.results-loading { + display: flex; + align-items: center; + gap: 8px; + margin: 15px 0; + color: #4a5568; + font-size: 0.95rem; +} + +.results-loading[hidden] { + display: none; +} + +.results-spinner { + width: 16px; + height: 16px; + flex-shrink: 0; + border: 2px solid #cbd5e1; + border-top-color: #3182ce; + border-radius: 50%; + animation: results-spinner-rotation 0.8s linear infinite; +} + +@keyframes results-spinner-rotation { + to { + transform: rotate(360deg); + } +} diff --git a/js/search-results.js b/js/search-results.js index 9461e39..4d12c06 100644 --- a/js/search-results.js +++ b/js/search-results.js @@ -25,6 +25,7 @@ let listContainer, sortRadios, categorySelect, limitSelect; let prevBtn, nextBtn, numbersContainer, jsNav, resultCountEl; + let loadingElement; function init() { listContainer = document.querySelector('.s-res-list'); @@ -38,23 +39,41 @@ numbersContainer = document.getElementById('dynamic-page-numbers'); jsNav = document.getElementById('js-page-navigation'); resultCountEl = document.getElementById('s-res-result-count'); + loadingElement = document.getElementById('results-loading'); const checkedRadio = document.querySelector('.sort-radio:checked'); state.sort = checkedRadio ? checkedRadio.value : 'alphabet'; state.category = categorySelect ? categorySelect.value : 'all'; state.itemsPerPage = limitSelect ? (parseInt(limitSelect.value, 10) || 10) : 10; + if (loadingElement) { + loadingElement.hidden = false; + } + fetchFullDataset() .then(function (data) { state.allItems = data.results || []; attachEvents(); render(); - if (jsNav) jsNav.style.display = 'flex'; + + if (jsNav) { + jsNav.style.display = 'flex'; + } }) .catch(function (err) { - // JSON-Endpoint nicht erreichbar: die serverseitig gerenderte - // (No-JS-)Ansicht bleibt sichtbar und funktioniert weiter. - console.error('Suchergebnisse konnten nicht nachgeladen werden:', err); + /* + * Falls das Nachladen nicht funktioniert, bleibt die bereits + * serverseitig ausgegebene Ergebnisliste sichtbar. + */ + console.error( + 'Suchergebnisse konnten nicht nachgeladen werden:', + err + ); + }) + .finally(function () { + if (loadingElement) { + loadingElement.hidden = true; + } }); } diff --git a/js/showCategory.js b/js/showCategory.js index 08b07ff..394a721 100644 --- a/js/showCategory.js +++ b/js/showCategory.js @@ -21,6 +21,7 @@ let listContainer, sortRadios, searchInput, limitSelect; let prevBtn, nextBtn, numbersContainer, jsNav, resultCountEl; + let loadingElement; let searchDebounceTimer; function init() { @@ -35,23 +36,41 @@ numbersContainer = document.getElementById('dynamic-page-numbers'); jsNav = document.getElementById('js-page-navigation'); resultCountEl = document.getElementById('s-res-result-count'); + loadingElement = document.getElementById('results-loading'); const checkedRadio = document.querySelector('.sort-radio:checked'); state.sort = checkedRadio ? checkedRadio.value : 'alphabet'; state.query = searchInput ? searchInput.value : ''; state.itemsPerPage = limitSelect ? (parseInt(limitSelect.value, 10) || 10) : 10; + if (loadingElement) { + loadingElement.hidden = false; + } + fetchFullDataset() .then(function (data) { state.allItems = data.results || []; attachEvents(); render(); - if (jsNav) jsNav.style.display = 'flex'; + + if (jsNav) { + jsNav.style.display = 'flex'; + } }) .catch(function (err) { - // JSON-Endpoint nicht erreichbar: die serverseitig gerenderte - // (No-JS-)Ansicht bleibt sichtbar und funktioniert weiter. - console.error('Kategorie-Beiträge konnten nicht nachgeladen werden:', err); + /* + * Falls das Nachladen nicht funktioniert, bleibt die bereits + * serverseitig ausgegebene Kategorieansicht sichtbar. + */ + console.error( + 'Kategorie-Beiträge konnten nicht nachgeladen werden:', + err + ); + }) + .finally(function () { + if (loadingElement) { + loadingElement.hidden = true; + } }); } From 9146d395a21927df7b7e40d844d1c6390c3497b2 Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Mon, 20 Jul 2026 00:05:44 +0200 Subject: [PATCH 3/4] Update dataSources.local.xml --- .idea/dataSources.local.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index 707e2b3..b341a8a 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + " From 75b4aa0b885795712d81d2f5a68465a79a19bf2a Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Mon, 20 Jul 2026 00:11:27 +0200 Subject: [PATCH 4/4] Update index.php --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index b70d61c..f17f987 100644 --- a/index.php +++ b/index.php @@ -5,6 +5,7 @@ if (session_status() === PHP_SESSION_NONE) { include_once "includes/csrf.php"; include_once "php/controller/index-controller.php"; ?> +