diff --git a/client/galaxy/scripts/mvc/citation/citation-view.js b/client/galaxy/scripts/mvc/citation/citation-view.js index b7af5665fcb..5fb36002468 100644 --- a/client/galaxy/scripts/mvc/citation/citation-view.js +++ b/client/galaxy/scripts/mvc/citation/citation-view.js @@ -164,8 +164,8 @@ var CitationListView = Backbone.View.extend({ '
', '
', _l("Citations"), - ' ', - ' ', + ' ', + ' ', '
', '
', this.partialWarningElement(), diff --git a/static/scripts/mvc/citation/citation-view.js b/static/scripts/mvc/citation/citation-view.js index b7af5665fcb..5fb36002468 100644 --- a/static/scripts/mvc/citation/citation-view.js +++ b/static/scripts/mvc/citation/citation-view.js @@ -164,8 +164,8 @@ var CitationListView = Backbone.View.extend({ '
', '
', _l("Citations"), - ' ', - ' ', + ' ', + ' ', '
', '
', this.partialWarningElement(), diff --git a/static/scripts/packed/mvc/citation/citation-view.js b/static/scripts/packed/mvc/citation/citation-view.js index bbfda8e7ab0..18a71226d71 100644 --- a/static/scripts/packed/mvc/citation/citation-view.js +++ b/static/scripts/packed/mvc/citation/citation-view.js @@ -1 +1 @@ -define(["mvc/base-mvc","mvc/citation/citation-model","utils/localization"],function(a,d,c){var b=Backbone.View.extend({tagName:"div",className:"citations",render:function(){this.$el.append("

"+this.formattedReference()+"

");return this},formattedReference:function(){var k=this.model;var i=k.entryType();var l=k.fields();var g="";var o=this._asSentence((l.author?l.author:"")+(l.year?(" ("+l.year+")"):""))+" ";var n=l.title||"";var h=l.pages?("pp. "+l.pages):"";var p=l.address;if(i=="article"){var j=(l.volume?l.volume:"")+(l.number?(" ("+l.number+")"):"")+(h?", "+h:"");g=o+this._asSentence(n)+(l.journal?("In "+l.journal+", "):"")+this._asSentence(j)+this._asSentence(l.address)+""}else{if(i=="inproceedings"||i=="proceedings"){g=o+this._asSentence(n)+(l.booktitle?("In "+l.booktitle+", "):"")+(h?h:"")+(p?", "+p:"")+"."}else{if(i=="mastersthesis"||i=="phdthesis"){g=o+this._asSentence(n)+(l.howpublished?l.howpublished+". ":"")+(l.note?l.note+".":"")}else{if(i=="techreport"){g=o+this._asSentence(n)+this._asSentence(l.institution)+this._asSentence(l.number)+this._asSentence(l.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=o+" "+this._formatBookInfo(l)}else{g=o+" "+this._asSentence(n)+this._asSentence(l.howpublished)+this._asSentence(l.note)}}}}}var m="";if(l.doi){m="http://dx.doi.org/"+l.doi;g+='[doi:'+l.doi+"]"}var f=l.url||m;if(f){g+='[Link]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+=""+f.title+""}if(f.editor){g+=", Edited by "+f.editor+", "}if(f.publisher){g+=", "+f.publisher}if(f.pages){g+=", pp. "+f.pages+""}if(f.series){g+=", "+f.series+""}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return(f&&f.trim())?f+". ":""}});var e=Backbone.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(g){var f=new b({model:g});this.$(".citations-formatted").append(f.render().el);var h=this.$(".citations-bibtex-text");h.val(h.val()+"\n\r"+g.attributes.content)},render:function(){this.$el.html(this.citationsElement());this.collection.each(function(f){this.renderCitation(f)},this);this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show();this.$(".citations-to-bibtex").hide();this.$(".citations-bibtex").show();this.$(".citations-formatted").hide();this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide();this.$(".citations-to-bibtex").show();this.$(".citations-bibtex").hide();this.$(".citations-formatted").show()},partialWarningElement:function(){if(this.collection.partial){return['
',"Warning: This is a experimental feature. Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' cite Galaxy.',"
",].join("")}else{return""}},citationsElement:function(){return['
','
',c("Citations"),' ',' ',"
",'
',this.partialWarningElement(),'',"
",'
','',"
","
"].join("")}});return{CitationView:b,CitationListView:e}}); \ No newline at end of file +define(["mvc/base-mvc","mvc/citation/citation-model","utils/localization"],function(a,d,c){var b=Backbone.View.extend({tagName:"div",className:"citations",render:function(){this.$el.append("

"+this.formattedReference()+"

");return this},formattedReference:function(){var k=this.model;var i=k.entryType();var l=k.fields();var g="";var o=this._asSentence((l.author?l.author:"")+(l.year?(" ("+l.year+")"):""))+" ";var n=l.title||"";var h=l.pages?("pp. "+l.pages):"";var p=l.address;if(i=="article"){var j=(l.volume?l.volume:"")+(l.number?(" ("+l.number+")"):"")+(h?", "+h:"");g=o+this._asSentence(n)+(l.journal?("In "+l.journal+", "):"")+this._asSentence(j)+this._asSentence(l.address)+""}else{if(i=="inproceedings"||i=="proceedings"){g=o+this._asSentence(n)+(l.booktitle?("In "+l.booktitle+", "):"")+(h?h:"")+(p?", "+p:"")+"."}else{if(i=="mastersthesis"||i=="phdthesis"){g=o+this._asSentence(n)+(l.howpublished?l.howpublished+". ":"")+(l.note?l.note+".":"")}else{if(i=="techreport"){g=o+this._asSentence(n)+this._asSentence(l.institution)+this._asSentence(l.number)+this._asSentence(l.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=o+" "+this._formatBookInfo(l)}else{g=o+" "+this._asSentence(n)+this._asSentence(l.howpublished)+this._asSentence(l.note)}}}}}var m="";if(l.doi){m="http://dx.doi.org/"+l.doi;g+='[doi:'+l.doi+"]"}var f=l.url||m;if(f){g+='[Link]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+=""+f.title+""}if(f.editor){g+=", Edited by "+f.editor+", "}if(f.publisher){g+=", "+f.publisher}if(f.pages){g+=", pp. "+f.pages+""}if(f.series){g+=", "+f.series+""}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return(f&&f.trim())?f+". ":""}});var e=Backbone.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(g){var f=new b({model:g});this.$(".citations-formatted").append(f.render().el);var h=this.$(".citations-bibtex-text");h.val(h.val()+"\n\r"+g.attributes.content)},render:function(){this.$el.html(this.citationsElement());this.collection.each(function(f){this.renderCitation(f)},this);this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show();this.$(".citations-to-bibtex").hide();this.$(".citations-bibtex").show();this.$(".citations-formatted").hide();this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide();this.$(".citations-to-bibtex").show();this.$(".citations-bibtex").hide();this.$(".citations-formatted").show()},partialWarningElement:function(){if(this.collection.partial){return['
',"Warning: This is a experimental feature. Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' cite Galaxy.',"
",].join("")}else{return""}},citationsElement:function(){return['
','
',c("Citations"),' ',' ',"
",'
',this.partialWarningElement(),'',"
",'
','',"
","
"].join("")}});return{CitationView:b,CitationListView:e}}); \ No newline at end of file