From c391d7f4faf897ae2afd536a27b9d44bdf158faa Mon Sep 17 00:00:00 2001
From: j <j@mailb.org>
Date: Sat, 25 Jan 2025 10:24:24 +0530
Subject: [PATCH] better delete anntoation dialog

---
 static/js/editor.js | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/static/js/editor.js b/static/js/editor.js
index 82a75344a..70cc2e3ee 100644
--- a/static/js/editor.js
+++ b/static/js/editor.js
@@ -481,12 +481,16 @@ pandora.ui.editor = function(data) {
     pandora._dontSelectResult = false;
 
     function confirmDeleteDialog(options, callback) {
-        const subject = options.items.length == 1 ? Ox._('annotation') : Ox._('annotations')
+        const title = Ox.getObjectById(
+            pandora.site.layers,
+            getAnnotationById(options.items[0]).layer
+        ).item
+        const subject = options.items.length == 1 ? title : title + 's'
         const $dialog = pandora.ui.iconDialog({
             buttons: [
                 Ox.Button({
                         id: 'cancel',
-                        title: Ox._('Cancel')
+                        title: Ox._('Keep {0}', [Ox._(subject)])
                     })
                     .bindEvent({
                         click: function() {
@@ -495,7 +499,7 @@ pandora.ui.editor = function(data) {
                     }),
                 Ox.Button({
                         id: 'delete',
-                        title: Ox._('Delete')
+                        title: Ox._('Delete {0}', [Ox._(subject)])
                     })
                     .bindEvent({
                         click: function() {
@@ -505,13 +509,13 @@ pandora.ui.editor = function(data) {
                     })
             ],
             content: Ox._(
-                'Are you sure you want delete {0} {1}',
-                [options.items.length, subject]
+                'Are you sure you want delete {0} {1}?<br><br>All data will be removed.',
+                [options.items.length, Ox._(subject.toLowerCase())]
             ),
             height: 96,
             keys: {enter: 'delete', escape: 'cancel'},
             title: Ox._(
-                'Delete {0} {1}', [options.items.length, subject]
+                'Delete {0}', [Ox._(subject)]
             )
         });
         $dialog.open()