commit 33fedc306c8fe72a383484e62a6991e6e93e606c
parent b01ae24f1811ffae6a5e3d79c8a261a764ac2e35
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date: Sat, 13 Apr 2013 01:53:02 -0500
Add icons to context menus
Diffstat:
15 files changed, 137 insertions(+), 31 deletions(-)
diff --git a/chrome/content/zotero/locateMenu.js b/chrome/content/zotero/locateMenu.js
@@ -93,8 +93,9 @@ var Zotero_LocateMenu = new function() {
/**
* Clear the bottom part of the context menu and add locate options
* @param {menupopup} menu The menu to add context menu items to
+ * @param {Boolean} showIcons Whether menu items should have associated icons
*/
- this.buildContextMenu = function(menu) {
+ this.buildContextMenu = function(menu, showIcons) {
// get selected items
var selectedItems = _getSelectedItems();
@@ -102,7 +103,7 @@ var Zotero_LocateMenu = new function() {
if(!selectedItems.length || selectedItems.length > 20) return;
// add view options
- _addViewOptions(menu, selectedItems);
+ _addViewOptions(menu, selectedItems, showIcons);
/*// look for locate engines
var availableEngines = _getAvailableLocateEngines(selectedItems);
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -2400,7 +2400,7 @@ var ZoteroPane = new function()
}
// add locate menu options
- Zotero_LocateMenu.buildContextMenu(menu);
+ Zotero_LocateMenu.buildContextMenu(menu, true);
}
diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul
@@ -237,31 +237,31 @@
<popupset>
<menupopup id="zotero-collectionmenu" onpopupshowing="ZoteroPane_Local.buildCollectionContextMenu();">
<!-- Keep order in sync with buildCollectionContextMenu -->
- <menuitem label="&zotero.toolbar.newCollection.label;" command="cmd_zotero_newCollection"/>
- <menuitem label="&zotero.toolbar.newSavedSearch.label;" command="cmd_zotero_newSavedSearch"/>
- <menuitem label="&zotero.toolbar.newSubcollection.label;" oncommand="ZoteroPane_Local.newCollection(ZoteroPane_Local.getSelectedCollection().id)"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-new-collection" label="&zotero.toolbar.newCollection.label;" command="cmd_zotero_newCollection"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-new-saved-search" label="&zotero.toolbar.newSavedSearch.label;" command="cmd_zotero_newSavedSearch"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-new-collection" label="&zotero.toolbar.newSubcollection.label;" oncommand="ZoteroPane_Local.newCollection(ZoteroPane_Local.getSelectedCollection().id)"/>
<menuseparator/>
- <menuitem label="&zotero.toolbar.duplicate.label;" oncommand="ZoteroPane_Local.setVirtual(ZoteroPane_Local.getSelectedLibraryID(), 'duplicates', true)"/>
- <menuitem label="&zotero.collections.showUnfiledItems;" oncommand="ZoteroPane_Local.setVirtual(ZoteroPane_Local.getSelectedLibraryID(), 'unfiled', true)"/>
- <menuitem oncommand="ZoteroPane_Local.editSelectedCollection();"/>
- <menuitem oncommand="ZoteroPane_Local.deleteSelectedCollection();"/>
- <menuitem oncommand="ZoteroPane_Local.deleteSelectedCollection(true);"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-show-duplicates" label="&zotero.toolbar.duplicate.label;" oncommand="ZoteroPane_Local.setVirtual(ZoteroPane_Local.getSelectedLibraryID(), 'duplicates', true)"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-show-unfiled" label="&zotero.collections.showUnfiledItems;" oncommand="ZoteroPane_Local.setVirtual(ZoteroPane_Local.getSelectedLibraryID(), 'unfiled', true)"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-edit-collection" oncommand="ZoteroPane_Local.editSelectedCollection();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-delete-collection" oncommand="ZoteroPane_Local.deleteSelectedCollection();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-move-to-trash" oncommand="ZoteroPane_Local.deleteSelectedCollection(true);"/>
<menuseparator/>
- <menuitem oncommand="Zotero_File_Interface.exportCollection();"/>
- <menuitem oncommand="Zotero_File_Interface.bibliographyFromCollection();"/>
- <menuitem label="&zotero.toolbar.export.label;" oncommand="Zotero_File_Interface.exportFile()"/>
- <menuitem oncommand="Zotero_Report_Interface.loadCollectionReport(event)"/>
- <menuitem label="&zotero.toolbar.emptyTrash.label;" oncommand="ZoteroPane_Local.emptyTrash();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-export" oncommand="Zotero_File_Interface.exportCollection();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-create-bibliography" oncommand="Zotero_File_Interface.bibliographyFromCollection();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-export" label="&zotero.toolbar.export.label;" oncommand="Zotero_File_Interface.exportFile()"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-create-report" oncommand="Zotero_Report_Interface.loadCollectionReport(event)"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-delete-from-lib" label="&zotero.toolbar.emptyTrash.label;" oncommand="ZoteroPane_Local.emptyTrash();"/>
<menuitem label="&zotero.toolbar.newCollection.label;" oncommand="ZoteroPane_Local.createCommonsBucket();"/><!--TODO localize -->
<menuitem label="Refresh" oncommand="ZoteroPane_Local.refreshCommonsBucket();"/><!--TODO localize -->
</menupopup>
<menupopup id="zotero-itemmenu" onpopupshowing="ZoteroPane_Local.buildItemContextMenu();">
<!-- Keep order in sync with buildItemContextMenu -->
- <menuitem label="&zotero.items.menu.showInLibrary;" oncommand="ZoteroPane_Local.selectItem(this.parentNode.getAttribute('itemID'), true)"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-show-in-library" label="&zotero.items.menu.showInLibrary;" oncommand="ZoteroPane_Local.selectItem(this.parentNode.getAttribute('itemID'), true)"/>
<menuseparator/>
<!-- with icon: <menuitem class="menuitem-iconic" id="zotero-menuitem-note" label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane_Local.newNote(false, this.parentNode.getAttribute('itemID'))"/>-->
- <menuitem label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane_Local.newNote(false, this.parentNode.getAttribute('itemID'))"/>
- <menu label="&zotero.items.menu.attach;">
+ <menuitem class="menuitem-iconic zotero-menuitem-attach-note" label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane_Local.newNote(false, this.parentNode.getAttribute('itemID'))"/>
+ <menu class="menu-iconic zotero-menuitem-attach" label="&zotero.items.menu.attach;">
<menupopup id="zotero-add-attachment-popup">
<menuitem class="menuitem-iconic zotero-menuitem-attachments-snapshot" label="&zotero.items.menu.attach.snapshot;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromPage(false, itemID)"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-web-link" label="&zotero.items.menu.attach.link;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromPage(true, itemID)"/>
@@ -271,20 +271,20 @@
</menupopup>
</menu>
<menuseparator/>
- <menuitem label="&zotero.items.menu.duplicateItem;" oncommand="ZoteroPane_Local.duplicateSelectedItem();"/>
- <menuitem oncommand="ZoteroPane_Local.deleteSelectedItems();"/>
- <menuitem oncommand="ZoteroPane_Local.deleteSelectedItems(true, true);"/>
- <menuitem label="&zotero.items.menu.restoreToLibrary;" oncommand="ZoteroPane_Local.restoreSelectedItems();"/>
- <menuitem label="&zotero.items.menu.mergeItems;" oncommand="ZoteroPane_Local.mergeSelectedItems();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-duplicate-item" label="&zotero.items.menu.duplicateItem;" oncommand="ZoteroPane_Local.duplicateSelectedItem();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-delete-from-lib" oncommand="ZoteroPane_Local.deleteSelectedItems();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-move-to-trash" oncommand="ZoteroPane_Local.deleteSelectedItems(true, true);"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-restore-to-library" label="&zotero.items.menu.restoreToLibrary;" oncommand="ZoteroPane_Local.restoreSelectedItems();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-merge-items" label="&zotero.items.menu.mergeItems;" oncommand="ZoteroPane_Local.mergeSelectedItems();"/>
<menuseparator/>
- <menuitem oncommand="Zotero_File_Interface.exportItems();"/>
- <menuitem oncommand="Zotero_File_Interface.bibliographyFromItems();"/>
- <menuitem oncommand="Zotero_Report_Interface.loadItemReport(event)"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-export" oncommand="Zotero_File_Interface.exportItems();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-create-bibliography" oncommand="Zotero_File_Interface.bibliographyFromItems();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-create-report" oncommand="Zotero_Report_Interface.loadItemReport(event)"/>
<menuseparator/>
- <menuitem oncommand="Zotero_RecognizePDF.recognizeSelected();"/>
- <menuitem oncommand="ZoteroPane_Local.createParentItemsFromSelected();"/>
- <menuitem oncommand="ZoteroPane_Local.renameSelectedAttachmentsFromParents()"/>
- <menuitem oncommand="ZoteroPane_Local.reindexItem();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-retrieve-metadata" oncommand="Zotero_RecognizePDF.recognizeSelected();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-create-parent" oncommand="ZoteroPane_Local.createParentItemsFromSelected();"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-rename-from-parent" oncommand="ZoteroPane_Local.renameSelectedAttachmentsFromParents()"/>
+ <menuitem class="menuitem-iconic zotero-menuitem-reindex" oncommand="ZoteroPane_Local.reindexItem();"/>
</menupopup>
</popupset>
diff --git a/chrome/skin/default/zotero/arrow-curve-090-left.png b/chrome/skin/default/zotero/arrow-curve-090-left.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/arrow-join-090.png b/chrome/skin/default/zotero/arrow-join-090.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/arrow-split-090.png b/chrome/skin/default/zotero/arrow-split-090.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/bookmark-pencil.png b/chrome/skin/default/zotero/bookmark-pencil.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/cross-script.png b/chrome/skin/default/zotero/cross-script.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/document-search-result.png b/chrome/skin/default/zotero/document-search-result.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/edit-list-order.png b/chrome/skin/default/zotero/edit-list-order.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/lifebuoy.png b/chrome/skin/default/zotero/lifebuoy.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/overlay.css b/chrome/skin/default/zotero/overlay.css
@@ -352,6 +352,61 @@
list-style-image: url('chrome://zotero/skin/treeitem-note.png');
}
+.zotero-menuitem-new-saved-search
+{
+ list-style-image: url('chrome://zotero/skin/treesource-search.png');
+}
+
+.zotero-menuitem-show-duplicates
+{
+ list-style-image: url('chrome://zotero/skin/treesource-duplicates.png');
+}
+
+.zotero-menuitem-show-unfiled
+{
+ list-style-image: url('chrome://zotero/skin/treesource-unfiled.png');
+}
+
+.zotero-menuitem-new-collection
+{
+ list-style-image: url('chrome://zotero/skin/toolbar-collection-add.png');
+}
+
+.zotero-menuitem-edit-collection
+{
+ list-style-image: url('chrome://zotero/skin/toolbar-collection-edit.png');
+}
+
+.zotero-menuitem-delete-collection
+{
+ list-style-image: url('chrome://zotero/skin/toolbar-collection-delete.png');
+}
+
+.zotero-menuitem-show-in-library
+{
+ list-style-image: url('chrome://zotero/skin/treesource-library.png');
+}
+
+.zotero-menuitem-move-to-trash
+{
+ list-style-image: url('chrome://zotero/skin/treesource-trash-full.png');
+}
+
+.zotero-menuitem-delete-from-lib
+{
+ list-style-image: url('chrome://zotero/skin/cross-script.png');
+}
+
+.zotero-menuitem-attach-note
+{
+ list-style-image: url('chrome://zotero/skin/toolbar-note-add.png');
+}
+
+.zotero-menuitem-attach
+{
+ list-style-image: url('chrome://zotero/skin/attach.png');
+}
+
.zotero-menuitem-attachments-file
{
list-style-image: url('chrome://zotero/skin/treeitem-attachment-file.png');
@@ -372,6 +427,56 @@
list-style-image: url('chrome://zotero/skin/treeitem-attachment-web-link.png');
}
+.zotero-menuitem-duplicate-item
+{
+ list-style-image: url('chrome://zotero/skin/arrow-split-090.png');
+}
+
+.zotero-menuitem-merge-items
+{
+ list-style-image: url('chrome://zotero/skin/arrow-join-090.png');
+}
+
+.zotero-menuitem-export
+{
+ list-style-image: url('chrome://zotero/skin/arrow-curve-090-left.png');
+}
+
+.zotero-menuitem-restore-to-library
+{
+ list-style-image: url('chrome://zotero/skin/lifebuoy.png');
+}
+
+.zotero-menuitem-create-bibliography
+{
+ list-style-image: url('chrome://zotero/skin/edit-list-order.png');
+}
+
+.zotero-menuitem-create-report
+{
+ list-style-image: url('chrome://zotero/skin/treeitem-report.png');
+}
+
+.zotero-menuitem-retrieve-metadata
+{
+ list-style-image: url('chrome://zotero/skin/puzzle-arrow.png');
+}
+
+.zotero-menuitem-reindex
+{
+ list-style-image: url('chrome://zotero/skin/document-search-result.png');
+}
+
+.zotero-menuitem-create-parent
+{
+ list-style-image: url('chrome://zotero/skin/page_white_add.png');
+}
+
+.zotero-menuitem-rename-from-parent
+{
+ list-style-image: url('chrome://zotero/skin/bookmark-pencil.png');
+}
+
#zotero-tb-advanced-search
{
list-style-image: url('chrome://zotero/skin/toolbar-advanced-search.png');
diff --git a/chrome/skin/default/zotero/page_white_add.png b/chrome/skin/default/zotero/page_white_add.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/puzzle-arrow.png b/chrome/skin/default/zotero/puzzle-arrow.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/toolbar-collection-delete.png b/chrome/skin/default/zotero/toolbar-collection-delete.png
Binary files differ.