Add support for text annotations

This commit is contained in:
Martynas Bagdonas 2023-06-20 13:57:49 +03:00 committed by Dan Stillman
parent cb14034c46
commit 89adf56eed
3 changed files with 6 additions and 1 deletions

View file

@ -33,6 +33,7 @@ Zotero.Annotations = new function () {
Zotero.defineProperty(this, 'ANNOTATION_TYPE_IMAGE', { value: 3 });
Zotero.defineProperty(this, 'ANNOTATION_TYPE_INK', { value: 4 });
Zotero.defineProperty(this, 'ANNOTATION_TYPE_UNDERLINE', { value: 5 });
Zotero.defineProperty(this, 'ANNOTATION_TYPE_TEXT', { value: 6 });
Zotero.defineProperty(this, 'DEFAULT_COLOR', { value: '#ffd400' });

View file

@ -3802,7 +3802,7 @@ for (let name of ['type', 'authorName', 'text', 'comment', 'color', 'pageLabel',
if (currentType && currentType != value) {
throw new Error("Cannot change annotation type");
}
if (!['highlight', 'underline', 'note', 'image', 'ink'].includes(value)) {
if (!['highlight', 'underline', 'note', 'text', 'image', 'ink'].includes(value)) {
let e = new Error(`Unknown annotation type '${value}'`);
e.name = "ZoteroInvalidDataError";
throw e;

View file

@ -532,6 +532,10 @@ Zotero.Items = function() {
case Zotero.Annotations.ANNOTATION_TYPE_NOTE:
type = 'note';
break;
case Zotero.Annotations.ANNOTATION_TYPE_TEXT:
type = 'text';
break;
case Zotero.Annotations.ANNOTATION_TYPE_IMAGE:
type = 'image';