Remove isAuthor
from JSON passed to PDF reader
This commit is contained in:
parent
bf9ef5fc01
commit
60f9a0417f
2 changed files with 2 additions and 7 deletions
|
@ -117,11 +117,11 @@ Zotero.Annotations = new function () {
|
||||||
o.key = item.key;
|
o.key = item.key;
|
||||||
o.type = item.annotationType;
|
o.type = item.annotationType;
|
||||||
o.isExternal = item.annotationIsExternal;
|
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') {
|
if (!o.isExternal && item.library.libraryType == 'group') {
|
||||||
o.authorName = Zotero.Users.getName(item.createdByUserID);
|
o.authorName = Zotero.Users.getName(item.createdByUserID);
|
||||||
}
|
}
|
||||||
o.readOnly = o.isExternal || !o.isAuthor;
|
o.readOnly = o.isExternal || !isAuthor;
|
||||||
if (o.type == 'highlight') {
|
if (o.type == 'highlight') {
|
||||||
o.text = item.annotationText;
|
o.text = item.annotationText;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ describe("Zotero.Annotations", function() {
|
||||||
"key": "92JLMCVT",
|
"key": "92JLMCVT",
|
||||||
"type": "highlight",
|
"type": "highlight",
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"isAuthor": true,
|
|
||||||
"readOnly": false,
|
"readOnly": false,
|
||||||
"text": "This is an <b>extracted</b> text with rich-text\nAnd a new line",
|
"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",
|
"comment": "This is a comment with <i>rich-text</i>\nAnd a new line",
|
||||||
|
@ -39,7 +38,6 @@ describe("Zotero.Annotations", function() {
|
||||||
"key": "5TKU34XX",
|
"key": "5TKU34XX",
|
||||||
"type": "note",
|
"type": "note",
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"isAuthor": true,
|
|
||||||
"readOnly": false,
|
"readOnly": false,
|
||||||
"comment": "This is a note",
|
"comment": "This is a note",
|
||||||
"color": "#ffec00",
|
"color": "#ffec00",
|
||||||
|
@ -60,7 +58,6 @@ describe("Zotero.Annotations", function() {
|
||||||
"key": "QD32MQJF",
|
"key": "QD32MQJF",
|
||||||
"type": "image",
|
"type": "image",
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"isAuthor": true,
|
|
||||||
"readOnly": false,
|
"readOnly": false,
|
||||||
"image": "zotero://attachment/library/items/LB417FR4",
|
"image": "zotero://attachment/library/items/LB417FR4",
|
||||||
"comment": "This is a comment",
|
"comment": "This is a comment",
|
||||||
|
@ -84,7 +81,6 @@ describe("Zotero.Annotations", function() {
|
||||||
"key": "PE57YAYH",
|
"key": "PE57YAYH",
|
||||||
"type": "highlight",
|
"type": "highlight",
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"isAuthor": false,
|
|
||||||
"authorName": "Kate Smith",
|
"authorName": "Kate Smith",
|
||||||
"text": "This is an <b>extracted</b> text with rich-text\nAnd a new line",
|
"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",
|
"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);
|
var json = await Zotero.Annotations.toJSON(annotation);
|
||||||
|
|
||||||
assert.isFalse(json.isAuthor);
|
|
||||||
assert.equal(json.authorName, 'First Last');
|
assert.equal(json.authorName, 'First Last');
|
||||||
|
|
||||||
await annotation.eraseTx({
|
await annotation.eraseTx({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue