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.
This commit is contained in:
Dan Stillman 2021-03-10 10:39:40 -05:00
parent 24cc59cc7e
commit 98c101fd55
3 changed files with 6 additions and 17 deletions

View file

@ -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:

View file

@ -648,7 +648,7 @@
<menuitem id="context-pane-list-show-in-library" label="&zotero.items.menu.showInLibrary;"/>
<menuitem id="context-pane-list-edit-in-window" label="&zotero.context.editInWindow;"/>
<menuseparator/>
<menuitem id="context-pane-list-delete" label="&zotero.general.delete;"/>
<menuitem id="context-pane-list-move-to-trash" label="&zotero.general.moveToTrash;"/>
</menupopup>
</popupset>
</hbox>

View file

@ -6,6 +6,7 @@
<!ENTITY zotero.general.deselectAll "Deselect All">
<!ENTITY zotero.general.edit "Edit">
<!ENTITY zotero.general.delete "Delete">
<!ENTITY zotero.general.moveToTrash "Move to Trash">
<!ENTITY zotero.general.ok "OK">
<!ENTITY zotero.general.cancel "Cancel">
<!ENTITY zotero.general.refresh "Refresh">