Remove isAuthor from JSON passed to PDF reader

This commit is contained in:
Dan Stillman 2022-02-08 04:15:51 -05:00
parent bf9ef5fc01
commit 60f9a0417f
2 changed files with 2 additions and 7 deletions

View file

@ -117,11 +117,11 @@ Zotero.Annotations = new function () {
o.key = item.key;
o.type = item.annotationType;
o.isExternal = item.annotationIsExternal;
o.isAuthor = !item.createdByUserID || item.createdByUserID == Zotero.Users.getCurrentUserID();
var isAuthor = !item.createdByUserID || item.createdByUserID == Zotero.Users.getCurrentUserID();
if (!o.isExternal && item.library.libraryType == 'group') {
o.authorName = Zotero.Users.getName(item.createdByUserID);
}
o.readOnly = o.isExternal || !o.isAuthor;
o.readOnly = o.isExternal || !isAuthor;
if (o.type == 'highlight') {
o.text = item.annotationText;
}

View file

@ -4,7 +4,6 @@ describe("Zotero.Annotations", function() {
"key": "92JLMCVT",
"type": "highlight",
"isExternal": false,
"isAuthor": true,
"readOnly": false,
"text": "This is an <b>extracted</b> text with rich-text\nAnd a new line",
"comment": "This is a comment with <i>rich-text</i>\nAnd a new line",
@ -39,7 +38,6 @@ describe("Zotero.Annotations", function() {
"key": "5TKU34XX",
"type": "note",
"isExternal": false,
"isAuthor": true,
"readOnly": false,
"comment": "This is a note",
"color": "#ffec00",
@ -60,7 +58,6 @@ describe("Zotero.Annotations", function() {
"key": "QD32MQJF",
"type": "image",
"isExternal": false,
"isAuthor": true,
"readOnly": false,
"image": "zotero://attachment/library/items/LB417FR4",
"comment": "This is a comment",
@ -84,7 +81,6 @@ describe("Zotero.Annotations", function() {
"key": "PE57YAYH",
"type": "highlight",
"isExternal": false,
"isAuthor": false,
"authorName": "Kate Smith",
"text": "This is an <b>extracted</b> text with rich-text\nAnd a new line",
"comment": "This is a comment with <i>rich-text</i>\nAnd a new line",
@ -254,7 +250,6 @@ describe("Zotero.Annotations", function() {
});
var json = await Zotero.Annotations.toJSON(annotation);
assert.isFalse(json.isAuthor);
assert.equal(json.authorName, 'First Last');
await annotation.eraseTx({