diff --git a/client/galaxy/scripts/mvc/history/options-menu.js b/client/galaxy/scripts/mvc/history/options-menu.js index 691c2d716553..a00330e804c4 100644 --- a/client/galaxy/scripts/mvc/history/options-menu.js +++ b/client/galaxy/scripts/mvc/history/options-menu.js @@ -17,6 +17,8 @@ var menu = [ { html : _l( 'Saved Histories' ), href : 'histories/list', + target : '_top' + }, { html : _l( 'Histories Shared with Me' ), @@ -205,7 +207,7 @@ function buildMenu( isAnon, purgeAllowed, urlRoot ){ //TODO:?? hard-coded galaxy_main if( menuOption.href ){ menuOption.href = urlRoot + menuOption.href; - menuOption.target = 'galaxy_main'; + menuOption.target = menuOption.target || 'galaxy_main'; } if( menuOption.confirm ){ diff --git a/static/maps/mvc/history/options-menu.js.map b/static/maps/mvc/history/options-menu.js.map index d101ca6b98a3..5c3f54e3a879 100644 --- a/static/maps/mvc/history/options-menu.js.map +++ b/static/maps/mvc/history/options-menu.js.map @@ -1 +1 @@ -{"version":3,"file":"options-menu.js","sources":["../../../src/mvc/history/options-menu.js"],"names":["define","PopupMenu","historyCopyDialog","BASE_MVC","_l","Webhooks","buildMenu","isAnon","purgeAllowed","urlRoot","_","clone","menu","filter","menuOption","anon","purge","href","target","confirm","func","galaxy_main","location","html","header","Galaxy","currHistoryPanel","createNewHistory","model","done","loadCurrentHistory","window","id","collapseAll","$","post","root","user_action","add","url","async","callback","webhooks","webhooks_menu","each","models","index","webhook","toJSON","activate","push","config","title","length","unshift","merge","create","$button","options","undefined","anonymous"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"options-menu.js","sources":["../../../src/mvc/history/options-menu.js"],"names":["define","PopupMenu","historyCopyDialog","BASE_MVC","_l","Webhooks","buildMenu","isAnon","purgeAllowed","urlRoot","_","clone","menu","filter","menuOption","anon","purge","href","target","confirm","func","galaxy_main","location","html","header","Galaxy","currHistoryPanel","createNewHistory","model","done","loadCurrentHistory","window","id","collapseAll","$","post","root","user_action","add","url","async","callback","webhooks","webhooks_menu","each","models","index","webhook","toJSON","activate","push","config","title","length","unshift","merge","create","$button","options","undefined","anonymous"],"mappings":"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"} \ No newline at end of file diff --git a/static/scripts/bundled/analysis.bundled.js b/static/scripts/bundled/analysis.bundled.js index 19e5de72941c..4f19790b6f0b 100644 --- a/static/scripts/bundled/analysis.bundled.js +++ b/static/scripts/bundled/analysis.bundled.js @@ -10,7 +10,7 @@ return e.length?o.map(e,function(e){if(e.divider)return'
  • 0},fetch:function(e){var t=this;return a.Model.prototype.fetch.call(this,e).always(function(){t._generateUrls()})},parse:function(e,t){var i=a.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},save:function(e,t){return t=t||{},t.wait=!!o.isUndefined(t.wait)||t.wait,a.Model.prototype.save.call(this,e,t)},delete:function(e){return this.get("deleted")?r.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},e)},purge:function(e){if(this.get("purged"))return r.when();e=e||{},e.url=this.urls.purge;var t=this,n=r.ajax(e);return n.done(function(e,i,n){t.set({deleted:!0,purged:!0})}),n.fail(function(n,s,a){var o=i("Unable to purge dataset"),r="Removal of datasets by users is not allowed in this Galaxy instance";n.responseJSON&&n.responseJSON.error?o=n.responseJSON.error:n.responseText.indexOf(r)!==-1&&(o=r),n.responseText=o,t.trigger("error",t,n,e,i(o),{error:o})}),n},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var e=this.get("id")||"";return this.get("name")&&(e='"'+this.get("name")+'",'+e),"Dataset("+e+")"}})),c=a.Collection.extend(t.LoggableMixin).extend({_logNamespace:n,model:l,urlRoot:Galaxy.root+"api/datasets",url:function(){return this.urlRoot},ids:function(){return this.map(function(e){return e.get("id")})},notReady:function(){return this.filter(function(e){return!e.inReadyState()})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},ajaxQueue:function(e,t){var i=r.Deferred(),n=this.length,s=[];if(!n)return i.resolve([]),i;var a=this.chain().reverse().map(function(o,r){return function(){var l=e.call(o,t);l.done(function(e){i.notify({curr:r,total:n,response:e,model:o})}),l.always(function(e){s.push(e),a.length?a.shift()():i.resolve(s)})}}).value();return a.shift()(),i},matches:function(e){return this.filter(function(t){return t.matches(e)})},toString:function(){return["DatasetAssociationCollection(",this.length,")"].join("")}});return{DatasetAssociation:l,DatasetAssociationCollection:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){a.ajaxSettings.traditional=!0,n=[i(4),i(117),i(118),i(52)],s=function(e,t,i,n){return o.View.extend({grid:null,initialize:function(t){this.dict_format=t.dict_format;var i=this;window.add_tag_to_grid_filter=function(e,t){var n=e+(void 0!==t&&""!==t?":"+t:""),s=r("#advanced-search").is(":visible");s||(r("#standard-search").slideToggle("fast"),r("#advanced-search").slideToggle("fast")),i.add_filter_condition("tags",n)},this.dict_format?(this.setElement("
    "),t.url_base&&!t.items?e.get({url:t.url_base,success:function(e){i.init_grid(e)}}):this.init_grid(t)):(this.setElement("#grid-container"),this.init_grid(t)),t.use_panels&&r("#center").css({padding:"10px",overflow:"auto"})},handle_refresh:function(e){e&&r.inArray("history",e)>-1&&top.Galaxy&&top.Galaxy.currHistoryPanel&&top.Galaxy.currHistoryPanel.loadCurrentHistory()},init_grid:function(e){this.grid=new t(e);var n=this.grid.attributes;this.handle_refresh(n.refresh_frames);var s=this.grid.get("url_base");if(s=s.replace(/^.*\/\/[^\/]+/,""),this.grid.set("url_base",s),this.$el.html(i.grid(n)),this.$el.find("#grid-table-header").html(i.header(n)),this.$el.find("#grid-table-body").html(i.body(n)),this.$el.find("#grid-table-footer").html(i.footer(n)),n.message){this.$el.find("#grid-message").html(i.message(n));var a=this;n.use_hide_message&&setTimeout(function(){a.$el.find("#grid-message").html("")},5e3)}this.init_grid_elements(),this.init_grid_controls(),init_refresh_on_change()},init_grid_controls:function(){var e=this;this.$el.find(".operation-button").each(function(){r(this).off(),r(this).click(function(){return e.submit_operation(this),!1})}),this.$el.find("input[type=text]").each(function(){r(this).off(),r(this).click(function(){r(this).select()}).keyup(function(){r(this).css("font-style","normal")})}),this.$el.find(".sort-link").each(function(){r(this).off(),r(this).click(function(){return e.set_sort_condition(r(this).attr("sort_key")),!1})}),this.$el.find(".text-filter-form").each(function(){r(this).off(),r(this).submit(function(){var t=r(this).attr("column_key"),i=r("#input-"+t+"-filter"),n=i.val();return i.val(""),e.add_filter_condition(t,n),!1})}),this.$el.find(".text-filter-val > a").each(function(){r(this).off(),r(this).click(function(){return r(this).parent().remove(),e.remove_filter_condition(r(this).attr("filter_key"),r(this).attr("filter_val")),!1})}),this.$el.find(".categorical-filter > a").each(function(){r(this).off(),r(this).click(function(){return e.set_categorical_filter(r(this).attr("filter_key"),r(this).attr("filter_val")),!1})}),this.$el.find(".advanced-search-toggle").each(function(){r(this).off(),r(this).click(function(){return e.$el.find("#standard-search").slideToggle("fast"),e.$el.find("#advanced-search").slideToggle("fast"),!1})}),this.$el.find("#check_all").off(),this.$el.find("#check_all").on("click",function(){e.check_all_items()})},init_grid_elements:function(){this.$el.find(".grid").each(function(){var e=r(this).find("input.grid-row-select-checkbox"),t=r(this).find("span.grid-selected-count"),i=function(){t.text(r(e).filter(":checked").length)};r(e).each(function(){r(this).change(i)}),i()}),0!==this.$el.find(".community_rating_star").length&&this.$el.find(".community_rating_star").rating({});var e=this.grid.attributes,t=this;this.$el.find(".page-link > a").each(function(){r(this).click(function(){return t.set_page(r(this).attr("page_num")),!1})}),this.$el.find(".use-target").each(function(){r(this).click(function(e){return t.execute({href:r(this).attr("href"),target:r(this).attr("target")}),!1})});var i=e.items.length;0!=i&&l.each(e.items,function(i,s){var a=t.$("#grid-"+s+"-popup").off(),o=new n(a);l.each(e.operations,function(e){t._add_operation(o,e,i)})})},_add_operation:function(e,t,i){var n=this,s=i.operation_config[t.label];s.allowed&&t.allow_popup&&e.addItem({html:t.label,href:s.url_args,target:s.target,confirmation_text:t.confirm,func:function(e){e.preventDefault();var s=r(e.target).html();t.onclick?t.onclick(i.encode_id):n.execute(this.findItemByHtml(s))}})},add_filter_condition:function(e,t){if(""===t)return!1;this.grid.add_filter(e,t,!0);var n=r(i.filter_element(e,t)),s=this;n.click(function(){r(this).remove(),s.remove_filter_condition(e,t)});var a=this.$el.find("#"+e+"-filtering-criteria");a.append(n),this.go_page_one(),this.execute()},remove_filter_condition:function(e,t){this.grid.remove_filter(e,t),this.go_page_one(),this.execute()},set_sort_condition:function(e){var t=this.grid.get("sort_key"),i=e;t.indexOf(e)!==-1&&"-"!==t.substring(0,1)&&(i="-"+e),this.$el.find(".sort-arrow").remove();var n="-"==i.substring(0,1)?"↑":"↓",s=r(""+n+"").addClass("sort-arrow");this.$el.find("#"+e+"-header").append(s),this.grid.set("sort_key",i),this.go_page_one(),this.execute()},set_categorical_filter:function(e,t){var i=this.grid.get("categorical_filters")[e],n=this.grid.get("filters")[e],s=this;this.$el.find("."+e+"-filter").each(function(){var a=r.trim(r(this).text()),o=i[a],l=o[e];if(l==t)r(this).empty(),r(this).addClass("current-filter"),r(this).append(a);else if(l==n){r(this).empty();var c=r(''+a+"");c.click(function(){s.set_categorical_filter(e,l)}),r(this).removeClass("current-filter"),r(this).append(c)}}),this.grid.add_filter(e,t),this.go_page_one(),this.execute()},set_page:function(e){var t=this;this.$el.find(".page-link").each(function(){var i,n=r(this).attr("id"),s=parseInt(n.split("-")[2],10),a=t.grid.get("cur_page");if(s===e)i=r(this).children().text(),r(this).empty(),r(this).addClass("inactive-link"),r(this).text(i);else if(s===a){i=r(this).text(),r(this).empty(),r(this).removeClass("inactive-link");var o=r(''+i+"");o.click(function(){t.set_page(s)}),r(this).append(o)}}),"all"===e?this.grid.set("cur_page",e):this.grid.set("cur_page",parseInt(e,10)),this.execute()},submit_operation:function(e,t){var i=r(e).val(),n=this.$el.find('input[name="id"]:checked').length;if(!n>0)return!1;var s=l.findWhere(this.grid.attributes.operations,{label:i});s&&!t&&(t=s.confirm||"");var a=[];return this.$el.find("input[name=id]:checked").each(function(){a.push(r(this).val())}),this.execute({operation:i,id:a,confirmation_text:t}),!0},check_all_items:function(){var e,t=document.getElementById("check_all"),i=document.getElementsByTagName("input"),n=0;if(t.checked===!0)for(e=0;e1)for(var r=o[1],l=r.split("&"),c=0;c'"),title:a.template(i("Copying history")+' "<%- name %>"'),submitLabel:i("Copy"),errorMessage:i("History could not be copied."),progressive:i("Copying history"),activeLabel:i("Copy only the active, non-deleted datasets"),allLabel:i("Copy all datasets including deleted ones"),anonWarning:i("As an anonymous user, unless you login or register, you will lose your current history ")+i("after copying this history. "),_template:a.template(["<% if( isAnon ){ %>",'
    ',"<%- anonWarning %>",i("You can"),' ',i("login here")," ",i("or")," ",' ',i("register here"),".","
    ","<% } %>","
    ",'
    ",'','","<% if( allowAll ){ %>","
    ","

    ",i("Choose which datasets from the original history to include:"),"

    ",'/>','',"
    ",'/>','',"<% } %>","
    "].join("")),_showAjaxIndicator:function(){var e='

    '+this.progressive+"...

    ";this.modal.$(".modal-body").empty().append(e).css({"margin-top":"8px"})},dialog:function(e,n,s){function l(){var i=e.$("#copy-modal-title").val();if(!i)return void e.$(".invalid-title").show();var s="copy-all"===e.$('input[name="copy-what"]:checked').val();e.$("button").prop("disabled",!0),c._showAjaxIndicator(),n.copy(!0,i,s).done(function(e){d.resolve(e)}).fail(function(e,a,o){var r={name:i,copyAllDatasets:s};t.ajaxErrorModal(n,e,r,c.errorMessage),d.rejectWith(d,arguments)}).done(function(){g&&e.hide()})}s=s||{};var c=this,d=o.Deferred(),h=s.nameFn||this.defaultName,u=h({name:n.get("name")}),p=s.allDatasets?"copy-all":"copy-non-deleted",f=!!a.isUndefined(s.allowAll)||s.allowAll,g=!!a.isUndefined(s.autoClose)||s.autoClose;this.modal=e;var m=s.closing_callback;return e.show(a.extend(s,{title:this.title({name:n.get("name")}),body:r(c._template({name:u,isAnon:Galaxy.user.isAnonymous(),allowAll:f,copyWhat:p,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:a.object([[i("Cancel"),function(){e.hide()}],[this.submitLabel,l]]),height:"auto",closing_events:!0,closing_callback:function(e){e&&d.reject({cancelled:!0}),m&&m(e)}})),e.$("#copy-modal-title").focus().select(),e.$("#copy-modal-title").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),l())}),d}},s=a.extend({},n,{defaultName:a.template("imported: <%- name %>"),title:a.template(i("Importing history")+' "<%- name %>"'),submitLabel:i("Import"),errorMessage:i("History could not be imported."),progressive:i("Importing history"),activeLabel:i("Import only the active, non-deleted datasets"),allLabel:i("Import all datasets including deleted ones"),anonWarning:i("As an anonymous user, unless you login or register, you will lose your current history ")+i("after importing this history. ")}),l=function(t,i){i=i||{};var a=window.parent.Galaxy.modal||new e.View({});return i.useImport?s.dialog(a,t,i):n.dialog(a,t,i)};return l}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a){n=[i(38),i(6),i(5)],s=function(e,t,i){"use strict";var n=e.DatasetListItemView,s=n.extend({className:n.prototype.className+" history-content",initialize:function(e,t){n.prototype.initialize.call(this,e,t)},toString:function(){var e=this.model?this.model+"":"(no model)";return"HDAListItemView("+e+")"}});return s.prototype.templates=function(){var e=t.wrapTemplate(['
    ','','
    ','<%- dataset.hid %> ','<%- dataset.name %>',"
    ","
    ",'',"<% _.each(_.sortBy(_.uniq(dataset.tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<%- tag.slice(5) %>',"<% } %>","<% }); %>","","
    "],"dataset"),s=a.extend({},n.prototype.templates.warnings,{hidden:t.wrapTemplate(["<% if( !dataset.visible ){ %>",'
    ',i("This dataset has been hidden"),"
    ","<% } %>"],"dataset")});return a.extend({},n.prototype.templates,{titleBar:e,warnings:s})}(),{HDAListItemView:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a){n=[i(77),i(83),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.DatasetAssociation,o=t.HistoryContentMixin,r=s.extend(i.mixin(o,{defaults:a.extend({},s.prototype.defaults,o.defaults,{history_content_type:"dataset",model_class:"HistoryDatasetAssociation"})}));return{HistoryDatasetAssociation:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a){n=[i(11),i(35),i(75),i(6),i(5)],s=function(e,t,i,n,s){"use strict";var o=t.DCListItemView,r=o.extend({className:o.prototype.className+" history-content",_setUpListeners:function(){o.prototype._setUpListeners.call(this),this.listenTo(this.model,{"change:tags change:populated change:visible":function(e,t){this.render()}})},_getFoldoutPanelClass:function(){switch(this.model.get("collection_type")){case"list":return i.ListCollectionView;case"paired":return i.PairCollectionView;case"list:paired":return i.ListOfPairsCollectionView;case"list:list":return i.ListOfListsCollectionView}throw new TypeError("Uknown collection_type: "+this.model.get("collection_type"))},_swapNewRender:function(t){o.prototype._swapNewRender.call(this,t);var i=this.model.get("populated")?e.OK:e.RUNNING;return this.$el.addClass("state-"+i),this.$el},toString:function(){var e=this.model?this.model+"":"(no model)";return"HDCAListItemView("+e+")"}});return r.prototype.templates=function(){var e=a.extend({},o.prototype.templates.warnings,{hidden:n.wrapTemplate(["<% if( !collection.visible ){ %>",'
    ',s("This collection has been hidden"),"
    ","<% } %>"],"collection")}),t=n.wrapTemplate(['
    ','','
    ','<%- collection.hid %> ','<%- collection.name %>',"
    ",'
    ','',"<% _.each(_.sortBy(_.uniq(collection.tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<%- tag.slice(5) %>',"<% } %>","<% }); %>","","
    "],"collection");return a.extend({},o.prototype.templates,{warnings:e,titleBar:t})}(),{HDCAListItemView:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a){n=[i(11),i(6),i(5)],s=function(e,t,i){"use strict";var n={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",hidden:function(){return!this.get("visible")},isVisible:function(e,t){var i=!0;return e||!this.get("deleted")&&!this.get("purged")||(i=!1),t||this.get("visible")||(i=!1),i},urlRoot:Galaxy.root+"api/histories/",url:function(){var e=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return e},hide:function(e){return this.get("visible")?this.save({visible:!1},e):a.when()},unhide:function(e){return this.get("visible")?a.when():this.save({visible:!0},e)},toString:function(){return[this.get("type_id"),this.get("hid"),this.get("name")].join(":")}};return{HistoryContentMixin:n}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(48),i(142),i(6),i(5),i(90)],s=function(e,t,i,n){"use strict";var s="list",l=a.View.extend(i.LoggableMixin).extend({_logNamespace:s,viewClass:e.ListItemView,collectionClass:a.Collection,tagName:"div",className:"list-panel",fxSpeed:"fast",emptyMsg:n("This list is empty"),noneFoundMsg:n("No matching items found"),searchPlaceholder:n("search"),initialize:function(e,t){e=e||{},e.logger&&(this.logger=e.logger),this.log(this+".initialize:",e),this.fxSpeed=o.has(e,"fxSpeed")?e.fxSpeed:this.fxSpeed,this.filters=[],this.searchFor=e.searchFor||"",this.selecting=void 0===e.selecting||e.selecting,this.selected=e.selected||[],this.lastSelected=null,this.dragItems=e.dragItems||!1,this.viewClass=e.viewClass||this.viewClass,this.views=[],this.collection=e.collection||this._createDefaultCollection(),this.filters=e.filters||[],this.$scrollContainer=e.$scrollContainer||this.$scrollContainer,this.title=e.title||"",this.subtitle=e.subtitle||"",this._setUpListeners()},_setUpListeners:function(){return this.off(),this.on({error:function(e,t,i,n,s){console.error(e,t,i,n,s)},loading:function(){this._showLoadingIndicator("loading...",40)},"loading-done":function(){this._hideLoadingIndicator(40)}}),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this._setUpCollectionListeners(),this._setUpViewListeners(),this},_createDefaultCollection:function(){return new this.collectionClass([])},_setUpCollectionListeners:function(){return this.log(this+"._setUpCollectionListeners",this.collection),this.stopListening(this.collection),this.listenTo(this.collection,{error:function(e,t,i,n,s){this.trigger("error",e,t,i,n,s)},update:function(e,t){var i=t.changes;return t.renderAll||i.added.length+i.removed.length>1?this.renderItems():1===i.added.length?this.addItemView(o.first(i.added),e,t):1===i.removed.length?this.removeItemView(o.first(i.removed),e,t):void 0}}),this},_setUpViewListeners:function(){this.log(this+"._setUpViewListeners"),this.on({"view:selected":function(e,t){if(t&&t.shiftKey&&this.lastSelected){var i=this.viewFromModelId(this.lastSelected);i&&this.selectRange(e,i)}else t&&t.altKey&&!this.selecting&&this.showSelectors();this.selected.push(e.model.id),this.lastSelected=e.model.id},"view:de-selected":function(e,t){this.selected=o.without(this.selected,e.model.id)}})},render:function(e){this.log(this+".render",e);var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){this.debug(this+"(ListPanel)._buildNewRender");var e=r(this.templates.el({},this));return this._renderControls(e),this._renderTitle(e),this._renderSubtitle(e),this._renderSearch(e),this.renderItems(e),e},_renderControls:function(e){this.debug(this+"(ListPanel)._renderControls");var t=r(this.templates.controls({},this));return e.find(".controls").replaceWith(t),t},_renderTitle:function(e){},_renderSubtitle:function(e){},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;i.log("_queueNewRender:",e,t),r(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",this.className).append(e.children()),this.selecting&&this.showSelectors(0),this},_setUpBehaviors:function(e){return e=e||this.$el,this.$controls(e).find("[title]").tooltip(),this._renderMultiselectActionMenu(e),this},_renderMultiselectActionMenu:function(e){e=e||this.$el;var t=e.find(".list-action-menu"),i=this.multiselectActions();if(!i.length)return t.empty();var s=r(['
    ','",'","
    "].join("")),a=i.map(function(e){var t=['
  • ',e.html,"
  • "].join("");return r(t).click(function(t){return t.preventDefault(),e.func(t)})});return s.find("ul").append(a),t.replaceWith(s),s},multiselectActions:function(){return[]},$scrollContainer:function(e){return(e||this.$el).parent().parent()},$controls:function(e){return(e||this.$el).find("> .controls")},$list:function(e){return(e||this.$el).find("> .list-items")},$messages:function(e){return(e||this.$el).find("> .controls .messages")},$emptyMessage:function(e){return(e||this.$el).find("> .empty-message")},renderItems:function(e){e=e||this.$el;var t=this;t.log(this+".renderItems",e);var i=t.$list(e);t.freeViews();var n=t._filterCollection();return t.views=n.map(function(e){var i=t._createItemView(e);return i}),i.empty(),t.views.length&&t._attachItems(e),t._renderEmptyMessage(e).toggle(!t.views.length),t.trigger("views:ready",t.views),t.views},_filterCollection:function(){var e=this;return e.collection.filter(o.bind(e._filterItem,e))},_filterItem:function(e){var t=this;return o.every(t.filters.map(function(t){return t.call(e)}))&&(!t.searchFor||e.matchesAll(t.searchFor))},_createItemView:function(e){var t=this._getItemViewClass(e),i=o.extend(this._getItemViewOptions(e),{model:e}),n=new t(i);return this._setUpItemViewListeners(n),n},_destroyItemView:function(e){this.stopListening(e),this.views=o.without(this.views,e)},_destroyItemViews:function(e){var t=this;return t.views.forEach(function(e){t.stopListening(e)}),t.views=[],t},freeViews:function(){return this._destroyItemViews()},_getItemViewClass:function(e){return this.viewClass},_getItemViewOptions:function(e){return{fxSpeed:this.fxSpeed,expanded:!1,selectable:this.selecting,selected:o.contains(this.selected,e.id),draggable:this.dragItems}},_setUpItemViewListeners:function(e){var t=this;return this.listenTo(e,"all",function(){var e=Array.prototype.slice.call(arguments,0);e[0]="view:"+e[0],t.trigger.apply(t,e)}),this.listenTo(e,"draggable:dragstart",function(e,t){var i={},n=this.getSelectedModels();i=n.length?n.toJSON():[t.model.toJSON()],e.dataTransfer.setData("text",JSON.stringify(i))},this),t},_attachItems:function(e){var t=this;return this.$list(e).append(this.views.map(function(e){return t._renderItemView$el(e)})),this},_renderItemView$el:function(e){return e.render(0).$el},_renderEmptyMessage:function(e){this.debug("_renderEmptyMessage",e,this.searchFor);var t=this.searchFor?this.noneFoundMsg:this.emptyMsg;return this.$emptyMessage(e).text(t)},expandAll:function(){o.each(this.views,function(e){e.expand()})},collapseAll:function(){o.each(this.views,function(e){e.collapse()})},addItemView:function(e,t,i){var n=this,s=n._filterCollection().indexOf(e);if(s!==-1){var a=n._createItemView(e);return r(a).queue("fx",[function(e){n.$emptyMessage().is(":visible")?n.$emptyMessage().fadeOut(n.fxSpeed,e):e()},function(e){n._attachView(a,s),e()}]),a}},_attachView:function(e,t,i){i=!!o.isUndefined(i)||i,t=t||0;var n=this;return n.views.splice(t,0,e),n._insertIntoListAt(t,n._renderItemView$el(e).hide()),n.trigger("view:attached",e),i?e.$el.slideDown(n.fxSpeed,function(){n.trigger("view:attached:rendered")}):(e.$el.show(),n.trigger("view:attached:rendered")),e},_insertIntoListAt:function(e,t){var i=this.$list();return 0===e?i.prepend(t):i.children().eq(e-1).after(t),t},removeItemView:function(e,t,i){var n=this,s=o.find(n.views,function(t){return t.model===e});if(s)return n.views=o.without(n.views,s),n.trigger("view:removed",s),r({}).queue("fx",[function(e){s.$el.fadeOut(n.fxSpeed,e)},function(e){s.remove(),n.trigger("view:removed:rendered"),n.views.length?e():n._renderEmptyMessage().fadeIn(n.fxSpeed,e)}]),s},viewFromModelId:function(e){return o.find(this.views,function(t){return t.model.id===e})},viewFromModel:function(e){return e?this.viewFromModelId(e.id):void 0},viewsWhereModel:function(e){return this.views.filter(function(t){return o.isMatch(t.model.attributes,e)})},viewRange:function(e,t){if(e===t)return e?[e]:[];var i=this.views.indexOf(e),n=this.views.indexOf(t);return i===-1||n===-1?i===n?[]:i===-1?[t]:[e]:i .controls .search-query");return i.val()!==e&&i.val(e),this},clearSearch:function(e){return this.searchFor="",this.trigger("search:clear",this),this.$("> .controls .search-query").val(""),this.renderItems(),this},THROTTLE_SELECTOR_FX_AT:20,showSelectors:function(e){e=void 0!==e?e:this.fxSpeed,this.selecting=!0,this.$(".list-actions").slideDown(e),e=this.views.length>=this.THROTTLE_SELECTOR_FX_AT?0:e,o.each(this.views,function(t){t.showSelector(e)})},hideSelectors:function(e){e=void 0!==e?e:this.fxSpeed,this.selecting=!1,this.$(".list-actions").slideUp(e),e=this.views.length>=this.THROTTLE_SELECTOR_FX_AT?0:e,o.each(this.views,function(t){t.hideSelector(e)}),this.selected=[],this.lastSelected=null},toggleSelectors:function(){this.selecting?this.hideSelectors():this.showSelectors()},selectAll:function(e){o.each(this.views,function(t){t.select(e)})},deselectAll:function(e){this.lastSelected=null,o.each(this.views,function(t){t.deselect(e)})},selectRange:function(e,t){var i=this.viewRange(e,t);return o.each(i,function(e){e.select()}),i},getSelectedViews:function(){return o.filter(this.views,function(e){return e.selected})},getSelectedModels:function(){return new this.collection.constructor(o.map(this.getSelectedViews(),function(e){return e.model}))},_showLoadingIndicator:function(e,i,n){this.debug("_showLoadingIndicator",this.indicator,e,i,n),i=void 0!==i?i:this.fxSpeed,this.indicator||(this.indicator=new t(this.$el),this.debug("\t created",this.indicator)),this.$el.is(":visible")?(this.$el.fadeOut(i),this.indicator.show(e,i,n)):this.indicator.show(0,n)},_hideLoadingIndicator:function(e,t){this.debug("_hideLoadingIndicator",this.indicator,e,t),e=void 0!==e?e:this.fxSpeed,this.indicator&&this.indicator.hide(e,t)},scrollPosition:function(){return this.$scrollContainer().scrollTop()},scrollTo:function(e,t){return t=t||0,this.$scrollContainer().animate({scrollTop:e},t),this},scrollToTop:function(e){return this.scrollTo(0,e)},scrollToItem:function(e,t){return e?this:this},scrollToId:function(e,t){return this.scrollToItem(this.viewFromModelId(e),t)},events:{"click .select-all":"selectAll","click .deselect-all":"deselectAll"},toString:function(){return"ListPanel("+this.collection+")"}});l.prototype.templates=function(){var e=i.wrapTemplate(["
    ",'
    ','
    ','
    ',"
    "]),t=i.wrapTemplate(['
    ','
    ','
    <%- view.title %>
    ',"
    ",'
    <%- view.subtitle %>
    ','
    ','
    ','",'
    ','
    ','",'","
    ",'
    ',"
    ","
    ","
    "]); return{el:e,controls:t}}();var c=l.extend({modelCollectionKey:"contents",initialize:function(e){l.prototype.initialize.call(this,e),this.selecting=void 0!==e.selecting&&e.selecting,this.setModel(this.model,e)},setModel:function(e,t){if(t=t||{},this.debug(this+".setModel:",e,t),this.freeModel(),this.freeViews(),e){var i=this.model?this.model.get("id"):null;this.model=e,this.logger&&(this.model.logger=this.logger),this._setUpModelListeners(),this.stopListening(this.collection),this.collection=this.model[this.modelCollectionKey]||t.collection||this._createDefaultCollection(),this._setUpCollectionListeners(),i&&e.get("id")!==i&&this.trigger("new-model",this)}return this},freeModel:function(){return this.model&&this.stopListening(this.model),this},_setUpModelListeners:function(){return this.log(this+"._setUpModelListeners",this.model),this.listenTo(this.model,"error",function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("error"),this.trigger.apply(this,e)},this),this.logger&&this.listenTo(this.model,"all",function(e){this.info(this+"(model)",e,arguments)}),this},_renderControls:function(e){this.debug(this+"(ModelListPanel)._renderControls");var t=this.model?this.model.toJSON():{},i=r(this.templates.controls(t,this));return e.find(".controls").replaceWith(i),i},toString:function(){return"ModelListPanel("+this.model+")"}});return c.prototype.templates=function(){var e=i.wrapTemplate(['
    ','
    ','
    <%- model.name %>
    ',"
    ",'
    <%- view.subtitle %>
    ','
    ','
    ','",'
    ','
    ','",'","
    ",'
    ',"
    ","
    ","
    "]);return o.extend(o.clone(l.prototype.templates),{controls:e})}(),{ListPanel:l,ModelListPanel:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},,function(e,t,i){var n,s;(function(a,o){n=[i(5)],s=function(e){"use strict";function t(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(),a("
    ").addClass("error-details").hide().appendTo(Galaxy.modal.$(".modal-content")).append([a("

    ").text(h),a("

    ").text(JSON.stringify(n,null,"  "))]),a('").appendTo(Galaxy.modal.$(".buttons")).click(function(){Galaxy.modal.$(".error-details").toggle()})),Galaxy.modal}function i(i,n,s){if(i){if(i=e(i),n=e(n)||e("Error:"),window.Galaxy&&Galaxy.modal)return t(i,n,s);alert(n+"\n\n"+i),console.log("error details:",JSON.stringify(s))}}function n(){return i(e("You appear to be offline. Please check your connection and try again."),e("Offline?"))}function s(){return i(e("Galaxy is currently unreachable. Please try again in a few minutes.")+" "+c,e("Cannot connect to Galaxy"))}function r(t,n,s,a,o){a=a||d,a+=" "+c,o=o||e("An error occurred");var r=l(t,n,s);return i(a,o,r)}function l(e,t,i){return{raven:o.result(window.Raven,"lastEventId"),userAgent:navigator.userAgent,onLine:navigator.onLine,version:o.result(Galaxy.config,"version_major"),xhr:o.omit(t,o.functions(t)),options:o.omit(i,"xhr"),url:o.result(Galaxy.lastAjax,"url"),data:o.result(Galaxy.lastAjax,"data"),model:o.result(e,"toJSON",e+""),user:o.omit(o.result(Galaxy.user,"toJSON"),"email")}}var c=e("Please contact a Galaxy administrator if the problem persists."),d=e("An error occurred while updating information with the server."),h=e("The following information can assist the developers in finding the source of the error:");return{errorModal:i,offlineErrorModal:n,badGatewayErrorModal:s,ajaxErrorModal:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},,,function(e,t,i){var n,s,a;(function(i,o){!function(i){s=[],n=i,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(function(){i.fn.extend({hoverhighlight:function(e,t){return e=e||"body",this.length?(o(this).each(function(){var i=o(this),n=i.data("target");n&&i.mouseover(function(i){o(n,e).css({background:t})}).mouseout(function(e){o(n).css({background:""})})}),this):this}})})}).call(t,i(1),i(1))},function(e,t,i){var n,s,a;(function(i,o){!function(i){s=[],n=i,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(function(){function e(e,n){function s(e){var t=i(this).parent().children("input");t.val("").trigger("searchInput.clear").blur(),n.onclear()}function a(e,t){return t?(i(this).trigger("search.search",t),void("function"==typeof n.onfirstsearch&&g?(g=!1,n.onfirstsearch(t)):n.onsearch(t))):s()}function r(){return['"].join("")}function l(){return i(r()).focus(function(e){i(this).select()}).keyup(function(e){if(e.preventDefault(),e.stopPropagation(),e.which===u&&n.escWillClear)s.call(this,e);else{var t=i(this).val();(e.which===p||n.minSearchLen&&t.length>=n.minSearchLen)&&a.call(this,e,t)}}).val(n.initialVal)}function c(){return i([''].join("")).tooltip({placement:"bottom"}).click(function(e){s.call(this,e)})}function d(){return i([''].join("")).hide().tooltip({placement:"bottom"})}function h(){f.find(".search-loading").toggle(),f.find(".search-clear").toggle()}var u=27,p=13,f=i(e),g=!0,m={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onfirstsearch:null,onsearch:function(e){},minSearchLen:0,escWillClear:!0,oninit:function(){}};return"string"===o.type(n)?("toggle-loading"===n&&h(),f):("object"===o.type(n)&&(n=o.extend(!0,{},m,n)),f.addClass("search-input").prepend([l(),c(),d()]))}var t=window._l||function(e){return e};o.fn.extend({searchInput:function(t){return this.each(function(){return e(this,t)})}})})}).call(t,i(1),i(1))},,function(e,t,i){var n,s;n=[],s=function(){function e(e,t){var i=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",s=t.toString().toLowerCase()||"",a=String.fromCharCode(0),o=n.replace(i,a+"$1"+a).split(a),r=s.replace(i,a+"$1"+a).split(a),l=new Date(n).getTime(),c=l?new Date(s).getTime():null;if(c){if(lc)return 1}for(var d,h,u=0,p=Math.max(o.length,r.length);uh)return 1}return 0}return e}.apply(t,n),!(void 0!==s&&(e.exports=s))},,,function(e,t,i){(function(t){var n=i(7),s=i(125);CurrentHistoryView=i(122).CurrentHistoryView,_l=i(5);var a=t.View.extend({initialize:function(e,i){var s=this;this.userIsAnonymous=Galaxy.user.isAnonymous(),this.allow_user_dataset_purge=i.config.allow_user_dataset_purge,this.root=i.root,this.historyView=new CurrentHistoryView({className:CurrentHistoryView.prototype.className+" middle",purgeAllowed:this.allow_user_dataset_purge,linkTarget:"galaxy_main"}),Galaxy.currHistoryPanel=this.historyView,Galaxy.currHistoryPanel.listenToGalaxy(Galaxy),this.buttonRefresh=new n.ButtonLink({id:"history-refresh-button",title:"Refresh history",cls:"panel-header-button",icon:"fa fa-refresh",onclick:function(){s.historyView.loadCurrentHistory()}}),this.buttonOptions=new n.ButtonLink({id:"history-options-button",title:"History options",cls:"panel-header-button",target:"galaxy_main",icon:"fa fa-cog",href:this.root+"root/history_options"}),this.buttonViewMulti=new n.ButtonLink({id:"history-view-multi-button",title:"View all histories",cls:"panel-header-button",icon:"fa fa-columns",href:this.root+"history/view_multiple"}),this.model=new t.Model({cls:"history-right-panel",title:_l("History"),buttons:[this.buttonRefresh,this.buttonOptions,this.buttonViewMulti]}),this.setElement(this._template()),this.historyView.setElement(this.$el),this.historyView.connectToQuotaMeter(Galaxy.quotaMeter),this.historyView.loadCurrentHistory(),Galaxy.listenTo(this.historyView,"history-size-change",function(){Galaxy.user.fetch({url:Galaxy.user.urlRoot()+"/"+(Galaxy.user.id||"current")})})},render:function(){this.optionsMenu=s(this.buttonOptions.$el,{anonymous:this.userIsAnonymous,purgeAllowed:this.allow_user_dataset_purge,root:this.root}),this.buttonViewMulti.$el[this.userIsAnonymous?"hide":"show"]()},_template:function(e){return['
    '].join("")},toString:function(){return"historyPanel"}});e.exports=a}).call(t,i(3))},function(e,t,i){(function(t,n){var s=i(51),a=i(134),o=i(5),r=t.View.extend({initialize:function(e,i){var n=i.config;this.root=i.root,this.stored_workflow_menu_entries=n.stored_workflow_menu_entries||[];var r=new s.ToolSearch({hidden:!1}),l=new s.ToolCollection(n.toolbox);this.tool_panel=new s.ToolPanel({tool_search:r,tools:l,layout:n.toolbox_in_panel}),this.tool_panel_view=new s.ToolPanelView({model:this.tool_panel}),this.upload_button=new a({nginx_upload_path:n.nginx_upload_path,ftp_upload_site:n.ftp_upload_site,default_genome:n.default_genome,default_extension:n.default_extension}),Galaxy.upload=this.upload_button,this.model=new t.Model({title:o("Tools"),buttons:[this.upload_button]}),this.setElement(this._template())},render:function(){var e=this;this.tool_panel.get("layout").size()>0&&(this.$el.prepend(this.tool_panel_view.$el),this.tool_panel_view.render()),e.$("#internal-workflows").append(e._templateAllWorkflow({title:o("All workflows"),href:"workflow"})),n.each(this.stored_workflow_menu_entries,function(t){e.$("#internal-workflows").append(e._templateTool({title:t.stored_workflow.name,href:"workflow/run?id="+t.encoded_stored_workflow_id}))})},_templateTool:function(e){return['"].join("")},_templateAllWorkflow:function(e){return['"].join("")},_template:function(){return['
    ','",'
    ','
    ','
    ',"",o("Workflows"),"","
    ",'
    ','
    ',"
    ","
    "].join("")},toString:function(){return"toolPanel"}});e.exports=r}).call(t,i(3),i(2))},,,,,,,,,,,,,,,,,function(e,t,i){var n,s;(function(a,o){n=[i(35),i(76),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.DCListItemView,r=s.extend({initialize:function(e){s.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCListItemEdit("+e+")"}}),l=e.DCEListItemView,c=l.extend({initialize:function(e){l.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCEListItemEdit("+e+")"}}),d=t.DatasetListItemEdit.extend({initialize:function(e){t.DatasetListItemEdit.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):a.when()},_renderDeleteButton:function(){return null},toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetDCEListItemEdit("+e+")"}});d.prototype.templates=function(){return o.extend({},t.DatasetListItemEdit.prototype.templates,{titleBar:e.DatasetDCEListItemView.prototype.templates.titleBar})}();var h=e.NestedDCDCEListItemView.extend({toString:function(){var e=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemEdit("+e+")"}});return{DCListItemEdit:r,DCEListItemEdit:c,DatasetDCEListItemEdit:d,NestedDCDCEListItemEdit:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},function(e,t,i){var n,s;n=[i(75),i(36),i(113),i(6),i(49),i(17),i(5),i(16)],s=function(e,t,i,n,s,a,o){"use strict";var r=e.CollectionView,l=r.extend({DatasetDCEViewClass:i.DatasetDCEListItemEdit,NestedDCDCEViewClass:i.NestedDCDCEListItemEdit,initialize:function(e){r.prototype.initialize.call(this,e)},_setUpBehaviors:function(e){if(e=e||this.$el,r.prototype._setUpBehaviors.call(this,e),this.model&&Galaxy.user&&!Galaxy.user.isAnonymous()){this.tagsEditorShown=!0;var t=this,i="> .controls .name";e.find(i).attr("title",o("Click to rename collection")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(e){var n=t.model.get("name");e&&e!==n?(t.$el.find(i).text(e),t.model.save({name:e}).fail(function(){t.$el.find(i).text(t.model.previous("name"))})):t.$el.find(i).text(n)}}),this.tagsEditor=new s.TagsEditor({model:this.model,el:e.find(".tags-display"),onshowFirstTime:function(){this.render()},usePrompt:!1}),this.tagsEditor.toggle(!0)}},toString:function(){return"CollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),c=l.extend({DatasetDCEViewClass:i.DatasetDCEListItemEdit,toString:function(){return"ListCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),d=c.extend({toString:function(){return"PairCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),h=d.extend({_setUpBehaviors:function(e){r.prototype._setUpBehaviors.call(this,e)},toString:function(){return"NestedPairCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),u=l.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemEdit.extend({foldoutPanelClass:h}),toString:function(){return"ListOfPairsCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),p=l.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemEdit.extend({foldoutPanelClass:h}),toString:function(){return"ListOfListsCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}});return{CollectionViewEdit:l,ListCollectionViewEdit:c,PairCollectionViewEdit:d,ListOfPairsCollectionViewEdit:u,ListOfListsCollectionViewEdit:p}}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(146),i(92),i(74),i(6),i(5),i(89)],s=function(e,t,i,n,s){"use strict";function c(e){function t(){return i.length||(i=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]),i}e=e||{},e.createPair=e.createPair||function(e){e=e||{};var t=e.listA.splice(e.indexA,1)[0],i=e.listB.splice(e.indexB,1)[0],n=e.listB.indexOf(t),s=e.listA.indexOf(i);return n!==-1&&e.listB.splice(n,1),s!==-1&&e.listA.splice(s,1),this._pair(t,i,{silent:!0})};var i=[];return e.preprocessMatch=e.preprocessMatch||function(e){var i=t.call(this);return o.extend(e,{matchTo:e.matchTo.name.replace(i[0],""),possible:e.possible.name.replace(i[1],"")})},function(t){this.debug("autopair _strategy ---------------------------"),t=t||{};var i,n=t.listA,s=t.listB,a=0,o={score:0,index:null},r=[];for(this.debug("starting list lens:",n.length,s.length),this.debug("bestMatch (starting):",JSON.stringify(o,null," "));a=d?r.push(e.createPair.call(this,{listA:n,indexA:a,listB:s,indexB:o.index})):a+=1,!n.length||!s.length)return r}return this.debug("paired:",JSON.stringify(r,null," ")),this.debug("autopair _strategy ---------------------------"),r}}function d(e,t){var i=e.toJSON();return f(i,{historyId:e.historyId,defaultHideSourceItems:t})}var h="collections",u=a.View.extend(n.LoggableMixin).extend({_logNamespace:h,tagName:"li",className:"dataset paired",initialize:function(e){this.pair=e.pair||{}},template:o.template(['<%- pair.forward.name %>','','<%- pair.name %>',"",'<%- pair.reverse.name %>'].join("")),render:function(){return this.$el.attr("draggable",!0).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container"),this},events:{dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(e){e.currentTarget.style.opacity="0.4",e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.pair)),this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(e){e.currentTarget.style.opacity="1.0",this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"PairView("+this.pair.name+")"}}),p=a.View.extend(n.LoggableMixin).extend(i.CollectionCreatorMixin).extend({_logNamespace:h,className:"list-of-pairs-collection-creator collection-creator flex-row-container",initialize:function(e){this.metric("PairedCollectionCreator.initialize",e),e=o.defaults(e,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:!0,strategy:"lcs",matchPercentage:.9,twoPassAutopairing:!0}),this.initialList=e.datasets,this.historyId=e.historyId,this.filters=this.commonFilters[e.filters]||this.commonFilters[this.DEFAULT_FILTERS],o.isArray(e.filters)&&(this.filters=e.filters),this.automaticallyPair=e.automaticallyPair,this.strategy=this.strategies[e.strategy]||this.strategies[this.DEFAULT_STRATEGY],o.isFunction(e.strategy)&&(this.strategy=e.strategy),this.matchPercentage=e.matchPercentage,this.twoPassAutopairing=e.twoPassAutopairing,this.removeExtensions=!0,this.oncancel=e.oncancel,this.oncreate=e.oncreate,this.autoscrollDist=e.autoscrollDist||24,this.unpairedPanelHidden=!1,this.pairedPanelHidden=!1,this.$dragging=null,this.blocking=!1,this._setUpCommonSettings(e),this._setUpBehaviors(),this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[],this.unpaired=[],this.selectedIds=[],this._sortInitialList(),this._ensureIds(),this.unpaired=this.initialList.slice(0),this.automaticallyPair&&(this.autoPair(),this.once("rendered:initial",function(){this.trigger("autopair")}))},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(e){return e.sort(function(e,i){return t(e.name,i.name)}),e},_ensureIds:function(){return this.initialList.forEach(function(e){e.hasOwnProperty("id")||(e.id=o.uniqueId())}),this.initialList},_splitByFilters:function(){function e(e,t){return t.test(e.name)}var t=this.filters.map(function(e){return new RegExp(e)}),i=[[],[]];return this.unpaired.forEach(function(n){t.forEach(function(t,s){e(n,t)&&i[s].push(n)})}),i},_addToUnpaired:function(e){var i=function(n,s){if(n===s)return n;var a=Math.floor((s-n)/2)+n,o=t(e.name,this.unpaired[a].name);if(o<0)return i(n,a);if(o>0)return i(a+1,s);for(;this.unpaired[a]&&this.unpaired[a].name===e.name;)a++;return a}.bind(this);this.unpaired.splice(i(0,this.unpaired.length),0,e)},autoPair:function(e){var t=this._splitByFilters(),i=[];return this.twoPassAutopairing&&(i=this.autopairSimple({listA:t[0],listB:t[1]}),t=this._splitByFilters()),e=e||this.strategy,t=this._splitByFilters(),i=i.concat(this[e].call(this,{listA:t[0],listB:t[1]}))},autopairSimple:c({scoreThreshold:function(){return 1},match:function(e){return e=e||{},e.matchTo===e.possible?{index:e.index,score:1}:e.bestMatch}}),autopairLevenshtein:c({scoreThreshold:function(){return this.matchPercentage},match:function(t){t=t||{};var i=e(t.matchTo,t.possible),n=1-i/Math.max(t.matchTo.length,t.possible.length);return n>t.bestMatch.score?{index:t.index,score:n}:t.bestMatch}}),autopairLCS:c({scoreThreshold:function(){return this.matchPercentage},match:function(e){e=e||{};var t=this._naiveStartingAndEndingLCS(e.matchTo,e.possible).length,i=t/Math.max(e.matchTo.length,e.possible.length);return i>e.bestMatch.score?{index:e.index,score:i}:e.bestMatch}}),_naiveStartingAndEndingLCS:function(e,t){for(var i="",n="",s=0,a=0;s=0&&a>=0&&e[s]===t[a];)n=[e[s],n].join(""),s-=1,a-=1;return i+n},_pair:function(e,t,i){i=i||{},this.debug("_pair:",e,t);var n=this._createPair(e,t,i.name);return this.paired.push(n),this.unpaired=o.without(this.unpaired,e,t),i.silent||this.trigger("pair:new",n),n},_createPair:function(e,t,i){if(!e||!t||e===t)throw new Error("Bad pairing: "+[JSON.stringify(e),JSON.stringify(t)]);return i=i||this._guessNameForPair(e,t),{forward:e,name:i,reverse:t}},_guessNameForPair:function(e,t,i){i=void 0!==i?i:this.removeExtensions;var n=e.name,s=t.name,a=this._naiveStartingAndEndingLCS(n.replace(new RegExp(this.filters[0]),""),s.replace(new RegExp(this.filters[1]),""));if(i){var o=a.lastIndexOf(".");if(o>0){var r=a.slice(o,a.length);a=a.replace(r,""),n=n.replace(r,""),s=s.replace(r,"")}}return a||n+" & "+s},_unpair:function(e,t){if(t=t||{},!e)throw new Error("Bad pair: "+JSON.stringify(e));return this.paired=o.without(this.paired,e),this._addToUnpaired(e.forward),this._addToUnpaired(e.reverse),t.silent||this.trigger("pair:unpair",[e]),e},unpairAll:function(){for(var e=[];this.paired.length;)e.push(this._unpair(this.paired[0],{silent:!0}));this.trigger("pair:unpair",e)},_pairToJSON:function(e,t){return t=t||"hda",{collection_type:"paired",src:"new_collection",name:e.name,element_identifiers:[{name:"forward",id:e.forward.id,src:t},{name:"reverse",id:e.reverse.id,src:t}]}},createList:function(e){var t=this,i=Galaxy.root+"api/histories/"+this.historyId+"/contents/dataset_collections",n={type:"dataset_collection",collection_type:"list:paired",hide_source_items:t.hideOriginals||!1,name:o.escape(e||t.$(".collection-name").val()),element_identifiers:t.paired.map(function(e){return t._pairToJSON(e)})};return t.blocking=!0,r.ajax(i,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(n)}).always(function(){t.blocking=!1}).fail(function(e,i,n){t._ajaxErrHandler(e,i,n)}).done(function(e,i,n){t.trigger("collection:created",e,i,n),t.metric("collection:created",e),"function"==typeof t.oncreate&&t.oncreate.call(this,e,i,n)})},_ajaxErrHandler:function(e,t,i){this.error(e,t,i);var n=s("An error occurred while creating this collection");e&&(n+=0===e.readyState&&0===e.status?": "+s("Galaxy could not be reached and may be updating.")+s(" Try again in a few minutes."):e.responseJSON?"
    "+JSON.stringify(e.responseJSON)+"
    ":": "+i),creator._showAlert(n,"alert-danger")},render:function(e,t){return this.$el.empty().html(this.templates.main()),this._renderHeader(e),this._renderMiddle(e),this._renderFooter(e),this._addPluginComponents(),this.trigger("rendered",this),this},_renderHeader:function(e,t){var i=this.$(".header").empty().html(this.templates.header()).find(".help-content").prepend(l(this.templates.helpContent()));return this._renderFilters(),i},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(e,t){var i=this.$(".middle").empty().html(this.templates.middle());return this.unpairedPanelHidden?this.$(".unpaired-columns").hide():this.pairedPanelHidden&&this.$(".paired-columns").hide(),this._renderUnpaired(),this._renderPaired(),i},_renderUnpaired:function(e,t){var i,n,a=this,o=[],r=this._splitByFilters();return this.$(".forward-column .title").text([r[0].length,s("unpaired forward")].join(" ")),this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-r[0].length)),this.$(".reverse-column .title").text([r[1].length,s("unpaired reverse")].join(" ")),this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-r[1].length)),this.$(".unpaired-columns .column-datasets").empty(),this.$(".autopair-link").toggle(0!==this.unpaired.length),0===this.unpaired.length?void this._renderUnpairedEmpty():(n=r[1].map(function(e,t){return void 0!==r[0][t]&&r[0][t]!==e&&o.push(a._renderPairButton()),a._renderUnpairedDataset(e)}),i=r[0].map(function(e){return a._renderUnpairedDataset(e)}),i.length||n.length?(this.$(".unpaired-columns .forward-column .column-datasets").append(i).add(this.$(".unpaired-columns .paired-column .column-datasets").append(o)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(n)),void this._adjUnpairedOnScrollbar()):void this._renderUnpairedNotShown())},_renderUnpairedDisplayStr:function(e){return["(",e," ",s("filtered out"),")"].join("")},_renderUnpairedDataset:function(e){return l("
  • ").attr("id","dataset-"+e.id).addClass("dataset unpaired").attr("draggable",!0).addClass(e.selected?"selected":"").append(l("").addClass("dataset-name").text(e.name)).data("dataset",e)},_renderPairButton:function(){return l("
  • ").addClass("dataset unpaired").append(l("").addClass("dataset-name").text(s("Pair these datasets")))},_renderUnpairedEmpty:function(){var e=l('
    ').text("("+s("no remaining unpaired datasets")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(e),e},_renderUnpairedNotShown:function(){var e=l('
    ').text("("+s("no datasets were found matching the current filters")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(e),e},_adjUnpairedOnScrollbar:function(){var e=this.$(".unpaired-columns").last(),t=this.$(".unpaired-columns .reverse-column .dataset").first();if(t.length){var i=e.offset().left+e.outerWidth(),n=t.offset().left+t.outerWidth(),s=Math.floor(i)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",s>0?s:0)}},_renderPaired:function(e,t){if(this.$(".paired-column-title .title").text([this.paired.length,s("paired")].join(" ")),this.$(".unpair-all-link").toggle(0!==this.paired.length),0===this.paired.length)return void this._renderPairedEmpty();this.$(".remove-extensions-link").show(),this.$(".paired-columns .column-datasets").empty();var i=this;this.paired.forEach(function(e,t){var n=new u({pair:e});i.$(".paired-columns .column-datasets").append(n.render().$el).append(['"].join(""))})},_renderPairedEmpty:function(){var e=l('
    ').text("("+s("no paired datasets yet")+")");return this.$(".paired-columns .column-datasets").empty().prepend(e),e},footerSettings:{".hide-originals":"hideOriginals",".remove-extensions":"removeExtensions"},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link"),this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(e){function t(e,t){return['"].join("")}var i=l(o.template(['
    ','
    ',s("Choose from the following filters to change which unpaired reads are shown in the display"),":
    ",o.values(this.commonFilters).map(function(e){return t(e[0],e[1])}).join(""),"
    "].join(""))({}));return this.$(e).popover({container:".collection-creator",placement:"bottom",html:!0,content:i})},_validationWarning:function(e,t){var i="validation-warning";"name"===e&&(e=this.$(".collection-name").add(this.$(".collection-name-prompt")),this.$(".collection-name").focus().select()),t?(e=e||this.$("."+i),e.removeClass(i)):e.addClass(i)},_setUpBehaviors:function(){return this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("pair:new",function(){this._renderUnpaired(),this._renderPaired(),this.$(".paired-columns").scrollTop(8e6)}),this.on("pair:unpair",function(e){this._renderUnpaired(),this._renderPaired(),this.splitView()}),this.on("filter-change",function(){this.filters=[this.$(".forward-unpaired-filter input").val(),this.$(".reverse-unpaired-filter input").val()],this.metric("filter-change",this.filters),this._renderFilters(),this._renderUnpaired()}),this.on("autopair",function(){this._renderUnpaired(),this._renderPaired();var e,t=null;this.paired.length?(t="alert-success",e=this.paired.length+" "+s("pairs created"),this.unpaired.length||(e+=": "+s("all datasets have been successfully paired"),this.hideUnpaired(),this.$(".collection-name").focus())):e=s(["Could not automatically create any pairs from the given dataset names.","You may want to choose or enter different filters and try auto-pairing again.","Close this message using the X on the right to view more help."].join(" ")),this._showAlert(e,t)}),this},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .forward-column .column-title":"_clickShowOnlyUnpaired","click .reverse-column .column-title":"_clickShowOnlyUnpaired","click .unpair-all-link":"_clickUnpairAll","change .forward-unpaired-filter input":function(e){this.trigger("filter-change")},"focus .forward-unpaired-filter input":function(e){l(e.currentTarget).select()},"click .autopair-link":"_clickAutopair","click .choose-filters .filter-choice":"_clickFilterChoice","click .clear-filters-link":"_clearFilters","change .reverse-unpaired-filter input":function(e){this.trigger("filter-change")},"focus .reverse-unpaired-filter input":function(e){l(e.currentTarget).select()},"click .forward-column .dataset.unpaired":"_clickUnpairedDataset","click .reverse-column .dataset.unpaired":"_clickUnpairedDataset","click .paired-column .dataset.unpaired":"_clickPairRow","click .unpaired-columns":"clearSelectedUnpaired","mousedown .unpaired-columns .dataset":"_mousedownUnpaired","click .paired-column-title":"_clickShowOnlyPaired","mousedown .flexible-partition-drag":"_startPartitionDrag","click .paired-columns .dataset.paired":"selectPair","click .paired-columns":"clearSelectedPaired","click .paired-columns .pair-name":"_clickPairName","click .unpair-btn":"_clickUnpair","dragover .paired-columns .column-datasets":"_dragoverPairedColumns","drop .paired-columns .column-datasets":"_dropPairedColumns","pair.dragstart .paired-columns .column-datasets":"_pairDragstart","pair.dragend .paired-columns .column-datasets":"_pairDragend","change .remove-extensions":function(e){this.toggleExtensions()},"change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},_clickShowOnlyUnpaired:function(e){this.$(".paired-columns").is(":visible")?this.hidePaired():this.splitView()},_clickShowOnlyPaired:function(e){this.$(".unpaired-columns").is(":visible")?this.hideUnpaired():this.splitView()},hideUnpaired:function(e,t){this.unpairedPanelHidden=!0,this.pairedPanelHidden=!1,this._renderMiddle(e,t)},hidePaired:function(e,t){this.unpairedPanelHidden=!1,this.pairedPanelHidden=!0,this._renderMiddle(e,t)},splitView:function(e,t){return this.unpairedPanelHidden=this.pairedPanelHidden=!1,this._renderMiddle(e,t),this},_clickUnpairAll:function(e){this.metric("unpairAll"),this.unpairAll()},_clickAutopair:function(e){var t=this.autoPair(); this.metric("autopair",t.length,this.unpaired.length),this.trigger("autopair")},_clickFilterChoice:function(e){var t=l(e.currentTarget);this.$(".forward-unpaired-filter input").val(t.data("forward")),this.$(".reverse-unpaired-filter input").val(t.data("reverse")),this._hideChooseFilters(),this.trigger("filter-change")},_hideChooseFilters:function(){this.$(".choose-filters-link").popover("hide"),this.$(".popover").css("display","none")},_clearFilters:function(e){this.$(".forward-unpaired-filter input").val(""),this.$(".reverse-unpaired-filter input").val(""),this.trigger("filter-change")},_clickUnpairedDataset:function(e){return e.stopPropagation(),this.toggleSelectUnpaired(l(e.currentTarget))},toggleSelectUnpaired:function(e,t){t=t||{};var i=e.data("dataset"),n=void 0!==t.force?t.force:!e.hasClass("selected");return e.length&&void 0!==i?(n?(e.addClass("selected"),t.waitToPair||this.pairAllSelected()):e.removeClass("selected"),e):e},pairAllSelected:function(e){e=e||{};var t=this,i=[],n=[],s=[];return t.$(".unpaired-columns .forward-column .dataset.selected").each(function(){i.push(l(this).data("dataset"))}),t.$(".unpaired-columns .reverse-column .dataset.selected").each(function(){n.push(l(this).data("dataset"))}),i.length=n.length=Math.min(i.length,n.length),i.forEach(function(e,i){try{s.push(t._pair(e,n[i],{silent:!0}))}catch(e){t.error(e)}}),s.length&&!e.silent&&this.trigger("pair:new",s),s},clearSelectedUnpaired:function(){this.$(".unpaired-columns .dataset.selected").removeClass("selected")},_mousedownUnpaired:function(e){if(e.shiftKey){var t=this,i=l(e.target).addClass("selected"),n=function(e){t.$(e.target).filter(".dataset").addClass("selected")};i.parent().on("mousemove",n),l(document).one("mouseup",function(e){i.parent().off("mousemove",n),t.pairAllSelected()})}},_clickPairRow:function(e){var t=l(e.currentTarget).index(),i=l(".unpaired-columns .forward-column .dataset").eq(t).data("dataset"),n=l(".unpaired-columns .reverse-column .dataset").eq(t).data("dataset");this._pair(i,n)},_startPartitionDrag:function(e){function t(e){n.$(".flexible-partition-drag").css("color",""),l("body").css("cursor","").unbind("mousemove",i)}function i(e){var t=e.pageY-s;n.adjPartition(t)||l("body").trigger("mouseup"),n._adjUnpairedOnScrollbar(),s+=t}var n=this,s=e.pageY;l("body").css("cursor","ns-resize"),n.$(".flexible-partition-drag").css("color","black"),l("body").mousemove(i),l("body").one("mouseup",t)},adjPartition:function(e){var t=this.$(".unpaired-columns"),i=this.$(".paired-columns"),n=parseInt(t.css("height"),10),s=parseInt(i.css("height"),10);n=Math.max(10,n+e),s-=e;var a=e<0;if(a){if(this.unpairedPanelHidden)return!1;if(n<=10)return this.hideUnpaired(),!1}else this.unpairedPanelHidden&&(t.show(),this.unpairedPanelHidden=!1);if(a)this.pairedPanelHidden&&(i.show(),this.pairedPanelHidden=!1);else{if(this.pairedPanelHidden)return!1;if(s<=15)return this.hidePaired(),!1}return t.css({height:n+"px",flex:"0 0 auto"}),!0},selectPair:function(e){e.stopPropagation(),l(e.currentTarget).toggleClass("selected")},clearSelectedPaired:function(e){this.$(".paired-columns .dataset.selected").removeClass("selected")},_clickPairName:function(e){e.stopPropagation();var t=l(e.currentTarget),i=t.parent().parent(),n=i.index(".dataset.paired"),s=this.paired[n],a=prompt("Enter a new name for the pair:",s.name);a&&(s.name=a,s.customizedName=!0,t.text(s.name))},_clickUnpair:function(e){var t=Math.floor(l(e.currentTarget).index(".unpair-btn"));this._unpair(this.paired[t])},_dragoverPairedColumns:function(e){e.preventDefault();var t=this.$(".paired-columns .column-datasets");this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestPairedDatasetLi(e.originalEvent.clientY);l(".element-drop-placeholder").remove();var n=l('
    ');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=2,n=e.offset(),s=e.scrollTop(),a=t-n.top,o=n.top+e.outerHeight()-t;a>=0&&a=0&&oe&&a-o",e.name)},toString:function(){return"PairedCollectionCreator"},templates:o.extend({},i.CollectionCreatorMixin._creatorTemplates,{header:o.template(['",'
    ','','',"
    ",'
    ','
    ','
    ','
    ','',s("Unpaired forward"),"",'',"
    ",'
    ','',"
    ","
    ","
    ",'",'
    ','
    ','
    ','',s("Unpaired reverse"),"",'',"
    ",'
    ','',"
    ","
    ","
    ","
    "].join("")),middle:o.template(['
    ','
    ','
      ',"
      ",'
      ','
        ',"
        ",'
        ','
          ',"
          ","
          ",'
          ','
          ','
          ','
          ','',"
          ",'',s("Unpair all"),"","
          ","
          ",'
          ','
            ',"
            "].join("")),footer:o.template(['
            ','
            ','",'","
            ",'
            ','','
            ',s("Name"),":
            ","
            ","
            ",'
            ','
            ','",'
            ','",'","
            ","
            ",'
            ','","
            ","
            "].join("")),helpContent:o.template(["

            ",s(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections 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, choose which datasets are paired, ","and re-order the final collection."].join("")),"

            ","

            ",s(['Unpaired datasets are shown in the unpaired section ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the paired section.',"

              To pair datasets, you can:","
            • Click a dataset in the ",'forward column ',"to select it then click a dataset in the ",'reverse column.',"
            • ",'
            • Click one of the "Pair these datasets" buttons in the ','middle column ',"to pair the datasets in a particular row.","
            • ",'
            • Click "Auto-pair" ',"to have your datasets automatically paired based on name.","
            • ","
            "].join("")),"

            ","

            ",s(["

              You can filter what is shown in the unpaired sections by:","
            • Entering partial dataset names in either the ",'forward filter or ','reverse filter.',"
            • ","
            • Choosing from a list of preset filters by clicking the ",'"Choose filters" link.',"
            • ","
            • Entering regular expressions to match dataset names. See: ",'MDN\'s JavaScript Regular Expression Tutorial. ',"Note: forward slashes (\\) are not needed.","
            • ","
            • Clearing the filters by clicking the ",'"Clear filters" link.',"
            • ","
            "].join("")),"

            ","

            ",s(["To unpair individual dataset pairs, click the ",'unpair buttons ( ). ','Click the "Unpair all" link to unpair all pairs.'].join("")),"

            ","

            ",s(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','"Remove file extensions from pair names?" control.'].join("")),"

            ","

            ",s(['Once your collection is complete, enter a name and ','click "Create list". ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"

            "].join(""))})}),f=function(e,t){var i,n=r.Deferred();if(t=o.defaults(t||{},{datasets:e,oncancel:function(){Galaxy.modal.hide(),n.reject("cancelled")},oncreate:function(e,t){Galaxy.modal.hide(),n.resolve(t)}}),!window.Galaxy||!Galaxy.modal)throw new Error("Galaxy or Galaxy.modal not found");return i=new p(t),Galaxy.modal.show({title:"Create a collection of paired datasets",body:i.$el,width:"80%",height:"800px",closing_events:!0}),i.render(),window.creator=i,n};return{PairedCollectionCreator:p,pairedCollectionCreatorModal:f,createListOfPairsCollection:d}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(37),i(44),i(6),i(5)],s=function(e,t,i,n){"use strict";function s(e,t){var i=e.toJSON(),n=u(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=[{name:"forward",src:"hda",id:t[0].id},{name:"reverse",src:"hda",id:t[1].id}],e.createHDCA(t,"paired",i,n)}});return n}var l="collections",c=a.View.extend(i.LoggableMixin).extend({_logNamespace:l,tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.identifier=e.identifier},render:function(){return this.$el.attr("data-element-id",this.element.id).html(this.template({identifier:this.identifier,element:this.element})),this},template:o.template(['<%- identifier %>','<%- element.name %>'].join("")),destroy:function(){this.off(),this.$el.remove()},toString:function(){return"DatasetCollectionElementView()"}}),d=e.ListCollectionCreator,h=d.extend({elementViewClass:c,collectionClass:t.HistoryPairDatasetCollection,className:"pair-collection-creator collection-creator flex-row-container",_mangleDuplicateNames:function(){},render:function(e,t){return 2===this.workingElements.length?d.prototype.render.call(this,e,t):this._renderInvalid(e,t)},_renderList:function(e,t){var i=this,n=r("
            "),s=i.$list();o.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),n.append(i._createForwardElementView().$el),n.append(i._createReverseElementView().$el),s.empty().append(n.children()),o.invoke(i.elementViews,"render")},_createForwardElementView:function(){return this._createElementView(this.workingElements[0],{identifier:"forward"})},_createReverseElementView:function(){return this._createElementView(this.workingElements[1],{identifier:"reverse"})},_createElementView:function(e,t){var i=new this.elementViewClass(o.extend(t,{element:e}));return this.elementViews.push(i),i},swap:function(){this.workingElements=[this.workingElements[1],this.workingElements[0]],this._renderList()},events:o.extend(o.clone(d.prototype.events),{"click .swap":"swap"}),templates:o.extend(o.clone(d.prototype.templates),{middle:o.template(['",'
            ',"
            "].join("")),helpContent:o.template(["

            ",n(["Pair collections are permanent collections containing two datasets: one forward and one reverse. ","Often these are forward and reverse reads. The pair collections can be passed to tools and ","workflows in order to have analyses done on both datasets. This interface allows ","you to create a pair, name it, and swap which is forward and which reverse."].join("")),"

            ","
              ","
            • ",n(['Click the "Swap" link to make your forward dataset the reverse ',"and the reverse dataset forward."].join("")),"
            • ","
            • ",n(['Click the "Cancel" button to exit the interface.'].join("")),"
            • ","

            ","

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

            "].join("")),invalidInitial:o.template(['
            ','
            ','',"<% if( _.size( problems ) ){ %>",n("The following selections could not be included due to problems"),"
              <% _.each( problems, function( problem ){ %>","
            • <%- problem.element.name %>: <%- problem.text %>
            • ","<% }); %>
            ","<% } else if( _.size( elements ) === 0 ){ %>",n("No datasets were selected"),".","<% } else if( _.size( elements ) === 1 ){ %>",n("Only one dataset was selected"),": <%- elements[0].name %>","<% } else if( _.size( elements ) > 2 ){ %>",n("Too many datasets were selected"),': <%- _.pluck( elements, "name" ).join( ", ") %>',"<% } %>","
            ",n("Two (and only two) elements are needed for the pair"),". ",n("You may need to "),'',n("cancel")," ",n("and reselect new elements"),".","
            ","
            ","
            ",'"].join(""))}),toString:function(){return"PairCollectionCreator"}}),u=function(t,i){return i=i||{},i.title=n("Create a collection from a pair of datasets"),e.collectionCreatorModal(t,i,h)};return{PairCollectionCreator:h,pairCollectionCreatorModal:u,createPairCollection:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(i,a,o){n=[],s=function(){return i.Model.extend({defaults:{url_base:"",async:!1,async_ops:[],categorical_filters:[],filters:{},sort_key:null,show_item_checkboxes:!1,advanced_search:!1,cur_page:1,num_pages:1,operation:void 0,item_ids:void 0},can_async_op:function(e){return a.indexOf(this.attributes.async_ops,e)!==-1},add_filter:function(e,t,i){if(i){var n,s=this.attributes.filters[e];if(null===s||void 0===s)n=t;else if("string"==typeof s)if("All"==s)n=t;else{var a=[];a[0]=s,a[1]=t,n=a}else n=s,n.push(t);this.attributes.filters[e]=n}else this.attributes.filters[e]=t},remove_filter:function(e,t){var i=this.attributes.filters[e];if(null===i||void 0===i)return!1;if("string"==typeof i)this.attributes.filters[e]="";else{var n=a.indexOf(i,t);n!==-1&&(i[n]="")}},get_url_data:function(){var e={async:this.attributes.async,sort:this.attributes.sort_key,page:this.attributes.cur_page,show_item_checkboxes:this.attributes.show_item_checkboxes,advanced_search:this.attributes.advanced_search};this.attributes.operation&&(e.operation=this.attributes.operation),this.attributes.item_ids&&(e.id=this.attributes.item_ids);var t=this;return a.each(a.pairs(t.attributes.filters),function(t){e["f-"+t[0]]=t[1]}),e},get_url:function(e){return this.get("url_base")+"?"+o.param(this.get_url_data())+"&"+o.param(e)}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,n){var s,a;(function(o){s=[n(4)],a=function(e){return{grid:function(e){var t="";return t=e.embedded?this.grid_header(e)+this.grid_table(e):'
            '+this.grid_header(e)+'
            '+this.grid_table(e),e.info_text&&(t+='
            '+e.info_text+"
            "),t},grid_table:function(e){return'
            '},grid_header:function(e){var t='
            ';if(e.embedded||(t+="

            "+e.title+"

            "),e.global_actions){t+='
              ';var n=e.global_actions.length>=3;n&&(t+='
            • Actions
            • ');for(i in e.global_actions){var s=e.global_actions[i];t+='
            • '+s.label+"
            • "}n&&(t+="
              "),t+="
            "}return e.insert&&(t+=e.insert),t+=this.grid_filters(e),t+="
            "},header:function(e){var t="";e.show_item_checkboxes&&(t+="",e.items.length>0&&(t+=''),t+="");for(var i in e.columns){var n=e.columns[i];n.visible&&(t+='',t+=n.href?''+n.label+"":n.label,t+=''+n.extra+"")}return t+=""},body:function(e){var t="",i=0,n=e.items.length;0==n&&(t+='No Items',i=1);for(var s in e.items){var a=e.items[s],r=a.encode_id;t+="",e.show_item_checkboxes&&(t+='');for(j in e.columns){var l=e.columns[j];if(l.visible){var c="";l.nowrap&&(c='style="white-space:nowrap;"');var d=a.column_config[l.label],h=d.link,u=d.value,p=d.target;"string"===o.type(u)&&(u=u.replace(/\/\//g,"/"));var f="",g="";l.attach_popup&&(f="grid-"+s+"-popup",g="menubutton",""!=h&&(g+=" split"),g+=" popup"),t+="",h?(0!=e.operations.length&&(t+='
            '),t+=''+u+"",0!=e.operations.length&&(t+="
            ")):t+='
            ",t+=""}}t+="",i++}return t},footer:function(e){var t="";if(e.use_paging&&e.num_pages>1){var n=e.num_page_links,s=e.cur_page_num,a=e.num_pages,o=n/2,r=s-o,l=0;r<=0&&(r=1,l=o-(s-r));var c=o+l,d=s+c;d<=a?max_offset=0:(d=a,max_offset=c-(d+1-s)),0!=max_offset&&(r-=max_offset,r<1&&(r=1)),t+='',e.show_item_checkboxes&&(t+=""),t+='Page:',r>1&&(t+='1 ...');for(var h=r;h'+h+"":''+h+"";d'+a+""),t+="",t+=' | Show All'}if(e.show_item_checkboxes){t+='For selected items: ';for(i in e.operations){var u=e.operations[i];u.allow_multiple&&(t+=' ')}t+=""}var p=!1;for(i in e.operations)if(e.operations[i].global_operation){p=!0;break}if(p){t+='';for(i in e.operations){var u=e.operations[i];u.global_operation&&(t+=''+u.label+"")}t+=""}return e.legend&&(t+=''+e.legend+""),t},message:function(e){return'

            '+e.message+'

            '},grid_filters:function(e){var t=e.default_filter_dict,i=e.filters,n="none";e.advanced_search&&(n="block");var s=!1;for(var a in e.columns){var o=e.columns[a];if("advanced"==o.filterable){var r=o.key,l=i[r],c=t[r];l&&c&&l!=c&&(n="block"),s=!0}}var d="block";"block"==n&&(d="none");var h='",h+='"},grid_column_filter:function(e,t){var i=(e.default_filter_dict,e.filters),n=t.label,s=t.key;"advanced"==t.filterable&&(n=n.toLowerCase());var a="";if("advanced"==t.filterable&&(a+=''+n+":"),a+='',t.is_text){a+='
            ';for(h in e.columns){var r=e.columns[h],l=i[r.key];l&&"All"!=l&&(r.is_text&&(l=JSON.stringify(l)),a+='')}a+='';var c=i[s];if(c){var d=o.type(c);if("string"==d&&"All"!=c&&(a+=this.filter_element(s,c)),"array"==d)for(var h in c){var u=c[h],p=c;p=p.slice(h),a+=this.filter_element(s,u)}}a+="";var f="";if("standard"==t.filterable){f=t.label.toLowerCase();var g=f.length;g<20&&(g=20),g+=4}a+='
            '}else{a+='';var m=!1;for(cf_label in e.categorical_filters[s]){var v=e.categorical_filters[s][cf_label],_="",y="";for(key in v)_=key,y=v[key];m&&(a+=" | "),m=!0;var u=i[s];a+=u&&v[s]&&u==y?''+cf_label+"":''+cf_label+""}a+=""}return a+=""},filter_element:function(t,i){return i=e.sanitize(i),''+i+''}}}.apply(t,s),!(void 0!==a&&(e.exports=a))}).call(t,n(1))},function(e,t,i){var n,s;(function(a,o){n=[i(76),i(80),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.DatasetListItemEdit,r=s.extend({className:s.prototype.className+" history-content",_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):e.model.has("rerunnable")?a.when():e.model.fetch({silent:!0,data:{keys:["rerunnable","creating_job"].join(",")}})},events:o.extend(o.clone(s.prototype.events),{"click .unhide-link":function(e){return this.model.unhide(),!1}}),toString:function(){var e=this.model?this.model+"":"(no model)";return"HDAListItemEdit("+e+")"}});return r.prototype.templates=function(){var e=o.extend({},s.prototype.templates.warnings,{hidden:i.wrapTemplate(["<% if( !dataset.visible ){ %>",'
            ',n("This dataset has been hidden"),'
            ',n("Unhide it"),"","
            ","<% } %>"],"dataset")});return o.extend({},s.prototype.templates,{titleBar:t.HDAListItemView.prototype.templates.titleBar,warnings:e})}(),{HDAListItemEdit:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},function(e,t,i){var n,s;n=[i(82),i(114),i(17),i(5)],s=function(e,t,i,n){"use strict";var s=e.HDCAListItemView,a=s.extend({_getFoldoutPanelClass:function(){switch(this.model.get("collection_type")){case"list":return t.ListCollectionViewEdit;case"paired":return t.PairCollectionViewEdit;case"list:paired":return t.ListOfPairsCollectionViewEdit;case"list:list":return t.ListOfListsCollectionViewEdit}throw new TypeError("Uknown collection_type: "+this.model.get("collection_type"))},_renderPrimaryActions:function(){return this.log(this+"._renderPrimaryActions"),s.prototype._renderPrimaryActions.call(this).concat([this._renderDeleteButton()])},_renderDeleteButton:function(){var e=this,t=this.model.get("deleted");return i({title:n(t?"Dataset collection is already deleted":"Delete"),classes:"delete-btn",faIcon:"fa-times",disabled:t,onclick:function(){e.$el.find(".icon-btn.delete-btn").trigger("mouseout"),e.model.delete()}})},toString:function(){var e=this.model?this.model+"":"(no model)";return"HDCAListItemEdit("+e+")"}});return{HDCAListItemEdit:a}}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(78),i(46),i(79)],s=function(e,t,i,n){var s=a.View.extend({initialize:function(t){var i=this;this.setElement(o("
            ")),this.model=new a.Model,e.get({url:Galaxy.root+"history/list",success:function(e){e.dict_format=!0,r.each(e.operations,function(e){"Copy"==e.label&&(e.onclick=function(e){i._showCopyDialog(e)})}),i.model.set(e),i.render()}})},render:function(){var e=new t(this.model.attributes);this.$el.empty().append(e.$el)},_showCopyDialog:function(e){var t=new i.History({id:e});t.fetch().fail(function(){alert("History could not be fetched. Please contact an administrator")}).done(function(){n(t,{}).done(function(){window.parent&&window.parent.Galaxy&&window.parent.Galaxy.currHistoryPanel&&window.parent.Galaxy.currHistoryPanel.loadCurrentHistory(),window.location.reload(!0)})})}});return{View:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(46),i(123),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=i.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryViewPrefs("+JSON.stringify(this.toJSON())+")"}});s.storageKey=function(){return"history-panel"};var l=t.HistoryViewEdit,c=l.extend({className:l.prototype.className+" current-history-panel",HDCAViewClass:l.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),emptyMsg:[n("This history is empty"),". ",n("You can "),'',n("load your own data"),"",n(" or "),'',n("get data from an external source"),""].join(""),initialize:function(e){e=e||{},this.preferences=new s(a.extend({id:s.storageKey()},a.pick(e,a.keys(s.prototype.defaults)))),l.prototype.initialize.call(this,e),this.panelStack=[],this.currentContentId=e.currentContentId||null},_setUpListeners:function(){l.prototype._setUpListeners.call(this);var e=this;this.on("new-model",function(){e.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(){return this.loadHistory(null,{url:Galaxy.root+"history/current_history_json"})},switchToHistory:function(e,t){return Galaxy.user.isAnonymous()?(this.trigger("error",n("You must be logged in to switch histories"),n("Anonymous user")),o.when()):this.loadHistory(e,{url:Galaxy.root+"history/set_as_current?id="+e})},createNewHistory:function(e){return Galaxy.user.isAnonymous()?(this.trigger("error",n("You must be logged in to create histories"),n("Anonymous user")),o.when()):this.loadHistory(null,{url:Galaxy.root+"history/create_new_current"})},setModel:function(e,t,i){return l.prototype.setModel.call(this,e,t,i),this.model&&this.model.id&&(this.log("checking for updates"), -this.model.checkForUpdates()),this},_setUpModelListeners:function(){return l.prototype._setUpModelListeners.call(this),this.listenTo(this.model,{"change:nice_size change:size":function(){this.trigger("history-size-change",this,this.model,arguments)},"change:id":function(){this.once("loading-done",function(){this.model.checkForUpdates()})}})},_setUpCollectionListeners:function(){l.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,"state:ready",function(e,t,i){e.get("visible")||this.collection.storage.includeHidden()||this.removeItemView(e)})},_setUpBehaviors:function(e){e=e||this.$el;var t=this;return l.prototype._setUpBehaviors.call(t,e),this._debouncedScrollCaptureHandler||(this._debouncedScrollCaptureHandler=a.debounce(function(){t.$el.is(":visible")&&t.preferences.set("scrollPosition",o(this).scrollTop())},40)),t.$scrollContainer(e).off("scroll",this._debouncedScrollCaptureHandler).on("scroll",this._debouncedScrollCaptureHandler),t},_buildNewRender:function(){if(!this.model)return o();var e=l.prototype._buildNewRender.call(this);return e.find(".search").prependTo(e.find("> .controls")),this._renderQuotaMessage(e),e},_renderQuotaMessage:function(e){return e=e||this.$el,o(this.templates.quotaMsg({},this)).prependTo(e.find(".messages"))},_renderTags:function(e){var t=this;l.prototype._renderTags.call(t,e),t.preferences.get("tagsEditorShown")&&t.tagsEditor.toggle(!0),t.listenTo(t.tagsEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("tagsEditorShown",e.hidden)})},_renderAnnotation:function(e){var t=this;l.prototype._renderAnnotation.call(t,e),t.preferences.get("annotationEditorShown")&&t.annotationEditor.toggle(!0),t.listenTo(t.annotationEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("annotationEditorShown",e.hidden)})},_swapNewRender:function(e){l.prototype._swapNewRender.call(this,e);var t=this;return a.delay(function(){var e=t.preferences.get("scrollPosition");e&&t.scrollTo(e,0)},10),this},_attachItems:function(e){l.prototype._attachItems.call(this,e);var t=this;return t.currentContentId&&t._setCurrentContentById(t.currentContentId),this},addItemView:function(e,t,i){var n=l.prototype.addItemView.call(this,e,t,i);return n&&this.panelStack.length?this._collapseDrilldownPanel():n},_setUpItemViewListeners:function(e){var t=this;return l.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}})},setCurrentContent:function(e){this.$(".history-content.current-content").removeClass("current-content"),e?(e.$el.addClass("current-content"),this.currentContentId=e.model.id):this.currentContentId=null},_setCurrentContentById:function(e){var t=this.viewFromModelId(e)||null;this.setCurrentContent(t)},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$controls().add(this.$list()).hide(),e.parentName=this.model.get("name"),e.delegateEvents().render().$el.appendTo(this.$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.$controls().add(this.$list()).show()},events:a.extend(a.clone(l.prototype.events),{"click .uploader-link":function(e){Galaxy.upload.show(e)},"click .get-data-link":function(e){var t=o(".toolMenuContainer");t.parent().scrollTop(0),t.find('span:contains("Get Data")').click()}}),listenToGalaxy:function(e){this.listenTo(e,{"galaxy_main:load":function(e){var t=e.fullpath,i=null,n={display:/datasets\/([a-f0-9]+)\/display/,edit:/datasets\/([a-f0-9]+)\/edit/,report_error:/dataset\/errors\?id=([a-f0-9]+)/,rerun:/tool_runner\/rerun\?id=([a-f0-9]+)/,show_params:/datasets\/([a-f0-9]+)\/show_params/};a.find(n,function(e,n){return i=a.result(t.match(e),1)}),this._setCurrentContentById(i?"dataset-"+i:null)},"center-panel:load":function(e){this._setCurrentContentById()}})},connectToQuotaMeter:function(e){return e?(this.listenTo(e,"quota:over",this.showQuotaMessage),this.listenTo(e,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){e&&e.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(e){var t=a.isUndefined(e)?this.$messages().children('[class$="message"]'):o(e.currentTarget);return t=t.not(".quota-message"),t.fadeOut(this.fxSpeed,function(){o(this).remove()}),this},showQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")&&e.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")||e.slideUp(this.fxSpeed)},unhideHidden:function(){var e=this;return confirm(n("Really unhide all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{visible:!0}).done(function(){e.model.contents.includeHidden||e.renderItems()}):r.when()},deleteHidden:function(){var e=this;return confirm(n("Really delete all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{deleted:!0,visible:!0}):r.when()},toString:function(){return"CurrentHistoryView("+(this.model?this.model.get("name"):"")+")"}});return c.prototype.templates=function(){var e=i.wrapTemplate(['
            ',n("You are over your disk quota"),". ",n("Tool execution is on hold until your disk usage drops below your allocated quota"),".","
            "],"history");return a.extend(a.clone(l.prototype.templates),{quotaMsg:e})}(),{CurrentHistoryView:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(124),i(45),i(11),i(81),i(119),i(120),i(49),i(72),i(37),i(116),i(115),i(17),i(52),i(6),i(5),i(16)],s=function(e,t,i,n,s,l,c,d,h,u,p,f,g,m,v){"use strict";var _=e.HistoryView,y=_.extend({HDAViewClass:s.HDAListItemEdit,HDCAViewClass:l.HDCAListItemEdit,initialize:function(e){e=e||{},_.prototype.initialize.call(this,e),this.tagsEditor=null,this.dragItems=!0,this.annotationEditor=null,this.purgeAllowed=e.purgeAllowed||!1,this.annotationEditorShown=e.annotationEditorShown||!1,this.tagsEditorShown=e.tagsEditorShown||!1},_setUpListeners:function(){return _.prototype._setUpListeners.call(this),this.on({"droptarget:drop":function(e,t){this.dataDropped(t),this.dropTargetOff()},"view:attached view:removed":function(){this._renderCounts()},"search:loading-progress":this._renderSearchProgress,"search:searching":this._renderSearchFindings})},_setUpModelListeners:function(){return _.prototype._setUpModelListeners.call(this),this.listenTo(this.model,"change:size",this.updateHistoryDiskSize),this},_setUpCollectionListeners:function(){return _.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"change:deleted":this._handleItemDeletedChange,"change:visible":this._handleItemVisibleChange,"change:purged":function(e){this.model.fetch()},"fetching-deleted":function(e){this.$("> .controls .deleted-count").html(""+v("loading...")+"")},"fetching-hidden":function(e){this.$("> .controls .hidden-count").html(""+v("loading...")+"")},"fetching-deleted-done fetching-hidden-done":this._renderCounts}),this},_buildNewRender:function(){var e=_.prototype._buildNewRender.call(this);return this.model?(Galaxy&&Galaxy.user&&Galaxy.user.id&&Galaxy.user.id===this.model.get("user_id")&&(this._renderTags(e),this._renderAnnotation(e)),e):e},updateHistoryDiskSize:function(){this.$(".history-size").text(this.model.get("nice_size"))},renderItems:function(e){var t=_.prototype.renderItems.call(this,e);return this.searchFor||this._renderCounts(e),t},_renderCounts:function(e){e=e instanceof a?e:this.$el;var t=this.templates.counts(this.model.toJSON(),this);return e.find("> .controls .subtitle").html(t)},_renderTags:function(e){var t=this;this.tagsEditor=new c.TagsEditor({model:this.model,el:e.find(".controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDATagEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDATagEditors(!1,t.fxSpeed)},$activator:f({title:v("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".controls .actions"))})},_renderAnnotation:function(e){var t=this;this.annotationEditor=new d.AnnotationEditor({model:this.model,el:e.find(".controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDAAnnotationEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDAAnnotationEditors(!1,t.fxSpeed)},$activator:f({title:v("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".controls .actions"))})},_setUpBehaviors:function(e){if(e=e||this.$el,_.prototype._setUpBehaviors.call(this,e),this.model&&Galaxy.user&&!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.model.get("user_id")){var t=this,i="> .controls .name";e.find(i).attr("title",v("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(e){var n=t.model.get("name");e&&e!==n?(t.$el.find(i).text(e),t.model.save({name:e}).fail(function(){t.$el.find(i).text(t.model.previous("name"))})):t.$el.find(i).text(n)}})}},multiselectActions:function(){var e=this,t=[{html:v("Hide datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.hide;e.getSelectedModels().ajaxQueue(t)}},{html:v("Unhide datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.unhide;e.getSelectedModels().ajaxQueue(t)}},{html:v("Delete datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.delete;e.getSelectedModels().ajaxQueue(t)}},{html:v("Undelete datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.undelete;e.getSelectedModels().ajaxQueue(t)}}];return e.purgeAllowed&&t.push({html:v("Permanently delete datasets"),func:function(){if(confirm(v("This will permanently remove the data in your datasets. Are you sure?"))){var t=n.HistoryDatasetAssociation.prototype.purge;e.getSelectedModels().ajaxQueue(t)}}}),t=t.concat(e._collectionActions())},_collectionActions:function(){var e=this;return[{html:v("Build Dataset List"),func:function(){e.buildCollection("list")}},{html:v("Build Dataset Pair"),func:function(){e.buildCollection("paired")}},{html:v("Build List of Dataset Pairs"),func:function(){e.buildCollection("list:paired")}}]},buildCollection:function(e,t,i){var n,s=this,t=t||s.getSelectedModels(),i=i||!1;"list"==e?n=h.createListCollection:"paired"==e?n=u.createPairCollection:"list:paired"==e?n=p.createListOfPairsCollection:console.warn("Unknown collectionType encountered "+e),n(t,i).done(function(){s.model.refresh()})},_getItemViewOptions:function(e){var t=_.prototype._getItemViewOptions.call(this,e);return o.extend(t,{purgeAllowed:this.purgeAllowed,tagsEditorShown:this.tagsEditor&&!this.tagsEditor.hidden,annotationEditorShown:this.annotationEditor&&!this.annotationEditor.hidden}),t},_handleItemDeletedChange:function(e){e.get("deleted")?this._handleItemDeletion(e):this._handleItemUndeletion(e),this._renderCounts()},_handleItemDeletion:function(e){var t=this.model.get("contents_active");t.deleted+=1,t.active-=1,this.model.contents.includeDeleted||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUndeletion:function(e){var t=this.model.get("contents_active");t.deleted-=1,this.model.contents.includeDeleted||(t.active-=1),this.model.set("contents_active",t)},_handleItemVisibleChange:function(e){e.hidden()?this._handleItemHidden(e):this._handleItemUnhidden(e),this._renderCounts()},_handleItemHidden:function(e){var t=this.model.get("contents_active");t.hidden+=1,t.active-=1,this.model.contents.includeHidden||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUnhidden:function(e){var t=this.model.get("contents_active");t.hidden-=1,this.model.contents.includeHidden||(t.active-=1),this.model.set("contents_active",t)},toggleHDATagEditors:function(e,t){o.each(this.views,function(i){i.tagsEditor&&i.tagsEditor.toggle(e,t)})},toggleHDAAnnotationEditors:function(e,t){o.each(this.views,function(i){i.annotationEditor&&i.annotationEditor.toggle(e,t)})},events:o.extend(o.clone(_.prototype.events),{"click .show-selectors-btn":"toggleSelectors","click .toggle-deleted-link":function(e){this.toggleShowDeleted()},"click .toggle-hidden-link":function(e){this.toggleShowHidden()}}),_renderSearchProgress:function(e,t){var i=e+t;return this.$("> .controls .subtitle").html(["",v("Searching "),i,"/",this.model.contentsShown(),""].join(""))},_renderSearchFindings:function(){return this.$("> .controls .subtitle").html([v("Found"),this.views.length].join(" ")),this},dropTargetOn:function(){if(this.dropTarget)return this;this.dropTarget=!0;var e={dragenter:o.bind(this.dragenter,this),dragover:o.bind(this.dragover,this),dragleave:o.bind(this.dragleave,this),drop:o.bind(this.drop,this)},t=this._renderDropTarget();this.$list().before([this._renderDropTargetHelp(),t]);for(var i in e)e.hasOwnProperty(i)&&t.on(i,e[i]);return this},_renderDropTarget:function(){return this.$(".history-drop-target").remove(),r("
            ").addClass("history-drop-target")},_renderDropTargetHelp:function(){return this.$(".history-drop-target-help").remove(),r("
            ").addClass("history-drop-target-help").text(v("Drag datasets here to copy them to the current history"))},dropTargetOff:function(){if(!this.dropTarget)return this;this.dropTarget=!1;var e=this.$(".history-drop-target").get(0);for(var t in this._dropHandlers)this._dropHandlers.hasOwnProperty(t)&&e.off(t,this._dropHandlers[t]);return this.$(".history-drop-target").remove(),this.$(".history-drop-target-help").remove(),this},dropTargetToggle:function(){return this.dropTarget?this.dropTargetOff():this.dropTargetOn(),this},dragenter:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","2px solid black")},dragover:function(e){e.preventDefault(),e.stopPropagation()},dragleave:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","1px dashed black")},drop:function(e){e.preventDefault();var t=this,i=e.originalEvent.dataTransfer,n=i.getData("text");i.dropEffect="move";try{n=JSON.parse(n)}catch(e){t.warn("error parsing JSON from drop:",n)}return t.trigger("droptarget:drop",e,n,t),!1},dataDropped:function(e){var t=this;return o.isObject(e)&&"HistoryDatasetAssociation"===e.model_class&&e.id?0!==t.contents.currentPage?t.contents.fetchPage(0).then(function(){return t.model.contents.copy(e.id)}):t.model.contents.copy(e.id):a.when()},toString:function(){return"HistoryViewEdit("+(this.model?this.model.get("name"):"")+")"}});return y.prototype.templates=function(){var e=m.wrapTemplate(["<% var shown = Math.max( view.views.length, history.contents_active.active ) %>","<% if( shown ){ %>",'',"<%- shown %> ",v("shown"),"","<% } %>","<% if( history.contents_active.deleted ){ %>",'',"<% if( view.model.contents.includeDeleted ){ %>",'',v("hide deleted"),"","<% } else { %>","<%- history.contents_active.deleted %> ",'',v("deleted"),"","<% } %>","","<% } %>","<% if( history.contents_active.hidden ){ %>",'',"<% if( view.model.contents.includeHidden ){ %>",'',v("hide hidden"),"","<% } else { %>","<%- history.contents_active.hidden %> ",'',v("hidden"),"","<% } %>","","<% } %>"],"history");return o.extend(o.clone(_.prototype.templates),{counts:e})}(),{HistoryViewEdit:y}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(84),i(46),i(45),i(47),i(80),i(82),i(87),i(86),i(17),i(6),i(5),i(90)],s=function(e,t,i,n,s,r,l,c,d,h,u){"use strict";var p=e.ModelListPanel,f=p.extend({_logNamespace:"history",HDAViewClass:s.HDAListItemView,HDCAViewClass:r.HDCAListItemView,collectionClass:i.HistoryContents,modelCollectionKey:"contents",tagName:"div",className:p.prototype.className+" history-panel",emptyMsg:u("This history is empty"),noneFoundMsg:u("No matching datasets found"),searchPlaceholder:u("search datasets"),FETCH_COLLECTION_COUNTS_DELAY:2e3,initialize:function(e){p.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_createDefaultCollection:function(){return new this.collectionClass([],{history:this.model})},freeModel:function(){return p.prototype.freeModel.call(this),this.model&&this.model.clearUpdateTimeout(),this},_setUpListeners:function(){p.prototype._setUpListeners.call(this),this.on({error:function(e,t,i,n,s){this.errorHandler(e,t,i,n,s)},"loading-done":function(){var e=this;a.delay(function(){e.model.contents.fetchCollectionCounts()},e.FETCH_COLLECTION_COUNTS_DELAY)},"views:ready view:attached view:removed":function(e){this._renderSelectButton()},"view:attached":function(e){this.scrollTo(0)}})},loadHistory:function(e,i,n){n=a.extend(n||{silent:!0}),this.info("loadHistory:",e,i,n);var s=this;return s.setModel(new t.History({id:e})),n.silent=!0,s.trigger("loading"),s.model.fetchWithContents(i,n).always(function(){s.render(),s.trigger("loading-done")})},refreshContents:function(e){return this.model?this.model.refresh(e):o.when()},_setUpCollectionListeners:function(){return p.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"fetching-more":function(){this._toggleContentsLoadingIndicator(!0),this.$emptyMessage().hide()},"fetching-more-done":function(){this._toggleContentsLoadingIndicator(!1)}})},_showLoadingIndicator:function(e,t,i){var n=o('
            ');this.$el.html(n.text(e).slideDown(a.isUndefined(t)?this.fxSpeed:t))},_hideLoadingIndicator:function(e){this.$(".loading-indicator").slideUp(a.isUndefined(e)?this.fxSpeed+200:e,function(){o(this).remove()})},_buildNewRender:function(){var e=p.prototype._buildNewRender.call(this);return this._renderSelectButton(e),e},_renderSelectButton:function(e){if(e=e||this.$el,!this.multiselectActions().length)return null;if(!this.views.length)return this.hideSelectors(),e.find(".controls .actions .show-selectors-btn").remove(),null;var t=e.find(".controls .actions .show-selectors-btn");return t.length?t:d({title:u("Operations on multiple datasets"),classes:"show-selectors-btn",faIcon:"fa-check-square-o"}).prependTo(e.find(".controls .actions"))},_renderEmptyMessage:function(e){var t=this,i=t.$emptyMessage(e),n=t.model.get("contents_active").active<=0;return n?i.empty().append(t.emptyMsg).show():t.searchFor&&t.model.contents.haveSearchDetails()&&!t.views.length?i.empty().append(t.noneFoundMsg).show():(i.hide(),o())},$scrollContainer:function(e){return this.$list(e)},_toggleContentsLoadingIndicator:function(e){e?this.$list().html('
            '):this.$list().find(".contents-loading-indicator").remove()},renderItems:function(e){e=e||this.$el;var t=this,i=t.$list(e);o(".tooltip").remove(),i.empty(),t.views=[];var n=t._filterCollection();return n.length?(t._renderPagination(e),t.views=t._renderSomeItems(n,i)):e.find("> .controls .list-pagination").empty(),t._renderEmptyMessage(e).toggle(!n.length),t.trigger("views:ready",t.views),t.views},_renderPagination:function(e){var t=e.find("> .controls .list-pagination");return this.searchFor||!this.model.contents.shouldPaginate()?t.empty():(t.html(this.templates.pagination({current:this.model.contents.currentPage+1,last:this.model.contents.getLastPage()+1},this)),t.find("select.pages").tooltip(),t)},_renderSomeItems:function(e,t){var i=this,n=[];return t.append(e.map(function(e){var t=i._createItemView(e);return n.push(t),i._renderItemView$el(t)})),n},_filterItem:function(e){var t=this,i=t.model.contents;return(i.includeHidden||!e.hidden())&&(i.includeDeleted||!e.isDeletedOrPurged())&&p.prototype._filterItem.call(t,e)},_getItemViewClass:function(e){var t=e.get("history_content_type");switch(t){case"dataset":return this.HDAViewClass;case"dataset_collection":return this.HDCAViewClass}throw new TypeError("Unknown history_content_type: "+t)},_getItemViewOptions:function(e){var t=p.prototype._getItemViewOptions.call(this,e);return a.extend(t,{linkTarget:this.linkTarget,expanded:this.model.contents.storage.isExpanded(e.id),hasUser:this.model.ownedByCurrUser()})},_setUpItemViewListeners:function(e){var t=this;return p.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{expanded:function(e){t.model.contents.storage.addExpanded(e.model)},collapsed:function(e){t.model.contents.storage.removeExpanded(e.model)}})},collapseAll:function(){this.model.contents.storage.clearExpanded(),p.prototype.collapseAll.call(this)},getSelectedModels:function(){var e=p.prototype.getSelectedModels.call(this);return e.historyId=this.collection.historyId,e},events:a.extend(a.clone(p.prototype.events),{"click .show-selectors-btn":"toggleSelectors","click > .controls .prev":"_clickPrevPage","click > .controls .next":"_clickNextPage","change > .controls .pages":"_changePageSelect","click .messages [class$=message]":"clearMessages"}),_clickPrevPage:function(e){this.model.clearUpdateTimeout(),this.model.contents.fetchPrevPage()},_clickNextPage:function(e){this.model.clearUpdateTimeout(),this.model.contents.fetchNextPage()},_changePageSelect:function(e){this.model.clearUpdateTimeout();var t=o(e.currentTarget).val();this.model.contents.fetchPage(t)},toggleShowDeleted:function(e,t){e=void 0!==e?e:!this.model.contents.includeDeleted;var i=this,n=i.model.contents;return n.setIncludeDeleted(e,t),i.trigger("show-deleted",e),n.fetchCurrentPage({renderAll:!0}),e},toggleShowHidden:function(e,t,i){e=void 0!==e?e:!this.model.contents.includeHidden;var n=this,s=n.model.contents;return s.setIncludeHidden(e,i),n.trigger("show-hidden",e),s.fetchCurrentPage({renderAll:!0}),e},_firstSearch:function(e){var t=this,i="> .controls .search-input";if(this.log("onFirstSearch",e),t.model.contents.haveSearchDetails())return void t.searchItems(e);t.$(i).searchInput("toggle-loading"),t.searchFor=e;t.model.contents.progressivelyFetchDetails({silent:!0}).progress(function(e,i,n){t.renderItems(),t.trigger("search:loading-progress",i,n)}).always(function(){t.$el.find(i).searchInput("toggle-loading")}).done(function(){t.searchItems(e,"force")})},clearSearch:function(e){var t=this;return t.searchFor?(t.searchFor="",t.trigger("search:clear",t),t.$("> .controls .search-query").val(""),t.model.contents.fetchCurrentPage({silent:!0}).done(function(){t.renderItems()}),t):t},errorHandler:function(e,t,i){if(!t||0!==t.status||0!==t.readyState){if(this.error(e,t,i),a.isString(e)&&a.isString(t)){var n=e,s=t;return c.errorModal(n,s,i)}return t&&502===t.status?c.badGatewayErrorModal():c.ajaxErrorModal(e,t,i)}},clearMessages:function(e){var t=a.isUndefined(e)?this.$messages().children('[class$="message"]'):o(e.currentTarget);return t.fadeOut(this.fxSpeed,function(){o(this).remove()}),this},scrollToHid:function(e){return this.scrollToItem(a.first(this.viewsWhereModel({hid:e})))},ordinalIndicator:function(e){var t=e+"";switch(t.charAt(t.length-1)){case"1":return t+"st";case"2":return t+"nd";case"3":return t+"rd";default:return t+"th"}},toString:function(){return"HistoryView("+(this.model?this.model.get("name"):"")+")"}});return f.prototype.templates=function(){var e=h.wrapTemplate(["
            ",'
            ','
              ','
              ',"
              "]),t=h.wrapTemplate(['
              ','
              ','
              <%- history.name %>
              ',"
              ",'
              ','
              <%- history.nice_size %>
              ','
              ','
              ',"<% if( history.deleted && history.purged ){ %>",'
              ',u("This history has been purged and deleted"),"
              ","<% } else if( history.deleted ){ %>",'
              ',u("This history has been deleted"),"
              ","<% } else if( history.purged ){ %>",'
              ',u("This history has been purged"),"
              ","<% } %>","<% if( history.message ){ %>",'
              messagesmall">',"<%= history.message.text %>","
              ","<% } %>","
              ",'
              ','
              ','",'
              ','
              ','",'","
              ",'
              ',"
              ","
              ",'
              ',"
              "],"history"),i=h.wrapTemplate(['','",''],"pages");return a.extend(a.clone(p.prototype.templates),{el:e,controls:t,pagination:i})}(),{HistoryView:f}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(52),i(79),i(6),i(5),i(28)],s=function(e,t,i,n,s){"use strict";function r(e,t,i){return o.clone(l).filter(function(n){return!(e&&!n.anon)&&(!(!t&&n.purge)&&(n.href&&(n.href=i+n.href,n.target="galaxy_main"),n.confirm&&(n.func=function(){confirm(n.confirm)&&(galaxy_main.location=n.href)}),!0))})}var l=[{html:n("History Lists"),header:!0},{html:n("Saved Histories"),href:"histories/list"},{html:n("Histories Shared with Me"),href:"history/list_shared"},{html:n("Current History"),header:!0,anon:!0},{html:n("Create New"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.createNewHistory()}},{html:n("Copy History"),func:function(){t(Galaxy.currHistoryPanel.model).done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:n("Share or Publish"),href:"history/sharing"},{html:n("Show Structure"),href:"history/display_structured",anon:!0},{html:n("Extract Workflow"),href:"workflow/build_from_current_history"},{html:n("Delete"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really delete the current history?"))&&(galaxy_main.window.location.href="history/delete?id="+Galaxy.currHistoryPanel.model.id)}},{html:n("Delete Permanently"),purge:!0,anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really delete the current history permanently? This cannot be undone."))&&(galaxy_main.window.location.href="history/delete?purge=True&id="+Galaxy.currHistoryPanel.model.id)}},{html:n("Dataset Actions"),header:!0,anon:!0},{html:n("Copy Datasets"),href:"dataset/copy_datasets"},{html:n("Dataset Security"),href:"root/history_set_default_permissions"},{html:n("Resume Paused Jobs"),href:"history/resume_paused_jobs?current=True",anon:!0},{html:n("Collapse Expanded Datasets"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.collapseAll()}},{html:n("Unhide Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really unhide all hidden datasets?"))&&a.post(Galaxy.root+"history/adjust_hidden",{user_action:"unhide"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:n("Delete Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really delete all hidden datasets?"))&&a.post(Galaxy.root+"history/adjust_hidden",{user_action:"delete"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:n("Purge Deleted Datasets"),confirm:n("Really delete all deleted datasets permanently? This cannot be undone."),href:"history/purge_deleted_datasets",purge:!0,anon:!0},{html:n("Downloads"),header:!0},{html:n("Export Tool Citations"),href:"history/citations",anon:!0},{html:n("Export History to File"),href:"history/export_archive?preview=True",anon:!0},{html:n("Other Actions"),header:!0},{html:n("Import from File"),href:"history/import_archive"}];s.add({url:"api/webhooks/history-menu/all",async:!1,callback:function(e){var t=[];a.each(e.models,function(e,i){var s=i.toJSON();s.activate&&t.push({html:n(s.config.title),anon:!0})}),t.length>0&&(t.unshift({html:n("Webhooks"),header:!0}),a.merge(l,t))}});var c=function(t,i){i=i||{};var n=void 0===i.anonymous||i.anonymous,s=i.purgeAllowed||!1,a=r(n,s,Galaxy.root);return new e(t,a)};return c}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){var t=a.View.extend({initialize:function(e){this.collection=new a.Collection,this.model=e&&e.model||new a.Model({onchange:null,visible:!0}).set(e),this.setElement(o(this._template())),this.$nav=this.$(".tab-navigation"),this.$content=this.$(".tab-content"),this.$el.on("click",function(){o(".tooltip").hide()}),this.render(),this.listenTo(this.model,"change",this.render,this),this.listenTo(this.collection,"add",this._add,this),this.listenTo(this.collection,"remove",this._remove,this),this.listenTo(this.collection,"change",this._change,this),this.listenTo(this.collection,"reset",this._reset,this),this.listenTo(this.collection,"add remove reset",this.render,this)},render:function(){var e=this.model.get("current");e=this.$("#"+e).length>0?e:this.first(),e&&(this.$nav.children().removeClass("active"),this.$content.children().removeClass("active"),this.$("#tab-"+e).addClass("active"),this.$("#"+e).addClass("active")),this.$el[this.model.get("visible")?"fadeIn":"fadeOut"]("fast"),this.$nav[this.size()>1?"show":"hide"]()},current:function(){return this.model.get("current")},show:function(e){e&&(this.model.set({current:e,visible:!0}),this.model.get("onchange")&&this.model.get("onchange")(e))},hide:function(){this.model.set("visible",!1)},first:function(){var e=this.collection.first();return e&&e.id},size:function(){return this.collection.length},add:function(e){this.collection.add(e)},del:function(e){this.collection.remove(e)},delAll:function(){this.collection.reset()},showTab:function(e){this.collection.get(e).set("hidden",!1)},hideTab:function(e){this.collection.get(e).set("hidden",!0)},_add:function(e){var t=this,i=e.attributes;this.$content.append(o("
              ").attr("id",i.id).addClass("tab-pane").append(i.$el)),this.$nav.append(o(this._template_tab(i)).show().tooltip({title:i.tooltip,placement:"bottom",container:t.$el}).on("click",function(e){e.preventDefault(),t.show(i.id)})),1==this.size()&&this.show(i.id)},_remove:function(e){this.$("#tab-"+e.id).remove(),this.$("#"+e.id).remove()},_reset:function(){this.$nav.empty(),this.$content.empty()},_change:function(e){this.$("#tab-"+e.id)[e.get("hidden")?"hide":"show"]()},_template:function(){return o("
              ").addClass("ui-tabs tabbable tabs-left").append(o("