feat: enhance snippet management with import/export functionality and size display

This commit is contained in:
2025-10-13 16:00:34 +03:00
parent eaf14aafdd
commit 1734001d20
6 changed files with 188 additions and 20 deletions

View File

@@ -89,12 +89,33 @@ document.addEventListener('DOMContentLoaded', function () {
});
});
// Header links - show placeholder
document.querySelectorAll('.header-link').forEach(link => {
link.addEventListener('click', function () {
// Header links
const importLink = document.getElementById('import-link');
const exportLink = document.getElementById('export-link');
const helpLink = document.getElementById('help-link');
const importFileInput = document.getElementById('import-file-input');
if (importLink && importFileInput) {
importLink.addEventListener('click', function () {
importFileInput.click();
});
importFileInput.addEventListener('change', function () {
importSnippets(this);
});
}
if (exportLink) {
exportLink.addEventListener('click', function () {
exportSnippets();
});
}
if (helpLink) {
helpLink.addEventListener('click', function () {
alert('Coming soon in a future phase!');
});
});
}
// View mode toggle buttons
document.getElementById('view-draft').addEventListener('click', () => {