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))); } }