From ad04577ce26d1e18f7a736af0136fb06820e791c Mon Sep 17 00:00:00 2001 From: Ferdinand Date: Thu, 2 Apr 2026 15:27:08 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Verlauf=20l=C3=B6schbar,=20L=C3=B6sch-B?= =?UTF-8?q?est=C3=A4tigung,=20HEX/RGB/HSL=20Tooltips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Verlauf: neuer Button 'Verlauf löschen' mit Bestätigungsdialog - Löschen von Favoriten und Schemata erfordert jetzt Bestätigung - HEX, RGB und HSL Labels in Picker- und Eingabe-Tab mit ℹ Tooltip Co-Authored-By: Claude Sonnet 4.6 --- index.html | 12 ++++++------ js/collection.js | 24 ++++++++++++++++++++---- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index e550d98..ad63615 100644 --- a/index.html +++ b/index.html @@ -30,15 +30,15 @@
- +
- +
- +
@@ -53,15 +53,15 @@
- +
- +
- +
diff --git a/js/collection.js b/js/collection.js index 57eb983..6bbbc39 100644 --- a/js/collection.js +++ b/js/collection.js @@ -287,7 +287,10 @@ function renderSchemaCard(node, container, allSchemata, depth) { delBtn.className = 'action-btn'; delBtn.textContent = 'Löschen'; delBtn.style.fontSize = '0.75rem'; - delBtn.addEventListener('click', () => deleteSchema(node.name)); + delBtn.addEventListener('click', () => { + if (!confirm('"' + node.name + '" wirklich löschen?')) return; + deleteSchema(node.name); + }); btnGroup.appendChild(editBtn); btnGroup.appendChild(delBtn); @@ -352,7 +355,10 @@ export function renderSammlung() { del.className = 'action-btn'; del.textContent = 'Löschen'; del.style.fontSize = '0.7rem'; - del.addEventListener('click', () => removeFavorit(hex)); + del.addEventListener('click', () => { + if (!confirm('Favorit wirklich löschen?')) return; + removeFavorit(hex); + }); cell.appendChild(del); favContainer.appendChild(cell); }); @@ -369,9 +375,19 @@ export function renderSammlung() { msg.textContent = 'Noch kein Verlauf.'; histContainer.appendChild(msg); } else { - data.history.forEach(hsl => { - histContainer.appendChild(makeSwatch(hsl)); + const clearBtn = document.createElement('button'); + clearBtn.className = 'action-btn'; + clearBtn.textContent = 'Verlauf löschen'; + clearBtn.style.cssText = 'font-size:0.75rem;margin-bottom:0.75rem;display:block'; + clearBtn.addEventListener('click', () => { + if (!confirm('Verlauf wirklich löschen?')) return; + const d = load(); + d.history = []; + save(d); + renderSammlung(); }); + histContainer.appendChild(clearBtn); + data.history.forEach(hsl => histContainer.appendChild(makeSwatch(hsl))); } }