Rename/move some of the PDF retrieval functions

This commit is contained in:
Dan Stillman 2018-08-07 15:40:19 -04:00
parent b00704f54c
commit 8d8109dbac
4 changed files with 10 additions and 10 deletions

View file

@ -878,6 +878,13 @@ Zotero.Attachments = new function(){
};
this.canFindPDFForItem = function (item) {
return item.isRegularItem()
&& (!!item.getField('DOI') || !!item.getField('url'))
&& item.numPDFAttachments() == 0;
};
/**
* Look for an available PDF for an item and add it as an attachment
*

View file

@ -930,13 +930,6 @@ Zotero.Utilities.Internal = {
},
canFindPDFForItem: function (item) {
return item.isRegularItem()
&& (!!item.getField('DOI') || !!item.getField('url'))
&& item.numPDFAttachments() == 0;
},
/**
* Look for open-access PDFs for a given DOI using Zotero's Unpaywall mirror
*

View file

@ -3836,7 +3836,7 @@ var ZoteroPane = new function()
});
this.addPDFForSelectedItems = async function () {
this.findPDFForSelectedItems = async function () {
if (!this.canEdit()) {
this.displayCannotEditLibraryMessage();
return;
@ -3859,7 +3859,7 @@ var ZoteroPane = new function()
for (let i = 0; i < items.length; i++) {
let item = items[i];
if (Zotero.Utilities.Internal.canFindPDFForItem(item)) {
if (Zotero.Attachments.canFindPDFForItem(item)) {
let attachment = await Zotero.Attachments.addAvailablePDF(item);
if (attachment) {
successful++;

View file

@ -313,7 +313,7 @@
</menupopup>
</menu>
<menuseparator/>
<menuitem class="menuitem-iconic zotero-menuitem-find-pdf" oncommand="ZoteroPane.addPDFForSelectedItems()"/>
<menuitem class="menuitem-iconic zotero-menuitem-find-pdf" oncommand="ZoteroPane.findPDFForSelectedItems()"/>
<menuseparator/>
<menuitem class="menuitem-iconic zotero-menuitem-toggle-read-item" oncommand="ZoteroPane_Local.toggleSelectedItemsRead();"/>
<menuitem class="menuitem-iconic zotero-menuitem-duplicate-item" label="&zotero.items.menu.duplicateItem;" oncommand="ZoteroPane_Local.duplicateSelectedItem().done();"/>