From a7f59b24bef57ca7300787db994598bf75ee3bbc Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 25 Sep 2014 13:49:04 -0400 Subject: [PATCH] Fix various BibTex styling problems. Need to get out of the BibTeX formatting game as quickly as possible this is a loosing battle, but until then plugging holes in the ship. --- client/galaxy/scripts/libs/bibtex.js | 1 + client/galaxy/scripts/mvc/citation/citation-view.js | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/galaxy/scripts/libs/bibtex.js b/client/galaxy/scripts/libs/bibtex.js index 46e97925e93..fdaaf03e3d6 100644 --- a/client/galaxy/scripts/libs/bibtex.js +++ b/client/galaxy/scripts/libs/bibtex.js @@ -93,6 +93,7 @@ function BibtexParser(arg0) { 'booklet' : 14, 'masterthesis' : 15, 'conference' : 16 + ,'online' : 998 // Galaxy MOD: Handle @online entries for preprints. ,'data' : 999 // Galaxy MOD: Handle @data citations coming from figshare. } /** @private */ this.MACROS_ = { diff --git a/client/galaxy/scripts/mvc/citation/citation-view.js b/client/galaxy/scripts/mvc/citation/citation-view.js index 93cf52885e9..6a68fe25842 100644 --- a/client/galaxy/scripts/mvc/citation/citation-view.js +++ b/client/galaxy/scripts/mvc/citation/citation-view.js @@ -24,11 +24,12 @@ var CitationView = Backbone.View.extend({ var pages = fields.pages ? ("pp. " + fields.pages) : ""; var address = fields.address; if( entryType == "article" ) { + var volume = (fields.volume ? fields.volume : "") + + (fields.number ? ( " (" + fields.number + ")" ) : "") + + (pages ? ", " + pages : ""); ref = authorsAndYear + this._asSentence(title) + (fields.journal ? ("In " + fields.journal + ", ") : "") + - (fields.volume ? fields.volume : "") + - (fields.number ? ( "(" + fields.number + "), " ) : ", " ) + - this._asSentence(pages) + + this._asSentence(volume) + this._asSentence(fields.address) + "<\/em>"; } else if( entryType == "inproceedings" || entryType == "proceedings" ) { @@ -43,14 +44,14 @@ var CitationView = Backbone.View.extend({ (fields.howpublished ? fields.howpublished + ". " : "") + (fields.note ? fields.note + "." : ""); } else if( entryType == "techreport" ) { - ref = authorsAndYear + ". " + this._asSentence(title) + + ref = authorsAndYear + this._asSentence(title) + this._asSentence(fields.institution) + this._asSentence(fields.number) + this._asSentence(fields.type); } else if( entryType == "book" || entryType == "inbook" || entryType == "incollection" ) { - ref = this._asSentence(authorsAndYear) + " " + this._formatBookInfo(fields); + ref = authorsAndYear + " " + this._formatBookInfo(fields); } else { - ref = this._asSentence(authorsAndYear) + " " + this._asSentence(title) + + ref = authorsAndYear + " " + this._asSentence(title) + this._asSentence(fields.howpublished) + this._asSentence(fields.note); }