Add "Restore to Library" context menu option

This commit is contained in:
Simon Kornblith 2011-10-02 15:50:54 +00:00
parent b4c4ec3a86
commit 3364a533c5
4 changed files with 14 additions and 8 deletions

View file

@ -34,9 +34,8 @@
<vbox id="zotero-item-pane" zotero-persist="width">
<!-- Trash -->
<!-- TODO: localize -->
<!-- TODO: Make look less awful -->
<button id="zotero-item-restore-button" label="Restore to Library"
<button id="zotero-item-restore-button" label="&zotero.items.menu.restoreToLibrary;"
oncommand="ZoteroPane_Local.restoreSelectedItems()" hidden="true"/>
<!-- Commons -->

View file

@ -2142,6 +2142,7 @@ var ZoteroPane = new function()
'duplicateItem',
'deleteItem',
'deleteFromLibrary',
'restoreToLibrary',
'mergeItems',
'sep3',
'exportItems',
@ -2175,7 +2176,13 @@ var ZoteroPane = new function()
var itemGroup = this.getItemGroup();
show.push(m.deleteFromLibrary, m.sep3, m.exportItems, m.createBib, m.loadReport);
if(itemGroup.isTrash()) {
show.push(m.restoreToLibrary);
} else {
show.push(m.deleteFromLibrary);
}
show.push(m.sep3, m.exportItems, m.createBib, m.loadReport);
if (this.itemsView.selection.count > 0) {
// Multiple items selected
@ -2252,10 +2259,7 @@ var ZoteroPane = new function()
}
}
if (hasImportedAttachment) {
var d = [m.deleteFromLibrary, m.createParent, m.renameAttachments];
for each(var val in d) {
disable.push(val);
}
disable.push(m.deleteFromLibrary, m.createParent, m.renameAttachments);
}
}
}
@ -2274,7 +2278,7 @@ var ZoteroPane = new function()
// Disable actions in the trash
if (itemGroup.isTrash()) {
disable.push(m.deleteItem, m.deleteFromLibrary);
disable.push(m.deleteItem);
}
if (item.isRegularItem()) {
@ -2351,6 +2355,7 @@ var ZoteroPane = new function()
case 'exportItems':
case 'createBib':
case 'loadReport':
case 'restoreToLibrary':
continue;
}
}

View file

@ -271,6 +271,7 @@
<menuitem label="&zotero.items.menu.duplicateItem;" oncommand="ZoteroPane_Local.duplicateSelectedItem();"/>
<menuitem oncommand="ZoteroPane_Local.deleteSelectedItems();"/>
<menuitem oncommand="ZoteroPane_Local.deleteSelectedItems(true);"/>
<menuitem label="&zotero.items.menu.restoreToLibrary;" oncommand="ZoteroPane_Local.restoreSelectedItems();"/>
<!-- TODO: localize -->
<menuitem oncommand="ZoteroPane_Local.mergeSelectedItems();" label="Merge Items…"/>
<menuseparator/>

View file

@ -67,6 +67,7 @@
<!ENTITY zotero.items.menu.attach.file "Attach Stored Copy of File…">
<!ENTITY zotero.items.menu.attach.fileLink "Attach Link to File…">
<!ENTITY zotero.items.menu.restoreToLibrary "Restore to Library">
<!ENTITY zotero.items.menu.duplicateItem "Duplicate Selected Item">
<!ENTITY zotero.toolbar.newItem.label "New Item">