From 98c101fd550810937209495668f8697526511195 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 10 Mar 2021 10:39:40 -0500 Subject: [PATCH] Notes pane: Change "Delete" to "Move to Trash" and remove confirm() And remove unused _removeNote() function We prompt to delete in the items list to distinguish from collection removals, but it's arguably not necessary here, since you can always get the item out of the trash. Undo would be nice, though. --- chrome/content/zotero/contextPane.js | 20 ++++---------------- chrome/content/zotero/zoteroPane.xul | 2 +- chrome/locale/en-US/zotero/zotero.dtd | 1 + 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/chrome/content/zotero/contextPane.js b/chrome/content/zotero/contextPane.js index 65a3ce6ed2..134a4c995d 100644 --- a/chrome/content/zotero/contextPane.js +++ b/chrome/content/zotero/contextPane.js @@ -199,14 +199,6 @@ var ZoteroContextPane = new function () { _togglePane(1); } - function _removeNote(id) { - var ps = Components.classes['@mozilla.org/embedcomp/prompt-service;1'] - .getService(Components.interfaces.nsIPromptService); - if (ps.confirm(null, '', Zotero.getString('pane.item.notes.delete.confirm'))) { - Zotero.Items.trashTx(id); - } - } - function _getActiveEditor() { var splitter; if (Zotero.Prefs.get('layout') == 'stacked') { @@ -548,14 +540,10 @@ var ZoteroContextPane = new function () { ZoteroPane_Local.openNoteWindow(id); break; - case 'context-pane-list-delete': - var ps = Components.classes['@mozilla.org/embedcomp/prompt-service;1'] - .getService(Components.interfaces.nsIPromptService); - if (ps.confirm(null, '', Zotero.getString('pane.item.notes.delete.confirm'))) { - Zotero.Items.trashTx(id); - context.cachedNotes = context.cachedNotes.filter(x => x.id != id); - _updateNotesList(true); - } + case 'context-pane-list-move-to-trash': + Zotero.Items.trashTx(id); + context.cachedNotes = context.cachedNotes.filter(x => x.id != id); + _updateNotesList(true); break; default: diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index 75be06a7cb..b6ea18165a 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -648,7 +648,7 @@ - + diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd index c1c9f53aa4..74bed783ec 100644 --- a/chrome/locale/en-US/zotero/zotero.dtd +++ b/chrome/locale/en-US/zotero/zotero.dtd @@ -6,6 +6,7 @@ +