www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit c84a16984b80b0a7d44f1ad835f47eab86f1f36d
parent f6083068cd51bbcf2ec119b6fce615da3c9923c8
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date:   Tue, 12 May 2015 18:36:27 -0500

Map note excerpt to title in itemToCSLJSON
This way notes have some sort of user-friendly way of being traced from Word documents to Zotero items in the library

Diffstat:
Mchrome/content/zotero/xpcom/utilities.js | 5+++++
Mtest/tests/utilities.js | 1+
2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js @@ -1597,6 +1597,11 @@ Zotero.Utilities = { } } + // Special mapping for note title + if (zoteroItem.itemType == 'note' && zoteroItem.note) { + cslItem.title = Zotero.Notes.noteToTitle(zoteroItem.note); + } + // extract PMID var extra = zoteroItem.extra; if(typeof extra === "string") { diff --git a/test/tests/utilities.js b/test/tests/utilities.js @@ -207,6 +207,7 @@ describe("Zotero.Utilities", function() { let cslJSONNote = Zotero.Utilities.itemToCSLJSON(note); assert.equal(cslJSONNote.type, 'article', 'note is exported as "article"'); + assert.equal(cslJSONNote.title, note.getNoteTitle(), 'note title is set to Zotero pseudo-title'); }); it("should convert standalone attachments to expected format", function() { let file = getTestDataDirectory();