1
0

Favoriten-Viewer: Erfolgsmeldung für erfolgreich geladenen Inhalt hinzugefügt

This commit is contained in:
Akamaru
2025-04-21 19:26:22 +02:00
parent 91ee93c54c
commit 5009f7cccb

View File

@@ -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...
</div>
<div id="errorIndicator"></div>
<div id="successIndicator"></div>
</div>
</div>
@@ -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;