mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-31 02:28:09 +08:00
Add help section content
This commit is contained in:
@@ -163,9 +163,49 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/form/form-view', 'mvc/ui/ui-tabl
|
||||
},
|
||||
|
||||
_renderHelp: function( len_type ) {
|
||||
window.console.log( len_type);
|
||||
this.$help.empty().addClass( 'infomessagesmall' ).html( 'hallo' );
|
||||
this.$help.empty()
|
||||
.addClass( 'alert alert-info' )
|
||||
.html( len_type == 'fasta' ? this._templateFasta() : this._templateLen() );
|
||||
},
|
||||
|
||||
_templateLen: function() {
|
||||
return '<h4>Length Format</h4>' +
|
||||
'<p>' +
|
||||
'The length format is two-column, separated by whitespace, of the form:' +
|
||||
'<pre>chrom/contig length of chrom/contig</pre>' +
|
||||
'</p>' +
|
||||
'<p>' +
|
||||
'For example, the first few entries of <em>mm9.len</em> are as follows:' +
|
||||
'<pre>' +
|
||||
'chr1 197195432\n' +
|
||||
'chr2 181748087\n' +
|
||||
'chr3 159599783\n' +
|
||||
'chr4 155630120\n' +
|
||||
'chr5 152537259' +
|
||||
'</pre>' +
|
||||
'</p>' +
|
||||
'<p>Trackster uses this information to populate the select box for chrom/contig, and' +
|
||||
'to set the maximum basepair of the track browser. You may either upload a .len file' +
|
||||
'of this format (Len File option), or directly enter the information into the box ' +
|
||||
'(Len Entry option).</p>';
|
||||
},
|
||||
|
||||
_templateFasta: function() {
|
||||
return '<h4>FASTA format</h4>' +
|
||||
'<p>' +
|
||||
'This is a multi-fasta file from your current history that provides the genome' +
|
||||
'sequences for each chromosome/contig in your build.' +
|
||||
'</p>' +
|
||||
'<p>' +
|
||||
'Here is a snippet from an example multi-fasta file:' +
|
||||
'<pre>' +
|
||||
'>chr1\n' +
|
||||
'ATTATATATAAGACCACAGAGAGAATATTTTGCCCGG...\n\n' +
|
||||
'>chr2\n' +
|
||||
'GGCGGCCGCGGCGATATAGAACTACTCATTATATATA...\n\n' +
|
||||
'...' +
|
||||
'</pre>' +
|
||||
'</p>';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"user-custom-builds.js","sources":["../../../src/mvc/user/user-custom-builds.js"],"names":["define","Utils","Ui","Form","Table","Collection","Backbone","extend","comparator","a","b","get","View","initialize","self","this","model","Model","url","Galaxy","root","user","id","collection","message","Message","installed_builds","Select","optional","onchange","value","empty_text","error_text","table","cls","selectable","addHeader","appendHeader","setElement","$","append","text","$el","addClass","$form","css","width","float","$help","listenTo","_renderTable","_renderForm","fetch","render","delAll","sort","each","add","undefined","ButtonIcon","icon","tooltip","onclick","destroy","initial_type","form","inputs","type","name","label","help","test_param","data","cases","area","buttons","save","Button","title","floating","create","wait","success","response","update","status","error","err","responseJSON","err_msg","input_id","match","input_field","field_list","_renderHelp","empty","len_type","window","console","log","html"],"mappings":"AACAA,QAAU,cAAe,iBAAkB,qBAAsB,mBAAqB,SAAUC,EAAOC,EAAIC,EAAMC,GAC7G,GAAIC,GAAaC,SAASD,WAAWE,QACjCC,WAAY,SAAUC,EAAGC,GAGrB,MAFAD,GAAIA,EAAEE,IAAK,QACXD,EAAIA,EAAEC,IAAK,QACJF,EAAIC,EAAK,EAAQA,EAAJD,EAAQ,GAAK,KAIrCG,EAAON,SAASM,KAAKL,QACrBM,WAAY,WACR,GAAIC,GAAOC,IACXA,MAAKC,MAAQ,GAAIV,UAASW,MAC1BF,KAAKC,MAAME,IAAMC,OAAOC,KAAO,aAAeD,OAAOE,KAAKC,GAAK,0BAC/DP,KAAKQ,WAAa,GAAIlB,GACtBU,KAAKQ,WAAWL,IAAMC,OAAOC,KAAO,aAAeD,OAAOE,KAAKC,GAAK,iBACpEP,KAAKS,QAAU,GAAItB,GAAGuB,YACtBV,KAAKW,iBAAmB,GAAIxB,GAAGyB,OAAOf,MAClCgB,UAAc,EACdC,SAAc,WAAaf,EAAKY,iBAAiBI,MAAO,OACxDC,WAAc,4BACdC,WAAc,0CAElBjB,KAAKkB,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W,iCAAkC6D,OAAQ,cAb7FvE,EAAKU,QAAQ4D,QAAU5D,QAAS,2BAA4B6D,OAAQ,eAoBpFxD,SAAU,WACN,GAAI6D,GAAWzB,EAAKO,KAAKmB,MAAO,WAChC,IAAKD,EAAW,CACZ,GAAIE,GAAc3B,EAAK4B,WAAYH,EACnC5E,GAAKgF,YAAaF,EAAY9D,YAI1Cf,MAAK6B,MAAMmD,QAAQvD,OAAQyB,EAAKvB,KAChC3B,KAAKW,iBAAiB0D,OAAQrE,KAAKC,MAAML,IAAK,qBAC9CI,KAAK+E,YAAa9B,IAGtB8B,YAAa,SAAUE,GACnBC,OAAOC,QAAQC,IAAKH,GACpBjF,KAAKiC,MAAM+C,QAAQpD,SAAU,oBAAqByD,KAAM,WAKhE,QACIxF,KAAMA"}
|
||||
{"version":3,"file":"user-custom-builds.js","sources":["../../../src/mvc/user/user-custom-builds.js"],"names":["define","Utils","Ui","Form","Table","Collection","Backbone","extend","comparator","a","b","get","View","initialize","self","this","model","Model","url","Galaxy","root","user","id","collection","message","Message","installed_builds","Select","optional","onchange","value","empty_text","error_text","table","cls","selectable","addHeader","appendHeader","setElement","$","append","text","$el","addClass","$form","css","width","float","$help","listenTo","_renderTable","_renderForm","fetch","render","delAll","sort","each","add","undefined","ButtonIcon","icon","tooltip","onclick","destroy","initial_type","form","inputs","type","name","label","help","test_param","data","cases","area","buttons","save","Button","title","floating","create","wait","success","response","update","status","error","err","responseJSON","err_msg","input_id","match","input_field","field_list","_renderHelp","empty","len_type","html","_templateFasta","_templateLen"],"mappings":"AACAA,QAAU,cAAe,iBAAkB,qBAAsB,mBAAqB,SAAUC,EAAOC,EAAIC,EAAMC,GAC7G,GAAIC,GAAaC,SAASD,WAAWE,QACjCC,WAAY,SAAUC,EAAGC,GAGrB,MAFAD,GAAIA,EAAEE,IAAK,QACXD,EAAIA,EAAEC,IAAK,QACJF,EAAIC,EAAK,EAAQA,EAAJD,EAAQ,GAAK,KAIrCG,EAAON,SAASM,KAAKL,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5C,IAAW,4BACX6C,SAAW,QACXjB,QAAW,WACP,GAAIU,GAAOP,EAAKO,KAAKQ,QACfR,GAAKlD,IAAOkD,EAAKJ,KAGnBtD,EAAKS,WAAWyD,OAAQR,GACpBS,MAAU,EACVC,QAAU,SAAUC,GAEZrE,EAAKU,QAAQ4D,OADZD,EAASxE,IAAK,YACQa,QAAS2D,EAASxE,IAAK,WAAa0E,OAAQ,YAE5C7D,QAAS,yCAA0C6D,OAAQ,aAG1FC,MAAU,SAAUH,EAAUI,GAC1B,GAAI/D,GAAU+D,GAAOA,EAAIC,cAAgBD,EAAIC,aAAaC,OAC1D3E,GAAKU,QAAQ4D,QAAU5D,QAASA,GAAW,iCAAkC6D,OAAQ,cAb7FvE,EAAKU,QAAQ4D,QAAU5D,QAAS,2BAA4B6D,OAAQ,eAoBpFxD,SAAU,WACN,GAAI6D,GAAWzB,EAAKO,KAAKmB,MAAO,WAChC,IAAKD,EAAW,CACZ,GAAIE,GAAc3B,EAAK4B,WAAYH,EACnC5E,GAAKgF,YAAaF,EAAY9D,YAI1Cf,MAAK6B,MAAMmD,QAAQvD,OAAQyB,EAAKvB,KAChC3B,KAAKW,iBAAiB0D,OAAQrE,KAAKC,MAAML,IAAK,qBAC9CI,KAAK+E,YAAa9B,IAGtB8B,YAAa,SAAUE,GACnBjF,KAAKiC,MAAM+C,QACApD,SAAU,oBACVsD,KAAkB,SAAZD,EAAsBjF,KAAKmF,iBAAmBnF,KAAKoF,iBAGxEA,aAAc,WACV,MAAQ,0lBAqBZD,eAAgB,WACZ,MAAQ,+UAkBhB,QACItF,KAAMA"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-view","mvc/ui/ui-table"],function(a,b,c,d){var e=Backbone.Collection.extend({comparator:function(a,b){return a=a.get("name"),b=b.get("name"),a>b?1:b>a?-1:0}}),f=Backbone.View.extend({initialize:function(){var a=this;this.model=new Backbone.Model,this.model.url=Galaxy.root+"api/users/"+Galaxy.user.id+"/custom_builds_metadata",this.collection=new e,this.collection.url=Galaxy.root+"api/users/"+Galaxy.user.id+"/custom_builds",this.message=new b.Message({}),this.installed_builds=new b.Select.View({optional:!0,onchange:function(){a.installed_builds.value(null)},empty_text:"List of available builds:",error_text:"No system installed builds available."}),this.table=new d.View({cls:"grid",selectable:!1}),this.table.addHeader("Name"),this.table.addHeader("Key"),this.table.addHeader("Number of chroms/contigs"),this.table.addHeader(""),this.table.appendHeader(),this.setElement($("<div/>").append($("<h4/>").text("Current Custom Builds")).append(this.table.$el).append($("<h4/>").text("System Installed Builds").addClass("ui-margin-top")).append(this.installed_builds.$el).append($("<h4/>").text("Add a Custom Build").addClass("ui-margin-top")).append(this.message.$el).append($("<span/>").addClass("ui-margin-top").append(this.$form=$("<div/>").css({width:"49%","float":"left"})).append(this.$help=$("<div/>").css({width:"49%","float":"right"})))),this.listenTo(this.collection,"add remove reset",function(){a._renderTable()}),this.listenTo(this.model,"change",function(){a._renderForm()}),this.collection.fetch(),this.model.fetch()},render:function(){this._renderTable(),this._renderForm()},_renderTable:function(){var a=this;this.table.delAll(),this.collection.sort(),this.collection.each(function(c){a.table.add(c.id),a.table.add(c.get("name")),a.table.add(void 0!==c.get("count")?c.get("count"):"-"),a.table.add(new b.ButtonIcon({icon:"fa-trash-o",cls:"ui-button-icon-plain",tooltip:"Delete custom build.",onclick:function(){c.destroy()}}).$el),a.table.append(c.id)})},_renderForm:function(){var a=this,d="fasta",e=new c({inputs:[{type:"text",name:"name",label:"Name",help:"Specify a build name e.g. Hamster."},{type:"text",name:"id",label:"Key",help:"Specify a build key e.g. hamster_v1."},{name:"len",type:"conditional",test_param:{name:"type",label:"Definition",help:"Provide the data source.",type:"select",value:d,data:[{value:"fasta",label:"FASTA-file from history"},{value:"file",label:"Len-file from disk"},{value:"text",label:"Len-file by copy/paste"}]},cases:[{value:"fasta",inputs:[{type:"select",name:"value",label:"FASTA-file",data:this.model.get("fasta_hdas")}]},{value:"file",inputs:[{type:"upload",name:"value",label:"Len-file",data:this.model.get("len_hdas")}]},{value:"text",inputs:[{type:"text",area:!0,name:"value",label:"Edit/Paste"}]}]}],buttons:{save:new b.Button({icon:"fa-save",tooltip:"Create new Build",title:"Save",cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){var b=e.data.create();b.id&&b.name?a.collection.create(b,{wait:!0,success:function(b){a.message.update(b.get("message")?{message:b.get("message"),status:"warning"}:{message:"Successfully added a new custom build.",status:"success"})},error:function(b,c){var d=c&&c.responseJSON&&c.responseJSON.err_msg;a.message.update({message:d||"Failed to create custom build.",status:"danger"})}}):a.message.update({message:"All inputs are required.",status:"danger"})}})},onchange:function(){var b=e.data.match("len|type");if(b){var c=e.field_list[b];a._renderHelp(c.value())}}});this.$form.empty().append(e.$el),this.installed_builds.update(this.model.get("installed_builds")),this._renderHelp(d)},_renderHelp:function(a){window.console.log(a),this.$help.empty().addClass("infomessagesmall").html("hallo")}});return{View:f}});
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-view","mvc/ui/ui-table"],function(a,b,c,d){var e=Backbone.Collection.extend({comparator:function(a,b){return a=a.get("name"),b=b.get("name"),a>b?1:b>a?-1:0}}),f=Backbone.View.extend({initialize:function(){var a=this;this.model=new Backbone.Model,this.model.url=Galaxy.root+"api/users/"+Galaxy.user.id+"/custom_builds_metadata",this.collection=new e,this.collection.url=Galaxy.root+"api/users/"+Galaxy.user.id+"/custom_builds",this.message=new b.Message({}),this.installed_builds=new b.Select.View({optional:!0,onchange:function(){a.installed_builds.value(null)},empty_text:"List of available builds:",error_text:"No system installed builds available."}),this.table=new d.View({cls:"grid",selectable:!1}),this.table.addHeader("Name"),this.table.addHeader("Key"),this.table.addHeader("Number of chroms/contigs"),this.table.addHeader(""),this.table.appendHeader(),this.setElement($("<div/>").append($("<h4/>").text("Current Custom Builds")).append(this.table.$el).append($("<h4/>").text("System Installed Builds").addClass("ui-margin-top")).append(this.installed_builds.$el).append($("<h4/>").text("Add a Custom Build").addClass("ui-margin-top")).append(this.message.$el).append($("<span/>").addClass("ui-margin-top").append(this.$form=$("<div/>").css({width:"49%","float":"left"})).append(this.$help=$("<div/>").css({width:"49%","float":"right"})))),this.listenTo(this.collection,"add remove reset",function(){a._renderTable()}),this.listenTo(this.model,"change",function(){a._renderForm()}),this.collection.fetch(),this.model.fetch()},render:function(){this._renderTable(),this._renderForm()},_renderTable:function(){var a=this;this.table.delAll(),this.collection.sort(),this.collection.each(function(c){a.table.add(c.id),a.table.add(c.get("name")),a.table.add(void 0!==c.get("count")?c.get("count"):"-"),a.table.add(new b.ButtonIcon({icon:"fa-trash-o",cls:"ui-button-icon-plain",tooltip:"Delete custom build.",onclick:function(){c.destroy()}}).$el),a.table.append(c.id)})},_renderForm:function(){var a=this,d="fasta",e=new c({inputs:[{type:"text",name:"name",label:"Name",help:"Specify a build name e.g. Hamster."},{type:"text",name:"id",label:"Key",help:"Specify a build key e.g. hamster_v1."},{name:"len",type:"conditional",test_param:{name:"type",label:"Definition",help:"Provide the data source.",type:"select",value:d,data:[{value:"fasta",label:"FASTA-file from history"},{value:"file",label:"Len-file from disk"},{value:"text",label:"Len-file by copy/paste"}]},cases:[{value:"fasta",inputs:[{type:"select",name:"value",label:"FASTA-file",data:this.model.get("fasta_hdas")}]},{value:"file",inputs:[{type:"upload",name:"value",label:"Len-file",data:this.model.get("len_hdas")}]},{value:"text",inputs:[{type:"text",area:!0,name:"value",label:"Edit/Paste"}]}]}],buttons:{save:new b.Button({icon:"fa-save",tooltip:"Create new Build",title:"Save",cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){var b=e.data.create();b.id&&b.name?a.collection.create(b,{wait:!0,success:function(b){a.message.update(b.get("message")?{message:b.get("message"),status:"warning"}:{message:"Successfully added a new custom build.",status:"success"})},error:function(b,c){var d=c&&c.responseJSON&&c.responseJSON.err_msg;a.message.update({message:d||"Failed to create custom build.",status:"danger"})}}):a.message.update({message:"All inputs are required.",status:"danger"})}})},onchange:function(){var b=e.data.match("len|type");if(b){var c=e.field_list[b];a._renderHelp(c.value())}}});this.$form.empty().append(e.$el),this.installed_builds.update(this.model.get("installed_builds")),this._renderHelp(d)},_renderHelp:function(a){this.$help.empty().addClass("alert alert-info").html("fasta"==a?this._templateFasta():this._templateLen())},_templateLen:function(){return"<h4>Length Format</h4><p>The length format is two-column, separated by whitespace, of the form:<pre>chrom/contig length of chrom/contig</pre></p><p>For example, the first few entries of <em>mm9.len</em> are as follows:<pre>chr1 197195432\nchr2 181748087\nchr3 159599783\nchr4 155630120\nchr5 152537259</pre></p><p>Trackster uses this information to populate the select box for chrom/contig, andto set the maximum basepair of the track browser. You may either upload a .len fileof this format (Len File option), or directly enter the information into the box (Len Entry option).</p>"},_templateFasta:function(){return"<h4>FASTA format</h4><p>This is a multi-fasta file from your current history that provides the genomesequences for each chromosome/contig in your build.</p><p>Here is a snippet from an example multi-fasta file:<pre>>chr1\nATTATATATAAGACCACAGAGAGAATATTTTGCCCGG...\n\n>chr2\nGGCGGCCGCGGCGATATAGAACTACTCATTATATATA...\n\n...</pre></p>"}});return{View:f}});
|
||||
//# sourceMappingURL=../../../maps/mvc/user/user-custom-builds.js.map
|
||||
Reference in New Issue
Block a user