';
@@ -265,37 +279,37 @@ var Message = Backbone.View.extend({
status : 'info',
persistent : false
},
-
+
// initialize
initialize : function(options) {
// configure options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// create new element
this.setElement('');
-
+
// show initial message
if (this.options.message) {
this.update(this.options);
}
},
-
+
// update
update : function(options) {
// get options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// show message
if (options.message != '') {
this.$el.html(this._template(this.options));
this.$el.find('.alert').append(options.message);
this.$el.fadeIn();
-
+
// clear previous timeouts
if (this.timeout) {
window.clearTimeout(this.timeout);
}
-
+
// set timeout if message is not persistent
if (!options.persistent) {
var self = this;
@@ -311,7 +325,7 @@ var Message = Backbone.View.extend({
this.$el.fadeOut();
}
},
-
+
// element
_template: function(options) {
return '';
@@ -325,15 +339,15 @@ var Searchbox = Backbone.View.extend({
onclick : null,
searchword : ''
},
-
+
// initialize
initialize : function(options) {
// configure options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// create new element
this.setElement(this._template(this.options));
-
+
// add click event
var self = this;
if (this.options.onclick) {
@@ -343,7 +357,7 @@ var Searchbox = Backbone.View.extend({
});
}
},
-
+
// element
_template: function(options) {
return '
' +
@@ -368,30 +382,30 @@ var Input = Backbone.View.extend({
cls : '',
area : false
},
-
+
// initialize
initialize : function(options) {
// configure options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// create new element
this.setElement(this._template(this.options));
-
+
// set initial value
if (this.options.value !== undefined) {
this.value(this.options.value);
}
-
+
// disable input field
if (this.options.disabled) {
this.$el.prop('disabled', true);
}
-
+
// hide input field
if (!this.options.visible) {
this.$el.hide();
}
-
+
// onchange event handler. fires on user activity.
var self = this;
this.$el.on('input', function() {
@@ -400,7 +414,7 @@ var Input = Backbone.View.extend({
}
});
},
-
+
// value
value : function (new_val) {
if (new_val !== undefined) {
@@ -408,7 +422,7 @@ var Input = Backbone.View.extend({
}
return this.$el.val();
},
-
+
// element
_template: function(options) {
if (options.area) {
@@ -425,16 +439,16 @@ var Hidden = Backbone.View.extend({
initialize : function(options) {
// configure options
this.options = options;
-
+
// create new element
this.setElement(this._template(this.options));
-
+
// set initial value
if (this.options.value !== undefined) {
this.value(this.options.value);
}
},
-
+
// value
value : function (new_val) {
if (new_val !== undefined) {
@@ -442,7 +456,7 @@ var Hidden = Backbone.View.extend({
}
return this.$('hidden').val();
},
-
+
// element
_template: function(options) {
var tmpl = '
';
diff --git a/static/scripts/packed/mvc/tools/tools-form.js b/static/scripts/packed/mvc/tools/tools-form.js
index 054668f1066..bb7e267d699 100644
--- a/static/scripts/packed/mvc/tools/tools-form.js
+++ b/static/scripts/packed/mvc/tools/tools-form.js
@@ -1 +1 @@
-define(["utils/utils","mvc/ui/ui-misc","mvc/tools/tools-form-base","mvc/tools/tools-jobs"],function(c,e,b,a){var d=b.extend({initialize:function(g){if(g.job_id&&g.job_remap){g.inputs.rerun_remap_job_id={label:"Resume dependencies from this job",name:"rerun_remap_job_id",type:"select",display:"radio",ignore:"__ignore__",value:"__ignore__",options:[["Yes",g.job_id],["No","__ignore__"]],help:"The previous run of this tool failed and other tools were waiting for it to finish successfully. Use this option to resume those tools using the new output(s) of this tool run."}}var f=this;g=c.merge(g,{update_url:galaxy_config.root+"api/tools/"+g.id+"/build",buttons:{execute:new e.Button({icon:"fa-check",tooltip:"Execute: "+g.name,title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){a.submit(f.form,g)}})}});b.prototype.initialize.call(this,g)}});return{View:d}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-misc","mvc/tools/tools-form-base","mvc/tools/tools-jobs"],function(c,e,b,a){var d=b.extend({initialize:function(g){var f=this;var h=new e.Button({icon:"fa-check",tooltip:"Execute: "+g.name,title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){h.wait();a.submit(f.form,g,function(){h.unwait()})}});if(g.job_id&&g.job_remap){g.inputs.rerun_remap_job_id={label:"Resume dependencies from this job",name:"rerun_remap_job_id",type:"select",display:"radio",ignore:"__ignore__",value:"__ignore__",options:[["Yes",g.job_id],["No","__ignore__"]],help:"The previous run of this tool failed and other tools were waiting for it to finish successfully. Use this option to resume those tools using the new output(s) of this tool run."}}g=c.merge(g,{update_url:galaxy_config.root+"api/tools/"+g.id+"/build",buttons:{execute:h}});b.prototype.initialize.call(this,g)}});return{View:d}});
\ No newline at end of file
diff --git a/static/scripts/packed/mvc/tools/tools-jobs.js b/static/scripts/packed/mvc/tools/tools-jobs.js
index 453a86c4828..a3ccfb7d51f 100644
--- a/static/scripts/packed/mvc/tools/tools-jobs.js
+++ b/static/scripts/packed/mvc/tools/tools-jobs.js
@@ -1 +1 @@
-define(["utils/utils","mvc/tools/tools-template"],function(b,a){return{submit:function(g,e){var c=this;var f={tool_id:e.id,tool_version:e.version,inputs:g.data.create()};g.trigger("reset");if(!this._validation(g,f)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.debug(f);var d=true;g.modal.show({title:"Please wait...",body:"progress",buttons:{Close:function(){g.modal.hide();d=false}}});b.request({type:"POST",url:galaxy_config.root+"api/tools",data:f,success:function(h){g.modal.hide();g.reciept(a.success(h));c._refreshHdas()},error:function(h,j){g.modal.hide();if(h&&h.message&&h.message.data){var k=g.data.matchResponse(h.message.data);for(var i in k){g.highlight(i,k[i]);break}}else{console.debug(h);d&&g.modal.show({title:"Job submission failed",body:a.error(f),buttons:{Close:function(){g.modal.hide()}}})}}})},_validation:function(e,i){var f=i.inputs;var o=-1;var j=null;for(var l in f){var g=f[l];var m=e.data.match(l);var d=e.field_list[m];var k=e.input_list[m];if(!m||!k||!d){console.debug("tools-jobs::_validation - Retrieving input objects failed.");continue}if(!k.optional&&g==null){e.highlight(m);return false}if(g&&g.batch){var h=g.values.length;var c=null;if(h>0){c=g.values[0]&&g.values[0].src}if(c){if(j===null){j=c}else{if(j!==c){e.highlight(m,"Please select either dataset or dataset list fields for all batch mode fields.");return false}}}if(o===-1){o=h}else{if(o!==h){e.highlight(m,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains "+h+" selection(s) while a previous field contains "+o+".");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}}});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-template"],function(b,a){return{submit:function(f,d,g){var c=this;var e={tool_id:d.id,tool_version:d.version,inputs:f.data.create()};f.trigger("reset");if(!this._validation(f,e)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");g&&g();return}console.debug(e);b.request({type:"POST",url:galaxy_config.root+"api/tools",data:e,success:function(h){g&&g();f.reciept(a.success(h));c._refreshHdas()},error:function(h,j){g&&g();if(h&&h.message&&h.message.data){var k=f.data.matchResponse(h.message.data);for(var i in k){f.highlight(i,k[i]);break}}else{console.debug(h);h&&f.modal.show({title:"Job submission failed",body:a.error(e),buttons:{Close:function(){f.modal.hide()}}})}}})},_validation:function(e,i){var f=i.inputs;var o=-1;var j=null;for(var l in f){var g=f[l];var m=e.data.match(l);var d=e.field_list[m];var k=e.input_list[m];if(!m||!k||!d){console.debug("tools-jobs::_validation - Retrieving input objects failed.");continue}if(!k.optional&&g==null){e.highlight(m);return false}if(g&&g.batch){var h=g.values.length;var c=null;if(h>0){c=g.values[0]&&g.values[0].src}if(c){if(j===null){j=c}else{if(j!==c){e.highlight(m,"Please select either dataset or dataset list fields for all batch mode fields.");return false}}}if(o===-1){o=h}else{if(o!==h){e.highlight(m,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains "+h+" selection(s) while a previous field contains "+o+".");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}}});
\ No newline at end of file
diff --git a/static/scripts/packed/mvc/ui/ui-misc.js b/static/scripts/packed/mvc/ui/ui-misc.js
index 3ca257f4300..3cbafecd726 100644
--- a/static/scripts/packed/mvc/ui/ui-misc.js
+++ b/static/scripts/packed/mvc/ui/ui-misc.js
@@ -1 +1 @@
-define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-button-check","mvc/ui/ui-modal"],function(e,h,i,m,l,r,d,b){var q=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(s){return''}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},title:function(s){this.$el.html(s)},_template:function(s){return'"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){return'
';return s}});return{Anchor:p,Button:g,ButtonIcon:o,ButtonCheck:d,ButtonMenu:r,Icon:c,Image:q,Input:n,Label:j,Message:a,Modal:b,RadioButton:m.RadioButton,Checkbox:m.Checkbox,Radio:m.Radio,Searchbox:f,Select:h,Hidden:k,Slider:i,Drilldown:l}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-button-check","mvc/ui/ui-modal"],function(e,h,i,m,l,r,d,b){var q=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(s){return''}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},title:function(s){this.$el.html(s)},_template:function(s){return'"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){return'
';return s}});return{Anchor:p,Button:g,ButtonIcon:o,ButtonCheck:d,ButtonMenu:r,Icon:c,Image:q,Input:n,Label:j,Message:a,Modal:b,RadioButton:m.RadioButton,Checkbox:m.Checkbox,Radio:m.Radio,Searchbox:f,Select:h,Hidden:k,Slider:i,Drilldown:l}});
\ No newline at end of file