From 5009f7cccb7724e9b63ad3f000b6593ed06565e8 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Mon, 21 Apr 2025 19:26:22 +0200 Subject: [PATCH] =?UTF-8?q?Favoriten-Viewer:=20Erfolgsmeldung=20f=C3=BCr?= =?UTF-8?q?=20erfolgreich=20geladenen=20Inhalt=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- favorites_viewer/index.html | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/favorites_viewer/index.html b/favorites_viewer/index.html index dce9d7f..bf920d4 100644 --- a/favorites_viewer/index.html +++ b/favorites_viewer/index.html @@ -335,6 +335,21 @@ color: #d32f2f; } + #successIndicator { + padding: 10px 20px; + font-weight: 500; + border-radius: var(--border-radius); + display: none; + background-color: #e8f5e9; + color: #2e7d32; + } + + /* Icon für Success Indicator */ + #successIndicator::before { + content: "✅"; + margin-right: 8px; + } + .stats-container { margin-top: 20px; padding: 15px; @@ -486,6 +501,7 @@ ⏳ Verarbeite Datei...
+
@@ -523,6 +539,7 @@ const outputDiv = document.getElementById('favoritesOutput'); const loadingIndicator = document.getElementById('loadingIndicator'); const errorIndicator = document.getElementById('errorIndicator'); + const successIndicator = document.getElementById('successIndicator'); const searchInput = document.getElementById('searchInput'); const statsContainer = document.getElementById('statsContainer'); const statsGrid = document.getElementById('statsGrid'); @@ -563,6 +580,7 @@ fileName.textContent = 'Keine Datei ausgewählt'; errorIndicator.style.display = 'none'; loadingIndicator.style.display = 'none'; + successIndicator.style.display = 'none'; statsContainer.style.display = 'none'; return; } @@ -578,6 +596,7 @@ errorIndicator.textContent = `Fehler: Bitte lade eine HTML-Datei hoch.`; errorIndicator.style.display = 'block'; loadingIndicator.style.display = 'none'; + successIndicator.style.display = 'none'; statsContainer.style.display = 'none'; return; } else if (selectedFormat === 'json' && !isJson && !isHtml) { @@ -585,6 +604,7 @@ errorIndicator.textContent = `Fehler: Bitte lade eine JSON- oder HTML-Datei hoch.`; errorIndicator.style.display = 'block'; loadingIndicator.style.display = 'none'; + successIndicator.style.display = 'none'; statsContainer.style.display = 'none'; return; } @@ -594,6 +614,7 @@ reader.onloadstart = () => { outputDiv.innerHTML = ''; // Vorherige Ausgabe löschen errorIndicator.style.display = 'none'; + successIndicator.style.display = 'none'; loadingIndicator.style.display = 'block'; statsContainer.style.display = 'none'; @@ -611,6 +632,7 @@ reader.onerror = () => { loadingIndicator.style.display = 'none'; + successIndicator.style.display = 'none'; errorIndicator.textContent = 'Fehler beim Lesen der Datei.'; errorIndicator.style.display = 'block'; outputDiv.innerHTML = ''; @@ -631,6 +653,17 @@ updateStatistics(); updateSearch(); + + // Erfolgsmeldung anzeigen + const successIndicator = document.getElementById('successIndicator'); + successIndicator.textContent = `${statistics.totalBookmarks} Lesezeichen und ${statistics.totalFolders} Ordner erfolgreich geladen!`; + successIndicator.style.display = 'block'; + + // Erfolgsmeldung nach 5 Sekunden ausblenden + setTimeout(() => { + successIndicator.style.display = 'none'; + }, 5000); + } catch (error) { console.error("Fehler beim Parsen:", error); errorIndicator.textContent = 'Fehler beim Verarbeiten der Datei: ' + error.message;