From 85bf398fc33fb7ca230c51b09661176382923796 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Fri, 1 Dec 2017 15:31:09 -0500 Subject: [PATCH] change the default ot not add tags based on filename this is fairly confusing if you do not expect it and there is no way to revert --- .../scripts/mvc/library/library-foldertoolbar-view.js | 8 ++++---- static/scripts/bundled/library.bundled.js | 2 +- static/scripts/mvc/library/library-foldertoolbar-view.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js index 7eb7cc63516..512360922ad 100644 --- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js +++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js @@ -1519,8 +1519,8 @@ var FolderToolbarView = Backbone.View.extend({ "
", "
", '", "
", "" @@ -1561,8 +1561,8 @@ var FolderToolbarView = Backbone.View.extend({ "", "
", '", "
", "" diff --git a/static/scripts/bundled/library.bundled.js b/static/scripts/bundled/library.bundled.js index 54232da2d83..f53862848c3 100644 --- a/static/scripts/bundled/library.bundled.js +++ b/static/scripts/bundled/library.bundled.js @@ -46,4 +46,4 @@ n=i,l=e("
",{css:{position:"absolute",top:"-200px",left:s?"0px":"-1000px", // the check will work anyway, as when moving the node will be loaded first and checked again if(v === 'i' && !ins.is_loaded(p)) { } */ -p=!0,u=0,f=o.data.nodes.length;ue.inArray(o.data.nodes[u],b.children)&&(m-=1)),!(p=p&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(g,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[u]):o.data.nodes[u],c,m,{dnd:!0,ref:w.get_node(x.parent()),pos:j,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(i=w.last_error());break}if(p)return"i"===j&&x.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(s=setTimeout(function(e,t){return function(){e.open_node(t)}}(w,x),w.settings.dnd.open_timeout)),t={ins:w,par:c,pos:"i"!==j||"last"!==y||0!==h||w.is_loaded(v)?h:"last"},a.css({left:n+"px",top:l+"px"}).show(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),i={},_=!0,!1}),!0===_))return}else{for(p=!0,u=0,f=o.data.nodes.length;u
").html(a).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove touchmove",e.vakata.dnd.drag),e(document).bind("mouseup touchend",e.vakata.dnd.stop),!1},drag:function(i){if("touchmove"===i.type&&i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(i.pageX=i.originalEvent.changedTouches[0].pageX,i.pageY=i.originalEvent.changedTouches[0].pageY,i.target=document.elementFromPoint(i.originalEvent.changedTouches[0].pageX-window.pageXOffset,i.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_down){if(!t.is_drag){if(!(Math.abs(i.pageX-t.init_x)>(t.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)||Math.abs(i.pageY-t.init_y)>(t.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth()),t.is_drag=!0,e.vakata.dnd._trigger("start",i)}var s=!1,a=!1,r=!1,o=!1,n=!1,l=!1,d=!1,c=!1,h=!1,_=!1;return t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1,e(e(i.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var s=e(this),a=s.offset();if(this.scrollHeight>this.offsetHeight&&(a.top+s.height()-i.pageYthis.offsetWidth&&(a.left+s.width()-i.pageXo&&i.pageY-do&&o-(i.pageY-d)l&&i.pageX-cl&&l-(i.pageX-c)r&&(h=r-50),n&&_+t.helper_w>n&&(_=n-(t.helper_w+2)),t.helper.css({left:_+"px",top:h+"px"})),e.vakata.dnd._trigger("move",i),!1}},stop:function(i){if("touchend"===i.type&&i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(i.pageX=i.originalEvent.changedTouches[0].pageX,i.pageY=i.originalEvent.changedTouches[0].pageY,i.target=document.elementFromPoint(i.originalEvent.changedTouches[0].pageX-window.pageXOffset,i.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_drag)e.vakata.dnd._trigger("stop",i);else if("touchend"===i.type&&i.target===t.target){var s=setTimeout(function(){e(i.target).click()},100);e(i.target).one("click",function(){s&&clearTimeout(s)})}return e.vakata.dnd._clean(),!1}}}(e),e.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},e.jstree.plugins.search=function(t,i){this.bind=function(){i.bind.call(this),this._data.search.str="",this._data.search.dom=e(),this._data.search.res=[],this._data.search.opn=[],this.element.on("before_open.jstree",e.proxy(function(t,i){var s,a,r=this._data.search.res,o=[],n=e();if(r&&r.length&&(this._data.search.dom=e(this.element[0].querySelectorAll("#"+e.map(r,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(e.jstree.idregex,"\\$&"):t.replace(e.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this.settings.search.show_only_matches&&this._data.search.res.length)){for(s=0,a=r.length;s32&&(i.fuzzy=!1),i.fuzzy&&(s=1<=u;l--)if(m=a[t.charAt(l-1)],g[l]=0===o?(g[l+1]<<1|1)&m:(g[l+1]<<1|1)&m|(p[l+1]|p[l])<<1|1|p[l+1],g[l]&s&&(x=r(o,l-1))<=y){if(y=x,v=l-1,k.push(v),!(v>n))break;u=Math.max(1,2*n-v)}if(r(o+1,n)>y)break;p=g}return{isMatch:v>=0,score:x}},!0===t?{search:o}:o(t)}}(e),e.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1},e.jstree.plugins.sort=function(t,i){this.bind=function(){i.bind.call(this),this.element.on("model.jstree",e.proxy(function(e,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",e.proxy(function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",e.proxy(function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)},this))},this.sort=function(t,i){var s,a;if((t=this.get_node(t))&&t.children&&t.children.length&&(t.children.sort(e.proxy(this.settings.sort,this)),i))for(s=0,a=t.children_d.length;st.ttl)&&(t&&t.state&&(t=t.state),t&&e.isFunction(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),!!t&&(this.element.one("set_state.jstree",function(i,s){s.instance.trigger("restore_state",{state:e.extend(!0,{},t)})}),this.set_state(t),!0))},this.clear_state=function(){return e.vakata.storage.del(this.settings.state.key)}},function(e,t){e.vakata.storage={set:function(e,t){return window.localStorage.setItem(e,t)},get:function(e){return window.localStorage.getItem(e)},del:function(e){return window.localStorage.removeItem(e)}}}(e),e.jstree.defaults.types={"#":{},default:{}},e.jstree.plugins.types=function(i,s){this.init=function(e,i){var a,r;if(i&&i.types&&i.types.default)for(a in i.types)if("default"!==a&&"#"!==a&&i.types.hasOwnProperty(a))for(r in i.types.default)i.types.default.hasOwnProperty(r)&&i.types[a][r]===t&&(i.types[a][r]=i.types.default[r]);s.init.call(this,e,i),this._model.data["#"].type="#"},this.refresh=function(e,t){s.refresh.call(this,e,t),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",e.proxy(function(e,i){var s,a,r=this._model.data,o=i.nodes,n=this.settings.types,l="default";for(s=0,a=o.length;s .jstree-ocl",e.proxy(function(t){t.stopImmediatePropagation();var i=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor:eq(0)").trigger(i).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",e.proxy(function(e){return e.stopImmediatePropagation(),this.hover_node(e.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),i.teardown.call(this)},this.redraw_node=function(t,s,a){if(t=i.redraw_node.call(this,t,s,a)){var r=u.cloneNode(!0);-1!==e.inArray(t.id,this._data.core.selected)&&(r.className+=" jstree-wholerow-clicked"),t.insertBefore(r,t.childNodes[0])}return t}}}})},225:function(e,t,i){"use strict";(function(e,s,a,r){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=i(42),l=o(n),d=i(156),c=o(d),h=i(3),_=o(h),p=i(139),u=o(p),f=e.View.extend({el:"#center",model:null,options:{},defaults:{edit_mode:!1},events:{"click .toolbtn_modify_dataset":"enableModification","click .toolbtn_cancel_modifications":"render","click .toolbtn-download-dataset":"downloadDataset","click .toolbtn-import-dataset":"importIntoHistory","click .copy-link-to-clipboard":"copyToClipboard","click .make-private":"makeDatasetPrivate","click .remove-restrictions":"removeDatasetRestrictions","click .toolbtn_save_permissions":"savePermissions","click .toolbtn_save_modifications":"saveModifications"},select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=s.extend(this.options,e),this.fetchExtAndGenomes(),this.options.id&&this.fetchDataset()},fetchDataset:function(e){this.options=s.extend(this.options,e),this.model=new c.default.Item({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions?t.showPermissions():t.options.show_version?t.fetchVersion():t.render()},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):l.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},render:function(e){this.options=s.extend(this.options,e),a(".tooltip").remove();var t=this.templateDataset();this.$el.html(t({item:this.model})),a(".peek").html(this.model.get("peek")),a("#center [data-toggle]").tooltip()},fetchVersion:function(e){this.options=s.extend(this.options,e);var t=this;this.options.ldda_id?(this.ldda=new c.default.Ldda({id:this.options.ldda_id}),this.ldda.url=this.ldda.urlRoot+this.model.id+"/versions/"+this.ldda.id,this.ldda.fetch({success:function(){t.renderVersion()},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg):l.default.error("An error occurred.")}})):(this.render(),l.default.error("Library dataset version requested but no id provided."))},renderVersion:function(){a(".tooltip").remove();var e=this.templateVersion();this.$el.html(e({item:this.model,ldda:this.ldda})),a(".peek").html(this.ldda.get("peek"))},enableModification:function(){a(".tooltip").remove();var e=this.templateModifyDataset();this.$el.html(e({item:this.model})),this.renderSelectBoxes({genome_build:this.model.get("genome_build"),file_ext:this.model.get("file_ext")}),a(".peek").html(this.model.get("peek")),a("#center [data-toggle]").tooltip()},downloadDataset:function(){var e=Galaxy.root+"api/libraries/datasets/download/uncompressed",t={ld_ids:this.id};this.processDownload(e,t)},processDownload:function(e,t,i){if(e&&t){t="string"==typeof t?t:a.param(t);var s="";a.each(t.split("&"),function(){var e=this.split("=");s+=''}),a('
'+s+"
").appendTo("body").submit().remove(),l.default.info("Your download will begin soon.")}},importIntoHistory:function(){this.refreshUserHistoriesList(function(e){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:"Import into History",body:t({histories:e.histories.models}),buttons:{Import:function(){e.importCurrentIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})},refreshUserHistoriesList:function(e){var t=this;this.histories=new c.default.GalaxyHistories,this.histories.fetch({success:function(i){0===i.length?l.default.warning("You have to create history first. Click this to do so.","",{onclick:function(){window.location=Galaxy.root}}):e(t)},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg):l.default.error("An error occurred.")}})},importCurrentIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)a.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.processImportToHistory(e.id)}).fail(function(e,t,i){l.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var i=a(this.modal.$el).find("select[name=dataset_import_single] option:selected").val();this.processImportToHistory(i),this.modal.enableButton("Import")}},processImportToHistory:function(e){var t=new c.default.HistoryItem;t.url=t.urlRoot+e+"/contents",r.getJSON(Galaxy.root+"history/set_as_current?id="+e),t.save({content:this.id,source:"library"},{success:function(){Galaxy.modal.hide(),l.default.success("Dataset imported. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}})},error:function(e,t){void 0!==t.responseJSON?l.default.error("Dataset not imported. "+t.responseJSON.err_msg):l.default.error("An error occured. Dataset not imported. Please try again.")}})},showPermissions:function(e){var t=this.templateDatasetPermissions(),i=this;this.options=s.extend(this.options,e),a(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_dataset_roles.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1})),this.$el.html(t({item:this.model,is_admin:Galaxy.config.is_admin_user})),a.get(Galaxy.root+"api/libraries/datasets/"+i.id+"/permissions?scope=current").done(function(e){i.prepareSelectBoxes({fetched_permissions:e,is_admin:Galaxy.config.is_admin_user})}).fail(function(){l.default.error("An error occurred while attempting to fetch dataset permissions.")}),a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],i=0;i0))return void l.default.warning("Library dataset name has to be at least 1 character long.");i.set("name",s),t=!0}var a=this.$el.find(".input_dataset_misc_info").val();void 0!==a&&a!==i.get("misc_info")&&(i.set("misc_info",a),t=!0);var r=this.select_genome.$el.select2("data").id;void 0!==r&&r!==i.get("genome_build")&&(i.set("genome_build",r),t=!0);var o=this.select_extension.$el.select2("data").id;void 0!==o&&o!==i.get("file_ext")&&(i.set("file_ext",o),t=!0);var n=this;t?i.save(null,{patch:!0,success:function(e){n.render(),l.default.success("Changes to library dataset saved.")},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg):l.default.error("An error occured while attempting to update the library dataset.")}}):(n.render(),l.default.info("Nothing has changed."))},copyToClipboard:function(t){t.preventDefault();var i=e.history.location.href;-1!==i.lastIndexOf("/permissions")&&(i=i.substr(0,i.lastIndexOf("/permissions"))),window.prompt("Copy to clipboard: Ctrl+C, Enter",i)},makeDatasetPrivate:function(){var e=this;a.post(Galaxy.root+"api/libraries/datasets/"+e.id+"/permissions?action=make_private").done(function(t){e.model.set({is_unrestricted:!1}),e.showPermissions({fetched_permissions:t}),l.default.success("The dataset is now private to you.")}).fail(function(){l.default.error("An error occurred while attempting to make dataset private.")})},removeDatasetRestrictions:function(){var e=this;a.post(Galaxy.root+"api/libraries/datasets/"+e.id+"/permissions?action=remove_restrictions").done(function(t){e.model.set({is_unrestricted:!0}),e.showPermissions({fetched_permissions:t}),l.default.success("Access to this dataset is now unrestricted.")}).fail(function(){l.default.error("An error occurred while attempting to make dataset unrestricted.")})},_extractIds:function(e){for(var t=[],i=e.length-1;i>=0;i--)t.push(e[i].id);return t},savePermissions:function(e){var t=this,i=this._extractIds(this.accessSelectObject.$el.select2("data")),s=this._extractIds(this.manageSelectObject.$el.select2("data")),r=this._extractIds(this.modifySelectObject.$el.select2("data"));a.post(Galaxy.root+"api/libraries/datasets/"+t.id+"/permissions?action=set_permissions",{"access_ids[]":i,"manage_ids[]":s,"modify_ids[]":r}).done(function(e){t.showPermissions({fetched_permissions:e}),l.default.success("Permissions saved.")}).fail(function(){l.default.error("An error occurred while attempting to set dataset permissions.")})},fetchExtAndGenomes:function(){var e=this;0==this.list_genomes.length&&_.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){for(var i in t)e.list_extensions.push({id:t[i].extension,text:t[i].extension,description:t[i].description,description_url:t[i].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id','
','",'",'<% if (item.get("can_user_modify")) { %>','","<% } %>",'<% if (item.get("can_user_manage")) { %>','/datasets/<%- item.id %>/permissions">','","","<% } %>","
",'",'<% if (item.get("is_unrestricted")) { %>',"
",'This dataset is unrestricted so everybody with the link can access it. Just share this page.',"
","<% } %>",'
','',"",'','',"",'<% if (item.get("file_ext")) { %>',"",'','',"","<% } %>",'<% if (item.get("genome_build")) { %>',"",'','',"","<% } %>",'<% if (item.get("file_size")) { %>',"",'','',"","<% } %>",'<% if (item.get("date_uploaded")) { %>',"",'','',"","<% } %>",'<% if (item.get("uploaded_by")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_data_lines")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_comment_lines")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_columns")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_column_types")) { %>',"",'','',"","<% } %>",'<% if (item.get("message")) { %>',"",'','',"","<% } %>",'<% if (item.get("misc_blurb")) { %>',"",'','',"","<% } %>",'<% if (item.get("misc_info")) { %>',"",'','',"","<% } %>",'<% if (item.get("tags")) { %>',"",'','',"","<% } %>",'<% if ( item.get("uuid") !== "ok" ) { %>',"",'','',"","<% } %>",'<% if ( item.get("state") !== "ok" ) { %>',"",'','',"","<% } %>","
">Name<%= _.escape(item.get("name")) %>
Data type<%= _.escape(item.get("file_ext")) %>
Genome build<%= _.escape(item.get("genome_build")) %>
Size<%= _.escape(item.get("file_size")) %>
Date uploaded (UTC)<%= _.escape(item.get("date_uploaded")) %>
Uploaded by<%= _.escape(item.get("uploaded_by")) %>
Data Lines<%= _.escape(item.get("metadata_data_lines")) %>
Comment Lines<%= _.escape(item.get("metadata_comment_lines")) %>
Number of Columns<%= _.escape(item.get("metadata_columns")) %>
Column Types<%= _.escape(item.get("metadata_column_types")) %>
Message<%= _.escape(item.get("message")) %>
Misc. blurb<%= _.escape(item.get("misc_blurb")) %>
Misc. info<%= _.escape(item.get("misc_info")) %>
Tags<%= _.escape(item.get("tags")) %>
UUID<%= _.escape(item.get("uuid")) %>
State<%= _.escape(item.get("state")) %>
",'<% if (item.get("job_stderr")) { %>',"

Job Standard Error

",'
','<%= _.escape(item.get("job_stderr")) %>',"
","<% } %>",'<% if (item.get("job_stdout")) { %>',"

Job Standard Output

",'
','<%= _.escape(item.get("job_stdout")) %>',"
","<% } %>","
",'
',"
","
",'<% if (item.get("has_versions")) { %>',"
","

Expired versions:

","
","<% } %>","
",""].join(""))},templateVersion:function(){return s.template(['
','",'",'
This is an expired version of the library dataset: <%= _.escape(item.get("name")) %>
','
','',"",'','',"",'<% if (ldda.get("file_ext")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("genome_build")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("file_size")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("date_uploaded")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("uploaded_by")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_data_lines")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_comment_lines")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_columns")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_column_types")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("message")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("misc_blurb")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("misc_info")) { %>',"",'','',"","<% } %>",'<% if (item.get("tags")) { %>',"",'','',"","<% } %>","
Name<%= _.escape(ldda.get("name")) %>
Data type<%= _.escape(ldda.get("file_ext")) %>
Genome build<%= _.escape(ldda.get("genome_build")) %>
Size<%= _.escape(ldda.get("file_size")) %>
Date uploaded (UTC)<%= _.escape(ldda.get("date_uploaded")) %>
Uploaded by<%= _.escape(ldda.get("uploaded_by")) %>
Data Lines<%= _.escape(ldda.get("metadata_data_lines")) %>
Comment Lines<%= _.escape(ldda.get("metadata_comment_lines")) %>
Number of Columns<%= _.escape(ldda.get("metadata_columns")) %>
Column Types<%= _.escape(ldda.get("metadata_column_types")) %>
Message<%= _.escape(ldda.get("message")) %>
Miscellaneous blurb<%= _.escape(ldda.get("misc_blurb")) %>
Miscellaneous information<%= _.escape(ldda.get("misc_info")) %>
Tags<%= _.escape(item.get("tags")) %>
","
",'
',"
","
","
","
"].join(""))},templateModifyDataset:function(){return s.template(['
','
','",'","
",'",'
','',"",'','',"","",'',"","","",'',"","","",'','',"","",'','',"","",'','',"",'','','',"",'','<% if (item.get("metadata_comment_lines") === "") { %>','',"<% } else { %>",'',"<% } %>","","",'','',"","",'','',"","",'','',"","",'','',"","",'','',"",'<% if (item.get("tags")) { %>',"",'','',"","<% } %>","
">Name">
Data type",'',"
Genome build",'',"
Size<%= _.escape(item.get("file_size")) %>
Date uploaded (UTC)<%= _.escape(item.get("date_uploaded")) %>
Uploaded by<%= _.escape(item.get("uploaded_by")) %>
Data Lines<%= _.escape(item.get("metadata_data_lines")) %>
Comment Lines<%= _.escape(item.get("metadata_comment_lines")) %>unknown
Number of Columns<%= _.escape(item.get("metadata_columns")) %>
Column Types<%= _.escape(item.get("metadata_column_types")) %>
Message<%= _.escape(item.get("message")) %>
Misc. blurb<%= _.escape(item.get("misc_blurb")) %>
Misc. information">
Tags<%= _.escape(item.get("tags")) %>
","
",'
',"
","
","
","
"].join(""))},templateDatasetPermissions:function(){return s.template(['
','",'",'

Dataset: <%= _.escape(item.get("name")) %>

','
',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any dataset on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% } %>","
",'
',"

Library-related permissions

","

Roles that can modify the library item

",'
','
User with any of these roles can modify name, metadata, and other information about this library item.
',"
","

Dataset-related permissions

",'
Changes made below will affect every library item that was created from this dataset and also every history this dataset is part of.
','<% if (!item.get("is_unrestricted")) { %>','

You can remove all access restrictions on this dataset.

',"<% } else { %>",'

You can make this dataset private to you.

',"<% } %>","

Roles that can access the dataset

",'
','
',"User has to have all these roles in order to access this dataset."," Users without access permission cannot have other permissions on this dataset."," If there are no access roles set on the dataset it is considered unrestricted.","
","

Roles that can manage permissions on the dataset

",'
','
',"User with any of these roles can manage permissions of this dataset. If you remove yourself you will lose the ability manage this dataset unless you are an admin.","
",'","
","
"].join(""))},templateBulkImportInModal:function(){return s.template(["
",'
',"Select history: ",'","
",'
',"or create new: ",'',"","
","
"].join(""))}});t.default={LibraryDatasetView:f}}).call(t,i(1),i(2),i(0),i(0))},298:function(e,t,i){"use strict";function s(e){new r.default.GalaxyApp(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.App=s;var a=i(299),r=function(e){return e&&e.__esModule?e:{default:e}}(a);window.libraryApp=s},299:function(e,t,i){"use strict";(function(e,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(3),o=(a(r),i(42)),n=a(o),l=i(8),d=a(l),c=i(156),h=(a(c),i(301)),_=a(h),p=i(303),u=a(p),f=i(305),g=a(f),m=i(306),b=a(m),y=i(225),v=a(y),w=i(307),x=a(w),k=i(308),j=a(k),C=e.Router.extend({initialize:function(){this.routesHit=0,e.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"libraries","page/:show_page":"libraries_page","library/:library_id/permissions":"library_permissions","folders/:folder_id/permissions":"folder_permissions","folders/:id":"folder_content","folders/:id/page/:show_page":"folder_page","folders/:folder_id/datasets/:dataset_id":"dataset_detail","folders/:folder_id/datasets/:dataset_id/permissions":"dataset_permissions","folders/:folder_id/datasets/:dataset_id/versions/:ldda_id":"dataset_version","folders/:folder_id/download/:format":"download","folders/:folder_id/import/:source":"import_datasets"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})},trackPageview:function(){var t=e.history.getFragment();/^\//.test(t)||""==t||(t="/"+t),"undefined"!=typeof ga&&ga("send","pageview",Galaxy.root+"library/list"+t)}}),S=d.default.SessionStorageModel.extend({defaults:{with_deleted:!1,without_restricted:!1,sort_order:"asc",sort_by:"name",library_page_size:20,folder_page_size:15}}),G=e.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,libraryView:null,folderToolbarView:null,folderListView:null,datasetView:null,initialize:function(){window.Galaxy.config.ga_code&&(!function(e,t,i,s,a,r,o){e.GoogleAnalyticsObject=a,e[a]=e[a]||function(){(e[a].q=e[a].q||[]).push(arguments)},e[a].l=1*new Date,r=t.createElement(i),o=t.getElementsByTagName(i)[0],r.async=1,r.src="//www.google-analytics.com/analytics.js",o.parentNode.insertBefore(r,o)}(window,document,"script",0,"ga"),ga("create",window.Galaxy.config.ga_code,"auto"),ga("send","pageview")),Galaxy.libraries=this,this.preferences=new S({id:"global-lib-prefs"}),this.library_router=new C,this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView&&Galaxy.libraries.libraryToolbarView.$el.unbind("click"),Galaxy.libraries.libraryToolbarView=new g.default.LibraryToolbarView,Galaxy.libraries.libraryListView=new u.default.LibraryListView}),this.library_router.on("route:libraries_page",function(e){null===Galaxy.libraries.libraryToolbarView?(Galaxy.libraries.libraryToolbarView=new g.default.LibraryToolbarView,Galaxy.libraries.libraryListView=new u.default.LibraryListView({show_page:e})):Galaxy.libraries.libraryListView.render({show_page:e})}),this.library_router.on("route:folder_content",function(e){Galaxy.libraries.folderToolbarView&&Galaxy.libraries.folderToolbarView.$el.unbind("click"),Galaxy.libraries.folderToolbarView=new b.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new _.default.FolderListView({id:e})}),this.library_router.on("route:folder_page",function(e,t){null===Galaxy.libraries.folderToolbarView?(Galaxy.libraries.folderToolbarView=new b.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new _.default.FolderListView({id:e,show_page:t})):Galaxy.libraries.folderListView.render({id:e,show_page:parseInt(t)})}),this.library_router.on("route:download",function(e,t){0===s("#folder_list_body").find(":checked").length?(n.default.info("You must select at least one dataset to download"),Galaxy.libraries.library_router.navigate("folders/"+e,{trigger:!0,replace:!0})):(Galaxy.libraries.folderToolbarView.download(e,t),Galaxy.libraries.library_router.navigate("folders/"+e,{trigger:!1,replace:!0}))}),this.library_router.on("route:dataset_detail",function(e,t){Galaxy.libraries.datasetView&&Galaxy.libraries.datasetView.$el.unbind("click"),Galaxy.libraries.datasetView=new v.default.LibraryDatasetView({id:t,show_version:!1,show_permissions:!1})}),this.library_router.on("route:dataset_version",function(e,t,i){Galaxy.libraries.datasetView&&Galaxy.libraries.datasetView.$el.unbind("click"),Galaxy.libraries.datasetView=new v.default.LibraryDatasetView({id:t,ldda_id:i,show_version:!0})}),this.library_router.on("route:dataset_permissions",function(e,t){Galaxy.libraries.datasetView&&Galaxy.libraries.datasetView.$el.unbind("click"),Galaxy.libraries.datasetView=new v.default.LibraryDatasetView({id:t,show_permissions:!0})}),this.library_router.on("route:library_permissions",function(e){Galaxy.libraries.libraryView&&Galaxy.libraries.libraryView.$el.unbind("click"),Galaxy.libraries.libraryView=new x.default.LibraryView({id:e,show_permissions:!0})}),this.library_router.on("route:folder_permissions",function(e){Galaxy.libraries.folderView&&Galaxy.libraries.folderView.$el.unbind("click"),Galaxy.libraries.folderView=new j.default.FolderView({id:e,show_permissions:!0})}),this.library_router.on("route:import_datasets",function(e,t){Galaxy.libraries.folderToolbarView&&Galaxy.libraries.folderListView?Galaxy.libraries.folderToolbarView.showImportModal({source:t}):(Galaxy.libraries.folderToolbarView=new b.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new _.default.FolderListView({id:e}),Galaxy.libraries.folderToolbarView.showImportModal({source:t}))}),e.history.start({pushState:!1})}});t.default={GalaxyApp:G}}).call(t,i(1),i(0))},300:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e,t){return function(i,s){return i.get("type")===s.get("type")?i.has(e)||s.has(e)?i.has(e)?s.has(e)?i.get(e).toLowerCase()>s.get(e).toLowerCase()?"asc"===t?1:-1:s.get(e).toLowerCase()>i.get(e).toLowerCase()?"asc"===t?-1:1:0:-1:1:0:"folder"===i.get("type")?-1:1}},a=function(e,t){return function(i,s){return i.get(e).toLowerCase()>s.get(e).toLowerCase()?"asc"===t?1:-1:s.get(e).toLowerCase()>i.get(e).toLowerCase()?"asc"===t?-1:1:0}};t.default={generateFolderComparator:s,generateLibraryComparator:a}},301:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(302),h=r(c),_=e.View.extend({el:"#folder_items_element",progress:0,progressStep:1,folderContainer:null,current_sort_order:"asc",current_sort_key:"name",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .folder_row":"selectClickedRow","click .sort-folder-name":"sortColumnClicked","click .sort-folder-file_ext":"sortColumnClicked","click .sort-folder-description":"sortColumnClicked","click .sort-folder-state":"sortColumnClicked"},collection:null,defaults:{include_deleted:!1,page_count:null,show_page:null},initialize:function(e){this.options=s.defaults(this.options||{},this.defaults,e),this.modal=null,this.rowViews={},this.collection=new d.default.Folder,this.listenTo(this.collection,"add",this.renderOne),this.listenTo(this.collection,"remove",this.removeOne),this.listenTo(this.collection,"sort",this.rePaint),this.listenTo(this.collection,"reset",this.rePaint),this.fetchFolder()},fetchFolder:function(e){var e=e||{};this.options.include_deleted=e.include_deleted;var t=this;this.folderContainer=new d.default.FolderContainer({id:this.options.id}),this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents",this.options.include_deleted&&(this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"),this.folderContainer.fetch({success:function(e){t.folder_container=e,t.render()},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):n.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},render:function(e){this.options=s.extend(this.options,e);var t=this.templateFolder();a(".tooltip").hide();var i,r=this.folderContainer.attributes.metadata.full_path;if(i=1===r.length?0:r[r.length-2][0],this.$el.html(t({path:this.folderContainer.attributes.metadata.full_path,parent_library_id:this.folderContainer.attributes.metadata.parent_library_id,id:this.options.id,upper_folder_id:i,order:this.current_sort_order})),this.options.dataset_id){var o=s.findWhere(self.rowViews,{id:this.options.dataset_id});o?o.showDatasetDetails():n.default.error("Requested dataset not found. Showing folder instead.")}else(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.paginate();a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},paginate:function(e){this.options=s.extend(this.options,e),(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_items_count=this.folder_container.get("folder").models.length,this.options.page_count=Math.ceil(this.options.total_items_count/Galaxy.libraries.preferences.get("folder_page_size"));var t=Galaxy.libraries.preferences.get("folder_page_size")*(this.options.show_page-1),i=null;i=this.folder_container.get("folder").models.slice(t,t+Galaxy.libraries.preferences.get("folder_page_size")),this.options.items_shown=i.length,Galaxy.libraries.preferences.get("folder_page_size")*this.options.show_page>this.options.total_items_count+Galaxy.libraries.preferences.get("folder_page_size")&&(i=[]),Galaxy.libraries.folderToolbarView.renderPaginator(this.options),this.collection.reset(i)},rePaint:function(e){this.options=s.extend(this.options,e),this.removeAllRows(),this.renderAll(),this.checkEmptiness()},addAll:function(e){s.each(e,function(e){Galaxy.libraries.folderListView.collection.add(e,{current_sort_order:!1})}),a("#center [data-toggle]").tooltip(),this.checkEmptiness(),this.postRender()},postRender:function(){var e=this.folderContainer.attributes.metadata;e.contains_file_or_folder=void 0!==this.collection.findWhere({type:"file"})||void 0!==this.collection.findWhere({type:"folder"}),Galaxy.libraries.folderToolbarView.configureElements(e)},renderAll:function(){var e=this;s.each(this.collection.models.reverse(),function(t){e.renderOne(t)}),this.postRender()},renderOne:function(e){this.options.contains_file_or_folder=!0,e.set("folder_id",this.id);var t=new h.default.FolderRowView({model:e});this.rowViews[e.get("id")]=t,this.$el.find("#first_folder_item").after(t.el)},removeOne:function(e){this.$el.find("tr").filter(function(){return a(this).data("id")&&a(this).data("id")===e.id}).remove()},removeAllRows:function(){a(".library-row").remove()},checkEmptiness:function(){0===this.$el.find(".dataset_row").length&&0===this.$el.find(".folder_row").length?this.$el.find(".empty-folder-message").show():this.$el.find(".empty-folder-message").hide()},sortColumnClicked:function(e){e.preventDefault(),this.current_sort_order="asc"===this.current_sort_order?"desc":"asc",this.current_sort_key=e.currentTarget.className.replace("sort-folder-",""),this.collection.sortFolder(this.current_sort_key,this.current_sort_order),this.renderSortIcon()},selectAll:function(e){var t=e.target.checked,i=this;a(":checkbox","#folder_list_body").each(function(){this.checked=t;var e=a(this).closest("tr");t?i.makeDarkRow(e):i.makeWhiteRow(e)})},selectClickedRow:function(e){var t,i,s="";t=a(e.target).closest("tr"),"input"===e.target.localName?(s=e.target,i="input"):"td"===e.target.localName&&(s=t.find(":checkbox")[0],i="td"),s.checked?"td"===i?(s.checked="",this.makeWhiteRow(t)):"input"===i&&this.makeDarkRow(t):"td"===i?(s.checked="selected",this.makeDarkRow(t)):"input"===i&&this.makeWhiteRow(t)},makeDarkRow:function(e){e.removeClass("light").addClass("dark"),e.find("a").removeClass("light").addClass("dark"),e.find(".fa-file-o").removeClass("fa-file-o").addClass("fa-file"),e.find(".fa-folder-o").removeClass("fa-folder-o").addClass("fa-folder")},makeWhiteRow:function(e){e.removeClass("dark").addClass("light"),e.find("a").removeClass("dark").addClass("light"),e.find(".fa-file").removeClass("fa-file").addClass("fa-file-o"),e.find(".fa-folder").removeClass("fa-folder").addClass("fa-folder-o")},renderSortIcon:function(){"asc"===this.current_sort_order?(a('[class*="sort-icon"]').removeClass("fa-sort-alpha-desc").removeClass("fa-sort-alpha-asc"),a(".sort-icon-"+this.current_sort_key).addClass("fa-sort-alpha-asc")):a(".sort-icon-"+this.current_sort_key).addClass("fa-sort-alpha-desc")},templateFolder:function(){return s.template(['",'',"",'','','','','','','','',' ',"",'','',"","","","","","","","","","","","
name description data type sizetime updated (UTC)state
",'" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..',"
",'"].join(""))}});t.default={FolderListView:_}}).call(t,i(1),i(2),i(0))},302:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(225),h=r(c),_=e.View.extend({events:{"click .undelete_dataset_btn":"undeleteDataset","click .undelete_folder_btn":"undeleteFolder","click .edit_folder_btn":"startModifications","click .cancel_folder_btn":"cancelModifications","click .save_folder_btn":"saveModifications"},defaults:{type:null,visibility_config:{edit_folder_btn:!1,save_folder_btn:!1,cancel_folder_btn:!1,permission_folder_btn:!1},edit_mode:!1},initialize:function(e){this.options=s.defaults(e||{},this.defaults),this.render(this.options)},render:function(e){this.options=s.extend(this.options,e);var t=this.options.model,i=null;return"folder"===t.get("type")||"LibraryFolder"===t.get("model_class")?(this.options.type="folder",this.prepareButtons(t),i=t.get("deleted")?this.templateRowDeletedFolder():this.templateRowFolder()):"file"===t.get("type")||"LibraryDatasetDatasetAssociation"===t.get("model_class")||"LibraryDataset"===t.get("model_class")?(this.options.type="file",i=t.get("deleted")?this.templateRowDeletedFile():this.templateRowFile()):(Galaxy.emit.error("Unknown library item type found."),Galaxy.emit.error(t.get("type")||t.get("model_class"))),this.setElement(i({content_item:t,edit_mode:this.options.edit_mode,button_config:this.options.visibility_config})),this.$el.show(),this},prepareButtons:function(e){var t=this.options.visibility_config;!1===this.options.edit_mode?(t.save_folder_btn=!1,t.cancel_folder_btn=!1,!0===e.get("deleted")?(t.edit_folder_btn=!1,t.permission_folder_btn=!1):!1===e.get("deleted")&&(t.save_folder_btn=!1,t.cancel_folder_btn=!1,!0===e.get("can_modify")&&(t.edit_folder_btn=!0),!0===e.get("can_manage")&&(t.permission_folder_btn=!0))):!0===this.options.edit_mode&&(t.edit_folder_btn=!1,t.permission_folder_btn=!1,t.save_folder_btn=!0,t.cancel_folder_btn=!0),this.options.visibility_config=t},showDatasetDetails:function(){Galaxy.libraries.datasetView=new h.default.LibraryDatasetView({id:this.id})},undeleteDataset:function(e){a(".tooltip").hide();var t=this,i=a(e.target).closest("tr").data("id"),s=Galaxy.libraries.folderListView.collection.get(i);s.url=s.urlRoot+s.id+"?undelete=true",s.destroy({success:function(e,s){Galaxy.libraries.folderListView.collection.remove(i);var a=new d.default.Item(s);Galaxy.libraries.folderListView.collection.add(a),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),n.default.success("Dataset undeleted. Click this to see it.","",{onclick:function(){var e=t.model.get("folder_id");window.location=Galaxy.root+"library/list#folders/"+e+"/datasets/"+t.id}})},error:function(e,t){void 0!==t.responseJSON?n.default.error("Dataset was not undeleted. "+t.responseJSON.err_msg):n.default.error("An error occured! Dataset was not undeleted. Please try again.")}})},undeleteFolder:function(e){a(".tooltip").hide();var t=a(e.target).closest("tr").data("id"),i=Galaxy.libraries.folderListView.collection.get(t);i.url=i.urlRoot+i.id+"?undelete=true",i.destroy({success:function(e,i){Galaxy.libraries.folderListView.collection.remove(t);var s=new d.default.FolderAsModel(i);Galaxy.libraries.folderListView.collection.add(s),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),n.default.success("Folder undeleted.")},error:function(e,t){void 0!==t.responseJSON?n.default.error("Folder was not undeleted. "+t.responseJSON.err_msg):n.default.error("An error occured! Folder was not undeleted. Please try again.")}})},startModifications:function(){this.options.edit_mode=!0,this.repaint()},cancelModifications:function(){this.options.edit_mode=!1,this.repaint()},saveModifications:function(){var e=Galaxy.libraries.folderListView.collection.get(this.$el.data("id")),t=!1,i=this.$el.find(".input_folder_name").val();if(void 0!==i&&i!==e.get("name")){if(!(i.length>2))return void n.default.warning("Folder name has to be at least 3 characters long.");e.set("name",i),t=!0}var s=this.$el.find(".input_folder_description").val();if(void 0!==s&&s!==e.get("description")&&(e.set("description",s),t=!0),t){var a=this;e.save(null,{patch:!0,success:function(e){a.options.edit_mode=!1,a.repaint(e),n.default.success("Changes to folder saved.")},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg):n.default.error("An error occured while attempting to update the folder.")}})}else this.options.edit_mode=!1,this.repaint(e),n.default.info("Nothing has changed.")},repaint:function(){a(".tooltip").hide();var e=this.$el;this.render(),e.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},templateRowFolder:function(){return s.template(['',"",'',"",'',"<% if(!edit_mode) { %>","",'<%- content_item.get("name") %>',"","",'<%- content_item.get("description") %>',"","<% } else if(edit_mode){ %>",'','',"<% } %>","folder","","",'<%= _.escape(content_item.get("update_time")) %>',"","","","<% if(edit_mode) { %>",'",'","<% } else if (!edit_mode){%>",'",'','","","<% } %>","",""].join(""))},templateRowFile:function(){return s.template(['',"",'',"",'','',"","",'/datasets/<%- content_item.id %>" class="library-dataset">','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>','<%= _.escape(content_item.get("file_ext")) %>','<%= _.escape(content_item.get("file_size")) %>','<%= _.escape(content_item.get("update_time")) %>',"",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'<% if (content_item.get("is_unrestricted")) { %>','',"<% } %>",'<% if (content_item.get("is_private")) { %>','',"<% } %>",'<% if ((content_item.get("is_unrestricted") === false) && (content_item.get("is_private") === false)) { %>','',"<% } %>",'<% if (content_item.get("can_manage")) { %>','/datasets/<%- content_item.id %>/permissions">','","","<% } %>","",""].join(""))},templateRowDeletedFile:function(){return s.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>',"","",'<%= _.escape(content_item.get("file_ext")) %>',"","",'<%= _.escape(content_item.get("file_size")) %>',"","",'<%= _.escape(content_item.get("update_time")) %>',"","",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'','","",""].join(""))},templateRowDeletedFolder:function(){return s.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("description") %>',"","","folder","","","",'<%= _.escape(content_item.get("update_time")) %>',"","","",'','","",""].join(""))}});t.default={FolderRowView:_}}).call(t,i(1),i(2),i(0))},303:function(e,t,i){"use strict";(function(e,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(42),o=a(r),n=i(156),l=a(n),d=i(304),c=a(d),h=i(2),_=a(h),p=e.View.extend({el:"#libraries_element",events:{"click .sort-libraries-link":"sort_clicked"},defaults:{page_count:null,show_page:null,all_fetched:!1},initialize:function(e){this.options=_.default.defaults(this.options||{},e,this.defaults);var t=this;this.modal=null,this.collection=new l.default.Libraries,this.collection.url=this.collection.urlRoot+"?deleted=false",this.collection.fetch({success:function(){t.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})},render:function(e){this.options=_.default.extend(this.options,e),this.setElement("#libraries_element");var t=this.templateLibraryList(),i=null,a=null,r=function(e){return!0===e.get("public")};if(s(".tooltip").hide(),void 0!==e&&(a=void 0!==e.models?e.models:null),null!==this.collection&&null===a)this.sortLibraries(),i=Galaxy.libraries.preferences.get("with_deleted")?this.collection.models:this.collection.where({deleted:!1}),Galaxy.libraries.preferences.get("without_restricted")&&(i=_.default.filter(i,r));else if(null!==a){if(Galaxy.libraries.preferences.get("with_deleted"))i=a;else{var o=function(e){return!1===e.get("deleted")};i=_.default.filter(a,o)}Galaxy.libraries.preferences.get("without_restricted")&&(i=_.default.filter(i,r))}else i=[];(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_libraries_count=i.length;var n=Galaxy.libraries.preferences.get("library_page_size")*(this.options.show_page-1);this.options.page_count=Math.ceil(this.options.total_libraries_count/Galaxy.libraries.preferences.get("library_page_size")),this.options.total_libraries_count>0&&nthis.options.total_libraries_count+Galaxy.libraries.preferences.get("library_page_size")&&(i=[]),this.$el.html(t({length:1,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options),this.renderRows(i)):(this.$el.html(t({length:0,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options)),s("#center [data-toggle]").tooltip(),s("#center").css("overflow","auto")},fetchDeleted:function(){if(this.options.all_fetched)this.render();else{var e=this;this.collection.url=this.collection.urlRoot+"?deleted=true",this.collection.fetch({remove:!1,success:function(){e.options.all_fetched=!0,e.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})}},renderRows:function(e){for(var t=0;t',"<% if(length === 0) { %>","<% if(search_term.length > 0) { %>","
","There are no libraries matching your search. Try different keyword.","
","<% } else{ %>","
","There are no libraries visible to you here. If you expected some to show up please consult the",' library security wikipage',' or visit the Galaxy support site.',"
","<% }%>","<% } else{ %>",'',"",'",'',' ','',"",'',"","
','',"name","",'',"descriptionsynopsis
","<% }%>",""].join(""))}});t.default={LibraryListView:p}}).call(t,i(1),i(0))},304:function(e,t,i){"use strict";(function(e,s,a){Object.defineProperty(t,"__esModule",{value:!0});var r=i(42),o=function(e){return e&&e.__esModule?e:{default:e}}(r),n=e.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library"},edit_mode:!1,element_visibility_config:{upload_library_btn:!1,edit_library_btn:!1,permission_library_btn:!1,save_library_btn:!1,cancel_library_btn:!1,delete_library_btn:!1,undelete_library_btn:!1},initialize:function(e){this.render(e)},render:function(e){void 0===e&&(e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))),this.prepareButtons(e);var t=this.templateRow();return this.setElement(t({library:e,button_config:this.element_visibility_config,edit_mode:this.edit_mode})),this.$el.show(),this},repaint:function(e){s(".tooltip").hide();var t=this.$el;this.render(),t.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){var t=this.element_visibility_config;!1===this.edit_mode?(t.save_library_btn=!1,t.cancel_library_btn=!1,t.delete_library_btn=!1,!0===e.get("deleted")?(t.undelete_library_btn=!0,t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1):!1===e.get("deleted")&&(t.save_library_btn=!1,t.cancel_library_btn=!1,t.undelete_library_btn=!1,!0===e.get("can_user_add")&&(t.upload_library_btn=!0),!0===e.get("can_user_modify")&&(t.edit_library_btn=!0),!0===e.get("can_user_manage")&&(t.permission_library_btn=!0))):!0===this.edit_mode&&(t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1,t.save_library_btn=!0,t.cancel_library_btn=!0,t.delete_library_btn=!0,t.undelete_library_btn=!1),this.element_visibility_config=t},edit_button_clicked:function(){this.edit_mode=!0,this.repaint()},cancel_library_modification:function(){this.edit_mode=!1,this.repaint()},save_library_modification:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=!1,i=this.$el.find(".input_library_name").val();if(void 0!==i&&i!==e.get("name")){if(!(i.length>2))return void o.default.warning("Library name has to be at least 3 characters long.");e.set("name",i),t=!0}var s=this.$el.find(".input_library_description").val();void 0!==s&&s!==e.get("description")&&(e.set("description",s),t=!0);var a=this.$el.find(".input_library_synopsis").val();if(void 0!==a&&a!==e.get("synopsis")&&(e.set("synopsis",a),t=!0),t){var r=this;e.save(null,{patch:!0,success:function(e){r.edit_mode=!1,r.repaint(e),o.default.success("Changes to library saved.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while attempting to update the library.")}})}else this.edit_mode=!1,this.repaint(e),o.default.info("Nothing has changed.")},delete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.destroy({success:function(e){e.set("deleted",!0),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,!1===Galaxy.libraries.preferences.get("with_deleted")?(s(".tooltip").hide(),t.repaint(e),t.$el.remove()):!0===Galaxy.libraries.preferences.get("with_deleted")&&t.repaint(e),o.default.success("Library has been marked deleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured during deleting the library.")}})},undelete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.url=e.urlRoot+e.id+"?undelete=true",e.destroy({success:function(e){e.set("deleted",!1),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,t.repaint(e),o.default.success("Library has been undeleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while undeleting the library.")}})},templateRow:function(){return a.template(['" style="display:none;" data-id="<%- library.get("id") %>">',"<% if(!edit_mode) { %>",'<% if(library.get("deleted")) { %>','<%- library.get("name") %>',"<% } else { %>",'"><%- library.get("name") %>',"<% } %>",'<% if(library.get("description")) { %>','<% if( (library.get("description")).length> 80 ) { %>','"><%= _.escape(library.get("description")).substring(0, 80) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("description"))%>',"<% } %>","<% } else { %>","","<% } %>",'<% if(library.get("synopsis")) { %>','<% if( (library.get("synopsis")).length> 120 ) { %>','"><%= _.escape(library.get("synopsis")).substring(0, 120) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("synopsis"))%>',"<% } %>","<% } else { %>","","<% } %>","<% } else if(edit_mode){ %>",'','','',"<% } %>",'','<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',' ',"<% }%>",'','/permissions">','','','','" class="fa fa-ban fa-lg">','',"",""].join(""))}});t.default={LibraryRowView:n}}).call(t,i(1),i(0),i(2))},305:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=e.View.extend({el:"#center",defaults:{search_term:""},events:{"click #create_new_library_btn":"createLibraryFromModal","click #include_deleted_chk":"includeDeletedChecked","click #exclude_restricted_chk":"excludeRestrictedChecked","click .page_size_prompt":"showPageSizePrompt","keyup .library-search-input":"searchLibraries"},initialize:function(e){this.options=s.defaults(this.options||{},e,this.defaults),this.render()},render:function(){var e=this.templateToolBar(),t=!1,i=!0;Galaxy.user&&(t=Galaxy.user.isAdmin(),i=Galaxy.user.isAnonymous()),this.$el.html(e({admin_user:t,anon_user:i})),t&&(this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted"),this.$el.find("#exclude_restricted_chk")[0].checked=Galaxy.libraries.preferences.get("without_restricted"))},renderPaginator:function(e){this.options=s.extend(this.options,e);var t=this.templatePaginator();this.$el.find("#library_paginator").html(t({show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_libraries_count:this.options.total_libraries_count,libraries_shown:this.options.libraries_shown,library_page_size:Galaxy.libraries.preferences.get("library_page_size")}))},createLibraryFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this;this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){t.createNewLibrary()},Close:function(){t.modal.hide()}}})},createNewLibrary:function(){var e=this.serializeNewLibrary();if(this.validateNewLibrary(e)){var t=new d.default.Library,i=this;t.save(e,{success:function(e){Galaxy.libraries.libraryListView.collection.add(e),i.modal.hide(),i.clearLibraryModal(),Galaxy.libraries.libraryListView.render(),n.default.success("Library created.")},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg):n.default.error("An error occured.")}})}else n.default.error("Library's name is missing.");return!1},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many libraries per page do you want to see?",Galaxy.libraries.preferences.get("library_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({library_page_size:parseInt(t)}),Galaxy.libraries.libraryListView.render({show_page:1}))},clearLibraryModal:function(){a("input[name='Name']").val(""),a("input[name='Description']").val(""),a("input[name='Synopsis']").val("")},serializeNewLibrary:function(){return{name:a("input[name='Name']").val(),description:a("input[name='Description']").val(),synopsis:a("input[name='Synopsis']").val()}},validateNewLibrary:function(e){return""!==e.name},includeDeletedChecked:function(e){e.target.checked?(Galaxy.libraries.preferences.set({with_deleted:!0}),Galaxy.libraries.libraryListView.fetchDeleted()):(Galaxy.libraries.preferences.set({with_deleted:!1}),Galaxy.libraries.libraryListView.render())},excludeRestrictedChecked:function(e){e.target.checked?Galaxy.libraries.preferences.set({without_restricted:!0}):Galaxy.libraries.preferences.set({without_restricted:!1}),Galaxy.libraries.libraryListView.render()},searchLibraries:function(e){var t=a(".library-search-input").val();this.options.search_term=t,Galaxy.libraries.libraryListView.searchLibraries(t)},templateToolBar:function(){return s.template(['
','
','
','
','DATA LIBRARIES','',"",'
','',"
","<% if(admin_user === true) { %>",'
',"","","
",'','',"","<% } %>",'','','',"","","
","
","
",'
',"
","
"].join(""))},templatePaginator:function(){return s.template(['","",' <%- libraries_shown %> libraries shown (change)',"",""," <%- total_libraries_count %> total",""].join(""))},templateNewLibraryInModal:function(){return s.template(['
',"
",'','','',"
","
"].join(""))}});t.default={LibraryToolbarView:c}}).call(t,i(1),i(2),i(0))},306:function(e,t,i){"use strict";(function(e,s,a,r){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=i(3),l=o(n),d=i(42),c=o(d),h=i(156),_=o(h),p=i(139),u=o(p);i(198);var f=e.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page_size_prompt":"showPageSizePrompt"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=s.defaults(e||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(e){this.options=s.extend(this.options,e);var t=this.templateToolBar(),i={id:this.options.id,is_admin:!1,is_anonym:!0,mutiple_add_dataset_options:!1};Galaxy.user&&(i.is_admin=Galaxy.user.isAdmin(),i.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(i.mutiple_add_dataset_options=!0)),this.$el.html(t(i))},renderPaginator:function(e){this.options=s.extend(this.options,e);var t=this.templatePaginator();a("body").find(".folder-paginator").html(t({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(e){this.options=s.extend(this.options,e),!0===this.options.can_add_library_item?a(".add-library-items").show():a(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?(a(".dataset-manipulation").show(),a(".logged-dataset-manipulation").hide()):(a(".logged-dataset-manipulation").show(),a(".dataset-manipulation").show()):(a(".logged-dataset-manipulation").hide(),a(".dataset-manipulation").hide()),this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this,i=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Folder",body:i(),buttons:{Create:function(){t.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var t=this.serialize_new_folder();if(this.validate_new_folder(t)){var i,s=new _.default.FolderAsModel,a=e.history.fragment.split("/");i=a.indexOf("page")>-1?a[a.length-3]:a[a.length-1],s.url=s.urlRoot+i,s.save(t,{success:function(e){Galaxy.modal.hide(),c.default.success("Folder created."),e.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(e)},error:function(e,t){Galaxy.modal.hide(),void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")}})}else c.default.error("Folder's name is missing.");return!1},serialize_new_folder:function(){return{name:a("input[name='Name']").val(),description:a("input[name='Description']").val()}},validate_new_folder:function(e){return""!==e.name},modalBulkImport:function(){if(0===this.findCheckedRows().length)c.default.info("You must select some datasets first.");else{var e=this;this.histories=new _.default.GalaxyHistories,this.histories.fetch().done(function(){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:"Import into History",body:t({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")})}},importAllIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)a.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.options.last_used_history_id=e.id,t.processImportToHistory(e.id,e.name)}).fail(function(e,t,i){c.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var i=a("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=i;var s=a("select[name=dataset_import_bulk] option:selected").text();this.processImportToHistory(i,s),this.modal.enableButton("Import")}},processImportToHistory:function(e,t){var i=[],s=[];this.findCheckedRows().each(function(){var e=a(this).closest("tr").data("id");"F"==e.substring(0,1)?s.push(e):i.push(e)});for(var o=[],n=i.length-1;n>=0;n--){var l=i[n],d=new _.default.HistoryItem;d.url=d.urlRoot+e+"/contents",d.content=l,d.source="library",o.push(d)}for(var n=s.length-1;n>=0;n--){var c=s[n],d=new _.default.HistoryItem;d.url=d.urlRoot+e+"/contents",d.content=c,d.source="library_folder",o.push(d)}this.initChainCallControl({length:o.length,action:"to_history",history_name:t}),r.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(o,t)},updateProgress:function(){this.progress+=this.progressStep,a(".progress-bar-import").width(Math.round(this.progress)+"%");var e=Math.round(this.progress)+"% Complete";a(".completion_span").text(e)},download:function(e,t){var i=[],s=[];this.findCheckedRows().each(function(){var e=a(this).closest("tr").data("id");"F"==e.substring(0,1)?s.push(e):i.push(e)});var r=Galaxy.root+"api/libraries/datasets/download/"+t,o={ld_ids:i,folder_ids:s};this.processDownload(r,o,"get")},processDownload:function(e,t,i){if(e&&t){t="string"==typeof t?t:a.param(t);var s="";a.each(t.split("&"),function(){var e=this.split("=");s+=''}),a('
'+s+"
").appendTo("body").submit().remove(),c.default.info("Your download will begin soon.")}else c.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new _.default.GalaxyHistories;var e=this;this.histories.fetch().done(function(){e.modal=Galaxy.modal;var t=e.templateAddFilesFromHistory();e.modal.show({closing_events:!0,title:"Adding datasets from your history",body:t({histories:e.histories.models}),buttons:{Add:function(){e.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),e.fetchAndDisplayHistoryContents(e.histories.models[0].id),a("#dataset_add_bulk").change(function(t){e.fetchAndDisplayHistoryContents(t.target.value)})}).fail(function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")})},importFilesFromPathModal:function(){var e=this;this.modal=Galaxy.modal;var t=this.templateImportPathModal();this.modal.show({closing_events:!0,title:"Please enter paths to import",body:t({}),buttons:{Import:function(){e.importFromPathsClicked(e)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var e=this;l.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){e.list_extensions=[];for(var i in t)e.list_extensions.push({id:t[i].extension,text:t[i].extension,description:t[i].description,description_url:t[i].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id=0;h--){var _=l[h].trim();0!==_.length&&d.push(_)}this.initChainCallControl({length:d.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:d,preserve_dirs:e,link_data:t,space_to_tab:i,to_posix_lines:s,source:"admin_path",file_type:o,tag_using_filenames:r,dbkey:n})}else c.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(e){var t;switch(e.action){case"adding_datasets":t=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(t({folder_name:this.options.folder_name}));break;case"deleting_datasets":t=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(t());break;case"to_history":t=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(t({history_name:e.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/e.length,this.options.chain_call_control.total_number=e.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(e,t){var i=a("#jstree_browser").jstree().get_selected(!0),r=s.filter(i,function(e){return 0==e.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),n=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),d=this.modal.$el.find(".posix-checkbox").is(":checked"),h=this.select_extension.value(),_=this.select_genome.value(),p=this.modal.$el.find(".tag-files").is(":checked"),u=r[0].type,f=[];if(r.length<1)c.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var g=r.length-1;g>=0;g--)void 0!==r[g].li_attr.full_path&&f.push(r[g].li_attr.full_path);if(this.initChainCallControl({length:f.length,action:"adding_datasets"}),"folder"===u){var m=t.source+"_folder";this.chainCallImportingFolders({paths:f,preserve_dirs:o,link_data:n,space_to_tab:l,to_posix_lines:d,source:m,file_type:h,dbkey:_,tag_using_filenames:p})}else if("file"===u){var m=t.source+"_file";this.chainCallImportingUserdirFiles({paths:f,file_type:h,dbkey:_,link_data:n,space_to_tab:l,to_posix_lines:d,source:m,tag_using_filenames:p})}}},fetchAndDisplayHistoryContents:function(e){var t=new _.default.HistoryContents({id:e}),i=this;t.fetch({success:function(t){var s=i.templateHistoryContents();i.histories.get(e).set({contents:t}),i.modal.$el.find("#selected_history_content").html(s({history_contents:t.models.reverse()})),i.modal.$el.find(".history-import-select-all").bind("click",function(){a("#selected_history_content [type=checkbox]").prop("checked",!0)}),i.modal.$el.find(".history-import-unselect-all").bind("click",function(){a("#selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find("#selected_history_content").find(":checked"),t=[],i=[],s=[];if(e.length<1)c.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),e.each(function(){var e=a(this).closest("li").data("id");if(e){var s=a(this).closest("li").data("name");t.push(e),i.push(s)}});for(var r=t.length-1;r>=0;r--){var o=t[r],n=new _.default.Item;n.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===i[r]?n.set({from_hdca_id:o}):n.set({from_hda_id:o}),s.push(n)}this.initChainCallControl({length:s.length,action:"adding_datasets"}),this.chainCallAddingHdas(s)}},chainCallImportingIntoHistory:function(e,t){var i=this,s=e.pop();if(void 0===s)return 0===this.options.chain_call_control.failed_number?c.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?c.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;n--){var l=new _.default.Item({id:e[n]});o.push(l)}for(var n=t.length-1;n>=0;n--){var d=new _.default.FolderAsModel({id:t[n]});o.push(d)}this.options.chain_call_control.total_number=r,this.chainCallDeletingItems(o)}},showLocInfo:function(){var e=null,t=this;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new _.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")}}))},showLocInfoModal:function(e){var t=this,i=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Location Details",body:i({library:e,options:t.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(e){switch(e.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),c.default.error("Invalid import source.")}},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(t)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return a("#folder_list_body").find(":checked")},templateToolBar:function(){return s.template(['
','
','
',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'','",'','','","","","
","",'
',"
",'
',"
"].join(""))},templateLocInfoInModal:function(){return s.template(["
",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
library
name<%- library.get("name") %>
description<%- library.get("description") %>
synopsis<%- library.get("synopsis") %>
created"><%- library.get("create_time_pretty") %>
id<%- library.get("id") %>
",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
folder
name<%- options.folder_name %>
description<%- options.folder_description %>
id<%- options.id %>
","
"].join(""))},templateNewFolderInModal:function(){return s.template(['
',"
",'','',"
","
"].join(""))},templateBulkImportInModal:function(){return s.template(["
",'
',"Select history: ",'","
",'
',"or create new: ",'',"","
","
"].join(""))},templateImportIntoHistoryProgressBar:function(){return s.template(['
',"Importing selected items to history <%= _.escape(history_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateAddingDatasetsProgressBar:function(){return s.template(['
',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateDeletingItemsProgressBar:function(){return s.template(['
',"
",'
','
','0% Complete',"
","
"].join(""))},templateBrowserModal:function(){return s.template(['
','
All files you select will be imported into the current folder ignoring their folder structure.
','','
','",'","
",'
','",'",'",'","
",'",'","
",'
',"
","
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
","
",'","
","
"].join(""))},templateImportPathModal:function(){return s.template(['
','
All files within the given folders and their subfolders will be imported into the current folder.
','
','",'","
",'",'","
",'',"
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
",'","
","
"].join(""))},templateAddFilesFromHistory:function(){return s.template(['
',"
","1. Select history: ",'","
","
",'
',"
","
"].join(""))},templateHistoryContents:function(){return s.template(["

2. Choose the datasets to import:

","
",'",'","
","
","
    ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">',"
  • ","<% } else { %>",'
  • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
  • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">','","
  • ","<% } %>","<% } %>","<% }); %>","
"].join(""))},templatePaginator:function(){return s.template(['","",' <%- items_shown %> items shown (change)',"",""," <%- total_items_count %> total",""].join(""))}});t.default={FolderToolbarView:f}}).call(t,i(1),i(2),i(0),i(0))},307:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(139),h=r(c),_=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=s.extend(this.options,e),this.options.id&&this.fetchLibrary()},fetchLibrary:function(e){this.options=s.extend(this.options,e),this.model=new d.default.Library({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):n.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=s.extend(this.options,e),a(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_library_role_list.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1}));var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var i=this.templateLibraryPermissions();this.$el.html(i({library:this.model,is_admin:t}));var r=this;a.get(Galaxy.root+"api/libraries/"+r.id+"/permissions?scope=current").done(function(e){r.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){n.default.error("An error occurred while attempting to fetch library permissions.")}),a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],i=0;i=0;i--)t.push(e[i].id);return t},savePermissions:function(e){var t=this,i=this._extractIds(this.accessSelectObject.$el.select2("data")),s=this._extractIds(this.addSelectObject.$el.select2("data")),r=this._extractIds(this.manageSelectObject.$el.select2("data")),o=this._extractIds(this.modifySelectObject.$el.select2("data"));a.post(Galaxy.root+"api/libraries/"+t.id+"/permissions?action=set_permissions",{"access_ids[]":i,"add_ids[]":s,"manage_ids[]":r,"modify_ids[]":o}).done(function(e){t.showPermissions({fetched_permissions:e}),n.default.success("Permissions saved.")}).fail(function(){n.default.error("An error occurred while attempting to set library permissions.")})},templateLibraryPermissions:function(){return s.template(['
','","

",'Library: <%= _.escape(library.get("name")) %>',"

",'
',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any library on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
",'
',"

Library permissions

","

Roles that can access the library

",'
','
',"User with any of these roles can access this library. If there are no access roles set on the library it is considered unrestricted.","
","

Roles that can manage permissions on this library

",'
','
',"User with any of these roles can manage permissions on this library (includes giving access).","
","

Roles that can add items to this library

",'
','
',"User with any of these roles can add items to this library (folders and datasets).","
","

Roles that can modify this library

",'
','
',"User with any of these roles can modify this library (name, synopsis, etc.).","
",'","
","
"].join(""))}});t.default={LibraryView:_}}).call(t,i(1),i(2),i(0))},308:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(139),h=r(c),_=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=s.extend(this.options,e),this.options.id&&this.fetchFolder()},fetchFolder:function(e){this.options=s.extend(this.options,e),this.model=new d.default.FolderAsModel({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):n.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=s.extend(this.options,e),a(".tooltip").remove();var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var i=this.templateFolderPermissions();this.$el.html(i({folder:this.model,is_admin:t}));var r=this;a.get(Galaxy.root+"api/folders/"+r.id+"/permissions?scope=current").done(function(e){r.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){n.default.error("An error occurred while attempting to fetch folder permissions.")}),a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],i=0;i=0;i--)t.push(e[i].id);return t},savePermissions:function(e){var t=this,i=this._extractIds(this.addSelectObject.$el.select2("data")),s=this._extractIds(this.manageSelectObject.$el.select2("data")),r=this._extractIds(this.modifySelectObject.$el.select2("data"));a.post(Galaxy.root+"api/folders/"+t.id+"/permissions?action=set_permissions",{"add_ids[]":i,"manage_ids[]":s,"modify_ids[]":r}).done(function(e){t.showPermissions({fetched_permissions:e}),n.default.success("Permissions saved.")}).fail(function(){n.default.error("An error occurred while attempting to set folder permissions.")})},templateFolderPermissions:function(){return s.template(['
','","

",'Folder: <%= _.escape(folder.get("name")) %>',"

",'
',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any folder on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
",'
',"

Folder permissions

","

","Roles that can manage permissions on this folder","

",'
','
',"User with any of these roles can manage permissions on this folder.","
","

","Roles that can add items to this folder","

",'
','
',"User with any of these roles can add items to this folder (folders and datasets).","
","

","Roles that can modify this folder","

",'
','
',"User with any of these roles can modify this folder (name, etc.).","
",'","
","
"].join(""))}});t.default={FolderView:_}}).call(t,i(1),i(2),i(0))},62:function(e,t,i){"use strict";function s(e,t){var i=void 0!==e.prototype?e.prototype:e;return void 0!==t&&(i._logNamespace=t),a.forEach(function(e){i[e]=function(){if(this.logger)return this.logger.emit?this.logger.emit(e,this._logNamespace,arguments):this.logger[e]?this.logger[e].apply(this.logger,arguments):void 0}}),e}Object.defineProperty(t,"__esModule",{value:!0});var a=["log","debug","info","warn","error","metric"];t.default=s},8:function(e,t,i){"use strict";(function(e){function s(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function r(e,t){var i=Array.prototype.slice.call(arguments,0),s=i.pop();return i.unshift(s),d.defaults.apply(d,i)}function o(e,t){t=t||"model";var i=d.template(e.join(""));return function(e,s){var a={view:s||{},_l:f.default};return a[t]=e||{},i(a)}}function n(e,t){t=t||{};var i=t.ascending?1:-1;return function(t,s){return t=t.get(e),s=s.get(e),(ts?1:0)*i}}Object.defineProperty(t,"__esModule",{value:!0});var l=i(2),d=a(l),c=i(1),h=a(c),_=i(62),p=s(_),u=i(7),f=s(u),g={logger:null,_logNamespace:"."};(0,p.default)(g);var m=h.Model.extend({initialize:function(e){if(this._checkEnabledSessionStorage(),!e.id)throw new Error("SessionStorageModel requires an id in the initial attributes");this.id=e.id;var t=this.isNew()?{}:this._read(this);this.clear({silent:!0}),this.save(d.extend({},this.defaults,t,e),{silent:!0}),this.on("change",function(){this.save()})},_checkEnabledSessionStorage:function(){try{return window.sessionStorage.length>=0}catch(e){return alert("Please enable cookies in your browser for this Galaxy site"),!1}},sync:function(e,t,i){i.silent||t.trigger("request",t,{},i);var s={};switch(e){case"create":s=this._create(t);break;case"read":s=this._read(t);break;case"update":s=this._update(t);break;case"delete":s=this._delete(t)}return void 0!==s||null!==s?i.success&&i.success():i.error&&i.error(),s},_create:function(e){try{var t=e.toJSON(),i=sessionStorage.setItem(e.id,JSON.stringify(t));return null===i?i:t}catch(e){if(!(e instanceof DOMException&&navigator.userAgent.indexOf("Safari")>-1))throw e}return null},_read:function(e){return JSON.parse(sessionStorage.getItem(e.id))},_update:function(e){return e._create(e)},_delete:function(e){return sessionStorage.removeItem(e.id)},isNew:function(){return!sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});!function(){m.prototype=d.omit(m.prototype,"url","urlRoot")}();var b={searchAttributes:[],searchAliases:{},searchAttribute:function(e,t){var i=this.get(e);return!(!t||void 0===i||null===i)&&(d.isArray(i)?this._searchArrayAttribute(i,t):-1!==i.toString().toLowerCase().indexOf(t.toLowerCase()))},_searchArrayAttribute:function(e,t){return t=t.toLowerCase(),d.any(e,function(e){return-1!==e.toString().toLowerCase().indexOf(t.toLowerCase())})},search:function(e){var t=this;return d.filter(this.searchAttributes,function(i){return t.searchAttribute(i,e)})},matches:function(e){var t=e.split("=");if(t.length>=2){var i=t[0];return i=this.searchAliases[i]||i,this.searchAttribute(i,t[1])}return!!this.search(e).length},matchesAll:function(e){var t=this;return e=e.match(/(".*"|\w*=".*"|\S*)/g).filter(function(e){return!!e}),d.all(e,function(e){return e=e.replace(/"/g,""),t.matches(e)})}},y={hiddenUntilActivated:function(t,i){if(i=i||{},this.HUAVOptions={$elementShown:this.$el,showFn:e.prototype.toggle,showSpeed:"fast"},d.extend(this.HUAVOptions,i||{}),this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible"),this.hidden=this.isHidden(),t){var s=this;t.on("click",function(e){s.toggle(s.HUAVOptions.showSpeed)})}},isHidden:function(){return this.HUAVOptions.$elementShown.is(":hidden")},toggle:function(){return this.hidden?(this.HUAVOptions.hasBeenShown||d.isFunction(this.HUAVOptions.onshowFirstTime)&&(this.HUAVOptions.hasBeenShown=!0,this.HUAVOptions.onshowFirstTime.call(this)),d.isFunction(this.HUAVOptions.onshow)&&(this.HUAVOptions.onshow.call(this),this.trigger("hiddenUntilActivated:shown",this)),this.hidden=!1):(d.isFunction(this.HUAVOptions.onhide)&&(this.HUAVOptions.onhide.call(this),this.trigger("hiddenUntilActivated:hidden",this)),this.hidden=!0),this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}},v={initialize:function(e){this.draggable=e.draggable||!1},$dragHandle:function(){return this.$(".title-bar")},toggleDraggable:function(){this.draggable?this.draggableOff():this.draggableOn()},draggableOn:function(){this.draggable=!0,this.dragStartHandler=d.bind(this._dragStartHandler,this),this.dragEndHandler=d.bind(this._dragEndHandler,this);var e=this.$dragHandle().attr("draggable",!0).get(0);e.addEventListener("dragstart",this.dragStartHandler,!1),e.addEventListener("dragend",this.dragEndHandler,!1)},draggableOff:function(){this.draggable=!1;var e=this.$dragHandle().attr("draggable",!1).get(0);e.removeEventListener("dragstart",this.dragStartHandler,!1),e.removeEventListener("dragend",this.dragEndHandler,!1)},_dragStartHandler:function(e){return e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON())),this.trigger("draggable:dragstart",e,this),!1},_dragEndHandler:function(e){return this.trigger("draggable:dragend",e,this),!1}},w={initialize:function(e){this.selectable=e.selectable||!1,this.selected=e.selected||!1},$selector:function(){return this.$(".selector")},_renderSelected:function(){this.$selector().find("span").toggleClass("fa-check-square-o",this.selected).toggleClass("fa-square-o",!this.selected)},toggleSelector:function(){this.$selector().is(":visible")?this.hideSelector():this.showSelector()},showSelector:function(e){e=void 0!==e?e:this.fxSpeed,this.selectable=!0,this.trigger("selectable",!0,this),this._renderSelected(),e?this.$selector().show(e):this.$selector().show()},hideSelector:function(e){e=void 0!==e?e:this.fxSpeed,this.selectable=!1,this.trigger("selectable",!1,this),e?this.$selector().hide(e):this.$selector().hide()},toggleSelect:function(e){this.selected?this.deselect(e):this.select(e)},select:function(e){return this.selected||(this.trigger("selected",this,e),this.selected=!0,this._renderSelected()),!1},deselect:function(e){return this.selected&&(this.trigger("de-selected",this,e),this.selected=!1,this._renderSelected()),!1}};t.default={LoggableMixin:g,SessionStorageModel:m,mixin:r,SearchableModelMixin:b,HiddenUntilActivatedViewMixin:y,DraggableViewMixin:v,SelectableViewMixin:w,wrapTemplate:o,buildComparator:n}}).call(t,i(0))}},[298]); \ No newline at end of file +p=!0,u=0,f=o.data.nodes.length;ue.inArray(o.data.nodes[u],b.children)&&(m-=1)),!(p=p&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(g,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[u]):o.data.nodes[u],c,m,{dnd:!0,ref:w.get_node(x.parent()),pos:j,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(i=w.last_error());break}if(p)return"i"===j&&x.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(s=setTimeout(function(e,t){return function(){e.open_node(t)}}(w,x),w.settings.dnd.open_timeout)),t={ins:w,par:c,pos:"i"!==j||"last"!==y||0!==h||w.is_loaded(v)?h:"last"},a.css({left:n+"px",top:l+"px"}).show(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),i={},_=!0,!1}),!0===_))return}else{for(p=!0,u=0,f=o.data.nodes.length;u
").html(a).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove touchmove",e.vakata.dnd.drag),e(document).bind("mouseup touchend",e.vakata.dnd.stop),!1},drag:function(i){if("touchmove"===i.type&&i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(i.pageX=i.originalEvent.changedTouches[0].pageX,i.pageY=i.originalEvent.changedTouches[0].pageY,i.target=document.elementFromPoint(i.originalEvent.changedTouches[0].pageX-window.pageXOffset,i.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_down){if(!t.is_drag){if(!(Math.abs(i.pageX-t.init_x)>(t.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)||Math.abs(i.pageY-t.init_y)>(t.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth()),t.is_drag=!0,e.vakata.dnd._trigger("start",i)}var s=!1,a=!1,r=!1,o=!1,n=!1,l=!1,d=!1,c=!1,h=!1,_=!1;return t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1,e(e(i.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var s=e(this),a=s.offset();if(this.scrollHeight>this.offsetHeight&&(a.top+s.height()-i.pageYthis.offsetWidth&&(a.left+s.width()-i.pageXo&&i.pageY-do&&o-(i.pageY-d)l&&i.pageX-cl&&l-(i.pageX-c)r&&(h=r-50),n&&_+t.helper_w>n&&(_=n-(t.helper_w+2)),t.helper.css({left:_+"px",top:h+"px"})),e.vakata.dnd._trigger("move",i),!1}},stop:function(i){if("touchend"===i.type&&i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(i.pageX=i.originalEvent.changedTouches[0].pageX,i.pageY=i.originalEvent.changedTouches[0].pageY,i.target=document.elementFromPoint(i.originalEvent.changedTouches[0].pageX-window.pageXOffset,i.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_drag)e.vakata.dnd._trigger("stop",i);else if("touchend"===i.type&&i.target===t.target){var s=setTimeout(function(){e(i.target).click()},100);e(i.target).one("click",function(){s&&clearTimeout(s)})}return e.vakata.dnd._clean(),!1}}}(e),e.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},e.jstree.plugins.search=function(t,i){this.bind=function(){i.bind.call(this),this._data.search.str="",this._data.search.dom=e(),this._data.search.res=[],this._data.search.opn=[],this.element.on("before_open.jstree",e.proxy(function(t,i){var s,a,r=this._data.search.res,o=[],n=e();if(r&&r.length&&(this._data.search.dom=e(this.element[0].querySelectorAll("#"+e.map(r,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(e.jstree.idregex,"\\$&"):t.replace(e.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this.settings.search.show_only_matches&&this._data.search.res.length)){for(s=0,a=r.length;s32&&(i.fuzzy=!1),i.fuzzy&&(s=1<=u;l--)if(m=a[t.charAt(l-1)],g[l]=0===o?(g[l+1]<<1|1)&m:(g[l+1]<<1|1)&m|(p[l+1]|p[l])<<1|1|p[l+1],g[l]&s&&(x=r(o,l-1))<=y){if(y=x,v=l-1,k.push(v),!(v>n))break;u=Math.max(1,2*n-v)}if(r(o+1,n)>y)break;p=g}return{isMatch:v>=0,score:x}},!0===t?{search:o}:o(t)}}(e),e.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1},e.jstree.plugins.sort=function(t,i){this.bind=function(){i.bind.call(this),this.element.on("model.jstree",e.proxy(function(e,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",e.proxy(function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",e.proxy(function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)},this))},this.sort=function(t,i){var s,a;if((t=this.get_node(t))&&t.children&&t.children.length&&(t.children.sort(e.proxy(this.settings.sort,this)),i))for(s=0,a=t.children_d.length;st.ttl)&&(t&&t.state&&(t=t.state),t&&e.isFunction(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),!!t&&(this.element.one("set_state.jstree",function(i,s){s.instance.trigger("restore_state",{state:e.extend(!0,{},t)})}),this.set_state(t),!0))},this.clear_state=function(){return e.vakata.storage.del(this.settings.state.key)}},function(e,t){e.vakata.storage={set:function(e,t){return window.localStorage.setItem(e,t)},get:function(e){return window.localStorage.getItem(e)},del:function(e){return window.localStorage.removeItem(e)}}}(e),e.jstree.defaults.types={"#":{},default:{}},e.jstree.plugins.types=function(i,s){this.init=function(e,i){var a,r;if(i&&i.types&&i.types.default)for(a in i.types)if("default"!==a&&"#"!==a&&i.types.hasOwnProperty(a))for(r in i.types.default)i.types.default.hasOwnProperty(r)&&i.types[a][r]===t&&(i.types[a][r]=i.types.default[r]);s.init.call(this,e,i),this._model.data["#"].type="#"},this.refresh=function(e,t){s.refresh.call(this,e,t),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",e.proxy(function(e,i){var s,a,r=this._model.data,o=i.nodes,n=this.settings.types,l="default";for(s=0,a=o.length;s .jstree-ocl",e.proxy(function(t){t.stopImmediatePropagation();var i=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor:eq(0)").trigger(i).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",e.proxy(function(e){return e.stopImmediatePropagation(),this.hover_node(e.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),i.teardown.call(this)},this.redraw_node=function(t,s,a){if(t=i.redraw_node.call(this,t,s,a)){var r=u.cloneNode(!0);-1!==e.inArray(t.id,this._data.core.selected)&&(r.className+=" jstree-wholerow-clicked"),t.insertBefore(r,t.childNodes[0])}return t}}}})},225:function(e,t,i){"use strict";(function(e,s,a,r){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=i(42),l=o(n),d=i(156),c=o(d),h=i(3),_=o(h),p=i(139),u=o(p),f=e.View.extend({el:"#center",model:null,options:{},defaults:{edit_mode:!1},events:{"click .toolbtn_modify_dataset":"enableModification","click .toolbtn_cancel_modifications":"render","click .toolbtn-download-dataset":"downloadDataset","click .toolbtn-import-dataset":"importIntoHistory","click .copy-link-to-clipboard":"copyToClipboard","click .make-private":"makeDatasetPrivate","click .remove-restrictions":"removeDatasetRestrictions","click .toolbtn_save_permissions":"savePermissions","click .toolbtn_save_modifications":"saveModifications"},select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=s.extend(this.options,e),this.fetchExtAndGenomes(),this.options.id&&this.fetchDataset()},fetchDataset:function(e){this.options=s.extend(this.options,e),this.model=new c.default.Item({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions?t.showPermissions():t.options.show_version?t.fetchVersion():t.render()},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):l.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},render:function(e){this.options=s.extend(this.options,e),a(".tooltip").remove();var t=this.templateDataset();this.$el.html(t({item:this.model})),a(".peek").html(this.model.get("peek")),a("#center [data-toggle]").tooltip()},fetchVersion:function(e){this.options=s.extend(this.options,e);var t=this;this.options.ldda_id?(this.ldda=new c.default.Ldda({id:this.options.ldda_id}),this.ldda.url=this.ldda.urlRoot+this.model.id+"/versions/"+this.ldda.id,this.ldda.fetch({success:function(){t.renderVersion()},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg):l.default.error("An error occurred.")}})):(this.render(),l.default.error("Library dataset version requested but no id provided."))},renderVersion:function(){a(".tooltip").remove();var e=this.templateVersion();this.$el.html(e({item:this.model,ldda:this.ldda})),a(".peek").html(this.ldda.get("peek"))},enableModification:function(){a(".tooltip").remove();var e=this.templateModifyDataset();this.$el.html(e({item:this.model})),this.renderSelectBoxes({genome_build:this.model.get("genome_build"),file_ext:this.model.get("file_ext")}),a(".peek").html(this.model.get("peek")),a("#center [data-toggle]").tooltip()},downloadDataset:function(){var e=Galaxy.root+"api/libraries/datasets/download/uncompressed",t={ld_ids:this.id};this.processDownload(e,t)},processDownload:function(e,t,i){if(e&&t){t="string"==typeof t?t:a.param(t);var s="";a.each(t.split("&"),function(){var e=this.split("=");s+=''}),a('
'+s+"
").appendTo("body").submit().remove(),l.default.info("Your download will begin soon.")}},importIntoHistory:function(){this.refreshUserHistoriesList(function(e){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:"Import into History",body:t({histories:e.histories.models}),buttons:{Import:function(){e.importCurrentIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})},refreshUserHistoriesList:function(e){var t=this;this.histories=new c.default.GalaxyHistories,this.histories.fetch({success:function(i){0===i.length?l.default.warning("You have to create history first. Click this to do so.","",{onclick:function(){window.location=Galaxy.root}}):e(t)},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg):l.default.error("An error occurred.")}})},importCurrentIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)a.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.processImportToHistory(e.id)}).fail(function(e,t,i){l.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var i=a(this.modal.$el).find("select[name=dataset_import_single] option:selected").val();this.processImportToHistory(i),this.modal.enableButton("Import")}},processImportToHistory:function(e){var t=new c.default.HistoryItem;t.url=t.urlRoot+e+"/contents",r.getJSON(Galaxy.root+"history/set_as_current?id="+e),t.save({content:this.id,source:"library"},{success:function(){Galaxy.modal.hide(),l.default.success("Dataset imported. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}})},error:function(e,t){void 0!==t.responseJSON?l.default.error("Dataset not imported. "+t.responseJSON.err_msg):l.default.error("An error occured. Dataset not imported. Please try again.")}})},showPermissions:function(e){var t=this.templateDatasetPermissions(),i=this;this.options=s.extend(this.options,e),a(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_dataset_roles.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1})),this.$el.html(t({item:this.model,is_admin:Galaxy.config.is_admin_user})),a.get(Galaxy.root+"api/libraries/datasets/"+i.id+"/permissions?scope=current").done(function(e){i.prepareSelectBoxes({fetched_permissions:e,is_admin:Galaxy.config.is_admin_user})}).fail(function(){l.default.error("An error occurred while attempting to fetch dataset permissions.")}),a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],i=0;i0))return void l.default.warning("Library dataset name has to be at least 1 character long.");i.set("name",s),t=!0}var a=this.$el.find(".input_dataset_misc_info").val();void 0!==a&&a!==i.get("misc_info")&&(i.set("misc_info",a),t=!0);var r=this.select_genome.$el.select2("data").id;void 0!==r&&r!==i.get("genome_build")&&(i.set("genome_build",r),t=!0);var o=this.select_extension.$el.select2("data").id;void 0!==o&&o!==i.get("file_ext")&&(i.set("file_ext",o),t=!0);var n=this;t?i.save(null,{patch:!0,success:function(e){n.render(),l.default.success("Changes to library dataset saved.")},error:function(e,t){void 0!==t.responseJSON?l.default.error(t.responseJSON.err_msg):l.default.error("An error occured while attempting to update the library dataset.")}}):(n.render(),l.default.info("Nothing has changed."))},copyToClipboard:function(t){t.preventDefault();var i=e.history.location.href;-1!==i.lastIndexOf("/permissions")&&(i=i.substr(0,i.lastIndexOf("/permissions"))),window.prompt("Copy to clipboard: Ctrl+C, Enter",i)},makeDatasetPrivate:function(){var e=this;a.post(Galaxy.root+"api/libraries/datasets/"+e.id+"/permissions?action=make_private").done(function(t){e.model.set({is_unrestricted:!1}),e.showPermissions({fetched_permissions:t}),l.default.success("The dataset is now private to you.")}).fail(function(){l.default.error("An error occurred while attempting to make dataset private.")})},removeDatasetRestrictions:function(){var e=this;a.post(Galaxy.root+"api/libraries/datasets/"+e.id+"/permissions?action=remove_restrictions").done(function(t){e.model.set({is_unrestricted:!0}),e.showPermissions({fetched_permissions:t}),l.default.success("Access to this dataset is now unrestricted.")}).fail(function(){l.default.error("An error occurred while attempting to make dataset unrestricted.")})},_extractIds:function(e){for(var t=[],i=e.length-1;i>=0;i--)t.push(e[i].id);return t},savePermissions:function(e){var t=this,i=this._extractIds(this.accessSelectObject.$el.select2("data")),s=this._extractIds(this.manageSelectObject.$el.select2("data")),r=this._extractIds(this.modifySelectObject.$el.select2("data"));a.post(Galaxy.root+"api/libraries/datasets/"+t.id+"/permissions?action=set_permissions",{"access_ids[]":i,"manage_ids[]":s,"modify_ids[]":r}).done(function(e){t.showPermissions({fetched_permissions:e}),l.default.success("Permissions saved.")}).fail(function(){l.default.error("An error occurred while attempting to set dataset permissions.")})},fetchExtAndGenomes:function(){var e=this;0==this.list_genomes.length&&_.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){for(var i in t)e.list_extensions.push({id:t[i].extension,text:t[i].extension,description:t[i].description,description_url:t[i].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id','
','",'",'<% if (item.get("can_user_modify")) { %>','","<% } %>",'<% if (item.get("can_user_manage")) { %>','/datasets/<%- item.id %>/permissions">','","","<% } %>","
",'",'<% if (item.get("is_unrestricted")) { %>',"
",'This dataset is unrestricted so everybody with the link can access it. Just share this page.',"
","<% } %>",'
','',"",'','',"",'<% if (item.get("file_ext")) { %>',"",'','',"","<% } %>",'<% if (item.get("genome_build")) { %>',"",'','',"","<% } %>",'<% if (item.get("file_size")) { %>',"",'','',"","<% } %>",'<% if (item.get("date_uploaded")) { %>',"",'','',"","<% } %>",'<% if (item.get("uploaded_by")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_data_lines")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_comment_lines")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_columns")) { %>',"",'','',"","<% } %>",'<% if (item.get("metadata_column_types")) { %>',"",'','',"","<% } %>",'<% if (item.get("message")) { %>',"",'','',"","<% } %>",'<% if (item.get("misc_blurb")) { %>',"",'','',"","<% } %>",'<% if (item.get("misc_info")) { %>',"",'','',"","<% } %>",'<% if (item.get("tags")) { %>',"",'','',"","<% } %>",'<% if ( item.get("uuid") !== "ok" ) { %>',"",'','',"","<% } %>",'<% if ( item.get("state") !== "ok" ) { %>',"",'','',"","<% } %>","
">Name<%= _.escape(item.get("name")) %>
Data type<%= _.escape(item.get("file_ext")) %>
Genome build<%= _.escape(item.get("genome_build")) %>
Size<%= _.escape(item.get("file_size")) %>
Date uploaded (UTC)<%= _.escape(item.get("date_uploaded")) %>
Uploaded by<%= _.escape(item.get("uploaded_by")) %>
Data Lines<%= _.escape(item.get("metadata_data_lines")) %>
Comment Lines<%= _.escape(item.get("metadata_comment_lines")) %>
Number of Columns<%= _.escape(item.get("metadata_columns")) %>
Column Types<%= _.escape(item.get("metadata_column_types")) %>
Message<%= _.escape(item.get("message")) %>
Misc. blurb<%= _.escape(item.get("misc_blurb")) %>
Misc. info<%= _.escape(item.get("misc_info")) %>
Tags<%= _.escape(item.get("tags")) %>
UUID<%= _.escape(item.get("uuid")) %>
State<%= _.escape(item.get("state")) %>
",'<% if (item.get("job_stderr")) { %>',"

Job Standard Error

",'
','<%= _.escape(item.get("job_stderr")) %>',"
","<% } %>",'<% if (item.get("job_stdout")) { %>',"

Job Standard Output

",'
','<%= _.escape(item.get("job_stdout")) %>',"
","<% } %>","
",'
',"
","
",'<% if (item.get("has_versions")) { %>',"
","

Expired versions:

","
","<% } %>","
","
"].join(""))},templateVersion:function(){return s.template(['
','",'",'
This is an expired version of the library dataset: <%= _.escape(item.get("name")) %>
','
','',"",'','',"",'<% if (ldda.get("file_ext")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("genome_build")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("file_size")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("date_uploaded")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("uploaded_by")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_data_lines")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_comment_lines")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_columns")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("metadata_column_types")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("message")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("misc_blurb")) { %>',"",'','',"","<% } %>",'<% if (ldda.get("misc_info")) { %>',"",'','',"","<% } %>",'<% if (item.get("tags")) { %>',"",'','',"","<% } %>","
Name<%= _.escape(ldda.get("name")) %>
Data type<%= _.escape(ldda.get("file_ext")) %>
Genome build<%= _.escape(ldda.get("genome_build")) %>
Size<%= _.escape(ldda.get("file_size")) %>
Date uploaded (UTC)<%= _.escape(ldda.get("date_uploaded")) %>
Uploaded by<%= _.escape(ldda.get("uploaded_by")) %>
Data Lines<%= _.escape(ldda.get("metadata_data_lines")) %>
Comment Lines<%= _.escape(ldda.get("metadata_comment_lines")) %>
Number of Columns<%= _.escape(ldda.get("metadata_columns")) %>
Column Types<%= _.escape(ldda.get("metadata_column_types")) %>
Message<%= _.escape(ldda.get("message")) %>
Miscellaneous blurb<%= _.escape(ldda.get("misc_blurb")) %>
Miscellaneous information<%= _.escape(ldda.get("misc_info")) %>
Tags<%= _.escape(item.get("tags")) %>
","
",'
',"
","
","
","
"].join(""))},templateModifyDataset:function(){return s.template(['
','
','",'","
",'",'
','',"",'','',"","",'',"","","",'',"","","",'','',"","",'','',"","",'','',"",'','','',"",'','<% if (item.get("metadata_comment_lines") === "") { %>','',"<% } else { %>",'',"<% } %>","","",'','',"","",'','',"","",'','',"","",'','',"","",'','',"",'<% if (item.get("tags")) { %>',"",'','',"","<% } %>","
">Name">
Data type",'',"
Genome build",'',"
Size<%= _.escape(item.get("file_size")) %>
Date uploaded (UTC)<%= _.escape(item.get("date_uploaded")) %>
Uploaded by<%= _.escape(item.get("uploaded_by")) %>
Data Lines<%= _.escape(item.get("metadata_data_lines")) %>
Comment Lines<%= _.escape(item.get("metadata_comment_lines")) %>unknown
Number of Columns<%= _.escape(item.get("metadata_columns")) %>
Column Types<%= _.escape(item.get("metadata_column_types")) %>
Message<%= _.escape(item.get("message")) %>
Misc. blurb<%= _.escape(item.get("misc_blurb")) %>
Misc. information">
Tags<%= _.escape(item.get("tags")) %>
","
",'
',"
","
","
","
"].join(""))},templateDatasetPermissions:function(){return s.template(['
','",'",'

Dataset: <%= _.escape(item.get("name")) %>

','
',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any dataset on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% } %>","
",'
',"

Library-related permissions

","

Roles that can modify the library item

",'
','
User with any of these roles can modify name, metadata, and other information about this library item.
',"
","

Dataset-related permissions

",'
Changes made below will affect every library item that was created from this dataset and also every history this dataset is part of.
','<% if (!item.get("is_unrestricted")) { %>','

You can remove all access restrictions on this dataset.

',"<% } else { %>",'

You can make this dataset private to you.

',"<% } %>","

Roles that can access the dataset

",'
','
',"User has to have all these roles in order to access this dataset."," Users without access permission cannot have other permissions on this dataset."," If there are no access roles set on the dataset it is considered unrestricted.","
","

Roles that can manage permissions on the dataset

",'
','
',"User with any of these roles can manage permissions of this dataset. If you remove yourself you will lose the ability manage this dataset unless you are an admin.","
",'","
","
"].join(""))},templateBulkImportInModal:function(){return s.template(["
",'
',"Select history: ",'","
",'
',"or create new: ",'',"","
","
"].join(""))}});t.default={LibraryDatasetView:f}}).call(t,i(1),i(2),i(0),i(0))},298:function(e,t,i){"use strict";function s(e){new r.default.GalaxyApp(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.App=s;var a=i(299),r=function(e){return e&&e.__esModule?e:{default:e}}(a);window.libraryApp=s},299:function(e,t,i){"use strict";(function(e,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(3),o=(a(r),i(42)),n=a(o),l=i(8),d=a(l),c=i(156),h=(a(c),i(301)),_=a(h),p=i(303),u=a(p),f=i(305),g=a(f),m=i(306),b=a(m),y=i(225),v=a(y),w=i(307),x=a(w),k=i(308),j=a(k),C=e.Router.extend({initialize:function(){this.routesHit=0,e.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"libraries","page/:show_page":"libraries_page","library/:library_id/permissions":"library_permissions","folders/:folder_id/permissions":"folder_permissions","folders/:id":"folder_content","folders/:id/page/:show_page":"folder_page","folders/:folder_id/datasets/:dataset_id":"dataset_detail","folders/:folder_id/datasets/:dataset_id/permissions":"dataset_permissions","folders/:folder_id/datasets/:dataset_id/versions/:ldda_id":"dataset_version","folders/:folder_id/download/:format":"download","folders/:folder_id/import/:source":"import_datasets"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})},trackPageview:function(){var t=e.history.getFragment();/^\//.test(t)||""==t||(t="/"+t),"undefined"!=typeof ga&&ga("send","pageview",Galaxy.root+"library/list"+t)}}),S=d.default.SessionStorageModel.extend({defaults:{with_deleted:!1,without_restricted:!1,sort_order:"asc",sort_by:"name",library_page_size:20,folder_page_size:15}}),G=e.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,libraryView:null,folderToolbarView:null,folderListView:null,datasetView:null,initialize:function(){window.Galaxy.config.ga_code&&(!function(e,t,i,s,a,r,o){e.GoogleAnalyticsObject=a,e[a]=e[a]||function(){(e[a].q=e[a].q||[]).push(arguments)},e[a].l=1*new Date,r=t.createElement(i),o=t.getElementsByTagName(i)[0],r.async=1,r.src="//www.google-analytics.com/analytics.js",o.parentNode.insertBefore(r,o)}(window,document,"script",0,"ga"),ga("create",window.Galaxy.config.ga_code,"auto"),ga("send","pageview")),Galaxy.libraries=this,this.preferences=new S({id:"global-lib-prefs"}),this.library_router=new C,this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView&&Galaxy.libraries.libraryToolbarView.$el.unbind("click"),Galaxy.libraries.libraryToolbarView=new g.default.LibraryToolbarView,Galaxy.libraries.libraryListView=new u.default.LibraryListView}),this.library_router.on("route:libraries_page",function(e){null===Galaxy.libraries.libraryToolbarView?(Galaxy.libraries.libraryToolbarView=new g.default.LibraryToolbarView,Galaxy.libraries.libraryListView=new u.default.LibraryListView({show_page:e})):Galaxy.libraries.libraryListView.render({show_page:e})}),this.library_router.on("route:folder_content",function(e){Galaxy.libraries.folderToolbarView&&Galaxy.libraries.folderToolbarView.$el.unbind("click"),Galaxy.libraries.folderToolbarView=new b.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new _.default.FolderListView({id:e})}),this.library_router.on("route:folder_page",function(e,t){null===Galaxy.libraries.folderToolbarView?(Galaxy.libraries.folderToolbarView=new b.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new _.default.FolderListView({id:e,show_page:t})):Galaxy.libraries.folderListView.render({id:e,show_page:parseInt(t)})}),this.library_router.on("route:download",function(e,t){0===s("#folder_list_body").find(":checked").length?(n.default.info("You must select at least one dataset to download"),Galaxy.libraries.library_router.navigate("folders/"+e,{trigger:!0,replace:!0})):(Galaxy.libraries.folderToolbarView.download(e,t),Galaxy.libraries.library_router.navigate("folders/"+e,{trigger:!1,replace:!0}))}),this.library_router.on("route:dataset_detail",function(e,t){Galaxy.libraries.datasetView&&Galaxy.libraries.datasetView.$el.unbind("click"),Galaxy.libraries.datasetView=new v.default.LibraryDatasetView({id:t,show_version:!1,show_permissions:!1})}),this.library_router.on("route:dataset_version",function(e,t,i){Galaxy.libraries.datasetView&&Galaxy.libraries.datasetView.$el.unbind("click"),Galaxy.libraries.datasetView=new v.default.LibraryDatasetView({id:t,ldda_id:i,show_version:!0})}),this.library_router.on("route:dataset_permissions",function(e,t){Galaxy.libraries.datasetView&&Galaxy.libraries.datasetView.$el.unbind("click"),Galaxy.libraries.datasetView=new v.default.LibraryDatasetView({id:t,show_permissions:!0})}),this.library_router.on("route:library_permissions",function(e){Galaxy.libraries.libraryView&&Galaxy.libraries.libraryView.$el.unbind("click"),Galaxy.libraries.libraryView=new x.default.LibraryView({id:e,show_permissions:!0})}),this.library_router.on("route:folder_permissions",function(e){Galaxy.libraries.folderView&&Galaxy.libraries.folderView.$el.unbind("click"),Galaxy.libraries.folderView=new j.default.FolderView({id:e,show_permissions:!0})}),this.library_router.on("route:import_datasets",function(e,t){Galaxy.libraries.folderToolbarView&&Galaxy.libraries.folderListView?Galaxy.libraries.folderToolbarView.showImportModal({source:t}):(Galaxy.libraries.folderToolbarView=new b.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new _.default.FolderListView({id:e}),Galaxy.libraries.folderToolbarView.showImportModal({source:t}))}),e.history.start({pushState:!1})}});t.default={GalaxyApp:G}}).call(t,i(1),i(0))},300:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e,t){return function(i,s){return i.get("type")===s.get("type")?i.has(e)||s.has(e)?i.has(e)?s.has(e)?i.get(e).toLowerCase()>s.get(e).toLowerCase()?"asc"===t?1:-1:s.get(e).toLowerCase()>i.get(e).toLowerCase()?"asc"===t?-1:1:0:-1:1:0:"folder"===i.get("type")?-1:1}},a=function(e,t){return function(i,s){return i.get(e).toLowerCase()>s.get(e).toLowerCase()?"asc"===t?1:-1:s.get(e).toLowerCase()>i.get(e).toLowerCase()?"asc"===t?-1:1:0}};t.default={generateFolderComparator:s,generateLibraryComparator:a}},301:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(302),h=r(c),_=e.View.extend({el:"#folder_items_element",progress:0,progressStep:1,folderContainer:null,current_sort_order:"asc",current_sort_key:"name",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .folder_row":"selectClickedRow","click .sort-folder-name":"sortColumnClicked","click .sort-folder-file_ext":"sortColumnClicked","click .sort-folder-description":"sortColumnClicked","click .sort-folder-state":"sortColumnClicked"},collection:null,defaults:{include_deleted:!1,page_count:null,show_page:null},initialize:function(e){this.options=s.defaults(this.options||{},this.defaults,e),this.modal=null,this.rowViews={},this.collection=new d.default.Folder,this.listenTo(this.collection,"add",this.renderOne),this.listenTo(this.collection,"remove",this.removeOne),this.listenTo(this.collection,"sort",this.rePaint),this.listenTo(this.collection,"reset",this.rePaint),this.fetchFolder()},fetchFolder:function(e){var e=e||{};this.options.include_deleted=e.include_deleted;var t=this;this.folderContainer=new d.default.FolderContainer({id:this.options.id}),this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents",this.options.include_deleted&&(this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"),this.folderContainer.fetch({success:function(e){t.folder_container=e,t.render()},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):n.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},render:function(e){this.options=s.extend(this.options,e);var t=this.templateFolder();a(".tooltip").hide();var i,r=this.folderContainer.attributes.metadata.full_path;if(i=1===r.length?0:r[r.length-2][0],this.$el.html(t({path:this.folderContainer.attributes.metadata.full_path,parent_library_id:this.folderContainer.attributes.metadata.parent_library_id,id:this.options.id,upper_folder_id:i,order:this.current_sort_order})),this.options.dataset_id){var o=s.findWhere(self.rowViews,{id:this.options.dataset_id});o?o.showDatasetDetails():n.default.error("Requested dataset not found. Showing folder instead.")}else(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.paginate();a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},paginate:function(e){this.options=s.extend(this.options,e),(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_items_count=this.folder_container.get("folder").models.length,this.options.page_count=Math.ceil(this.options.total_items_count/Galaxy.libraries.preferences.get("folder_page_size"));var t=Galaxy.libraries.preferences.get("folder_page_size")*(this.options.show_page-1),i=null;i=this.folder_container.get("folder").models.slice(t,t+Galaxy.libraries.preferences.get("folder_page_size")),this.options.items_shown=i.length,Galaxy.libraries.preferences.get("folder_page_size")*this.options.show_page>this.options.total_items_count+Galaxy.libraries.preferences.get("folder_page_size")&&(i=[]),Galaxy.libraries.folderToolbarView.renderPaginator(this.options),this.collection.reset(i)},rePaint:function(e){this.options=s.extend(this.options,e),this.removeAllRows(),this.renderAll(),this.checkEmptiness()},addAll:function(e){s.each(e,function(e){Galaxy.libraries.folderListView.collection.add(e,{current_sort_order:!1})}),a("#center [data-toggle]").tooltip(),this.checkEmptiness(),this.postRender()},postRender:function(){var e=this.folderContainer.attributes.metadata;e.contains_file_or_folder=void 0!==this.collection.findWhere({type:"file"})||void 0!==this.collection.findWhere({type:"folder"}),Galaxy.libraries.folderToolbarView.configureElements(e)},renderAll:function(){var e=this;s.each(this.collection.models.reverse(),function(t){e.renderOne(t)}),this.postRender()},renderOne:function(e){this.options.contains_file_or_folder=!0,e.set("folder_id",this.id);var t=new h.default.FolderRowView({model:e});this.rowViews[e.get("id")]=t,this.$el.find("#first_folder_item").after(t.el)},removeOne:function(e){this.$el.find("tr").filter(function(){return a(this).data("id")&&a(this).data("id")===e.id}).remove()},removeAllRows:function(){a(".library-row").remove()},checkEmptiness:function(){0===this.$el.find(".dataset_row").length&&0===this.$el.find(".folder_row").length?this.$el.find(".empty-folder-message").show():this.$el.find(".empty-folder-message").hide()},sortColumnClicked:function(e){e.preventDefault(),this.current_sort_order="asc"===this.current_sort_order?"desc":"asc",this.current_sort_key=e.currentTarget.className.replace("sort-folder-",""),this.collection.sortFolder(this.current_sort_key,this.current_sort_order),this.renderSortIcon()},selectAll:function(e){var t=e.target.checked,i=this;a(":checkbox","#folder_list_body").each(function(){this.checked=t;var e=a(this).closest("tr");t?i.makeDarkRow(e):i.makeWhiteRow(e)})},selectClickedRow:function(e){var t,i,s="";t=a(e.target).closest("tr"),"input"===e.target.localName?(s=e.target,i="input"):"td"===e.target.localName&&(s=t.find(":checkbox")[0],i="td"),s.checked?"td"===i?(s.checked="",this.makeWhiteRow(t)):"input"===i&&this.makeDarkRow(t):"td"===i?(s.checked="selected",this.makeDarkRow(t)):"input"===i&&this.makeWhiteRow(t)},makeDarkRow:function(e){e.removeClass("light").addClass("dark"),e.find("a").removeClass("light").addClass("dark"),e.find(".fa-file-o").removeClass("fa-file-o").addClass("fa-file"),e.find(".fa-folder-o").removeClass("fa-folder-o").addClass("fa-folder")},makeWhiteRow:function(e){e.removeClass("dark").addClass("light"),e.find("a").removeClass("dark").addClass("light"),e.find(".fa-file").removeClass("fa-file").addClass("fa-file-o"),e.find(".fa-folder").removeClass("fa-folder").addClass("fa-folder-o")},renderSortIcon:function(){"asc"===this.current_sort_order?(a('[class*="sort-icon"]').removeClass("fa-sort-alpha-desc").removeClass("fa-sort-alpha-asc"),a(".sort-icon-"+this.current_sort_key).addClass("fa-sort-alpha-asc")):a(".sort-icon-"+this.current_sort_key).addClass("fa-sort-alpha-desc")},templateFolder:function(){return s.template(['",'',"",'','','','','','','','',' ',"",'','',"","","","","","","","","","","","
name description data type sizetime updated (UTC)state
",'" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..',"
",'"].join(""))}});t.default={FolderListView:_}}).call(t,i(1),i(2),i(0))},302:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(225),h=r(c),_=e.View.extend({events:{"click .undelete_dataset_btn":"undeleteDataset","click .undelete_folder_btn":"undeleteFolder","click .edit_folder_btn":"startModifications","click .cancel_folder_btn":"cancelModifications","click .save_folder_btn":"saveModifications"},defaults:{type:null,visibility_config:{edit_folder_btn:!1,save_folder_btn:!1,cancel_folder_btn:!1,permission_folder_btn:!1},edit_mode:!1},initialize:function(e){this.options=s.defaults(e||{},this.defaults),this.render(this.options)},render:function(e){this.options=s.extend(this.options,e);var t=this.options.model,i=null;return"folder"===t.get("type")||"LibraryFolder"===t.get("model_class")?(this.options.type="folder",this.prepareButtons(t),i=t.get("deleted")?this.templateRowDeletedFolder():this.templateRowFolder()):"file"===t.get("type")||"LibraryDatasetDatasetAssociation"===t.get("model_class")||"LibraryDataset"===t.get("model_class")?(this.options.type="file",i=t.get("deleted")?this.templateRowDeletedFile():this.templateRowFile()):(Galaxy.emit.error("Unknown library item type found."),Galaxy.emit.error(t.get("type")||t.get("model_class"))),this.setElement(i({content_item:t,edit_mode:this.options.edit_mode,button_config:this.options.visibility_config})),this.$el.show(),this},prepareButtons:function(e){var t=this.options.visibility_config;!1===this.options.edit_mode?(t.save_folder_btn=!1,t.cancel_folder_btn=!1,!0===e.get("deleted")?(t.edit_folder_btn=!1,t.permission_folder_btn=!1):!1===e.get("deleted")&&(t.save_folder_btn=!1,t.cancel_folder_btn=!1,!0===e.get("can_modify")&&(t.edit_folder_btn=!0),!0===e.get("can_manage")&&(t.permission_folder_btn=!0))):!0===this.options.edit_mode&&(t.edit_folder_btn=!1,t.permission_folder_btn=!1,t.save_folder_btn=!0,t.cancel_folder_btn=!0),this.options.visibility_config=t},showDatasetDetails:function(){Galaxy.libraries.datasetView=new h.default.LibraryDatasetView({id:this.id})},undeleteDataset:function(e){a(".tooltip").hide();var t=this,i=a(e.target).closest("tr").data("id"),s=Galaxy.libraries.folderListView.collection.get(i);s.url=s.urlRoot+s.id+"?undelete=true",s.destroy({success:function(e,s){Galaxy.libraries.folderListView.collection.remove(i);var a=new d.default.Item(s);Galaxy.libraries.folderListView.collection.add(a),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),n.default.success("Dataset undeleted. Click this to see it.","",{onclick:function(){var e=t.model.get("folder_id");window.location=Galaxy.root+"library/list#folders/"+e+"/datasets/"+t.id}})},error:function(e,t){void 0!==t.responseJSON?n.default.error("Dataset was not undeleted. "+t.responseJSON.err_msg):n.default.error("An error occured! Dataset was not undeleted. Please try again.")}})},undeleteFolder:function(e){a(".tooltip").hide();var t=a(e.target).closest("tr").data("id"),i=Galaxy.libraries.folderListView.collection.get(t);i.url=i.urlRoot+i.id+"?undelete=true",i.destroy({success:function(e,i){Galaxy.libraries.folderListView.collection.remove(t);var s=new d.default.FolderAsModel(i);Galaxy.libraries.folderListView.collection.add(s),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),n.default.success("Folder undeleted.")},error:function(e,t){void 0!==t.responseJSON?n.default.error("Folder was not undeleted. "+t.responseJSON.err_msg):n.default.error("An error occured! Folder was not undeleted. Please try again.")}})},startModifications:function(){this.options.edit_mode=!0,this.repaint()},cancelModifications:function(){this.options.edit_mode=!1,this.repaint()},saveModifications:function(){var e=Galaxy.libraries.folderListView.collection.get(this.$el.data("id")),t=!1,i=this.$el.find(".input_folder_name").val();if(void 0!==i&&i!==e.get("name")){if(!(i.length>2))return void n.default.warning("Folder name has to be at least 3 characters long.");e.set("name",i),t=!0}var s=this.$el.find(".input_folder_description").val();if(void 0!==s&&s!==e.get("description")&&(e.set("description",s),t=!0),t){var a=this;e.save(null,{patch:!0,success:function(e){a.options.edit_mode=!1,a.repaint(e),n.default.success("Changes to folder saved.")},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg):n.default.error("An error occured while attempting to update the folder.")}})}else this.options.edit_mode=!1,this.repaint(e),n.default.info("Nothing has changed.")},repaint:function(){a(".tooltip").hide();var e=this.$el;this.render(),e.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},templateRowFolder:function(){return s.template(['',"",'',"",'',"<% if(!edit_mode) { %>","",'<%- content_item.get("name") %>',"","",'<%- content_item.get("description") %>',"","<% } else if(edit_mode){ %>",'','',"<% } %>","folder","","",'<%= _.escape(content_item.get("update_time")) %>',"","","","<% if(edit_mode) { %>",'",'","<% } else if (!edit_mode){%>",'",'','","","<% } %>","",""].join(""))},templateRowFile:function(){return s.template(['',"",'',"",'','',"","",'/datasets/<%- content_item.id %>" class="library-dataset">','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>','<%= _.escape(content_item.get("file_ext")) %>','<%= _.escape(content_item.get("file_size")) %>','<%= _.escape(content_item.get("update_time")) %>',"",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'<% if (content_item.get("is_unrestricted")) { %>','',"<% } %>",'<% if (content_item.get("is_private")) { %>','',"<% } %>",'<% if ((content_item.get("is_unrestricted") === false) && (content_item.get("is_private") === false)) { %>','',"<% } %>",'<% if (content_item.get("can_manage")) { %>','/datasets/<%- content_item.id %>/permissions">','","","<% } %>","",""].join(""))},templateRowDeletedFile:function(){return s.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>',"","",'<%= _.escape(content_item.get("file_ext")) %>',"","",'<%= _.escape(content_item.get("file_size")) %>',"","",'<%= _.escape(content_item.get("update_time")) %>',"","",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'','","",""].join(""))},templateRowDeletedFolder:function(){return s.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("description") %>',"","","folder","","","",'<%= _.escape(content_item.get("update_time")) %>',"","","",'','","",""].join(""))}});t.default={FolderRowView:_}}).call(t,i(1),i(2),i(0))},303:function(e,t,i){"use strict";(function(e,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(42),o=a(r),n=i(156),l=a(n),d=i(304),c=a(d),h=i(2),_=a(h),p=e.View.extend({el:"#libraries_element",events:{"click .sort-libraries-link":"sort_clicked"},defaults:{page_count:null,show_page:null,all_fetched:!1},initialize:function(e){this.options=_.default.defaults(this.options||{},e,this.defaults);var t=this;this.modal=null,this.collection=new l.default.Libraries,this.collection.url=this.collection.urlRoot+"?deleted=false",this.collection.fetch({success:function(){t.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})},render:function(e){this.options=_.default.extend(this.options,e),this.setElement("#libraries_element");var t=this.templateLibraryList(),i=null,a=null,r=function(e){return!0===e.get("public")};if(s(".tooltip").hide(),void 0!==e&&(a=void 0!==e.models?e.models:null),null!==this.collection&&null===a)this.sortLibraries(),i=Galaxy.libraries.preferences.get("with_deleted")?this.collection.models:this.collection.where({deleted:!1}),Galaxy.libraries.preferences.get("without_restricted")&&(i=_.default.filter(i,r));else if(null!==a){if(Galaxy.libraries.preferences.get("with_deleted"))i=a;else{var o=function(e){return!1===e.get("deleted")};i=_.default.filter(a,o)}Galaxy.libraries.preferences.get("without_restricted")&&(i=_.default.filter(i,r))}else i=[];(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_libraries_count=i.length;var n=Galaxy.libraries.preferences.get("library_page_size")*(this.options.show_page-1);this.options.page_count=Math.ceil(this.options.total_libraries_count/Galaxy.libraries.preferences.get("library_page_size")),this.options.total_libraries_count>0&&nthis.options.total_libraries_count+Galaxy.libraries.preferences.get("library_page_size")&&(i=[]),this.$el.html(t({length:1,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options),this.renderRows(i)):(this.$el.html(t({length:0,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options)),s("#center [data-toggle]").tooltip(),s("#center").css("overflow","auto")},fetchDeleted:function(){if(this.options.all_fetched)this.render();else{var e=this;this.collection.url=this.collection.urlRoot+"?deleted=true",this.collection.fetch({remove:!1,success:function(){e.options.all_fetched=!0,e.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})}},renderRows:function(e){for(var t=0;t',"<% if(length === 0) { %>","<% if(search_term.length > 0) { %>","
","There are no libraries matching your search. Try different keyword.","
","<% } else{ %>","
","There are no libraries visible to you here. If you expected some to show up please consult the",' library security wikipage',' or visit the Galaxy support site.',"
","<% }%>","<% } else{ %>",'',"",'",'',' ','',"",'',"","
','',"name","",'',"descriptionsynopsis
","<% }%>","
"].join(""))}});t.default={LibraryListView:p}}).call(t,i(1),i(0))},304:function(e,t,i){"use strict";(function(e,s,a){Object.defineProperty(t,"__esModule",{value:!0});var r=i(42),o=function(e){return e&&e.__esModule?e:{default:e}}(r),n=e.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library"},edit_mode:!1,element_visibility_config:{upload_library_btn:!1,edit_library_btn:!1,permission_library_btn:!1,save_library_btn:!1,cancel_library_btn:!1,delete_library_btn:!1,undelete_library_btn:!1},initialize:function(e){this.render(e)},render:function(e){void 0===e&&(e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))),this.prepareButtons(e);var t=this.templateRow();return this.setElement(t({library:e,button_config:this.element_visibility_config,edit_mode:this.edit_mode})),this.$el.show(),this},repaint:function(e){s(".tooltip").hide();var t=this.$el;this.render(),t.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){var t=this.element_visibility_config;!1===this.edit_mode?(t.save_library_btn=!1,t.cancel_library_btn=!1,t.delete_library_btn=!1,!0===e.get("deleted")?(t.undelete_library_btn=!0,t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1):!1===e.get("deleted")&&(t.save_library_btn=!1,t.cancel_library_btn=!1,t.undelete_library_btn=!1,!0===e.get("can_user_add")&&(t.upload_library_btn=!0),!0===e.get("can_user_modify")&&(t.edit_library_btn=!0),!0===e.get("can_user_manage")&&(t.permission_library_btn=!0))):!0===this.edit_mode&&(t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1,t.save_library_btn=!0,t.cancel_library_btn=!0,t.delete_library_btn=!0,t.undelete_library_btn=!1),this.element_visibility_config=t},edit_button_clicked:function(){this.edit_mode=!0,this.repaint()},cancel_library_modification:function(){this.edit_mode=!1,this.repaint()},save_library_modification:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=!1,i=this.$el.find(".input_library_name").val();if(void 0!==i&&i!==e.get("name")){if(!(i.length>2))return void o.default.warning("Library name has to be at least 3 characters long.");e.set("name",i),t=!0}var s=this.$el.find(".input_library_description").val();void 0!==s&&s!==e.get("description")&&(e.set("description",s),t=!0);var a=this.$el.find(".input_library_synopsis").val();if(void 0!==a&&a!==e.get("synopsis")&&(e.set("synopsis",a),t=!0),t){var r=this;e.save(null,{patch:!0,success:function(e){r.edit_mode=!1,r.repaint(e),o.default.success("Changes to library saved.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while attempting to update the library.")}})}else this.edit_mode=!1,this.repaint(e),o.default.info("Nothing has changed.")},delete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.destroy({success:function(e){e.set("deleted",!0),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,!1===Galaxy.libraries.preferences.get("with_deleted")?(s(".tooltip").hide(),t.repaint(e),t.$el.remove()):!0===Galaxy.libraries.preferences.get("with_deleted")&&t.repaint(e),o.default.success("Library has been marked deleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured during deleting the library.")}})},undelete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.url=e.urlRoot+e.id+"?undelete=true",e.destroy({success:function(e){e.set("deleted",!1),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,t.repaint(e),o.default.success("Library has been undeleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while undeleting the library.")}})},templateRow:function(){return a.template(['" style="display:none;" data-id="<%- library.get("id") %>">',"<% if(!edit_mode) { %>",'<% if(library.get("deleted")) { %>','<%- library.get("name") %>',"<% } else { %>",'"><%- library.get("name") %>',"<% } %>",'<% if(library.get("description")) { %>','<% if( (library.get("description")).length> 80 ) { %>','"><%= _.escape(library.get("description")).substring(0, 80) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("description"))%>',"<% } %>","<% } else { %>","","<% } %>",'<% if(library.get("synopsis")) { %>','<% if( (library.get("synopsis")).length> 120 ) { %>','"><%= _.escape(library.get("synopsis")).substring(0, 120) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("synopsis"))%>',"<% } %>","<% } else { %>","","<% } %>","<% } else if(edit_mode){ %>",'','','',"<% } %>",'','<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',' ',"<% }%>",'','/permissions">','','','','" class="fa fa-ban fa-lg">','',"",""].join(""))}});t.default={LibraryRowView:n}}).call(t,i(1),i(0),i(2))},305:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=e.View.extend({el:"#center",defaults:{search_term:""},events:{"click #create_new_library_btn":"createLibraryFromModal","click #include_deleted_chk":"includeDeletedChecked","click #exclude_restricted_chk":"excludeRestrictedChecked","click .page_size_prompt":"showPageSizePrompt","keyup .library-search-input":"searchLibraries"},initialize:function(e){this.options=s.defaults(this.options||{},e,this.defaults),this.render()},render:function(){var e=this.templateToolBar(),t=!1,i=!0;Galaxy.user&&(t=Galaxy.user.isAdmin(),i=Galaxy.user.isAnonymous()),this.$el.html(e({admin_user:t,anon_user:i})),t&&(this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted"),this.$el.find("#exclude_restricted_chk")[0].checked=Galaxy.libraries.preferences.get("without_restricted"))},renderPaginator:function(e){this.options=s.extend(this.options,e);var t=this.templatePaginator();this.$el.find("#library_paginator").html(t({show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_libraries_count:this.options.total_libraries_count,libraries_shown:this.options.libraries_shown,library_page_size:Galaxy.libraries.preferences.get("library_page_size")}))},createLibraryFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this;this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){t.createNewLibrary()},Close:function(){t.modal.hide()}}})},createNewLibrary:function(){var e=this.serializeNewLibrary();if(this.validateNewLibrary(e)){var t=new d.default.Library,i=this;t.save(e,{success:function(e){Galaxy.libraries.libraryListView.collection.add(e),i.modal.hide(),i.clearLibraryModal(),Galaxy.libraries.libraryListView.render(),n.default.success("Library created.")},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg):n.default.error("An error occured.")}})}else n.default.error("Library's name is missing.");return!1},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many libraries per page do you want to see?",Galaxy.libraries.preferences.get("library_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({library_page_size:parseInt(t)}),Galaxy.libraries.libraryListView.render({show_page:1}))},clearLibraryModal:function(){a("input[name='Name']").val(""),a("input[name='Description']").val(""),a("input[name='Synopsis']").val("")},serializeNewLibrary:function(){return{name:a("input[name='Name']").val(),description:a("input[name='Description']").val(),synopsis:a("input[name='Synopsis']").val()}},validateNewLibrary:function(e){return""!==e.name},includeDeletedChecked:function(e){e.target.checked?(Galaxy.libraries.preferences.set({with_deleted:!0}),Galaxy.libraries.libraryListView.fetchDeleted()):(Galaxy.libraries.preferences.set({with_deleted:!1}),Galaxy.libraries.libraryListView.render())},excludeRestrictedChecked:function(e){e.target.checked?Galaxy.libraries.preferences.set({without_restricted:!0}):Galaxy.libraries.preferences.set({without_restricted:!1}),Galaxy.libraries.libraryListView.render()},searchLibraries:function(e){var t=a(".library-search-input").val();this.options.search_term=t,Galaxy.libraries.libraryListView.searchLibraries(t)},templateToolBar:function(){return s.template(['
','
','
','
','DATA LIBRARIES','',"",'
','',"
","<% if(admin_user === true) { %>",'
',"","","
",'','',"","<% } %>",'','','',"","","
","
","
",'
',"
","
"].join(""))},templatePaginator:function(){return s.template(['","",' <%- libraries_shown %> libraries shown (change)',"",""," <%- total_libraries_count %> total",""].join(""))},templateNewLibraryInModal:function(){return s.template(['
',"
",'','','',"
","
"].join(""))}});t.default={LibraryToolbarView:c}}).call(t,i(1),i(2),i(0))},306:function(e,t,i){"use strict";(function(e,s,a,r){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=i(3),l=o(n),d=i(42),c=o(d),h=i(156),_=o(h),p=i(139),u=o(p);i(198);var f=e.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page_size_prompt":"showPageSizePrompt"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=s.defaults(e||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(e){this.options=s.extend(this.options,e);var t=this.templateToolBar(),i={id:this.options.id,is_admin:!1,is_anonym:!0,mutiple_add_dataset_options:!1};Galaxy.user&&(i.is_admin=Galaxy.user.isAdmin(),i.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(i.mutiple_add_dataset_options=!0)),this.$el.html(t(i))},renderPaginator:function(e){this.options=s.extend(this.options,e);var t=this.templatePaginator();a("body").find(".folder-paginator").html(t({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(e){this.options=s.extend(this.options,e),!0===this.options.can_add_library_item?a(".add-library-items").show():a(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?(a(".dataset-manipulation").show(),a(".logged-dataset-manipulation").hide()):(a(".logged-dataset-manipulation").show(),a(".dataset-manipulation").show()):(a(".logged-dataset-manipulation").hide(),a(".dataset-manipulation").hide()),this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this,i=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Folder",body:i(),buttons:{Create:function(){t.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var t=this.serialize_new_folder();if(this.validate_new_folder(t)){var i,s=new _.default.FolderAsModel,a=e.history.fragment.split("/");i=a.indexOf("page")>-1?a[a.length-3]:a[a.length-1],s.url=s.urlRoot+i,s.save(t,{success:function(e){Galaxy.modal.hide(),c.default.success("Folder created."),e.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(e)},error:function(e,t){Galaxy.modal.hide(),void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")}})}else c.default.error("Folder's name is missing.");return!1},serialize_new_folder:function(){return{name:a("input[name='Name']").val(),description:a("input[name='Description']").val()}},validate_new_folder:function(e){return""!==e.name},modalBulkImport:function(){if(0===this.findCheckedRows().length)c.default.info("You must select some datasets first.");else{var e=this;this.histories=new _.default.GalaxyHistories,this.histories.fetch().done(function(){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:"Import into History",body:t({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")})}},importAllIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)a.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.options.last_used_history_id=e.id,t.processImportToHistory(e.id,e.name)}).fail(function(e,t,i){c.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var i=a("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=i;var s=a("select[name=dataset_import_bulk] option:selected").text();this.processImportToHistory(i,s),this.modal.enableButton("Import")}},processImportToHistory:function(e,t){var i=[],s=[];this.findCheckedRows().each(function(){var e=a(this).closest("tr").data("id");"F"==e.substring(0,1)?s.push(e):i.push(e)});for(var o=[],n=i.length-1;n>=0;n--){var l=i[n],d=new _.default.HistoryItem;d.url=d.urlRoot+e+"/contents",d.content=l,d.source="library",o.push(d)}for(var n=s.length-1;n>=0;n--){var c=s[n],d=new _.default.HistoryItem;d.url=d.urlRoot+e+"/contents",d.content=c,d.source="library_folder",o.push(d)}this.initChainCallControl({length:o.length,action:"to_history",history_name:t}),r.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(o,t)},updateProgress:function(){this.progress+=this.progressStep,a(".progress-bar-import").width(Math.round(this.progress)+"%");var e=Math.round(this.progress)+"% Complete";a(".completion_span").text(e)},download:function(e,t){var i=[],s=[];this.findCheckedRows().each(function(){var e=a(this).closest("tr").data("id");"F"==e.substring(0,1)?s.push(e):i.push(e)});var r=Galaxy.root+"api/libraries/datasets/download/"+t,o={ld_ids:i,folder_ids:s};this.processDownload(r,o,"get")},processDownload:function(e,t,i){if(e&&t){t="string"==typeof t?t:a.param(t);var s="";a.each(t.split("&"),function(){var e=this.split("=");s+=''}),a('
'+s+"
").appendTo("body").submit().remove(),c.default.info("Your download will begin soon.")}else c.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new _.default.GalaxyHistories;var e=this;this.histories.fetch().done(function(){e.modal=Galaxy.modal;var t=e.templateAddFilesFromHistory();e.modal.show({closing_events:!0,title:"Adding datasets from your history",body:t({histories:e.histories.models}),buttons:{Add:function(){e.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),e.fetchAndDisplayHistoryContents(e.histories.models[0].id),a("#dataset_add_bulk").change(function(t){e.fetchAndDisplayHistoryContents(t.target.value)})}).fail(function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")})},importFilesFromPathModal:function(){var e=this;this.modal=Galaxy.modal;var t=this.templateImportPathModal();this.modal.show({closing_events:!0,title:"Please enter paths to import",body:t({}),buttons:{Import:function(){e.importFromPathsClicked(e)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var e=this;l.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){e.list_extensions=[];for(var i in t)e.list_extensions.push({id:t[i].extension,text:t[i].extension,description:t[i].description,description_url:t[i].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id=0;h--){var _=l[h].trim();0!==_.length&&d.push(_)}this.initChainCallControl({length:d.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:d,preserve_dirs:e,link_data:t,space_to_tab:i,to_posix_lines:s,source:"admin_path",file_type:o,tag_using_filenames:r,dbkey:n})}else c.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(e){var t;switch(e.action){case"adding_datasets":t=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(t({folder_name:this.options.folder_name}));break;case"deleting_datasets":t=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(t());break;case"to_history":t=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(t({history_name:e.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/e.length,this.options.chain_call_control.total_number=e.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(e,t){var i=a("#jstree_browser").jstree().get_selected(!0),r=s.filter(i,function(e){return 0==e.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),n=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),d=this.modal.$el.find(".posix-checkbox").is(":checked"),h=this.select_extension.value(),_=this.select_genome.value(),p=this.modal.$el.find(".tag-files").is(":checked"),u=r[0].type,f=[];if(r.length<1)c.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var g=r.length-1;g>=0;g--)void 0!==r[g].li_attr.full_path&&f.push(r[g].li_attr.full_path);if(this.initChainCallControl({length:f.length,action:"adding_datasets"}),"folder"===u){var m=t.source+"_folder";this.chainCallImportingFolders({paths:f,preserve_dirs:o,link_data:n,space_to_tab:l,to_posix_lines:d,source:m,file_type:h,dbkey:_,tag_using_filenames:p})}else if("file"===u){var m=t.source+"_file";this.chainCallImportingUserdirFiles({paths:f,file_type:h,dbkey:_,link_data:n,space_to_tab:l,to_posix_lines:d,source:m,tag_using_filenames:p})}}},fetchAndDisplayHistoryContents:function(e){var t=new _.default.HistoryContents({id:e}),i=this;t.fetch({success:function(t){var s=i.templateHistoryContents();i.histories.get(e).set({contents:t}),i.modal.$el.find("#selected_history_content").html(s({history_contents:t.models.reverse()})),i.modal.$el.find(".history-import-select-all").bind("click",function(){a("#selected_history_content [type=checkbox]").prop("checked",!0)}),i.modal.$el.find(".history-import-unselect-all").bind("click",function(){a("#selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find("#selected_history_content").find(":checked"),t=[],i=[],s=[];if(e.length<1)c.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),e.each(function(){var e=a(this).closest("li").data("id");if(e){var s=a(this).closest("li").data("name");t.push(e),i.push(s)}});for(var r=t.length-1;r>=0;r--){var o=t[r],n=new _.default.Item;n.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===i[r]?n.set({from_hdca_id:o}):n.set({from_hda_id:o}),s.push(n)}this.initChainCallControl({length:s.length,action:"adding_datasets"}),this.chainCallAddingHdas(s)}},chainCallImportingIntoHistory:function(e,t){var i=this,s=e.pop();if(void 0===s)return 0===this.options.chain_call_control.failed_number?c.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?c.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;n--){var l=new _.default.Item({id:e[n]});o.push(l)}for(var n=t.length-1;n>=0;n--){var d=new _.default.FolderAsModel({id:t[n]});o.push(d)}this.options.chain_call_control.total_number=r,this.chainCallDeletingItems(o)}},showLocInfo:function(){var e=null,t=this;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new _.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occurred.")}}))},showLocInfoModal:function(e){var t=this,i=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Location Details",body:i({library:e,options:t.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(e){switch(e.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),c.default.error("Invalid import source.")}},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(t)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return a("#folder_list_body").find(":checked")},templateToolBar:function(){return s.template(['
','
','
',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'','",'','','","","","
","",'
',"
",'
',"
"].join(""))},templateLocInfoInModal:function(){return s.template(["
",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
library
name<%- library.get("name") %>
description<%- library.get("description") %>
synopsis<%- library.get("synopsis") %>
created"><%- library.get("create_time_pretty") %>
id<%- library.get("id") %>
",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
folder
name<%- options.folder_name %>
description<%- options.folder_description %>
id<%- options.id %>
","
"].join(""))},templateNewFolderInModal:function(){return s.template(['
',"
",'','',"
","
"].join(""))},templateBulkImportInModal:function(){return s.template(["
",'
',"Select history: ",'","
",'
',"or create new: ",'',"","
","
"].join(""))},templateImportIntoHistoryProgressBar:function(){return s.template(['
',"Importing selected items to history <%= _.escape(history_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateAddingDatasetsProgressBar:function(){return s.template(['
',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateDeletingItemsProgressBar:function(){return s.template(['
',"
",'
','
','0% Complete',"
","
"].join(""))},templateBrowserModal:function(){return s.template(['
','
All files you select will be imported into the current folder ignoring their folder structure.
','','
','",'","
",'
','",'",'",'","
",'",'","
",'
',"
","
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
","
",'","
","
"].join(""))},templateImportPathModal:function(){return s.template(['
','
All files within the given folders and their subfolders will be imported into the current folder.
','
','",'","
",'",'","
",'',"
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
",'","
","
"].join(""))},templateAddFilesFromHistory:function(){return s.template(['
',"
","1. Select history: ",'","
","
",'
',"
","
"].join(""))},templateHistoryContents:function(){return s.template(["

2. Choose the datasets to import:

","
",'",'","
","
","
    ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">',"
  • ","<% } else { %>",'
  • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
  • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">','","
  • ","<% } %>","<% } %>","<% }); %>","
"].join(""))},templatePaginator:function(){return s.template(['","",' <%- items_shown %> items shown (change)',"",""," <%- total_items_count %> total",""].join(""))}});t.default={FolderToolbarView:f}}).call(t,i(1),i(2),i(0),i(0))},307:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(139),h=r(c),_=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=s.extend(this.options,e),this.options.id&&this.fetchLibrary()},fetchLibrary:function(e){this.options=s.extend(this.options,e),this.model=new d.default.Library({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):n.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=s.extend(this.options,e),a(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_library_role_list.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1}));var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var i=this.templateLibraryPermissions();this.$el.html(i({library:this.model,is_admin:t}));var r=this;a.get(Galaxy.root+"api/libraries/"+r.id+"/permissions?scope=current").done(function(e){r.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){n.default.error("An error occurred while attempting to fetch library permissions.")}),a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],i=0;i=0;i--)t.push(e[i].id);return t},savePermissions:function(e){var t=this,i=this._extractIds(this.accessSelectObject.$el.select2("data")),s=this._extractIds(this.addSelectObject.$el.select2("data")),r=this._extractIds(this.manageSelectObject.$el.select2("data")),o=this._extractIds(this.modifySelectObject.$el.select2("data"));a.post(Galaxy.root+"api/libraries/"+t.id+"/permissions?action=set_permissions",{"access_ids[]":i,"add_ids[]":s,"manage_ids[]":r,"modify_ids[]":o}).done(function(e){t.showPermissions({fetched_permissions:e}),n.default.success("Permissions saved.")}).fail(function(){n.default.error("An error occurred while attempting to set library permissions.")})},templateLibraryPermissions:function(){return s.template(['
','","

",'Library: <%= _.escape(library.get("name")) %>',"

",'
',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any library on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
",'
',"

Library permissions

","

Roles that can access the library

",'
','
',"User with any of these roles can access this library. If there are no access roles set on the library it is considered unrestricted.","
","

Roles that can manage permissions on this library

",'
','
',"User with any of these roles can manage permissions on this library (includes giving access).","
","

Roles that can add items to this library

",'
','
',"User with any of these roles can add items to this library (folders and datasets).","
","

Roles that can modify this library

",'
','
',"User with any of these roles can modify this library (name, synopsis, etc.).","
",'","
","
"].join(""))}});t.default={LibraryView:_}}).call(t,i(1),i(2),i(0))},308:function(e,t,i){"use strict";(function(e,s,a){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),n=r(o),l=i(156),d=r(l),c=i(139),h=r(c),_=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=s.extend(this.options,e),this.options.id&&this.fetchFolder()},fetchFolder:function(e){this.options=s.extend(this.options,e),this.model=new d.default.FolderAsModel({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?n.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):n.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=s.extend(this.options,e),a(".tooltip").remove();var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var i=this.templateFolderPermissions();this.$el.html(i({folder:this.model,is_admin:t}));var r=this;a.get(Galaxy.root+"api/folders/"+r.id+"/permissions?scope=current").done(function(e){r.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){n.default.error("An error occurred while attempting to fetch folder permissions.")}),a("#center [data-toggle]").tooltip(),a("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],i=0;i=0;i--)t.push(e[i].id);return t},savePermissions:function(e){var t=this,i=this._extractIds(this.addSelectObject.$el.select2("data")),s=this._extractIds(this.manageSelectObject.$el.select2("data")),r=this._extractIds(this.modifySelectObject.$el.select2("data"));a.post(Galaxy.root+"api/folders/"+t.id+"/permissions?action=set_permissions",{"add_ids[]":i,"manage_ids[]":s,"modify_ids[]":r}).done(function(e){t.showPermissions({fetched_permissions:e}),n.default.success("Permissions saved.")}).fail(function(){n.default.error("An error occurred while attempting to set folder permissions.")})},templateFolderPermissions:function(){return s.template(['
','","

",'Folder: <%= _.escape(folder.get("name")) %>',"

",'
',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any folder on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
",'
',"

Folder permissions

","

","Roles that can manage permissions on this folder","

",'
','
',"User with any of these roles can manage permissions on this folder.","
","

","Roles that can add items to this folder","

",'
','
',"User with any of these roles can add items to this folder (folders and datasets).","
","

","Roles that can modify this folder","

",'
','
',"User with any of these roles can modify this folder (name, etc.).","
",'","
","
"].join(""))}});t.default={FolderView:_}}).call(t,i(1),i(2),i(0))},62:function(e,t,i){"use strict";function s(e,t){var i=void 0!==e.prototype?e.prototype:e;return void 0!==t&&(i._logNamespace=t),a.forEach(function(e){i[e]=function(){if(this.logger)return this.logger.emit?this.logger.emit(e,this._logNamespace,arguments):this.logger[e]?this.logger[e].apply(this.logger,arguments):void 0}}),e}Object.defineProperty(t,"__esModule",{value:!0});var a=["log","debug","info","warn","error","metric"];t.default=s},8:function(e,t,i){"use strict";(function(e){function s(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function r(e,t){var i=Array.prototype.slice.call(arguments,0),s=i.pop();return i.unshift(s),d.defaults.apply(d,i)}function o(e,t){t=t||"model";var i=d.template(e.join(""));return function(e,s){var a={view:s||{},_l:f.default};return a[t]=e||{},i(a)}}function n(e,t){t=t||{};var i=t.ascending?1:-1;return function(t,s){return t=t.get(e),s=s.get(e),(ts?1:0)*i}}Object.defineProperty(t,"__esModule",{value:!0});var l=i(2),d=a(l),c=i(1),h=a(c),_=i(62),p=s(_),u=i(7),f=s(u),g={logger:null,_logNamespace:"."};(0,p.default)(g);var m=h.Model.extend({initialize:function(e){if(this._checkEnabledSessionStorage(),!e.id)throw new Error("SessionStorageModel requires an id in the initial attributes");this.id=e.id;var t=this.isNew()?{}:this._read(this);this.clear({silent:!0}),this.save(d.extend({},this.defaults,t,e),{silent:!0}),this.on("change",function(){this.save()})},_checkEnabledSessionStorage:function(){try{return window.sessionStorage.length>=0}catch(e){return alert("Please enable cookies in your browser for this Galaxy site"),!1}},sync:function(e,t,i){i.silent||t.trigger("request",t,{},i);var s={};switch(e){case"create":s=this._create(t);break;case"read":s=this._read(t);break;case"update":s=this._update(t);break;case"delete":s=this._delete(t)}return void 0!==s||null!==s?i.success&&i.success():i.error&&i.error(),s},_create:function(e){try{var t=e.toJSON(),i=sessionStorage.setItem(e.id,JSON.stringify(t));return null===i?i:t}catch(e){if(!(e instanceof DOMException&&navigator.userAgent.indexOf("Safari")>-1))throw e}return null},_read:function(e){return JSON.parse(sessionStorage.getItem(e.id))},_update:function(e){return e._create(e)},_delete:function(e){return sessionStorage.removeItem(e.id)},isNew:function(){return!sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});!function(){m.prototype=d.omit(m.prototype,"url","urlRoot")}();var b={searchAttributes:[],searchAliases:{},searchAttribute:function(e,t){var i=this.get(e);return!(!t||void 0===i||null===i)&&(d.isArray(i)?this._searchArrayAttribute(i,t):-1!==i.toString().toLowerCase().indexOf(t.toLowerCase()))},_searchArrayAttribute:function(e,t){return t=t.toLowerCase(),d.any(e,function(e){return-1!==e.toString().toLowerCase().indexOf(t.toLowerCase())})},search:function(e){var t=this;return d.filter(this.searchAttributes,function(i){return t.searchAttribute(i,e)})},matches:function(e){var t=e.split("=");if(t.length>=2){var i=t[0];return i=this.searchAliases[i]||i,this.searchAttribute(i,t[1])}return!!this.search(e).length},matchesAll:function(e){var t=this;return e=e.match(/(".*"|\w*=".*"|\S*)/g).filter(function(e){return!!e}),d.all(e,function(e){return e=e.replace(/"/g,""),t.matches(e)})}},y={hiddenUntilActivated:function(t,i){if(i=i||{},this.HUAVOptions={$elementShown:this.$el,showFn:e.prototype.toggle,showSpeed:"fast"},d.extend(this.HUAVOptions,i||{}),this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible"),this.hidden=this.isHidden(),t){var s=this;t.on("click",function(e){s.toggle(s.HUAVOptions.showSpeed)})}},isHidden:function(){return this.HUAVOptions.$elementShown.is(":hidden")},toggle:function(){return this.hidden?(this.HUAVOptions.hasBeenShown||d.isFunction(this.HUAVOptions.onshowFirstTime)&&(this.HUAVOptions.hasBeenShown=!0,this.HUAVOptions.onshowFirstTime.call(this)),d.isFunction(this.HUAVOptions.onshow)&&(this.HUAVOptions.onshow.call(this),this.trigger("hiddenUntilActivated:shown",this)),this.hidden=!1):(d.isFunction(this.HUAVOptions.onhide)&&(this.HUAVOptions.onhide.call(this),this.trigger("hiddenUntilActivated:hidden",this)),this.hidden=!0),this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}},v={initialize:function(e){this.draggable=e.draggable||!1},$dragHandle:function(){return this.$(".title-bar")},toggleDraggable:function(){this.draggable?this.draggableOff():this.draggableOn()},draggableOn:function(){this.draggable=!0,this.dragStartHandler=d.bind(this._dragStartHandler,this),this.dragEndHandler=d.bind(this._dragEndHandler,this);var e=this.$dragHandle().attr("draggable",!0).get(0);e.addEventListener("dragstart",this.dragStartHandler,!1),e.addEventListener("dragend",this.dragEndHandler,!1)},draggableOff:function(){this.draggable=!1;var e=this.$dragHandle().attr("draggable",!1).get(0);e.removeEventListener("dragstart",this.dragStartHandler,!1),e.removeEventListener("dragend",this.dragEndHandler,!1)},_dragStartHandler:function(e){return e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON())),this.trigger("draggable:dragstart",e,this),!1},_dragEndHandler:function(e){return this.trigger("draggable:dragend",e,this),!1}},w={initialize:function(e){this.selectable=e.selectable||!1,this.selected=e.selected||!1},$selector:function(){return this.$(".selector")},_renderSelected:function(){this.$selector().find("span").toggleClass("fa-check-square-o",this.selected).toggleClass("fa-square-o",!this.selected)},toggleSelector:function(){this.$selector().is(":visible")?this.hideSelector():this.showSelector()},showSelector:function(e){e=void 0!==e?e:this.fxSpeed,this.selectable=!0,this.trigger("selectable",!0,this),this._renderSelected(),e?this.$selector().show(e):this.$selector().show()},hideSelector:function(e){e=void 0!==e?e:this.fxSpeed,this.selectable=!1,this.trigger("selectable",!1,this),e?this.$selector().hide(e):this.$selector().hide()},toggleSelect:function(e){this.selected?this.deselect(e):this.select(e)},select:function(e){return this.selected||(this.trigger("selected",this,e),this.selected=!0,this._renderSelected()),!1},deselect:function(e){return this.selected&&(this.trigger("de-selected",this,e),this.selected=!1,this._renderSelected()),!1}};t.default={LoggableMixin:g,SessionStorageModel:m,mixin:r,SearchableModelMixin:b,HiddenUntilActivatedViewMixin:y,DraggableViewMixin:v,SelectableViewMixin:w,wrapTemplate:o,buildComparator:n}}).call(t,i(0))}},[298]); \ No newline at end of file diff --git a/static/scripts/mvc/library/library-foldertoolbar-view.js b/static/scripts/mvc/library/library-foldertoolbar-view.js index 49072f43b33..3776c79fd30 100644 --- a/static/scripts/mvc/library/library-foldertoolbar-view.js +++ b/static/scripts/mvc/library/library-foldertoolbar-view.js @@ -1 +1 @@ -define("mvc/library/library-foldertoolbar-view",["exports","utils/utils","libs/toastr","mvc/library/library-model","mvc/ui/ui-select","libs/jquery/jstree"],function(e,t,i,a,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var l=s(t),r=s(i),n=s(a),d=s(o),c=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page_size_prompt":"showPageSizePrompt"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=_.defaults(e||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(e){this.options=_.extend(this.options,e);var t=this.templateToolBar(),i={id:this.options.id,is_admin:!1,is_anonym:!0,mutiple_add_dataset_options:!1};Galaxy.user&&(i.is_admin=Galaxy.user.isAdmin(),i.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(i.mutiple_add_dataset_options=!0)),this.$el.html(t(i))},renderPaginator:function(e){this.options=_.extend(this.options,e);var t=this.templatePaginator();$("body").find(".folder-paginator").html(t({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(e){this.options=_.extend(this.options,e),!0===this.options.can_add_library_item?$(".add-library-items").show():$(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?($(".dataset-manipulation").show(),$(".logged-dataset-manipulation").hide()):($(".logged-dataset-manipulation").show(),$(".dataset-manipulation").show()):($(".logged-dataset-manipulation").hide(),$(".dataset-manipulation").hide()),this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this,i=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Folder",body:i(),buttons:{Create:function(){t.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var e=this.serialize_new_folder();if(this.validate_new_folder(e)){var t,i=new n.default.FolderAsModel,a=Backbone.history.fragment.split("/");t=a.indexOf("page")>-1?a[a.length-3]:a[a.length-1],i.url=i.urlRoot+t,i.save(e,{success:function(e){Galaxy.modal.hide(),r.default.success("Folder created."),e.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(e)},error:function(e,t){Galaxy.modal.hide(),void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")}})}else r.default.error("Folder's name is missing.");return!1},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(e){return""!==e.name},modalBulkImport:function(){if(0===this.findCheckedRows().length)r.default.info("You must select some datasets first.");else{var e=this;this.histories=new n.default.GalaxyHistories,this.histories.fetch().done(function(){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:"Import into History",body:t({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")})}},importAllIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)$.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.options.last_used_history_id=e.id,t.processImportToHistory(e.id,e.name)}).fail(function(e,t,i){r.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var i=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=i;var a=$("select[name=dataset_import_bulk] option:selected").text();this.processImportToHistory(i,a),this.modal.enableButton("Import")}},processImportToHistory:function(e,t){var i=[],a=[];this.findCheckedRows().each(function(){var e=$(this).closest("tr").data("id");"F"==e.substring(0,1)?a.push(e):i.push(e)});for(var o=[],s=i.length-1;s>=0;s--){var l=i[s];(d=new n.default.HistoryItem).url=d.urlRoot+e+"/contents",d.content=l,d.source="library",o.push(d)}for(s=a.length-1;s>=0;s--){var r=a[s],d=new n.default.HistoryItem;d.url=d.urlRoot+e+"/contents",d.content=r,d.source="library_folder",o.push(d)}this.initChainCallControl({length:o.length,action:"to_history",history_name:t}),jQuery.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(o,t)},updateProgress:function(){this.progress+=this.progressStep,$(".progress-bar-import").width(Math.round(this.progress)+"%");var e=Math.round(this.progress)+"% Complete";$(".completion_span").text(e)},download:function(e,t){var i=[],a=[];this.findCheckedRows().each(function(){var e=$(this).closest("tr").data("id");"F"==e.substring(0,1)?a.push(e):i.push(e)});var o=Galaxy.root+"api/libraries/datasets/download/"+t,s={ld_ids:i,folder_ids:a};this.processDownload(o,s,"get")},processDownload:function(e,t,i){if(e&&t){t="string"==typeof t?t:$.param(t);var a="";$.each(t.split("&"),function(){var e=this.split("=");a+=''}),$('
'+a+"
").appendTo("body").submit().remove(),r.default.info("Your download will begin soon.")}else r.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new n.default.GalaxyHistories;var e=this;this.histories.fetch().done(function(){e.modal=Galaxy.modal;var t=e.templateAddFilesFromHistory();e.modal.show({closing_events:!0,title:"Adding datasets from your history",body:t({histories:e.histories.models}),buttons:{Add:function(){e.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),e.fetchAndDisplayHistoryContents(e.histories.models[0].id),$("#dataset_add_bulk").change(function(t){e.fetchAndDisplayHistoryContents(t.target.value)})}).fail(function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")})},importFilesFromPathModal:function(){var e=this;this.modal=Galaxy.modal;var t=this.templateImportPathModal();this.modal.show({closing_events:!0,title:"Please enter paths to import",body:t({}),buttons:{Import:function(){e.importFromPathsClicked(e)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var e=this;l.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){e.list_extensions=[];for(var i in t)e.list_extensions.push({id:t[i].extension,text:t[i].extension,description:t[i].description,description_url:t[i].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id=0;c--){var p=n[c].trim();0!==p.length&&d.push(p)}this.initChainCallControl({length:d.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:d,preserve_dirs:e,link_data:t,space_to_tab:i,to_posix_lines:a,source:"admin_path",file_type:s,tag_using_filenames:o,dbkey:l})}else r.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(e){var t;switch(e.action){case"adding_datasets":t=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(t({folder_name:this.options.folder_name}));break;case"deleting_datasets":t=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(t());break;case"to_history":t=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(t({history_name:e.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/e.length,this.options.chain_call_control.total_number=e.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(e,t){var i=$("#jstree_browser").jstree().get_selected(!0),a=_.filter(i,function(e){return 0==e.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),s=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),n=this.modal.$el.find(".posix-checkbox").is(":checked"),d=this.select_extension.value(),c=this.select_genome.value(),p=this.modal.$el.find(".tag-files").is(":checked"),h=a[0].type,u=[];if(a.length<1)r.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var m=a.length-1;m>=0;m--)void 0!==a[m].li_attr.full_path&&u.push(a[m].li_attr.full_path);if(this.initChainCallControl({length:u.length,action:"adding_datasets"}),"folder"===h){f=t.source+"_folder";this.chainCallImportingFolders({paths:u,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:n,source:f,file_type:d,dbkey:c,tag_using_filenames:p})}else if("file"===h){var f=t.source+"_file";this.chainCallImportingUserdirFiles({paths:u,file_type:d,dbkey:c,link_data:s,space_to_tab:l,to_posix_lines:n,source:f,tag_using_filenames:p})}}},fetchAndDisplayHistoryContents:function(e){var t=this;new n.default.HistoryContents({id:e}).fetch({success:function(i){var a=t.templateHistoryContents();t.histories.get(e).set({contents:i}),t.modal.$el.find("#selected_history_content").html(a({history_contents:i.models.reverse()})),t.modal.$el.find(".history-import-select-all").bind("click",function(){$("#selected_history_content [type=checkbox]").prop("checked",!0)}),t.modal.$el.find(".history-import-unselect-all").bind("click",function(){$("#selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find("#selected_history_content").find(":checked"),t=[],i=[],a=[];if(e.length<1)r.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),e.each(function(){var e=$(this).closest("li").data("id");if(e){var a=$(this).closest("li").data("name");t.push(e),i.push(a)}});for(var o=t.length-1;o>=0;o--){var s=t[o],l=new n.default.Item;l.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===i[o]?l.set({from_hdca_id:s}):l.set({from_hda_id:s}),a.push(l)}this.initChainCallControl({length:a.length,action:"adding_datasets"}),this.chainCallAddingHdas(a)}},chainCallImportingIntoHistory:function(e,t){var i=this,a=e.pop();if(void 0===a)return 0===this.options.chain_call_control.failed_number?r.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?r.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;l--){var d=new n.default.Item({id:e[l]});s.push(d)}for(l=t.length-1;l>=0;l--){var c=new n.default.FolderAsModel({id:t[l]});s.push(c)}this.options.chain_call_control.total_number=o,this.chainCallDeletingItems(s)}},showLocInfo:function(){var e=null,t=this;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new n.default.Library({id:this.options.parent_library_id})).fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")}})},showLocInfoModal:function(e){var t=this,i=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Location Details",body:i({library:e,options:t.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(e){switch(e.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),r.default.error("Invalid import source.")}},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(t)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return $("#folder_list_body").find(":checked")},templateToolBar:function(){return _.template(['
','
','
',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'','",'','','","","","
","",'
',"
",'
',"
"].join(""))},templateLocInfoInModal:function(){return _.template(["
",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
library
name<%- library.get("name") %>
description<%- library.get("description") %>
synopsis<%- library.get("synopsis") %>
created"><%- library.get("create_time_pretty") %>
id<%- library.get("id") %>
",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
folder
name<%- options.folder_name %>
description<%- options.folder_description %>
id<%- options.id %>
","
"].join(""))},templateNewFolderInModal:function(){return _.template(['
',"
",'','',"
","
"].join(""))},templateBulkImportInModal:function(){return _.template(["
",'
',"Select history: ",'","
",'
',"or create new: ",'',"","
","
"].join(""))},templateImportIntoHistoryProgressBar:function(){return _.template(['
',"Importing selected items to history <%= _.escape(history_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateAddingDatasetsProgressBar:function(){return _.template(['
',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateDeletingItemsProgressBar:function(){return _.template(['
',"
",'
','
','0% Complete',"
","
"].join(""))},templateBrowserModal:function(){return _.template(['
','
All files you select will be imported into the current folder ignoring their folder structure.
','','
','",'","
",'
','",'",'",'","
",'",'","
",'
',"
","
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
","
",'","
","
"].join(""))},templateImportPathModal:function(){return _.template(['
','
All files within the given folders and their subfolders will be imported into the current folder.
','
','",'","
",'",'","
",'',"
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
",'","
","
"].join(""))},templateAddFilesFromHistory:function(){return _.template(['
',"
","1. Select history: ",'","
","
",'
',"
","
"].join(""))},templateHistoryContents:function(){return _.template(["

2. Choose the datasets to import:

","
",'",'","
","
","
    ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">',"
  • ","<% } else { %>",'
  • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
  • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">','","
  • ","<% } %>","<% } %>","<% }); %>","
"].join(""))},templatePaginator:function(){return _.template(['","",' <%- items_shown %> items shown (change)',"",""," <%- total_items_count %> total",""].join(""))}});e.default={FolderToolbarView:c}}); \ No newline at end of file +define("mvc/library/library-foldertoolbar-view",["exports","utils/utils","libs/toastr","mvc/library/library-model","mvc/ui/ui-select","libs/jquery/jstree"],function(e,t,i,a,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var l=s(t),r=s(i),n=s(a),d=s(o),c=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page_size_prompt":"showPageSizePrompt"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=_.defaults(e||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(e){this.options=_.extend(this.options,e);var t=this.templateToolBar(),i={id:this.options.id,is_admin:!1,is_anonym:!0,mutiple_add_dataset_options:!1};Galaxy.user&&(i.is_admin=Galaxy.user.isAdmin(),i.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(i.mutiple_add_dataset_options=!0)),this.$el.html(t(i))},renderPaginator:function(e){this.options=_.extend(this.options,e);var t=this.templatePaginator();$("body").find(".folder-paginator").html(t({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(e){this.options=_.extend(this.options,e),!0===this.options.can_add_library_item?$(".add-library-items").show():$(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?($(".dataset-manipulation").show(),$(".logged-dataset-manipulation").hide()):($(".logged-dataset-manipulation").show(),$(".dataset-manipulation").show()):($(".logged-dataset-manipulation").hide(),$(".dataset-manipulation").hide()),this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this,i=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Folder",body:i(),buttons:{Create:function(){t.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var e=this.serialize_new_folder();if(this.validate_new_folder(e)){var t,i=new n.default.FolderAsModel,a=Backbone.history.fragment.split("/");t=a.indexOf("page")>-1?a[a.length-3]:a[a.length-1],i.url=i.urlRoot+t,i.save(e,{success:function(e){Galaxy.modal.hide(),r.default.success("Folder created."),e.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(e)},error:function(e,t){Galaxy.modal.hide(),void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")}})}else r.default.error("Folder's name is missing.");return!1},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(e){return""!==e.name},modalBulkImport:function(){if(0===this.findCheckedRows().length)r.default.info("You must select some datasets first.");else{var e=this;this.histories=new n.default.GalaxyHistories,this.histories.fetch().done(function(){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:"Import into History",body:t({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")})}},importAllIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)$.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.options.last_used_history_id=e.id,t.processImportToHistory(e.id,e.name)}).fail(function(e,t,i){r.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var i=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=i;var a=$("select[name=dataset_import_bulk] option:selected").text();this.processImportToHistory(i,a),this.modal.enableButton("Import")}},processImportToHistory:function(e,t){var i=[],a=[];this.findCheckedRows().each(function(){var e=$(this).closest("tr").data("id");"F"==e.substring(0,1)?a.push(e):i.push(e)});for(var o=[],s=i.length-1;s>=0;s--){var l=i[s];(d=new n.default.HistoryItem).url=d.urlRoot+e+"/contents",d.content=l,d.source="library",o.push(d)}for(s=a.length-1;s>=0;s--){var r=a[s],d=new n.default.HistoryItem;d.url=d.urlRoot+e+"/contents",d.content=r,d.source="library_folder",o.push(d)}this.initChainCallControl({length:o.length,action:"to_history",history_name:t}),jQuery.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(o,t)},updateProgress:function(){this.progress+=this.progressStep,$(".progress-bar-import").width(Math.round(this.progress)+"%");var e=Math.round(this.progress)+"% Complete";$(".completion_span").text(e)},download:function(e,t){var i=[],a=[];this.findCheckedRows().each(function(){var e=$(this).closest("tr").data("id");"F"==e.substring(0,1)?a.push(e):i.push(e)});var o=Galaxy.root+"api/libraries/datasets/download/"+t,s={ld_ids:i,folder_ids:a};this.processDownload(o,s,"get")},processDownload:function(e,t,i){if(e&&t){t="string"==typeof t?t:$.param(t);var a="";$.each(t.split("&"),function(){var e=this.split("=");a+=''}),$('
'+a+"
").appendTo("body").submit().remove(),r.default.info("Your download will begin soon.")}else r.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new n.default.GalaxyHistories;var e=this;this.histories.fetch().done(function(){e.modal=Galaxy.modal;var t=e.templateAddFilesFromHistory();e.modal.show({closing_events:!0,title:"Adding datasets from your history",body:t({histories:e.histories.models}),buttons:{Add:function(){e.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),e.fetchAndDisplayHistoryContents(e.histories.models[0].id),$("#dataset_add_bulk").change(function(t){e.fetchAndDisplayHistoryContents(t.target.value)})}).fail(function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")})},importFilesFromPathModal:function(){var e=this;this.modal=Galaxy.modal;var t=this.templateImportPathModal();this.modal.show({closing_events:!0,title:"Please enter paths to import",body:t({}),buttons:{Import:function(){e.importFromPathsClicked(e)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var e=this;l.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){e.list_extensions=[];for(var i in t)e.list_extensions.push({id:t[i].extension,text:t[i].extension,description:t[i].description,description_url:t[i].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id=0;c--){var p=n[c].trim();0!==p.length&&d.push(p)}this.initChainCallControl({length:d.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:d,preserve_dirs:e,link_data:t,space_to_tab:i,to_posix_lines:a,source:"admin_path",file_type:s,tag_using_filenames:o,dbkey:l})}else r.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(e){var t;switch(e.action){case"adding_datasets":t=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(t({folder_name:this.options.folder_name}));break;case"deleting_datasets":t=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(t());break;case"to_history":t=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(t({history_name:e.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/e.length,this.options.chain_call_control.total_number=e.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(e,t){var i=$("#jstree_browser").jstree().get_selected(!0),a=_.filter(i,function(e){return 0==e.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),s=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),n=this.modal.$el.find(".posix-checkbox").is(":checked"),d=this.select_extension.value(),c=this.select_genome.value(),p=this.modal.$el.find(".tag-files").is(":checked"),h=a[0].type,u=[];if(a.length<1)r.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var m=a.length-1;m>=0;m--)void 0!==a[m].li_attr.full_path&&u.push(a[m].li_attr.full_path);if(this.initChainCallControl({length:u.length,action:"adding_datasets"}),"folder"===h){f=t.source+"_folder";this.chainCallImportingFolders({paths:u,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:n,source:f,file_type:d,dbkey:c,tag_using_filenames:p})}else if("file"===h){var f=t.source+"_file";this.chainCallImportingUserdirFiles({paths:u,file_type:d,dbkey:c,link_data:s,space_to_tab:l,to_posix_lines:n,source:f,tag_using_filenames:p})}}},fetchAndDisplayHistoryContents:function(e){var t=this;new n.default.HistoryContents({id:e}).fetch({success:function(i){var a=t.templateHistoryContents();t.histories.get(e).set({contents:i}),t.modal.$el.find("#selected_history_content").html(a({history_contents:i.models.reverse()})),t.modal.$el.find(".history-import-select-all").bind("click",function(){$("#selected_history_content [type=checkbox]").prop("checked",!0)}),t.modal.$el.find(".history-import-unselect-all").bind("click",function(){$("#selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find("#selected_history_content").find(":checked"),t=[],i=[],a=[];if(e.length<1)r.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),e.each(function(){var e=$(this).closest("li").data("id");if(e){var a=$(this).closest("li").data("name");t.push(e),i.push(a)}});for(var o=t.length-1;o>=0;o--){var s=t[o],l=new n.default.Item;l.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===i[o]?l.set({from_hdca_id:s}):l.set({from_hda_id:s}),a.push(l)}this.initChainCallControl({length:a.length,action:"adding_datasets"}),this.chainCallAddingHdas(a)}},chainCallImportingIntoHistory:function(e,t){var i=this,a=e.pop();if(void 0===a)return 0===this.options.chain_call_control.failed_number?r.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?r.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;l--){var d=new n.default.Item({id:e[l]});s.push(d)}for(l=t.length-1;l>=0;l--){var c=new n.default.FolderAsModel({id:t[l]});s.push(c)}this.options.chain_call_control.total_number=o,this.chainCallDeletingItems(s)}},showLocInfo:function(){var e=null,t=this;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new n.default.Library({id:this.options.parent_library_id})).fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?r.default.error(t.responseJSON.err_msg):r.default.error("An error occurred.")}})},showLocInfoModal:function(e){var t=this,i=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Location Details",body:i({library:e,options:t.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(e){switch(e.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),r.default.error("Invalid import source.")}},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(t)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return $("#folder_list_body").find(":checked")},templateToolBar:function(){return _.template(['
','
','
',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'','",'','','","","","
","",'
',"
",'
',"
"].join(""))},templateLocInfoInModal:function(){return _.template(["
",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
library
name<%- library.get("name") %>
description<%- library.get("description") %>
synopsis<%- library.get("synopsis") %>
created"><%- library.get("create_time_pretty") %>
id<%- library.get("id") %>
",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
folder
name<%- options.folder_name %>
description<%- options.folder_description %>
id<%- options.id %>
","
"].join(""))},templateNewFolderInModal:function(){return _.template(['
',"
",'','',"
","
"].join(""))},templateBulkImportInModal:function(){return _.template(["
",'
',"Select history: ",'","
",'
',"or create new: ",'',"","
","
"].join(""))},templateImportIntoHistoryProgressBar:function(){return _.template(['
',"Importing selected items to history <%= _.escape(history_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateAddingDatasetsProgressBar:function(){return _.template(['
',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateDeletingItemsProgressBar:function(){return _.template(['
',"
",'
','
','0% Complete',"
","
"].join(""))},templateBrowserModal:function(){return _.template(['
','
All files you select will be imported into the current folder ignoring their folder structure.
','','
','",'","
",'
','",'",'",'","
",'",'","
",'
',"
","
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
","
",'","
","
"].join(""))},templateImportPathModal:function(){return _.template(['
','
All files within the given folders and their subfolders will be imported into the current folder.
','
','",'","
",'",'","
",'',"
","

You can set extension type and genome for all imported datasets at once:

","
",'Type: ','Genome: ',"
","
",'","
","
"].join(""))},templateAddFilesFromHistory:function(){return _.template(['
',"
","1. Select history: ",'","
","
",'
',"
","
"].join(""))},templateHistoryContents:function(){return _.template(["

2. Choose the datasets to import:

","
",'",'","
","
","
    ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">',"
  • ","<% } else { %>",'
  • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
  • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
  • " data-name="<%= _.escape(history_item.get("type")) %>">','","
  • ","<% } %>","<% } %>","<% }); %>","
"].join(""))},templatePaginator:function(){return _.template(['","",' <%- items_shown %> items shown (change)',"",""," <%- total_items_count %> total",""].join(""))}});e.default={FolderToolbarView:c}}); \ No newline at end of file