diff --git a/chrome/content/zotero/integration/citationExplorer.js b/chrome/content/zotero/integration/citationExplorer.js index 2e564a54b1..8d33861f0b 100644 --- a/chrome/content/zotero/integration/citationExplorer.js +++ b/chrome/content/zotero/integration/citationExplorer.js @@ -194,6 +194,7 @@ window.ZoteroDocumentCitations = { onActivate: this.onItemActivate.bind(this), emptyMessage: Zotero.getString('pane.items.loading'), firstColumnExtraWidth: 28-16, + firstColumnPrependRenderer: this._itemFirstColumnPrependRenderer.bind(this), }); await itemList.waitForLoad(); // Remove focus from citationList if focus is on itemList @@ -236,19 +237,6 @@ window.ZoteroDocumentCitations = { await this.refreshItemList(); }, - onSelectTab: async function (selectedIndex) { - if (selectedIndex === selectedTab) return; - selectedTab = selectedIndex; - if (selectedTab) { - this._highlightedCitations = new Set(); - document.querySelector('#button-show-in-zotero').hidden = true; - document.querySelector('#button-relink-item').hidden = false; - document.querySelector('#button-addTo-library').style.display = 'none'; - } - await this.refreshCitationList(); - await this.refreshItemList(); - }, - _initMappings: async function () { const itemMap = {}; itemRows = items.map((item) => { @@ -267,7 +255,7 @@ window.ZoteroDocumentCitations = { itemMap[item.id || item.cslItemID] = proxyItem; return proxyItem; }); - uncitedItemRows = uncitedItems.map((item) => { + itemRows.push(...uncitedItems.map((item) => { return new Proxy(item, { get(target, prop) { if (prop == 'citedIn') { @@ -276,7 +264,7 @@ window.ZoteroDocumentCitations = { return Reflect.get(...arguments); } }); - }); + })); citationRows = await Promise.all(citations .map(async (citation, citationIndex) => { let isLinked = true; @@ -420,6 +408,16 @@ window.ZoteroDocumentCitations = { await this.refreshCitationList(); await this.refreshItemList(); }, + + _itemFirstColumnPrependRenderer: function (index, data, firstColumnPrepend) { + if (itemRows[index].citedIn.length === 0) { + let span = document.createElement('span'); + span.classList.add('badge', 'badge-uncited'); + span.textContent = 'Uncited'; + firstColumnPrepend.push(span); + } + return firstColumnPrepend; + }, async addToLibraryAndLink() { var collectionID = _addToTarget.objectType == 'collection' ? _addToTarget.id : undefined; diff --git a/chrome/content/zotero/integration/citationExplorer.xhtml b/chrome/content/zotero/integration/citationExplorer.xhtml index d49f54810c..5f9d7d8db0 100644 --- a/chrome/content/zotero/integration/citationExplorer.xhtml +++ b/chrome/content/zotero/integration/citationExplorer.xhtml @@ -84,16 +84,7 @@ -