diff --git a/chrome/content/zotero/elements/itemPane.js b/chrome/content/zotero/elements/itemPane.js index ab76b8661c..1a6caae80d 100644 --- a/chrome/content/zotero/elements/itemPane.js +++ b/chrome/content/zotero/elements/itemPane.js @@ -224,19 +224,30 @@ // Display label in the middle of the item pane else { if (count) { - if (count == 1) { - let item = this.data[0]; - // If a collection or search is selected, it must be in the trash. - if (item.isCollection()) { - let subcollectionsCount = item.getDescendents(false, 'collection', true).length; - msg = Zotero.getString('pane.collections.deletedCollection', subcollectionsCount); + let key; + // In the trash, we have to check the object type + if (this.collectionTreeRow.isTrash()) { + let obj = this.data[0]; + if (this.data.every(x => x.isCollection())) { + key = 'item-pane-message-collections-selected'; } - else if (item.isSearch()) { - msg = Zotero.getString('pane.collections.deletedSearch'); + else if (this.data.every(x => x.isSearch())) { + key = 'item-pane-message-searches-selected'; + } + else if (this.data.every(x => x.isItem())) { + key = 'item-pane-message-items-selected'; + } + else { + key = 'item-pane-message-objects-selected'; } } - - msg = Zotero.getString('pane.item.selected.multiple', count); + else { + key = 'item-pane-message-items-selected'; + } + // TODO: Add mechanism for this to setItemPaneMessage() + let elem = document.createXULElement('description'); + document.l10n.setAttributes(elem, key, { count }); + msg = elem; } else { let rowCount = this.itemsView.rowCount; diff --git a/chrome/content/zotero/itemTree.jsx b/chrome/content/zotero/itemTree.jsx index 2158d256b3..db8d59dba0 100644 --- a/chrome/content/zotero/itemTree.jsx +++ b/chrome/content/zotero/itemTree.jsx @@ -2813,10 +2813,13 @@ var ItemTree = class ItemTree extends LibraryTree { let itemTypeAriaLabel; try { - if (item.isSearch() || item.isCollection()) { - // Special treatment for trashed collections or searches since they are not an actual - // item and do not have an item type - itemTypeAriaLabel = Zotero.getString(`pane.collections.deleted${item._ObjectType}Aria`) + '.'; + // Special treatment for trashed collections or searches since they are not an actual + // item and do not have an item type + if (item.isSearch()) { + itemTypeAriaLabel = Zotero.getString('searchConditions.collection') + '.'; + } + else if (item.isCollection()) { + itemTypeAriaLabel = Zotero.getString('searchConditions.savedSearch') + '.'; } else { var itemType = Zotero.ItemTypes.getName(item.itemTypeID); @@ -3823,20 +3826,16 @@ var ItemTree = class ItemTree extends LibraryTree { _getIcon(index) { var item = this.getRow(index).ref; - // TEMP + // Non-item objects that can be appear in the trash if (item.isCollection() || item.isSearch()) { - let iconClsName; + let icon; if (item.isCollection()) { - iconClsName = "IconTreeitemCollection"; + icon = getCSSIcon('collection'); } - if (item.isSearch()) { - iconClsName = "IconTreeitemSearch"; - } - var icon = getDOMElement(iconClsName); - if (!icon) { - Zotero.debug('Could not find tree icon for "' + itemType + '"'); - return document.createElement('span'); + else if (item.isSearch()) { + icon = getCSSIcon('search'); } + icon.classList.add('icon-item-type'); return icon; } diff --git a/chrome/content/zotero/xpcom/data/collection.js b/chrome/content/zotero/xpcom/data/collection.js index fadd30a65e..8d7a7df44f 100644 --- a/chrome/content/zotero/xpcom/data/collection.js +++ b/chrome/content/zotero/xpcom/data/collection.js @@ -691,7 +691,7 @@ Zotero.Collection.prototype.trash = Zotero.Promise.coroutine(function* (env) { }); /** -* Completely erases the collection and it's descendants. +* Completely erase the collection and its descendants. **/ Zotero.Collection.prototype._eraseData = Zotero.Promise.coroutine(function* (env) { Zotero.DB.requireTransaction(); diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 24c27a66ea..e314f8ee5d 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -535,6 +535,24 @@ item-pane-header-bibEntry = item-pane-header-more-options = .label = More Options +item-pane-message-items-selected = { $count -> + [one] { $count } item selected + *[other] { $count } items selected + } +item-pane-message-collections-selected = { $count -> + [one] { $count } collection selected + *[other] { $count } collections selected + } +item-pane-message-searches-selected = { $count -> + [one] { $count } search selected + *[other] { $count } searches selected + } +item-pane-message-objects-selected = { $count -> + [one] { $count } object selected + *[other] { $count } objects selected + } + + locate-library-lookup-no-resolver = You must choose a resolver from the { $pane } pane of the { -app-name } settings. architecture-win32-warning-message = { -app-name } is running in 32-bit mode on a 64-bit version of Windows. { -app-name } will run more efficiently in 64-bit mode. diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 1b3f23f6b1..e732b0e637 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -276,10 +276,6 @@ pane.collections.retracted = Retracted Items pane.collections.duplicate = Duplicate Items pane.collections.removeLibrary = Remove Library pane.collections.removeLibrary.text = Are you sure you want to permanently remove “%S” from this computer? -pane.collections.deletedCollection = Deleted collection with %1$S subcollections -pane.collections.deletedCollectionAria = Deleted collection -pane.collections.deletedSearch = Deleted search -pane.collections.deletedSearchAria = Deleted search pane.collections.menu.duplicate.savedSearch = Duplicate Saved Search pane.collections.menu.remove.library = Remove Library… diff --git a/scss/components/_item-tree.scss b/scss/components/_item-tree.scss index 78d6f904cb..ed4fb1342a 100644 --- a/scss/components/_item-tree.scss +++ b/scss/components/_item-tree.scss @@ -274,6 +274,12 @@ $-attachmentIcons: ( attachment-video ); +// Non-item objects that can appear in the trash +$-trashableObjectIcons: ( + "collection", + "search" +); + .icon-item-type { width: 16px; height: 16px; @@ -324,5 +330,11 @@ $-attachmentIcons: ( background-origin: content-box; } } + + @each $icon in $-trashableObjectIcons { + .icon-css.icon-#{$icon} { + @include svgicon($icon, $color, "16", "collection-tree"); + } + } } }