mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Reduce form mako to json generation, load form just once
This commit is contained in:
@@ -1078,19 +1078,23 @@ $.extend( Workflow.prototype, {
|
||||
this.activate_node(node);
|
||||
}
|
||||
},
|
||||
clear_active_node : function() {
|
||||
clear_active_node : function(callback) {
|
||||
if ( this.active_node ) {
|
||||
this.active_node.make_inactive();
|
||||
this.active_node = null;
|
||||
}
|
||||
parent.show_form_for_tool( "<div>No node selected</div>" );
|
||||
if (parent.__NEWTOOLFORM__) {
|
||||
parent.show_tool_form( "<div>No node selected</div>", {id: 'no-node'}, callback );
|
||||
} else {
|
||||
parent.show_form_for_tool( "<div>No node selected</div>" );
|
||||
}
|
||||
},
|
||||
activate_node : function( node ) {
|
||||
if ( this.active_node != node ) {
|
||||
this.check_changes_in_active_form();
|
||||
this.clear_active_node();
|
||||
if (parent.__NEWTOOLFORM__) {
|
||||
parent.show_form_for_tool( node.form_html, node );
|
||||
parent.show_tool_form( node.form_html, node );
|
||||
} else {
|
||||
parent.show_form_for_tool( node.form_html + node.tooltip, node );
|
||||
}
|
||||
@@ -1104,7 +1108,7 @@ $.extend( Workflow.prototype, {
|
||||
// Reactive with new form_html
|
||||
this.check_changes_in_active_form(); //Force changes to be saved even on new connection (previously dumped)
|
||||
if (parent.__NEWTOOLFORM__) {
|
||||
parent.show_form_for_tool( node.form_html, node );
|
||||
parent.show_tool_form( node.form_html, node );
|
||||
} else {
|
||||
parent.show_form_for_tool( node.form_html + node.tooltip, node );
|
||||
}
|
||||
|
||||
@@ -83,6 +83,14 @@ $( function() {
|
||||
|
||||
// Initialize workflow state
|
||||
reset();
|
||||
|
||||
// get available datatypes for post job action options
|
||||
datatypes = JSON.parse($.ajax({
|
||||
type : 'GET',
|
||||
url : galaxy_config.root + 'api/datatypes',
|
||||
async : false
|
||||
}).responseText);
|
||||
|
||||
// Load the datatype info
|
||||
$.ajax( {
|
||||
url: get_datatypes_url,
|
||||
@@ -204,10 +212,10 @@ $( function() {
|
||||
}
|
||||
|
||||
function edit_workflow_attributes() {
|
||||
workflow.clear_active_node();
|
||||
$('.right-content').hide();
|
||||
$('#edit-attributes').show();
|
||||
|
||||
workflow.clear_active_node(function() {
|
||||
$('.right-content').hide();
|
||||
$('#edit-attributes').show();
|
||||
});
|
||||
}
|
||||
|
||||
// On load, set the size to the pref stored in local storage if it exists
|
||||
@@ -447,6 +455,47 @@ function show_workflow_parameters(){
|
||||
}
|
||||
}
|
||||
|
||||
function show_tool_form( text, node, callback ) {
|
||||
require(['utils/utils', 'mvc/tools/tools-form-workflow'], function(Utils, ToolsForm){
|
||||
// initialize tags and identifiers
|
||||
var cls = 'right-content';
|
||||
var id = cls + '-' + node.id;
|
||||
|
||||
// grab panel container
|
||||
var $container = $('#' + cls);
|
||||
|
||||
// remove previous notifications
|
||||
var $current = $container.find('#' + id);
|
||||
if ($current.length > 0 && $current.find('.section-row').length == 0) {
|
||||
$current.remove();
|
||||
}
|
||||
|
||||
// check if tool form already exists
|
||||
if ($container.find('#' + id).length == 0) {
|
||||
var $el = $('<div id="' + id + '" class="' + cls + '"/>');
|
||||
if (Utils.isJSON(text)) {
|
||||
var options = JSON.parse(text);
|
||||
options.datatypes = datatypes;
|
||||
$el.append((new ToolsForm.View(options)).$el);
|
||||
} else {
|
||||
$el.append(text);
|
||||
}
|
||||
$container.append($el);
|
||||
}
|
||||
|
||||
// hide everything
|
||||
$('.' + cls).hide();
|
||||
|
||||
// show current form
|
||||
$container.find('#' + id).show();
|
||||
$container.show();
|
||||
$container.scrollTop();
|
||||
|
||||
// temporary fix for async require callback
|
||||
callback && callback();
|
||||
});
|
||||
}
|
||||
|
||||
function show_form_for_tool( text, node ) {
|
||||
$('.right-content').hide();
|
||||
$("#right-content").show().html( text );
|
||||
|
||||
@@ -24,10 +24,6 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view',
|
||||
// set element
|
||||
this.setElement('<div/>');
|
||||
|
||||
// append to body
|
||||
this.container = options.container || 'body';
|
||||
$(this.container).append(this.$el);
|
||||
|
||||
// create form
|
||||
this._buildForm(options);
|
||||
},
|
||||
|
||||
@@ -7,6 +7,9 @@ define(['utils/utils', 'mvc/tools/tools-form-base'],
|
||||
// create form view
|
||||
var View = ToolFormBase.extend({
|
||||
initialize: function(options) {
|
||||
// link this
|
||||
var self = this;
|
||||
|
||||
// link with node representation in workflow module
|
||||
this.node = workflow.active_node;
|
||||
if (!this.node) {
|
||||
@@ -56,22 +59,20 @@ define(['utils/utils', 'mvc/tools/tools-form-base'],
|
||||
}
|
||||
});
|
||||
|
||||
// load extension
|
||||
var self = this;
|
||||
Utils.get({
|
||||
url : galaxy_config.root + 'api/datatypes',
|
||||
cache : true,
|
||||
success : function(datatypes) {
|
||||
self.datatypes = datatypes;
|
||||
self._makeSections(options.inputs);
|
||||
ToolFormBase.prototype.initialize.call(self, options);
|
||||
}
|
||||
});
|
||||
// configure custom sections
|
||||
this._makeSections(options);
|
||||
|
||||
// create final tool form
|
||||
ToolFormBase.prototype.initialize.call(this, options);
|
||||
},
|
||||
|
||||
/** Builds all sub sections
|
||||
*/
|
||||
_makeSections: function(inputs){
|
||||
_makeSections: function(options){
|
||||
// initialize local variables
|
||||
var inputs = options.inputs;
|
||||
var datatypes = options.datatypes;
|
||||
|
||||
// for annotation
|
||||
inputs[Utils.uid()] = {
|
||||
label : 'Annotation / Notes',
|
||||
@@ -110,20 +111,20 @@ define(['utils/utils', 'mvc/tools/tools-form-base'],
|
||||
|
||||
// add output specific actions
|
||||
for (var i in this.node.output_terminals) {
|
||||
inputs[Utils.uid()] = this._makeSection(i);
|
||||
inputs[Utils.uid()] = this._makeSection(i, datatypes);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** Builds sub section with step actions/annotation
|
||||
*/
|
||||
_makeSection: function(output_id){
|
||||
_makeSection: function(output_id, datatypes){
|
||||
// format datatypes
|
||||
var extensions = [];
|
||||
for (key in this.datatypes) {
|
||||
for (key in datatypes) {
|
||||
extensions.push({
|
||||
0 : this.datatypes[key],
|
||||
1 : this.datatypes[key]
|
||||
0 : datatypes[key],
|
||||
1 : datatypes[key]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,16 @@ function deepeach(dict, callback) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a string is a json string
|
||||
* @param{String} text - Content to be validated
|
||||
*/
|
||||
function isJSON(text) {
|
||||
return /^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
|
||||
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
||||
replace(/(?:^|:|,)(?:\s*\[)+/g, ''));
|
||||
};
|
||||
|
||||
/**
|
||||
* Sanitize/escape a string
|
||||
* @param{String} content - Content to be sanitized
|
||||
@@ -254,7 +264,8 @@ return {
|
||||
sanitize: sanitize,
|
||||
textify: textify,
|
||||
validate: validate,
|
||||
deepeach: deepeach
|
||||
deepeach: deepeach,
|
||||
isJSON: isJSON
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
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 +1 @@
|
||||
{"version":3,"file":"tools-form-workflow.js","sources":["../../../src/mvc/tools/tools-form-workflow.js"],"names":["define","Utils","ToolFormBase","View","extend","initialize","options","this","node","workflow","active_node","console","debug","post_job_actions","merge","text_enable","text_disable","is_workflow","narrow","initial_errors","cls","update_url","galaxy_config","root","update","data","self","update_field_data","form","errors","tool_model","deepeach","inputs","item","type","indexOf","collapsible","collapsible_value","__class__","test_param","get","url","cache","success","datatypes","_makeSections","prototype","call","uid","label","name","area","help","value","annotation","output_id","output_terminals","Object","keys","String","Boolean","ignore","payload","host","window","location","i","_makeSection","visit","head","head_list","push","input","action","argument","p_id","p","d","j","expanded","action_arguments","slice","extensions","key",1,"sort","a","b","unshift","input_config","title","flat"],"mappings":"AA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AKqC,UAAUuC,MAK3BD,GAAWG,KAAK,SAASC,EAAGC,GACxB,MAAOD,GAAErC,MAAQsC,EAAEtC,MAAQ,EAAIqC,EAAErC,MAAQsC,EAAEtC,MAAQ,GAAK,IAI5DiC,EAAWM,SACP,EAAI,YACJJ,EAAI,cAERF,EAAWM,SACP,EAAI,WACJJ,EAAI,aAERF,EAAWM,SACP,EAAI,kBACJJ,EAAI,aAIR,IAAIK,IACAC,MAAU,iBAAoBnC,EAAY,IAC1CrB,KAAU,UACVyD,MAAU,EACV3D,SACIyC,OAAc,sBACdC,SAAc,UACdzB,MAAc,iBACdf,KAAc,OACdmB,MAAc,GACdQ,OAAc,GACdT,KAAc,+JAEdqB,OAAc,uBACdC,SAAc,UACdzB,MAAc,kBACdf,KAAc,SACd2B,OAAc,YACdR,MAAc,YACd/C,QAAc4E,EACd9B,KAAc,+EAEdqB,OAAc,mBACdC,SAAc,OACdzB,MAAc,OACdf,KAAc,OACdmB,MAAc,GACdQ,OAAc,GACdT,KAAc,+CAEdsC,MAAU,iBACVxD,KAAU,UACVyD,MAAU,EACV3D,SACIyC,OAAc,kBACdC,SAAc,WACdzB,MAAc,eACdf,KAAc,UACdmB,MAAc,GACdQ,OAAc,KAEdY,OAAc,kBACdC,SAAc,WACdzB,MAAc,eACdf,KAAc,UACdmB,MAAc,GACdQ,OAAc,KAEdY,OAAc,kBACdC,SAAc,SACdzB,MAAc,aACdf,KAAc,UACdmB,MAAc,GACdQ,OAAc,KAEdY,OAAc,kBACdC,SAAc,YACdzB,MAAc,gBACdf,KAAc,UACdmB,MAAc,GACdQ,OAAc,KAEdY,OAAc,kBACdC,SAAc,UACdzB,MAAc,cACdf,KAAc,UACdmB,MAAc,GACdQ,OAAc,KAElBT,KAAU,8FAKd1B,EAAOnB,IA+CX,OAHA6D,GAAMqB,GAGCA,IAIf,QACItF,KAAMA"}
|
||||
{"version":3,"file":"tools-form-workflow.js","sources":["../../../src/mvc/tools/tools-form-workflow.js"],"names":["define","Utils","ToolFormBase","View","extend","initialize","options","self","this","node","workflow","active_node","post_job_actions","merge","text_enable","text_disable","is_workflow","narrow","initial_errors","cls","update_url","galaxy_config","root","update","data","update_field_data","form","errors","tool_model","deepeach","inputs","item","type","indexOf","collapsible","collapsible_value","__class__","test_param","_makeSections","prototype","call","console","debug","datatypes","uid","label","name","area","help","value","annotation","output_id","output_terminals","Object","keys","String","Boolean","ignore","payload","host","window","location","i","_makeSection","visit","head","head_list","push","input","action","argument","p_id","p","d","j","expanded","action_arguments","slice","extensions","key",1,"sort","a","b","unshift","input_config","title","flat"],"mappings":"AAGAA,QAAQ,cAAe,6BACnB,SAASC,EAAOC,GAGhB,GAAIC,GAAOD,EAAaE,QACpBC,WAAY,SAASC,GAEjB,GAAIC,GAAOC,IAIX,OADAA,MAAKC,KAAOC,SAASC,YAChBH,KAAKC,MAMVD,KAAKI,iBAAmBJ,KAAKC,KAAKG,qBAGlCN,EAAUL,EAAMY,MAAMP,GAElBQ,YAAkB,iBAClBC,aAAkB,iBAGlBC,aAAkB,EAClBC,QAAkB,EAClBC,gBAAkB,EAClBC,IAAkB,oBAGlBC,WAAkBC,cAAcC,KAAO,6BACvCC,OAAkB,SAASC,GACvBjB,EAAKE,KAAKgB,kBAAkBD,GAC5BjB,EAAKmB,KAAKC,OAAOH,GAAQA,EAAKI,eAKtC3B,EAAM4B,SAASvB,EAAQwB,OAAQ,SAASC,GAChCA,EAAKC,MACmD,KAAlD,OAAQ,mBAAoBC,QAAQF,EAAKC,QAC3CD,EAAKG,aAAc,EACnBH,EAAKI,mBAAqBC,UAAa,mBAMnDnC,EAAM4B,SAASvB,EAAQwB,OAAQ,SAASC,GAChCA,EAAKC,MACY,eAAbD,EAAKC,OACLD,EAAKM,WAAWH,aAAc,KAM1C1B,KAAK8B,cAAchC,OAGnBJ,GAAaqC,UAAUlC,WAAWmC,KAAKhC,KAAMF,QAlDzCmC,SAAQC,MAAM,4EAuDtBJ,cAAe,SAAShC,GAEpB,GAAIwB,GAASxB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ACdC,SAAc,YACdzB,MAAc,gBACdb,KAAc,UACdiB,MAAc,GACdQ,OAAc,KAEdY,OAAc,kBACdC,SAAc,UACdzB,MAAc,cACdb,KAAc,UACdiB,MAAc,GACdQ,OAAc,KAElBT,KAAU,8FAKdzC,EAAOC,IA+CX,OAHAwD,GAAMqB,GAGCA,IAIf,QACIlF,KAAMA"}
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"utils.js","sources":["../../src/utils/utils.js"],"names":["define","_","deepeach","dict","callback","i","d","sanitize","content","$","text","html","validate","value","Array","length","undefined","indexOf","textify","lst","toString","replace","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","galaxy_config","root","merge","optionsDefault","defaults","bytesToString","size","normal_font","unit","rounded","Math","round","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,QAAQ,mBAAoB,SAASC,GAIrC,QAASC,GAASC,EAAMC,GACpB,IAAK,GAAIC,KAAKF,GAAM,CAChB,GAAIG,GAAIH,EAAKE,EACTC,IAAkB,gBAAP,KACXF,EAASE,GACTJ,EAASI,EAAGF,KASxB,QAASG,GAASC,GACd,MAAOC,GAAE,UAAUC,KAAKF,GAASG,OAQrC,QAASC,GAAUC,GAIf,GAHMA,YAAiBC,SACnBD,GAASA,IAEQ,IAAjBA,EAAME,OACN,OAAO,CAEX,KAAK,GAAIV,KAAKQ,GACV,IAAK,WAAY,gBAAiB,KAAMG,QAAWC,QAAQJ,EAAMR,IAAM,GACnE,OAAO,CAGf,QAAO,EAOX,QAASa,GAAQC,GACb,GAAIA,GAAMA,EAAIC,UACd,IAAID,EAAK,CACLA,EAAMA,EAAIE,QAAQ,KAAM,KACxB,IAAIC,GAAMH,EAAII,YAAY,KAI1B,OA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EAClB5B,IAAMA,EACNsC,MAAQA,EACRG,cAAeA,EACfO,IAAKA,EACLE,KAAMA,EACNzC,QAASA,EACT3B,SAAUA,EACVW,QAASA,EACTN,SAAUA,EACVV,SAAUA"}
|
||||
{"version":3,"file":"utils.js","sources":["../../src/utils/utils.js"],"names":["define","_","deepeach","dict","callback","i","d","isJSON","text","test","replace","sanitize","content","$","html","validate","value","Array","length","undefined","indexOf","textify","lst","toString","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","galaxy_config","root","merge","optionsDefault","defaults","bytesToString","size","normal_font","unit","rounded","Math","round","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,QAAQ,mBAAoB,SAASC,GAIrC,QAASC,GAASC,EAAMC,GACpB,IAAK,GAAIC,KAAKF,GAAM,CAChB,GAAIG,GAAIH,EAAKE,EACTC,IAAkB,gBAAP,KACXF,EAASE,GACTJ,EAASI,EAAGF,KASxB,QAASG,GAAOC,GACZ,MAAO,gBAAgBC,KAAKD,EAAKE,QAAQ,mBAAoB,KACzDA,QAAQ,mEAAoE,KAC5EA,QAAQ,uBAAwB,KAOxC,QAASC,GAASC,GACd,MAAOC,GAAE,UAAUL,KAAKI,GAASE,OAQrC,QAASC,GAAUC,GAIf,GAHMA,YAAiBC,SACnBD,GAASA,IAEQ,IAAjBA,EAAME,OACN,OAAO,CAEX,KAAK,GAAIb,KAAKW,GACV,IAAK,WAAY,gBAAiB,KAAMG,QAAWC,QAAQJ,EAAMX,IAAM,GACnE,OAAO,CAGf,QAAO,EAOX,QAASgB,GAAQC,GACb,GAAIA,GAAMA,EAAIC,UACd,IAAID,EAAK,CACLA,EAAMA,EAAIZ,QAAQ,KAAM,KACxB,IAAIc,GAAMF,E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AAgBA,EAChBP,gBAAkBA,EAClB5B,IAAMA,EACNsC,MAAQA,EACRG,cAAeA,EACfO,IAAKA,EACLE,KAAMA,EACNzC,QAASA,EACTzB,SAAUA,EACVU,QAASA,EACTN,SAAUA,EACVb,SAAUA,EACVK,OAAQA"}
|
||||
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","utils/deferred","mvc/ui/ui-misc","mvc/form/form-view","mvc/tools/tools-template","mvc/citation/citation-model","mvc/citation/citation-view"],function(a,b,c,d,e,f,g){return Backbone.View.extend({initialize:function(a){var c=parent.Galaxy;this.is_admin=c&&c.currUser?c.currUser.get("is_admin"):!1,this.deferred=new b,this.setElement("<div/>"),this.container=a.container||"body",$(this.container).append(this.$el),this._buildForm(a)},_buildForm:function(b){var c=this;this.options=a.merge(b,this.options),this.options=a.merge({icon:"fa-wrench",title:"<b>"+b.name+"</b> "+b.description+" (Galaxy Tool Version "+b.version+")",operations:this._operations(),onchange:function(){c.deferred.reset(),c.deferred.execute(function(){c._updateModel()})}},this.options),this.form=new d(this.options),this._footer(),this.$el.empty(),this.$el.append(this.form.$el)},_buildModel:function(b){var c=this;this.options.id=b.id,this.options.version=b.version;var d=galaxy_config.root+"api/tools/"+b.id+"/build?";if(b.job_id)d+="job_id="+b.job_id;else if(b.dataset_id)d+="dataset_id="+b.dataset_id;else{d+="tool_version="+b.version+"&";var e=top.location.href,f=e.indexOf("?");-1!=e.indexOf("tool_id=")&&-1!==f&&(d+=e.slice(f+1))}var g=this.deferred.register();a.request({type:"GET",url:d,success:function(a){c._buildForm(a.tool_model||a),c.form.message.update({status:"success",message:"Now you are using '"+c.options.name+"' version "+c.options.version+".",persistent:!1}),c.deferred.done(g),console.debug("tools-form::initialize() - Initial tool model ready."),console.debug(a)},error:function(a){c.deferred.done(g),console.debug("tools-form::initialize() - Initial tool model request failed."),console.debug(a);var b=a.error||"Uncaught error.";c.form.modal.show({title:"Tool cannot be executed",body:b,buttons:{Close:function(){c.form.modal.hide()}}})}})},_updateModel:function(){var b=this.options.update_url||galaxy_config.root+"api/tools/"+this.options.id+"/build",c=this,d=this.form,e={tool_id:this.options.id,tool_version:this.options.version,inputs:$.extend(!0,{},c.form.data.create())};d.wait(!0);var f=this.deferred.register();console.debug("tools-form-base::_updateModel() - Sending current state (see below)."),console.debug(e),a.request({type:"POST",url:b,data:e,success:function(a){c.form.update(a.tool_model||a),c.options.update&&c.options.update(a),d.wait(!1),console.debug("tools-form-base::_updateModel() - Received new model (see below)."),console.debug(a),c.deferred.done(f)},error:function(a){c.deferred.done(f),console.debug("tools-form-base::_updateModel() - Refresh request failed."),console.debug(a)}})},_operations:function(){var a=this,b=this.options,d=new c.ButtonMenu({icon:"fa-cubes",title:!b.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(b.versions&&b.versions.length>1)for(var f in b.versions){var g=b.versions[f];g!=b.version&&d.addMenu({title:"Switch to "+g,version:g,icon:"fa-cube",onclick:function(){var c=b.id.replace(b.version,this.version),d=this.version;a.deferred.reset(),a.deferred.execute(function(){a._buildModel({id:c,version:d})})}})}else d.$el.hide();var h=new c.ButtonMenu({icon:"fa-caret-down",title:!b.narrow&&"Options"||null,tooltip:"View available options"});return b.biostar_url&&(h.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/p/new/post/")}}),h.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/local/search/page/?q="+b.name)}})),h.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="+b.id)}}),this.is_admin&&h.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+b.id+"/download"}}),b.requirements&&b.requirements.length>0&&h.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){this.visible?(this.visible=!1,a.form.message.update({message:""})):(this.visible=!0,a.form.message.update({persistent:!0,message:e.requirements(b),status:"info"}))}}),b.sharable_url&&h.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(b.sharable_url)}}),{menu:h,versions:d}},_footer:function(){var a=this.options;if(""!=a.help&&this.form.$el.append(e.help(a)),a.citations){var b=$("<div/>"),c=new f.ToolCitationCollection;c.tool_id=a.id;var d=new g.CitationListView({el:b,collection:c});d.render(),c.fetch(),this.form.$el.append(b)}}})});
|
||||
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(a,b,c,d,e,f,g){return Backbone.View.extend({initialize:function(a){var c=parent.Galaxy;this.is_admin=c&&c.currUser?c.currUser.get("is_admin"):!1,this.deferred=new b,this.setElement("<div/>"),this._buildForm(a)},_buildForm:function(b){var c=this;this.options=a.merge(b,this.options),this.options=a.merge({icon:"fa-wrench",title:"<b>"+b.name+"</b> "+b.description+" (Galaxy Tool Version "+b.version+")",operations:this._operations(),onchange:function(){c.deferred.reset(),c.deferred.execute(function(){c._updateModel()})}},this.options),this.form=new d(this.options),this._footer(),this.$el.empty(),this.$el.append(this.form.$el)},_buildModel:function(b){var c=this;this.options.id=b.id,this.options.version=b.version;var d=galaxy_config.root+"api/tools/"+b.id+"/build?";if(b.job_id)d+="job_id="+b.job_id;else if(b.dataset_id)d+="dataset_id="+b.dataset_id;else{d+="tool_version="+b.version+"&";var e=top.location.href,f=e.indexOf("?");-1!=e.indexOf("tool_id=")&&-1!==f&&(d+=e.slice(f+1))}var g=this.deferred.register();a.request({type:"GET",url:d,success:function(a){c._buildForm(a.tool_model||a),c.form.message.update({status:"success",message:"Now you are using '"+c.options.name+"' version "+c.options.version+".",persistent:!1}),c.deferred.done(g),console.debug("tools-form::initialize() - Initial tool model ready."),console.debug(a)},error:function(a){c.deferred.done(g),console.debug("tools-form::initialize() - Initial tool model request failed."),console.debug(a);var b=a.error||"Uncaught error.";c.form.modal.show({title:"Tool cannot be executed",body:b,buttons:{Close:function(){c.form.modal.hide()}}})}})},_updateModel:function(){var b=this.options.update_url||galaxy_config.root+"api/tools/"+this.options.id+"/build",c=this,d=this.form,e={tool_id:this.options.id,tool_version:this.options.version,inputs:$.extend(!0,{},c.form.data.create())};d.wait(!0);var f=this.deferred.register();console.debug("tools-form-base::_updateModel() - Sending current state (see below)."),console.debug(e),a.request({type:"POST",url:b,data:e,success:function(a){c.form.update(a.tool_model||a),c.options.update&&c.options.update(a),d.wait(!1),console.debug("tools-form-base::_updateModel() - Received new model (see below)."),console.debug(a),c.deferred.done(f)},error:function(a){c.deferred.done(f),console.debug("tools-form-base::_updateModel() - Refresh request failed."),console.debug(a)}})},_operations:function(){var a=this,b=this.options,d=new c.ButtonMenu({icon:"fa-cubes",title:!b.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(b.versions&&b.versions.length>1)for(var f in b.versions){var g=b.versions[f];g!=b.version&&d.addMenu({title:"Switch to "+g,version:g,icon:"fa-cube",onclick:function(){var c=b.id.replace(b.version,this.version),d=this.version;a.deferred.reset(),a.deferred.execute(function(){a._buildModel({id:c,version:d})})}})}else d.$el.hide();var h=new c.ButtonMenu({icon:"fa-caret-down",title:!b.narrow&&"Options"||null,tooltip:"View available options"});return b.biostar_url&&(h.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/p/new/post/")}}),h.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/local/search/page/?q="+b.name)}})),h.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="+b.id)}}),this.is_admin&&h.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+b.id+"/download"}}),b.requirements&&b.requirements.length>0&&h.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){this.visible?(this.visible=!1,a.form.message.update({message:""})):(this.visible=!0,a.form.message.update({persistent:!0,message:e.requirements(b),status:"info"}))}}),b.sharable_url&&h.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(b.sharable_url)}}),{menu:h,versions:d}},_footer:function(){var a=this.options;if(""!=a.help&&this.form.$el.append(e.help(a)),a.citations){var b=$("<div/>"),c=new f.ToolCitationCollection;c.tool_id=a.id;var d=new g.CitationListView({el:b,collection:c});d.render(),c.fetch(),this.form.$el.append(b)}}})});
|
||||
//# sourceMappingURL=../../../maps/mvc/tools/tools-form-base.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils","mvc/tools/tools-form-base"],function(a,b){var c=b.extend({initialize:function(c){if(this.node=workflow.active_node,!this.node)return void console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");this.post_job_actions=this.node.post_job_actions||{},c=a.merge(c,{text_enable:"Set in Advance",text_disable:"Set at Runtime",is_workflow:!0,narrow:!0,initial_errors:!0,cls:"ui-portlet-narrow",update_url:galaxy_config.root+"api/workflows/build_module",update:function(a){d.node.update_field_data(a),d.form.errors(a&&a.tool_model)}}),a.deepeach(c.inputs,function(a){a.type&&-1==["data","data_collection"].indexOf(a.type)&&(a.collapsible=!0,a.collapsible_value={__class__:"RuntimeValue"})}),a.deepeach(c.inputs,function(a){a.type&&"conditional"==a.type&&(a.test_param.collapsible=!1)});var d=this;a.get({url:galaxy_config.root+"api/datatypes",cache:!0,success:function(a){d.datatypes=a,d._makeSections(c.inputs),b.prototype.initialize.call(d,c)}})},_makeSections:function(b){b[a.uid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:!0,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var c=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(c){b[a.uid()]={name:"pja__"+c+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+c])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}},b[a.uid()]={name:"pja__"+c+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+c])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var d in this.node.output_terminals)b[a.uid()]=this._makeSection(d)}},_makeSection:function(a){function b(c,d){d=d||[],d.push(c);for(var f in c.inputs){var g=c.inputs[f];if(g.action){if(g.name="pja__"+a+"__"+g.action,g.argument&&(g.name+="__"+g.argument),g.payload)for(var h in g.payload){var i=g.payload[h];g.payload[g.name+"__"+h]=i,delete i}var j=e.post_job_actions[g.action+a];if(j){for(var k in d)d[k].expanded=!0;g.value=g.argument?j.action_arguments&&j.action_arguments[g.argument]||g.value:"true"}}g.inputs&&b(g,d.slice(0))}}var c=[];for(key in this.datatypes)c.push({0:this.datatypes[key],1:this.datatypes[key]});c.sort(function(a,b){return a.label>b.label?1:a.label<b.label?-1:0}),c.unshift({0:"Sequences",1:"Sequences"}),c.unshift({0:"Roadmaps",1:"Roadmaps"}),c.unshift({0:"Leave unchanged",1:"__empty__"});var d={title:"Add Actions: '"+a+"'",type:"section",flat:!0,inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"__empty__",value:"__empty__",options:c,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{title:"Assign columns",type:"section",flat:!0,inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]},e=this;return b(d),d}});return{View:c}});
|
||||
define(["utils/utils","mvc/tools/tools-form-base"],function(a,b){var c=b.extend({initialize:function(c){var d=this;return this.node=workflow.active_node,this.node?(this.post_job_actions=this.node.post_job_actions||{},c=a.merge(c,{text_enable:"Set in Advance",text_disable:"Set at Runtime",is_workflow:!0,narrow:!0,initial_errors:!0,cls:"ui-portlet-narrow",update_url:galaxy_config.root+"api/workflows/build_module",update:function(a){d.node.update_field_data(a),d.form.errors(a&&a.tool_model)}}),a.deepeach(c.inputs,function(a){a.type&&-1==["data","data_collection"].indexOf(a.type)&&(a.collapsible=!0,a.collapsible_value={__class__:"RuntimeValue"})}),a.deepeach(c.inputs,function(a){a.type&&"conditional"==a.type&&(a.test_param.collapsible=!1)}),this._makeSections(c),void b.prototype.initialize.call(this,c)):void console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.")},_makeSections:function(b){var c=b.inputs,d=b.datatypes;c[a.uid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:!0,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var e=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(e){c[a.uid()]={name:"pja__"+e+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+e])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}},c[a.uid()]={name:"pja__"+e+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+e])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var f in this.node.output_terminals)c[a.uid()]=this._makeSection(f,d)}},_makeSection:function(a,b){function c(b,d){d=d||[],d.push(b);for(var e in b.inputs){var g=b.inputs[e];if(g.action){if(g.name="pja__"+a+"__"+g.action,g.argument&&(g.name+="__"+g.argument),g.payload)for(var h in g.payload){var i=g.payload[h];g.payload[g.name+"__"+h]=i,delete i}var j=f.post_job_actions[g.action+a];if(j){for(var k in d)d[k].expanded=!0;g.value=g.argument?j.action_arguments&&j.action_arguments[g.argument]||g.value:"true"}}g.inputs&&c(g,d.slice(0))}}var d=[];for(key in b)d.push({0:b[key],1:b[key]});d.sort(function(a,b){return a.label>b.label?1:a.label<b.label?-1:0}),d.unshift({0:"Sequences",1:"Sequences"}),d.unshift({0:"Roadmaps",1:"Roadmaps"}),d.unshift({0:"Leave unchanged",1:"__empty__"});var e={title:"Add Actions: '"+a+"'",type:"section",flat:!0,inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"__empty__",value:"__empty__",options:d,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{title:"Assign columns",type:"section",flat:!0,inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]},f=this;return c(e),e}});return{View:c}});
|
||||
//# sourceMappingURL=../../../maps/mvc/tools/tools-form-workflow.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return $("<div/>").text(a).html()}function d(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function e(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function f(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):g({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function g(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function h(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function i(a){$('link[href^="'+a+'"]').length||$('<link href="'+galaxy_config.root+a+'" rel="stylesheet">').appendTo("head")}function j(b,c){return b?a.defaults(b,c):c}function k(a,b){var c="";if(a>=1e11)a/=1e11,c="TB";else if(a>=1e8)a/=1e8,c="GB";else if(a>=1e5)a/=1e5,c="MB";else if(a>=100)a/=100,c="KB";else{if(!(a>0))return"<strong>-</strong>";a=10*a,c="b"}var d=Math.round(a)/10;return b?d+" "+c:"<strong>"+d+"</strong> "+c}function l(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function m(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}return{cssLoadFile:i,cssGetAttribute:h,get:f,merge:j,bytesToString:k,uid:l,time:m,request:g,sanitize:c,textify:e,validate:d,deepeach:b}});
|
||||
define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))}function d(a){return $("<div/>").text(a).html()}function e(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function f(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function g(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):h({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function h(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function i(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function j(a){$('link[href^="'+a+'"]').length||$('<link href="'+galaxy_config.root+a+'" rel="stylesheet">').appendTo("head")}function k(b,c){return b?a.defaults(b,c):c}function l(a,b){var c="";if(a>=1e11)a/=1e11,c="TB";else if(a>=1e8)a/=1e8,c="GB";else if(a>=1e5)a/=1e5,c="MB";else if(a>=100)a/=100,c="KB";else{if(!(a>0))return"<strong>-</strong>";a=10*a,c="b"}var d=Math.round(a)/10;return b?d+" "+c:"<strong>"+d+"</strong> "+c}function m(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function n(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}return{cssLoadFile:j,cssGetAttribute:i,get:g,merge:k,bytesToString:l,uid:m,time:n,request:h,sanitize:d,textify:f,validate:e,deepeach:b,isJSON:c}});
|
||||
//# sourceMappingURL=../../maps/utils/utils.js.map
|
||||
@@ -22,6 +22,7 @@ ${h.css('base', 'jquery-ui/smoothness/jquery-ui')}
|
||||
require(['mvc/tools/tools-form'], function(ToolsForm){
|
||||
$(function(){
|
||||
var form = new ToolsForm.View(${ h.dumps(self.form_config) });
|
||||
$('body').append(form.$el);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
<!--[if lt IE 9]>
|
||||
<script type='text/javascript' src="${h.url_for('/static/scripts/libs/IE/excanvas.js')}"></script>
|
||||
<![endif]-->
|
||||
|
||||
${h.js( "libs/jquery/jquery.event.drag",
|
||||
"libs/jquery/jquery.event.drop",
|
||||
"libs/jquery/jquery.event.hover",
|
||||
"libs/jquery/jquery.form",
|
||||
"libs/jquery/jstorage",
|
||||
"libs/jquery/jquery-ui",
|
||||
"galaxy.workflow_editor.canvas",
|
||||
"libs/jquery/jquery.autocomplete",
|
||||
"galaxy.autocom_tagging",
|
||||
"galaxy.workflows" )}
|
||||
"galaxy.workflows",
|
||||
"libs/bibtex" )}
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<script type='text/javascript'>
|
||||
@@ -74,7 +75,7 @@
|
||||
<%def name="stylesheets()">
|
||||
|
||||
## Include "base.css" for styling tool menu and forms (details)
|
||||
${h.css( "base", "autocomplete_tagging", "tool_menu" )}
|
||||
${h.css( "base", "autocomplete_tagging", "tool_menu", "jquery-ui/smoothness/jquery-ui" )}
|
||||
|
||||
## But make sure styles for the layout take precedence
|
||||
${parent.stylesheets()}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
## TEMPORARY SWITCH FOR THE NEW TOOL FORM
|
||||
%if util.string_as_bool(trans.app.config.get('workflow_toolform_upgrade', True)):
|
||||
${h.js("libs/bibtex", "libs/jquery/jquery-ui")}
|
||||
${h.css('jquery-ui/smoothness/jquery-ui')}
|
||||
<%
|
||||
## TEMPORARY: create tool dictionary in mako while both tool forms are in use.
|
||||
## This avoids making two separate requests since the classic form requires the mako anyway.
|
||||
@@ -16,13 +14,7 @@
|
||||
'container' : '#right-content'
|
||||
})
|
||||
%>
|
||||
<script>
|
||||
require(['mvc/tools/tools-form-workflow'], function(ToolsForm){
|
||||
$(function(){
|
||||
var form = new ToolsForm.View(${ h.dumps(self.form_config) });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
${ h.dumps(self.form_config) }
|
||||
%else:
|
||||
<%
|
||||
from galaxy.tools.parameters import DataToolParameter, RuntimeValue
|
||||
|
||||
Reference in New Issue
Block a user