Output full content of notes in bibliography-mode Quick Copy if only copying notes; otherwise, exclude notes from generated bibliography

This commit is contained in:
Dan Stillman 2008-06-03 18:27:44 +00:00
parent 50fe8f6b66
commit 8b8eb3a5c4

View File

@ -145,6 +145,45 @@ Zotero.QuickCopy = new function() {
return true;
}
else if (mode == 'bibliography') {
// Move notes to separate array
var allNotes = true;
var notes = [];
for (var i=0; i<items.length; i++) {
if (items[i].isNote()) {
notes.push(items.splice(i, 1)[0]);
i--;
}
else {
allNotes = false;
}
}
// If all notes, export full content
if (allNotes) {
var content = [];
for (var i=0; i<notes.length; i++) {
content.push(notes[i].getNote());
}
default xml namespace = '';
var html = <div/>;
var firstp = true;
for (var i=0; i<content.length; i++) {
var p = <p>{content[i]}</p>;
p.@style = 'white-space: pre-wrap';
html.p += p;
}
html = html.toXMLString();
var content = {
text: contentType == "html" ? html : content.join('\n\n'),
html: html
};
return content;
}
var csl = Zotero.Cite.getStyle(format);
var itemSet = csl.createItemSet(items);
var bibliography = {