From 952f3f9b7a04a6e7d3185da76d84dea0fa9bca8d Mon Sep 17 00:00:00 2001 From: guerler Date: Fri, 11 Dec 2015 03:10:17 -0500 Subject: [PATCH] Open select2 dropdown on click --- client/galaxy/scripts/mvc/ui/ui-select-default.js | 1 + client/galaxy/style/less/ui.less | 1 + static/maps/mvc/ui/ui-select-default.js.map | 2 +- static/scripts/bundled/analysis.bundled.js | 4 ++-- static/scripts/bundled/analysis.bundled.js.map | 2 +- static/scripts/bundled/libs.bundled.js.map | 2 +- static/scripts/mvc/ui/ui-select-default.js | 2 +- static/style/blue/base.css | 2 +- 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/galaxy/scripts/mvc/ui/ui-select-default.js b/client/galaxy/scripts/mvc/ui/ui-select-default.js index ab4852b767c..9299e5d4b15 100644 --- a/client/galaxy/scripts/mvc/ui/ui-select-default.js +++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js @@ -30,6 +30,7 @@ var View = Backbone.View.extend({ // link elements this.$select = this.$el.find('.select'); this.$icon_dropdown = this.$el.find('.icon-dropdown'); + this.$icon_dropdown.on( 'click', function() { self.$select.select2 && self.$select.select2( 'open' ) }); // allow regular multi-select field to be resized var minHeight = null; diff --git a/client/galaxy/style/less/ui.less b/client/galaxy/style/less/ui.less index 40579eebaf5..ccff95b31bc 100644 --- a/client/galaxy/style/less/ui.less +++ b/client/galaxy/style/less/ui.less @@ -578,6 +578,7 @@ position: absolute; top: 8px; right: 8px; + cursor: pointer; } .icon-resize { display: none; diff --git a/static/maps/mvc/ui/ui-select-default.js.map b/static/maps/mvc/ui/ui-select-default.js.map index 0ab8048af0c..356908dfec3 100644 --- a/static/maps/mvc/ui/ui-select-default.js.map +++ b/static/maps/mvc/ui/ui-select-default.js.map @@ -1 +1 @@ -{"version":3,"file":"ui-select-default.js","sources":["../../../src/mvc/ui/ui-select-default.js"],"names":["define","Utils","Buttons","View","Backbone","extend","optionsDefault","id","uid","cls","error_text","empty_text","visible","wait","multiple","searchable","optional","initialize","options","self","this","merge","setElement","_template","$select","$el","find","$icon_dropdown","minHeight","$","on","event","currentY","pageY","currentHeight","height","show","Math","max","hide","off","all_button","ButtonCheck","onclick","new_value","value","_availableOptions","trigger","prepend","addClass","prop","remove","update","data","undefined","onchange","exists","val","select2","current","_getValue","isArray","length","_size","first","text","unwait","removeClass","disabled","is","enable","disable","append","_templateOption","label","key","closeOnSelect","setOnChange","callback","validate","available","each","i","e","push","attr","_","escape"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"ui-select-default.js","sources":["../../../src/mvc/ui/ui-select-default.js"],"names":["define","Utils","Buttons","View","Backbone","extend","optionsDefault","id","uid","cls","error_text","empty_text","visible","wait","multiple","searchable","optional","initialize","options","self","this","merge","setElement","_template","$select","$el","find","$icon_dropdown","on","select2","minHeight","$","event","currentY","pageY","currentHeight","height","show","Math","max","hide","off","all_button","ButtonCheck","onclick","new_value","value","_availableOptions","trigger","prepend","addClass","prop","remove","update","data","undefined","onchange","exists","val","current","_getValue","isArray","length","_size","first","text","unwait","removeClass","disabled","is","enable","disable","append","_templateOption","label","key","closeOnSelect","setOnChange","callback","validate","available","each","i","e","push","attr","_","escape"],"mappings":"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"} \ No newline at end of file diff --git a/static/scripts/bundled/analysis.bundled.js b/static/scripts/bundled/analysis.bundled.js index de9c74da39f..bf32af2080b 100644 --- a/static/scripts/bundled/analysis.bundled.js +++ b/static/scripts/bundled/analysis.bundled.js @@ -3,8 +3,8 @@ var e=this.get("content"),i=t(e).entries[0];this.entry=i,this._fields={};var n=i this}"undefined"!=typeof t&&t.exports&&(t.exports=i)},function(t,e,i){var n,s;(function(o){n=[i(6),i(22),i(5)],s=function(t,e,i){var n=o.View.extend({tagName:"div",className:"citations",render:function(){return this.$el.append("

"+this.formattedReference()+"

"),this},formattedReference:function(){var t=this.model,e=t.entryType(),i=t.fields(),n="",s=this._asSentence((i.author?i.author:"")+(i.year?" ("+i.year+")":""))+" ",o=i.title||"",a=i.pages?"pp. "+i.pages:"",r=i.address;if("article"==e){var l=(i.volume?i.volume:"")+(i.number?" ("+i.number+")":"")+(a?", "+a:"");n=s+this._asSentence(o)+(i.journal?"In "+i.journal+", ":"")+this._asSentence(l)+this._asSentence(i.address)+""}else n="inproceedings"==e||"proceedings"==e?s+this._asSentence(o)+(i.booktitle?"In "+i.booktitle+", ":"")+(a?a:"")+(r?", "+r:"")+".":"mastersthesis"==e||"phdthesis"==e?s+this._asSentence(o)+(i.howpublished?i.howpublished+". ":"")+(i.note?i.note+".":""):"techreport"==e?s+this._asSentence(o)+this._asSentence(i.institution)+this._asSentence(i.number)+this._asSentence(i.type):"book"==e||"inbook"==e||"incollection"==e?s+" "+this._formatBookInfo(i):s+" "+this._asSentence(o)+this._asSentence(i.howpublished)+this._asSentence(i.note);var c="";i.doi&&(c="http://dx.doi.org/"+i.doi,n+='[doi:'+i.doi+"]");var d=i.url||c;return d&&(n+='[Link]'),n},_formatBookInfo:function(t){var e="";return t.chapter&&(e+=t.chapter+" in "),t.title&&(e+=""+t.title+""),t.editor&&(e+=", Edited by "+t.editor+", "),t.publisher&&(e+=", "+t.publisher),t.pages&&(e+=", pp. "+t.pages),t.series&&(e+=", "+t.series+""),t.volume&&(e+=", Vol."+t.volume),t.issn&&(e+=", ISBN: "+t.issn),e+"."},_asSentence:function(t){return t&&t.trim()?t+". ":""}}),s=o.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(t){var e=new n({model:t});this.$(".citations-formatted").append(e.render().el);var i=this.$(".citations-bibtex-text");i.val(i.val()+"\n\r"+t.attributes.content)},render:function(){this.$el.html(this.citationsElement()),this.collection.each(function(t){this.renderCitation(t)},this),this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show(),this.$(".citations-to-bibtex").hide(),this.$(".citations-bibtex").show(),this.$(".citations-formatted").hide(),this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide(),this.$(".citations-to-bibtex").show(),this.$(".citations-bibtex").hide(),this.$(".citations-formatted").show()},partialWarningElement:function(){return this.collection.partial?['
',"Warning: This is a experimental feature. Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' cite Galaxy.',"
"].join(""):""},citationsElement:function(){return['
','
',i("Citations"),' ',' ',"
",'
',this.partialWarningElement(),'',"
",'
','',"
","
"].join("")}});return{CitationView:n,CitationListView:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(o,a,r){n=[i(48),i(37),i(6),i(5)],s=function(t,e,i,n){var s=t.FoldoutListItemView,l=t.ListItemView,c=s.extend({className:s.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(t){this.linkTarget=t.linkTarget||"_blank",this.hasUser=t.hasUser,s.prototype.initialize.call(this,t)},_setUpListeners:function(){s.prototype._setUpListeners.call(this),this.model.on("change",function(t,e){o.isEqual(o.keys(t.changed),["deleted"])&&this.render()},this)},_renderSubtitle:function(){var t=a('
');switch(this.model.get("collection_type")){case"list":return t.text(n("a list of datasets"));case"paired":return t.text(n("a pair of datasets"));case"list:paired":return t.text(n("a list of paired datasets"))}return t},_getFoldoutPanelOptions:function(){var t=s.prototype._getFoldoutPanelOptions.call(this);return o.extend(t,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){var t=this.model?this.model+"":"(no model)";return"DCListItemView("+t+")"}});c.prototype.templates=function(){var t=o.extend({},s.prototype.templates.warnings,{error:i.wrapTemplate(["<% if( model.error ){ %>",'
',n("There was an error getting the data for this collection"),": <%- model.error %>","
","<% } %>"]),purged:i.wrapTemplate(["<% if( model.purged ){ %>",'
',n("This collection has been deleted and removed from disk"),"
","<% } %>"]),deleted:i.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
',n("This collection has been deleted"),"
","<% } %>"])}),e=i.wrapTemplate(['
','
','<%- collection.element_identifier || collection.name %>',"
",'
',"
"],"collection");return o.extend({},s.prototype.templates,{warnings:t,titleBar:e})}();var d=l.extend({className:l.prototype.className+" dataset-collection-element",initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log("DCEListItemView.initialize:",t),l.prototype.initialize.call(this,t)},toString:function(){var t=this.model?this.model+"":"(no model)";return"DCEListItemView("+t+")"}});d.prototype.templates=function(){var t=i.wrapTemplate(['
','
','<%- element.element_identifier %>',"
",'
',"
"],"element");return o.extend({},l.prototype.templates,{titleBar:t})}();var h=e.DatasetListItemView.extend({className:e.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log("DatasetDCEListItemView.initialize:",t),e.DatasetListItemView.prototype.initialize.call(this,t)},_fetchModelDetails:function(){var t=this;return t.model.inReadyState()&&!t.model.hasDetails()?t.model.fetch({silent:!0}):r.when()},toString:function(){var t=this.model?this.model+"":"(no model)";return"DatasetDCEListItemView("+t+")"}});h.prototype.templates=function(){var t=i.wrapTemplate(['
','','
','<%- element.element_identifier %>',"
","
"],"element");return o.extend({},e.DatasetListItemView.prototype.templates,{titleBar:t})}();var u=c.extend({className:c.prototype.className+" dataset-collection-element",_swapNewRender:function(t){c.prototype._swapNewRender.call(this,t);var e=this.model.get("state")||"ok";return this.$el.addClass("state-"+e),this.$el},toString:function(){var t=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+t+")"}});return{DCListItemView:c,DCEListItemView:d,DatasetDCEListItemView:h,NestedDCDCEListItemView:u}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(1),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(95),i(6),i(5)],s=function(t,e,i){var n="collections",s={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(t){return o.extend(t,t.object,{element_id:t.id}),delete t.object,t},constructor:function(t,e){t=this._mergeObject(t),this.idAttribute="element_id",a.Model.apply(this,arguments)},parse:function(t,e){var i=t;return i=this._mergeObject(i)}},l=a.Model.extend(e.LoggableMixin).extend(s).extend({_logNamespace:n}),c=a.Collection.extend(e.LoggableMixin).extend({_logNamespace:n,model:l,initialize:function(t,e){this.debug(this+"(DCECollection).initialize:",t,e),e=e||{}},toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),d=t.DatasetAssociation.extend(e.mixin(s,{url:function(){return this.has("history_id")?Galaxy.root+"api/histories/"+this.get("history_id")+"/contents/"+this.get("id"):(console.warn("no endpoint for non-hdas within a collection yet"),Galaxy.root+"api/datasets")},defaults:o.extend({},t.DatasetAssociation.prototype.defaults,s.defaults),constructor:function(t,e){this.debug(" DatasetDCE.constructor:",t,e),s.constructor.call(this,t,e)},initialize:function(e,i){this.debug(this+"(DatasetDCE).initialize:",e,i),t.DatasetAssociation.prototype.initialize.call(this,e,i)},hasDetails:function(){return o.has(this.attributes,"annotation")},toString:function(){var t=this.get("element_identifier");return["DatasetDCE(",t,")"].join("")}})),h=c.extend({model:d,initialize:function(t,e){this.debug(this+"(DatasetDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),u=a.Model.extend(e.LoggableMixin).extend(e.SearchableModelMixin).extend({_logNamespace:n,defaults:{collection_type:null,deleted:!1},collectionClass:c,initialize:function(t,e){this.debug(this+"(DatasetCollection).initialize:",t,e,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var t=this.get("elements")||[];return this.unset("elements",{silent:!0}),this.elements=new this.collectionClass(t),this.elements},toJSON:function(){var t=a.Model.prototype.toJSON.call(this);return this.elements&&(t.elements=this.elements.toJSON()),t},inReadyState:function(){var t=this.get("populated");return this.isDeletedOrPurged()||t},hasDetails:function(){return this.debug("hasDetails:",this.elements.length),0!==this.elements.length},getVisibleContents:function(t){return this.elements},"delete":function(t){return this.get("deleted")?r.when():this.save({deleted:!0},t)},undelete:function(t){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},t)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var t=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+t.join(",")+")"}}),p=u.extend({collectionClass:h,initialize:function(t,e){this.debug(this+"(ListDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListDatasetCollection(",this.get("name"),")"].join("")}}),f=p.extend({initialize:function(t,e){this.debug(this+"(PairDatasetCollection).initialize:",t,e),p.prototype.initialize.call(this,t,e)},toString:function(){return["PairDatasetCollection(",this.get("name"),")"].join("")}}),g=u.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",t,")"].join("")}})),m=c.extend({model:g,initialize:function(t,e){this.debug(this+"(NestedDCDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),v=f.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedPairDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",t,")"].join("")}})),_=m.extend({model:v,initialize:function(t,e){this.debug(this+"(NestedPairDCDCECollection).initialize:",t,e),m.prototype.initialize.call(this,t,e)},toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),y=u.extend({collectionClass:_,initialize:function(t,e){this.debug(this+"(ListPairedDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:p,PairDatasetCollection:f,ListPairedDatasetCollection:y}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(2),i(1))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(45),i(15),i(6),i(12),i(109),i(5),i(106)],s=function(t,e,i,n,s,c){function d(t){var e=t.toJSON(),i=g(e,{creationFn:function(e,i){return e=e.map(function(t){return{id:t.id,name:t.name,src:"dataset"===t.history_content_type?"hda":"hdca"}}),t.createHDCA(e,"list",i)}});return i}var h="collections",u=o.View.extend(i.LoggableMixin).extend({_logNamespace:h,tagName:"li",className:"collection-element",initialize:function(t){this.element=t.element||{},this.selected=t.selected||!1},render:function(){return this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})),this.selected&&this.$el.addClass("selected"),this},template:a.template(['',"<%- element.name %>","",'"].join("")),select:function(t){this.$el.toggleClass("selected",t),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var t=this,e=this.$el.parent().width();this.$el.animate({"margin-right":e},"fast",function(){t.trigger("discard",{source:t}),t.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(t){t.stopPropagation(),this.select(t)},_clickName:function(t){t.stopPropagation(),t.preventDefault();var e=([c("Enter a new name for the element"),":\n(",c("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(c("Enter a new name for the element")+":",this.element.name));e&&(this.element.name=e,this.render())},_clickDiscard:function(t){t.stopPropagation(),this.discard()},_dragstart:function(t){t.originalEvent&&(t=t.originalEvent),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(t){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(t){this.$el.parent().trigger(t)},toString:function(){return"DatasetCollectionElementView()"}}),p=o.View.extend(i.LoggableMixin).extend({_logNamespace:h,elementViewClass:u,collectionClass:t.HistoryListDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},initialize:function(t){this.metric("ListCollectionCreator.initialize",t);var e=this;a.each(this.defaultAttributes,function(i,n){i=t[n]||i,e[n]=i}),e.initialElements=t.elements||[],this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(t){t.hasOwnProperty("id")||(t.id=a.uniqueId())}),this.workingElements},_validateElements:function(){var t=this;return t.invalidElements=[],this.workingElements=this.workingElements.filter(function(e){var i=t._isElementInvalid(e);return i&&t.invalidElements.push({element:e,text:i}),!i}),this.workingElements},_isElementInvalid:function(t){return"dataset"!==t.history_content_type?c("is not a dataset"):t.state!==e.OK?c(a.contains(e.NOT_READY_STATES,t.state)?"hasn't finished running yet":"has errored, is paused, or is not accessible"):t.deleted||t.purged?c("has been deleted or purged"):null},_mangleDuplicateNames:function(){var t=900,e=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+e+")",e+=1,e>=t)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(t){},render:function(t,e){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(t,e){var i=this,n=l("
"),s=i.$list();a.each(this.elementViews,function(t){t.destroy(),i.removeElementView(t)}),i.workingElements.forEach(function(t){var e=i._createElementView(t);n.append(e.$el)}),i._renderClearSelected(),s.empty().append(n.children()),a.invoke(i.elementViews,"render"),s.height()>s.css("max-height")?s.css("border-width","1px 0px 1px 0px"):s.css("border-width","0px")},_createElementView:function(t){var e=new this.elementViewClass({element:t,selected:a.has(this.selectedIds,t.id)});return this.elementViews.push(e),this._listenToElementView(e),e},_listenToElementView:function(t){var e=this;e.listenTo(t,{select:function(t){var i=t.source.element;t.selected?e.selectedIds[i.id]=!0:delete e.selectedIds[i.id],e.trigger("elements:select",t)},discard:function(t){e.trigger("elements:discard",t)}})},addElementView:function(t){},removeElementView:function(t){delete this.selectedIds[t.element.id],this._renderClearSelected(),this.elementViews=a.without(this.elementViews,t),this.stopListening(t)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(t){return t},createList:function(t){if(!this.workingElements.length){var e=c("No valid elements for final list")+". ";return e+=''+c("Cancel")+" ",e+=c("or"),e+=' '+c("start over")+".",void this._showAlert(e)}var i=this,n=this.workingElements.map(function(t){return i._elementToJSON(t)});return i.blocking=!0,i.creationFn(n,t).always(function(){i.blocking=!1}).fail(function(t,e,n){i.trigger("error",{xhr:t,status:e,message:c("An error occurred while creating this collection")})}).done(function(t,e,n){i.trigger("collection:created",t,e,n),i.metric("collection:created",t),"function"==typeof i.oncreate&&i.oncreate.call(this,t,e,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(t){this._renderClearSelected()}),this.on("elements:discard",function(t){var e=t.source.element;this.removeElementView(t.source),this.workingElements=a.without(this.workingElements,e),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(t){this.error(t);var e=this;if(content=t.message||c("An error occurred"),t.xhr){var i=t.xhr,n=t.message;0===i.readyState&&0===i.status?content+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes."):i.responseJSON?content+=":
"+JSON.stringify(i.responseJSON)+"
":content+=": "+n}e._showAlert(content,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","click .cancel-create":function(t){"function"==typeof this.oncancel&&this.oncancel.call(this)},"click .create-collection":"_clickCreate"},_clickMoreHelp:function(t){t.stopPropagation(),this.$(".main-help").addClass("expanded"),this.$(".more-help").hide()},_clickLessHelp:function(t){t.stopPropagation(),this.$(".main-help").removeClass("expanded"),this.$(".more-help").show()},_toggleHelp:function(t){t.stopPropagation(),this.$(".main-help").toggleClass("expanded"),this.$(".more-help").toggle()},_showAlert:function(t,e){e=e||"alert-danger",this.$(".main-help").hide(),this.$(".header .alert").attr("class","alert alert-dismissable").addClass(e).show().find(".alert-message").html(t)},_hideAlert:function(t){this.$(".main-help").show(),this.$(".header .alert").hide()},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(t){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(t){t.preventDefault();var e=this.$list();this._checkForAutoscroll(e,t.originalEvent.clientY);var i=this._getNearestElement(t.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=r('
');i.size()?i.before(n):e.append(n)},_checkForAutoscroll:function(t,e){var i=2,n=t.offset(),s=t.scrollTop(),o=e-n.top,a=n.top+t.outerHeight()-e;o>=0&&o=0&&at&&t>o-a)return s}return r()},_dropElements:function(t){t.originalEvent&&(t=t.originalEvent),t.preventDefault(),t.dataTransfer.dropEffect="move";var e=this._getNearestElement(t.clientY);return e.size()?this.$dragging.insertBefore(e):this.$dragging.insertAfter(this.$(".collection-elements .collection-element").last()),this._syncOrderToDom(),!1},_syncOrderToDom:function(){var t=this,e=[];this.$(".collection-elements .collection-element").each(function(){var i=r(this).attr("data-element-id"),n=a.findWhere(t.workingElements,{id:i});n?e.push(n):console.error("missing element: ",i)}),this.workingElements=e,this._renderList()},_elementDragstart:function(t,e){e.select(!0),this.$dragging=this.$(".collection-elements .collection-element.selected")},_elementDragend:function(t,e){r(".element-drop-placeholder").remove(),this.$dragging=null},_changeName:function(t){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(t){13!==t.keyCode||this.blocking||this._clickCreate()},_getName:function(){return a.escape(this.$(".collection-name").val())},_clickCreate:function(t){var e=this._getName();e?this.blocking||this.createList(e):this._validationWarning("name")},templates:{main:a.template(['
','
',''].join("")),header:a.template(['",'
','','',"
"].join("")),middle:a.template(['",'
',"
"].join("")),footer:a.template(['
','
','','
',c("Name"),":
","
","
",'
','
','",'
','",'","
","
",'
','","
","
"].join("")),helpContent:a.template(["

",c(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"

","
    ","
  • ",c(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
  • ","
  • ",c(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
  • ","
  • ",c(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
  • ","
  • ",c(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
  • ","
  • ",c(['Click the "Cancel" button to exit the interface.'].join("")),"
  • ","

","

",c(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"

"].join("")),invalidElements:a.template([c("The following selections could not be included due to problems:"),"
    <% _.each( problems, function( problem ){ %>","
  • <%- problem.element.name %>: <%- problem.text %>
  • ","<% }); %>
"].join("")),noElementsLeft:a.template(['
  • ',c("No elements left! "),c("Would you like to "),'',c("start over"),"?","
  • "].join("")),invalidInitial:a.template(['
    ','
    ','',"<% if( _.size( problems ) ){ %>",c("The following selections could not be included due to problems"),":","
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    ","<% } else if( _.size( elements ) < 1 ){ %>",c("No datasets were selected"),".","<% } %>","
    ",c("At least one element is needed for the collection"),". ",c("You may need to "),'',c("cancel")," ",c("and reselect new elements"),".","
    ","
    ","
    ",'"].join(""))},toString:function(){return"ListCollectionCreator"}}),f=function(t,e,i){var s,o=l.Deferred(),r=Galaxy.modal||new n.View;return e=a.defaults(e||{},{elements:t,oncancel:function(){r.hide(),o.reject("cancelled")},oncreate:function(t,e){r.hide(),o.resolve(e)}}),s=new i(e),r.show({title:e.title||c("Create a collection"),body:s.$el,width:"80%",height:"min-content",closing_events:!0}),s.render(),window._collectionCreator=s,o},g=function(t,e){return e=e||{},e.title=c("Create a collection from a list of datasets"),f(t,e,p)};return{DatasetCollectionElementView:u,ListCollectionCreator:p,collectionCreatorModal:f,listCollectionCreatorModal:g,createListCollection:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1),i(1))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(48),i(15),i(26),i(6),i(5)],s=function(t,e,i,n,s){var c="dataset",d=t.ListItemView,h=d.extend({_logNamespace:c,className:d.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log(this+".initialize:",t),d.prototype.initialize.call(this,t),this.linkTarget=t.linkTarget||"_blank"},_setUpListeners:function(){d.prototype._setUpListeners.call(this), this.model.on("change",function(t,e){this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()?this.model.fetch():this.render()},this)},_fetchModelDetails:function(){var t=this;return t.model.inReadyState()&&!t.model.hasDetails()?t.model.fetch({silent:!0}):o.when()},remove:function(t,e){var i=this;t=t||this.fxSpeed,this.$el.fadeOut(t,function(){a.View.prototype.remove.call(i),e&&e.call(i)})},render:function(t){return d.prototype.render.call(this,t)},_swapNewRender:function(t){return d.prototype._swapNewRender.call(this,t),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var t=this.model.get("state");if(t===e.NOT_VIEWABLE||t===e.DISCARDED||!this.model.get("accessible"))return null;var n={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))n.disabled=!0,n.title=s("Cannot display datasets removed from disk");else if(t===e.UPLOAD)n.disabled=!0,n.title=s("This dataset must finish uploading before it can be viewed");else if(t===e.NEW)n.disabled=!0,n.title=s("This dataset is not yet viewable");else{n.title=s("View data"),n.href=this.model.urls.display;var o=this;n.onclick=function(t){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add_dataset(o.model.get("id")),t.preventDefault())}}return n.faIcon="fa-eye",i(n)},_renderDetails:function(){if(this.model.get("state")===e.NOT_VIEWABLE)return r(this.templates.noAccess(this.model.toJSON(),this));var t=d.prototype._renderDetails.call(this);return t.find(".actions .left").empty().append(this._renderSecondaryActions()),t.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),t.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(t),t},_renderSummary:function(){var t=this.model.toJSON(),e=this.templates.summaries[t.state];return(e=e||this.templates.summaries.unknown)(t,this)},_renderDetailMessages:function(){var t=this,e=r('
    '),i=t.model.toJSON();return l.each(t.templates.detailMessages,function(n){e.append(r(n(i,t)))}),e},_renderDisplayApplications:function(){return this.model.isDeletedOrPurged()?"":[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){switch(this.debug("_renderSecondaryActions"),this.model.get("state")){case e.NOT_VIEWABLE:return[];case e.OK:case e.FAILED_METADATA:case e.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return i({title:s("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:l.isEmpty(this.model.get("meta_files"))?r(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var t=this.model.urls;return r(['"].join("\n"))},events:l.extend(l.clone(d.prototype.events),{"click .display-btn":function(t){this.trigger("display",this,t)},"click .params-btn":function(t){this.trigger("params",this,t)},"click .download-btn":function(t){this.trigger("download",this,t)}}),toString:function(){var t=this.model?this.model+"":"(no model)";return"DatasetListItemView("+t+")"}});return h.prototype.templates=function(){var t=l.extend({},d.prototype.templates.warnings,{failed_metadata:n.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','
    ',s("An error occurred setting the metadata for this dataset"),"
    ","<% } %>"]),error:n.wrapTemplate(["<% if( model.error ){ %>",'
    ',s("There was an error getting the data for this dataset"),": <%- model.error %>","
    ","<% } %>"]),purged:n.wrapTemplate(["<% if( model.purged ){ %>",'
    ',s("This dataset has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:n.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',s("This dataset has been deleted"),"
    ","<% } %>"])}),i=n.wrapTemplate(['
    ','
    ','
    ','
    ','
    ',"
    ","<% if( !dataset.deleted && !dataset.purged ){ %>",'
    ','
    ','
    ',"<% if( dataset.peek ){ %>",'
    <%= dataset.peek %>
    ',"<% } %>","<% } %>","
    "],"dataset"),o=n.wrapTemplate(['
    ','
    ',s("You do not have permission to view this dataset"),"
    ","
    "],"dataset"),a={};a[e.OK]=a[e.FAILED_METADATA]=n.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'
    ','<%- dataset.misc_blurb %>',"
    ","<% } %>","<% if( dataset.file_ext ){ %>",'
    ','",'<%- dataset.file_ext %>',"
    ","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'
    ','",'',"<%- dataset.metadata_dbkey %>","","
    ","<% } %>","<% if( dataset.misc_info ){ %>",'
    ','<%- dataset.misc_info %>',"
    ","<% } %>"],"dataset"),a[e.NEW]=n.wrapTemplate(["
    ",s("This is a new dataset and not all of its data are available yet"),"
    "],"dataset"),a[e.NOT_VIEWABLE]=n.wrapTemplate(["
    ",s("You do not have permission to view this dataset"),"
    "],"dataset"),a[e.DISCARDED]=n.wrapTemplate(["
    ",s("The job creating this dataset was cancelled before completion"),"
    "],"dataset"),a[e.QUEUED]=n.wrapTemplate(["
    ",s("This job is waiting to run"),"
    "],"dataset"),a[e.RUNNING]=n.wrapTemplate(["
    ",s("This job is currently running"),"
    "],"dataset"),a[e.UPLOAD]=n.wrapTemplate(["
    ",s("This dataset is currently uploading"),"
    "],"dataset"),a[e.SETTING_METADATA]=n.wrapTemplate(["
    ",s("Metadata is being auto-detected"),"
    "],"dataset"),a[e.PAUSED]=n.wrapTemplate(["
    ",s('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"
    "],"dataset"),a[e.ERROR]=n.wrapTemplate(["<% if( !dataset.purged ){ %>","
    <%- dataset.misc_blurb %>
    ","<% } %>",'',s("An error occurred with this dataset"),":",'
    <%- dataset.misc_info %>
    '],"dataset"),a[e.EMPTY]=n.wrapTemplate(["
    ",s("No data"),": <%- dataset.misc_blurb %>
    "],"dataset"),a.unknown=n.wrapTemplate(['
    Error: unknown dataset state: "<%- dataset.state %>"
    '],"dataset");var r={resubmitted:n.wrapTemplate(["<% if( model.resubmitted ){ %>",'
    ',s("The job creating this dataset has been resubmitted"),"
    ","<% } %>"])},c=n.wrapTemplate(["<% _.each( apps, function( app ){ %>",'
    ','<%- app.label %> ','',"<% _.each( app.links, function( link ){ %>",'',"<% print( _l( link.text ) ); %>"," ","<% }); %>","","
    ","<% }); %>"],"apps");return l.extend({},d.prototype.templates,{warnings:t,details:i,noAccess:o,summaries:a,detailMessages:r,displayApplications:c})}(),{DatasetListItemView:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(1),i(2),i(1),i(3))},function(t,e,i){var n,s;(function(o,a){n=[i(4)],s=function(t){return o.Model.extend({initialize:function(t){this.app=t},checksum:function(){var t="",e=this;return this.app.section.$el.find(".section-row").each(function(){var i=a(this).attr("id"),n=e.app.field_list[i];n&&(t+=i+":"+JSON.stringify(n.value&&n.value())+":"+n.collapsed+";")}),t},create:function(){function t(t,e,n){i.map_dict[t]=e,s[t]=n}function e(n,s){for(var o in s){var a=s[o];if(a.input){var r=a.input,l=n;switch(""!=n&&(l+="|"),l+=r.name,r.type){case"repeat":var c="section-",d=[],h=null;for(var u in a){var p=u.indexOf(c);-1!=p&&(p+=c.length,d.push(parseInt(u.substr(p))),h||(h=u.substr(0,p)))}d.sort(function(t,e){return t-e});var o=0;for(var f in d)e(l+"_"+o++,a[h+d[f]]);break;case"conditional":var g=i.app.field_list[r.id].value();t(l+"|"+r.test_param.name,r.id,g);var m=i.matchCase(r,g);-1!=m&&e(l,s[r.id+"-section-"+m]);break;case"section":e(!r.flat&&l||"",a);break;default:var v=i.app.field_list[r.id];if(v&&v.value){var g=v.value();if((void 0===r.ignore||r.ignore!=g)&&(v.collapsed&&r.collapsible_value&&(g=r.collapsible_value),t(l,r.id,g),r.payload))for(var _ in r.payload)t(_,r.id,r.payload[_])}}}}}var i=this,n={};this._iterate(this.app.section.$el,n);var s={};return this.map_dict={},e("",n),s},match:function(t){return this.map_dict&&this.map_dict[t]},matchCase:function(t,e){"boolean"==t.test_param.type&&(e="true"==e?t.test_param.truevalue||"true":t.test_param.falsevalue||"false");for(var i in t.cases)if(t.cases[i].value==e)return i;return-1},matchModel:function(t,e){function i(t,n){for(var o in n){var a=n[o],r=a.name;switch(""!=t&&(r=t+"|"+r),a.type){case"repeat":for(var l in a.cache)i(r+"_"+l,a.cache[l]);break;case"conditional":var c=a.test_param&&a.test_param.value,d=s.matchCase(a,c);-1!=d&&i(r,a.cases[d].inputs);break;case"section":i(r,a.inputs);break;default:var h=s.map_dict[r];h&&e(h,a)}}}var n={},s=this;return i("",t.inputs),n},matchResponse:function(t){function e(t,s){if("string"==typeof s){var o=n.map_dict[t];o&&(i[o]=s)}else for(var a in s){var r=a;if(""!==t){var l="|";s instanceof Array&&(l="_"),r=t+l+r}e(r,s[a])}}var i={},n=this;return e("",t),i},_iterate:function(t,e){var i=this,n=a(t).children();n.each(function(){var t=this,n=a(t).attr("id");if(a(t).hasClass("section-row")){e[n]={};var s=i.app.input_list[n];s&&(e[n]={input:s}),i._iterate(t,e[n])}else i._iterate(t,e)})}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(i){n=[],s=function(){return i.View.extend({initialize:function(t,e){this.app=t,this.text_enable=t.options.text_enable||"Enable",this.text_disable=t.options.text_disable||"Disable",this.cls_enable=t.options.cls_enable||"fa fa-caret-square-o-down",this.cls_disable=t.options.cls_disable||"fa fa-caret-square-o-up",this.field=e.field,this.default_value=e.default_value,this.setElement(this._template(e)),this.$field=this.$el.find(".ui-table-form-field"),this.$optional=this.$el.find(".ui-table-form-optional"),this.$optional_icon=this.$el.find(".ui-table-form-optional").find(".icon"),this.$error_text=this.$el.find(".ui-table-form-error-text"),this.$error=this.$el.find(".ui-table-form-error"),this.$field.prepend(this.field.$el),this.field.collapsed=e.collapsible&&e.value&&JSON.stringify(e.value)==JSON.stringify(e.collapsible_value),this._refresh();var i=this;this.$optional.on("click",function(){i.field.collapsed=!i.field.collapsed,i._refresh(),i.app.trigger("change")})},error:function(t){this.$error_text.html(t),this.$error.show(),this.$el.addClass("ui-error")},reset:function(){this.$error.hide(),this.$el.removeClass("ui-error")},_refresh:function(){this.$optional_icon.removeClass().addClass("icon"),this.field.collapsed?(this.$field.hide(),this._tooltip(this.text_enable,this.cls_enable),this.field.value&&this.field.value(this.default_value)):(this.$field.fadeIn("fast"),this._tooltip(this.text_disable,this.cls_disable),this.app.trigger("change"))},_tooltip:function(t,e){this.$optional.length&&this.$optional_icon.addClass(e).tooltip({placement:"bottom"}).attr("data-original-title",t).tooltip("fixTitle").tooltip("hide")},_template:function(t){var e='
    ';return e+=t.collapsible?'
    '+t.label+"
    ":t.label,e+='
    ',e+='
    ',t.help&&(e+=t.help,t.argument&&-1==t.help.indexOf("("+t.argument+")")&&(e+=" ("+t.argument+")")),e+="
    ",e+="
    "}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(o,a){n=[i(4),i(7),i(43),i(57),i(56),i(53)],s=function(t,e,i,n,s,r){return o.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(t,e){this.app=t},create:function(t){void 0===t.value&&(t.value=null),void 0===t.default_value&&(t.default_value=t.value);var e=null,i=this.types[t.type];return i&&"function"==typeof this[i]&&(e=this[i].call(this,t)),e||(this.app.incompatible=!0,e=t.options?this._fieldSelect(t):this._fieldText(t),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+t.type+").")),void 0!==t.value&&e.value(t.value),e},_fieldData:function(e){if(this.app.options.is_workflow)return e.info="Data input '"+e.name+"' ("+t.textify(e.extensions.toString())+")",e.value=null,this._fieldHidden(e);var n=this;return new i.View(this.app,{id:"field-"+e.id,extensions:e.extensions,optional:e.optional,multiple:e.multiple,type:e.type,data:e.options,onchange:function(){n.app.trigger("change")}})},_fieldSelect:function(t){if(0==t.options.length&&this.app.options.is_workflow)return this._fieldText(t);"data_column"==t.type&&(t.error_text="Missing columns in referenced dataset.");var i=[];for(var n in t.options){var s=t.options[n];i.push({label:s[0],value:s[1]})}var o=e.Select;switch(t.display){case"checkboxes":o=e.Checkbox;break;case"radio":o=e.Radio}var a=this;return new o.View({id:"field-"+t.id,data:i,error_text:t.error_text||"No options available",optional:t.optional&&null===t.default_value,multiple:t.multiple,optional:t.optional,searchable:t.searchable,onchange:function(){a.app.trigger("change")}})},_fieldDrilldown:function(t){if(0==t.options.length&&this.app.options.is_workflow)return this._fieldText(t);var i=this;return new e.Drilldown.View({id:"field-"+t.id,data:t.options,display:t.display,onchange:function(){i.app.trigger("change")}})},_fieldText:function(i){if(i.options)if(i.area=i.multiple,t.validate(i.value)){if(a.isArray(i.value)){var n="";for(var s in i.value){if(n+=String(i.value[s]),!i.multiple)break;n+="\n"}i.value=n}}else i.value="";var o=this;return new e.Input({id:"field-"+i.id,area:i.area,onchange:function(){o.app.trigger("change")}})},_fieldSlider:function(t){var i=this;return new e.Slider.View({id:"field-"+t.id,precise:"float"==t.type,min:t.min,max:t.max,onchange:function(){i.app.trigger("change")}})},_fieldHidden:function(t){return new e.Hidden({id:"field-"+t.id,info:t.info})},_fieldBoolean:function(t){var i=this;return new e.RadioButton.View({id:"field-"+t.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){i.app.trigger("change")}})},_fieldColor:function(t){var e=this;return new r({id:"field-"+t.id,onchange:function(){e.app.trigger("change")}})},_fieldLibrary:function(t){var e=this;return new n.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})},_fieldFtp:function(t){var e=this;return new s.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o,a){n=[i(4),i(18),i(10),i(7)],s=function(t,e,i,n){var s=o.View.extend({optionsDefault:{title:"Section",max:null,min:null},initialize:function(i){this.options=t.merge(i,this.optionsDefault),this.setElement("
    ");this.button_new=new n.ButtonIcon({icon:"fa-plus",title:"Insert "+i.title_new,tooltip:"Add new "+i.title_new+" block",floating:"clear",onclick:function(){i.onnew&&i.onnew()}}),this.table=new e.View({cls:"ui-table-plain",content:""}),this.$el.append(this.table.$el),this.$el.append(a("
    ").append(this.button_new.$el)),this.list={},this.n=0},size:function(){return this.n},add:function(t){if(!t.id||this.list[t.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate repeat block id.");this.n++;var e=new n.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain",onclick:function(){t.ondel&&t.ondel()}}),s=new i.View({id:t.id,title:"placeholder",cls:"ui-portlet-repeat",operations:{button_delete:e}});s.append(t.$el),s.$el.addClass("section-row"),this.list[t.id]=s,this.table.add(s.$el),this.table.append("row_"+t.id,!0),this.options.max>0&&this.n>=this.options.max&&this.button_new.disable(),this._refresh()},del:function(t){if(!this.list[t])return void Galaxy.emit.debug("form-repeat::del()","Invalid repeat block id.");this.n--;var e=this.table.get("row_"+t);e.remove(),delete this.list[t],this.button_new.enable(),this._refresh()},_refresh:function(){var t=0;for(var e in this.list){var i=this.list[e];i.title(++t+": "+this.options.title),this.n>this.options.min?i.showOperation("button_delete"):i.hideOperation("button_delete")}}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(4),i(18),i(7),i(10),i(41),i(39),i(40)],s=function(t,e,i,n,s,c,d){var h=o.View.extend({initialize:function(t,i){this.app=t,this.inputs=i.inputs,i.cls="ui-table-plain",i.cls_tr="section-row",this.table=new e.View(i),this.parameters=new d(t,i),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var t in this.inputs)this.add(this.inputs[t])},add:function(e){var i=a.extend(!0,{},e);i.id=e.id=t.uid(),this.app.input_list[i.id]=i;var n=i.type;switch(n){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(t){var e=this;t.test_param.id=t.id;var i=this._addRow(t.test_param);i.options.onchange=function(i){var n=e.app.data.matchCase(t,i);for(var s in t.cases){var o=t.cases[s],a=t.id+"-section-"+s,r=e.table.get(a),l=!1;for(var c in o.inputs)if(!o.inputs[c].hidden){l=!0;break}s==n&&l?r.fadeIn("fast"):r.hide()}e.app.trigger("change")};for(var n in t.cases){var s=t.id+"-section-"+n,o=new h(this.app,{inputs:t.cases[n].inputs});o.$el.addClass("ui-table-section"),this.table.add(o.$el),this.table.append(s)}i.trigger("change")},_addRepeat:function(t){function e(e){var s=t.id+"-section-"+n++,a=new h(i.app,{inputs:e});o.add({id:s,$el:a.$el,ondel:function(){o.del(s),i.app.trigger("change")}})}for(var i=this,n=0,o=new s.View({title:t.title,title_new:t.title,min:t.min,max:t.max,onnew:function(){e(t.inputs),i.app.trigger("change")}}),a=t.min,l=r.size(t.cache),d=0;dd?t.cache[d]:t.inputs,e(u)}var p=new c(this.app,{label:t.title,help:t.help,field:o});this.table.add(p.$el),this.table.append(t.id)},_addSection:function(t){var e=this,s=new h(e.app,{inputs:t.inputs}),o=new i.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),a=new n.View({title:t.title,cls:"ui-portlet-section",operations:{button_visible:o}});a.append(s.$el),a.append(l("
    ").addClass("ui-table-form-info").html(t.help));var r=!1;a.$content.hide(),a.$header.css("cursor","pointer"),a.$header.on("click",function(){r?(r=!1,a.$content.hide(),o.setIcon("fa-eye-slash")):(r=!0,a.$content.fadeIn("fast"),o.setIcon("fa-eye"))}),this.app.on("expand",function(t){a.$el.find("#"+t).length>0&&!r&&a.$header.trigger("click")}),t.expanded&&a.$header.trigger("click"),this.table.add(a.$el),this.table.append(t.id)},_addRow:function(t){var e=t.id,i=this.parameters.create(t);this.app.field_list[e]=i;var n=new c(this.app,{name:t.name,label:t.label||t.name,value:t.value,default_value:t.default_value,collapsible:t.collapsible,collapsible_value:t.collapsible_value,help:t.help,argument:t.argument,field:i});return this.app.element_list[e]=n,this.table.add(n.$el),this.table.append(e),t.hidden&&this.table.get(e).hide(),i}});return{View:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(4),i(7),i(31),i(16)],s=function(t,e,i,n){var s=o.View.extend({initialize:function(i,n){this.app=i,this.options=n,this.history={};var s=this;this.setElement('
    '),this.list={};var o=[];"data_collection"==n.type?this.mode="collection":n.multiple?this.mode="multiple":this.mode="single",this.current=this.mode,this.list={};var l=t.textify(n.extensions),c="No dataset available.";l&&(c="No "+l+" dataset available.");var d="No dataset list available.";if(l&&(d="No "+l+" dataset collection available."),"single"==this.mode&&(o.push({icon:"fa-file-o",value:"single",tooltip:"Single dataset"}),this.select_single=new e.Select.View({optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.single={field:this.select_single,type:"hda"}),("single"==this.mode||"multiple"==this.mode)&&(o.push({icon:"fa-files-o",value:"multiple",tooltip:"Multiple datasets"}),this.select_multiple=new e.Select.View({multiple:!0,searchable:!1,optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.multiple={field:this.select_multiple,type:"hda"}),"single"==this.mode||"multiple"==this.mode||"collection"==this.mode){o.push({icon:"fa-folder-o",value:"collection",tooltip:"Dataset collection"});var h="multiple"==this.mode;this.select_collection=new e.Select.View({error_text:d,multiple:h,searchable:!1,optional:n.optional,onchange:function(){s.trigger("change")}}),this.list.collection={field:this.select_collection,type:"hdca"}}this.button_type=new e.RadioButton.View({value:this.current,data:o,onchange:function(t){s.current=t,s.refresh(),s.trigger("change")}}),this.$batch=a(this.template_batch());var u=r.size(this.list),p=0;u>1&&(this.$el.append(this.button_type.$el),p=Math.max(0,35*r.size(this.list))+"px");for(var f in this.list)this.$el.append(this.list[f].field.$el.css({"margin-left":p}));this.$el.append(this.$batch.css({"margin-left":p})),this.update(n.data),void 0!==this.options.value&&this.value(this.options.value),this.refresh(),this.on("change",function(){n.onchange&&n.onchange(s.value())})},wait:function(){for(var t in this.list)this.list[t].field.wait()},unwait:function(){for(var t in this.list)this.list[t].field.unwait()},update:function(t){function e(t,e){if(t){var n=[];for(var s in e){var o=e[s];n.push({label:o.hid+": "+o.name,value:o.id}),i.history[o.id+"_"+o.src]=o}t.update(n)}}var i=this;e(this.select_single,t.hda),e(this.select_multiple,t.hda),e(this.select_collection,t.hdca)},value:function(t){if(void 0!==t)if(t&&t.values)try{var e=[];for(var i in t.values)e.push(t.values[i].id);t&&t.values.length>0&&"hdca"==t.values[0].src?(this.current="collection",this.select_collection.value(e)):"multiple"==this.mode?(this.current="multiple",this.select_multiple.value(e)):(this.current="single",this.select_single.value(e[0]))}catch(n){Galaxy.emit.debug("tools-select-content::value()","Skipped.")}else for(var i in this.list)this.list[i].field.value(null);this.refresh();var s=this._select().value();if(null===s)return null;if(s instanceof Array||(s=[s]),0===s.length)return null;var o={batch:this._batch(),values:[]};for(var i in s){var a=this.history[s[i]+"_"+this.list[this.current].type];if(!a)return null;o.values.push(a)}return o.values.sort(function(t,e){return t.hid-e.hid}),o},refresh:function(){this.button_type.value(this.current);for(var t in this.list){var e=this.list[t].field.$el;this.current==t?e.show():e.hide()}this._batch()?this.$batch.show():this.$batch.hide()},_select:function(){return this.list[this.current].field},_batch:function(){if("collection"==this.current){var t=this.history[this._select().value()+"_hdca"];if(t&&t.map_over_type)return!0}return"single"!=this.current&&"single"==this.mode?!0:!1},template_batch:function(){return'
    This is a batch mode input field. A separate job will be triggered for each dataset.
    '}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3))},function(t,e,i){var n,s;(function(o,a,r){n=[i(4),i(10),i(7),i(42),i(38)],s=function(t,e,i,n,s){return o.View.extend({initialize:function(e){this.optionsDefault={is_workflow:!1,initial_errors:!1,cls:"ui-portlet-limited"},this.options=t.merge(e,this.optionsDefault),Galaxy.emit.debug("form-view::initialize()","Ready to build form.",this.options);var n=parent.Galaxy;n&&n.modal?this.modal=n.modal:this.modal=new i.Modal.View,this.setElement("
    "),this._build()},update:function(t){var e=this;this.data.matchModel(t,function(t,i){var n=e.input_list[t];if(n&&n.options&&!a.isEqual(n.options,i.options)){n.options=i.options;var s=e.field_list[t];if(s.update){var o=[];if(-1!=["data","data_collection","drill_down"].indexOf(n.type))o=n.options;else for(var r in i.options){var l=i.options[r];l.length>2&&o.push({label:l[0],value:l[1]})}s.update(o),s.trigger("change"),Galaxy.emit.debug("form-view::update()","Updating options for "+t)}}})},wait:function(t){for(var e in this.input_list){var i=this.field_list[e],n=this.input_list[e];n.is_dynamic&&i.wait&&i.unwait&&(t?i.wait():i.unwait())}},highlight:function(t,e,i){var n=this.element_list[t];if(n&&(n.error(e||"Please verify this parameter."),this.trigger("expand",t),!i))if(self==top){var s=this.$el.parents().filter(function(){return"auto"==r(this).css("overflow")}).first();s.animate({scrollTop:s.scrollTop()+n.$el.offset().top-50},500)}else r("html, body").animate({scrollTop:n.$el.offset().top-20},500)},errors:function(t){if(this.trigger("reset"),t&&t.errors){var e=this.data.matchResponse(t.errors);for(var i in this.element_list){this.element_list[i];e[i]&&this.highlight(i,e[i],!0)}}},_build:function(){var t=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new s(this),this._renderForm(),this.data.create(),this.options.initial_errors&&this.errors(this.options);var e=this.data.checksum();this.on("change",function(){var i=t.data.checksum();i!=e&&(e=i,t.options.onchange&&t.options.onchange())}),this.on("reset",function(){for(var t in this.element_list)this.element_list[t].reset()})},_renderForm:function(){this.message=new i.Message,this.section=new n.View(this,{inputs:this.options.inputs}),r(".tooltip").remove(),this.portlet=new e.View({icon:"fa-wrench",title:this.options.title,cls:this.options.cls,operations:this.options.operations,buttons:this.options.buttons}),this.portlet.append(this.message.$el.addClass("ui-margin-top")),this.portlet.append(this.section.$el),this.$el.empty(),this.$el.append(this.portlet.$el),this.options.message&&this.message.update({persistent:!0,status:"warning",message:this.options.message}),Galaxy.emit.debug("form-view::initialize()","Completed")}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(o){n=[i(35),i(46),i(5)],s=function(t,e,i){function n(t){return function(e,i){return this.isNew()&&(i=i||{},i.url=this.urlRoot+this.get("history_id")+"/contents",e=e||{},e.type="dataset_collection"),t.call(this,e,i)}}var s=e.HistoryContentMixin,a=t.ListDatasetCollection,r=t.PairDatasetCollection,l=t.ListPairedDatasetCollection,c=a.extend(s).extend({defaults:o.extend(o.clone(a.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list",model_class:"HistoryDatasetCollectionAssociation"}),initialize:function(t,e){a.prototype.initialize.call(this,t,e),s.initialize.call(this,t,e)},save:n(a.prototype.save),toString:function(){return["HistoryListDatasetCollection(",this.get("name"),")"].join("")}}),d=r.extend(s).extend({defaults:o.extend(o.clone(r.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"paired",model_class:"HistoryDatasetCollectionAssociation"}),initialize:function(t,e){r.prototype.initialize.call(this,t,e),s.initialize.call(this,t,e)},save:n(r.prototype.save),toString:function(){return["HistoryPairDatasetCollection(",this.get("name"),")"].join("")}}),h=l.extend(s).extend({defaults:o.extend(o.clone(l.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list:paired",model_class:"HistoryDatasetCollectionAssociation"}),initialize:function(t,e){l.prototype.initialize.call(this,t,e),s.initialize.call(this,t,e)},save:n(l.prototype.save),toString:function(){return["HistoryListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{HistoryListDatasetCollection:c,HistoryPairDatasetCollection:d,HistoryListPairedDatasetCollection:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3))},function(t,e,i){var n,s;(function(o,a){n=[i(15),i(6),i(5)],s=function(t,e,i){var n="history",s=function(t,e){return[t,e].join("-")},r={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",constructor:function(t,e){t.type_id=s(t.history_content_type,t.id),this.debug("HistoryContentMixin.constructor:",t.type_id),o.Model.apply(this,arguments)},_typeIdStr:function(){return s(this.get("history_content_type"),this.get("id"))},initialize:function(t,e){this.on("change:id",this._createTypeId)},_createTypeId:function(){this.set("type_id",this._typeIdStr())},isNew:function(){return!this.get("id")},hidden:function(){return!this.get("visible")},isVisible:function(t,e){var i=!0;return t||!this.get("deleted")&&!this.get("purged")||(i=!1),e||this.get("visible")||(i=!1),i},urlRoot:Galaxy.root+"api/histories/",url:function(){var t=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return t},hide:function(t){return this.get("visible")?this.save({visible:!1},t):a.when()},unhide:function(t){return this.get("visible")?a.when():this.save({visible:!0},t)},toString:function(){var t=this.get("id")||"";return this.get("name")&&(t=this.get("hid")+' :"'+this.get("name")+'",'+t),"HistoryContent("+t+")"}},l=o.Model.extend(e.LoggableMixin).extend(r).extend({_logNamespace:n});return{typeIdStr:s,HistoryContentMixin:r,HistoryContent:l}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(46),i(97),i(45),i(6),i(5)],s=function(t,e,i,n,s){var l="history",c=o.Collection.extend(n.LoggableMixin).extend({_logNamespace:l,model:function(t,n){if("dataset"===t.history_content_type)return new e.HistoryDatasetAssociation(t,n);if("dataset_collection"===t.history_content_type){switch(t.collection_type){case"list":return new i.HistoryListDatasetCollection(t,n);case"paired":return new i.HistoryPairDatasetCollection(t,n);case"list:paired":return new i.HistoryListPairedDatasetCollection(t,n)}return{validationError:"Unknown collection_type: "+t.history_content_type }}return{validationError:"Unknown history_content_type: "+t.history_content_type}},initialize:function(t,e){e=e||{},this.historyId=e.historyId,this.model.prototype.idAttribute="type_id",this.on("all",function(){this.debug(this+".event:",arguments)})},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},ids:function(){return this.map(function(t){return t.get("id")})},notReady:function(){return this.filter(function(t){return!t.inReadyState()})},running:function(){var t=[];return this.each(function(e){var i=!e.inReadyState();i&&t.push(e.get("id"))}),t},getByHid:function(t){return a.first(this.filter(function(e){return e.get("hid")===t}))},getVisible:function(t,e,i){i=i||[],this.debug("checking isVisible");var n=new c(this.filter(function(i){return i.isVisible(t,e)}));return a.each(i,function(t){a.isFunction(t)&&(n=new c(n.filter(t)))}),n},hidden:function(){function t(t){return t.hidden()}return new c(this.filter(t))},deleted:function(){function t(t){return t.get("deleted")}return new c(this.filter(t))},haveDetails:function(){return this.all(function(t){return t.hasDetails()})},fetchAllDetails:function(t){t=t||{};var e={details:"all"};return t.data=t.data?a.extend(t.data,e):e,this.fetch(t)},ajaxQueue:function(t,e){var i=r.Deferred(),n=this.length,s=[];if(!n)return i.resolve([]),i;var o=this.chain().reverse().map(function(a,r){return function(){var l=t.call(a,e);l.done(function(t){i.notify({curr:r,total:n,response:t,model:a})}),l.always(function(t){s.push(t),o.length?o.shift()():i.resolve(s)})}}).value();return o.shift()(),i},isCopyable:function(t){var e=["HistoryDatasetAssociation","HistoryDatasetCollectionAssociation"];return a.isObject(t)&&t.id&&a.contains(e,t.model_class)},copy:function(t){var e,i,n;a.isString(t)?(e=t,n="hda",i="dataset"):(e=t.id,n={HistoryDatasetAssociation:"hda",LibraryDatasetDatasetAssociation:"ldda",HistoryDatasetCollectionAssociation:"hdca"}[t.model_class]||"hda",i="hdca"===n?"dataset_collection":"dataset");var s=this,o=r.post(this.url(),{content:e,source:n,type:i}).done(function(t){s.add([t])}).fail(function(t,a,r){s.trigger("error",s,o,{},"Error copying contents",{type:i,id:e,source:n})});return o},matches:function(t){return this.filter(function(e){return e.matches(t)})},set:function(e,i){e=a.isArray(e)?e:[e],a.each(e,function(e){e.type_id&&e.get&&e.get("type_id")||(e.type_id=t.typeIdStr(e.history_content_type,e.id))}),o.Collection.prototype.set.call(this,e,i)},createHDCA:function(t,e,n,s){var o=this,a={list:i.HistoryListDatasetCollection,paired:i.HistoryPairDatasetCollection},r=new a[e]({history_id:this.historyId,name:n,element_identifiers:t});return r.save().done(function(t){o.add(r)}).fail(function(t,e,i){o.trigger("error",t,e,i)})},clone:function(){var t=o.Collection.prototype.clone.call(this);return t.historyId=this.historyId,t},print:function(){var t=this;t.each(function(e){t.debug(e),e.elements&&t.debug(" elements:",e.elements)})},toString:function(){return["HistoryContents(",[this.historyId,this.length].join(),")"].join("")}});return{HistoryContents:c}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(6),i(5)],s=function(t,e){var i="list",n=o.View.extend(t.LoggableMixin).extend({_logNamespace:i,initialize:function(t){this.expanded=t.expanded||!1,this.log(" expanded:",this.expanded),this.fxSpeed=void 0!==t.fxSpeed?t.fxSpeed:this.fxSpeed},fxSpeed:"fast",render:function(t){var e=this._buildNewRender();return this._setUpBehaviors(e),this._queueNewRender(e,t),this},_buildNewRender:function(){var t=a(this.templates.el(this.model.toJSON(),this));return this.expanded&&this.$details(t).replaceWith(this._renderDetails().show()),t},_queueNewRender:function(t,e){e=void 0===e?this.fxSpeed:e;var i=this;a(i).queue("fx",[function(t){this.$el.fadeOut(e,t)},function(e){i._swapNewRender(t),e()},function(t){this.$el.fadeIn(e,t)},function(t){this.trigger("rendered",i),t()}])},_swapNewRender:function(t){return this.$el.empty().attr("class",r.isFunction(this.className)?this.className():this.className).append(t.children())},_setUpBehaviors:function(t){t=t||this.$el,t.find("[title]").tooltip({placement:"bottom"})},$details:function(t){return t=t||this.$el,t.find("> .details")},_renderDetails:function(){var t=a(this.templates.details(this.model.toJSON(),this));return this._setUpBehaviors(t),t},toggleExpanded:function(t){return t=void 0===t?!this.expanded:t,t?this.expand():this.collapse(),this},expand:function(){var t=this;return t._fetchModelDetails().always(function(){t._expand()})},_fetchModelDetails:function(){return this.model.hasDetails()?l.when():this.model.fetch()},_expand:function(){var t=this,e=t._renderDetails();t.$details().replaceWith(e),t.expanded=!0,t.$details().slideDown({duration:t.fxSpeed,step:function(){t.trigger("expanding",t)},complete:function(){t.trigger("expanded",t)}})},collapse:function(){this.debug(this+"(ExpandableView).collapse");var t=this;t.expanded=!1,this.$details().slideUp({duration:t.fxSpeed,step:function(){t.trigger("collapsing",t)},complete:function(){t.trigger("collapsed",t)}})}}),s=n.extend(t.mixin(t.SelectableViewMixin,t.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(e){n.prototype.initialize.call(this,e),t.SelectableViewMixin.initialize.call(this,e),t.DraggableViewMixin.initialize.call(this,e),this._setUpListeners()},_setUpListeners:function(){return this.on("selectable",function(t){t?this.$(".primary-actions").hide():this.$(".primary-actions").show()},this),this},_buildNewRender:function(){var t=n.prototype._buildNewRender.call(this);return t.children(".warnings").replaceWith(this._renderWarnings()),t.children(".title-bar").replaceWith(this._renderTitleBar()),t.children(".primary-actions").append(this._renderPrimaryActions()),t.find("> .title-bar .subtitle").replaceWith(this._renderSubtitle()),t},_swapNewRender:function(t){return n.prototype._swapNewRender.call(this,t),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var t=this,e=a('
    '),i=t.model.toJSON();return r.each(t.templates.warnings,function(n){e.append(a(n(i,t)))}),e},_renderTitleBar:function(){return a(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return a(this.templates.subtitle(this.model.toJSON(),this))},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(t){t.stopPropagation(),t.altKey?(this.toggleSelect(t),this.selectable||this.showSelector()):this.toggleExpanded()},_keyDownTitleBar:function(t){var e=32,i=13;return!t||"keydown"!==t.type||t.keyCode!==e&&t.keyCode!==i?!0:(this.toggleExpanded(),t.stopPropagation(),!1)},toString:function(){var t=this.model?this.model+"":"(no model)";return"ListItemView("+t+")"}}));s.prototype.templates=function(){var e=t.wrapTemplate(['
    ','
    ','
    ','',"
    ",'
    ','
    ','
    ',"
    "]),i={},n=t.wrapTemplate(['
    ','','
    ','<%- element.name %>',"
    ",'
    ',"
    "],"element"),s=t.wrapTemplate(['
    ']),o=t.wrapTemplate(['
    ']);return{el:e,warnings:i,titleBar:n,subtitle:s,details:o}}();var c=s.extend({foldoutStyle:"foldout",foldoutPanelClass:null,initialize:function(t){"drilldown"===this.foldoutStyle&&(this.expanded=!1),this.foldoutStyle=t.foldoutStyle||this.foldoutStyle,this.foldoutPanelClass=t.foldoutPanelClass||this.foldoutPanelClass,s.prototype.initialize.call(this,t),this.foldout=this._createFoldoutPanel()},_renderDetails:function(){if("drilldown"===this.foldoutStyle)return a();var t=s.prototype._renderDetails.call(this);return this._attachFoldout(this.foldout,t)},_createFoldoutPanel:function(){var t=this.model,e=this._getFoldoutPanelClass(t),i=this._getFoldoutPanelOptions(t),n=new e(r.extend(i,{model:t}));return n},_getFoldoutPanelClass:function(){return this.foldoutPanelClass},_getFoldoutPanelOptions:function(){return{foldoutStyle:this.foldoutStyle,fxSpeed:this.fxSpeed}},_attachFoldout:function(t,e){return e=e||this.$("> .details"),this.foldout=t.render(0),t.$("> .controls").hide(),e.append(t.$el)},expand:function(){var t=this;return t._fetchModelDetails().always(function(){"foldout"===t.foldoutStyle?t._expand():"drilldown"===t.foldoutStyle&&t._expandByDrilldown()})},_expandByDrilldown:function(){var t=this;t.foldout.on("close",function(){t.trigger("collapsed:drilldown",t,t.foldout)}),t.trigger("expanded:drilldown",t,t.foldout)}});return c.prototype.templates=function(){var e=t.wrapTemplate(['
    ',"
    "],"collection");return r.extend({},s.prototype.templates,{details:e})}(),{ExpandableView:n,ListItemView:s,FoldoutListItemView:c}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3),i(1))},function(t,e,i){var n,s;(function(o,a){n=[i(4),i(61),i(7),i(44),i(16),i(22),i(33)],s=function(t,e,i,n,s,r,l){return o.View.extend({initialize:function(i){if(this.options=t.merge(i,{}),this.setElement("
    "),this.deferred=new e,i.inputs)this._buildForm(i);else{var n=this;this.deferred.execute(function(t){n._buildModel(t,i,!0)})}},remove:function(){var t=this;this.$el.hide(),this.deferred.execute(function(){o.View.prototype.remove.call(t),Galaxy.emit.debug("tools-form-base::remove()","Destroy view.")})},_buildForm:function(e){var i=this;this.options=t.merge(e,this.options),this.options=t.merge({icon:"fa-wrench",title:""+e.name+" "+e.description+" (Galaxy Tool Version "+e.version+")",operations:this._operations(),onchange:function(){i.deferred.reset(),i.deferred.execute(function(t){i._updateModel(t)})}},this.options),this.options.customize&&this.options.customize(this.options),this.form=new n(this.options),this._footer(),this.$el.empty(),this.$el.append(this.form.$el)},_buildModel:function(e,n,s){var o=this;this.options.id=n.id,this.options.version=n.version;var r="",l={};n.job_id?r=Galaxy.root+"api/jobs/"+n.job_id+"/build_for_rerun":(r=Galaxy.root+"api/tools/"+n.id+"/build",Galaxy.params&&Galaxy.params.tool_id==n.id&&(l=a.extend({},Galaxy.params),n.version&&(l.tool_version=n.version))),t.request({type:"GET",url:r,data:l,success:function(t){o._buildForm(t.tool_model||t),!s&&o.form.message.update({status:"success",message:"Now you are using '"+o.options.name+"' version "+o.options.version+", id '"+o.options.id+"'.",persistent:!1}),Galaxy.emit.debug("tools-form-base::initialize()","Initial tool model ready.",t),e.resolve()},error:function(t){var n=t&&t.err_msg||"Uncaught error.";o.$el.is(":empty")?o.$el.prepend(new i.Message({message:n,status:"danger",persistent:!0,large:!0}).$el):Galaxy.modal.show({title:"Tool request failed",body:n,buttons:{Close:function(){Galaxy.modal.hide()}}}),Galaxy.emit.debug("tools-form::initialize()","Initial tool model request failed.",t),e.reject()}})},_updateModel:function(e){var i=this.options.update_url||Galaxy.root+"api/tools/"+this.options.id+"/build",n=this,s=this.form,o={tool_id:this.options.id,tool_version:this.options.version,inputs:a.extend(!0,{},n.form.data.create())};s.wait(!0),Galaxy.emit.debug("tools-form-base::_updateModel()","Sending current state.",o),t.request({type:"POST",url:i,data:o,success:function(t){n.form.update(t.tool_model||t),n.options.update&&n.options.update(t),s.wait(!1),Galaxy.emit.debug("tools-form-base::_updateModel()","Received new model.",t),e.resolve()},error:function(t){Galaxy.emit.debug("tools-form-base::_updateModel()","Refresh request failed.",t),e.reject()}})},_operations:function(){var t=this,e=this.options,n=new i.ButtonMenu({icon:"fa-cubes",title:!e.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(!e.is_workflow&&e.versions&&e.versions.length>1)for(var o in e.versions){var a=e.versions[o];a!=e.version&&n.addMenu({title:"Switch to "+a,version:a,icon:"fa-cube",onclick:function(){var i=e.id.replace(e.version,this.version),n=this.version;t.deferred.reset(),t.deferred.execute(function(e){t._buildModel(e,{id:i,version:n})})}})}else n.$el.hide();var r=new i.ButtonMenu({icon:"fa-caret-down",title:!e.narrow&&"Options"||null,tooltip:"View available options"});return e.biostar_url&&(r.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(e.biostar_url+"/p/new/post/")}}),r.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(e.biostar_url+"/local/search/page/?q="+e.name)}})),r.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+Galaxy.root+"root?tool_id="+e.id)}}),Galaxy.user&&Galaxy.user.get("is_admin")&&r.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",href:Galaxy.root+"api/tools/"+e.id+"/download",download:e.id}),e.requirements&&e.requirements.length>0&&r.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){this.visible?(this.visible=!1,t.form.message.update({message:""})):(this.visible=!0,t.form.message.update({persistent:!0,message:s.requirements(e),status:"info"}))}}),e.sharable_url&&r.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(e.sharable_url)}}),{menu:r,versions:n}},_footer:function(){var t=this.options;if(""!=t.help&&this.form.$el.append(s.help(t)),t.citations){var e=a("
    "),i=new r.ToolCitationCollection;i.tool_id=t.id;var n=new l.CitationListView({el:e,collection:i});n.render(),i.fetch(),this.form.$el.append(e)}}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;n=[i(4),i(16)],s=function(t,e){return{submit:function(i,n,s){var o=this,a={tool_id:n.id,tool_version:n.version,inputs:i.data.create()};return i.trigger("reset"),this._validation(i,a)?(Galaxy.emit.debug("tools-jobs::submit()","Validation complete.",a),void t.request({type:"POST",url:Galaxy.root+"api/tools",data:a,success:function(t){s&&s(),i.$el.replaceWith(e.success(t)),o._refreshHdas()},error:function(t){if(s&&s(),Galaxy.emit.debug("tools-jobs::submit","Submission failed.",t),t&&t.err_data){var n=i.data.matchResponse(t.err_data);for(var o in n){i.highlight(o,n[o]);break}}else i.modal.show({title:"Job submission failed",body:t&&t.err_msg||e.error(a),buttons:{Close:function(){i.modal.hide()}}})}})):(Galaxy.emit.debug("tools-jobs::submit()","Submission canceled. Validation failed."),void(s&&s()))},_validation:function(t,e){var i=e.inputs,n=-1,s=null;for(var o in i){var a=i[o],r=t.data.match(o),l=t.field_list[r],c=t.input_list[r];if(r&&c&&l){if(!c.optional&&null==a)return t.highlight(r),!1;if(a&&a.batch){var d=a.values.length,h=null;if(d>0&&(h=a.values[0]&&a.values[0].src),h)if(null===s)s=h;else if(s!==h)return t.highlight(r,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===n)n=d;else if(n!==d)return t.highlight(r,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains "+d+" selection(s) while a previous field contains "+n+"."),!1}}else Galaxy.emit.debug("tools-jobs::_validation()","Retrieving input objects failed.")}return!0},_refreshHdas:function(t,e){parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents(t,e)}}}.apply(e,n),!(void 0!==s&&(t.exports=s))},function(t,e,i){var n,s;(function(o,a){n=[i(3),i(21),i(14),i(23),i(65),i(66),i(64),i(67)],s=function(t,e,i,n,s,r,l,c){var d={hidden:!1,show:function(){this.set("hidden",!1)},hide:function(){this.set("hidden",!0)},toggle:function(){this.set("hidden",!this.get("hidden"))},is_visible:function(){return!this.attributes.hidden}},h=o.Model.extend({defaults:{name:null,label:null,type:null,value:null,html:null,num_samples:5},initialize:function(t){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new h(this.toJSON())},set_value:function(t){this.set("value",t||"")}}),u=o.Collection.extend({model:h}),p=h.extend({}),f=h.extend({set_value:function(t){this.set("value",parseInt(t,10))},get_samples:function(){return d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}}),g=f.extend({set_value:function(t){this.set("value",parseFloat(t))}}),m=h.extend({get_samples:function(){return t.map(this.get("options"),function(t){return t[0]})}});h.subModelTypes={integer:f,"float":g,data:p,select:m};var v=o.Model.extend({defaults:{id:null,name:null,description:null,target:null,inputs:[],outputs:[]},urlRoot:Galaxy.root+"api/tools",initialize:function(e){this.set("inputs",new u(t.map(e.inputs,function(t){var e=h.subModelTypes[t.type]||h;return new e(t)})))},toJSON:function(){var t=o.Model.prototype.toJSON.call(this);return t.inputs=this.get("inputs").map(function(t){return t.toJSON()}),t},remove_inputs:function(t){var e=this,i=e.get("inputs").filter(function(e){return-1!==t.indexOf(e.get("type"))});e.get("inputs").remove(i)},copy:function(t){var e=new v(this.toJSON());if(t){var i=new o.Collection;e.get("inputs").each(function(t){t.get_samples()&&i.push(t)}),e.set("inputs",i)}return e},apply_search_results:function(e){return-1!==t.indexOf(e,this.attributes.id)?this.show():this.hide(),this.is_visible()},set_input_value:function(t,e){this.get("inputs").find(function(e){return e.get("name")===t}).set("value",e)},set_input_values:function(e){var i=this;t.each(t.keys(e),function(t){i.set_input_value(t,e[t])})},run:function(){return this._run()},rerun:function(t,e){return this._run({action:"rerun",target_dataset_id:t.id,regions:e})},get_inputs_dict:function(){var t={};return this.get("inputs").each(function(e){t[e.get("name")]=e.get("value")}),t},_run:function(n){var s=t.extend({tool_id:this.id,inputs:this.get_inputs_dict()},n),o=a.Deferred(),r=new e.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(s),dataType:"json",contentType:"application/json",type:"POST"},interval:2e3,success_fn:function(t){return"pending"!==t}});return a.when(r.go()).then(function(t){o.resolve(new i.DatasetCollection(t))}),o}});t.extend(v.prototype,d);var _=(o.View.extend({}),o.Collection.extend({model:v})),y=o.Model.extend(d),w=o.Model.extend({defaults:{elems:[],open:!1},clear_search_results:function(){t.each(this.attributes.elems,function(t){t.show()}),this.show(),this.set("open",!1)},apply_search_results:function(e){var i,n=!0;t.each(this.attributes.elems,function(t){t instanceof y?(i=t,i.hide()):t instanceof v&&t.apply_search_results(e)&&(n=!1,i&&i.show())}),n?this.hide():(this.show(),this.set("open",!0))}});t.extend(w.prototype,d);var b=o.Model.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:!0,query:"",results:null,clear_key:27},urlRoot:Galaxy.root+"api/tools",initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var t=this.attributes.query;if(t.length");if(t.append(r(this.model.toJSON())),"upload1"===this.model.id)t.find("a").on("click",function(t){t.preventDefault(),Galaxy.upload.show()});else if("Tool"===this.model.get("model_class")){var e=this;t.find("a").on("click",function(t){t.preventDefault();var i=new n.View({id:e.model.id,version:e.model.get("version")});i.deferred.execute(function(){Galaxy.app.display(i)})})}return this.$el.append(t),this}}),$=C.extend({tagName:"div",className:"toolPanelLabel",render:function(){return this.$el.append(a("").text(this.model.attributes.text)),this}}),S=C.extend({tagName:"div",className:"toolSectionWrapper",initialize:function(){C.prototype.initialize.call(this),this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(l(this.model.toJSON()));var e=this.$el.find(".toolSectionBody");return t.each(this.model.attributes.elems,function(t){if(t instanceof v){var i=new E({model:t,className:"toolTitle"});i.render(),e.append(i.$el)}else if(t instanceof y){var n=new $({model:t});n.render(),e.append(n.$el)}}),this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast")}}),k=o.View.extend({tagName:"div",id:"tool-search",className:"bar",events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){return this.$el.append(c(this.model.toJSON())),this.model.is_visible()||this.$el.hide(),this.$el.find("[title]").tooltip(),this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){return this.model.clear_search(),this.$el.find(":input").val(""),this.focus_and_select(),!1},query_changed:function(t){return this.model.attributes.clear_key&&this.model.attributes.clear_key===t.which?(this.clear(),!1):void this.model.set("query",this.$el.find(":input").val())}}),T=o.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.model.get("tool_search").on("change:results",this.handle_search_results,this)},render:function(){var t=this,e=new k({model:this.model.get("tool_search")});return e.render(),t.$el.append(e.$el),this.model.get("layout").each(function(e){if(e instanceof w){var i=new S({model:e});i.render(),t.$el.append(i.$el)}else if(e instanceof v){var n=new E({model:e,className:"toolTitleNoSection"});n.render(),t.$el.append(n.$el)}else if(e instanceof y){var s=new $({model:e});s.render(),t.$el.append(s.$el)}}),t.$el.find("a.tool-link").click(function(e){var i=a(this).attr("class").split(/\s+/)[0],n=t.model.get("tools").get(i);t.trigger("tool_link_click",e,n)}),this},handle_search_results:function(){var t=this.model.get("tool_search").get("results");t&&0===t.length?a("#search-no-results").show():a("#search-no-results").hide()}}),D=o.View.extend({className:"toolForm",render:function(){this.$el.children().remove(),this.$el.append(s(this.model.toJSON()))}});o.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new T({collection:this.collection}),this.tool_form_view=new D},render:function(){this.tool_panel_view.render(),this.tool_panel_view.$el.css("float","left"),this.$el.append(this.tool_panel_view.$el),this.tool_form_view.$el.hide(),this.$el.append(this.tool_form_view.$el);var t=this;this.tool_panel_view.on("tool_link_click",function(e,i){e.preventDefault(),t.show_tool(i)})},show_tool:function(t){var e=this;t.fetch().done(function(){e.tool_form_view.model=t,e.tool_form_view.render(),e.tool_form_view.$el.show(),a("#left").width("650px")})}});return{ToolParameter:h,IntegerToolParameter:f,SelectToolParameter:m,Tool:v,ToolCollection:_,ToolSearch:b,ToolPanel:x,ToolPanelView:T,ToolFormView:D}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(i,o,a,r){n=[],s=function(){var t=i.View.extend({initialize:function(t,e){this.$button=t,this.$button.size()||(this.$button=o("
    ")),this.options=e||[];var i=this;this.$button.click(function(t){return o(".popmenu-wrapper").remove(),i._renderAndShow(t),!1})},_renderAndShow:function(t){this.render(),this.$el.appendTo("body").css(this._getShownPosition(t)).show(),this._setUpCloseBehavior()},render:function(){if(this.$el.addClass("popmenu-wrapper").hide().css({position:"absolute"}).html(this.template(this.$button.attr("id"),this.options)),this.options.length){var t=this;this.$el.find("li").each(function(e,i){var n=t.options[e];n.func&&o(this).children("a.popupmenu-option").click(function(e){n.func.call(t,e,n),e.preventDefault()})})}return this},template:function(t,e){return['"].join("")},_templateOptions:function(t){return t.length?a.map(t,function(t){if(t.divider)return'
  • ';if(t.header)return['
  • ',t.html,"
  • "].join("");var e=t.href||"javascript:void(0);",i=t.target?' target="'+t.target+'"':"",n=t.checked?'':"";return['
  • ",n,t.html,"
  • "].join("")}).join(""):"
  • (no options)
  • "},_getShownPosition:function(t){var e=this.$el.width(),i=t.pageX-e/2;return i=Math.min(i,o(document).scrollLeft()+o(window).width()-e-5),i=Math.max(i,o(document).scrollLeft()+5),{top:t.pageY,left:i}},_setUpCloseBehavior:function(){function t(t){if(o(document).off("click.close_popup"),window.parent!==window)try{o(window.parent.document).off("click.close_popup")}catch(i){}else try{o("iframe#galaxy_main").contents().off("click.close_popup")}catch(i){}e.remove()}var e=this;if(o("html").one("click.close_popup",t),window.parent!==window)try{o(window.parent.document).find("html").one("click.close_popup",t)}catch(i){}else try{o("iframe#galaxy_main").contents().one("click.close_popup",t)}catch(i){}},addItem:function(t,e){return e=e>=0?e:this.options.length,this.options.splice(e,0,t),this},removeItem:function(t){return t>=0&&this.options.splice(t,1),this},findIndexByHtml:function(t){for(var e=0;e'},_templateContent:function(){return'
    '},_templateBox:function(t){return'
    '},_template:function(){return'
    Select a color
    '}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,n){var s,o;(function(a){s=[n(4),n(25)],o=function(t,e){var n=e.BaseIcons.extend({initialize:function(t){t.type=t.display||"checkbox", -t.multiple="checkbox"==t.display,e.BaseIcons.prototype.initialize.call(this,t),this.initial=!0},value:function(t){var i=e.BaseIcons.prototype.value.call(this,t);if(this.initial&&null!==i&&this.header_index){this.initial=!1;var n=i;a.isArray(n)||(n=[n]);for(var s in n){var o=this.header_index[n[s]];for(var r in o)this._setState(o[r],!0)}}return i},_setState:function(t,e){var i=this.$(".button-"+t),n=this.$(".subgroup-"+t);i.data("is_expanded",e),e?(n.fadeIn("fast"),i.removeClass("toggle-expand"),i.addClass("toggle")):(n.hide(),i.removeClass("toggle"),i.addClass("toggle-expand"))},_templateOptions:function(e){function n(t,e){var i=t.find(".button-"+e);i.on("click",function(){o._setState(e,!i.data("is_expanded"))})}function s(e,r,l){l=l||[];for(i in r){var c=r[i],d=c.options.length>0,h=l.slice(0);o.header_index[c.value]=h.slice(0);var u=a("
    ");if(d){var p=t.uid(),f=a(''),g=a('