diff --git a/client/galaxy/scripts/mvc/tools/tools-form-base.js b/client/galaxy/scripts/mvc/tools/tools-form-base.js index 82036d177f2..240563c83d8 100644 --- a/client/galaxy/scripts/mvc/tools/tools-form-base.js +++ b/client/galaxy/scripts/mvc/tools/tools-form-base.js @@ -69,7 +69,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view', _operations: function() { // link this var self = this; - var options = self.options; + var options = this.options; // button for version selection var versions_button = new Ui.ButtonMenu({ @@ -142,7 +142,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view', }); // add admin operations - if (self.is_admin) { + if (this.is_admin) { // create download button menu_button.addMenu({ icon : 'fa-download', diff --git a/static/scripts/mvc/tools/tools-form-base.js b/static/scripts/mvc/tools/tools-form-base.js index 82036d177f2..240563c83d8 100644 --- a/static/scripts/mvc/tools/tools-form-base.js +++ b/static/scripts/mvc/tools/tools-form-base.js @@ -69,7 +69,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view', _operations: function() { // link this var self = this; - var options = self.options; + var options = this.options; // button for version selection var versions_button = new Ui.ButtonMenu({ @@ -142,7 +142,7 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view', }); // add admin operations - if (self.is_admin) { + if (this.is_admin) { // create download button menu_button.addMenu({ icon : 'fa-download', diff --git a/static/scripts/packed/mvc/tools/tools-form-base.js b/static/scripts/packed/mvc/tools/tools-form-base.js index 26214149b9c..30937ea1873 100644 --- a/static/scripts/packed/mvc/tools/tools-form-base.js +++ b/static/scripts/packed/mvc/tools/tools-form-base.js @@ -1 +1 @@ -define(["utils/utils","utils/deferred","mvc/ui/ui-misc","mvc/form/form-view","mvc/tools/tools-template","mvc/citation/citation-model","mvc/citation/citation-view"],function(f,d,g,c,a,e,b){return Backbone.View.extend({initialize:function(h){var i=parent.Galaxy;if(i&&i.currUser){this.is_admin=i.currUser.get("is_admin")}else{this.is_admin=false}this.deferred=new d();this.setElement("
");this.container=h.container||"body";$(this.container).append(this.$el);this._buildForm(h)},_buildForm:function(i){var h=this;this.options=f.merge(i,this.optionsDefault);var j=f.merge({icon:"fa-wrench",title:""+i.name+" "+i.description+" (Galaxy Tool Version "+i.version+")",operations:this._operations(),onchange:function(k){h.deferred.reset();h.deferred.execute(function(){h._updateModel($.extend(true,{},h.form.data.create()))})}},i);this.form=new c(j);this._footer();this.$el.empty();this.$el.append(this.form.$el)},_operations:function(){var j=this;var k=j.options;var n=new g.ButtonMenu({icon:"fa-cubes",title:(!k.narrow&&"Versions")||null,tooltip:"Select another tool version"});if(k.versions&&k.versions.length>1){for(var m in k.versions){var h=k.versions[m];if(h!=k.version){n.addMenu({title:"Switch to "+h,version:h,icon:"fa-cube",onclick:function(){k.id=k.id.replace(k.version,this.version);k.version=this.version;j.deferred.reset();j.deferred.execute(function(){j._buildModel()})}})}}}else{n.$el.hide()}var l=new g.ButtonMenu({icon:"fa-caret-down",title:(!k.narrow&&"Options")||null,tooltip:"View available options"});if(k.biostar_url){l.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(k.biostar_url+"/p/new/post/")}});l.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(k.biostar_url+"/local/search/page/?q="+k.name)}})}l.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="+k.id)}});if(j.is_admin){l.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+k.id+"/download"}})}if(k.requirements&&k.requirements.length>0){l.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;j.form.message.update({persistent:true,message:a.requirements(k),status:"info"})}else{this.visible=false;j.form.message.update({message:""})}}})}if(k.sharable_url){l.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(k.sharable_url)}})}return{menu:l,versions:n}},_footer:function(){var i=this.options;if(i.help!=""){this.form.$el.append(a.help(i))}if(i.citations){var k=$("
");var h=new e.ToolCitationCollection();h.tool_id=i.id;var j=new b.CitationListView({el:k,collection:h});j.render();h.fetch();this.form.$el.append(k)}}})}); \ No newline at end of file +define(["utils/utils","utils/deferred","mvc/ui/ui-misc","mvc/form/form-view","mvc/tools/tools-template","mvc/citation/citation-model","mvc/citation/citation-view"],function(f,d,g,c,a,e,b){return Backbone.View.extend({initialize:function(h){var i=parent.Galaxy;if(i&&i.currUser){this.is_admin=i.currUser.get("is_admin")}else{this.is_admin=false}this.deferred=new d();this.setElement("
");this.container=h.container||"body";$(this.container).append(this.$el);this._buildForm(h)},_buildForm:function(i){var h=this;this.options=f.merge(i,this.optionsDefault);var j=f.merge({icon:"fa-wrench",title:""+i.name+" "+i.description+" (Galaxy Tool Version "+i.version+")",operations:this._operations(),onchange:function(k){h.deferred.reset();h.deferred.execute(function(){h._updateModel($.extend(true,{},h.form.data.create()))})}},i);this.form=new c(j);this._footer();this.$el.empty();this.$el.append(this.form.$el)},_operations:function(){var j=this;var k=this.options;var n=new g.ButtonMenu({icon:"fa-cubes",title:(!k.narrow&&"Versions")||null,tooltip:"Select another tool version"});if(k.versions&&k.versions.length>1){for(var m in k.versions){var h=k.versions[m];if(h!=k.version){n.addMenu({title:"Switch to "+h,version:h,icon:"fa-cube",onclick:function(){k.id=k.id.replace(k.version,this.version);k.version=this.version;j.deferred.reset();j.deferred.execute(function(){j._buildModel()})}})}}}else{n.$el.hide()}var l=new g.ButtonMenu({icon:"fa-caret-down",title:(!k.narrow&&"Options")||null,tooltip:"View available options"});if(k.biostar_url){l.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(k.biostar_url+"/p/new/post/")}});l.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(k.biostar_url+"/local/search/page/?q="+k.name)}})}l.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="+k.id)}});if(this.is_admin){l.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+k.id+"/download"}})}if(k.requirements&&k.requirements.length>0){l.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;j.form.message.update({persistent:true,message:a.requirements(k),status:"info"})}else{this.visible=false;j.form.message.update({message:""})}}})}if(k.sharable_url){l.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(k.sharable_url)}})}return{menu:l,versions:n}},_footer:function(){var i=this.options;if(i.help!=""){this.form.$el.append(a.help(i))}if(i.citations){var k=$("
");var h=new e.ToolCitationCollection();h.tool_id=i.id;var j=new b.CitationListView({el:k,collection:h});j.render();h.fetch();this.form.$el.append(k)}}})}); \ No newline at end of file