www

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

commit c81931e65053670a0e8b0c66cc4bc84444fe4cc9
parent 4d5f50bf74e23e2ee798e27df367b7b86f81221c
Author: Simon Kornblith <simon@simonster.com>
Date:   Sat,  9 Apr 2011 16:27:36 +0000

closes #1812, Embed COinS in HTML bibliographies


Diffstat:
Mchrome/content/zotero/xpcom/cite.js | 20+++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js @@ -329,7 +329,25 @@ Zotero.Cite.makeFormattedBibliography = function(cslEngine, format) { if(!bib) return false; if(format == "html") { - var html = bib[0].bibstart+bib[1].join("")+bib[0].bibend; + var output = [bib[0].bibstart]; + for(var i in bib[1]) { + output.push(bib[1][i]); + + // add COinS + for each(var itemID in bib[0].entry_ids[i]) { + try { + var co = Zotero.OpenURL.createContextObject(Zotero.Items.get(itemID)); + if(!co) continue; + output.push(' <span class="Z3988" title="'+ + co.replace("&", "&amp;", "g").replace("<", "&lt;", "g").replace(">", "&gt;", "g")+ + '"/>\n'); + } catch(e) { + Zotero.logError(e); + } + } + } + output.push(bib[0].bibend); + var html = output.join(""); var inlineCSS = true; if (!inlineCSS) {