mirror of
https://github.com/zotero/zotero.git
synced 2026-09-17 23:51:18 +00:00
Trigger annotation import only for PDF attachments when creating a note
Fixes https://forums.zotero.org/discussion/120181/batch-create-note-from-annotations-for-different-attachment-types
This commit is contained in:
parent
1c70e53006
commit
8317f77837
1 changed files with 17 additions and 11 deletions
|
|
@ -5659,7 +5659,9 @@ var ZoteroPane = new function()
|
|||
this.displayCannotEditLibraryMessage();
|
||||
return;
|
||||
}
|
||||
await Zotero.PDFWorker.import(attachment.id, true);
|
||||
if (attachment.isPDFAttachment()) {
|
||||
await Zotero.PDFWorker.import(attachment.id, true);
|
||||
}
|
||||
var annotations = attachment.getAnnotations().filter(x => x.annotationType != 'ink');
|
||||
if (!annotations.length) {
|
||||
return;
|
||||
|
|
@ -5727,11 +5729,13 @@ var ZoteroPane = new function()
|
|||
|
||||
var annotations = [];
|
||||
for (let attachment of attachments) {
|
||||
try {
|
||||
await Zotero.PDFWorker.import(attachment.id, true);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
if (attachment.isPDFAttachment()) {
|
||||
try {
|
||||
await Zotero.PDFWorker.import(attachment.id, true);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
}
|
||||
annotations.push(...attachment.getAnnotations().filter(x => x.annotationType != 'ink'));
|
||||
}
|
||||
|
|
@ -5823,11 +5827,13 @@ var ZoteroPane = new function()
|
|||
continue;
|
||||
}
|
||||
for (let attachment of attachments) {
|
||||
try {
|
||||
await Zotero.PDFWorker.import(attachment.id, true);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
if (attachment.isPDFAttachment()) {
|
||||
try {
|
||||
await Zotero.PDFWorker.import(attachment.id, true);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
}
|
||||
annotations.push(...attachment.getAnnotations().filter(x => x.annotationType != 'ink'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue