3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/fc4f6db48ad3/ Changeset: fc4f6db48ad3 Branch: next-stable User: jmchilton Date: 2014-08-06 15:36:30 Summary: Fix-up citation related GUI. Was displaying warning message about history citations being potentially incomplete for tools - which if they have annotated citations we should assume they are complete. Affected #: 2 files diff -r 96abe113c582eed53fcf143bd516ad9cf5152c26 -r fc4f6db48ad35bf970eab651e7a52edd18d66378 static/scripts/mvc/citation/citation-model.js --- a/static/scripts/mvc/citation/citation-model.js +++ b/static/scripts/mvc/citation/citation-model.js @@ -37,7 +37,8 @@ var BaseCitationCollection = Backbone.Collection.extend( baseMVC.LoggableMixin ).extend( { /** root api url */ urlRoot : galaxy_config.root + 'api', - model : Citation + partial : true, // Assume some tools in history/workflow may not be properly annotated yet. + model : Citation, } ); var HistoryCitationCollection = BaseCitationCollection.extend( { @@ -51,7 +52,8 @@ /** complete api url */ url : function() { return this.urlRoot + '/tools/' + this.tool_id + '/citations'; - } + }, + partial : false, // If a tool has citations, assume they are complete. } ); //============================================================================== diff -r 96abe113c582eed53fcf143bd516ad9cf5152c26 -r fc4f6db48ad35bf970eab651e7a52edd18d66378 static/scripts/mvc/citation/citation-view.js --- a/static/scripts/mvc/citation/citation-view.js +++ b/static/scripts/mvc/citation/citation-view.js @@ -120,7 +120,7 @@ }, render: function() { - this.$el.html(this.citationsElement); + this.$el.html(this.citationsElement()); this.collection.each(function( item ){ this.renderCitation( item ); }, this); @@ -142,29 +142,40 @@ this.$(".citations-formatted").show(); }, - citationsElement: [ - '<div class="toolForm">', - '<div class="toolFormTitle">', - _l("Citations"), - ' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>', - ' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>', - '</div>', - '<div class="toolFormBody" style="padding:5px 10px">', - '<div style="padding:5px 10px">', - '<b>Warning: This is a experimental feature.</b> 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', - ' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.', - '</div>', - '<span class="citations-formatted"></span>', - '</div>', - '<div class="citations-bibtex toolFormBody" style="padding:5px 10px">', - '<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>', - '</div>', - '</div>' - ].join( '' ) + partialWarningElement: function() { + if( this.collection.partial ) { + return [ + '<div style="padding:5px 10px">', + '<b>Warning: This is a experimental feature.</b> 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', + ' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.', + '</div>', + ].join(''); + } else { + return ''; + } + }, + citationsElement: function() { + return [ + '<div class="toolForm">', + '<div class="toolFormTitle">', + _l("Citations"), + ' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>', + ' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>', + '</div>', + '<div class="toolFormBody" style="padding:5px 10px">', + this.partialWarningElement(), + '<span class="citations-formatted"></span>', + '</div>', + '<div class="citations-bibtex toolFormBody" style="padding:5px 10px">', + '<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>', + '</div>', + '</div>' + ].join( '' ); + } }); //============================================================================== https://bitbucket.org/galaxy/galaxy-central/commits/8a80483f4a57/ Changeset: 8a80483f4a57 Branch: next-stable User: jmchilton Date: 2014-08-06 15:37:08 Summary: Pack scripts. Affected #: 2 files diff -r fc4f6db48ad35bf970eab651e7a52edd18d66378 -r 8a80483f4a571ea66c0c397bcc367b2e8e4d52df static/scripts/packed/mvc/citation/citation-model.js --- a/static/scripts/packed/mvc/citation/citation-model.js +++ b/static/scripts/packed/mvc/citation/citation-model.js @@ -1,1 +1,1 @@ -define(["mvc/base-mvc","utils/localization"],function(a,e){var f=Backbone.Model.extend(a.LoggableMixin).extend({initialize:function(){var g=this.attributes.content;var h=new BibtexParser(g).entries[0];this.entry=h},entryType:function(){return this.entry.EntryType},fields:function(){return this.entry.Fields}});var b=Backbone.Collection.extend(a.LoggableMixin).extend({urlRoot:galaxy_config.root+"api",model:f});var d=b.extend({url:function(){return this.urlRoot+"/histories/"+this.history_id+"/citations"}});var c=b.extend({url:function(){return this.urlRoot+"/tools/"+this.tool_id+"/citations"}});return{Citation:f,HistoryCitationCollection:d,ToolCitationCollection:c}}); \ No newline at end of file +define(["mvc/base-mvc","utils/localization"],function(a,e){var f=Backbone.Model.extend(a.LoggableMixin).extend({initialize:function(){var g=this.attributes.content;var h=new BibtexParser(g).entries[0];this.entry=h},entryType:function(){return this.entry.EntryType},fields:function(){return this.entry.Fields}});var b=Backbone.Collection.extend(a.LoggableMixin).extend({urlRoot:galaxy_config.root+"api",partial:true,model:f,});var d=b.extend({url:function(){return this.urlRoot+"/histories/"+this.history_id+"/citations"}});var c=b.extend({url:function(){return this.urlRoot+"/tools/"+this.tool_id+"/citations"},partial:false,});return{Citation:f,HistoryCitationCollection:d,ToolCitationCollection:c}}); \ No newline at end of file diff -r fc4f6db48ad35bf970eab651e7a52edd18d66378 -r 8a80483f4a571ea66c0c397bcc367b2e8e4d52df static/scripts/packed/mvc/citation/citation-view.js --- a/static/scripts/packed/mvc/citation/citation-view.js +++ b/static/scripts/packed/mvc/citation/citation-view.js @@ -1,1 +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("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var j=this.model;var i=j.entryType();var k=j.fields();var g="";var n=this._asSentence((k.author?k.author:"")+(k.year?(" ("+k.year+")"):""))+" ";var m=k.title||"";var h=k.pages?("pp. "+k.pages):"";var o=k.address;if(i=="article"){g=n+this._asSentence(m)+(k.journal?("In <em>"+k.journal+", "):"")+(k.volume?k.volume:"")+(k.number?("("+k.number+"), "):", ")+this._asSentence(h)+this._asSentence(k.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=n+this._asSentence(m)+(k.booktitle?("In <em>"+k.booktitle+", "):"")+(h?h:"")+(o?", "+o:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=n+this._asSentence(m)+(k.howpublished?k.howpublished+". ":"")+(k.note?k.note+".":"")}else{if(i=="techreport"){g=n+". "+this._asSentence(m)+this._asSentence(k.institution)+this._asSentence(k.number)+this._asSentence(k.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=this._asSentence(n)+" "+this._formatBookInfo(k)}else{g=this._asSentence(n)+" "+this._asSentence(m)+this._asSentence(k.howpublished)+this._asSentence(k.note)}}}}}var l="";if(k.DOI){l="http://dx.doi.org/"+k.DOI;g+='[<a href="'+l+'">doi:'+k.DOI+"</a>]"}var f=k.url||l;if(f){g+='[<a href="'+f+'">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}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+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return f?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()},citationsElement:['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">','<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> 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",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].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("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var j=this.model;var i=j.entryType();var k=j.fields();var g="";var n=this._asSentence((k.author?k.author:"")+(k.year?(" ("+k.year+")"):""))+" ";var m=k.title||"";var h=k.pages?("pp. "+k.pages):"";var o=k.address;if(i=="article"){g=n+this._asSentence(m)+(k.journal?("In <em>"+k.journal+", "):"")+(k.volume?k.volume:"")+(k.number?("("+k.number+"), "):", ")+this._asSentence(h)+this._asSentence(k.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=n+this._asSentence(m)+(k.booktitle?("In <em>"+k.booktitle+", "):"")+(h?h:"")+(o?", "+o:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=n+this._asSentence(m)+(k.howpublished?k.howpublished+". ":"")+(k.note?k.note+".":"")}else{if(i=="techreport"){g=n+". "+this._asSentence(m)+this._asSentence(k.institution)+this._asSentence(k.number)+this._asSentence(k.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=this._asSentence(n)+" "+this._formatBookInfo(k)}else{g=this._asSentence(n)+" "+this._asSentence(m)+this._asSentence(k.howpublished)+this._asSentence(k.note)}}}}}var l="";if(k.DOI){l="http://dx.doi.org/"+k.DOI;g+='[<a href="'+l+'">doi:'+k.DOI+"</a>]"}var f=k.url||l;if(f){g+='[<a href="'+f+'">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}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+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return f?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['<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> 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",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",].join("")}else{return""}},citationsElement:function(){return['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">',this.partialWarningElement(),'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].join("")}});return{CitationView:b,CitationListView:e}}); \ No newline at end of file https://bitbucket.org/galaxy/galaxy-central/commits/853b09d9ed46/ Changeset: 853b09d9ed46 User: jmchilton Date: 2014-08-06 15:37:23 Summary: Merge next-stable. Affected #: 4 files diff -r 33c032a19f9af4549a5dfa7a55df7883117b4ea8 -r 853b09d9ed468ea36b57f6ccb009d9134a403889 static/scripts/mvc/citation/citation-model.js --- a/static/scripts/mvc/citation/citation-model.js +++ b/static/scripts/mvc/citation/citation-model.js @@ -37,7 +37,8 @@ var BaseCitationCollection = Backbone.Collection.extend( baseMVC.LoggableMixin ).extend( { /** root api url */ urlRoot : galaxy_config.root + 'api', - model : Citation + partial : true, // Assume some tools in history/workflow may not be properly annotated yet. + model : Citation, } ); var HistoryCitationCollection = BaseCitationCollection.extend( { @@ -51,7 +52,8 @@ /** complete api url */ url : function() { return this.urlRoot + '/tools/' + this.tool_id + '/citations'; - } + }, + partial : false, // If a tool has citations, assume they are complete. } ); //============================================================================== diff -r 33c032a19f9af4549a5dfa7a55df7883117b4ea8 -r 853b09d9ed468ea36b57f6ccb009d9134a403889 static/scripts/mvc/citation/citation-view.js --- a/static/scripts/mvc/citation/citation-view.js +++ b/static/scripts/mvc/citation/citation-view.js @@ -120,7 +120,7 @@ }, render: function() { - this.$el.html(this.citationsElement); + this.$el.html(this.citationsElement()); this.collection.each(function( item ){ this.renderCitation( item ); }, this); @@ -142,29 +142,40 @@ this.$(".citations-formatted").show(); }, - citationsElement: [ - '<div class="toolForm">', - '<div class="toolFormTitle">', - _l("Citations"), - ' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>', - ' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>', - '</div>', - '<div class="toolFormBody" style="padding:5px 10px">', - '<div style="padding:5px 10px">', - '<b>Warning: This is a experimental feature.</b> 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', - ' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.', - '</div>', - '<span class="citations-formatted"></span>', - '</div>', - '<div class="citations-bibtex toolFormBody" style="padding:5px 10px">', - '<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>', - '</div>', - '</div>' - ].join( '' ) + partialWarningElement: function() { + if( this.collection.partial ) { + return [ + '<div style="padding:5px 10px">', + '<b>Warning: This is a experimental feature.</b> 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', + ' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.', + '</div>', + ].join(''); + } else { + return ''; + } + }, + citationsElement: function() { + return [ + '<div class="toolForm">', + '<div class="toolFormTitle">', + _l("Citations"), + ' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>', + ' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>', + '</div>', + '<div class="toolFormBody" style="padding:5px 10px">', + this.partialWarningElement(), + '<span class="citations-formatted"></span>', + '</div>', + '<div class="citations-bibtex toolFormBody" style="padding:5px 10px">', + '<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>', + '</div>', + '</div>' + ].join( '' ); + } }); //============================================================================== diff -r 33c032a19f9af4549a5dfa7a55df7883117b4ea8 -r 853b09d9ed468ea36b57f6ccb009d9134a403889 static/scripts/packed/mvc/citation/citation-model.js --- a/static/scripts/packed/mvc/citation/citation-model.js +++ b/static/scripts/packed/mvc/citation/citation-model.js @@ -1,1 +1,1 @@ -define(["mvc/base-mvc","utils/localization"],function(a,e){var f=Backbone.Model.extend(a.LoggableMixin).extend({initialize:function(){var g=this.attributes.content;var h=new BibtexParser(g).entries[0];this.entry=h},entryType:function(){return this.entry.EntryType},fields:function(){return this.entry.Fields}});var b=Backbone.Collection.extend(a.LoggableMixin).extend({urlRoot:galaxy_config.root+"api",model:f});var d=b.extend({url:function(){return this.urlRoot+"/histories/"+this.history_id+"/citations"}});var c=b.extend({url:function(){return this.urlRoot+"/tools/"+this.tool_id+"/citations"}});return{Citation:f,HistoryCitationCollection:d,ToolCitationCollection:c}}); \ No newline at end of file +define(["mvc/base-mvc","utils/localization"],function(a,e){var f=Backbone.Model.extend(a.LoggableMixin).extend({initialize:function(){var g=this.attributes.content;var h=new BibtexParser(g).entries[0];this.entry=h},entryType:function(){return this.entry.EntryType},fields:function(){return this.entry.Fields}});var b=Backbone.Collection.extend(a.LoggableMixin).extend({urlRoot:galaxy_config.root+"api",partial:true,model:f,});var d=b.extend({url:function(){return this.urlRoot+"/histories/"+this.history_id+"/citations"}});var c=b.extend({url:function(){return this.urlRoot+"/tools/"+this.tool_id+"/citations"},partial:false,});return{Citation:f,HistoryCitationCollection:d,ToolCitationCollection:c}}); \ No newline at end of file diff -r 33c032a19f9af4549a5dfa7a55df7883117b4ea8 -r 853b09d9ed468ea36b57f6ccb009d9134a403889 static/scripts/packed/mvc/citation/citation-view.js --- a/static/scripts/packed/mvc/citation/citation-view.js +++ b/static/scripts/packed/mvc/citation/citation-view.js @@ -1,1 +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("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var j=this.model;var i=j.entryType();var k=j.fields();var g="";var n=this._asSentence((k.author?k.author:"")+(k.year?(" ("+k.year+")"):""))+" ";var m=k.title||"";var h=k.pages?("pp. "+k.pages):"";var o=k.address;if(i=="article"){g=n+this._asSentence(m)+(k.journal?("In <em>"+k.journal+", "):"")+(k.volume?k.volume:"")+(k.number?("("+k.number+"), "):", ")+this._asSentence(h)+this._asSentence(k.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=n+this._asSentence(m)+(k.booktitle?("In <em>"+k.booktitle+", "):"")+(h?h:"")+(o?", "+o:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=n+this._asSentence(m)+(k.howpublished?k.howpublished+". ":"")+(k.note?k.note+".":"")}else{if(i=="techreport"){g=n+". "+this._asSentence(m)+this._asSentence(k.institution)+this._asSentence(k.number)+this._asSentence(k.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=this._asSentence(n)+" "+this._formatBookInfo(k)}else{g=this._asSentence(n)+" "+this._asSentence(m)+this._asSentence(k.howpublished)+this._asSentence(k.note)}}}}}var l="";if(k.DOI){l="http://dx.doi.org/"+k.DOI;g+='[<a href="'+l+'">doi:'+k.DOI+"</a>]"}var f=k.url||l;if(f){g+='[<a href="'+f+'">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}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+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return f?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()},citationsElement:['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">','<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> 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",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].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("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var j=this.model;var i=j.entryType();var k=j.fields();var g="";var n=this._asSentence((k.author?k.author:"")+(k.year?(" ("+k.year+")"):""))+" ";var m=k.title||"";var h=k.pages?("pp. "+k.pages):"";var o=k.address;if(i=="article"){g=n+this._asSentence(m)+(k.journal?("In <em>"+k.journal+", "):"")+(k.volume?k.volume:"")+(k.number?("("+k.number+"), "):", ")+this._asSentence(h)+this._asSentence(k.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=n+this._asSentence(m)+(k.booktitle?("In <em>"+k.booktitle+", "):"")+(h?h:"")+(o?", "+o:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=n+this._asSentence(m)+(k.howpublished?k.howpublished+". ":"")+(k.note?k.note+".":"")}else{if(i=="techreport"){g=n+". "+this._asSentence(m)+this._asSentence(k.institution)+this._asSentence(k.number)+this._asSentence(k.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=this._asSentence(n)+" "+this._formatBookInfo(k)}else{g=this._asSentence(n)+" "+this._asSentence(m)+this._asSentence(k.howpublished)+this._asSentence(k.note)}}}}}var l="";if(k.DOI){l="http://dx.doi.org/"+k.DOI;g+='[<a href="'+l+'">doi:'+k.DOI+"</a>]"}var f=k.url||l;if(f){g+='[<a href="'+f+'">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}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+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return f?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['<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> 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",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",].join("")}else{return""}},citationsElement:function(){return['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">',this.partialWarningElement(),'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].join("")}});return{CitationView:b,CitationListView:e}}); \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.