Add support for text annotations
This commit is contained in:
parent
cb14034c46
commit
89adf56eed
3 changed files with 6 additions and 1 deletions
|
@ -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' });
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue