From 5d622b91f0b38808e20783571b30b73cfa101d2d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 22 Nov 2010 20:40:08 +0000 Subject: [PATCH] Bibliography HTML: move line-height to root div and disable some comments --- chrome/content/zotero/xpcom/cite.js | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index f419154d7..6e0a91a58 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -262,11 +262,11 @@ Zotero.Cite.makeFormattedBibliography = function(cslEngine, format) { return html; } - Zotero.debug("maxoffset: " + bib[0].maxoffset); - Zotero.debug("entryspacing: " + bib[0].entryspacing); - Zotero.debug("linespacing: " + bib[0].linespacing); - Zotero.debug("hangingindent: " + bib[0].hangingindent); - Zotero.debug("second-field-align: " + bib[0]["second-field-align"]); + //Zotero.debug("maxoffset: " + bib[0].maxoffset); + //Zotero.debug("entryspacing: " + bib[0].entryspacing); + //Zotero.debug("linespacing: " + bib[0].linespacing); + //Zotero.debug("hangingindent: " + bib[0].hangingindent); + //Zotero.debug("second-field-align: " + bib[0]["second-field-align"]); var maxOffset = parseInt(bib[0].maxoffset); var entrySpacing = parseInt(bib[0].entryspacing); @@ -290,7 +290,15 @@ Zotero.Cite.makeFormattedBibliography = function(cslEngine, format) { // TODO: second-field-align // div.csl-bib-body - xml.@style = "padding-top: 0.5em; padding-bottom: 0.5em;"; + //xml.@style = "padding-top: 0.5em; padding-bottom: 0.5em;"; + + if(lineSpacing) { + xml.@style += "line-height: " + lineSpacing + "; "; + } + + if(hangingIndent) { + xml.@style += "margin-left: " + hangingIndent + "em; text-indent: -" + hangingIndent + "em; "; + } // csl-entry var divs = xml..div.(@class == "csl-entry"); @@ -306,17 +314,9 @@ Zotero.Cite.makeFormattedBibliography = function(cslEngine, format) { } } - if(lineSpacing) { - div.@style += "line-height: " + lineSpacing + ";"; - } - i++; } - if(hangingIndent) { - xml.@style += "margin-left: " + hangingIndent + "em; text-indent: -" + hangingIndent + "em; "; - } - // Padding on the label column, which we need to include when // calculating offset of right column var rightPadding = .7; @@ -325,7 +325,7 @@ Zotero.Cite.makeFormattedBibliography = function(cslEngine, format) { // div.csl-left-margin for each(var div in xml..div.(@class == "csl-left-margin")) { - div.@style = "width: " + adjMaxOffset + "em; text-align: right; float: left; padding-right: " + rightPadding + "em;"; + div.@style = "float: left; width: " + adjMaxOffset + "em; text-align: right; padding-right: " + rightPadding + "em;"; } // div.csl-right-inline