commit/galaxy-central: guerler: ToolForm: Fix options menu
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/9b09297ed0db/ Changeset: 9b09297ed0db User: guerler Date: 2014-10-16 14:48:18+00:00 Summary: ToolForm: Fix options menu Affected #: 3 files diff -r 6e605c5d9feff984bfb5e67f2c36a400abdcae85 -r 9b09297ed0dbf506d5de13b6f91bbbd334b86238 client/galaxy/scripts/mvc/tools/tools-form.js --- a/client/galaxy/scripts/mvc/tools/tools-form.js +++ b/client/galaxy/scripts/mvc/tools/tools-form.js @@ -135,25 +135,28 @@ tooltip : 'Click to see a list of options.' }); - // add question option - menu.addMenu({ - icon : 'fa-question-circle', - title : 'Question?', - tooltip : 'Ask a question about this tool (Biostar)', - onclick : function() { - window.open(self.options.biostar_url + '/p/new/post/'); - } - }); - - // create search button - menu.addMenu({ - icon : 'fa-search', - title : 'Search', - tooltip : 'Search help for this tool (Biostar)', - onclick : function() { - window.open(self.options.biostar_url + '/t/' + self.options.id + '/'); - } - }); + // configure button selection + if(this.options.biostar_url) { + // add question option + menu.addMenu({ + icon : 'fa-question-circle', + title : 'Question?', + tooltip : 'Ask a question about this tool (Biostar)', + onclick : function() { + window.open(self.options.biostar_url + '/p/new/post/'); + } + }); + + // create search button + menu.addMenu({ + icon : 'fa-search', + title : 'Search', + tooltip : 'Search help for this tool (Biostar)', + onclick : function() { + window.open(self.options.biostar_url + '/t/' + self.options.id + '/'); + } + }); + }; // create share button menu.addMenu({ @@ -213,12 +216,6 @@ } }); - // configure button selection - if(!this.options.biostar_url) { - button_question.$el.hide(); - button_search.$el.hide(); - } - // append form this.$el.append(this.portlet.$el); diff -r 6e605c5d9feff984bfb5e67f2c36a400abdcae85 -r 9b09297ed0dbf506d5de13b6f91bbbd334b86238 static/scripts/mvc/tools/tools-form.js --- a/static/scripts/mvc/tools/tools-form.js +++ b/static/scripts/mvc/tools/tools-form.js @@ -135,25 +135,28 @@ tooltip : 'Click to see a list of options.' }); - // add question option - menu.addMenu({ - icon : 'fa-question-circle', - title : 'Question?', - tooltip : 'Ask a question about this tool (Biostar)', - onclick : function() { - window.open(self.options.biostar_url + '/p/new/post/'); - } - }); - - // create search button - menu.addMenu({ - icon : 'fa-search', - title : 'Search', - tooltip : 'Search help for this tool (Biostar)', - onclick : function() { - window.open(self.options.biostar_url + '/t/' + self.options.id + '/'); - } - }); + // configure button selection + if(this.options.biostar_url) { + // add question option + menu.addMenu({ + icon : 'fa-question-circle', + title : 'Question?', + tooltip : 'Ask a question about this tool (Biostar)', + onclick : function() { + window.open(self.options.biostar_url + '/p/new/post/'); + } + }); + + // create search button + menu.addMenu({ + icon : 'fa-search', + title : 'Search', + tooltip : 'Search help for this tool (Biostar)', + onclick : function() { + window.open(self.options.biostar_url + '/t/' + self.options.id + '/'); + } + }); + }; // create share button menu.addMenu({ @@ -213,12 +216,6 @@ } }); - // configure button selection - if(!this.options.biostar_url) { - button_question.$el.hide(); - button_search.$el.hide(); - } - // append form this.$el.append(this.portlet.$el); diff -r 6e605c5d9feff984bfb5e67f2c36a400abdcae85 -r 9b09297ed0dbf506d5de13b6f91bbbd334b86238 static/scripts/packed/mvc/tools/tools-form.js --- a/static/scripts/packed/mvc/tools/tools-form.js +++ b/static/scripts/packed/mvc/tools/tools-form.js @@ -1,1 +1,1 @@ -define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,h,l,j,a,e,d,f,k,c,g){var b=Backbone.View.extend({container:"body",initialize:function(n){console.debug(n);var m=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new l.Modal.View()}this.options=n;this.model=n.model;this.inputs=n.model.inputs;this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.field_list={};this.input_list={};this.element_list={};this.content=new f({history_id:this.options.history_id,success:function(){m._buildForm()}})},message:function(m){$(this.container).empty();$(this.container).append(m)},reset:function(){for(var m in this.element_list){this.element_list[m].reset()}},refresh:function(){this.tree.refresh();for(var m in this.field_list){this.field_list[m].trigger("change")}console.debug("tools-form::refresh() - Recreated data structure. Refresh.")},_refreshForm:function(){var m=this;var n=this.tree.finalize({data:function(o){if(o.values.length>0&&o.values[0]&&o.values[0].src==="hda"){return m.content.get({id:o.values[0].id}).dataset_id}return null}});console.debug("tools-form::_refreshForm() - Refreshing inputs/states.");console.debug(n);i.request({type:"GET",url:galaxy_config.root+"tool_runner/index?tool_id="+this.options.id+"&form_refresh=True",data:n,success:function(o){console.debug("tools-form::_refreshForm() - Refreshed inputs/states.");console.debug(o)},error:function(o){console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(o)}})},_buildForm:function(){var n=this;var p=new l.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/t/"+n.options.id+"/")}});p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+n.options.id)}});if(Galaxy.currUser.get("is_admin")){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+n.options.id+"/download"}})}this.section=new k.View(n,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,operations:{menu:p},buttons:{execute:new l.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){n.job_handler.submit()}})}});if(!this.options.biostar_url){button_question.$el.hide();button_search.$el.hide()}this.$el.append(this.portlet.$el);if(this.options.help!=""){this.$el.append(d.help(this.options.help))}if(this.options.citations){this.$el.append(d.citations());var m=new j.ToolCitationCollection();m.tool_id=this.options.id;var o=new a.CitationListView({collection:m});o.render();m.fetch()}this.portlet.append(this.section.$el);this.refresh()}});return{View:b}}); \ No newline at end of file +define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,h,l,j,a,e,d,f,k,c,g){var b=Backbone.View.extend({container:"body",initialize:function(n){console.debug(n);var m=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new l.Modal.View()}this.options=n;this.model=n.model;this.inputs=n.model.inputs;this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.field_list={};this.input_list={};this.element_list={};this.content=new f({history_id:this.options.history_id,success:function(){m._buildForm()}})},message:function(m){$(this.container).empty();$(this.container).append(m)},reset:function(){for(var m in this.element_list){this.element_list[m].reset()}},refresh:function(){this.tree.refresh();for(var m in this.field_list){this.field_list[m].trigger("change")}console.debug("tools-form::refresh() - Recreated data structure. Refresh.")},_refreshForm:function(){var m=this;var n=this.tree.finalize({data:function(o){if(o.values.length>0&&o.values[0]&&o.values[0].src==="hda"){return m.content.get({id:o.values[0].id}).dataset_id}return null}});console.debug("tools-form::_refreshForm() - Refreshing inputs/states.");console.debug(n);i.request({type:"GET",url:galaxy_config.root+"tool_runner/index?tool_id="+this.options.id+"&form_refresh=True",data:n,success:function(o){console.debug("tools-form::_refreshForm() - Refreshed inputs/states.");console.debug(o)},error:function(o){console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(o)}})},_buildForm:function(){var n=this;var p=new l.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});if(this.options.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/t/"+n.options.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+n.options.id)}});if(Galaxy.currUser.get("is_admin")){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+n.options.id+"/download"}})}this.section=new k.View(n,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,operations:{menu:p},buttons:{execute:new l.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){n.job_handler.submit()}})}});this.$el.append(this.portlet.$el);if(this.options.help!=""){this.$el.append(d.help(this.options.help))}if(this.options.citations){this.$el.append(d.citations());var m=new j.ToolCitationCollection();m.tool_id=this.options.id;var o=new a.CitationListView({collection:m});o.render();m.fetch()}this.portlet.append(this.section.$el);this.refresh()}});return{View:b}}); \ 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.
participants (1)
-
commits-noreply@bitbucket.org