Zotero.Items: Support EPUB and snapshot annotations

This commit is contained in:
Abe Jellinek 2023-05-11 20:13:51 +03:00 committed by Dan Stillman
parent 681cdd809f
commit 3be3d8ebef

View file

@ -1914,8 +1914,8 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
if (!parentItem.isFileAttachment()) {
throw new Error("Annotation parent must be a file attachment");
}
if (parentItem.attachmentContentType != 'application/pdf') {
//throw new Error("Annotation parent must be a PDF");
if (!['application/pdf', 'application/epub+zip', 'text/html'].includes(parentItem.attachmentContentType)) {
throw new Error("Annotation parent must be a PDF, EPUB, or HTML snapshot");
}
let type = this._getLatestField('annotationType');
let typeID = Zotero.Annotations[`ANNOTATION_TYPE_${type.toUpperCase()}`];