',i=1);for(var a in t.items){var n=t.items[a],l=n.encode_id;e+="
",t.show_item_checkboxes&&(e+='
');for(var o in t.columns){var r=t.columns[o];if(r.visible){var d="";r.nowrap&&(d='style="white-space:nowrap;"');var c=n.column_config[r.label],h=c.link,u=c.value,p=c.target;"string"===s.type(u)&&(u=u.replace(/\/\//g,"/"));var f="",m="";r.attach_popup&&(f="grid-"+a+"-popup",m="menubutton",""!=h&&(m+=" split"),m+=" popup"),e+="
Page:',l>1&&(e+='1 ...');for(var h=l;h'+h+"":e+=''+h+"";c'+a+""),e+="",e+=' | Show All
'}if(t.show_item_checkboxes){e+='
For selected items: ';for(var u in t.operations){var p=t.operations[u];p.allow_multiple&&(e+=' ')}e+="
"}var f=!1;for(u in t.operations)if(t.operations[u].global_operation){f=!0;break}if(f){e+='
';for(u in t.operations){var p=t.operations[u];p.global_operation&&(e+=''+p.label+"")}e+="
"}return t.legend&&(e+='
'+t.legend+"
"),e},message:function(t){return'
'+a.escape(t.message)+'
'},grid_filters:function(t){var e=t.default_filter_dict,i=t.filters,s="none";t.advanced_search&&(s="block");var a=!1;for(var n in t.columns){var l=t.columns[n];if("advanced"==l.filterable){var o=l.key,r=i[o],d=e[o];r&&d&&r!=d&&(s="block"),a=!0}}var c="block";"block"==s&&(c="none");var h='
';for(var n in t.columns){var l=t.columns[n];"standard"==l.filterable&&(h+=this.grid_column_filter(t,l))}h+="
'}})}}.apply(e,n))&&(t.exports=l)}).call(e,i(1),i(0))},30:function(t,e,i){"use strict";(function(s,a){var n,l;n=[i(3),i(18)],void 0!==(l=function(t,e){return{View:e.BaseIcons.extend({initialize:function(t){t.type=t.display||"checkbox",t.multiple="checkbox"==t.type,e.BaseIcons.prototype.initialize.call(this,t)},_setValue:function(t){if(e.BaseIcons.prototype._setValue.call(this,t),void 0!==t&&null!==t&&this.header_index){var i=this,n=s.isArray(t)?t:[t];a.each(n,function(t){var e=i.header_index[t];a.each(e,function(t){i._setState(t,!0)})})}},_setState:function(t,e){var i=this.$(".button-"+t),s=this.$(".subgroup-"+t);i.data("is_expanded",e),e?(s.show(),i.removeClass("fa-plus-square").addClass("fa-minus-square")):(s.hide(),i.removeClass("fa-minus-square").addClass("fa-plus-square"))},_templateOptions:function(){function e(t,e){var i=t.find(".button-"+e);i.on("click",function(){a._setState(e,!i.data("is_expanded"))})}function i(n,l,o){o=o||[];for(var r in l){var d=l[r],c=d.options&&d.options.length>0,h=o.slice(0);a.header_index[d.value]=h.slice(0);var u=s("");if(c){var p=t.uid(),f=s("").addClass("button-"+p).addClass("ui-drilldown-button fa fa-plus-square"),m=s("").addClass("subgroup-"+p).addClass("ui-drilldown-subgroup");u.append(s("").append(f).append(a._templateOption({label:d.name,value:d.value}))),h.push(p),i(m,d.options,h),u.append(m),e(u,p)}else u.append(a._templateOption({label:d.name,value:d.value}));n.append(u)}}var a=this;this.header_index={};var n=s("");return i(n,this.model.get("data")),n},_template:function(){return s("").addClass("ui-options-list drilldown-container").attr("id",this.model.id)}})}}.apply(e,n))&&(t.exports=l)}).call(e,i(0),i(2))},31:function(t,e,i){"use strict";(function(s,a,n,l){var o,r;o=[i(3),i(5),i(8),i(32),i(33),i(34)],void 0!==(r=function(t,e,i,o,r,d){var c=s.View.extend({initialize:function(t,e){this.app=t,this.inputs=e.inputs,this.parameters=new d,this.setElement(a("")),this.render()},render:function(){var t=this;this.$el.empty(),n.each(this.inputs,function(e){t.add(e)})},add:function(e){var i=l.extend(!0,{},e);switch(i.id=e.id=t.uid(),this.app.input_list[i.id]=i,i.type){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,this.app.model.get("sustain_conditionals")&&(t.test_param.disabled=!0);var i=this._addRow(t.test_param);i.model&&i.model.set("onchange",function(i){var s=e.app.data.matchCase(t,i);for(var a in t.cases){var n=t.cases[a],l=e.$("#"+t.id+"-section-"+a),o=!1;for(var r in n.inputs)if(!n.inputs[r].hidden){o=!0;break}a==s&&o?l.fadeIn("fast"):l.hide()}e.app.trigger("change")});for(var s in t.cases){var a=new c(this.app,{inputs:t.cases[s].inputs});this._append(a.$el.addClass("ui-form-section"),t.id+"-section-"+s)}i.trigger("change")},_addRepeat:function(t){function e(e){var n=t.id+"-section-"+s++,l=new c(i.app,{inputs:e});a.add({id:n,$el:l.$el,ondel:function(){a.del(n),i.app.trigger("change")}})}for(var i=this,s=0,a=new o.View({title:t.title||"Repeat",min:t.min,max:t.max,onnew:function(){e(t.inputs),i.app.trigger("change")}}),l=n.size(t.cache),d=0;d").addClass("ui-form-info").html(t.help)),this.app.on("expand",function(t){e.$("#"+t).length>0&&e.expand()}),this._append(e.$el,t.id)},_addRow:function(t){var e=this,i=t.id;t.onchange=t.onchange||function(){e.app.trigger("change",i)};var s=this.parameters.create(t);this.app.field_list[i]=s;var a=new r(this.app,{name:t.name,label:t.hide_label?"":t.label||t.name,value:t.value,text_value:t.text_value,collapsible_value:t.collapsible_value,collapsible_preview:t.collapsible_preview,help:t.help,argument:t.argument,disabled:t.disabled,color:t.color,style:t.style,backdrop:t.backdrop,hidden:t.hidden,fixed:t.fixed,field:s});return this.app.element_list[i]=a,this._append(a.$el,t.id),s},_append:function(t,e){this.$el.append(t.addClass("section-row").attr("id",e))}});return{View:c}}.apply(e,o))&&(t.exports=r)}).call(e,i(1),i(0),i(2),i(0))},32:function(t,e,i){"use strict";(function(s,a,n){var l,o;l=[i(3),i(8),i(5)],void 0!==(o=function(t,e,i){return{View:s.View.extend({initialize:function(e){this.list={},this.options=t.merge(e,{title:"Repeat",empty_text:"Not available.",max:null,min:null}),this.button_new=new i.ButtonIcon({icon:"fa-plus",title:"Insert "+this.options.title,tooltip:"Add new "+this.options.title+" block",cls:"ui-button-icon ui-clear-float form-repeat-add",onclick:function(){e.onnew&&e.onnew()}}),this.setElement(a("").append(this.$list=a("")).append(a("").append(this.button_new.$el)))},size:function(){return n.size(this.list)},add:function(t){if(!t.id||this.list[t.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate or invalid repeat block id.");var s=new i.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain form-repeat-delete",onclick:function(){t.ondel&&t.ondel()}}),a=new e.View({id:t.id,title:"placeholder",cls:t.cls||"ui-portlet-repeat",operations:{button_delete:s}});a.append(t.$el),a.$el.addClass("section-row").hide(),this.list[t.id]=a,this.$list.append(a.$el.fadeIn("fast")),this.options.max>0&&this.size()>=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.$list.find("#"+t).remove(),delete this.list[t],this.button_new.enable(),this._refresh()},delAll:function(){for(var t in this.list)this.del(t)},hideOptions:function(){this.button_new.$el.hide(),n.each(this.list,function(t){t.hideOperation("button_delete")}),n.isEmpty(this.list)&&this.$el.append(a("").addClass("ui-form-info").html(this.options.empty_text))},_refresh:function(){var t=0;for(var e in this.list){var i=this.list[e];i.title(++t+": "+this.options.title),i[this.size()>this.options.min?"showOperation":"hideOperation"]("button_delete")}}})}}.apply(e,l))&&(t.exports=o)}).call(e,i(1),i(0),i(2))},33:function(t,e,i){"use strict";(function(i,s,a){var n,l;n=[],void 0!==(l=function(){return i.View.extend({initialize:function(t,e){this.app=t,this.app_options=t.model?t.model.attributes:{},this.field=e&&e.field||new i.View,this.model=e&&e.model||new i.Model({text_enable:this.app_options.text_enable||"Enable",text_disable:this.app_options.text_disable||"Disable",cls_enable:this.app_options.cls_enable||"fa fa-caret-square-o-down",cls_disable:this.app_options.cls_disable||"fa fa-caret-square-o-up",always_refresh:this.app_options.always_refresh}).set(e),this.setElement(this._template()),this.$field=this.$(".ui-form-field"),this.$info=this.$(".ui-form-info"),this.$preview=this.$(".ui-form-preview"),this.$collapsible=this.$(".ui-form-collapsible"),this.$collapsible_text=this.$(".ui-form-collapsible-text"),this.$collapsible_icon=this.$(".ui-form-collapsible-icon"),this.$title=this.$(".ui-form-title"),this.$title_text=this.$(".ui-form-title-text"),this.$error_text=this.$(".ui-form-error-text"),this.$error=this.$(".ui-form-error"),this.$backdrop=this.$(".ui-form-backdrop"),this.$field.prepend(this.field.$el);var s=this.model.get("collapsible_value");this.field.collapsed=void 0!==s&&JSON.stringify(this.model.get("value"))==JSON.stringify(s),this.listenTo(this.model,"change",this.render,this),this.render();var a=this;this.$collapsible.on("click",function(){a.field.collapsed=!a.field.collapsed,t.trigger&&t.trigger("change"),a.render()}),this.field.model&&!this.model.get("always_refresh")&&this.listenTo(this.field.model,"change:value",function(){a.reset()})},backdrop:function(){this.model.set("backdrop",!0)},error:function(t){this.model.set("error_text",t)},reset:function(){!this.model.get("fixed")&&this.model.set("error_text",null)},render:function(){s(".tooltip").hide();var t=this.model.get("help",""),e=this.model.get("argument");e&&-1==t.indexOf("("+e+")")&&(t+=" ("+e+")"),this.$info.html(t),this.$el[this.model.get("hidden")?"hide":"show"](),this.$preview[this.field.collapsed&&this.model.get("collapsible_preview")||this.model.get("disabled")?"show":"hide"]().html(a.escape(this.model.get("text_value")));var i=this.model.get("error_text");if(this.$error[i?"show":"hide"](),this.$el[i?"addClass":"removeClass"]("ui-error"),this.$error_text.html(i),this.$backdrop[this.model.get("backdrop")?"show":"hide"](),this.field.collapsed||this.model.get("disabled")?this.$field.hide():this.$field.show(),this.field.model&&this.field.model.set({color:this.model.get("color"),style:this.model.get("style")}),this.model.get("disabled")||void 0===this.model.get("collapsible_value"))this.$title_text.show().text(this.model.get("label")),this.$collapsible.hide();else{var n=this.field.collapsed?"enable":"disable";this.$title_text.hide(),this.$collapsible.show(),this.$collapsible_text.text(this.model.get("label")),this.$collapsible_icon.removeClass().addClass("icon").addClass(this.model.get("cls_"+n)).attr("data-original-title",this.model.get("text_"+n)).tooltip({placement:"bottom"})}},_template:function(){return s("").addClass("ui-form-element").append(s("").addClass("ui-form-error ui-error").append(s("").addClass("fa fa-arrow-down")).append(s("").addClass("ui-form-error-text"))).append(s("").addClass("ui-form-title").append(s("").addClass("ui-form-collapsible").append(s("").addClass("ui-form-collapsible-icon")).append(s("").addClass("ui-form-collapsible-text"))).append(s("").addClass("ui-form-title-text"))).append(s("").addClass("ui-form-field").append(s("").addClass("ui-form-info")).append(s("").addClass("ui-form-backdrop"))).append(s("").addClass("ui-form-preview"))}})}.apply(e,n))&&(t.exports=l)}).call(e,i(1),i(0),i(2))},34:function(t,e,i){"use strict";(function(s,a,n){var l,o;l=[i(3),i(5),i(35),i(36),i(37),i(38),i(40)],void 0!==(o=function(t,e,i,l,o,r,d){return s.Model.extend({types:{text:"_fieldText",password:"_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",upload:"_fieldUpload",genomespacefile:"_fieldGenomeSpace"},create:function(t){var e=this.types[t.type],i="function"==typeof this[e]?this[e].call(this,t):null;return i||(i=t.options?this._fieldSelect(t):this._fieldText(t),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+t.type+").")),void 0===t.value&&(t.value=null),i.value(t.value),i},_fieldData:function(t){return new i.View({id:"field-"+t.id,extensions:t.extensions,optional:t.optional,multiple:t.multiple,type:t.type,flavor:t.flavor,data:t.options,onchange:t.onchange})},_fieldSelect:function(t){if(t.is_workflow)return this._fieldText(t);"data_column"==t.type&&(t.error_text="Missing columns in referenced dataset.");var i=t.data;i||(i=[],a.each(t.options,function(t){i.push({label:t[0],value:t[1]})}));var s=e.Select;switch(t.display){case"checkboxes":s=e.Checkbox;break;case"radio":s=e.Radio;break;case"radiobutton":s=e.RadioButton}return new s.View({id:"field-"+t.id,data:i,error_text:t.error_text||"No options available",readonly:t.readonly,multiple:t.multiple,optional:t.optional,onchange:t.onchange,individual:t.individual,searchable:"workflow"!==t.flavor})},_fieldDrilldown:function(t){return t.is_workflow?this._fieldText(t):new e.Drilldown.View({id:"field-"+t.id,data:t.options,display:t.display,optional:t.optional,onchange:t.onchange})},_fieldText:function(i){if(i.options&&i.data)if(i.area=i.multiple,t.isEmpty(i.value))i.value=null;else if(n.isArray(i.value)){var s="";for(var a in i.value){if(s+=String(i.value[a]),!i.multiple)break;s+="\n"}i.value=s}return new e.Input({id:"field-"+i.id,type:i.type,area:i.area,readonly:i.readonly,placeholder:i.placeholder,datalist:i.datalist,onchange:i.onchange})},_fieldSlider:function(t){return new e.Slider.View({id:"field-"+t.id,precise:"float"==t.type,is_workflow:t.is_workflow,min:t.min,max:t.max,onchange:t.onchange})},_fieldHidden:function(t){return new e.Hidden({id:"field-"+t.id,info:t.info})},_fieldBoolean:function(t){return new e.RadioButton.View({id:"field-"+t.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:t.onchange})},_fieldColor:function(t){return new d({id:"field-"+t.id,onchange:t.onchange})},_fieldLibrary:function(t){return new l.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:t.onchange})},_fieldFtp:function(t){return new o.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:t.onchange})},_fieldGenomeSpace:function(t){var e=this;return new r.View({id:"field-"+t.id,onchange:function(){e.app.trigger("change")}})},_fieldUpload:function(t){return new e.Upload({id:"field-"+t.id,onchange:t.onchange})}})}.apply(e,l))&&(t.exports=o)}).call(e,i(1),i(2),i(0))},35:function(t,e,i){"use strict";(function(s,a,n){var l,o;l=[i(3),i(5),i(17)],void 0!==(o=function(t,e,i){var l={DISABLED:"disabled",ENABLED:"enabled",LINKED:"linked"},o={data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:l.DISABLED},{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.LINKED},{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.LINKED}],data_multiple:[{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.DISABLED},{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collections",multiple:!0,batch:l.DISABLED}],data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.DISABLED}],workflow_data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:l.DISABLED}],workflow_data_multiple:[{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.DISABLED}],workflow_data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.DISABLED}],module_data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:l.DISABLED},{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.ENABLED}],module_data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.DISABLED},{src:"hdca",icon:"fa-folder",tooltip:"Multiple collections",multiple:!0,batch:l.ENABLED}]};return{View:s.View.extend({initialize:function(t){var i=this;this.model=t&&t.model||new s.Model({src_labels:{hda:"dataset",hdca:"dataset collection"},pagelimit:100,statustimer:1e3}).set(t),this.setElement(a("").addClass("ui-select-content")),this.button_product=new e.RadioButton.View({value:"false",data:[{icon:"fa fa-chain",value:"false",tooltip:"Linked inputs will be run in matched order with other datasets e.g. use this for matching forward and reverse reads."},{icon:"fa fa-chain-broken",value:"true",tooltip:"Unlinked dataset inputs will be run against *all* other inputs."}]});var n=a("").addClass("ui-form-info").append(a("").addClass("fa fa-sitemap")).append(a("").html("This is a batch mode input field. Separate jobs will be triggered for each dataset selection."));this.$batch={linked:n.clone(),enabled:n.clone().append(a("").append(a("").addClass("ui-form-title").html("Batch options:")).append(this.button_product.$el)).append(a("").css("clear","both"))},this.$el.on("dragenter",function(t){this.lastenter=t.target,i.$el.addClass("ui-dragover")}).on("dragover",function(t){t.preventDefault()}).on("dragleave",function(t){this.lastenter===t.target&&i.$el.removeClass("ui-dragover")}).on("drop",function(t){i._handleDrop(t)}),this.history={},this.listenTo(this.model,"change:data",this._changeData,this),this.listenTo(this.model,"change:wait",this._changeWait,this),this.listenTo(this.model,"change:current",this._changeCurrent,this),this.listenTo(this.model,"change:value",this._changeValue,this),this.listenTo(this.model,"change:type change:optional change:multiple change:extensions",this._changeType,this),this.render(),this.on("change",function(){t.onchange&&t.onchange(i.value())})},render:function(){this._changeType(),this._changeValue(),this._changeWait()},wait:function(){this.model.set("wait",!0)},unwait:function(){this.model.set("wait",!1)},update:function(t){this.model.set("data",t)},value:function(t){void 0!==t&&this.model.set("value",t);var e=this.model.get("current");if(this.config[e]){var i=this.fields[e].value();if(null!==i&&(i=a.isArray(i)?i:[i],i.length>0)){var s=this._batch({values:[]});for(var n in i){var l=this.history[i[n]+"_"+this.config[e].src];if(!l)return Galaxy.emit.debug("ui-select-content::value()","Requested details not found for '"+i[n]+"'."),null;s.values.push(l)}return s.values.sort(function(t,e){return t.hid-e.hid}),s}}else Galaxy.emit.debug("ui-select-content::value()","Invalid value/source '"+t+"'.");return null},_changeCurrent:function(){var t=this;n.each(this.fields,function(e,i){t.model.get("current")==i?(e.$el.show(),n.each(t.$batch,function(e,s){e[t.config[i].batch==s?"show":"hide"]()}),t.button_type.value(i)):e.$el.hide()})},_changeType:function(){var s=this,a=(this.model.get("flavor")?this.model.get("flavor")+"_":"")+String(this.model.get("type"))+(this.model.get("multiple")?"_multiple":"");o[a]?this.config=o[a]:(this.config=o.data,Galaxy.emit.debug("ui-select-content::_changeType()","Invalid configuration/type id '"+a+"'."));var l=s.model.get("data"),r=t.textify(this.model.get("extensions")),d=this.model.get("src_labels");this.fields=[],this.button_data=[],n.each(this.config,function(t,e){s.button_data.push({value:e,icon:t.icon,tooltip:t.tooltip}),s.fields.push(new i.View({optional:s.model.get("optional"),multiple:t.multiple,searchable:!t.multiple||l&&l[t.src]&&l[t.src].length>s.model.get("pagelimit"),individual:!0,error_text:"No "+(r?r+" ":"")+(d[t.src]||"content")+" available.",onchange:function(){s.trigger("change")}}))}),this.button_type=new e.RadioButton.View({value:this.model.get("current"),data:this.button_data,onchange:function(t){s.model.set("current",t),s.trigger("change")}}),this.$el.empty();var c=0;this.fields.length>1&&(this.$el.append(this.button_type.$el),c=Math.max(0,36*this.fields.length)+"px"),n.each(this.fields,function(t){s.$el.append(t.$el.css({"margin-left":c}))}),n.each(this.$batch,function(t,e){s.$el.append(t.css({"margin-left":c}))}),this.model.set("current",0),this._changeCurrent(),this._changeData()},_changeWait:function(){var t=this;n.each(this.fields,function(e){e[t.model.get("wait")?"wait":"unwait"]()})},_changeData:function(){var t=this.model.get("data"),e=this,i={};n.each(t,function(t,s){i[s]=[],n.each(t,function(t){i[s].push({hid:t.hid,keep:t.keep,label:t.hid+": "+t.name,value:t.id,tags:t.tags}),e.history[t.id+"_"+s]=t})}),n.each(this.config,function(t,s){i[t.src]&&e.fields[s].add(i[t.src],function(t,e){return e.hid-t.hid})})},_changeValue:function(){var t=this.model.get("value");if(t&&t.values&&t.values.length>0){var e=[];n.each(t.values,function(t){e.push(t.id)});for(var i=t.values[0].src,s=t.values.length>1,a=0;a
',i=1);for(var a in t.items){var n=t.items[a],l=n.encode_id;e+="
",t.show_item_checkboxes&&(e+='
');for(var o in t.columns){var r=t.columns[o];if(r.visible){var d="";r.nowrap&&(d='style="white-space:nowrap;"');var c=n.column_config[r.label],h=c.link,u=c.value,p=c.target;"string"===s.type(u)&&(u=u.replace(/\/\//g,"/"));var f="",m="";r.attach_popup&&(f="grid-"+a+"-popup",m="menubutton",""!=h&&(m+=" split"),m+=" popup"),e+="
Page:',l>1&&(e+='1 ...');for(var h=l;h'+h+"":e+=''+h+"";c'+a+""),e+="",e+=' | Show All
'}if(t.show_item_checkboxes){e+='
For selected items: ';for(var u in t.operations){var p=t.operations[u];p.allow_multiple&&(e+=' ')}e+="
"}var f=!1;for(u in t.operations)if(t.operations[u].global_operation){f=!0;break}if(f){e+='
';for(u in t.operations){var p=t.operations[u];p.global_operation&&(e+=''+p.label+"")}e+="
"}return t.legend&&(e+='
'+t.legend+"
"),e},message:function(t){return'
'+a.escape(t.message)+'
'},grid_filters:function(t){var e=t.default_filter_dict,i=t.filters,s="none";t.advanced_search&&(s="block");var a=!1;for(var n in t.columns){var l=t.columns[n];if("advanced"==l.filterable){var o=l.key,r=i[o],d=e[o];r&&d&&r!=d&&(s="block"),a=!0}}var c="block";"block"==s&&(c="none");var h='
';for(var n in t.columns){var l=t.columns[n];"standard"==l.filterable&&(h+=this.grid_column_filter(t,l))}h+="
'}})}}.apply(e,n))&&(t.exports=l)}).call(e,i(1),i(0))},30:function(t,e,i){"use strict";(function(s,a){var n,l;n=[i(3),i(18)],void 0!==(l=function(t,e){return{View:e.BaseIcons.extend({initialize:function(t){t.type=t.display||"checkbox",t.multiple="checkbox"==t.type,e.BaseIcons.prototype.initialize.call(this,t)},_setValue:function(t){if(e.BaseIcons.prototype._setValue.call(this,t),void 0!==t&&null!==t&&this.header_index){var i=this,n=s.isArray(t)?t:[t];a.each(n,function(t){var e=i.header_index[t];a.each(e,function(t){i._setState(t,!0)})})}},_setState:function(t,e){var i=this.$(".button-"+t),s=this.$(".subgroup-"+t);i.data("is_expanded",e),e?(s.show(),i.removeClass("fa-plus-square").addClass("fa-minus-square")):(s.hide(),i.removeClass("fa-minus-square").addClass("fa-plus-square"))},_templateOptions:function(){function e(t,e){var i=t.find(".button-"+e);i.on("click",function(){a._setState(e,!i.data("is_expanded"))})}function i(n,l,o){o=o||[];for(var r in l){var d=l[r],c=d.options&&d.options.length>0,h=o.slice(0);a.header_index[d.value]=h.slice(0);var u=s("");if(c){var p=t.uid(),f=s("").addClass("button-"+p).addClass("ui-drilldown-button fa fa-plus-square"),m=s("").addClass("subgroup-"+p).addClass("ui-drilldown-subgroup");u.append(s("").append(f).append(a._templateOption({label:d.name,value:d.value}))),h.push(p),i(m,d.options,h),u.append(m),e(u,p)}else u.append(a._templateOption({label:d.name,value:d.value}));n.append(u)}}var a=this;this.header_index={};var n=s("");return i(n,this.model.get("data")),n},_template:function(){return s("").addClass("ui-options-list drilldown-container").attr("id",this.model.id)}})}}.apply(e,n))&&(t.exports=l)}).call(e,i(0),i(2))},31:function(t,e,i){"use strict";(function(s,a,n,l){var o,r;o=[i(3),i(5),i(8),i(32),i(33),i(34)],void 0!==(r=function(t,e,i,o,r,d){var c=s.View.extend({initialize:function(t,e){this.app=t,this.inputs=e.inputs,this.parameters=new d,this.setElement(a("")),this.render()},render:function(){var t=this;this.$el.empty(),n.each(this.inputs,function(e){t.add(e)})},add:function(e){var i=l.extend(!0,{},e);switch(i.id=e.id=t.uid(),this.app.input_list[i.id]=i,i.type){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,this.app.model.get("sustain_conditionals")&&(t.test_param.disabled=!0);var i=this._addRow(t.test_param);i.model&&i.model.set("onchange",function(i){var s=e.app.data.matchCase(t,i);for(var a in t.cases){var n=t.cases[a],l=e.$("#"+t.id+"-section-"+a),o=!1;for(var r in n.inputs)if(!n.inputs[r].hidden){o=!0;break}a==s&&o?l.fadeIn("fast"):l.hide()}e.app.trigger("change")});for(var s in t.cases){var a=new c(this.app,{inputs:t.cases[s].inputs});this._append(a.$el.addClass("ui-form-section"),t.id+"-section-"+s)}i.trigger("change")},_addRepeat:function(t){function e(e){var n=t.id+"-section-"+s++,l=new c(i.app,{inputs:e});a.add({id:n,$el:l.$el,ondel:function(){a.del(n),i.app.trigger("change")}})}for(var i=this,s=0,a=new o.View({title:t.title||"Repeat",min:t.min,max:t.max,onnew:function(){e(t.inputs),i.app.trigger("change")}}),l=n.size(t.cache),d=0;d").addClass("ui-form-info").html(t.help)),this.app.on("expand",function(t){e.$("#"+t).length>0&&e.expand()}),this._append(e.$el,t.id)},_addRow:function(t){var e=this,i=t.id;t.onchange=t.onchange||function(){e.app.trigger("change",i)};var s=this.parameters.create(t);this.app.field_list[i]=s;var a=new r(this.app,{name:t.name,label:t.hide_label?"":t.label||t.name,value:t.value,text_value:t.text_value,collapsible_value:t.collapsible_value,collapsible_preview:t.collapsible_preview,help:t.help,argument:t.argument,disabled:t.disabled,color:t.color,style:t.style,backdrop:t.backdrop,hidden:t.hidden,fixed:t.fixed,field:s});return this.app.element_list[i]=a,this._append(a.$el,t.id),s},_append:function(t,e){this.$el.append(t.addClass("section-row").attr("id",e))}});return{View:c}}.apply(e,o))&&(t.exports=r)}).call(e,i(1),i(0),i(2),i(0))},32:function(t,e,i){"use strict";(function(s,a,n){var l,o;l=[i(3),i(8),i(5)],void 0!==(o=function(t,e,i){return{View:s.View.extend({initialize:function(e){this.list={},this.options=t.merge(e,{title:"Repeat",empty_text:"Not available.",max:null,min:null}),this.button_new=new i.ButtonIcon({icon:"fa-plus",title:"Insert "+this.options.title,tooltip:"Add new "+this.options.title+" block",cls:"ui-button-icon ui-clear-float form-repeat-add",onclick:function(){e.onnew&&e.onnew()}}),this.setElement(a("").append(this.$list=a("")).append(a("").append(this.button_new.$el)))},size:function(){return n.size(this.list)},add:function(t){if(!t.id||this.list[t.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate or invalid repeat block id.");var s=new i.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain form-repeat-delete",onclick:function(){t.ondel&&t.ondel()}}),a=new e.View({id:t.id,title:"placeholder",cls:t.cls||"ui-portlet-repeat",operations:{button_delete:s}});a.append(t.$el),a.$el.addClass("section-row").hide(),this.list[t.id]=a,this.$list.append(a.$el.fadeIn("fast")),this.options.max>0&&this.size()>=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.$list.find("#"+t).remove(),delete this.list[t],this.button_new.enable(),this._refresh()},delAll:function(){for(var t in this.list)this.del(t)},hideOptions:function(){this.button_new.$el.hide(),n.each(this.list,function(t){t.hideOperation("button_delete")}),n.isEmpty(this.list)&&this.$el.append(a("").addClass("ui-form-info").html(this.options.empty_text))},_refresh:function(){var t=0;for(var e in this.list){var i=this.list[e];i.title(++t+": "+this.options.title),i[this.size()>this.options.min?"showOperation":"hideOperation"]("button_delete")}}})}}.apply(e,l))&&(t.exports=o)}).call(e,i(1),i(0),i(2))},33:function(t,e,i){"use strict";(function(i,s,a){var n,l;n=[],void 0!==(l=function(){return i.View.extend({initialize:function(t,e){this.app=t,this.app_options=t.model?t.model.attributes:{},this.field=e&&e.field||new i.View,this.model=e&&e.model||new i.Model({text_enable:this.app_options.text_enable||"Enable",text_disable:this.app_options.text_disable||"Disable",cls_enable:this.app_options.cls_enable||"fa fa-caret-square-o-down",cls_disable:this.app_options.cls_disable||"fa fa-caret-square-o-up",always_refresh:this.app_options.always_refresh}).set(e),this.setElement(this._template()),this.$field=this.$(".ui-form-field"),this.$info=this.$(".ui-form-info"),this.$preview=this.$(".ui-form-preview"),this.$collapsible=this.$(".ui-form-collapsible"),this.$collapsible_text=this.$(".ui-form-collapsible-text"),this.$collapsible_icon=this.$(".ui-form-collapsible-icon"),this.$title=this.$(".ui-form-title"),this.$title_text=this.$(".ui-form-title-text"),this.$error_text=this.$(".ui-form-error-text"),this.$error=this.$(".ui-form-error"),this.$backdrop=this.$(".ui-form-backdrop"),this.$field.prepend(this.field.$el);var s=this.model.get("collapsible_value");this.field.collapsed=void 0!==s&&JSON.stringify(this.model.get("value"))==JSON.stringify(s),this.listenTo(this.model,"change",this.render,this),this.render();var a=this;this.$collapsible.on("click",function(){a.field.collapsed=!a.field.collapsed,t.trigger&&t.trigger("change"),a.render()}),this.field.model&&!this.model.get("always_refresh")&&this.listenTo(this.field.model,"change:value",function(){a.reset()})},backdrop:function(){this.model.set("backdrop",!0)},error:function(t){this.model.set("error_text",t)},reset:function(){!this.model.get("fixed")&&this.model.set("error_text",null)},render:function(){s(".tooltip").hide();var t=this.model.get("help",""),e=this.model.get("argument");e&&-1==t.indexOf("("+e+")")&&(t+=" ("+e+")"),this.$info.html(t),this.$el[this.model.get("hidden")?"hide":"show"](),this.$preview[this.field.collapsed&&this.model.get("collapsible_preview")||this.model.get("disabled")?"show":"hide"]().html(a.escape(this.model.get("text_value")));var i=this.model.get("error_text");if(this.$error[i?"show":"hide"](),this.$el[i?"addClass":"removeClass"]("ui-error"),this.$error_text.html(i),this.$backdrop[this.model.get("backdrop")?"show":"hide"](),this.field.collapsed||this.model.get("disabled")?this.$field.hide():this.$field.show(),this.field.model&&this.field.model.set({color:this.model.get("color"),style:this.model.get("style")}),this.model.get("disabled")||void 0===this.model.get("collapsible_value"))this.$title_text.show().text(this.model.get("label")),this.$collapsible.hide();else{var n=this.field.collapsed?"enable":"disable";this.$title_text.hide(),this.$collapsible.show(),this.$collapsible_text.text(this.model.get("label")),this.$collapsible_icon.removeClass().addClass("icon").addClass(this.model.get("cls_"+n)).attr("data-original-title",this.model.get("text_"+n)).tooltip({placement:"bottom"})}},_template:function(){return s("").addClass("ui-form-element").append(s("").addClass("ui-form-error ui-error").append(s("").addClass("fa fa-arrow-down")).append(s("").addClass("ui-form-error-text"))).append(s("").addClass("ui-form-title").append(s("").addClass("ui-form-collapsible").append(s("").addClass("ui-form-collapsible-icon")).append(s("").addClass("ui-form-collapsible-text"))).append(s("").addClass("ui-form-title-text"))).append(s("").addClass("ui-form-field").append(s("").addClass("ui-form-info")).append(s("").addClass("ui-form-backdrop"))).append(s("").addClass("ui-form-preview"))}})}.apply(e,n))&&(t.exports=l)}).call(e,i(1),i(0),i(2))},34:function(t,e,i){"use strict";(function(s,a,n){var l,o;l=[i(3),i(5),i(35),i(36),i(37),i(38),i(40)],void 0!==(o=function(t,e,i,l,o,r,d){return s.Model.extend({types:{text:"_fieldText",password:"_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",upload:"_fieldUpload",genomespacefile:"_fieldGenomeSpace"},create:function(t){var e=this.types[t.type],i="function"==typeof this[e]?this[e].call(this,t):null;return i||(i=t.options?this._fieldSelect(t):this._fieldText(t),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+t.type+").")),void 0===t.value&&(t.value=null),i.value(t.value),i},_fieldData:function(t){return new i.View({id:"field-"+t.id,extensions:t.extensions,optional:t.optional,multiple:t.multiple,type:t.type,flavor:t.flavor,data:t.options,onchange:t.onchange})},_fieldSelect:function(t){if(t.is_workflow)return this._fieldText(t);"data_column"==t.type&&(t.error_text="Missing columns in referenced dataset.");var i=t.data;i||(i=[],a.each(t.options,function(t){i.push({label:t[0],value:t[1]})}));var s=e.Select;switch(t.display){case"checkboxes":s=e.Checkbox;break;case"radio":s=e.Radio;break;case"radiobutton":s=e.RadioButton}return new s.View({id:"field-"+t.id,data:i,error_text:t.error_text||"No options available",readonly:t.readonly,multiple:t.multiple,optional:t.optional,onchange:t.onchange,individual:t.individual,searchable:"workflow"!==t.flavor})},_fieldDrilldown:function(t){return t.is_workflow?this._fieldText(t):new e.Drilldown.View({id:"field-"+t.id,data:t.options,display:t.display,optional:t.optional,onchange:t.onchange})},_fieldText:function(i){if(i.options&&i.data)if(i.area=i.multiple,t.isEmpty(i.value))i.value=null;else if(n.isArray(i.value)){var s="";for(var a in i.value){if(s+=String(i.value[a]),!i.multiple)break;s+="\n"}i.value=s}return new e.Input({id:"field-"+i.id,type:i.type,area:i.area,readonly:i.readonly,placeholder:i.placeholder,datalist:i.datalist,onchange:i.onchange})},_fieldSlider:function(t){return new e.Slider.View({id:"field-"+t.id,precise:"float"==t.type,is_workflow:t.is_workflow,min:t.min,max:t.max,onchange:t.onchange})},_fieldHidden:function(t){return new e.Hidden({id:"field-"+t.id,info:t.info})},_fieldBoolean:function(t){return new e.RadioButton.View({id:"field-"+t.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:t.onchange})},_fieldColor:function(t){return new d({id:"field-"+t.id,onchange:t.onchange})},_fieldLibrary:function(t){return new l.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:t.onchange})},_fieldFtp:function(t){return new o.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:t.onchange})},_fieldGenomeSpace:function(t){var e=this;return new r.View({id:"field-"+t.id,onchange:function(){e.app.trigger("change")}})},_fieldUpload:function(t){return new e.Upload({id:"field-"+t.id,onchange:t.onchange})}})}.apply(e,l))&&(t.exports=o)}).call(e,i(1),i(2),i(0))},35:function(t,e,i){"use strict";(function(s,a,n){var l,o;l=[i(3),i(5),i(17)],void 0!==(o=function(t,e,i){var l={DISABLED:"disabled",ENABLED:"enabled",LINKED:"linked"},o={data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:l.DISABLED},{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.LINKED},{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.LINKED}],data_multiple:[{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.DISABLED},{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collections",multiple:!0,batch:l.DISABLED}],data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.DISABLED}],workflow_data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:l.DISABLED}],workflow_data_multiple:[{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.DISABLED}],workflow_data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.DISABLED}],module_data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:l.DISABLED},{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:l.ENABLED}],module_data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:l.DISABLED},{src:"hdca",icon:"fa-folder",tooltip:"Multiple collections",multiple:!0,batch:l.ENABLED}]};return{View:s.View.extend({initialize:function(t){var i=this;this.model=t&&t.model||new s.Model({src_labels:{hda:"dataset",hdca:"dataset collection"},pagelimit:100,statustimer:1e3}).set(t),this.setElement(a("").addClass("ui-select-content")),this.button_product=new e.RadioButton.View({value:"false",data:[{icon:"fa fa-chain",value:"false",tooltip:"Linked inputs will be run in matched order with other datasets e.g. use this for matching forward and reverse reads."},{icon:"fa fa-chain-broken",value:"true",tooltip:"Unlinked dataset inputs will be run against *all* other inputs."}]});var n=a("").addClass("ui-form-info").append(a("").addClass("fa fa-sitemap")).append(a("").html("This is a batch mode input field. Separate jobs will be triggered for each dataset selection."));this.$batch={linked:n.clone(),enabled:n.clone().append(a("").append(a("").addClass("ui-form-title").html("Batch options:")).append(this.button_product.$el)).append(a("").css("clear","both"))},this.$el.on("dragenter",function(t){this.lastenter=t.target,i.$el.addClass("ui-dragover")}).on("dragover",function(t){t.preventDefault()}).on("dragleave",function(t){this.lastenter===t.target&&i.$el.removeClass("ui-dragover")}).on("drop",function(t){i._handleDrop(t)}),this.history={},this.listenTo(this.model,"change:data",this._changeData,this),this.listenTo(this.model,"change:wait",this._changeWait,this),this.listenTo(this.model,"change:current",this._changeCurrent,this),this.listenTo(this.model,"change:value",this._changeValue,this),this.listenTo(this.model,"change:type change:optional change:multiple change:extensions",this._changeType,this),this.render(),this.on("change",function(){t.onchange&&t.onchange(i.value())})},render:function(){this._changeType(),this._changeValue(),this._changeWait()},wait:function(){this.model.set("wait",!0)},unwait:function(){this.model.set("wait",!1)},update:function(t){this.model.set("data",t)},value:function(t){void 0!==t&&this.model.set("value",t);var e=this.model.get("current");if(this.config[e]){var i=this.fields[e].value();if(null!==i&&(i=a.isArray(i)?i:[i],i.length>0)){var s=this._batch({values:[]});for(var n in i){var l=this.history[i[n]+"_"+this.config[e].src];if(!l)return Galaxy.emit.debug("ui-select-content::value()","Requested details not found for '"+i[n]+"'."),null;s.values.push(l)}return s.values.sort(function(t,e){return t.hid-e.hid}),s}}else Galaxy.emit.debug("ui-select-content::value()","Invalid value/source '"+t+"'.");return null},_changeCurrent:function(){var t=this;n.each(this.fields,function(e,i){t.model.get("current")==i?(e.$el.show(),n.each(t.$batch,function(e,s){e[t.config[i].batch==s?"show":"hide"]()}),t.button_type.value(i)):e.$el.hide()})},_changeType:function(){var s=this,a=(this.model.get("flavor")?this.model.get("flavor")+"_":"")+String(this.model.get("type"))+(this.model.get("multiple")?"_multiple":"");o[a]?this.config=o[a]:(this.config=o.data,Galaxy.emit.debug("ui-select-content::_changeType()","Invalid configuration/type id '"+a+"'."));var l=s.model.get("data"),r=t.textify(this.model.get("extensions")),d=this.model.get("src_labels");this.fields=[],this.button_data=[],n.each(this.config,function(t,e){s.button_data.push({value:e,icon:t.icon,tooltip:t.tooltip}),s.fields.push(new i.View({optional:s.model.get("optional"),multiple:t.multiple,searchable:!t.multiple||l&&l[t.src]&&l[t.src].length>s.model.get("pagelimit"),individual:!0,error_text:"No "+(r?r+" ":"")+(d[t.src]||"content")+" available.",onchange:function(){s.trigger("change")}}))}),this.button_type=new e.RadioButton.View({value:this.model.get("current"),data:this.button_data,onchange:function(t){s.model.set("current",t),s.trigger("change")}}),this.$el.empty();var c=0;this.fields.length>1&&(this.$el.append(this.button_type.$el),c=Math.max(0,36*this.fields.length)+"px"),n.each(this.fields,function(t){s.$el.append(t.$el.css({"margin-left":c}))}),n.each(this.$batch,function(t,e){s.$el.append(t.css({"margin-left":c}))}),this.model.set("current",0),this._changeCurrent(),this._changeData()},_changeWait:function(){var t=this;n.each(this.fields,function(e){e[t.model.get("wait")?"wait":"unwait"]()})},_changeData:function(){var t=this.model.get("data"),e=this,i={};n.each(t,function(t,s){i[s]=[],n.each(t,function(t){i[s].push({hid:t.hid,keep:t.keep,label:t.hid+": "+t.name,value:t.id,tags:t.tags}),e.history[t.id+"_"+s]=t})}),n.each(this.config,function(t,s){i[t.src]&&e.fields[s].add(i[t.src],function(t,e){return e.hid-t.hid})})},_changeValue:function(){var t=this.model.get("value");if(t&&t.values&&t.values.length>0){var e=[];n.each(t.values,function(t){e.push(t.id)});for(var i=t.values[0].src,s=t.values.length>1,a=0;a
\";\n }\n });\n\n return {\n View: View\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 20:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $, _, jQuery) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n //jquery\n //backbone\n], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n // =============================================================================\n /**\n * view for a popup menu\n */\n var PopupMenu = Backbone.View.extend({\n //TODO: maybe better as singleton off the Galaxy obj\n /** Cache the desired button element and options, set up the button click handler\n * NOTE: attaches this view as HTML/jQ data on the button for later use.\n */\n initialize: function initialize($button, options) {\n // default settings\n this.$button = $button;\n if (!this.$button.length) {\n this.$button = $(\"\");\n }\n this.options = options || [];\n this.$button.data(\"popupmenu\", this);\n\n // set up button click -> open menu behavior\n var menu = this;\n this.$button.click(function (event) {\n // if there's already a menu open, remove it\n $(\".popmenu-wrapper\").remove();\n menu._renderAndShow(event);\n return false;\n });\n },\n\n // render the menu, append to the page body at the click position, and set up the 'click-away' handlers, show\n _renderAndShow: function _renderAndShow(clickEvent) {\n this.render();\n this.$el.appendTo(\"body\").css(this._getShownPosition(clickEvent)).show();\n this._setUpCloseBehavior();\n },\n\n // render the menu\n // this menu doesn't attach itself to the DOM ( see _renderAndShow )\n render: function render() {\n // render the menu body absolute and hidden, fill with template\n this.$el.addClass(\"popmenu-wrapper\").hide().css({ position: \"absolute\" }).html(this.template(this.$button.attr(\"id\"), this.options));\n\n // set up behavior on each link/anchor elem\n if (this.options.length) {\n var menu = this;\n //precondition: there should be one option per li\n this.$el.find(\"li\").each(function (i, li) {\n var option = menu.options[i];\n\n // if the option has 'func', call that function when the anchor is clicked\n if (option.func) {\n $(this).children(\"a.popupmenu-option\").click(function (event) {\n option.func.call(menu, event, option);\n // We must preventDefault otherwise clicking \"cancel\"\n // on a purge or something still navigates and causes\n // the action.\n event.preventDefault();\n // bubble up so that an option click will call the close behavior\n });\n }\n });\n }\n return this;\n },\n\n template: function template(id, options) {\n return ['
', this._templateOptions(options), \"
\"].join(\"\");\n },\n\n _templateOptions: function _templateOptions(options) {\n if (!options.length) {\n return \"
(no options)
\";\n }\n return _.map(options, function (option) {\n if (option.divider) {\n return '';\n } else if (option.header) {\n return ['
\"].join(\"\");\n }).join(\"\");\n },\n\n // get the absolute position/offset for the menu\n _getShownPosition: function _getShownPosition(clickEvent) {\n // display menu horiz. centered on click...\n var menuWidth = this.$el.width();\n var x = clickEvent.pageX - menuWidth / 2;\n\n // adjust to handle horiz. scroll and window dimensions ( draw entirely on visible screen area )\n x = Math.min(x, $(document).scrollLeft() + $(window).width() - menuWidth - 5);\n x = Math.max(x, $(document).scrollLeft() + 5);\n return {\n top: clickEvent.pageY,\n left: x\n };\n },\n\n // bind an event handler to all available frames so that when anything is clicked\n // the menu is removed from the DOM and the event handler unbinds itself\n _setUpCloseBehavior: function _setUpCloseBehavior() {\n var menu = this;\n //TODO: alternately: focus hack, blocking overlay, jquery.blockui\n\n // function to close popup and unbind itself\n function closePopup(event) {\n $(document).off(\"click.close_popup\");\n if (window && window.parent !== window) {\n try {\n $(window.parent.document).off(\"click.close_popup\");\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\").contents().off(\"click.close_popup\");\n } catch (err) {}\n }\n menu.remove();\n }\n\n $(\"html\").one(\"click.close_popup\", closePopup);\n if (window && window.parent !== window) {\n try {\n $(window.parent.document).find(\"html\").one(\"click.close_popup\", closePopup);\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\").contents().one(\"click.close_popup\", closePopup);\n } catch (err) {}\n }\n },\n\n // add a menu option/item at the given index\n addItem: function addItem(item, index) {\n // append to end if no index\n index = index >= 0 ? index : this.options.length;\n this.options.splice(index, 0, item);\n return this;\n },\n\n // remove a menu option/item at the given index\n removeItem: function removeItem(index) {\n if (index >= 0) {\n this.options.splice(index, 1);\n }\n return this;\n },\n\n // search for a menu option by its html\n findIndexByHtml: function findIndexByHtml(html) {\n for (var i = 0; i < this.options.length; i++) {\n if (_.has(this.options[i], \"html\") && this.options[i].html === html) {\n return i;\n }\n }\n return null;\n },\n\n // search for a menu option by its html\n findItemByHtml: function findItemByHtml(html) {\n return this.options[this.findIndexByHtml(html)];\n },\n\n // string representation\n toString: function toString() {\n return \"PopupMenu\";\n }\n });\n /** shortcut to new for when you don't need to preserve the ref */\n PopupMenu.create = function _create($button, options) {\n return new PopupMenu($button, options);\n };\n\n // -----------------------------------------------------------------------------\n // the following class functions are bridges from the original make_popupmenu and make_popup_menus\n // to the newer backbone.js PopupMenu\n\n /** Create a PopupMenu from simple map initial_options activated by clicking button_element.\n * Converts initial_options to object array used by PopupMenu.\n * @param {jQuery|DOMElement} button_element element which, when clicked, activates menu\n * @param {Object} initial_options map of key -> values, where\n * key is option text, value is fn to call when option is clicked\n * @returns {PopupMenu} the PopupMenu created\n */\n PopupMenu.make_popupmenu = function (button_element, initial_options) {\n var convertedOptions = [];\n _.each(initial_options, function (optionVal, optionKey) {\n var newOption = { html: optionKey };\n\n // keys with null values indicate: header\n if (optionVal === null) {\n // !optionVal? (null only?)\n newOption.header = true;\n\n // keys with function values indicate: a menu option\n } else if (jQuery.type(optionVal) === \"function\") {\n newOption.func = optionVal;\n }\n //TODO:?? any other special optionVals?\n // there was no divider option originally\n convertedOptions.push(newOption);\n });\n return new PopupMenu($(button_element), convertedOptions);\n };\n\n /** Find all anchors in $parent (using selector) and covert anchors into a PopupMenu options map.\n * @param {jQuery} $parent the element that contains the links to convert to options\n * @param {String} selector jq selector string to find links\n * @returns {Object[]} the options array to initialize a PopupMenu\n */\n //TODO: lose parent and selector, pass in array of links, use map to return options\n PopupMenu.convertLinksToOptions = function ($parent, selector) {\n $parent = $($parent);\n selector = selector || \"a\";\n var options = [];\n $parent.find(selector).each(function (elem, i) {\n var option = {},\n $link = $(elem);\n\n // convert link text to the option text (html) and the href into the option func\n option.html = $link.text();\n if ($link.attr(\"href\")) {\n var linkHref = $link.attr(\"href\"),\n linkTarget = $link.attr(\"target\"),\n confirmText = $link.attr(\"confirm\");\n\n option.func = function () {\n // if there's a \"confirm\" attribute, throw up a confirmation dialog, and\n // if the user cancels - do nothing\n if (confirmText && !confirm(confirmText)) {\n return;\n }\n\n // if there's no confirm attribute, or the user accepted the confirm dialog:\n switch (linkTarget) {\n // relocate the center panel\n case \"_parent\":\n window.parent.location = linkHref;\n break;\n\n // relocate the entire window\n case \"_top\":\n window.top.location = linkHref;\n break;\n\n // relocate this panel\n default:\n window.location = linkHref;\n }\n };\n }\n options.push(option);\n });\n return options;\n };\n\n /** Create a single popupmenu from existing DOM button and anchor elements\n * @param {jQuery} $buttonElement the element that when clicked will open the menu\n * @param {jQuery} $menuElement the element that contains the anchors to convert into a menu\n * @param {String} menuElementLinkSelector jq selector string used to find anchors to be made into menu options\n * @returns {PopupMenu} the PopupMenu (Backbone View) that can render, control the menu\n */\n PopupMenu.fromExistingDom = function ($buttonElement, $menuElement, menuElementLinkSelector) {\n $buttonElement = $($buttonElement);\n $menuElement = $($menuElement);\n var options = PopupMenu.convertLinksToOptions($menuElement, menuElementLinkSelector);\n // we're done with the menu (having converted it to an options map)\n $menuElement.remove();\n return new PopupMenu($buttonElement, options);\n };\n\n /** Create all popupmenus within a document or a more specific element\n * @param {DOMElement} parent the DOM element in which to search for popupmenus to build (defaults to document)\n * @param {String} menuSelector jq selector string to find popupmenu menu elements (defaults to \"div[popupmenu]\")\n * @param {Function} buttonSelectorBuildFn the function to build the jq button selector.\n * Will be passed $menuElement, parent.\n * (Defaults to return '#' + $menuElement.attr( 'popupmenu' ); )\n * @returns {PopupMenu[]} array of popupmenus created\n */\n PopupMenu.make_popup_menus = function (parent, menuSelector, buttonSelectorBuildFn) {\n parent = parent || document;\n // orig. Glx popupmenu menus have a (non-std) attribute 'popupmenu'\n // which contains the id of the button that activates the menu\n menuSelector = menuSelector || \"div[popupmenu]\";\n // default to (orig. Glx) matching button to menu by using the popupmenu attr of the menu as the id of the button\n buttonSelectorBuildFn = buttonSelectorBuildFn || function ($menuElement, parent) {\n return \"#\" + $menuElement.attr(\"popupmenu\");\n };\n\n // aggregate and return all PopupMenus\n var popupMenusCreated = [];\n $(parent).find(menuSelector).each(function () {\n var $menuElement = $(this),\n $buttonElement = $(parent).find(buttonSelectorBuildFn($menuElement, parent));\n popupMenusCreated.push(PopupMenu.fromDom($buttonElement, $menuElement));\n $buttonElement.addClass(\"popup\");\n });\n return popupMenusCreated;\n };\n\n // =============================================================================\n return PopupMenu;\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0), __webpack_require__(2), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 22:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** This class creates a ui table element. */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils) {\n var View = Backbone.View.extend({\n initialize: function initialize(options) {\n this.options = Utils.merge(options, {\n content: \"No content available.\",\n onchange: null,\n ondblclick: null,\n onconfirm: null,\n cls: \"ui-table\",\n selectable: true,\n cls_tr: \"\"\n });\n this.setElement(this._template());\n this.$thead = this.$(\"thead\");\n this.$tbody = this.$(\"tbody\");\n this.$tmessage = this.$(\"tmessage\");\n this.row = this._row();\n this.row_count = 0;\n },\n\n events: {\n click: \"_onclick\",\n dblclick: \"_ondblclick\"\n },\n\n /** Add cell to header row */\n addHeader: function addHeader($el) {\n this.row.append($(\"
\").append($el));\n },\n\n /** Append header row to table */\n appendHeader: function appendHeader() {\n this.$thead.append(this.row);\n this.row = $(\"
\");\n },\n\n /** Add cell to row */\n add: function add($el, width, align) {\n var wrapper = $(\"
\");\n if (width) {\n wrapper.css(\"width\", width);\n }\n if (align) {\n wrapper.css(\"text-align\", align);\n }\n this.row.append(wrapper.append($el));\n },\n\n /** Append row to table */\n append: function append(id, fade) {\n this._commit(id, fade, false);\n },\n\n /** Prepend row to table */\n prepend: function prepend(id, fade) {\n this._commit(id, fade, true);\n },\n\n /** Helper to get row element */\n get: function get(id) {\n return this.$(\"#\" + id);\n },\n\n /** Delete row by id */\n del: function del(id) {\n var item = this.$tbody.find(\"#\" + id);\n if (item.length > 0) {\n item.remove();\n this.row_count--;\n this._refresh();\n }\n },\n\n /** Delete all rows */\n delAll: function delAll() {\n this.$tbody.empty();\n this.row_count = 0;\n this._refresh();\n },\n\n /** Set a value i.e. selects/highlights a particular row by id */\n value: function value(new_value) {\n if (this.options.selectable) {\n this.before = this.$tbody.find(\".current\").attr(\"id\");\n if (new_value !== undefined) {\n this.$tbody.find(\"tr\").removeClass(\"current\");\n if (new_value) {\n this.$tbody.find(\"#\" + new_value).addClass(\"current\");\n }\n }\n var after = this.$tbody.find(\".current\").attr(\"id\");\n if (after === undefined) {\n return null;\n } else {\n if (after != this.before && this.options.onchange) {\n this.options.onchange(new_value);\n }\n return after;\n }\n }\n },\n\n /** Return the number of rows */\n size: function size() {\n return this.$tbody.find(\"tr\").length;\n },\n\n /** Helper to append rows */\n _commit: function _commit(id, fade, prepend) {\n this.del(id);\n this.row.attr(\"id\", id);\n if (prepend) {\n this.$tbody.prepend(this.row);\n } else {\n this.$tbody.append(this.row);\n }\n if (fade) {\n this.row.hide();\n this.row.fadeIn();\n }\n this.row = this._row();\n this.row_count++;\n this._refresh();\n },\n\n /** Helper to create new row */\n _row: function _row() {\n return $('
');\n },\n\n /** Handles onclick events */\n _onclick: function _onclick(e) {\n var old_value = this.value();\n var new_value = $(e.target).closest(\"tr\").attr(\"id\");\n if (new_value != \"\") {\n if (new_value && old_value != new_value) {\n if (this.options.onconfirm) {\n this.options.onconfirm(new_value);\n } else {\n this.value(new_value);\n }\n }\n }\n },\n\n /** Handles ondblclick events */\n _ondblclick: function _ondblclick(e) {\n var value = this.value();\n if (value && this.options.ondblclick) {\n this.options.ondblclick(value);\n }\n },\n\n /** Refresh helper */\n _refresh: function _refresh() {\n if (this.row_count == 0) {\n this.$tmessage.show();\n } else {\n this.$tmessage.hide();\n }\n },\n\n /** Template */\n _template: function _template() {\n return \"
\" + '
' + \"\" + \"\" + \"
\" + \"\" + this.options.content + \"\" + \"
\";\n }\n });\n\n return {\n View: View\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 23:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $, _) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/* This class maps the form dom to an api compatible javascript dictionary. */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils) {\n var Manager = Backbone.Model.extend({\n initialize: function initialize(app) {\n this.app = app;\n },\n\n /** Creates a checksum. */\n checksum: function checksum() {\n var sum = \"\";\n var self = this;\n this.app.section.$el.find(\".section-row\").each(function () {\n var id = $(this).attr(\"id\");\n var field = self.app.field_list[id];\n if (field) {\n sum += id + \":\" + JSON.stringify(field.value && field.value()) + \":\" + field.collapsed + \";\";\n }\n });\n return sum;\n },\n\n /** Convert dom into a dictionary of flat id/value pairs used e.g. on job submission. */\n create: function create() {\n var self = this;\n\n // get raw dictionary from dom\n var dict = {};\n this._iterate(this.app.section.$el, dict);\n\n // add to result dictionary, label elements\n var result_dict = {};\n this.flat_dict = {};\n function add(flat_id, input_id, input_value) {\n self.flat_dict[flat_id] = input_id;\n result_dict[flat_id] = input_value;\n self.app.element_list[input_id] && self.app.element_list[input_id].$el.attr(\"tour_id\", flat_id);\n }\n // converter between raw dictionary and job dictionary\n function convert(identifier, head) {\n for (var index in head) {\n var node = head[index];\n if (node.input) {\n var input = node.input;\n var flat_id = identifier;\n if (identifier != \"\") {\n flat_id += \"|\";\n }\n flat_id += input.name;\n switch (input.type) {\n case \"repeat\":\n var section_label = \"section-\";\n var block_indices = [];\n var block_prefix = null;\n for (var block_label in node) {\n var pos = block_label.indexOf(section_label);\n if (pos != -1) {\n pos += section_label.length;\n block_indices.push(parseInt(block_label.substr(pos)));\n if (!block_prefix) {\n block_prefix = block_label.substr(0, pos);\n }\n }\n }\n block_indices.sort(function (a, b) {\n return a - b;\n });\n var index = 0;\n for (var i in block_indices) {\n convert(flat_id + \"_\" + index++, node[block_prefix + block_indices[i]]);\n }\n break;\n case \"conditional\":\n var value = self.app.field_list[input.id].value();\n add(flat_id + \"|\" + input.test_param.name, input.id, value);\n var selectedCase = _matchCase(input, value);\n if (selectedCase != -1) {\n convert(flat_id, head[input.id + \"-section-\" + selectedCase]);\n }\n break;\n case \"section\":\n convert(!input.flat && flat_id || \"\", node);\n break;\n default:\n var field = self.app.field_list[input.id];\n if (field && field.value) {\n var value = field.value();\n if (input.ignore === undefined || input.ignore != value) {\n if (field.collapsed && input.collapsible_value) {\n value = input.collapsible_value;\n }\n add(flat_id, input.id, value);\n if (input.payload) {\n for (var p_id in input.payload) {\n add(p_id, input.id, input.payload[p_id]);\n }\n }\n }\n }\n }\n }\n }\n }\n convert(\"\", dict);\n return result_dict;\n },\n\n /** Matches flat ids to corresponding input element\n * @param{string} flat_id - Flat input id to be looked up.\n */\n match: function match(flat_id) {\n return this.flat_dict && this.flat_dict[flat_id];\n },\n\n /** Match conditional values to selected cases\n */\n matchCase: function matchCase(input, value) {\n return _matchCase(input, value);\n },\n\n /** Matches a new tool model to the current input elements e.g. used to update dynamic options\n */\n matchModel: function matchModel(model, callback) {\n var self = this;\n visitInputs(model.inputs, function (input, name) {\n self.flat_dict[name] && callback(input, self.flat_dict[name]);\n });\n },\n\n /** Matches identifier from api response to input elements e.g. used to display validation errors\n */\n matchResponse: function matchResponse(response) {\n var result = {};\n var self = this;\n function search(id, head) {\n if (typeof head === \"string\") {\n var input_id = self.flat_dict[id];\n input_id && (result[input_id] = head);\n } else {\n for (var i in head) {\n var new_id = i;\n if (id !== \"\") {\n var separator = \"|\";\n if (head instanceof Array) {\n separator = \"_\";\n }\n new_id = id + separator + new_id;\n }\n search(new_id, head[i]);\n }\n }\n }\n search(\"\", response);\n return result;\n },\n\n /** Map dom tree to dictionary tree with input elements.\n */\n _iterate: function _iterate(parent, dict) {\n var self = this;\n var children = $(parent).children();\n children.each(function () {\n var child = this;\n var id = $(child).attr(\"id\");\n if ($(child).hasClass(\"section-row\")) {\n var input = self.app.input_list[id];\n dict[id] = input && { input: input } || {};\n self._iterate(child, dict[id]);\n } else {\n self._iterate(child, dict);\n }\n });\n }\n });\n\n /** Match conditional values to selected cases\n * @param{dict} input - Definition of conditional input parameter\n * @param{dict} value - Current value\n */\n var _matchCase = function _matchCase(input, value) {\n if (input.test_param.type == \"boolean\") {\n if (value == \"true\") {\n value = input.test_param.truevalue || \"true\";\n } else {\n value = input.test_param.falsevalue || \"false\";\n }\n }\n for (var i in input.cases) {\n if (input.cases[i].value == value) {\n return i;\n }\n }\n return -1;\n };\n\n /** Visits tool inputs\n * @param{dict} inputs - Nested dictionary of input elements\n * @param{dict} callback - Called with the mapped dictionary object and corresponding model node\n */\n var visitInputs = function visitInputs(inputs, callback, prefix, context) {\n context = $.extend(true, {}, context);\n _.each(inputs, function (input) {\n if (input && input.type && input.name) {\n context[input.name] = input;\n }\n });\n for (var key in inputs) {\n var node = inputs[key];\n node.name = node.name || key;\n var name = prefix ? prefix + \"|\" + node.name : node.name;\n switch (node.type) {\n case \"repeat\":\n _.each(node.cache, function (cache, j) {\n visitInputs(cache, callback, name + \"_\" + j, context);\n });\n break;\n case \"conditional\":\n if (node.test_param) {\n callback(node.test_param, name + \"|\" + node.test_param.name, context);\n var selectedCase = _matchCase(node, node.test_param.value);\n if (selectedCase != -1) {\n visitInputs(node.cases[selectedCase].inputs, callback, name, context);\n } else {\n Galaxy.emit.debug(\"form-data::visitInputs() - Invalid case for \" + name + \".\");\n }\n } else {\n Galaxy.emit.debug(\"form-data::visitInputs() - Conditional test parameter missing for \" + name + \".\");\n }\n break;\n case \"section\":\n visitInputs(node.inputs, callback, name, context);\n break;\n default:\n callback(node, name, context);\n }\n }\n };\n\n return {\n Manager: Manager,\n visitInputs: visitInputs\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0), __webpack_require__(2)))\n\n/***/ }),\n\n/***/ 27:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, _, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n// dependencies\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n // grid model\n return Backbone.Model.extend({\n defaults: {\n url_base: \"\",\n async: false,\n async_ops: [],\n categorical_filters: [],\n filters: {},\n sort_key: null,\n show_item_checkboxes: false,\n advanced_search: false,\n cur_page: 1,\n num_pages: 1,\n operation: undefined,\n item_ids: undefined\n },\n\n /**\n * Return true if operation can be done asynchronously.\n */\n can_async_op: function can_async_op(op) {\n return _.indexOf(this.attributes.async_ops, op) !== -1;\n },\n\n /**\n * Add filtering criterion.\n */\n add_filter: function add_filter(key, value, append) {\n // Update URL arg with new condition.\n if (append) {\n // Update or append value.\n var cur_val = this.attributes.filters[key],\n new_val;\n if (cur_val === null || cur_val === undefined) {\n new_val = value;\n } else if (typeof cur_val == \"string\") {\n if (cur_val == \"All\" || cur_val == value) {\n new_val = value;\n } else {\n // Replace string with array.\n var values = [];\n values[0] = cur_val;\n values[1] = value;\n new_val = values;\n }\n } else {\n // Current value is an array.\n new_val = cur_val;\n if (new_val.indexOf(value) === -1) {\n new_val.push(value);\n }\n }\n this.attributes.filters[key] = new_val;\n } else {\n // Replace value.\n this.attributes.filters[key] = value;\n }\n },\n\n /**\n * Remove filtering criterion.\n */\n remove_filter: function remove_filter(key, condition) {\n var cur_val = this.attributes.filters[key];\n if (cur_val === null || cur_val === undefined) {\n return false;\n }\n\n if (typeof cur_val === \"string\") {\n // overwrite/remove condition.\n this.attributes.filters[key] = \"\";\n } else {\n // filter contains an array of conditions.\n var condition_index = _.indexOf(cur_val, condition);\n if (condition_index !== -1) {\n cur_val[condition_index] = \"\";\n }\n }\n },\n\n /**\n * Returns URL data for obtaining a new grid.\n */\n get_url_data: function get_url_data() {\n var url_data = {\n async: this.attributes.async,\n sort: this.attributes.sort_key,\n page: this.attributes.cur_page,\n show_item_checkboxes: this.attributes.show_item_checkboxes,\n advanced_search: this.attributes.advanced_search\n };\n\n // Add operation, item_ids only if they have values.\n if (this.attributes.operation) {\n url_data.operation = this.attributes.operation;\n }\n if (this.attributes.item_ids) {\n url_data.id = this.attributes.item_ids;\n }\n\n // Add filter arguments to data, placing \"f-\" in front of all arguments.\n var self = this;\n _.each(_.pairs(self.attributes.filters), function (k) {\n url_data[\"f-\" + k[0]] = k[1];\n });\n return url_data;\n },\n\n // Return URL for obtaining a new grid\n get_url: function get_url(args) {\n return this.get(\"url_base\") + \"?\" + $.param(this.get_url_data()) + \"&\" + $.param(args);\n }\n });\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(2), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 28:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(jQuery, _) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n// dependencies\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils) {\n // grid view templates\n return {\n // template\n grid: function grid(options) {\n var tmpl = \"\";\n if (options.embedded) {\n tmpl = this.grid_header(options) + this.grid_table(options);\n } else {\n tmpl = '' + \"
\" + \"
\" + '
' + this.grid_header(options) + \"
\" + \"
\" + \"
\" + \"
\" + \"
\" + '
' + \"
\" + \"
\" + \"
\" + \"
\" + this.grid_table(options);\n }\n\n // add info text\n if (options.info_text) {\n tmpl += '
' + options.info_text + \"
\";\n }\n\n // return\n return tmpl;\n },\n\n // template\n grid_table: function grid_table(options) {\n return '\";\n },\n\n // template\n grid_header: function grid_header(options) {\n var tmpl = '
';\n if (!options.embedded) {\n tmpl += \"
\" + options.title + \"
\";\n }\n if (options.global_actions) {\n tmpl += '
';\n var show_popup = options.global_actions.length >= 3;\n if (show_popup) {\n tmpl += '
\";\n\n // return template\n return tmpl;\n },\n\n // template\n body: function body(options) {\n // initialize\n var tmpl = \"\";\n var num_rows_rendered = 0;\n var items_length = options.items.length;\n\n // empty grid?\n if (items_length == 0) {\n // No results.\n tmpl += '
No Items
';\n num_rows_rendered = 1;\n }\n\n // create rows\n for (var i in options.items) {\n // encode ids\n var item = options.items[i];\n var encoded_id = item.encode_id;\n var popupmenu_id = \"grid-\" + i + \"-popup\";\n\n // Tag current\n tmpl += \"
\";\n }\n\n // Data columns\n for (var j in options.columns) {\n var column = options.columns[j];\n if (column.visible) {\n // Nowrap\n var nowrap = \"\";\n if (column.nowrap) {\n nowrap = 'style=\"white-space:nowrap;\"';\n }\n\n // get column settings\n var column_settings = item.column_config[column.label];\n\n // load attributes\n var link = column_settings.link;\n var value = column_settings.value;\n var target = column_settings.target;\n\n // unescape value\n if (jQuery.type(value) === \"string\") {\n value = value.replace(/\\/\\//g, \"/\");\n }\n\n // Attach popup menu?\n var id = \"\";\n var cls = \"\";\n if (column.attach_popup) {\n id = \"grid-\" + i + \"-popup\";\n cls = \"menubutton\";\n if (link != \"\") {\n cls += \" split\";\n }\n cls += \" popup\";\n }\n\n // Check for row wrapping\n tmpl += \"
\";\n\n // Link\n if (link) {\n if (options.operations.length != 0) {\n tmpl += '
';\n }\n tmpl += '' + value + \"\";\n if (options.operations.length != 0) {\n tmpl += \"
\";\n num_rows_rendered++;\n }\n return tmpl;\n },\n\n // template\n footer: function footer(options) {\n // create template string\n var tmpl = \"\";\n\n // paging\n if (options.use_paging && options.num_pages > 1) {\n // get configuration\n var num_page_links = options.num_page_links;\n var cur_page_num = options.cur_page_num;\n var num_pages = options.num_pages;\n\n // First pass on min page.\n var page_link_range = num_page_links / 2;\n var min_page = cur_page_num - page_link_range;\n var min_offset = 0;\n if (min_page <= 0) {\n // Min page is too low.\n min_page = 1;\n min_offset = page_link_range - (cur_page_num - min_page);\n }\n\n // Set max page.\n var max_range = page_link_range + min_offset;\n var max_page = cur_page_num + max_range;\n var max_offset;\n if (max_page <= num_pages) {\n // Max page is fine.\n max_offset = 0;\n } else {\n // Max page is too high.\n max_page = num_pages;\n // +1 to account for the +1 in the loop below.\n max_offset = max_range - (max_page + 1 - cur_page_num);\n }\n\n // Second and final pass on min page to add any unused\n // offset from max to min.\n if (max_offset != 0) {\n min_page -= max_offset;\n if (min_page < 1) {\n min_page = 1;\n }\n }\n\n // template header\n tmpl += '
';\n if (options.show_item_checkboxes) {\n tmpl += \"
\";\n }\n tmpl += '
' + '' + \"Page:\";\n\n if (min_page > 1) {\n tmpl += '1 ...';\n }\n\n // create page urls\n for (var page_index = min_page; page_index < max_page + 1; page_index++) {\n if (page_index == options.cur_page_num) {\n tmpl += '' + page_index + \"\";\n } else {\n tmpl += '' + page_index + \"\";\n }\n }\n\n // show last page\n if (max_page < num_pages) {\n tmpl += \"...\" + '' + num_pages + \"\";\n }\n tmpl += \"\";\n\n // Show all link\n tmpl += ' | Show All' + \"
\" + \"
\";\n }\n\n // Grid operations for multiple items.\n if (options.show_item_checkboxes) {\n // start template\n tmpl += \"
\" + '' + \"
\" + '
' + 'For selected items: ';\n\n // configure buttons for operations\n for (var i in options.operations) {\n var operation = options.operations[i];\n if (operation.allow_multiple) {\n tmpl += ' ';\n }\n }\n\n // finalize template\n tmpl += \"
\" + \"
\";\n }\n\n // count global operations\n var found_global = false;\n for (i in options.operations) {\n if (options.operations[i].global_operation) {\n found_global = true;\n break;\n }\n }\n\n // add global operations\n if (found_global) {\n tmpl += \"
\" + '
';\n for (i in options.operations) {\n var operation = options.operations[i];\n if (operation.global_operation) {\n tmpl += '' + operation.label + \"\";\n }\n }\n tmpl += \"
\";\n }\n\n // return\n return tmpl;\n },\n\n // template\n message: function message(options) {\n var status = options.status == \"success\" ? \"done\" : options.status;\n return \"
\" + '
' + _.escape(options.message) + \"
\" + '' + \"\";\n },\n\n // template\n grid_filters: function grid_filters(options) {\n // get filters\n var default_filter_dict = options.default_filter_dict;\n var filters = options.filters;\n\n // show advanced search if flag set or if there are filters for advanced search fields\n var advanced_search_display = \"none\";\n if (options.advanced_search) {\n advanced_search_display = \"block\";\n }\n\n // identify columns with advanced filtering\n var show_advanced_search_link = false;\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"advanced\") {\n var column_key = column.key;\n var f_key = filters[column_key];\n var d_key = default_filter_dict[column_key];\n if (f_key && d_key && f_key != d_key) {\n advanced_search_display = \"block\";\n }\n show_advanced_search_link = true;\n }\n }\n\n // hide standard search if advanced is shown\n var standard_search_display = \"block\";\n if (advanced_search_display == \"block\") {\n standard_search_display = \"none\";\n }\n\n //\n // standard search\n //\n var tmpl = '
' + \"
\" + \"
\" + '
' + \"
\";\n\n // add standard filters\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"standard\") {\n tmpl += this.grid_column_filter(options, column);\n }\n }\n\n // finalize standard search\n tmpl += \"
\" + \"
\" + \"
\" + \"
\" + \"
\";\n\n // show advanced search link in standard display\n if (show_advanced_search_link) {\n tmpl += 'Advanced Search';\n }\n\n // finalize standard search display\n tmpl += \"
\"\n );\n }\n });\n\n return {\n View: View\n };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/ui/ui-list.js","define(\n [\n //jquery\n //backbone\n ],\n function() {\n // =============================================================================\n /**\n * view for a popup menu\n */\n var PopupMenu = Backbone.View.extend({\n //TODO: maybe better as singleton off the Galaxy obj\n /** Cache the desired button element and options, set up the button click handler\n * NOTE: attaches this view as HTML/jQ data on the button for later use.\n */\n initialize: function($button, options) {\n // default settings\n this.$button = $button;\n if (!this.$button.length) {\n this.$button = $(\"\");\n }\n this.options = options || [];\n this.$button.data(\"popupmenu\", this);\n\n // set up button click -> open menu behavior\n var menu = this;\n this.$button.click(function(event) {\n // if there's already a menu open, remove it\n $(\".popmenu-wrapper\").remove();\n menu._renderAndShow(event);\n return false;\n });\n },\n\n // render the menu, append to the page body at the click position, and set up the 'click-away' handlers, show\n _renderAndShow: function(clickEvent) {\n this.render();\n this.$el\n .appendTo(\"body\")\n .css(this._getShownPosition(clickEvent))\n .show();\n this._setUpCloseBehavior();\n },\n\n // render the menu\n // this menu doesn't attach itself to the DOM ( see _renderAndShow )\n render: function() {\n // render the menu body absolute and hidden, fill with template\n this.$el\n .addClass(\"popmenu-wrapper\")\n .hide()\n .css({ position: \"absolute\" })\n .html(this.template(this.$button.attr(\"id\"), this.options));\n\n // set up behavior on each link/anchor elem\n if (this.options.length) {\n var menu = this;\n //precondition: there should be one option per li\n this.$el.find(\"li\").each(function(i, li) {\n var option = menu.options[i];\n\n // if the option has 'func', call that function when the anchor is clicked\n if (option.func) {\n $(this)\n .children(\"a.popupmenu-option\")\n .click(function(event) {\n option.func.call(menu, event, option);\n // We must preventDefault otherwise clicking \"cancel\"\n // on a purge or something still navigates and causes\n // the action.\n event.preventDefault();\n // bubble up so that an option click will call the close behavior\n });\n }\n });\n }\n return this;\n },\n\n template: function(id, options) {\n return [\n '
\"\n ].join(\"\");\n }).join(\"\");\n },\n\n // get the absolute position/offset for the menu\n _getShownPosition: function(clickEvent) {\n // display menu horiz. centered on click...\n var menuWidth = this.$el.width();\n var x = clickEvent.pageX - menuWidth / 2;\n\n // adjust to handle horiz. scroll and window dimensions ( draw entirely on visible screen area )\n x = Math.min(\n x,\n $(document).scrollLeft() + $(window).width() - menuWidth - 5\n );\n x = Math.max(x, $(document).scrollLeft() + 5);\n return {\n top: clickEvent.pageY,\n left: x\n };\n },\n\n // bind an event handler to all available frames so that when anything is clicked\n // the menu is removed from the DOM and the event handler unbinds itself\n _setUpCloseBehavior: function() {\n var menu = this;\n //TODO: alternately: focus hack, blocking overlay, jquery.blockui\n\n // function to close popup and unbind itself\n function closePopup(event) {\n $(document).off(\"click.close_popup\");\n if (window && window.parent !== window) {\n try {\n $(window.parent.document).off(\"click.close_popup\");\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\")\n .contents()\n .off(\"click.close_popup\");\n } catch (err) {}\n }\n menu.remove();\n }\n\n $(\"html\").one(\"click.close_popup\", closePopup);\n if (window && window.parent !== window) {\n try {\n $(window.parent.document)\n .find(\"html\")\n .one(\"click.close_popup\", closePopup);\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\")\n .contents()\n .one(\"click.close_popup\", closePopup);\n } catch (err) {}\n }\n },\n\n // add a menu option/item at the given index\n addItem: function(item, index) {\n // append to end if no index\n index = index >= 0 ? index : this.options.length;\n this.options.splice(index, 0, item);\n return this;\n },\n\n // remove a menu option/item at the given index\n removeItem: function(index) {\n if (index >= 0) {\n this.options.splice(index, 1);\n }\n return this;\n },\n\n // search for a menu option by its html\n findIndexByHtml: function(html) {\n for (var i = 0; i < this.options.length; i++) {\n if (\n _.has(this.options[i], \"html\") &&\n this.options[i].html === html\n ) {\n return i;\n }\n }\n return null;\n },\n\n // search for a menu option by its html\n findItemByHtml: function(html) {\n return this.options[this.findIndexByHtml(html)];\n },\n\n // string representation\n toString: function() {\n return \"PopupMenu\";\n }\n });\n /** shortcut to new for when you don't need to preserve the ref */\n PopupMenu.create = function _create($button, options) {\n return new PopupMenu($button, options);\n };\n\n // -----------------------------------------------------------------------------\n // the following class functions are bridges from the original make_popupmenu and make_popup_menus\n // to the newer backbone.js PopupMenu\n\n /** Create a PopupMenu from simple map initial_options activated by clicking button_element.\n * Converts initial_options to object array used by PopupMenu.\n * @param {jQuery|DOMElement} button_element element which, when clicked, activates menu\n * @param {Object} initial_options map of key -> values, where\n * key is option text, value is fn to call when option is clicked\n * @returns {PopupMenu} the PopupMenu created\n */\n PopupMenu.make_popupmenu = function(button_element, initial_options) {\n var convertedOptions = [];\n _.each(initial_options, function(optionVal, optionKey) {\n var newOption = { html: optionKey };\n\n // keys with null values indicate: header\n if (optionVal === null) {\n // !optionVal? (null only?)\n newOption.header = true;\n\n // keys with function values indicate: a menu option\n } else if (jQuery.type(optionVal) === \"function\") {\n newOption.func = optionVal;\n }\n //TODO:?? any other special optionVals?\n // there was no divider option originally\n convertedOptions.push(newOption);\n });\n return new PopupMenu($(button_element), convertedOptions);\n };\n\n /** Find all anchors in $parent (using selector) and covert anchors into a PopupMenu options map.\n * @param {jQuery} $parent the element that contains the links to convert to options\n * @param {String} selector jq selector string to find links\n * @returns {Object[]} the options array to initialize a PopupMenu\n */\n //TODO: lose parent and selector, pass in array of links, use map to return options\n PopupMenu.convertLinksToOptions = function($parent, selector) {\n $parent = $($parent);\n selector = selector || \"a\";\n var options = [];\n $parent.find(selector).each(function(elem, i) {\n var option = {},\n $link = $(elem);\n\n // convert link text to the option text (html) and the href into the option func\n option.html = $link.text();\n if ($link.attr(\"href\")) {\n var linkHref = $link.attr(\"href\"),\n linkTarget = $link.attr(\"target\"),\n confirmText = $link.attr(\"confirm\");\n\n option.func = function() {\n // if there's a \"confirm\" attribute, throw up a confirmation dialog, and\n // if the user cancels - do nothing\n if (confirmText && !confirm(confirmText)) {\n return;\n }\n\n // if there's no confirm attribute, or the user accepted the confirm dialog:\n switch (linkTarget) {\n // relocate the center panel\n case \"_parent\":\n window.parent.location = linkHref;\n break;\n\n // relocate the entire window\n case \"_top\":\n window.top.location = linkHref;\n break;\n\n // relocate this panel\n default:\n window.location = linkHref;\n }\n };\n }\n options.push(option);\n });\n return options;\n };\n\n /** Create a single popupmenu from existing DOM button and anchor elements\n * @param {jQuery} $buttonElement the element that when clicked will open the menu\n * @param {jQuery} $menuElement the element that contains the anchors to convert into a menu\n * @param {String} menuElementLinkSelector jq selector string used to find anchors to be made into menu options\n * @returns {PopupMenu} the PopupMenu (Backbone View) that can render, control the menu\n */\n PopupMenu.fromExistingDom = function(\n $buttonElement,\n $menuElement,\n menuElementLinkSelector\n ) {\n $buttonElement = $($buttonElement);\n $menuElement = $($menuElement);\n var options = PopupMenu.convertLinksToOptions(\n $menuElement,\n menuElementLinkSelector\n );\n // we're done with the menu (having converted it to an options map)\n $menuElement.remove();\n return new PopupMenu($buttonElement, options);\n };\n\n /** Create all popupmenus within a document or a more specific element\n * @param {DOMElement} parent the DOM element in which to search for popupmenus to build (defaults to document)\n * @param {String} menuSelector jq selector string to find popupmenu menu elements (defaults to \"div[popupmenu]\")\n * @param {Function} buttonSelectorBuildFn the function to build the jq button selector.\n * Will be passed $menuElement, parent.\n * (Defaults to return '#' + $menuElement.attr( 'popupmenu' ); )\n * @returns {PopupMenu[]} array of popupmenus created\n */\n PopupMenu.make_popup_menus = function(\n parent,\n menuSelector,\n buttonSelectorBuildFn\n ) {\n parent = parent || document;\n // orig. Glx popupmenu menus have a (non-std) attribute 'popupmenu'\n // which contains the id of the button that activates the menu\n menuSelector = menuSelector || \"div[popupmenu]\";\n // default to (orig. Glx) matching button to menu by using the popupmenu attr of the menu as the id of the button\n buttonSelectorBuildFn =\n buttonSelectorBuildFn ||\n function($menuElement, parent) {\n return \"#\" + $menuElement.attr(\"popupmenu\");\n };\n\n // aggregate and return all PopupMenus\n var popupMenusCreated = [];\n $(parent)\n .find(menuSelector)\n .each(function() {\n var $menuElement = $(this),\n $buttonElement = $(parent).find(\n buttonSelectorBuildFn($menuElement, parent)\n );\n popupMenusCreated.push(\n PopupMenu.fromDom($buttonElement, $menuElement)\n );\n $buttonElement.addClass(\"popup\");\n });\n return popupMenusCreated;\n };\n\n // =============================================================================\n return PopupMenu;\n }\n);\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/ui/popup-menu.js","/** This class creates a ui table element. */\ndefine([\"utils/utils\"], function(Utils) {\n var View = Backbone.View.extend({\n initialize: function(options) {\n this.options = Utils.merge(options, {\n content: \"No content available.\",\n onchange: null,\n ondblclick: null,\n onconfirm: null,\n cls: \"ui-table\",\n selectable: true,\n cls_tr: \"\"\n });\n this.setElement(this._template());\n this.$thead = this.$(\"thead\");\n this.$tbody = this.$(\"tbody\");\n this.$tmessage = this.$(\"tmessage\");\n this.row = this._row();\n this.row_count = 0;\n },\n\n events: {\n click: \"_onclick\",\n dblclick: \"_ondblclick\"\n },\n\n /** Add cell to header row */\n addHeader: function($el) {\n this.row.append($(\"
\";\n\n // return template\n return tmpl;\n },\n\n // template\n body: function(options) {\n // initialize\n var tmpl = \"\";\n var num_rows_rendered = 0;\n var items_length = options.items.length;\n\n // empty grid?\n if (items_length == 0) {\n // No results.\n tmpl += '
No Items
';\n num_rows_rendered = 1;\n }\n\n // create rows\n for (var i in options.items) {\n // encode ids\n var item = options.items[i];\n var encoded_id = item.encode_id;\n var popupmenu_id = \"grid-\" + i + \"-popup\";\n\n // Tag current\n tmpl += \"
\";\n }\n\n // Data columns\n for (var j in options.columns) {\n var column = options.columns[j];\n if (column.visible) {\n // Nowrap\n var nowrap = \"\";\n if (column.nowrap) {\n nowrap = 'style=\"white-space:nowrap;\"';\n }\n\n // get column settings\n var column_settings = item.column_config[column.label];\n\n // load attributes\n var link = column_settings.link;\n var value = column_settings.value;\n var target = column_settings.target;\n\n // unescape value\n if (jQuery.type(value) === \"string\") {\n value = value.replace(/\\/\\//g, \"/\");\n }\n\n // Attach popup menu?\n var id = \"\";\n var cls = \"\";\n if (column.attach_popup) {\n id = \"grid-\" + i + \"-popup\";\n cls = \"menubutton\";\n if (link != \"\") {\n cls += \" split\";\n }\n cls += \" popup\";\n }\n\n // Check for row wrapping\n tmpl += \"
\";\n\n // Link\n if (link) {\n if (options.operations.length != 0) {\n tmpl +=\n '
';\n }\n tmpl +=\n '' +\n value +\n \"\";\n if (options.operations.length != 0) {\n tmpl += \"
\";\n num_rows_rendered++;\n }\n return tmpl;\n },\n\n // template\n footer: function(options) {\n // create template string\n var tmpl = \"\";\n\n // paging\n if (options.use_paging && options.num_pages > 1) {\n // get configuration\n var num_page_links = options.num_page_links;\n var cur_page_num = options.cur_page_num;\n var num_pages = options.num_pages;\n\n // First pass on min page.\n var page_link_range = num_page_links / 2;\n var min_page = cur_page_num - page_link_range;\n var min_offset = 0;\n if (min_page <= 0) {\n // Min page is too low.\n min_page = 1;\n min_offset = page_link_range - (cur_page_num - min_page);\n }\n\n // Set max page.\n var max_range = page_link_range + min_offset;\n var max_page = cur_page_num + max_range;\n var max_offset;\n if (max_page <= num_pages) {\n // Max page is fine.\n max_offset = 0;\n } else {\n // Max page is too high.\n max_page = num_pages;\n // +1 to account for the +1 in the loop below.\n max_offset = max_range - (max_page + 1 - cur_page_num);\n }\n\n // Second and final pass on min page to add any unused\n // offset from max to min.\n if (max_offset != 0) {\n min_page -= max_offset;\n if (min_page < 1) {\n min_page = 1;\n }\n }\n\n // template header\n tmpl += '
';\n if (options.show_item_checkboxes) {\n tmpl += \"
\";\n }\n tmpl +=\n '
' +\n '' +\n \"Page:\";\n\n if (min_page > 1) {\n tmpl +=\n '1 ...';\n }\n\n // create page urls\n for (\n var page_index = min_page;\n page_index < max_page + 1;\n page_index++\n ) {\n if (page_index == options.cur_page_num) {\n tmpl +=\n '' +\n page_index +\n \"\";\n } else {\n tmpl +=\n '' +\n page_index +\n \"\";\n }\n }\n\n // show last page\n if (max_page < num_pages) {\n tmpl +=\n \"...\" +\n '' +\n num_pages +\n \"\";\n }\n tmpl += \"\";\n\n // Show all link\n tmpl +=\n ' | Show All' +\n \"
\" +\n \"
\";\n }\n\n // Grid operations for multiple items.\n if (options.show_item_checkboxes) {\n // start template\n tmpl +=\n \"
\" +\n '' +\n \"
\" +\n '
' +\n 'For selected items: ';\n\n // configure buttons for operations\n for (var i in options.operations) {\n var operation = options.operations[i];\n if (operation.allow_multiple) {\n tmpl +=\n ' ';\n }\n }\n\n // finalize template\n tmpl += \"
\" + \"
\";\n }\n\n // count global operations\n var found_global = false;\n for (i in options.operations) {\n if (options.operations[i].global_operation) {\n found_global = true;\n break;\n }\n }\n\n // add global operations\n if (found_global) {\n tmpl += \"
\" + '
';\n for (i in options.operations) {\n var operation = options.operations[i];\n if (operation.global_operation) {\n tmpl +=\n '' +\n operation.label +\n \"\";\n }\n }\n tmpl += \"
\" +\n '' +\n \"\"\n );\n },\n\n // template\n grid_filters: function(options) {\n // get filters\n var default_filter_dict = options.default_filter_dict;\n var filters = options.filters;\n\n // show advanced search if flag set or if there are filters for advanced search fields\n var advanced_search_display = \"none\";\n if (options.advanced_search) {\n advanced_search_display = \"block\";\n }\n\n // identify columns with advanced filtering\n var show_advanced_search_link = false;\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"advanced\") {\n var column_key = column.key;\n var f_key = filters[column_key];\n var d_key = default_filter_dict[column_key];\n if (f_key && d_key && f_key != d_key) {\n advanced_search_display = \"block\";\n }\n show_advanced_search_link = true;\n }\n }\n\n // hide standard search if advanced is shown\n var standard_search_display = \"block\";\n if (advanced_search_display == \"block\") {\n standard_search_display = \"none\";\n }\n\n //\n // standard search\n //\n var tmpl =\n '
' +\n \"
\" +\n \"
\" +\n '
' +\n \"
\";\n\n // add standard filters\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"standard\") {\n tmpl += this.grid_column_filter(options, column);\n }\n }\n\n // finalize standard search\n tmpl += \"
\" + \"
\" + \"
\" + \"
\" + \"
\";\n\n // show advanced search link in standard display\n if (show_advanced_search_link) {\n tmpl +=\n 'Advanced Search';\n }\n\n // finalize standard search display\n tmpl += \"
\";\n }\n });\n\n return {\n View: View\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 20:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $, _, jQuery) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n //jquery\n //backbone\n], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n // =============================================================================\n /**\n * view for a popup menu\n */\n var PopupMenu = Backbone.View.extend({\n //TODO: maybe better as singleton off the Galaxy obj\n /** Cache the desired button element and options, set up the button click handler\n * NOTE: attaches this view as HTML/jQ data on the button for later use.\n */\n initialize: function initialize($button, options) {\n // default settings\n this.$button = $button;\n if (!this.$button.length) {\n this.$button = $(\"\");\n }\n this.options = options || [];\n this.$button.data(\"popupmenu\", this);\n\n // set up button click -> open menu behavior\n var menu = this;\n this.$button.click(function (event) {\n // if there's already a menu open, remove it\n $(\".popmenu-wrapper\").remove();\n menu._renderAndShow(event);\n return false;\n });\n },\n\n // render the menu, append to the page body at the click position, and set up the 'click-away' handlers, show\n _renderAndShow: function _renderAndShow(clickEvent) {\n this.render();\n this.$el.appendTo(\"body\").css(this._getShownPosition(clickEvent)).show();\n this._setUpCloseBehavior();\n },\n\n // render the menu\n // this menu doesn't attach itself to the DOM ( see _renderAndShow )\n render: function render() {\n // render the menu body absolute and hidden, fill with template\n this.$el.addClass(\"popmenu-wrapper\").hide().css({ position: \"absolute\" }).html(this.template(this.$button.attr(\"id\"), this.options));\n\n // set up behavior on each link/anchor elem\n if (this.options.length) {\n var menu = this;\n //precondition: there should be one option per li\n this.$el.find(\"li\").each(function (i, li) {\n var option = menu.options[i];\n\n // if the option has 'func', call that function when the anchor is clicked\n if (option.func) {\n $(this).children(\"a.popupmenu-option\").click(function (event) {\n option.func.call(menu, event, option);\n // We must preventDefault otherwise clicking \"cancel\"\n // on a purge or something still navigates and causes\n // the action.\n event.preventDefault();\n // bubble up so that an option click will call the close behavior\n });\n }\n });\n }\n return this;\n },\n\n template: function template(id, options) {\n return ['
', this._templateOptions(options), \"
\"].join(\"\");\n },\n\n _templateOptions: function _templateOptions(options) {\n if (!options.length) {\n return \"
(no options)
\";\n }\n return _.map(options, function (option) {\n if (option.divider) {\n return '';\n } else if (option.header) {\n return ['
\"].join(\"\");\n }).join(\"\");\n },\n\n // get the absolute position/offset for the menu\n _getShownPosition: function _getShownPosition(clickEvent) {\n // display menu horiz. centered on click...\n var menuWidth = this.$el.width();\n var x = clickEvent.pageX - menuWidth / 2;\n\n // adjust to handle horiz. scroll and window dimensions ( draw entirely on visible screen area )\n x = Math.min(x, $(document).scrollLeft() + $(window).width() - menuWidth - 5);\n x = Math.max(x, $(document).scrollLeft() + 5);\n return {\n top: clickEvent.pageY,\n left: x\n };\n },\n\n // bind an event handler to all available frames so that when anything is clicked\n // the menu is removed from the DOM and the event handler unbinds itself\n _setUpCloseBehavior: function _setUpCloseBehavior() {\n var menu = this;\n //TODO: alternately: focus hack, blocking overlay, jquery.blockui\n\n // function to close popup and unbind itself\n function closePopup(event) {\n $(document).off(\"click.close_popup\");\n if (window && window.parent !== window) {\n try {\n $(window.parent.document).off(\"click.close_popup\");\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\").contents().off(\"click.close_popup\");\n } catch (err) {}\n }\n menu.remove();\n }\n\n $(\"html\").one(\"click.close_popup\", closePopup);\n if (window && window.parent !== window) {\n try {\n $(window.parent.document).find(\"html\").one(\"click.close_popup\", closePopup);\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\").contents().one(\"click.close_popup\", closePopup);\n } catch (err) {}\n }\n },\n\n // add a menu option/item at the given index\n addItem: function addItem(item, index) {\n // append to end if no index\n index = index >= 0 ? index : this.options.length;\n this.options.splice(index, 0, item);\n return this;\n },\n\n // remove a menu option/item at the given index\n removeItem: function removeItem(index) {\n if (index >= 0) {\n this.options.splice(index, 1);\n }\n return this;\n },\n\n // search for a menu option by its html\n findIndexByHtml: function findIndexByHtml(html) {\n for (var i = 0; i < this.options.length; i++) {\n if (_.has(this.options[i], \"html\") && this.options[i].html === html) {\n return i;\n }\n }\n return null;\n },\n\n // search for a menu option by its html\n findItemByHtml: function findItemByHtml(html) {\n return this.options[this.findIndexByHtml(html)];\n },\n\n // string representation\n toString: function toString() {\n return \"PopupMenu\";\n }\n });\n /** shortcut to new for when you don't need to preserve the ref */\n PopupMenu.create = function _create($button, options) {\n return new PopupMenu($button, options);\n };\n\n // -----------------------------------------------------------------------------\n // the following class functions are bridges from the original make_popupmenu and make_popup_menus\n // to the newer backbone.js PopupMenu\n\n /** Create a PopupMenu from simple map initial_options activated by clicking button_element.\n * Converts initial_options to object array used by PopupMenu.\n * @param {jQuery|DOMElement} button_element element which, when clicked, activates menu\n * @param {Object} initial_options map of key -> values, where\n * key is option text, value is fn to call when option is clicked\n * @returns {PopupMenu} the PopupMenu created\n */\n PopupMenu.make_popupmenu = function (button_element, initial_options) {\n var convertedOptions = [];\n _.each(initial_options, function (optionVal, optionKey) {\n var newOption = { html: optionKey };\n\n // keys with null values indicate: header\n if (optionVal === null) {\n // !optionVal? (null only?)\n newOption.header = true;\n\n // keys with function values indicate: a menu option\n } else if (jQuery.type(optionVal) === \"function\") {\n newOption.func = optionVal;\n }\n //TODO:?? any other special optionVals?\n // there was no divider option originally\n convertedOptions.push(newOption);\n });\n return new PopupMenu($(button_element), convertedOptions);\n };\n\n /** Find all anchors in $parent (using selector) and covert anchors into a PopupMenu options map.\n * @param {jQuery} $parent the element that contains the links to convert to options\n * @param {String} selector jq selector string to find links\n * @returns {Object[]} the options array to initialize a PopupMenu\n */\n //TODO: lose parent and selector, pass in array of links, use map to return options\n PopupMenu.convertLinksToOptions = function ($parent, selector) {\n $parent = $($parent);\n selector = selector || \"a\";\n var options = [];\n $parent.find(selector).each(function (elem, i) {\n var option = {},\n $link = $(elem);\n\n // convert link text to the option text (html) and the href into the option func\n option.html = $link.text();\n if ($link.attr(\"href\")) {\n var linkHref = $link.attr(\"href\"),\n linkTarget = $link.attr(\"target\"),\n confirmText = $link.attr(\"confirm\");\n\n option.func = function () {\n // if there's a \"confirm\" attribute, throw up a confirmation dialog, and\n // if the user cancels - do nothing\n if (confirmText && !confirm(confirmText)) {\n return;\n }\n\n // if there's no confirm attribute, or the user accepted the confirm dialog:\n switch (linkTarget) {\n // relocate the center panel\n case \"_parent\":\n window.parent.location = linkHref;\n break;\n\n // relocate the entire window\n case \"_top\":\n window.top.location = linkHref;\n break;\n\n // relocate this panel\n default:\n window.location = linkHref;\n }\n };\n }\n options.push(option);\n });\n return options;\n };\n\n /** Create a single popupmenu from existing DOM button and anchor elements\n * @param {jQuery} $buttonElement the element that when clicked will open the menu\n * @param {jQuery} $menuElement the element that contains the anchors to convert into a menu\n * @param {String} menuElementLinkSelector jq selector string used to find anchors to be made into menu options\n * @returns {PopupMenu} the PopupMenu (Backbone View) that can render, control the menu\n */\n PopupMenu.fromExistingDom = function ($buttonElement, $menuElement, menuElementLinkSelector) {\n $buttonElement = $($buttonElement);\n $menuElement = $($menuElement);\n var options = PopupMenu.convertLinksToOptions($menuElement, menuElementLinkSelector);\n // we're done with the menu (having converted it to an options map)\n $menuElement.remove();\n return new PopupMenu($buttonElement, options);\n };\n\n /** Create all popupmenus within a document or a more specific element\n * @param {DOMElement} parent the DOM element in which to search for popupmenus to build (defaults to document)\n * @param {String} menuSelector jq selector string to find popupmenu menu elements (defaults to \"div[popupmenu]\")\n * @param {Function} buttonSelectorBuildFn the function to build the jq button selector.\n * Will be passed $menuElement, parent.\n * (Defaults to return '#' + $menuElement.attr( 'popupmenu' ); )\n * @returns {PopupMenu[]} array of popupmenus created\n */\n PopupMenu.make_popup_menus = function (parent, menuSelector, buttonSelectorBuildFn) {\n parent = parent || document;\n // orig. Glx popupmenu menus have a (non-std) attribute 'popupmenu'\n // which contains the id of the button that activates the menu\n menuSelector = menuSelector || \"div[popupmenu]\";\n // default to (orig. Glx) matching button to menu by using the popupmenu attr of the menu as the id of the button\n buttonSelectorBuildFn = buttonSelectorBuildFn || function ($menuElement, parent) {\n return \"#\" + $menuElement.attr(\"popupmenu\");\n };\n\n // aggregate and return all PopupMenus\n var popupMenusCreated = [];\n $(parent).find(menuSelector).each(function () {\n var $menuElement = $(this),\n $buttonElement = $(parent).find(buttonSelectorBuildFn($menuElement, parent));\n popupMenusCreated.push(PopupMenu.fromDom($buttonElement, $menuElement));\n $buttonElement.addClass(\"popup\");\n });\n return popupMenusCreated;\n };\n\n // =============================================================================\n return PopupMenu;\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0), __webpack_require__(2), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 22:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** This class creates a ui table element. */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils) {\n var View = Backbone.View.extend({\n initialize: function initialize(options) {\n this.options = Utils.merge(options, {\n content: \"No content available.\",\n onchange: null,\n ondblclick: null,\n onconfirm: null,\n cls: \"ui-table\",\n selectable: true,\n cls_tr: \"\"\n });\n this.setElement(this._template());\n this.$thead = this.$(\"thead\");\n this.$tbody = this.$(\"tbody\");\n this.$tmessage = this.$(\"tmessage\");\n this.row = this._row();\n this.row_count = 0;\n },\n\n events: {\n click: \"_onclick\",\n dblclick: \"_ondblclick\"\n },\n\n /** Add cell to header row */\n addHeader: function addHeader($el) {\n this.row.append($(\"
\").append($el));\n },\n\n /** Append header row to table */\n appendHeader: function appendHeader() {\n this.$thead.append(this.row);\n this.row = $(\"
\");\n },\n\n /** Add cell to row */\n add: function add($el, width, align) {\n var wrapper = $(\"
\");\n if (width) {\n wrapper.css(\"width\", width);\n }\n if (align) {\n wrapper.css(\"text-align\", align);\n }\n this.row.append(wrapper.append($el));\n },\n\n /** Append row to table */\n append: function append(id, fade) {\n this._commit(id, fade, false);\n },\n\n /** Prepend row to table */\n prepend: function prepend(id, fade) {\n this._commit(id, fade, true);\n },\n\n /** Helper to get row element */\n get: function get(id) {\n return this.$(\"#\" + id);\n },\n\n /** Delete row by id */\n del: function del(id) {\n var item = this.$tbody.find(\"#\" + id);\n if (item.length > 0) {\n item.remove();\n this.row_count--;\n this._refresh();\n }\n },\n\n /** Delete all rows */\n delAll: function delAll() {\n this.$tbody.empty();\n this.row_count = 0;\n this._refresh();\n },\n\n /** Set a value i.e. selects/highlights a particular row by id */\n value: function value(new_value) {\n if (this.options.selectable) {\n this.before = this.$tbody.find(\".current\").attr(\"id\");\n if (new_value !== undefined) {\n this.$tbody.find(\"tr\").removeClass(\"current\");\n if (new_value) {\n this.$tbody.find(\"#\" + new_value).addClass(\"current\");\n }\n }\n var after = this.$tbody.find(\".current\").attr(\"id\");\n if (after === undefined) {\n return null;\n } else {\n if (after != this.before && this.options.onchange) {\n this.options.onchange(new_value);\n }\n return after;\n }\n }\n },\n\n /** Return the number of rows */\n size: function size() {\n return this.$tbody.find(\"tr\").length;\n },\n\n /** Helper to append rows */\n _commit: function _commit(id, fade, prepend) {\n this.del(id);\n this.row.attr(\"id\", id);\n if (prepend) {\n this.$tbody.prepend(this.row);\n } else {\n this.$tbody.append(this.row);\n }\n if (fade) {\n this.row.hide();\n this.row.fadeIn();\n }\n this.row = this._row();\n this.row_count++;\n this._refresh();\n },\n\n /** Helper to create new row */\n _row: function _row() {\n return $('
');\n },\n\n /** Handles onclick events */\n _onclick: function _onclick(e) {\n var old_value = this.value();\n var new_value = $(e.target).closest(\"tr\").attr(\"id\");\n if (new_value != \"\") {\n if (new_value && old_value != new_value) {\n if (this.options.onconfirm) {\n this.options.onconfirm(new_value);\n } else {\n this.value(new_value);\n }\n }\n }\n },\n\n /** Handles ondblclick events */\n _ondblclick: function _ondblclick(e) {\n var value = this.value();\n if (value && this.options.ondblclick) {\n this.options.ondblclick(value);\n }\n },\n\n /** Refresh helper */\n _refresh: function _refresh() {\n if (this.row_count == 0) {\n this.$tmessage.show();\n } else {\n this.$tmessage.hide();\n }\n },\n\n /** Template */\n _template: function _template() {\n return \"
\" + '
' + \"\" + \"\" + \"
\" + \"\" + this.options.content + \"\" + \"
\";\n }\n });\n\n return {\n View: View\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 23:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $, _) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/* This class maps the form dom to an api compatible javascript dictionary. */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils) {\n var Manager = Backbone.Model.extend({\n initialize: function initialize(app) {\n this.app = app;\n },\n\n /** Creates a checksum. */\n checksum: function checksum() {\n var sum = \"\";\n var self = this;\n this.app.section.$el.find(\".section-row\").each(function () {\n var id = $(this).attr(\"id\");\n var field = self.app.field_list[id];\n if (field) {\n sum += id + \":\" + JSON.stringify(field.value && field.value()) + \":\" + field.collapsed + \";\";\n }\n });\n return sum;\n },\n\n /** Convert dom into a dictionary of flat id/value pairs used e.g. on job submission. */\n create: function create() {\n var self = this;\n\n // get raw dictionary from dom\n var dict = {};\n this._iterate(this.app.section.$el, dict);\n\n // add to result dictionary, label elements\n var result_dict = {};\n this.flat_dict = {};\n function add(flat_id, input_id, input_value) {\n self.flat_dict[flat_id] = input_id;\n result_dict[flat_id] = input_value;\n self.app.element_list[input_id] && self.app.element_list[input_id].$el.attr(\"tour_id\", flat_id);\n }\n // converter between raw dictionary and job dictionary\n function convert(identifier, head) {\n for (var index in head) {\n var node = head[index];\n if (node.input) {\n var input = node.input;\n var flat_id = identifier;\n if (identifier != \"\") {\n flat_id += \"|\";\n }\n flat_id += input.name;\n switch (input.type) {\n case \"repeat\":\n var section_label = \"section-\";\n var block_indices = [];\n var block_prefix = null;\n for (var block_label in node) {\n var pos = block_label.indexOf(section_label);\n if (pos != -1) {\n pos += section_label.length;\n block_indices.push(parseInt(block_label.substr(pos)));\n if (!block_prefix) {\n block_prefix = block_label.substr(0, pos);\n }\n }\n }\n block_indices.sort(function (a, b) {\n return a - b;\n });\n var index = 0;\n for (var i in block_indices) {\n convert(flat_id + \"_\" + index++, node[block_prefix + block_indices[i]]);\n }\n break;\n case \"conditional\":\n var value = self.app.field_list[input.id].value();\n add(flat_id + \"|\" + input.test_param.name, input.id, value);\n var selectedCase = _matchCase(input, value);\n if (selectedCase != -1) {\n convert(flat_id, head[input.id + \"-section-\" + selectedCase]);\n }\n break;\n case \"section\":\n convert(!input.flat && flat_id || \"\", node);\n break;\n default:\n var field = self.app.field_list[input.id];\n if (field && field.value) {\n var value = field.value();\n if (input.ignore === undefined || input.ignore != value) {\n if (field.collapsed && input.collapsible_value) {\n value = input.collapsible_value;\n }\n add(flat_id, input.id, value);\n if (input.payload) {\n for (var p_id in input.payload) {\n add(p_id, input.id, input.payload[p_id]);\n }\n }\n }\n }\n }\n }\n }\n }\n convert(\"\", dict);\n return result_dict;\n },\n\n /** Matches flat ids to corresponding input element\n * @param{string} flat_id - Flat input id to be looked up.\n */\n match: function match(flat_id) {\n return this.flat_dict && this.flat_dict[flat_id];\n },\n\n /** Match conditional values to selected cases\n */\n matchCase: function matchCase(input, value) {\n return _matchCase(input, value);\n },\n\n /** Matches a new tool model to the current input elements e.g. used to update dynamic options\n */\n matchModel: function matchModel(model, callback) {\n var self = this;\n visitInputs(model.inputs, function (input, name) {\n self.flat_dict[name] && callback(input, self.flat_dict[name]);\n });\n },\n\n /** Matches identifier from api response to input elements e.g. used to display validation errors\n */\n matchResponse: function matchResponse(response) {\n var result = {};\n var self = this;\n function search(id, head) {\n if (typeof head === \"string\") {\n var input_id = self.flat_dict[id];\n input_id && (result[input_id] = head);\n } else {\n for (var i in head) {\n var new_id = i;\n if (id !== \"\") {\n var separator = \"|\";\n if (head instanceof Array) {\n separator = \"_\";\n }\n new_id = id + separator + new_id;\n }\n search(new_id, head[i]);\n }\n }\n }\n search(\"\", response);\n return result;\n },\n\n /** Map dom tree to dictionary tree with input elements.\n */\n _iterate: function _iterate(parent, dict) {\n var self = this;\n var children = $(parent).children();\n children.each(function () {\n var child = this;\n var id = $(child).attr(\"id\");\n if ($(child).hasClass(\"section-row\")) {\n var input = self.app.input_list[id];\n dict[id] = input && { input: input } || {};\n self._iterate(child, dict[id]);\n } else {\n self._iterate(child, dict);\n }\n });\n }\n });\n\n /** Match conditional values to selected cases\n * @param{dict} input - Definition of conditional input parameter\n * @param{dict} value - Current value\n */\n var _matchCase = function _matchCase(input, value) {\n if (input.test_param.type == \"boolean\") {\n if (value == \"true\") {\n value = input.test_param.truevalue || \"true\";\n } else {\n value = input.test_param.falsevalue || \"false\";\n }\n }\n for (var i in input.cases) {\n if (input.cases[i].value == value) {\n return i;\n }\n }\n return -1;\n };\n\n /** Visits tool inputs\n * @param{dict} inputs - Nested dictionary of input elements\n * @param{dict} callback - Called with the mapped dictionary object and corresponding model node\n */\n var visitInputs = function visitInputs(inputs, callback, prefix, context) {\n context = $.extend(true, {}, context);\n _.each(inputs, function (input) {\n if (input && input.type && input.name) {\n context[input.name] = input;\n }\n });\n for (var key in inputs) {\n var node = inputs[key];\n node.name = node.name || key;\n var name = prefix ? prefix + \"|\" + node.name : node.name;\n switch (node.type) {\n case \"repeat\":\n _.each(node.cache, function (cache, j) {\n visitInputs(cache, callback, name + \"_\" + j, context);\n });\n break;\n case \"conditional\":\n if (node.test_param) {\n callback(node.test_param, name + \"|\" + node.test_param.name, context);\n var selectedCase = _matchCase(node, node.test_param.value);\n if (selectedCase != -1) {\n visitInputs(node.cases[selectedCase].inputs, callback, name, context);\n } else {\n Galaxy.emit.debug(\"form-data::visitInputs() - Invalid case for \" + name + \".\");\n }\n } else {\n Galaxy.emit.debug(\"form-data::visitInputs() - Conditional test parameter missing for \" + name + \".\");\n }\n break;\n case \"section\":\n visitInputs(node.inputs, callback, name, context);\n break;\n default:\n callback(node, name, context);\n }\n }\n };\n\n return {\n Manager: Manager,\n visitInputs: visitInputs\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0), __webpack_require__(2)))\n\n/***/ }),\n\n/***/ 27:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, _, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n// dependencies\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n // grid model\n return Backbone.Model.extend({\n defaults: {\n url_base: \"\",\n async: false,\n async_ops: [],\n categorical_filters: [],\n filters: {},\n sort_key: null,\n show_item_checkboxes: false,\n advanced_search: false,\n cur_page: 1,\n num_pages: 1,\n operation: undefined,\n item_ids: undefined\n },\n\n /**\n * Return true if operation can be done asynchronously.\n */\n can_async_op: function can_async_op(op) {\n return _.indexOf(this.attributes.async_ops, op) !== -1;\n },\n\n /**\n * Add filtering criterion.\n */\n add_filter: function add_filter(key, value, append) {\n // Update URL arg with new condition.\n if (append) {\n // Update or append value.\n var cur_val = this.attributes.filters[key],\n new_val;\n if (cur_val === null || cur_val === undefined) {\n new_val = value;\n } else if (typeof cur_val == \"string\") {\n if (cur_val == \"All\" || cur_val == value) {\n new_val = value;\n } else {\n // Replace string with array.\n var values = [];\n values[0] = cur_val;\n values[1] = value;\n new_val = values;\n }\n } else {\n // Current value is an array.\n new_val = cur_val;\n if (new_val.indexOf(value) === -1) {\n new_val.push(value);\n }\n }\n this.attributes.filters[key] = new_val;\n } else {\n // Replace value.\n this.attributes.filters[key] = value;\n }\n },\n\n /**\n * Remove filtering criterion.\n */\n remove_filter: function remove_filter(key, condition) {\n var cur_val = this.attributes.filters[key];\n if (cur_val === null || cur_val === undefined) {\n return false;\n }\n\n if (typeof cur_val === \"string\") {\n // overwrite/remove condition.\n this.attributes.filters[key] = \"\";\n } else {\n // filter contains an array of conditions.\n var condition_index = _.indexOf(cur_val, condition);\n if (condition_index !== -1) {\n cur_val[condition_index] = \"\";\n }\n }\n },\n\n /**\n * Returns URL data for obtaining a new grid.\n */\n get_url_data: function get_url_data() {\n var url_data = {\n async: this.attributes.async,\n sort: this.attributes.sort_key,\n page: this.attributes.cur_page,\n show_item_checkboxes: this.attributes.show_item_checkboxes,\n advanced_search: this.attributes.advanced_search\n };\n\n // Add operation, item_ids only if they have values.\n if (this.attributes.operation) {\n url_data.operation = this.attributes.operation;\n }\n if (this.attributes.item_ids) {\n url_data.id = this.attributes.item_ids;\n }\n\n // Add filter arguments to data, placing \"f-\" in front of all arguments.\n var self = this;\n _.each(_.pairs(self.attributes.filters), function (k) {\n url_data[\"f-\" + k[0]] = k[1];\n });\n return url_data;\n },\n\n // Return URL for obtaining a new grid\n get_url: function get_url(args) {\n return this.get(\"url_base\") + \"?\" + $.param(this.get_url_data()) + \"&\" + $.param(args);\n }\n });\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(2), __webpack_require__(0)))\n\n/***/ }),\n\n/***/ 28:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(jQuery, _) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n// dependencies\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils) {\n // grid view templates\n return {\n // template\n grid: function grid(options) {\n var tmpl = \"\";\n if (options.embedded) {\n tmpl = this.grid_header(options) + this.grid_table(options);\n } else {\n tmpl = '' + \"
\" + \"
\" + '
' + this.grid_header(options) + \"
\" + \"
\" + \"
\" + \"
\" + \"
\" + '
' + \"
\" + \"
\" + \"
\" + \"
\" + this.grid_table(options);\n }\n\n // add info text\n if (options.info_text) {\n tmpl += '
' + options.info_text + \"
\";\n }\n\n // return\n return tmpl;\n },\n\n // template\n grid_table: function grid_table(options) {\n return '\";\n },\n\n // template\n grid_header: function grid_header(options) {\n var tmpl = '
';\n if (!options.embedded) {\n tmpl += \"
\" + options.title + \"
\";\n }\n if (options.global_actions) {\n tmpl += '
';\n var show_popup = options.global_actions.length >= 3;\n if (show_popup) {\n tmpl += '
\";\n\n // return template\n return tmpl;\n },\n\n // template\n body: function body(options) {\n // initialize\n var tmpl = \"\";\n var num_rows_rendered = 0;\n var items_length = options.items.length;\n\n // empty grid?\n if (items_length == 0) {\n // No results.\n tmpl += '
No Items
';\n num_rows_rendered = 1;\n }\n\n // create rows\n for (var i in options.items) {\n // encode ids\n var item = options.items[i];\n var encoded_id = item.encode_id;\n var popupmenu_id = \"grid-\" + i + \"-popup\";\n\n // Tag current\n tmpl += \"
\";\n }\n\n // Data columns\n for (var j in options.columns) {\n var column = options.columns[j];\n if (column.visible) {\n // Nowrap\n var nowrap = \"\";\n if (column.nowrap) {\n nowrap = 'style=\"white-space:nowrap;\"';\n }\n\n // get column settings\n var column_settings = item.column_config[column.label];\n\n // load attributes\n var link = column_settings.link;\n var value = column_settings.value;\n var target = column_settings.target;\n\n // unescape value\n if (jQuery.type(value) === \"string\") {\n value = value.replace(/\\/\\//g, \"/\");\n }\n\n // Attach popup menu?\n var id = \"\";\n var cls = \"\";\n if (column.attach_popup) {\n id = \"grid-\" + i + \"-popup\";\n cls = \"menubutton\";\n if (link != \"\") {\n cls += \" split\";\n }\n cls += \" popup\";\n }\n\n // Check for row wrapping\n tmpl += \"
\";\n\n // Link\n if (link) {\n if (options.operations.length != 0) {\n tmpl += '
';\n }\n tmpl += '' + value + \"\";\n if (options.operations.length != 0) {\n tmpl += \"
\";\n num_rows_rendered++;\n }\n return tmpl;\n },\n\n // template\n footer: function footer(options) {\n // create template string\n var tmpl = \"\";\n\n // paging\n if (options.use_paging && options.num_pages > 1) {\n // get configuration\n var num_page_links = options.num_page_links;\n var cur_page_num = options.cur_page_num;\n var num_pages = options.num_pages;\n\n // First pass on min page.\n var page_link_range = num_page_links / 2;\n var min_page = cur_page_num - page_link_range;\n var min_offset = 0;\n if (min_page <= 0) {\n // Min page is too low.\n min_page = 1;\n min_offset = page_link_range - (cur_page_num - min_page);\n }\n\n // Set max page.\n var max_range = page_link_range + min_offset;\n var max_page = cur_page_num + max_range;\n var max_offset;\n if (max_page <= num_pages) {\n // Max page is fine.\n max_offset = 0;\n } else {\n // Max page is too high.\n max_page = num_pages;\n // +1 to account for the +1 in the loop below.\n max_offset = max_range - (max_page + 1 - cur_page_num);\n }\n\n // Second and final pass on min page to add any unused\n // offset from max to min.\n if (max_offset != 0) {\n min_page -= max_offset;\n if (min_page < 1) {\n min_page = 1;\n }\n }\n\n // template header\n tmpl += '
';\n if (options.show_item_checkboxes) {\n tmpl += \"
\";\n }\n tmpl += '
' + '' + \"Page:\";\n\n if (min_page > 1) {\n tmpl += '1 ...';\n }\n\n // create page urls\n for (var page_index = min_page; page_index < max_page + 1; page_index++) {\n if (page_index == options.cur_page_num) {\n tmpl += '' + page_index + \"\";\n } else {\n tmpl += '' + page_index + \"\";\n }\n }\n\n // show last page\n if (max_page < num_pages) {\n tmpl += \"...\" + '' + num_pages + \"\";\n }\n tmpl += \"\";\n\n // Show all link\n tmpl += ' | Show All' + \"
\" + \"
\";\n }\n\n // Grid operations for multiple items.\n if (options.show_item_checkboxes) {\n // start template\n tmpl += \"
\" + '' + \"
\" + '
' + 'For selected items: ';\n\n // configure buttons for operations\n for (var i in options.operations) {\n var operation = options.operations[i];\n if (operation.allow_multiple) {\n tmpl += ' ';\n }\n }\n\n // finalize template\n tmpl += \"
\" + \"
\";\n }\n\n // count global operations\n var found_global = false;\n for (i in options.operations) {\n if (options.operations[i].global_operation) {\n found_global = true;\n break;\n }\n }\n\n // add global operations\n if (found_global) {\n tmpl += \"
\" + '
';\n for (i in options.operations) {\n var operation = options.operations[i];\n if (operation.global_operation) {\n tmpl += '' + operation.label + \"\";\n }\n }\n tmpl += \"
\";\n }\n\n // return\n return tmpl;\n },\n\n // template\n message: function message(options) {\n var status = options.status == \"success\" ? \"done\" : options.status;\n return \"
\" + '
' + _.escape(options.message) + \"
\" + '' + \"\";\n },\n\n // template\n grid_filters: function grid_filters(options) {\n // get filters\n var default_filter_dict = options.default_filter_dict;\n var filters = options.filters;\n\n // show advanced search if flag set or if there are filters for advanced search fields\n var advanced_search_display = \"none\";\n if (options.advanced_search) {\n advanced_search_display = \"block\";\n }\n\n // identify columns with advanced filtering\n var show_advanced_search_link = false;\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"advanced\") {\n var column_key = column.key;\n var f_key = filters[column_key];\n var d_key = default_filter_dict[column_key];\n if (f_key && d_key && f_key != d_key) {\n advanced_search_display = \"block\";\n }\n show_advanced_search_link = true;\n }\n }\n\n // hide standard search if advanced is shown\n var standard_search_display = \"block\";\n if (advanced_search_display == \"block\") {\n standard_search_display = \"none\";\n }\n\n //\n // standard search\n //\n var tmpl = '
' + \"
\" + \"
\" + '
' + \"
\";\n\n // add standard filters\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"standard\") {\n tmpl += this.grid_column_filter(options, column);\n }\n }\n\n // finalize standard search\n tmpl += \"
\" + \"
\" + \"
\" + \"
\" + \"
\";\n\n // show advanced search link in standard display\n if (show_advanced_search_link) {\n tmpl += 'Advanced Search';\n }\n\n // finalize standard search display\n tmpl += \"
\"\n );\n }\n });\n\n return {\n View: View\n };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/ui/ui-list.js","define(\n [\n //jquery\n //backbone\n ],\n function() {\n // =============================================================================\n /**\n * view for a popup menu\n */\n var PopupMenu = Backbone.View.extend({\n //TODO: maybe better as singleton off the Galaxy obj\n /** Cache the desired button element and options, set up the button click handler\n * NOTE: attaches this view as HTML/jQ data on the button for later use.\n */\n initialize: function($button, options) {\n // default settings\n this.$button = $button;\n if (!this.$button.length) {\n this.$button = $(\"\");\n }\n this.options = options || [];\n this.$button.data(\"popupmenu\", this);\n\n // set up button click -> open menu behavior\n var menu = this;\n this.$button.click(function(event) {\n // if there's already a menu open, remove it\n $(\".popmenu-wrapper\").remove();\n menu._renderAndShow(event);\n return false;\n });\n },\n\n // render the menu, append to the page body at the click position, and set up the 'click-away' handlers, show\n _renderAndShow: function(clickEvent) {\n this.render();\n this.$el\n .appendTo(\"body\")\n .css(this._getShownPosition(clickEvent))\n .show();\n this._setUpCloseBehavior();\n },\n\n // render the menu\n // this menu doesn't attach itself to the DOM ( see _renderAndShow )\n render: function() {\n // render the menu body absolute and hidden, fill with template\n this.$el\n .addClass(\"popmenu-wrapper\")\n .hide()\n .css({ position: \"absolute\" })\n .html(this.template(this.$button.attr(\"id\"), this.options));\n\n // set up behavior on each link/anchor elem\n if (this.options.length) {\n var menu = this;\n //precondition: there should be one option per li\n this.$el.find(\"li\").each(function(i, li) {\n var option = menu.options[i];\n\n // if the option has 'func', call that function when the anchor is clicked\n if (option.func) {\n $(this)\n .children(\"a.popupmenu-option\")\n .click(function(event) {\n option.func.call(menu, event, option);\n // We must preventDefault otherwise clicking \"cancel\"\n // on a purge or something still navigates and causes\n // the action.\n event.preventDefault();\n // bubble up so that an option click will call the close behavior\n });\n }\n });\n }\n return this;\n },\n\n template: function(id, options) {\n return [\n '
\"\n ].join(\"\");\n }).join(\"\");\n },\n\n // get the absolute position/offset for the menu\n _getShownPosition: function(clickEvent) {\n // display menu horiz. centered on click...\n var menuWidth = this.$el.width();\n var x = clickEvent.pageX - menuWidth / 2;\n\n // adjust to handle horiz. scroll and window dimensions ( draw entirely on visible screen area )\n x = Math.min(\n x,\n $(document).scrollLeft() + $(window).width() - menuWidth - 5\n );\n x = Math.max(x, $(document).scrollLeft() + 5);\n return {\n top: clickEvent.pageY,\n left: x\n };\n },\n\n // bind an event handler to all available frames so that when anything is clicked\n // the menu is removed from the DOM and the event handler unbinds itself\n _setUpCloseBehavior: function() {\n var menu = this;\n //TODO: alternately: focus hack, blocking overlay, jquery.blockui\n\n // function to close popup and unbind itself\n function closePopup(event) {\n $(document).off(\"click.close_popup\");\n if (window && window.parent !== window) {\n try {\n $(window.parent.document).off(\"click.close_popup\");\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\")\n .contents()\n .off(\"click.close_popup\");\n } catch (err) {}\n }\n menu.remove();\n }\n\n $(\"html\").one(\"click.close_popup\", closePopup);\n if (window && window.parent !== window) {\n try {\n $(window.parent.document)\n .find(\"html\")\n .one(\"click.close_popup\", closePopup);\n } catch (err) {}\n } else {\n try {\n $(\"iframe#galaxy_main\")\n .contents()\n .one(\"click.close_popup\", closePopup);\n } catch (err) {}\n }\n },\n\n // add a menu option/item at the given index\n addItem: function(item, index) {\n // append to end if no index\n index = index >= 0 ? index : this.options.length;\n this.options.splice(index, 0, item);\n return this;\n },\n\n // remove a menu option/item at the given index\n removeItem: function(index) {\n if (index >= 0) {\n this.options.splice(index, 1);\n }\n return this;\n },\n\n // search for a menu option by its html\n findIndexByHtml: function(html) {\n for (var i = 0; i < this.options.length; i++) {\n if (\n _.has(this.options[i], \"html\") &&\n this.options[i].html === html\n ) {\n return i;\n }\n }\n return null;\n },\n\n // search for a menu option by its html\n findItemByHtml: function(html) {\n return this.options[this.findIndexByHtml(html)];\n },\n\n // string representation\n toString: function() {\n return \"PopupMenu\";\n }\n });\n /** shortcut to new for when you don't need to preserve the ref */\n PopupMenu.create = function _create($button, options) {\n return new PopupMenu($button, options);\n };\n\n // -----------------------------------------------------------------------------\n // the following class functions are bridges from the original make_popupmenu and make_popup_menus\n // to the newer backbone.js PopupMenu\n\n /** Create a PopupMenu from simple map initial_options activated by clicking button_element.\n * Converts initial_options to object array used by PopupMenu.\n * @param {jQuery|DOMElement} button_element element which, when clicked, activates menu\n * @param {Object} initial_options map of key -> values, where\n * key is option text, value is fn to call when option is clicked\n * @returns {PopupMenu} the PopupMenu created\n */\n PopupMenu.make_popupmenu = function(button_element, initial_options) {\n var convertedOptions = [];\n _.each(initial_options, function(optionVal, optionKey) {\n var newOption = { html: optionKey };\n\n // keys with null values indicate: header\n if (optionVal === null) {\n // !optionVal? (null only?)\n newOption.header = true;\n\n // keys with function values indicate: a menu option\n } else if (jQuery.type(optionVal) === \"function\") {\n newOption.func = optionVal;\n }\n //TODO:?? any other special optionVals?\n // there was no divider option originally\n convertedOptions.push(newOption);\n });\n return new PopupMenu($(button_element), convertedOptions);\n };\n\n /** Find all anchors in $parent (using selector) and covert anchors into a PopupMenu options map.\n * @param {jQuery} $parent the element that contains the links to convert to options\n * @param {String} selector jq selector string to find links\n * @returns {Object[]} the options array to initialize a PopupMenu\n */\n //TODO: lose parent and selector, pass in array of links, use map to return options\n PopupMenu.convertLinksToOptions = function($parent, selector) {\n $parent = $($parent);\n selector = selector || \"a\";\n var options = [];\n $parent.find(selector).each(function(elem, i) {\n var option = {},\n $link = $(elem);\n\n // convert link text to the option text (html) and the href into the option func\n option.html = $link.text();\n if ($link.attr(\"href\")) {\n var linkHref = $link.attr(\"href\"),\n linkTarget = $link.attr(\"target\"),\n confirmText = $link.attr(\"confirm\");\n\n option.func = function() {\n // if there's a \"confirm\" attribute, throw up a confirmation dialog, and\n // if the user cancels - do nothing\n if (confirmText && !confirm(confirmText)) {\n return;\n }\n\n // if there's no confirm attribute, or the user accepted the confirm dialog:\n switch (linkTarget) {\n // relocate the center panel\n case \"_parent\":\n window.parent.location = linkHref;\n break;\n\n // relocate the entire window\n case \"_top\":\n window.top.location = linkHref;\n break;\n\n // relocate this panel\n default:\n window.location = linkHref;\n }\n };\n }\n options.push(option);\n });\n return options;\n };\n\n /** Create a single popupmenu from existing DOM button and anchor elements\n * @param {jQuery} $buttonElement the element that when clicked will open the menu\n * @param {jQuery} $menuElement the element that contains the anchors to convert into a menu\n * @param {String} menuElementLinkSelector jq selector string used to find anchors to be made into menu options\n * @returns {PopupMenu} the PopupMenu (Backbone View) that can render, control the menu\n */\n PopupMenu.fromExistingDom = function(\n $buttonElement,\n $menuElement,\n menuElementLinkSelector\n ) {\n $buttonElement = $($buttonElement);\n $menuElement = $($menuElement);\n var options = PopupMenu.convertLinksToOptions(\n $menuElement,\n menuElementLinkSelector\n );\n // we're done with the menu (having converted it to an options map)\n $menuElement.remove();\n return new PopupMenu($buttonElement, options);\n };\n\n /** Create all popupmenus within a document or a more specific element\n * @param {DOMElement} parent the DOM element in which to search for popupmenus to build (defaults to document)\n * @param {String} menuSelector jq selector string to find popupmenu menu elements (defaults to \"div[popupmenu]\")\n * @param {Function} buttonSelectorBuildFn the function to build the jq button selector.\n * Will be passed $menuElement, parent.\n * (Defaults to return '#' + $menuElement.attr( 'popupmenu' ); )\n * @returns {PopupMenu[]} array of popupmenus created\n */\n PopupMenu.make_popup_menus = function(\n parent,\n menuSelector,\n buttonSelectorBuildFn\n ) {\n parent = parent || document;\n // orig. Glx popupmenu menus have a (non-std) attribute 'popupmenu'\n // which contains the id of the button that activates the menu\n menuSelector = menuSelector || \"div[popupmenu]\";\n // default to (orig. Glx) matching button to menu by using the popupmenu attr of the menu as the id of the button\n buttonSelectorBuildFn =\n buttonSelectorBuildFn ||\n function($menuElement, parent) {\n return \"#\" + $menuElement.attr(\"popupmenu\");\n };\n\n // aggregate and return all PopupMenus\n var popupMenusCreated = [];\n $(parent)\n .find(menuSelector)\n .each(function() {\n var $menuElement = $(this),\n $buttonElement = $(parent).find(\n buttonSelectorBuildFn($menuElement, parent)\n );\n popupMenusCreated.push(\n PopupMenu.fromDom($buttonElement, $menuElement)\n );\n $buttonElement.addClass(\"popup\");\n });\n return popupMenusCreated;\n };\n\n // =============================================================================\n return PopupMenu;\n }\n);\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/ui/popup-menu.js","/** This class creates a ui table element. */\ndefine([\"utils/utils\"], function(Utils) {\n var View = Backbone.View.extend({\n initialize: function(options) {\n this.options = Utils.merge(options, {\n content: \"No content available.\",\n onchange: null,\n ondblclick: null,\n onconfirm: null,\n cls: \"ui-table\",\n selectable: true,\n cls_tr: \"\"\n });\n this.setElement(this._template());\n this.$thead = this.$(\"thead\");\n this.$tbody = this.$(\"tbody\");\n this.$tmessage = this.$(\"tmessage\");\n this.row = this._row();\n this.row_count = 0;\n },\n\n events: {\n click: \"_onclick\",\n dblclick: \"_ondblclick\"\n },\n\n /** Add cell to header row */\n addHeader: function($el) {\n this.row.append($(\"
\";\n\n // return template\n return tmpl;\n },\n\n // template\n body: function(options) {\n // initialize\n var tmpl = \"\";\n var num_rows_rendered = 0;\n var items_length = options.items.length;\n\n // empty grid?\n if (items_length == 0) {\n // No results.\n tmpl += '
No Items
';\n num_rows_rendered = 1;\n }\n\n // create rows\n for (var i in options.items) {\n // encode ids\n var item = options.items[i];\n var encoded_id = item.encode_id;\n var popupmenu_id = \"grid-\" + i + \"-popup\";\n\n // Tag current\n tmpl += \"
\";\n }\n\n // Data columns\n for (var j in options.columns) {\n var column = options.columns[j];\n if (column.visible) {\n // Nowrap\n var nowrap = \"\";\n if (column.nowrap) {\n nowrap = 'style=\"white-space:nowrap;\"';\n }\n\n // get column settings\n var column_settings = item.column_config[column.label];\n\n // load attributes\n var link = column_settings.link;\n var value = column_settings.value;\n var target = column_settings.target;\n\n // unescape value\n if (jQuery.type(value) === \"string\") {\n value = value.replace(/\\/\\//g, \"/\");\n }\n\n // Attach popup menu?\n var id = \"\";\n var cls = \"\";\n if (column.attach_popup) {\n id = \"grid-\" + i + \"-popup\";\n cls = \"menubutton\";\n if (link != \"\") {\n cls += \" split\";\n }\n cls += \" popup\";\n }\n\n // Check for row wrapping\n tmpl += \"
\";\n\n // Link\n if (link) {\n if (options.operations.length != 0) {\n tmpl +=\n '
';\n }\n tmpl +=\n '' +\n value +\n \"\";\n if (options.operations.length != 0) {\n tmpl += \"
\";\n num_rows_rendered++;\n }\n return tmpl;\n },\n\n // template\n footer: function(options) {\n // create template string\n var tmpl = \"\";\n\n // paging\n if (options.use_paging && options.num_pages > 1) {\n // get configuration\n var num_page_links = options.num_page_links;\n var cur_page_num = options.cur_page_num;\n var num_pages = options.num_pages;\n\n // First pass on min page.\n var page_link_range = num_page_links / 2;\n var min_page = cur_page_num - page_link_range;\n var min_offset = 0;\n if (min_page <= 0) {\n // Min page is too low.\n min_page = 1;\n min_offset = page_link_range - (cur_page_num - min_page);\n }\n\n // Set max page.\n var max_range = page_link_range + min_offset;\n var max_page = cur_page_num + max_range;\n var max_offset;\n if (max_page <= num_pages) {\n // Max page is fine.\n max_offset = 0;\n } else {\n // Max page is too high.\n max_page = num_pages;\n // +1 to account for the +1 in the loop below.\n max_offset = max_range - (max_page + 1 - cur_page_num);\n }\n\n // Second and final pass on min page to add any unused\n // offset from max to min.\n if (max_offset != 0) {\n min_page -= max_offset;\n if (min_page < 1) {\n min_page = 1;\n }\n }\n\n // template header\n tmpl += '
';\n if (options.show_item_checkboxes) {\n tmpl += \"
\";\n }\n tmpl +=\n '
' +\n '' +\n \"Page:\";\n\n if (min_page > 1) {\n tmpl +=\n '1 ...';\n }\n\n // create page urls\n for (\n var page_index = min_page;\n page_index < max_page + 1;\n page_index++\n ) {\n if (page_index == options.cur_page_num) {\n tmpl +=\n '' +\n page_index +\n \"\";\n } else {\n tmpl +=\n '' +\n page_index +\n \"\";\n }\n }\n\n // show last page\n if (max_page < num_pages) {\n tmpl +=\n \"...\" +\n '' +\n num_pages +\n \"\";\n }\n tmpl += \"\";\n\n // Show all link\n tmpl +=\n ' | Show All' +\n \"
\" +\n \"
\";\n }\n\n // Grid operations for multiple items.\n if (options.show_item_checkboxes) {\n // start template\n tmpl +=\n \"
\" +\n '' +\n \"
\" +\n '
' +\n 'For selected items: ';\n\n // configure buttons for operations\n for (var i in options.operations) {\n var operation = options.operations[i];\n if (operation.allow_multiple) {\n tmpl +=\n ' ';\n }\n }\n\n // finalize template\n tmpl += \"
\" + \"
\";\n }\n\n // count global operations\n var found_global = false;\n for (i in options.operations) {\n if (options.operations[i].global_operation) {\n found_global = true;\n break;\n }\n }\n\n // add global operations\n if (found_global) {\n tmpl += \"
\" + '
';\n for (i in options.operations) {\n var operation = options.operations[i];\n if (operation.global_operation) {\n tmpl +=\n '' +\n operation.label +\n \"\";\n }\n }\n tmpl += \"
\" +\n '' +\n \"\"\n );\n },\n\n // template\n grid_filters: function(options) {\n // get filters\n var default_filter_dict = options.default_filter_dict;\n var filters = options.filters;\n\n // show advanced search if flag set or if there are filters for advanced search fields\n var advanced_search_display = \"none\";\n if (options.advanced_search) {\n advanced_search_display = \"block\";\n }\n\n // identify columns with advanced filtering\n var show_advanced_search_link = false;\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"advanced\") {\n var column_key = column.key;\n var f_key = filters[column_key];\n var d_key = default_filter_dict[column_key];\n if (f_key && d_key && f_key != d_key) {\n advanced_search_display = \"block\";\n }\n show_advanced_search_link = true;\n }\n }\n\n // hide standard search if advanced is shown\n var standard_search_display = \"block\";\n if (advanced_search_display == \"block\") {\n standard_search_display = \"none\";\n }\n\n //\n // standard search\n //\n var tmpl =\n '
' +\n \"
\" +\n \"
\" +\n '
' +\n \"
\";\n\n // add standard filters\n for (var i in options.columns) {\n var column = options.columns[i];\n if (column.filterable == \"standard\") {\n tmpl += this.grid_column_filter(options, column);\n }\n }\n\n // finalize standard search\n tmpl += \"
\" + \"
\" + \"
\" + \"
\" + \"
\";\n\n // show advanced search link in standard display\n if (show_advanced_search_link) {\n tmpl +=\n 'Advanced Search';\n }\n\n // finalize standard search display\n tmpl += \"