diff --git a/client/galaxy/scripts/mvc/collection/collection-view.js b/client/galaxy/scripts/mvc/collection/collection-view.js index 2f2a93af9fb..2b7de39e3c3 100644 --- a/client/galaxy/scripts/mvc/collection/collection-view.js +++ b/client/galaxy/scripts/mvc/collection/collection-view.js @@ -52,6 +52,7 @@ var CollectionView = _super.extend( _queueNewRender: function($newRender, speed) { speed = speed === undefined ? this.fxSpeed : speed; var panel = this; + this.handleWarning($newRender); panel.log("_queueNewRender:", $newRender, speed); // TODO: jquery@1.12 doesn't change display when the elem has display: flex @@ -61,6 +62,16 @@ var CollectionView = _super.extend( panel.trigger("rendered", panel); }, + handleWarning: function($newRender) { + var viewLength = this.views.length; + var elementCount = this.model.get("element_count"); + if (elementCount && elementCount !== viewLength) { + var warning = _l(`displaying only ${viewLength} of ${elementCount} items`); + var $warns = $newRender.find(".elements-warning"); + $warns.html(`
| '+this.grid_header(e)+' | ||
| ",a&&(u+='Advanced Search'),u+=" |
| Close Advanced Search |
"+t.message+"",buttons:{Close:function(){Galaxy.modal.hide()}}})})),a.append(e("").text(" ")),a.append(e("").text("Try again").click(function(){i.init(!0)})))}}),this.update_icons(),n}},predraw_init:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(i&&void 0!==i.min&&void 0!==i.max){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_default_value("min_value",n),t.config.set_default_value("max_value",a),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},get_drawables:function(){return this}});var Y=function(t,i,n){q.call(this,t,i,n);var a=this;if(A(a.container_div,a.drag_handle_class,".group",a),this.filters_manager=new b.default.FiltersManager(this,"filters"in n?n.filters:null),this.data_manager.set("filters_manager",this.filters_manager),this.filters_available=!1,this.tool=n.tool?new N(l.extend(n.tool,{track:this,tool_state:n.tool_state})):null,this.tile_cache=new c.default.Cache(10),this.left_offset=0,this.header_div&&(this.set_filters_manager(this.filters_manager),this.tool)){var s=new G({model:this.tool});s.render(),this.dynamic_tool_div=s.$el,this.header_div.after(this.dynamic_tool_div)}this.tiles_div=e("").addClass("tiles").appendTo(this.content_div),this.config.get_value("content_visible")||this.tiles_div.hide(),this.overlay_div=e("").addClass("overlay").appendTo(this.content_div),n.mode&&this.change_mode(n.mode)};E(Y.prototype,z.prototype,q.prototype,{action_icons_def:q.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(t){e(".tooltip").remove(),t.slotters[t.view.resolution_px_b].max_rows*=2,t.request_draw({clear_tile_cache:!0})},hide:!0}]),copy:function(e){var t=this.to_dict();E(t,{data_manager:this.data_manager});var i=new this.constructor(this.view,e,t);return i.change_mode(this.mode),i.enabled=this.enabled,i},set_filters_manager:function(e){this.filters_manager=e,this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:this.tool?this.tool.state_dict():{}}},set_min_max:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(isNaN(parseFloat(t.config.get_value("min_value")))||isNaN(parseFloat(t.config.get_value("max_value")))){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},change_mode:function(e){var t=this;return t.mode=e,t.config.set_value("mode",e),"Auto"===e&&this.data_manager.clear(),t.request_draw({clear_tile_cache:!0}),this.action_icons.mode_icon.attr("title","Set display mode (now: "+t.mode+")"),t},update_icons:function(){var e=this;e.action_icons.filters_icon.toggle(e.filters_available),e.action_icons.tools_icon.toggle(null!==e.tool),e.action_icons.param_space_viz_icon.toggle(null!==e.tool)},_gen_tile_cache_key:function(e,t){return e+"_"+t},request_draw:function(e){e&&e.clear_tile_cache&&this.tile_cache.clear(),this.view.request_redraw(e,this)},before_draw:function(){this.max_height_px=0},_draw:function(t){if(this.can_draw()){var i=t&&t.clear_after,n=this.view.low,a=this.view.high,s=this.view.container.width(),o=this.view.resolution_px_b,r=1/o;this.is_overview&&(n=this.view.max_low,a=this.view.max_high,o=s/(view.max_high-view.max_low),r=1/o),this.before_draw(),this.tiles_div.children().addClass("remove");for(var d,u,h=Math.floor(400*r),f=Math.floor(n/h),p=[],m=[];f*h").text(d).make_text_editable({num_cols:12,on_finish:function(t){e(".tooltip").remove(),n.config.set_value(r,s(t,1)),i()},help_text:"Set "+o+" value"}).addClass("yaxislabel "+a).css("color",this.config.get_value("label_color")),this.container_div.prepend(l))},postdraw_actions:function(e,t,i,n){if(l.filter(e,function(e){return e instanceof F}).length>0){this.max_height_px=0;var a=this;l.each(e,function(e){e instanceof F||(e.html_elt.remove(),a.draw_helper(e.region,i,{force:!0,mode:"Coverage"}))}),a._add_yaxis_label("max")}else this.container_div.find(".yaxislabel").remove(),l.find(e,function(e){return e.has_icons})&&l.each(e,function(e){e.has_icons||e.html_elt.css("padding-top",20)})},get_mode:function(e){return this.mode},update_auto_mode:function(e){},_get_drawables:function(){return[this]},draw_helper:function(t,i,n){n||(n={});var a=n.force,s=n.mode||this.mode,o=1/i,r=this,d=this._get_drawables(),c=this._gen_tile_cache_key(i,t),u=a?void 0:r.tile_cache.get_elt(c);if(u)return function(e){return e&&"track"in e}(u)&&r.show_tile(u,i),u;if(!1===n.data_fetch)return null;var h=function(){var e=l.find(I,function(e){return e===s})?"Coverage":s,i=l.map(d,function(i){return i.data_manager.get_data(t,e,o,r.data_url_extra_params)});return view.reference_track&&i.push(view.reference_track.data_manager.get_data(t,s,o,view.reference_track.data_url_extra_params)),i},f=e.Deferred();return r.tile_cache.set_elt(c,f),e.when.apply(e,h()).then(function(){var a,s=h(),o=s;if(l.find(s,function(e){return p.default.is_deferred(e)}))return r.tile_cache.set_elt(c,void 0),void e.when(r.draw_helper(t,i,n)).then(function(e){f.resolve(e)});view.reference_track&&(a=view.reference_track.data_manager.subset_entry(s.pop(),t));var u=[],m=[];l.each(d,function(e,t){var n=e.mode,a=o[t];"Auto"===n&&(n=e.get_mode(a),e.update_auto_mode(n)),u.push(n),m.push(e.get_canvas_height(a,n,i,b))});var _,g=r.view.canvas_manager.new_canvas(),v=t.get("start"),w=t.get("end"),b=Math.ceil((w-v)*i)+r.left_offset,y=l.max(m);g.width=b,g.height=n.height||y;var x=g.getContext("2d");x.translate(r.left_offset,0),d.length>1&&(x.globalAlpha=.5,x.globalCompositeOperation="source-over"),l.each(d,function(e,n){_=e.draw_tile(o[n],x,u[n],t,i,a)}),void 0!==_&&(r.tile_cache.set_elt(c,_),r.show_tile(_,i)),f.resolve(_)}),f},get_canvas_height:function(e,t,i,n){return this.visible_height_px},_draw_line_track_tile:function(e,t,i,n,a){-1!==[void 0,null].indexOf(this.config.get_value("min_value"))&&this.config.set_value("min_value",0),-1!==[void 0,null,0].indexOf(this.config.get_value("max_value"))&&this.config.set_value("max_value",l.max(l.map(e.data,function(e){return e[1]}))||0);var s=t.canvas;return new v.default.LinePainter(e.data,n.get("start"),n.get("end"),this.config.to_key_value_dict(),i).draw(t,s.width,s.height,a),new F(this,n,a,s,e.data)},draw_tile:function(e,t,i,n,a,s){},show_tile:function(e,t){var i=e.html_elt;e.predisplay_actions();var n=Math.round((e.low-(this.is_overview?this.view.max_low:this.view.low))*t);this.left_offset&&(n-=this.left_offset),i.css("left",n),i.hasClass("remove")?i.removeClass("remove"):this.tiles_div.append(i),i.css("height","auto"),this.max_height_px=Math.max(this.max_height_px,i.height()-2),i.parent().children().css("height",this.max_height_px+"px");var a=this.max_height_px;0!==this.visible_height_px&&(a=Math.min(this.max_height_px,this.visible_height_px)),this.tiles_div.css("height",a+"px")},tool_region_and_parameters_str:function(e){var t=this;return" - region=["+(void 0!==e?e.toString():"all")+"], parameters=["+l.values(t.tool.get_inputs_dict()).join(", ")+"]"},data_and_mode_compatible:function(e,t){return"Auto"===t||("Coverage"===t?"bigwig"===e.dataset_type:"bigwig"!==e.dataset_type&&"no_detail"!==e.extra_info)},can_subset:function(e){return!e.message&&"no_detail"!==e.extra_info&&("bigwig"!==e.dataset_type||e.data[1][0]-e.data[0][0]==1)},init_for_tool_data:function(){this.data_manager.set("data_type","raw_data"),this.data_query_wait=1e3,this.dataset_check_type="state"}});var W=function(e,t){q.call(this,e,t,{resize:!1,header:!1}),this.container_div.addClass("label-track")};E(W.prototype,q.prototype,{init:function(){this.enabled=!0},predraw_init:function(){},_draw:function(t){for(var i=this.view,n=i.high-i.low,a=Math.floor(Math.pow(10,Math.floor(Math.log(n)/Math.log(10)))),s=Math.floor(i.low/a)*a,o=this.view.container.width(),r=e("").addClass("label-container");s
| Name | Size | Created |
|---|
"+JSON.stringify(n.responseJSON)+"":i+=": "+a}t._showAlert(i,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=a('');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=e.offset(),n=e.scrollTop(),a=t-i.top,s=i.top+e.outerHeight()-t;a>=0&&a
",(0,b.default)(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"
","",(0,b.default)(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"
"].join("")),invalidElements:n.template([(0,b.default)("The following selections could not be included due to problems:"),"<%= dataset.peek %>',"<% } %>","<% } %>","
| '+this.grid_header(e)+' | ||
| ",a&&(u+='Advanced Search'),u+=" |
| Close Advanced Search |
"+t.message+"",buttons:{Close:function(){Galaxy.modal.hide()}}})})),a.append(e("").text(" ")),a.append(e("").text("Try again").click(function(){i.init(!0)})))}}),this.update_icons(),n}},predraw_init:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(i&&void 0!==i.min&&void 0!==i.max){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_default_value("min_value",n),t.config.set_default_value("max_value",a),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},get_drawables:function(){return this}});var Y=function(t,i,n){q.call(this,t,i,n);var a=this;if(A(a.container_div,a.drag_handle_class,".group",a),this.filters_manager=new b.default.FiltersManager(this,"filters"in n?n.filters:null),this.data_manager.set("filters_manager",this.filters_manager),this.filters_available=!1,this.tool=n.tool?new N(l.extend(n.tool,{track:this,tool_state:n.tool_state})):null,this.tile_cache=new c.default.Cache(10),this.left_offset=0,this.header_div&&(this.set_filters_manager(this.filters_manager),this.tool)){var s=new G({model:this.tool});s.render(),this.dynamic_tool_div=s.$el,this.header_div.after(this.dynamic_tool_div)}this.tiles_div=e("").addClass("tiles").appendTo(this.content_div),this.config.get_value("content_visible")||this.tiles_div.hide(),this.overlay_div=e("").addClass("overlay").appendTo(this.content_div),n.mode&&this.change_mode(n.mode)};E(Y.prototype,z.prototype,q.prototype,{action_icons_def:q.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(t){e(".tooltip").remove(),t.slotters[t.view.resolution_px_b].max_rows*=2,t.request_draw({clear_tile_cache:!0})},hide:!0}]),copy:function(e){var t=this.to_dict();E(t,{data_manager:this.data_manager});var i=new this.constructor(this.view,e,t);return i.change_mode(this.mode),i.enabled=this.enabled,i},set_filters_manager:function(e){this.filters_manager=e,this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:this.tool?this.tool.state_dict():{}}},set_min_max:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(isNaN(parseFloat(t.config.get_value("min_value")))||isNaN(parseFloat(t.config.get_value("max_value")))){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},change_mode:function(e){var t=this;return t.mode=e,t.config.set_value("mode",e),"Auto"===e&&this.data_manager.clear(),t.request_draw({clear_tile_cache:!0}),this.action_icons.mode_icon.attr("title","Set display mode (now: "+t.mode+")"),t},update_icons:function(){var e=this;e.action_icons.filters_icon.toggle(e.filters_available),e.action_icons.tools_icon.toggle(null!==e.tool),e.action_icons.param_space_viz_icon.toggle(null!==e.tool)},_gen_tile_cache_key:function(e,t){return e+"_"+t},request_draw:function(e){e&&e.clear_tile_cache&&this.tile_cache.clear(),this.view.request_redraw(e,this)},before_draw:function(){this.max_height_px=0},_draw:function(t){if(this.can_draw()){var i=t&&t.clear_after,n=this.view.low,a=this.view.high,s=this.view.container.width(),o=this.view.resolution_px_b,r=1/o;this.is_overview&&(n=this.view.max_low,a=this.view.max_high,o=s/(view.max_high-view.max_low),r=1/o),this.before_draw(),this.tiles_div.children().addClass("remove");for(var d,u,h=Math.floor(400*r),f=Math.floor(n/h),p=[],m=[];f*h").text(d).make_text_editable({num_cols:12,on_finish:function(t){e(".tooltip").remove(),n.config.set_value(r,s(t,1)),i()},help_text:"Set "+o+" value"}).addClass("yaxislabel "+a).css("color",this.config.get_value("label_color")),this.container_div.prepend(l))},postdraw_actions:function(e,t,i,n){if(l.filter(e,function(e){return e instanceof F}).length>0){this.max_height_px=0;var a=this;l.each(e,function(e){e instanceof F||(e.html_elt.remove(),a.draw_helper(e.region,i,{force:!0,mode:"Coverage"}))}),a._add_yaxis_label("max")}else this.container_div.find(".yaxislabel").remove(),l.find(e,function(e){return e.has_icons})&&l.each(e,function(e){e.has_icons||e.html_elt.css("padding-top",20)})},get_mode:function(e){return this.mode},update_auto_mode:function(e){},_get_drawables:function(){return[this]},draw_helper:function(t,i,n){n||(n={});var a=n.force,s=n.mode||this.mode,o=1/i,r=this,d=this._get_drawables(),c=this._gen_tile_cache_key(i,t),u=a?void 0:r.tile_cache.get_elt(c);if(u)return function(e){return e&&"track"in e}(u)&&r.show_tile(u,i),u;if(!1===n.data_fetch)return null;var h=function(){var e=l.find(I,function(e){return e===s})?"Coverage":s,i=l.map(d,function(i){return i.data_manager.get_data(t,e,o,r.data_url_extra_params)});return view.reference_track&&i.push(view.reference_track.data_manager.get_data(t,s,o,view.reference_track.data_url_extra_params)),i},f=e.Deferred();return r.tile_cache.set_elt(c,f),e.when.apply(e,h()).then(function(){var a,s=h(),o=s;if(l.find(s,function(e){return p.default.is_deferred(e)}))return r.tile_cache.set_elt(c,void 0),void e.when(r.draw_helper(t,i,n)).then(function(e){f.resolve(e)});view.reference_track&&(a=view.reference_track.data_manager.subset_entry(s.pop(),t));var u=[],m=[];l.each(d,function(e,t){var n=e.mode,a=o[t];"Auto"===n&&(n=e.get_mode(a),e.update_auto_mode(n)),u.push(n),m.push(e.get_canvas_height(a,n,i,b))});var _,g=r.view.canvas_manager.new_canvas(),v=t.get("start"),w=t.get("end"),b=Math.ceil((w-v)*i)+r.left_offset,y=l.max(m);g.width=b,g.height=n.height||y;var x=g.getContext("2d");x.translate(r.left_offset,0),d.length>1&&(x.globalAlpha=.5,x.globalCompositeOperation="source-over"),l.each(d,function(e,n){_=e.draw_tile(o[n],x,u[n],t,i,a)}),void 0!==_&&(r.tile_cache.set_elt(c,_),r.show_tile(_,i)),f.resolve(_)}),f},get_canvas_height:function(e,t,i,n){return this.visible_height_px},_draw_line_track_tile:function(e,t,i,n,a){-1!==[void 0,null].indexOf(this.config.get_value("min_value"))&&this.config.set_value("min_value",0),-1!==[void 0,null,0].indexOf(this.config.get_value("max_value"))&&this.config.set_value("max_value",l.max(l.map(e.data,function(e){return e[1]}))||0);var s=t.canvas;return new v.default.LinePainter(e.data,n.get("start"),n.get("end"),this.config.to_key_value_dict(),i).draw(t,s.width,s.height,a),new F(this,n,a,s,e.data)},draw_tile:function(e,t,i,n,a,s){},show_tile:function(e,t){var i=e.html_elt;e.predisplay_actions();var n=Math.round((e.low-(this.is_overview?this.view.max_low:this.view.low))*t);this.left_offset&&(n-=this.left_offset),i.css("left",n),i.hasClass("remove")?i.removeClass("remove"):this.tiles_div.append(i),i.css("height","auto"),this.max_height_px=Math.max(this.max_height_px,i.height()-2),i.parent().children().css("height",this.max_height_px+"px");var a=this.max_height_px;0!==this.visible_height_px&&(a=Math.min(this.max_height_px,this.visible_height_px)),this.tiles_div.css("height",a+"px")},tool_region_and_parameters_str:function(e){var t=this;return" - region=["+(void 0!==e?e.toString():"all")+"], parameters=["+l.values(t.tool.get_inputs_dict()).join(", ")+"]"},data_and_mode_compatible:function(e,t){return"Auto"===t||("Coverage"===t?"bigwig"===e.dataset_type:"bigwig"!==e.dataset_type&&"no_detail"!==e.extra_info)},can_subset:function(e){return!e.message&&"no_detail"!==e.extra_info&&("bigwig"!==e.dataset_type||e.data[1][0]-e.data[0][0]==1)},init_for_tool_data:function(){this.data_manager.set("data_type","raw_data"),this.data_query_wait=1e3,this.dataset_check_type="state"}});var W=function(e,t){q.call(this,e,t,{resize:!1,header:!1}),this.container_div.addClass("label-track")};E(W.prototype,q.prototype,{init:function(){this.enabled=!0},predraw_init:function(){},_draw:function(t){for(var i=this.view,n=i.high-i.low,a=Math.floor(Math.pow(10,Math.floor(Math.log(n)/Math.log(10)))),s=Math.floor(i.low/a)*a,o=this.view.container.width(),r=e("").addClass("label-container");s
| Name | Size | Created |
|---|
"+JSON.stringify(n.responseJSON)+"":i+=": "+a}t._showAlert(i,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=a('');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=e.offset(),n=e.scrollTop(),a=t-i.top,s=i.top+e.outerHeight()-t;a>=0&&a
",(0,b.default)(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"
","",(0,b.default)(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"
"].join("")),invalidElements:n.template([(0,b.default)("The following selections could not be included due to problems:"),"<%= dataset.peek %>',"<% } %>","<% } %>","
'+this.progressive+"...
";this.modal.$(".modal-body").empty().append(e).css({"margin-top":"8px"})},dialog:function(t,i,s){function o(){var e=t.$("#copy-modal-title").val();if(!e)return void t.$(".invalid-title").show();var n="copy-all"===t.$('input[name="copy-what"]:checked').val();t.$("button").prop("disabled",!0),r._showAjaxIndicator(),i.copy(!0,e,n).done(function(e){l.resolve(e)}).fail(function(t,a,s){var o={name:e,copyAllDatasets:n};d.default.ajaxErrorModal(i,t,o,r.errorMessage),l.rejectWith(l,arguments)}).done(function(){m&&t.hide()})}s=s||{};var r=this,l=n.Deferred(),c=s.nameFn||this.defaultName,h=c({name:i.get("name")}),f=s.allDatasets?"copy-all":"copy-non-deleted",p=!!e.isUndefined(s.allowAll)||s.allowAll,m=!!e.isUndefined(s.autoClose)||s.autoClose;this.modal=t;var _=s.closing_callback;return t.show(e.extend(s,{title:this.title({name:i.get("name")}),body:a(r._template({name:h,isAnon:Galaxy.user.isAnonymous(),allowAll:p,copyWhat:f,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:e.object([[(0,u.default)("Cancel"),function(){t.hide()}],[this.submitLabel,o]]),height:"auto",closing_events:!0,closing_callback:function(e){e&&l.reject({cancelled:!0}),_&&_(e)}})),t.$("#copy-modal-title").focus().select(),t.$("#copy-modal-title").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),o())}),l}},f=e.extend({},h,{defaultName:e.template("imported: <%- name %>"),title:e.template((0,u.default)("Importing history")+' "<%- name %>"'),submitLabel:(0,u.default)("Import"),errorMessage:(0,u.default)("History could not be imported."),progressive:(0,u.default)("Importing history"),activeLabel:(0,u.default)("Import only the active, non-deleted datasets"),allLabel:(0,u.default)("Import all datasets including deleted ones"),anonWarning:(0,u.default)("As an anonymous user, unless you login or register, you will lose your current history ")+(0,u.default)("after importing this history. ")}),p=function(e,t){t=t||{};var i=window.parent.Galaxy.modal||new r.default.View({});return t.useImport?f.dialog(i,e,t):h.dialog(i,e,t)};t.default=p}).call(t,i(2),i(0),i(0))},function(e,t,i){"use strict";(function(e,n){function a(t,i,n){return Galaxy.modal.show({title:i,body:t,closing_events:!0,buttons:{Ok:function(){Galaxy.modal.hide()}}}),Galaxy.modal.$el.addClass("error-modal"),n&&(Galaxy.modal.$(".error-details").add(Galaxy.modal.$('button:contains("Details")')).remove(),e("").addClass("error-details").hide().appendTo(Galaxy.modal.$(".modal-content")).append([e("").text(p),e("").text(JSON.stringify(n,null," "))]),e('").appendTo(Galaxy.modal.$(".buttons")).click(function(){Galaxy.modal.$(".error-details").toggle()})),Galaxy.modal}function s(e,t,i){if(e){if(e=(0,u.default)(e),t=(0,u.default)(t)||(0,u.default)("Error:"),window.Galaxy&&Galaxy.modal)return a(e,t,i);alert(t+"\n\n"+e),console.log("error details:",JSON.stringify(i))}}function o(){return s((0,u.default)("You appear to be offline. Please check your connection and try again."),(0,u.default)("Offline?"))}function r(){return s((0,u.default)("Galaxy is currently unreachable. Please try again in a few minutes.")+" "+h,(0,u.default)("Cannot connect to Galaxy"))}function l(e,t,i,n,a){return n=n||f,n+=" "+h,a=a||(0,u.default)("An error occurred"),s(n,a,d(e,t,i))}function d(e,t,i){return{raven:n.result(window.Raven,"lastEventId"),userAgent:navigator.userAgent,onLine:navigator.onLine,version:n.result(Galaxy.config,"version_major"),xhr:n.omit(t,n.functions(t)),options:n.omit(i,"xhr"),url:n.result(Galaxy.lastAjax,"url"),data:n.result(Galaxy.lastAjax,"data"),model:n.result(e,"toJSON",""+e),user:n.omit(n.result(Galaxy.user,"toJSON"),"email")}}Object.defineProperty(t,"__esModule",{value:!0});var c=i(7),u=function(e){return e&&e.__esModule?e:{default:e}}(c),h=(0,u.default)("Please contact a Galaxy administrator if the problem persists."),f=(0,u.default)("An error occurred while updating information with the server."),p=(0,u.default)("The following information can assist the developers in finding the source of the error:");t.default={errorModal:s,offlineErrorModal:o,badGatewayErrorModal:r,ajaxErrorModal:l}}).call(t,i(0),i(2))},function(e,t,i){"use strict";(function(e){function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),s=n(a),o=i(1),r=n(o),l=i(8),d=function(e){return e&&e.__esModule?e:{default:e}}(l),c=r.Collection.extend({initialize:function(e,t){r.Collection.prototype.initialize.call(this,e,t),this.setOrder(t.order||this.order,{silent:!0})},_setUpListeners:function(){return this.on({"changed-order":this.sort})},fetch:function(e){return e=this._buildFetchOptions(e),Galaxy.debug("fetch options:",e),r.Collection.prototype.fetch.call(this,e)},_buildFetchOptions:function(e){e=s.clone(e)||{};var t=this;e.traditional=!0,e.data=e.data||t._buildFetchData(e),Galaxy.debug("data:",e.data);var i=this._buildFetchFilters(e);return Galaxy.debug("filters:",i),s.isEmpty(i)||s.extend(e.data,this._fetchFiltersToAjaxData(i)),Galaxy.debug("data:",e.data),e},_buildFetchData:function(e){var t={};return this.order&&(t.order=this.order),s.defaults(s.pick(e,this._fetchParams),t)},_fetchParams:["order","limit","offset","view","keys"],_buildFetchFilters:function(e){return s.clone(e.filters||{})},_fetchFiltersToAjaxData:function(e){var t={q:[],qv:[]};return s.each(e,function(e,i){void 0!==e&&""!==e&&(!0===e&&(e="True"),!1===e&&(e="False"),null===e&&(e="None"),t.q.push(i),t.qv.push(e))}),t},reset:function(e,t){return this.allFetched=!1,r.Collection.prototype.reset.call(this,e,t)},order:null,comparators:{update_time:d.default.buildComparator("update_time",{ascending:!1}),"update_time-asc":d.default.buildComparator("update_time",{ascending:!0}),create_time:d.default.buildComparator("create_time",{ascending:!1}),"create_time-asc":d.default.buildComparator("create_time",{ascending:!0})},setOrder:function(e,t){t=t||{};var i=this,n=i.comparators[e];if(s.isUndefined(n))throw new Error("unknown order: "+e);if(n!==i.comparator)return i.order=e,i.comparator=n,t.silent||i.trigger("changed-order",t),i}}),u=c.extend({limitPerPage:500,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.currentPage=t.currentPage||0},getTotalItemCount:function(){return this.length},shouldPaginate:function(){return this.getTotalItemCount()>=this.limitPerPage},getLastPage:function(){return Math.floor(this.getTotalItemCount()/this.limitPerPage)},getPageCount:function(){return this.getLastPage()+1},getPageLimitOffset:function(e){return e=this.constrainPageNum(e),{limit:this.limitPerPage,offset:e*this.limitPerPage}},constrainPageNum:function(e){return Math.max(0,Math.min(e,this.getLastPage()))},fetchPage:function(e,t){var i=this;return e=i.constrainPageNum(e),i.currentPage=e,t=s.defaults(t||{},i.getPageLimitOffset(e)),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")})},fetchCurrentPage:function(e){return this.fetchPage(this.currentPage,e)},fetchPrevPage:function(e){return this.fetchPage(this.currentPage-1,e)},fetchNextPage:function(e){return this.fetchPage(this.currentPage+1,e)}}),h=c.extend({limitOnFirstFetch:null,limitPerFetch:100,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.limitOnFirstFetch=t.limitOnFirstFetch||this.limitOnFirstFetch,this.limitPerFetch=t.limitPerFetch||this.limitPerFetch,this.allFetched=!1,this.lastFetched=t.lastFetched||0},_buildFetchOptions:function(e){return e.remove=e.remove||!1,c.prototype._buildFetchOptions.call(this,e)},fetchFirst:function(e){return Galaxy.debug("ControlledFetchCollection.fetchFirst:",e),e=e?s.clone(e):{},this.allFetched=!1,this.lastFetched=0,this.fetchMore(s.defaults(e,{reset:!0,limit:this.limitOnFirstFetch}))},fetchMore:function(t){Galaxy.debug("ControlledFetchCollection.fetchMore:",t),t=s.clone(t||{});var i=this;if(Galaxy.debug("fetchMore, options.reset:",t.reset),!t.reset&&i.allFetched)return e.when();t.reset?t.offset=0:void 0===t.offset&&(t.offset=i.lastFetched);var n=t.limit=t.limit||i.limitPerFetch||null;return Galaxy.debug("fetchMore, limit:",n,"offset:",t.offset),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")}).done(function(e){var t=s.isArray(e)?e.length:0;i.lastFetched+=t,Galaxy.debug("fetchMore, lastFetched:",i.lastFetched),(!n||t