Save citation lists instead of multiple item citations
This commit is contained in:
parent
c8e9778311
commit
cdd637f3ec
|
@ -509,16 +509,9 @@ var Zotero_File_Interface = new function() {
|
|||
return;
|
||||
}
|
||||
else {
|
||||
if (io.mode == 'citation') {
|
||||
var csl = Zotero.Styles.get(format).csl;
|
||||
csl.updateItems([item.id for each(item in items)]);
|
||||
var citation = {citationItems:[{id:item.id} for each(item in items)], properties:{}};
|
||||
var bibliography = csl.previewCitationCluster(citation, [], [], "html");
|
||||
}
|
||||
else {
|
||||
var style = Zotero.Styles.get(io.style);
|
||||
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style, items, format);
|
||||
}
|
||||
var style = Zotero.Styles.get(io.style);
|
||||
var bibliography = Zotero.Cite.makeFormattedBibliographyOrCitationList(style,
|
||||
items, format, io.mode === "citation");
|
||||
}
|
||||
} catch(e) {
|
||||
window.alert(Zotero.getString("fileInterface.bibliographyGenerationError"));
|
||||
|
|
|
@ -191,14 +191,18 @@ Zotero.Cite.getBibliographyFormatParameters = function(bib) {
|
|||
* @param {Zotero.Style} style The style to use
|
||||
* @param {Zotero.Item[]} items An array of items
|
||||
* @param {String} format The format of the output
|
||||
* @param {Boolean} asCitationList Whether to return a list of formatted citations even if
|
||||
* the style defines a bibliography
|
||||
*/
|
||||
Zotero.Cite.makeFormattedBibliographyOrCitationList = function(style, items, format) {
|
||||
Zotero.Cite.makeFormattedBibliographyOrCitationList = function(style, items, format, asCitationList) {
|
||||
var cslEngine = style.csl;
|
||||
cslEngine.setOutputFormat(format);
|
||||
cslEngine.updateItems([item.id for each(item in items)]);
|
||||
|
||||
var bibliography = Zotero.Cite.makeFormattedBibliography(cslEngine, format);
|
||||
if(bibliography) return bibliography;
|
||||
if(!asCitationList) {
|
||||
var bibliography = Zotero.Cite.makeFormattedBibliography(cslEngine, format);
|
||||
if(bibliography) return bibliography;
|
||||
}
|
||||
|
||||
var styleClass = style.class;
|
||||
var citations = [cslEngine.appendCitationCluster({"citationItems":[{"id":item.id}], "properties":{}}, true)[0][1]
|
||||
|
|
Loading…
Reference in New Issue
Block a user