Enable "Add Note from Annotations" for EPUBs and snapshots

This commit is contained in:
Abe Jellinek 2023-07-05 14:45:11 -04:00 committed by Dan Stillman
parent db6ff88ad1
commit 6a4715c324
2 changed files with 11 additions and 2 deletions

View file

@ -2427,6 +2427,14 @@ Zotero.Item.prototype.isPDFAttachment = function () {
};
/**
* @return {Boolean} - Returns true if item is a stored or linked EPUB attachment
*/
Zotero.Item.prototype.isEPUBAttachment = function () {
return this.isFileAttachment() && this.attachmentContentType == 'application/epub+zip';
};
/**
* Returns number of child attachments of item
*

View file

@ -3990,8 +3990,9 @@ var ZoteroPane = new function()
function isAttachmentWithExtractableAnnotations(item) {
// For now, consider all PDF attachments eligible, since we want to extract external
// annotations in unprocessed files if present
//return item.isPDFAttachment() && item.getAnnotations().some(x => x.annotationType != 'ink');
return item.isPDFAttachment();
// item.isPDFAttachment() && item.getAnnotations().some(x => x.annotationType != 'ink');
return item.isPDFAttachment()
|| (item.isEPUBAttachment() || item.isSnapshotAttachment()) && item.getAnnotations().length;
}