diff --git a/client/galaxy/scripts/apps/admin-toolshed.js b/client/galaxy/scripts/apps/admin-toolshed.js deleted file mode 100644 index e9dc586e5ee..00000000000 --- a/client/galaxy/scripts/apps/admin-toolshed.js +++ /dev/null @@ -1,7 +0,0 @@ -import AdminToolshed from "admin.toolshed"; - -export function App(options) { - new AdminToolshed.GalaxyApp(options); -} - -window.adminToolshedApp = App; diff --git a/client/galaxy/scripts/apps/extended.js b/client/galaxy/scripts/apps/extended.js new file mode 100644 index 00000000000..4761a3ce304 --- /dev/null +++ b/client/galaxy/scripts/apps/extended.js @@ -0,0 +1,50 @@ +import WorkflowView from "mvc/workflow/workflow-view"; +import Trackster from "viz/trackster"; +import Circster from "viz/circster"; +import GalaxyLibrary from "galaxy.library"; +import AdminToolshed from "admin.toolshed"; +import Masthead from "layout/masthead"; +import user from "mvc/user/user-model"; +import Modal from "mvc/ui/ui-modal"; + +export function mastheadEntry(options) { + if (!Galaxy.user) { + Galaxy.user = new user.User(options.user_json); + } + if (!Galaxy.masthead) { + Galaxy.masthead = new Masthead.View(options); + Galaxy.modal = new Modal.View(); + $("#masthead").replaceWith(Galaxy.masthead.render().$el); + } +} + +export function adminToolshedEntry(options) { + new AdminToolshed.GalaxyApp(options); +} + +export function tracksterEntry(options) { + new Trackster.GalaxyApp(options); +} + +export function circsterEntry(options) { + new Circster.GalaxyApp(options); +} + +export function workflowEntry(options) { + new WorkflowView(options); +} + +function libraryEntry(options) { + new GalaxyLibrary.GalaxyApp(options); +} + +export const bundleEntries = { + library: libraryEntry, + masthead: mastheadEntry, + workflow: workflowEntry, + trackster: tracksterEntry, + circster: circsterEntry, + adminToolshed: adminToolshedEntry +}; + +window.bundleEntries = bundleEntries; diff --git a/client/galaxy/scripts/apps/library.js b/client/galaxy/scripts/apps/library.js deleted file mode 100644 index 674a14e673a..00000000000 --- a/client/galaxy/scripts/apps/library.js +++ /dev/null @@ -1,7 +0,0 @@ -import GalaxyLibrary from "galaxy.library"; - -export function App(options) { - new GalaxyLibrary.GalaxyApp(options); -} - -window.libraryApp = App; diff --git a/client/galaxy/scripts/apps/masthead.js b/client/galaxy/scripts/apps/masthead.js deleted file mode 100644 index 18c83db2673..00000000000 --- a/client/galaxy/scripts/apps/masthead.js +++ /dev/null @@ -1,16 +0,0 @@ -import Masthead from "layout/masthead"; -import user from "mvc/user/user-model"; -import Modal from "mvc/ui/ui-modal"; - -export default function masthead(options) { - if (!Galaxy.user) { - Galaxy.user = new user.User(options.user_json); - } - if (!Galaxy.masthead) { - Galaxy.masthead = new Masthead.View(options); - Galaxy.modal = new Modal.View(); - $("#masthead").replaceWith(Galaxy.masthead.render().$el); - } -} - -window.masthead = masthead; diff --git a/client/galaxy/scripts/apps/viz.js b/client/galaxy/scripts/apps/viz.js deleted file mode 100644 index 0c45296067f..00000000000 --- a/client/galaxy/scripts/apps/viz.js +++ /dev/null @@ -1,13 +0,0 @@ -import Trackster from "viz/trackster"; -import Circster from "viz/circster"; - -export function tracksterApp(options) { - new Trackster.GalaxyApp(options); -} - -export function circsterApp(options) { - new Circster.GalaxyApp(options); -} - -window.tracksterApp = tracksterApp; -window.circsterApp = circsterApp; diff --git a/client/galaxy/scripts/apps/workflow.js b/client/galaxy/scripts/apps/workflow.js deleted file mode 100644 index 1a892974252..00000000000 --- a/client/galaxy/scripts/apps/workflow.js +++ /dev/null @@ -1,7 +0,0 @@ -import WorkflowView from "mvc/workflow/workflow-view"; - -export default function workflowApp(options) { - new WorkflowView(options); -} - -window.workflowApp = workflowApp; diff --git a/client/galaxy/scripts/mvc/form/form-data.js b/client/galaxy/scripts/mvc/form/form-data.js index 8e508000a3d..e393af66943 100644 --- a/client/galaxy/scripts/mvc/form/form-data.js +++ b/client/galaxy/scripts/mvc/form/form-data.js @@ -1,6 +1,5 @@ /* This class maps the form dom to an api compatible javascript dictionary. */ -import Utils from "utils/utils"; -var Manager = Backbone.Model.extend({ +export var Manager = Backbone.Model.extend({ initialize: function(app) { this.app = app; }, @@ -33,7 +32,9 @@ var Manager = Backbone.Model.extend({ function add(flat_id, input_id, input_value) { self.flat_dict[flat_id] = input_id; result_dict[flat_id] = input_value; - self.app.element_list[input_id] && self.app.element_list[input_id].$el.attr("tour_id", flat_id); + if (self.app.element_list[input_id]) { + self.app.element_list[input_id].$el.attr("tour_id", flat_id); + } } // converter between raw dictionary and job dictionary function convert(identifier, head) { @@ -42,7 +43,7 @@ var Manager = Backbone.Model.extend({ if (node.input) { var input = node.input; var flat_id = identifier; - if (identifier != "") { + if (identifier !== "") { flat_id += "|"; } flat_id += input.name; @@ -62,7 +63,7 @@ var Manager = Backbone.Model.extend({ } } block_indices.sort((a, b) => a - b); - var index = 0; + index = 0; for (var i in block_indices) { convert(`${flat_id}_${index++}`, node[block_prefix + block_indices[i]]); } @@ -81,7 +82,7 @@ var Manager = Backbone.Model.extend({ default: var field = self.app.field_list[input.id]; if (field && field.value) { - var value = field.value(); + value = field.value(); if (input.ignore === undefined || input.ignore != value) { if (field.collapsed && input.collapsible_value) { value = input.collapsible_value; @@ -120,7 +121,9 @@ var Manager = Backbone.Model.extend({ matchModel: function(model, callback) { var self = this; visitInputs(model.inputs, (input, name) => { - self.flat_dict[name] && callback(input, self.flat_dict[name]); + if (self.flat_dict[name]) { + callback(input, self.flat_dict[name]); + } }); }, @@ -132,7 +135,9 @@ var Manager = Backbone.Model.extend({ function search(id, head) { if (typeof head === "string") { var input_id = self.flat_dict[id]; - input_id && (result[input_id] = head); + if (input_id) { + result[input_id] = head; + } } else { for (var i in head) { var new_id = i; @@ -174,7 +179,7 @@ var Manager = Backbone.Model.extend({ * @param{dict} input - Definition of conditional input parameter * @param{dict} value - Current value */ -var matchCase = (input, value) => { +export var matchCase = (input, value) => { if (input.test_param.type == "boolean") { if (value == "true") { value = input.test_param.truevalue || "true"; @@ -194,7 +199,7 @@ var matchCase = (input, value) => { * @param{dict} inputs - Nested dictionary of input elements * @param{dict} callback - Called with the mapped dictionary object and corresponding model node */ -var visitInputs = (inputs, callback, prefix, context) => { +export var visitInputs = (inputs, callback, prefix, context) => { context = $.extend(true, {}, context); _.each(inputs, input => { if (input && input.type && input.name) { diff --git a/client/galaxy/scripts/mvc/form/form-parameters.js b/client/galaxy/scripts/mvc/form/form-parameters.js index 0fd34d43995..00a55597c36 100644 --- a/client/galaxy/scripts/mvc/form/form-parameters.js +++ b/client/galaxy/scripts/mvc/form/form-parameters.js @@ -41,7 +41,9 @@ export default Backbone.Model.extend({ field = input_def.options ? this._fieldSelect(input_def) : this._fieldText(input_def); Galaxy.emit.debug("form-parameters::_addRow()", `Auto matched field type (${input_def.type}).`); } - input_def.value === undefined && (input_def.value = null); + if (input_def.value === undefined) { + input_def.value = null; + } field.value(input_def.value); return field; }, diff --git a/client/galaxy/scripts/mvc/form/form-repeat.js b/client/galaxy/scripts/mvc/form/form-repeat.js index f97f70993d3..7f38e16ee3d 100644 --- a/client/galaxy/scripts/mvc/form/form-repeat.js +++ b/client/galaxy/scripts/mvc/form/form-repeat.js @@ -2,7 +2,8 @@ import Utils from "utils/utils"; import Portlet from "mvc/ui/ui-portlet"; import Ui from "mvc/ui/ui-misc"; -var View = Backbone.View.extend({ + +export var View = Backbone.View.extend({ initialize: function(options) { this.list = {}; this.options = Utils.merge(options, { @@ -17,7 +18,9 @@ var View = Backbone.View.extend({ tooltip: `Add new ${this.options.title} block`, cls: "ui-button-icon ui-clear-float form-repeat-add", onclick: function() { - options.onnew && options.onnew(); + if (options.onnew) { + options.onnew(); + } } }); this.setElement( @@ -43,7 +46,9 @@ var View = Backbone.View.extend({ tooltip: "Delete this repeat block", cls: "ui-button-icon-plain form-repeat-delete", onclick: function() { - options.ondel && options.ondel(); + if (options.ondel) { + options.ondel(); + } } }); var portlet = new Portlet.View({ @@ -56,7 +61,9 @@ var View = Backbone.View.extend({ portlet.$el.addClass("section-row").hide(); this.list[options.id] = portlet; this.$list.append(portlet.$el.fadeIn("fast")); - this.options.max > 0 && this.size() >= this.options.max && this.button_new.disable(); + if (this.options.max > 0 && this.size() >= this.options.max) { + this.button_new.disable(); + } this._refresh(); }, @@ -85,12 +92,13 @@ var View = Backbone.View.extend({ _.each(this.list, portlet => { portlet.hideOperation("button_delete"); }); - _.isEmpty(this.list) && + if (_.isEmpty(this.list)) { this.$el.append( $("
") .addClass("ui-form-info") .html(this.options.empty_text) ); + } }, /** Refresh view */ diff --git a/client/galaxy/scripts/mvc/form/form-view.js b/client/galaxy/scripts/mvc/form/form-view.js index f67778d15e0..52dc99782f4 100644 --- a/client/galaxy/scripts/mvc/form/form-view.js +++ b/client/galaxy/scripts/mvc/form/form-view.js @@ -1,12 +1,12 @@ /** This is the main class of the form plugin. It is referenced as 'app' in lower level modules. */ -import Utils from "utils/utils"; import Portlet from "mvc/ui/ui-portlet"; import Ui from "mvc/ui/ui-misc"; import FormSection from "mvc/form/form-section"; import FormData from "mvc/form/form-data"; -export default Backbone.View.extend({ + +export var View = Backbone.View.extend({ initialize: function(options) { this.model = new Backbone.Model({ initial_errors: false, @@ -95,7 +95,6 @@ export default Backbone.View.extend({ if (options && options.errors) { var error_messages = this.data.matchResponse(options.errors); for (var input_id in this.element_list) { - var input = this.element_list[input_id]; if (error_messages[input_id]) { this.highlight(input_id, error_messages[input_id], true); } @@ -118,7 +117,9 @@ export default Backbone.View.extend({ this.data = new FormData.Manager(this); this._renderForm(); this.data.create(); - this.model.get("initial_errors") && this.errors(this.model.attributes); + if (this.model.get("initial_errors")) { + this.errors(this.model.attributes); + } // add listener which triggers on checksum change, and reset the form input wrappers var current_check = this.data.checksum(); this.on("change", input_id => { @@ -160,13 +161,18 @@ export default Backbone.View.extend({ this.portlet.append(this.message.$el); this.portlet.append(this.section.$el); this.$el.empty(); - options.inputs && this.$el.append(this.portlet.$el); - options.message && + if (options.inputs) { + this.$el.append(this.portlet.$el); + } + if (options.message) { this.message.update({ persistent: true, status: options.status, message: options.message }); + } Galaxy.emit.debug("form-view::initialize()", "Completed"); } }); + +export default View; diff --git a/client/galaxy/scripts/mvc/form/form-wrapper.js b/client/galaxy/scripts/mvc/form/form-wrapper.js index 9b6fed24622..07ea81de971 100644 --- a/client/galaxy/scripts/mvc/form/form-wrapper.js +++ b/client/galaxy/scripts/mvc/form/form-wrapper.js @@ -23,6 +23,8 @@ var View = Backbone.View.extend({ message: options.message, status: options.status || "warning", icon: options.icon, + initial_errors: true, + errors: options.errors, inputs: options.inputs, buttons: { submit: new Ui.Button({ 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/client/galaxy/scripts/mvc/ui/ui-misc.js b/client/galaxy/scripts/mvc/ui/ui-misc.js index 6a4c2da8fd1..7ad33d347c3 100644 --- a/client/galaxy/scripts/mvc/ui/ui-misc.js +++ b/client/galaxy/scripts/mvc/ui/ui-misc.js @@ -1,15 +1,15 @@ /** * This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc. */ -import Utils from "utils/utils"; import Select from "mvc/ui/ui-select-default"; import Slider from "mvc/ui/ui-slider"; import Options from "mvc/ui/ui-options"; import Drilldown from "mvc/ui/ui-drilldown"; import Buttons from "mvc/ui/ui-buttons"; import Modal from "mvc/ui/ui-modal"; + /** Label wrapper */ -var Label = Backbone.View.extend({ +export var Label = Backbone.View.extend({ tagName: "label", initialize: function(options) { this.model = (options && options.model) || new Backbone.Model(options); @@ -35,7 +35,7 @@ var Label = Backbone.View.extend({ }); /** Displays messages used e.g. in the tool form */ -var Message = Backbone.View.extend({ +export var Message = Backbone.View.extend({ initialize: function(options) { this.model = (options && options.model) || @@ -85,14 +85,14 @@ var Message = Backbone.View.extend({ } }); -var UnescapedMessage = Message.extend({ +export var UnescapedMessage = Message.extend({ messageForDisplay: function() { return this.model.get("message"); } }); /** Renders an input element used e.g. in the tool form */ -var Input = Backbone.View.extend({ +export var Input = Backbone.View.extend({ initialize: function(options) { this.model = (options && options.model) || @@ -158,7 +158,7 @@ var Input = Backbone.View.extend({ }); /** Creates a hidden element input field used e.g. in the tool form */ -var Hidden = Backbone.View.extend({ +export var Hidden = Backbone.View.extend({ initialize: function(options) { this.model = (options && options.model) || new Backbone.Model(options); this.setElement( @@ -182,7 +182,7 @@ var Hidden = Backbone.View.extend({ }); /** Creates a upload element input field */ -var Upload = Backbone.View.extend({ +export var Upload = Backbone.View.extend({ initialize: function(options) { var self = this; this.model = (options && options.model) || new Backbone.Model(options); @@ -232,6 +232,21 @@ var Upload = Backbone.View.extend({ } }); +/* Make more Ui stuff directly available at this namespace (for backwards + * compatibility). We should eliminate this practice, though, and just require + * what we need where we need it, allowing for better package optimization. + */ + +export let Button = Buttons.ButtonDefault; +export let ButtonIcon = Buttons.ButtonIcon; +export let ButtonCheck = Buttons.ButtonCheck; +export let ButtonMenu = Buttons.ButtonMenu; +export let ButtonLink = Buttons.ButtonLink; +export let Checkbox = Options.Checkbox; +export let RadioButton = Options.RadioButton; +export let Radio = Options.Radio; +export { Select, Slider, Drilldown }; + export default { Button: Buttons.ButtonDefault, ButtonIcon: Buttons.ButtonIcon, diff --git a/client/galaxy/scripts/mvc/ui/ui-modal.js b/client/galaxy/scripts/mvc/ui/ui-modal.js index 6f6f11b119d..841c2aca079 100644 --- a/client/galaxy/scripts/mvc/ui/ui-modal.js +++ b/client/galaxy/scripts/mvc/ui/ui-modal.js @@ -1,4 +1,4 @@ -var View = Backbone.View.extend({ +export var View = Backbone.View.extend({ className: "ui-modal", // defaults diff --git a/client/galaxy/scripts/mvc/ui/ui-portlet.js b/client/galaxy/scripts/mvc/ui/ui-portlet.js index a2b90297be2..38b7e07e864 100644 --- a/client/galaxy/scripts/mvc/ui/ui-portlet.js +++ b/client/galaxy/scripts/mvc/ui/ui-portlet.js @@ -1,6 +1,7 @@ import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; -var View = Backbone.View.extend({ + +export var View = Backbone.View.extend({ visible: false, initialize: function(options) { var self = this; diff --git a/client/galaxy/scripts/mvc/ui/ui-slider.js b/client/galaxy/scripts/mvc/ui/ui-slider.js index 45be78c6612..2b10bd62454 100644 --- a/client/galaxy/scripts/mvc/ui/ui-slider.js +++ b/client/galaxy/scripts/mvc/ui/ui-slider.js @@ -1,4 +1,5 @@ import Utils from "utils/utils"; + var View = Backbone.View.extend({ initialize: function(options) { var self = this; diff --git a/client/galaxy/scripts/mvc/ui/ui-tabs.js b/client/galaxy/scripts/mvc/ui/ui-tabs.js index 0cfb229f250..d5dc94796e1 100644 --- a/client/galaxy/scripts/mvc/ui/ui-tabs.js +++ b/client/galaxy/scripts/mvc/ui/ui-tabs.js @@ -1,10 +1,8 @@ /** * Renders tabs e.g. used in the charts editor, behaves similar to repeat and section rendering */ -import Utils from "utils/utils"; -var View = Backbone.View.extend({ +export var View = Backbone.View.extend({ initialize: function(options) { - var self = this; this.collection = new Backbone.Collection(); this.model = (options && options.model) || diff --git a/client/galaxy/scripts/mvc/ui/ui-thumbnails.js b/client/galaxy/scripts/mvc/ui/ui-thumbnails.js index 45ff9f60e08..0579b8c7c44 100644 --- a/client/galaxy/scripts/mvc/ui/ui-thumbnails.js +++ b/client/galaxy/scripts/mvc/ui/ui-thumbnails.js @@ -1,8 +1,8 @@ /** This class renders the selection grid. */ import Utils from "utils/utils"; -import Ui from "mvc/ui/ui-misc"; import Tabs from "mvc/ui/ui-tabs"; -var View = Backbone.View.extend({ + +export var View = Backbone.View.extend({ events: { "click .ui-thumbnails-item": "_onclick", "dblclick .ui-thumbnails-item": "_ondblclick" @@ -26,8 +26,6 @@ var View = Backbone.View.extend({ }, _renderDefault: function() { - var self = this; - var index = []; var title_length = 20; var $el = $("
").addClass("ui-thumbnails-grid"); this.collection.each(model => { @@ -35,7 +33,7 @@ var View = Backbone.View.extend({ var title = model.get("title"); $el.append( $( - self._templateThumbnailItem({ + this._templateThumbnailItem({ id: model.id, title: title.length < title_length ? title : `${title.substr(0, title_length)}...`, title_icon: model.get("title_icon"), @@ -51,7 +49,7 @@ var View = Backbone.View.extend({ if ($el.children().length > 0) { this.tabs.add({ id: Utils.uid(), - title: self.model.get("title_default"), + title: this.model.get("title_default"), $el: $el }); } @@ -82,7 +80,9 @@ var View = Backbone.View.extend({ this.$(`[value="${new_value}"]`).addClass("ui-thumbnail-current"); var after = this.$(".ui-thumbnail-current").attr("value"); var change_handler = this.model.get("onchange"); - after != before && change_handler && change_handler(after); + if (after != before && change_handler) { + change_handler(after); + } } return this.$(".ui-thumbnail-current").attr("value"); }, @@ -97,8 +97,10 @@ var View = Backbone.View.extend({ }, /** Add double click handler */ - _ondblclick: function(e) { - this.model.get("ondblclick") && this.model.get("ondblclick")(this.value()); + _ondblclick: function() { + if (this.model.get("ondblclick")) { + this.model.get("ondblclick")(this.value()); + } }, /* Thumbnail template with image */ diff --git a/client/galaxy/scripts/mvc/visualization/visualization-model.js b/client/galaxy/scripts/mvc/visualization/visualization-model.js index bd084691105..40b56109554 100644 --- a/client/galaxy/scripts/mvc/visualization/visualization-model.js +++ b/client/galaxy/scripts/mvc/visualization/visualization-model.js @@ -1,10 +1,11 @@ +import * as Backbone from "libs/backbone"; //============================================================================== /** @class Model for a saved Galaxy visualization. * * @augments Backbone.Model * @constructs */ -var Visualization = Backbone.Model.extend( +export var Visualization = Backbone.Model.extend( /** @lends Visualization.prototype */ { ///** logger used to record this.log messages, commonly set to console */ //// comment this out to suppress log output @@ -76,7 +77,7 @@ var Visualization = Backbone.Model.extend( * * @constructs */ -var VisualizationCollection = Backbone.Collection.extend( +export var VisualizationCollection = Backbone.Collection.extend( /** @lends VisualizationCollection.prototype */ { model: Visualization, diff --git a/client/galaxy/scripts/mvc/workflow/workflow-canvas.js b/client/galaxy/scripts/mvc/workflow/workflow-canvas.js index f1417aac7a9..fe3eed53995 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-canvas.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-canvas.js @@ -7,6 +7,8 @@ function CanvasManager(app, canvas_viewport, overview) { this.ov = overview.find("#overview-viewport"); // Make overview box draggable this.init_drag(); + // Initialize Copy & Paste events + this.init_copy_paste(); } $.extend(CanvasManager.prototype, { init_drag: function() { @@ -33,6 +35,9 @@ $.extend(CanvasManager.prototype, { var x_adjust; var y_adjust; this.cv + .bind("click", function() { + document.activeElement.blur(); + }) .bind("dragstart", function() { var o = $(this).offset(); var p = self.cc.position(); @@ -96,6 +101,42 @@ $.extend(CanvasManager.prototype, { only be done by dragging the borders */ $("#overview-border div").bind("drag", () => {}); }, + init_copy_paste: function() { + document.addEventListener("copy", e => { + // If it appears that the user is trying to copy/paste text, we + // pass that through. + if (window.getSelection().toString() === "") { + if (this.app.workflow.active_node) { + e.clipboardData.setData( + "application/json", + JSON.stringify({ + nodeId: this.app.workflow.active_node.id + }) + ); + } + e.preventDefault(); + } + }); + + document.addEventListener("paste", e => { + // If it appears that the user is trying to paste into a text box, + // pass that through and skip the workflow copy/paste logic. + if ( + document.activeElement && + document.activeElement.type !== "textarea" && + document.activeElement.type !== "text" + ) { + var nodeId; + try { + nodeId = JSON.parse(e.clipboardData.getData("application/json")).nodeId; + } catch (error) {} + if (nodeId && this.app.workflow.nodes.hasOwnProperty(nodeId)) { + this.app.workflow.nodes[nodeId].clone(); + } + e.preventDefault(); + } + }); + }, update_viewport_overlay: function() { var cc = this.cc; var cv = this.cv; @@ -229,27 +270,28 @@ $.extend(ScrollPanel.prototype, { close_dist = 5; var nudge = 23; + var t = 0; if (x - close_dist < min_x) { if (panel_pos.left < p_max_x) { - var t = Math.min(nudge, p_max_x - panel_pos.left); + t = Math.min(nudge, p_max_x - panel_pos.left); panel.css("left", panel_pos.left + t); moved = true; } } else if (x + close_dist > max_x) { if (panel_pos.left > p_min_x) { - var t = Math.min(nudge, panel_pos.left - p_min_x); + t = Math.min(nudge, panel_pos.left - p_min_x); panel.css("left", panel_pos.left - t); moved = true; } } else if (y - close_dist < min_y) { if (panel_pos.top < p_max_y) { - var t = Math.min(nudge, p_max_y - panel_pos.top); + t = Math.min(nudge, p_max_y - panel_pos.top); panel.css("top", panel_pos.top + t); moved = true; } } else if (y + close_dist > max_y) { if (panel_pos.top > p_min_y) { - var t = Math.min(nudge, panel_pos.top - p_min_x); + t = Math.min(nudge, panel_pos.top - p_min_x); panel.css("top", `${panel_pos.top - t}px`); moved = true; } @@ -257,13 +299,12 @@ $.extend(ScrollPanel.prototype, { if (moved) { // Keep moving even if mouse doesn't move onmove(); - var panel = this; this.timeout = setTimeout(() => { - panel.test(e, onmove); + this.test(e, onmove); }, 50); } }, - stop: function(e, ui) { + stop: function() { clearTimeout(this.timeout); } }); diff --git a/client/galaxy/scripts/mvc/workflow/workflow-manager.js b/client/galaxy/scripts/mvc/workflow/workflow-manager.js index 431a8284e0f..35b8d79890d 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-manager.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-manager.js @@ -300,6 +300,7 @@ $.extend(Workflow.prototype, { this.active_node.make_inactive(); this.active_node = null; } + document.activeElement.blur(); this.app.showAttributes(); }, activate_node: function(node) { diff --git a/client/galaxy/scripts/mvc/workflow/workflow-node.js b/client/galaxy/scripts/mvc/workflow/workflow-node.js index a14919d35e3..e32591b7373 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-node.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-node.js @@ -1,3 +1,4 @@ +import Utils from "utils/utils"; import NodeView from "mvc/workflow/workflow-view-node"; var Node = Backbone.Model.extend({ initialize: function(app, attr) { @@ -129,6 +130,31 @@ var Node = Backbone.Model.extend({ t.redraw(); }); }, + clone: function() { + var copiedData = { + name: this.name, + label: this.label, + annotation: this.annotation, + post_job_actions: this.post_job_actions + }; + var node = this.app.workflow.create_node(this.type, this.name, this.content_id); + + Utils.request({ + type: "POST", + url: `${Galaxy.root}api/workflows/build_module`, + data: { + type: this.type, + tool_id: this.content_id, + inputs: this.tool_state + }, + success: data => { + var newData = Object.assign({}, data, copiedData); + node.init_field_data(newData); + node.update_field_data(newData); + this.app.workflow.activate_node(node); + } + }); + }, destroy: function() { $.each(this.input_terminals, (k, t) => { t.destroy(); diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view.js b/client/galaxy/scripts/mvc/workflow/workflow-view.js index 938cccdbe95..2c79f499fef 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view.js @@ -763,6 +763,13 @@ export default Backbone.View.extend({ // Fix width to computed width // Now add floats var buttons = $("
"); + buttons.append( + $("
") + .addClass("fa-icon-button fa fa-files-o") + .click(e => { + node.clone(); + }) + ); buttons.append( $("
") .addClass("fa-icon-button fa fa-times") diff --git a/client/galaxy/scripts/utils/utils.js b/client/galaxy/scripts/utils/utils.js index b75edad7beb..4ff7e2c2254 100644 --- a/client/galaxy/scripts/utils/utils.js +++ b/client/galaxy/scripts/utils/utils.js @@ -4,12 +4,12 @@ */ import _l from "utils/localization"; /** Builds a basic iframe */ -function iframe(src) { +export function iframe(src) { return `';return n(".chat-modal").length>0&&n(".chat-modal").remove(),o.modal=new r.default.View({body:h,height:350,width:600,closing_events:!0,title_separator:!1,cls:"ui-modal chat-modal"}),o.modal.show(),c=n(".chat-modal .modal-header"),u=n(".chat-modal .modal-body"),c.addClass("modal-header-body"),u.addClass("modal-header-body"),c.find("h4").remove(),c.removeAttr("min-height padding border"),c.append(''),n(".close-modal").click(function(t){n(".chat-modal").css("display","none")}),n(".expand-compress-modal").click(function(t){n(".expand-compress-modal").hasClass("fa-expand")?(n(".chat-modal .modal-dialog").width("1000px"),n(".chat-modal .modal-body").height("575px"),n(".expand-compress-modal").removeClass("fa-expand").addClass("fa-compress"),n(".expand-compress-modal").attr("title","Minimize"),n(".expand-compress-modal").css("margin-left","96.2%")):(n(".chat-modal .modal-dialog").width("600px"),n(".chat-modal .modal-body").height("350px"),n(".expand-compress-modal").removeClass("fa-compress").addClass("fa-expand"),n(".expand-compress-modal").attr("title","Maximize"),n(".expand-compress-modal").css("margin-left","93.2%"))}),this},render:function(){var t=this;return{id:"show-chat-online",icon:"fa-comment-o",tooltip:"Chat online",visible:!1,onclick:t.makeModalIframe}}});e.default={GenericNavView:o}}).call(e,i(1),i(0))},function(t,e,i){"use strict";(function(t,n,a){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(45),s=r(o),l=i(15),d=r(l),c=i(13),u=r(c),h=i(145),f=r(h),p=i(7),_=r(p);e.default=t.View.extend({initialize:function(t){var e=this;t=t||{},this.frames=new s.default.View({visible:!1}),this.setElement(this.frames.$el),this.buttonActive=t.collection.add({id:"enable-scratchbook",icon:"fa-th",tooltip:(0,_.default)("Enable/Disable Scratchbook"),onclick:function(){e.active=!e.active,e.buttonActive.set({toggle:e.active,show_note:e.active,note_cls:e.active&&"fa fa-check"}),!e.active&&e.frames.hide()},onbeforeunload:function(){if(e.frames.length()>0)return"You opened "+e.frames.length()+" frame(s) which will be lost."}}),this.buttonLoad=t.collection.add({id:"show-scratchbook",icon:"fa-eye",tooltip:(0,_.default)("Show/Hide Scratchbook"),show_note:!0,visible:!1,onclick:function(t){e.frames.visible?e.frames.hide():e.frames.show()}}),this.frames.on("add remove",function(){this.visible&&0==this.length()&&this.hide(),e.buttonLoad.set({note:this.length(),visible:this.length()>0})}).on("show hide ",function(){e.buttonLoad.set({toggle:this.visible,icon:this.visible&&"fa-eye"||"fa-eye-slash"})}),this.history_cache={}},addDataset:function(t){var e=this,i=null;if(Galaxy&&Galaxy.currHistoryPanel){var a=Galaxy.currHistoryPanel.collection.historyId;this.history_cache[a]={name:Galaxy.currHistoryPanel.model.get("name"),dataset_ids:[]},Galaxy.currHistoryPanel.collection.each(function(t){!t.get("deleted")&&t.get("visible")&&e.history_cache[a].dataset_ids.push(t.get("id"))})}var r=function(t,i){if(t){var n=e.history_cache[t.get("history_id")];if(n&&n.dataset_ids){var a=n.dataset_ids,r=a.indexOf(t.get("id"));if(-1!==r&&r+i>=0&&r+i=this.options.errorAtPercent},_render_quota:function(){var t=this.model.toJSON(),e=t.quota_percent,i=a(this._templateQuotaMeter(t)),n=i.find(".progress-bar");return this.isOverQuota()?(n.attr("class","progress-bar progress-bar-danger"),i.find(".quota-meter-text").css("color","white"),this.trigger("quota:over",t)):e>=this.options.warnAtPercent?(n.attr("class","progress-bar progress-bar-warning"),this.trigger("quota:under quota:under:approaching",t)):(n.attr("class","progress-bar progress-bar-success"),this.trigger("quota:under quota:under:ok",t)),i},_render_usage:function(){var t=a(this._templateUsage(this.model.toJSON()));return this.log(this+".rendering usage:",t),t},render:function(){var t=null;return this.log(this+".model.quota_percent:",this.model.get("quota_percent")),t=null===this.model.get("quota_percent")||void 0===this.model.get("quota_percent")?this._render_usage():this._render_quota(),this.$el.html(t),this.$el.find(".quota-meter-text").tooltip(),this},_templateQuotaMeter:function(t){return['
','
','
':">",(0,d.default)("Using")," ",t.quota_percent,"%","
","
"].join("")},_templateUsage:function(t){return['
','
',t.nice_total_disk_usage?(0,d.default)("Using ")+t.nice_total_disk_usage:"","
","
"].join("")},toString:function(){return"UserQuotaMeter("+this.model+")"}});e.default={UserQuotaMeter:c}}).call(e,i(1),i(2),i(0))},,,,,,,,,,,,,function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{default:t}}function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function r(t,e){return this._init(t||{},e||{})}Object.defineProperty(e,"__esModule",{value:!0});var o=i(2),s=a(o),l=i(1),d=a(l),c=i(8),u=n(c),h=i(158),f=n(h),p=i(178),_=n(p),m=i(62),g=n(m),v=i(7),b=n(v);(0,g.default)(r,"GalaxyApp");var w="galaxy:debug:namespaces",y=!1;try{y="true"==localStorage.getItem("galaxy:debug")}catch(t){console.log((0,b.default)("localStorage not available for debug flag retrieval"))}r.prototype._init=function(t,e){var i=this;return s.extend(i,d.Events),y&&(i.logger=console,console.debug("debugging galaxy:","options:",t,"bootstrapped:",e)),i._processOptions(t),i.root=t.root||"/",i.params=t.params||{},i.session_csrf_token=t.session_csrf_token||null,i._initConfig(t.config||{}),i._patchGalaxy(window.Galaxy),i._initLogger(i.options.loggerOptions||{}),i.debug("GalaxyApp.options: ",i.options),i.debug("GalaxyApp.config: ",i.config),i.debug("GalaxyApp.logger: ",i.logger),i._initLocale(),i.debug("GalaxyApp.localize: ",i.localize),i.config=t.config||{},i.debug("GalaxyApp.config: ",i.config),i._initUser(t.user||{}),i.debug("GalaxyApp.user: ",i.user),i._setUpListeners(),i.trigger("ready",i),i},r.prototype.defaultOptions={patchExisting:!0,root:"/",session_csrf_token:null},r.prototype._processOptions=function(t){var e=this,i=e.defaultOptions;e.options={};for(var n in i)i.hasOwnProperty(n)&&(e.options[n]=t.hasOwnProperty(n)?t[n]:i[n]);return e},r.prototype._initConfig=function(t){var e=this;return e.config=t,e.config.debug=y||e.config.debug,e},r.prototype._patchGalaxy=function(t){var e=this;if(e.options.patchExisting&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},r.prototype._initLogger=function(t){var e=this;if(e.config.debug){t.consoleLogger=t.consoleLogger||console,t.consoleLevel=t.consoleLevel||_.default.MetricsLogger.ALL;try{t.consoleNamespaceWhitelist=localStorage.getItem(w).split(",")}catch(t){}try{t.consoleFlattenMessages="true"==localStorage.getItem("galaxy:debug:flatten")}catch(t){}console.log(t.consoleFlattenMessages)}return e.logger=new _.default.MetricsLogger(t),e.emit={},["log","debug","info","warn","error","metric"].map(function(t){e.emit[t]=function(i){e.logger.emit(t,arguments[0],Array.prototype.slice.call(arguments,1))}}),e.config.debug&&(u.default.LoggableMixin.logger=e.logger),e},r.prototype._initLocale=function(t){var e=this;return e.debug("_initLocale:",t),e.localize=b.default,window._l=e.localize,e},r.prototype._initUser=function(t){var e=this;return e.debug("_initUser:",t),e.user=new f.default.User(t),e.user.logger=e.logger,e},r.prototype._setUpListeners=function(){var e=this;return e.lastAjax={},t(document).bind("ajaxSend",function(t,i,n){var a=n.data;try{a=JSON.parse(a)}catch(t){}e.lastAjax={url:location.href.slice(0,-1)+n.url,data:a}}),e},r.prototype.debugging=function(t){var e=this;try{if(void 0===t)return"true"===localStorage.getItem("galaxy:debug");if(t)return localStorage.setItem("galaxy:debug",!0),!0;localStorage.removeItem("galaxy:debug"),e.debuggingNamespaces(null)}catch(t){console.log((0,b.default)("localStorage not available for debug flag retrieval"))}return!1},r.prototype.debuggingNamespaces=function(t){var e=this;try{if(void 0===t){var i=localStorage.getItem(w);return"string"==typeof i?i.split(","):[]}null===t?localStorage.removeItem(w):localStorage.setItem(w,t);var n=e.debuggingNamespaces();return e.logger&&(e.logger.options.consoleNamespaceWhitelist=n),n}catch(t){console.log((0,b.default)("localStorage not available for debug namespace retrieval"))}},r.prototype.toString=function(){return"GalaxyApp("+(this.user?this.user.get("email")||"(anonymous)":"uninitialized")+")"},e.default={GalaxyApp:r}}).call(e,i(0))},function(t,e,i){"use strict";(function(t){function i(t){t=t||{};var e=this;return e.userId=window.bootstrapped&&window.bootstrapped.user?window.bootstrapped.user.id:null,e.userId=e.userId||t.userId||null,e.consoleLogger=t.consoleLogger||null,e._init(t),e}function n(t){var e=String(t);return"[object Object]"==e&&(e=JSON.stringify(t)),e}function a(t){return this._init(t||{})}Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i.ALL=0,i.LOG=0,i.DEBUG=10,i.INFO=20,i.WARN=30,i.ERROR=40,i.METRIC=50,i.NONE=100,i.defaultOptions={logLevel:i.NONE,consoleLevel:i.NONE,defaultNamespace:"Galaxy",consoleNamespaceWhitelist:null,consoleFlattenMessages:!1,clientPrefix:"client.",maxCacheSize:3e3,postSize:1e3,addTime:!0,cacheKeyPrefix:"logs-",postUrl:"/api/metrics",delayPostInMs:6e5,getPingData:void 0,onServerResponse:void 0},i.prototype._init=function(t){var e=this;e.options={};for(var n in i.defaultOptions)i.defaultOptions.hasOwnProperty(n)&&(e.options[n]=t.hasOwnProperty(n)?t[n]:i.defaultOptions[n]);return e.options.logLevel=e._parseLevel(e.options.logLevel),e.options.consoleLevel=e._parseLevel(e.options.consoleLevel),e._sending=!1,e._waiting=null,e._postSize=e.options.postSize,e._initCache(),e},i.prototype._initCache=function(){try{this.cache=new a({maxSize:this.options.maxCacheSize,key:this.options.cacheKeyPrefix+this.userId})}catch(t){this._emitToConsole("warn","MetricsLogger",["Could not intitialize logging cache:",t]),this.options.logLevel=i.NONE}},i.prototype._parseLevel=function(t){var e=void 0===t?"undefined":r(t);if("number"===e)return t;if("string"===e){var n=t.toUpperCase();if(i.hasOwnProperty(n))return i[n]}throw new Error("Unknown log level: "+t)},i.prototype.emit=function(t,e,i){var n=this;return e=e||n.options.defaultNamespace,t&&i?(t=n._parseLevel(t),t>=n.options.logLevel&&n._addToCache(t,e,i),n.consoleLogger&&t>=n.options.consoleLevel&&n._emitToConsole(t,e,i),n):n},i.prototype._addToCache=function(t,e,i){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var n=this;try{n.cache.add(n._buildEntry(t,e,i))>=n._postSize&&n._postCache()}catch(t){n._emitToConsole("warn","MetricsLogger",["Metrics logger could not stringify logArguments:",e,i]),n._emitToConsole("error","MetricsLogger",[t])}return n},i.prototype._buildEntry=function(t,e,i){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var n={level:t,namespace:this.options.clientPrefix+e,args:i};return this.options.addTime&&(n.time=(new Date).toISOString()),n},i.prototype._postCache=function(e){if(e=e||{},this._emitToConsole("info","MetricsLogger",["_postCache",e,this._postSize]),!this.options.postUrl||this._sending)return t.when({});var i=this,n=e.count||i._postSize,a=i.cache.get(n),r=a.length,o="function"==typeof i.options.getPingData?i.options.getPingData():{};return o.metrics=JSON.stringify(a),i._sending=!0,t.post(i.options.postUrl,o).always(function(){i._sending=!1}).fail(function(t,e,n){i._postSize=i.options.maxCacheSize,i.emit("error","MetricsLogger",["_postCache error:",t.readyState,t.status,t.responseJSON||t.responseText])}).done(function(t){"function"==typeof i.options.onServerResponse&&i.options.onServerResponse(t),i.cache.remove(r),i._postSize=i.options.postSize})},i.prototype._delayPost=function(){var t=this;t._waiting=setTimeout(function(){t._waiting=null},t.options.delayPostInMs)},i.prototype._emitToConsole=function(t,e,a){var r=this,o=r.options.consoleNamespaceWhitelist;if(!r.consoleLogger)return r;if(o&&-1===o.indexOf(e))return r;var s=Array.prototype.slice.call(a,0);return s.unshift(e),r.options.consoleFlattenMessages&&(s=[s.map(n).join(" ")]),t>=i.METRIC&&"function"==typeof r.consoleLogger.info?r.consoleLogger.info.apply(r.consoleLogger,s):t>=i.ERROR&&"function"==typeof r.consoleLogger.error?r.consoleLogger.error.apply(r.consoleLogger,s):(t>=i.WARN&&"function"==typeof r.consoleLogger.warn?r.consoleLogger.warn.apply(r.consoleLogger,s):t>=i.INFO&&"function"==typeof r.consoleLogger.info?r.consoleLogger.info.apply(r.consoleLogger,s):t>=i.DEBUG&&"function"==typeof r.consoleLogger.debug?r.consoleLogger.debug.apply(r.consoleLogger,s):"function"==typeof r.consoleLogger.log&&r.consoleLogger.log.apply(r.consoleLogger,s),r)},i.prototype.log=function(){this.emit(1,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.debug=function(){this.emit(i.DEBUG,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.info=function(){this.emit(i.INFO,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.warn=function(){this.emit(i.WARN,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.error=function(){this.emit(i.ERROR,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.metric=function(){this.emit(i.METRIC,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},a.defaultOptions={maxSize:5e3},a.prototype._init=function(t){if(!this._hasStorage())throw new Error("LoggingCache needs localStorage");if(!t.key)throw new Error("LoggingCache needs key for localStorage");return this.key=t.key,this._initStorage(),this.maxSize=t.maxSize||a.defaultOptions.maxSize,this},a.prototype._hasStorage=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(t){return!1}},a.prototype._initStorage=function(){return null===localStorage.getItem(this.key)?this.empty():this},a.prototype.add=function(t){var e=this,i=e._fetchAndParse(),n=i.length+1-e.maxSize;return n>0&&i.splice(0,n),i.push(t),e._unparseAndStore(i),i.length},a.prototype._fetchAndParse=function(){var t=this;return JSON.parse(localStorage.getItem(t.key))},a.prototype._unparseAndStore=function(t){var e=this;return localStorage.setItem(e.key,JSON.stringify(t))},a.prototype.length=function(){return this._fetchAndParse().length},a.prototype.get=function(t){return this._fetchAndParse().slice(0,t)},a.prototype.remove=function(t){var e=this._fetchAndParse(),i=e.splice(0,t);return this._unparseAndStore(e),i},a.prototype.empty=function(){return localStorage.setItem(this.key,"[]"),this},a.prototype.stringify=function(t){return JSON.stringify(this.get(t))},a.prototype.print=function(){console.log(JSON.stringify(this._fetchAndParse(),null," "))},e.default={MetricsLogger:i,LoggingCache:a}}).call(e,i(0))},function(t,e,i){"use strict";(function(t,n,a){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(160),s=r(o),l=i(176),d=r(l),c=i(9),u=r(c),h=i(3),f=r(h),p=t.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(e){var i=this;this.config=n.defaults(e.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""}),Galaxy.modal=this.modal=new u.default.View,Galaxy.display=this.display=function(t){t.title?(f.default.setWindowTitle(t.title),t.allow_title_display=!1):(f.default.setWindowTitle(),t.allow_title_display=!0),i.center.display(t)},Galaxy.router=this.router=e.Router&&new e.Router(i,e),this.masthead=new s.default.View(this.config),this.center=new d.default.CenterPanel,this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$("#masthead").replaceWith(this.masthead.$el),this.$("#center").append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.panels={},n.each(this._panelids,function(t){var n=t.charAt(0).toUpperCase()+t.slice(1),a=e[n];if(a){var r=new a(i,e);i[r.toString()]=r,i.panels[t]=new d.default.SidePanel({id:t,el:i.$("#"+t),view:r})}}),this.render(),this.router&&t.history.start({root:Galaxy.root,pushState:!0})},render:function(){return a(".select2-hidden-accessible").remove(),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var t=this.config.message_box_content||"",e=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+e+"-message").html(t).toggle(!!t).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var t=this.config.inactivity_box_content||"",e=a("").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(t+" ").append(e).toggle(!!t).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var t=this;return n.each(this._panelids,function(e){var i=t.panels[e];i?i.render():(t.$("#center").css(e,0),t.$("#"+e).hide())}),this},_template:function(){return['
','
','
','
','
','
','
','",'
'].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var t=window.Galaxy.config.communication_server_host,e=window.Galaxy.config.communication_server_port,i=window.Galaxy.user.attributes.preferences,n=a("#show-chat-online");i&&-1!=["1","true"].indexOf(i.communication_server)?a.ajax({url:t+":"+e}).success(function(t){null!==window.Galaxy.user.id&&"hidden"===n.css("visibility")&&n.css("visibility","visible")}).error(function(t){n.css("visibility","hidden")}):n.css("visibility","hidden")}});e.default={View:p}}).call(e,i(1),i(2),i(0))},,,function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(0),r=n(a),o=i(61),s=n(o),l=i(4),d=n(l),c=r.default,u=t.Router.extend({initialize:function(t,e){this.page=t,this.options=e},push:function(t,e){e=e||{},e.__identifer=Math.random().toString(36).substr(2),c.isEmptyObject(e)||(t+=-1==t.indexOf("?")?"?":"&",t+=c.param(e,!0)),Galaxy.params=e,this.navigate(t,{trigger:!0})},execute:function(t,e,i){Galaxy.debug("router execute:",t,e,i);var n=s.default.parse(e.pop());e.push(n),t&&(this.authenticate(e,i)?t.apply(this,e):this.access_denied())},authenticate:function(t,e){return!0},access_denied:function(){this.page.display(new d.default.Message({status:"danger",message:"You must be logged in with proper credentials to make this request.",persistent:!0}))}});e.default=u}).call(e,i(1))},,,,,,,,,,,,,,,function(t,e,i){"use strict";(function(t,n){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(20),o=a(r),s=i(4),l=a(s),d=t.View.extend({initialize:function(e){this.model=new t.Model(e),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement("
"),this.render()},render:function(){var t=this;n.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(e){var i=n.extend({},t.model.attributes,e),a=new o.default({title:i.title,message:i.message,status:i.status||"warning",icon:i.icon,inputs:i.inputs,buttons:{submit:new l.default.Button({tooltip:i.submit_tooltip,title:i.submit_title||"Save",icon:i.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){t._submit(a)}})}});t.$el.empty().append(a.$el)}).fail(function(e){t.$el.empty().append(new l.default.Message({message:"Failed to load resource "+t.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(t){var e=this;n.ajax({url:Galaxy.root+e.url,data:JSON.stringify(t.data.create()),type:"PUT",contentType:"application/json"}).done(function(i){var a={};i.id?a.id=i.id:a={message:i.message,status:"success",persistent:!1},e.redirect?window.location=Galaxy.root+e.redirect+"?"+n.param(a):(t.data.matchModel(i,function(e,i){t.field_list[i].value(e.value)}),e._showMessage(t,success_message))}).fail(function(i){e._showMessage(t,{message:i.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(t,e){t.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf(n(this).css("overflow"))}).first().animate({scrollTop:0},500),t.message.update(e)}});e.default={View:d}}).call(e,i(1),i(0))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";(function(t){function e(t){return t&&t.__esModule?t:{default:t}}var n=i(0),a=e(n),r=i(177),o=e(r),s=i(278),l=e(s),d=i(197),c=e(d),u=i(26),h=e(u),f=i(4),p=(e(f),i(61)),_=e(p),m=i(182),g=e(m),v=i(3),b=e(v),w=i(179),y=e(w),x=i(142),k=e(x),C=i(279),S=e(C),$=a.default;window.app=function(e,i){window.Galaxy=new o.default.GalaxyApp(e,i),Galaxy.debug("admin app");var n=g.default.extend({routes:{"(/)admin(/)users":"show_users","(/)admin(/)roles":"show_roles","(/)admin(/)groups":"show_groups","(/)admin(/)tool_versions":"show_tool_versions","(/)admin(/)quotas":"show_quotas","(/)admin(/)repositories":"show_repositories","(/)admin(/)forms":"show_forms","(/)admin(/)form(/)(:form_id)":"show_form","(/)admin/api_keys":"show_user_api_keys"},authenticate:function(t,e){return Galaxy.user&&Galaxy.user.id&&Galaxy.user.get("is_admin")},show_users:function(){this.page.display(new h.default({url_base:Galaxy.root+"admin/users_list",url_data:Galaxy.params,dict_format:!0}))},show_roles:function(){this.page.display(new h.default({url_base:Galaxy.root+"admin/roles_list",url_data:Galaxy.params,dict_format:!0}))},show_groups:function(){this.page.display(new h.default({url_base:Galaxy.root+"admin/groups_list",url_data:Galaxy.params,dict_format:!0}))},show_repositories:function(){this.page.display(new h.default({url_base:Galaxy.root+"admin_toolshed/browse_repositories",url_data:Galaxy.params,dict_format:!0}))},show_tool_versions:function(){this.page.display(new h.default({url_base:Galaxy.root+"admin/tool_versions_list",url_data:Galaxy.params,dict_format:!0}))},show_quotas:function(){this.page.display(new h.default({url_base:Galaxy.root+"admin/quotas_list",url_data:Galaxy.params,dict_format:!0}))},show_user_api_keys:function(){var t=document.createElement("div");this.page.display(t),new k.default(S.default).$mount(t)},show_forms:function(){this.page.display(new h.default({url_base:Galaxy.root+"forms/forms_list",url_data:Galaxy.params,dict_format:!0}))},show_form:function(t){var e="?id="+_.default.get("id"),i={reset_user_password:{title:"Reset passwords",url:"admin/reset_user_password"+e,icon:"fa-user",submit_title:"Save new password",redirect:"admin/users"},manage_roles_and_groups_for_user:{url:"admin/manage_roles_and_groups_for_user"+e,icon:"fa-users",redirect:"admin/users"},manage_users_and_groups_for_role:{url:"admin/manage_users_and_groups_for_role"+e,redirect:"admin/roles"},manage_users_and_roles_for_group:{url:"admin/manage_users_and_roles_for_group"+e,redirect:"admin/groups"},manage_users_and_groups_for_quota:{url:"admin/manage_users_and_groups_for_quota"+e,redirect:"admin/quotas"},create_role:{url:"admin/create_role",redirect:"admin/roles"},create_group:{url:"admin/create_group",redirect:"admin/groups"},create_quota:{url:"admin/create_quota",redirect:"admin/quotas"},rename_role:{url:"admin/rename_role"+e,redirect:"admin/roles"},rename_group:{url:"admin/rename_group"+e,redirect:"admin/groups"},rename_quota:{url:"admin/rename_quota"+e,redirect:"admin/quotas"},edit_quota:{url:"admin/edit_quota"+e,redirect:"admin/quotas"},set_quota_default:{url:"admin/set_quota_default"+e,redirect:"admin/quotas"},create_form:{url:"forms/create_form",redirect:"admin/forms"},edit_form:{url:"forms/edit_form"+e,redirect:"admin/forms"}};this.page.display(new c.default.View(i[t]))}});$(function(){t.extend(e.config,{active_view:"admin"}),b.default.setWindowTitle("Administration"),Galaxy.page=new y.default.View(t.extend(e,{Left:l.default,Router:n}))})}}).call(e,i(2))},function(t,e,i){"use strict";(function(t,n,a){Object.defineProperty(e,"__esModule",{value:!0});var r=i(7),o=function(t){return t&&t.__esModule?t:{default:t}}(r),s=t.View.extend({initialize:function(e,i){var n=this;this.page=e,this.root=i.root,this.config=i.config,this.settings=i.settings,this.message=i.message,this.status=i.status,this.model=new t.Model({title:(0,o.default)("Administration")}),this.categories=new t.Collection([{title:"Server",items:[{title:"Data types",url:"admin/view_datatypes_registry"},{title:"Data tables",url:"admin/view_tool_data_tables"},{title:"Display applications",url:"admin/display_applications"},{title:"Manage jobs",url:"admin/jobs"},{title:"Local data",url:"data_manager"}]},{title:"User Management",items:[{title:"Users",url:"admin/users",target:"__use_router__"},{title:"Quotas",url:"admin/quotas",target:"__use_router__",enabled:n.config.enable_quotas},{title:"Groups",url:"admin/groups",target:"__use_router__"},{title:"Roles",url:"admin/roles",target:"__use_router__"},{title:"Forms",url:"admin/forms",target:"__use_router__"},{title:"API keys",url:"admin/api_keys",target:"__use_router__"},{title:"Impersonate a user",url:"admin/impersonate",enabled:n.config.allow_user_impersonation}]},{title:"Tool Management",items:[{title:"Install new tools",url:"admin_toolshed/browse_tool_sheds",enabled:n.settings.is_tool_shed_installed},{title:"Install new tools (Beta)",url:"admin_toolshed/browse_toolsheds",enabled:n.settings.is_tool_shed_installed&&n.config.enable_beta_ts_api_install},{title:"Monitor installation",url:"admin_toolshed/monitor_repository_installation",enabled:n.settings.installing_repository_ids},{title:"Manage tools",url:"admin/repositories",enabled:n.settings.is_repo_installed,target:"__use_router__"},{title:"Manage metadata",url:"admin_toolshed/reset_metadata_on_selected_installed_repositories",enabled:n.settings.is_repo_installed},{title:"Manage whitelist",url:"admin/sanitize_whitelist"},{title:"Manage dependencies",url:"admin/manage_tool_dependencies"},{title:"View lineage",url:"admin/tool_versions",target:"__use_router__"},{title:"View migration stages",url:"admin/review_tool_migration_stages"},{title:"View error logs",url:"admin/tool_errors"}]}]),this.setElement(this._template())},render:function(){var t=this;this.$el.empty(),this.categories.each(function(e){var i=n(t._templateSection(e.attributes)),r=i.find(".ui-side-section-body");a.each(e.get("items"),function(e){if(void 0===e.enabled||e.enabled){var i=n("").attr({href:t.root+e.url}).text((0,o.default)(e.title));"__use_router__"==e.target?i.on("click",function(i){i.preventDefault(),t.page.router.push(e.url)}):i.attr("target","galaxy_main"),r.append(n("
").addClass("ui-side-section-body-title").append(i))}}),t.$el.append(i)}),this.page.$("#galaxy_main").prop("src",this.root+"admin/center?message="+this.message+"&status="+this.status)},_templateSection:function(t){return["
",'
'+(0,o.default)(t.title)+"
",'
',"
"].join("")},_template:function(){return'
'},toString:function(){return"adminPanel"}});e.default=s}).call(e,i(1),i(0),i(2))},function(t,e,i){"use strict";function n(t){i(280)}Object.defineProperty(e,"__esModule",{value:!0});var a=i(282),r=i.n(a),o=i(283),s=i(60),l=n,d=s(r.a,o.a,!1,l,null,null);e.default=d.exports},function(t,e,i){var n=i(281);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);i(59)("b1b74e4e",n,!0)},function(t,e,i){e=t.exports=i(58)(void 0),e.push([t.i,"",""])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(66),a=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default={data:function(){return{users:[],errors:[]}},created:function(){var t=this;a.default.get(Galaxy.root+"userskeys/all_users").then(function(e){t.users=e.data}).catch(function(e){t.errors.push(e)})},methods:{generateKey:function(t){var e=this;a.default.get(Galaxy.root+"userskeys/admin_api_keys",{params:{uid:t}}).then(function(t){e.users=t.data}).catch(function(t){e.errors.push(t)})}}}},function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"toolForm",attrs:{id:"form-userkeys"}},[i("div",{staticClass:"toolFormTitle"},[t._v("User Information")]),t._v(" "),t.users&&t.users.length>0?i("div",[i("table",{staticClass:"grid"},[t._m(0),t._v(" "),i("tbody",t._l(t.users,function(e){return i("tr",[i("td",[t._v("\n "+t._s(e.uid)+"\n ")]),t._v(" "),i("td",[t._v("\n "+t._s(e.email)+"\n ")]),t._v(" "),i("td",[t._v("\n "+t._s(e.key)+"\n ")]),t._v(" "),i("td",[i("input",{attrs:{type:"button",value:"Generate a new key now"},on:{click:function(i){t.generateKey(e.uid)}}})])])}))])]):i("div",[i("div",[t._v("No user information available")])]),t._v(" "),i("div",{staticStyle:{clear:"both"}})])},a=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("thead",[i("th",[t._v("Encoded UID")]),i("th",[t._v("Email")]),i("th",[t._v("API Key")]),i("th",[t._v("Actions")])])}],r={render:n,staticRenderFns:a};e.a=r}],[277]); \ No newline at end of file +webpackJsonp([2],{23:function(e,t,o){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function s(e,t){return this._init(e||{},t||{})}Object.defineProperty(t,"__esModule",{value:!0});var n=o(1),r=a(n),l=o(2),u=a(l),c=o(5),d=i(c),p=o(24),g=i(p),_=o(25),f=i(_),h=o(32),m=i(h),y=o(4),v=i(y);(0,m.default)(s,"GalaxyApp");var b="galaxy:debug:namespaces",w=!1;try{w="true"==localStorage.getItem("galaxy:debug")}catch(e){console.log((0,v.default)("localStorage not available for debug flag retrieval"))}s.prototype._init=function(e,t){var o=this;return r.extend(o,u.Events),w&&(o.logger=console,console.debug("debugging galaxy:","options:",e,"bootstrapped:",t)),o._processOptions(e),o.root=e.root||"/",o.params=e.params||{},o.session_csrf_token=e.session_csrf_token||null,o._initConfig(e.config||{}),o._patchGalaxy(window.Galaxy),o._initLogger(o.options.loggerOptions||{}),o.debug("GalaxyApp.options: ",o.options),o.debug("GalaxyApp.config: ",o.config),o.debug("GalaxyApp.logger: ",o.logger),o._initLocale(),o.debug("GalaxyApp.localize: ",o.localize),o.config=e.config||{},o.debug("GalaxyApp.config: ",o.config),o._initUser(e.user||{}),o.debug("GalaxyApp.user: ",o.user),o._setUpListeners(),o.trigger("ready",o),o},s.prototype.defaultOptions={patchExisting:!0,root:"/",session_csrf_token:null},s.prototype._processOptions=function(e){var t=this,o=t.defaultOptions;t.options={};for(var i in o)o.hasOwnProperty(i)&&(t.options[i]=e.hasOwnProperty(i)?e[i]:o[i]);return t},s.prototype._initConfig=function(e){var t=this;return t.config=e,t.config.debug=w||t.config.debug,t},s.prototype._patchGalaxy=function(e){var t=this;if(t.options.patchExisting&&e)for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])},s.prototype._initLogger=function(e){var t=this;if(t.config.debug){e.consoleLogger=e.consoleLogger||console,e.consoleLevel=e.consoleLevel||f.default.MetricsLogger.ALL;try{e.consoleNamespaceWhitelist=localStorage.getItem(b).split(",")}catch(e){}try{e.consoleFlattenMessages="true"==localStorage.getItem("galaxy:debug:flatten")}catch(e){}console.log(e.consoleFlattenMessages)}return t.logger=new f.default.MetricsLogger(e),t.emit={},["log","debug","info","warn","error","metric"].map(function(e){t.emit[e]=function(o){t.logger.emit(e,arguments[0],Array.prototype.slice.call(arguments,1))}}),t.config.debug&&(d.default.LoggableMixin.logger=t.logger),t},s.prototype._initLocale=function(e){var t=this;return t.debug("_initLocale:",e),t.localize=v.default,window._l=t.localize,t},s.prototype._initUser=function(e){var t=this;return t.debug("_initUser:",e),t.user=new g.default.User(e),t.user.logger=t.logger,t},s.prototype._setUpListeners=function(){var t=this;return t.lastAjax={},e(document).bind("ajaxSend",function(e,o,i){var a=i.data;try{a=JSON.parse(a)}catch(e){}t.lastAjax={url:location.href.slice(0,-1)+i.url,data:a}}),t},s.prototype.debugging=function(e){var t=this;try{if(void 0===e)return"true"===localStorage.getItem("galaxy:debug");if(e)return localStorage.setItem("galaxy:debug",!0),!0;localStorage.removeItem("galaxy:debug"),t.debuggingNamespaces(null)}catch(e){console.log((0,v.default)("localStorage not available for debug flag retrieval"))}return!1},s.prototype.debuggingNamespaces=function(e){var t=this;try{if(void 0===e){var o=localStorage.getItem(b);return"string"==typeof o?o.split(","):[]}null===e?localStorage.removeItem(b):localStorage.setItem(b,e);var i=t.debuggingNamespaces();return t.logger&&(t.logger.options.consoleNamespaceWhitelist=i),i}catch(e){console.log((0,v.default)("localStorage not available for debug namespace retrieval"))}},s.prototype.toString=function(){return"GalaxyApp("+(this.user?this.user.get("email")||"(anonymous)":"uninitialized")+")"},t.default={GalaxyApp:s}}).call(t,o(0))},25:function(e,t,o){"use strict";(function(e){function o(e){e=e||{};var t=this;return t.userId=window.bootstrapped&&window.bootstrapped.user?window.bootstrapped.user.id:null,t.userId=t.userId||e.userId||null,t.consoleLogger=e.consoleLogger||null,t._init(e),t}function i(e){var t=String(e);return"[object Object]"==t&&(t=JSON.stringify(e)),t}function a(e){return this._init(e||{})}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o.ALL=0,o.LOG=0,o.DEBUG=10,o.INFO=20,o.WARN=30,o.ERROR=40,o.METRIC=50,o.NONE=100,o.defaultOptions={logLevel:o.NONE,consoleLevel:o.NONE,defaultNamespace:"Galaxy",consoleNamespaceWhitelist:null,consoleFlattenMessages:!1,clientPrefix:"client.",maxCacheSize:3e3,postSize:1e3,addTime:!0,cacheKeyPrefix:"logs-",postUrl:"/api/metrics",delayPostInMs:6e5,getPingData:void 0,onServerResponse:void 0},o.prototype._init=function(e){var t=this;t.options={};for(var i in o.defaultOptions)o.defaultOptions.hasOwnProperty(i)&&(t.options[i]=e.hasOwnProperty(i)?e[i]:o.defaultOptions[i]);return t.options.logLevel=t._parseLevel(t.options.logLevel),t.options.consoleLevel=t._parseLevel(t.options.consoleLevel),t._sending=!1,t._waiting=null,t._postSize=t.options.postSize,t._initCache(),t},o.prototype._initCache=function(){try{this.cache=new a({maxSize:this.options.maxCacheSize,key:this.options.cacheKeyPrefix+this.userId})}catch(e){this._emitToConsole("warn","MetricsLogger",["Could not intitialize logging cache:",e]),this.options.logLevel=o.NONE}},o.prototype._parseLevel=function(e){var t=void 0===e?"undefined":s(e);if("number"===t)return e;if("string"===t){var i=e.toUpperCase();if(o.hasOwnProperty(i))return o[i]}throw new Error("Unknown log level: "+e)},o.prototype.emit=function(e,t,o){var i=this;return t=t||i.options.defaultNamespace,e&&o?(e=i._parseLevel(e),e>=i.options.logLevel&&i._addToCache(e,t,o),i.consoleLogger&&e>=i.options.consoleLevel&&i._emitToConsole(e,t,o),i):i},o.prototype._addToCache=function(e,t,o){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var i=this;try{i.cache.add(i._buildEntry(e,t,o))>=i._postSize&&i._postCache()}catch(e){i._emitToConsole("warn","MetricsLogger",["Metrics logger could not stringify logArguments:",t,o]),i._emitToConsole("error","MetricsLogger",[e])}return i},o.prototype._buildEntry=function(e,t,o){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var i={level:e,namespace:this.options.clientPrefix+t,args:o};return this.options.addTime&&(i.time=(new Date).toISOString()),i},o.prototype._postCache=function(t){if(t=t||{},this._emitToConsole("info","MetricsLogger",["_postCache",t,this._postSize]),!this.options.postUrl||this._sending)return e.when({});var o=this,i=t.count||o._postSize,a=o.cache.get(i),s=a.length,n="function"==typeof o.options.getPingData?o.options.getPingData():{};return n.metrics=JSON.stringify(a),o._sending=!0,e.post(o.options.postUrl,n).always(function(){o._sending=!1}).fail(function(e,t,i){o._postSize=o.options.maxCacheSize,o.emit("error","MetricsLogger",["_postCache error:",e.readyState,e.status,e.responseJSON||e.responseText])}).done(function(e){"function"==typeof o.options.onServerResponse&&o.options.onServerResponse(e),o.cache.remove(s),o._postSize=o.options.postSize})},o.prototype._delayPost=function(){var e=this;e._waiting=setTimeout(function(){e._waiting=null},e.options.delayPostInMs)},o.prototype._emitToConsole=function(e,t,a){var s=this,n=s.options.consoleNamespaceWhitelist;if(!s.consoleLogger)return s;if(n&&-1===n.indexOf(t))return s;var r=Array.prototype.slice.call(a,0);return r.unshift(t),s.options.consoleFlattenMessages&&(r=[r.map(i).join(" ")]),e>=o.METRIC&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=o.ERROR&&"function"==typeof s.consoleLogger.error?s.consoleLogger.error.apply(s.consoleLogger,r):(e>=o.WARN&&"function"==typeof s.consoleLogger.warn?s.consoleLogger.warn.apply(s.consoleLogger,r):e>=o.INFO&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=o.DEBUG&&"function"==typeof s.consoleLogger.debug?s.consoleLogger.debug.apply(s.consoleLogger,r):"function"==typeof s.consoleLogger.log&&s.consoleLogger.log.apply(s.consoleLogger,r),s)},o.prototype.log=function(){this.emit(1,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.debug=function(){this.emit(o.DEBUG,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.info=function(){this.emit(o.INFO,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.warn=function(){this.emit(o.WARN,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.error=function(){this.emit(o.ERROR,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.metric=function(){this.emit(o.METRIC,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},a.defaultOptions={maxSize:5e3},a.prototype._init=function(e){if(!this._hasStorage())throw new Error("LoggingCache needs localStorage");if(!e.key)throw new Error("LoggingCache needs key for localStorage");return this.key=e.key,this._initStorage(),this.maxSize=e.maxSize||a.defaultOptions.maxSize,this},a.prototype._hasStorage=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},a.prototype._initStorage=function(){return null===localStorage.getItem(this.key)?this.empty():this},a.prototype.add=function(e){var t=this,o=t._fetchAndParse(),i=o.length+1-t.maxSize;return i>0&&o.splice(0,i),o.push(e),t._unparseAndStore(o),o.length},a.prototype._fetchAndParse=function(){var e=this;return JSON.parse(localStorage.getItem(e.key))},a.prototype._unparseAndStore=function(e){var t=this;return localStorage.setItem(t.key,JSON.stringify(e))},a.prototype.length=function(){return this._fetchAndParse().length},a.prototype.get=function(e){return this._fetchAndParse().slice(0,e)},a.prototype.remove=function(e){var t=this._fetchAndParse(),o=t.splice(0,e);return this._unparseAndStore(t),o},a.prototype.empty=function(){return localStorage.setItem(this.key,"[]"),this},a.prototype.stringify=function(e){return JSON.stringify(this.get(e))},a.prototype.print=function(){console.log(JSON.stringify(this._fetchAndParse(),null," "))},t.default={MetricsLogger:o,LoggingCache:a}}).call(t,o(0))},26:function(e,t,o){"use strict";(function(e,i,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o(33),r=s(n),l=o(22),u=s(l),c=o(8),d=s(c),p=o(3),g=s(p),_=e.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(t){var o=this;this.config=i.defaults(t.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""}),Galaxy.modal=this.modal=new d.default.View,Galaxy.display=this.display=function(e){e.title?(g.default.setWindowTitle(e.title),e.allow_title_display=!1):(g.default.setWindowTitle(),e.allow_title_display=!0),o.center.display(e)},Galaxy.router=this.router=t.Router&&new t.Router(o,t),this.masthead=new r.default.View(this.config),this.center=new u.default.CenterPanel,this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$("#masthead").replaceWith(this.masthead.$el),this.$("#center").append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.panels={},i.each(this._panelids,function(e){var i=e.charAt(0).toUpperCase()+e.slice(1),a=t[i];if(a){var s=new a(o,t);o[s.toString()]=s,o.panels[e]=new u.default.SidePanel({id:e,el:o.$("#"+e),view:s})}}),this.render(),this.router&&e.history.start({root:Galaxy.root,pushState:!0})},render:function(){return a(".select2-hidden-accessible").remove(),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var e=this.config.message_box_content||"",t=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+t+"-message").html(e).toggle(!!e).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var e=this.config.inactivity_box_content||"",t=a("").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(e+" ").append(t).toggle(!!e).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var e=this;return i.each(this._panelids,function(t){var o=e.panels[t];o?o.render():(e.$("#center").css(t,0),e.$("#"+t).hide())}),this},_template:function(){return['
','
','
','
','
','
','
','",'
'].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var e=window.Galaxy.config.communication_server_host,t=window.Galaxy.config.communication_server_port,o=window.Galaxy.user.attributes.preferences,i=a("#show-chat-online");o&&-1!=["1","true"].indexOf(o.communication_server)?a.ajax({url:e+":"+t}).success(function(e){null!==window.Galaxy.user.id&&"hidden"===i.css("visibility")&&i.css("visibility","visible")}).error(function(e){i.css("visibility","hidden")}):i.css("visibility","hidden")}});t.default={View:_}}).call(t,o(2),o(1),o(0))},277:function(e,t,o){"use strict";(function(e){function t(e){return e&&e.__esModule?e:{default:e}}var i=o(0),a=t(i),s=o(23),n=t(s),r=o(278),l=t(r),u=o(68),c=t(u),d=o(19),p=t(d),g=o(6),_=(t(g),o(14)),f=t(_),h=o(53),m=t(h),y=o(3),v=t(y),b=o(26),w=t(b),x=o(31),S=t(x),L=o(279),G=t(L),O=a.default;window.app=function(t,o){window.Galaxy=new n.default.GalaxyApp(t,o),Galaxy.debug("admin app");var i=m.default.extend({routes:{"(/)admin(/)users":"show_users","(/)admin(/)roles":"show_roles","(/)admin(/)groups":"show_groups","(/)admin(/)tool_versions":"show_tool_versions","(/)admin(/)quotas":"show_quotas","(/)admin(/)repositories":"show_repositories","(/)admin(/)forms":"show_forms","(/)admin(/)form(/)(:form_id)":"show_form","(/)admin/api_keys":"show_user_api_keys"},authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id&&Galaxy.user.get("is_admin")},show_users:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/users_list",url_data:Galaxy.params,dict_format:!0}))},show_roles:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/roles_list",url_data:Galaxy.params,dict_format:!0}))},show_groups:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/groups_list",url_data:Galaxy.params,dict_format:!0}))},show_repositories:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin_toolshed/browse_repositories",url_data:Galaxy.params,dict_format:!0}))},show_tool_versions:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/tool_versions_list",url_data:Galaxy.params,dict_format:!0}))},show_quotas:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/quotas_list",url_data:Galaxy.params,dict_format:!0}))},show_user_api_keys:function(){var e=document.createElement("div");this.page.display(e),new S.default(G.default).$mount(e)},show_forms:function(){this.page.display(new p.default({url_base:Galaxy.root+"forms/forms_list",url_data:Galaxy.params,dict_format:!0}))},show_form:function(e){var t="?id="+f.default.get("id"),o={reset_user_password:{title:"Reset passwords",url:"admin/reset_user_password"+t,icon:"fa-user",submit_title:"Save new password",redirect:"admin/users"},manage_roles_and_groups_for_user:{url:"admin/manage_roles_and_groups_for_user"+t,icon:"fa-users",redirect:"admin/users"},manage_users_and_groups_for_role:{url:"admin/manage_users_and_groups_for_role"+t,redirect:"admin/roles"},manage_users_and_roles_for_group:{url:"admin/manage_users_and_roles_for_group"+t,redirect:"admin/groups"},manage_users_and_groups_for_quota:{url:"admin/manage_users_and_groups_for_quota"+t,redirect:"admin/quotas"},create_role:{url:"admin/create_role",redirect:"admin/roles"},create_group:{url:"admin/create_group",redirect:"admin/groups"},create_quota:{url:"admin/create_quota",redirect:"admin/quotas"},rename_role:{url:"admin/rename_role"+t,redirect:"admin/roles"},rename_group:{url:"admin/rename_group"+t,redirect:"admin/groups"},rename_quota:{url:"admin/rename_quota"+t,redirect:"admin/quotas"},edit_quota:{url:"admin/edit_quota"+t,redirect:"admin/quotas"},set_quota_default:{url:"admin/set_quota_default"+t,redirect:"admin/quotas"},create_form:{url:"forms/create_form",redirect:"admin/forms"},edit_form:{url:"forms/edit_form"+t,redirect:"admin/forms"}};this.page.display(new c.default.View(o[e]))}});O(function(){e.extend(t.config,{active_view:"admin"}),v.default.setWindowTitle("Administration"),Galaxy.page=new w.default.View(e.extend(t,{Left:l.default,Router:i}))})}}).call(t,o(1))},278:function(e,t,o){"use strict";(function(e,i,a){Object.defineProperty(t,"__esModule",{value:!0});var s=o(4),n=function(e){return e&&e.__esModule?e:{default:e}}(s),r=e.View.extend({initialize:function(t,o){var i=this;this.page=t,this.root=o.root,this.config=o.config,this.settings=o.settings,this.message=o.message,this.status=o.status,this.model=new e.Model({title:(0,n.default)("Administration")}),this.categories=new e.Collection([{title:"Server",items:[{title:"Data types",url:"admin/view_datatypes_registry"},{title:"Data tables",url:"admin/view_tool_data_tables"},{title:"Display applications",url:"admin/display_applications"},{title:"Manage jobs",url:"admin/jobs"},{title:"Local data",url:"data_manager"}]},{title:"User Management",items:[{title:"Users",url:"admin/users",target:"__use_router__"},{title:"Quotas",url:"admin/quotas",target:"__use_router__",enabled:i.config.enable_quotas},{title:"Groups",url:"admin/groups",target:"__use_router__"},{title:"Roles",url:"admin/roles",target:"__use_router__"},{title:"Forms",url:"admin/forms",target:"__use_router__"},{title:"API keys",url:"admin/api_keys",target:"__use_router__"},{title:"Impersonate a user",url:"admin/impersonate",enabled:i.config.allow_user_impersonation}]},{title:"Tool Management",items:[{title:"Install new tools",url:"admin_toolshed/browse_tool_sheds",enabled:i.settings.is_tool_shed_installed},{title:"Install new tools (Beta)",url:"admin_toolshed/browse_toolsheds",enabled:i.settings.is_tool_shed_installed&&i.config.enable_beta_ts_api_install},{title:"Monitor installation",url:"admin_toolshed/monitor_repository_installation",enabled:i.settings.installing_repository_ids},{title:"Manage tools",url:"admin/repositories",enabled:i.settings.is_repo_installed,target:"__use_router__"},{title:"Manage metadata",url:"admin_toolshed/reset_metadata_on_selected_installed_repositories",enabled:i.settings.is_repo_installed},{title:"Manage whitelist",url:"admin/sanitize_whitelist"},{title:"Manage dependencies",url:"admin/manage_tool_dependencies"},{title:"View lineage",url:"admin/tool_versions",target:"__use_router__"},{title:"View migration stages",url:"admin/review_tool_migration_stages"},{title:"View error logs",url:"admin/tool_errors"}]}]),this.setElement(this._template())},render:function(){var e=this;this.$el.empty(),this.categories.each(function(t){var o=i(e._templateSection(t.attributes)),s=o.find(".ui-side-section-body");a.each(t.get("items"),function(t){if(void 0===t.enabled||t.enabled){var o=i("").attr({href:e.root+t.url}).text((0,n.default)(t.title));"__use_router__"==t.target?o.on("click",function(o){o.preventDefault(),e.page.router.push(t.url)}):o.attr("target","galaxy_main"),s.append(i("
").addClass("ui-side-section-body-title").append(o))}}),e.$el.append(o)}),this.page.$("#galaxy_main").prop("src",this.root+"admin/center?message="+this.message+"&status="+this.status)},_templateSection:function(e){return["
",'
'+(0,n.default)(e.title)+"
",'
',"
"].join("")},_template:function(){return'
'},toString:function(){return"adminPanel"}});t.default=r}).call(t,o(2),o(0),o(1))},279:function(e,t,o){"use strict";function i(e){o(280)}Object.defineProperty(t,"__esModule",{value:!0});var a=o(282),s=o.n(a),n=o(283),r=o(48),l=i,u=r(s.a,n.a,!1,l,null,null);t.default=u.exports},280:function(e,t,o){var i=o(281);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);o(47)("b1b74e4e",i,!0)},281:function(e,t,o){t=e.exports=o(46)(void 0),t.push([e.i,"",""])},282:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(92),a=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default={data:function(){return{users:[],errors:[]}},created:function(){var e=this;a.default.get(Galaxy.root+"userskeys/all_users").then(function(t){e.users=t.data}).catch(function(t){e.errors.push(t)})},methods:{generateKey:function(e){var t=this;a.default.get(Galaxy.root+"userskeys/admin_api_keys",{params:{uid:e}}).then(function(e){t.users=e.data}).catch(function(e){t.errors.push(e)})}}}},283:function(e,t,o){"use strict";var i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"toolForm",attrs:{id:"form-userkeys"}},[o("div",{staticClass:"toolFormTitle"},[e._v("User Information")]),e._v(" "),e.users&&e.users.length>0?o("div",[o("table",{staticClass:"grid"},[e._m(0),e._v(" "),o("tbody",e._l(e.users,function(t){return o("tr",[o("td",[e._v("\n "+e._s(t.uid)+"\n ")]),e._v(" "),o("td",[e._v("\n "+e._s(t.email)+"\n ")]),e._v(" "),o("td",[e._v("\n "+e._s(t.key)+"\n ")]),e._v(" "),o("td",[o("input",{attrs:{type:"button",value:"Generate a new key now"},on:{click:function(o){e.generateKey(t.uid)}}})])])}))])]):o("div",[o("div",[e._v("No user information available")])]),e._v(" "),o("div",{staticStyle:{clear:"both"}})])},a=[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("thead",[o("th",[e._v("Encoded UID")]),o("th",[e._v("Email")]),o("th",[e._v("API Key")]),o("th",[e._v("Actions")])])}],s={render:i,staticRenderFns:a};t.a=s},53:function(e,t,o){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(0),s=i(a),n=o(14),r=i(n),l=o(6),u=i(l),c=s.default,d=e.Router.extend({initialize:function(e,t){this.page=e,this.options=t},push:function(e,t){t=t||{},t.__identifer=Math.random().toString(36).substr(2),c.isEmptyObject(t)||(e+=-1==e.indexOf("?")?"?":"&",e+=c.param(t,!0)),Galaxy.params=t,this.navigate(e,{trigger:!0})},execute:function(e,t,o){Galaxy.debug("router execute:",e,t,o);var i=r.default.parse(t.pop());t.push(i),e&&(this.authenticate(t,o)?e.apply(this,t):this.access_denied())},authenticate:function(e,t){return!0},access_denied:function(){this.page.display(new u.default.Message({status:"danger",message:"You must be logged in with proper credentials to make this request.",persistent:!0}))}});t.default=d}).call(t,o(2))},68:function(e,t,o){"use strict";(function(e,i){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=o(11),n=a(s),r=o(6),l=a(r),u=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement("
"),this.render()},render:function(){var e=this;i.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(t){var o=i.extend({},e.model.attributes,t),a=new n.default({title:o.title,message:o.message,status:o.status||"warning",icon:o.icon,initial_errors:!0,errors:o.errors,inputs:o.inputs,buttons:{submit:new l.default.Button({tooltip:o.submit_tooltip,title:o.submit_title||"Save",icon:o.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){e._submit(a)}})}});e.$el.empty().append(a.$el)}).fail(function(t){e.$el.empty().append(new l.default.Message({message:"Failed to load resource "+e.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e){var t=this;i.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(o){var a={};o.id?a.id=o.id:a={message:o.message,status:"success",persistent:!1},t.redirect?window.location=Galaxy.root+t.redirect+"?"+i.param(a):(e.data.matchModel(o,function(t,o){e.field_list[o].value(t.value)}),t._showMessage(e,success_message))}).fail(function(o){t._showMessage(e,{message:o.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(e,t){e.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf(i(this).css("overflow"))}).first().animate({scrollTop:0},500),e.message.update(t)}});t.default={View:u}}).call(t,o(2),o(0))}},[277]); \ No newline at end of file diff --git a/static/scripts/bundled/adminToolshed.bundled.js b/static/scripts/bundled/adminToolshed.bundled.js index ed1c9ee23ae..c3e22d52ad5 100644 --- a/static/scripts/bundled/adminToolshed.bundled.js +++ b/static/scripts/bundled/adminToolshed.bundled.js @@ -1,4 +1,4 @@ -webpackJsonp([6],{11:function(e,t,i){"use strict";(function(e,s,n){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=a(o),l=i(4),d=a(l),c=e.View.extend({visible:!1,initialize:function(t){var i=this;this.model=t&&t.model||new e.Model({id:r.default.uid(),cls:"ui-portlet",title:"",icon:"",buttons:null,body:null,scrollable:!0,nopadding:!1,operations:null,collapsible:!1,collapsible_button:!1,collapsed:!1,onchange_title:null}).set(t),this.setElement(this._template()),this.$body=this.$(".portlet-body"),this.$title_text=this.$(".portlet-title-text"),this.$title_icon=this.$(".portlet-title-icon"),this.$header=this.$(".portlet-header"),this.$content=this.$(".portlet-content"),this.$backdrop=this.$(".portlet-backdrop"),this.$buttons=this.$(".portlet-buttons"),this.$operations=this.$(".portlet-operations"),this.model.get("body")&&this.append(this.model.get("body")),this.collapsible_button=new d.default.ButtonIcon({icon:"fa-eye",tooltip:"Collapse/Expand",cls:"ui-button-icon-plain",onclick:function(){i[i.collapsed?"expand":"collapse"]()}}),this.render()},render:function(){var e=this,t=this.model.attributes;return this.$el.removeClass().addClass(t.cls).attr("id",t.id),this.$header[t.title?"show":"hide"](),this.$title_text.html(t.title),s.each([this.$content,this.$body],function(e){e[t.nopadding?"addClass":"removeClass"]("no-padding")}),t.icon?this.$title_icon.removeClass().addClass("portlet-title-icon fa").addClass(t.icon).show():this.$title_icon.hide(),this.$title_text[t.collapsible?"addClass":"removeClass"]("no-highlight collapsible").off(),t.collapsible&&(this.$title_text.on("click",function(){e[e.collapsed?"expand":"collapse"]()}),t.collapsed?this.collapse():this.expand()),this.$title_text.prop("disabled",!t.onchange_title),t.onchange_title&&this.$title_text.make_text_editable({on_finish:function(e){t.onchange_title(e)}}),t.buttons?(this.$buttons.empty().show(),n.each(this.model.get("buttons"),function(t,i){i.$el.prop("id",t),e.$buttons.append(i.$el)})):this.$buttons.hide(),this.$operations.empty,t.collapsible_button&&this.$operations.append(this.collapsible_button.$el),t.operations&&n.each(t.operations,function(t,i){i.$el.prop("id",t),e.$operations.append(i.$el)}),this},append:function(e){this.$body.append(e)},empty:function(){this.$body.empty()},header:function(){return this.$header},body:function(){return this.$body},show:function(){this.visible=!0,this.$el.fadeIn("fast")},hide:function(){this.visible=!1,this.$el.hide()},enableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!1)},disableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!0)},hideOperation:function(e){this.$operations.find("#"+e).hide()},showOperation:function(e){this.$operations.find("#"+e).show()},setOperation:function(e,t){this.$operations.find("#"+e).off("click").on("click",t)},title:function(e){return e&&this.$title_text.html(e),this.$title_text.html()},collapse:function(){this.collapsed=!0,this.$content.height("0%"),this.$body.hide(),this.collapsible_button.setIcon("fa-eye-slash")},expand:function(){this.collapsed=!1,this.$content.height("100%"),this.$body.fadeIn("fast"),this.collapsible_button.setIcon("fa-eye")},disable:function(){this.$backdrop.show()},enable:function(){this.$backdrop.hide()},_template:function(){return n("
").append(n("
").addClass("portlet-header").append(n("
").addClass("portlet-operations")).append(n("
").addClass("portlet-title").append(n("").addClass("portlet-title-icon")).append(n("").addClass("portlet-title-text")))).append(n("
").addClass("portlet-content").append(n("
").addClass("portlet-body")).append(n("
").addClass("portlet-buttons"))).append(n("
").addClass("portlet-backdrop"))}});t.default={View:c}}).call(t,i(1),i(2),i(0))},12:function(e,t,i){"use strict";(function(e,s){Object.defineProperty(t,"__esModule",{value:!0});var n=i(3),a=function(e){return e&&e.__esModule?e:{default:e}}(n),o=e.View.extend({initialize:function(t){this.model=t&&t.model||new e.Model({id:a.default.uid(),title:"",icon:"",cls:"btn btn-default",wait:!1,wait_text:"Sending...",wait_cls:"btn btn-info",disabled:!1,percentage:-1}).set(t),this.setElement(s("','/permissions">','','','','" class="fa fa-ban fa-lg">','',"",""].join(""))}});t.default={LibraryRowView:s}}).call(t,n(2),n(0),n(1))},302:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=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=i.defaults(this.options||{},e,this.defaults),this.render()},render:function(){var e=this.templateToolBar(),t=!1,n=!0;Galaxy.user&&(t=Galaxy.user.isAdmin(),n=Galaxy.user.isAnonymous()),this.$el.html(e({admin_user:t,anon_user:n})),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=i.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 c.default.Library,n=this;t.save(e,{success:function(e){Galaxy.libraries.libraryListView.collection.add(e),n.modal.hide(),n.clearLibraryModal(),Galaxy.libraries.libraryListView.render(),s.default.success("Library created.")},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg):s.default.error("An error occured.")}})}else s.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(){r("input[name='Name']").val(""),r("input[name='Description']").val(""),r("input[name='Synopsis']").val("")},serializeNewLibrary:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val(),synopsis:r("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=r(".library-search-input").val();this.options.search_term=t,Galaxy.libraries.libraryListView.searchLibraries(t)},templateToolBar:function(){return i.template(['
','
','
','
','DATA LIBRARIES','',"",'
','',"
","<% if(admin_user === true) { %>",'
',"","","
",'','',"","<% } %>",'','','',"","","
","
","
",'
',"
","
"].join(""))},templatePaginator:function(){return i.template(['","",' <%- libraries_shown %> libraries shown (change)',"",""," <%- total_libraries_count %> total",""].join(""))},templateNewLibraryInModal:function(){return i.template(['
',"
",'','','',"
","
"].join(""))}});t.default={LibraryToolbarView:d}}).call(t,n(2),n(1),n(0))},303:function(e,t,n){"use strict";(function(e,i,r,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),l=o(s),c=n(7),d=o(c),u=n(13),h=o(u),f=n(10),p=o(f);n(127);var _=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=i.defaults(e||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(e){this.options=i.extend(this.options,e);var t=this.templateToolBar(),n={id:this.options.id,is_admin:!1,is_anonym:!0,mutiple_add_dataset_options:!1};Galaxy.user&&(n.is_admin=Galaxy.user.isAdmin(),n.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||(n.mutiple_add_dataset_options=!0)),this.$el.html(t(n))},renderPaginator:function(e){this.options=i.extend(this.options,e);var t=this.templatePaginator();r("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=i.extend(this.options,e),!0===this.options.can_add_library_item?r(".add-library-items").show():r(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?(r(".dataset-manipulation").show(),r(".logged-dataset-manipulation").hide()):(r(".logged-dataset-manipulation").show(),r(".dataset-manipulation").show()):(r(".logged-dataset-manipulation").hide(),r(".dataset-manipulation").hide()),this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this,n=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Folder",body:n(),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 n,i=new h.default.FolderAsModel,r=e.history.fragment.split("/");n=r.indexOf("page")>-1?r[r.length-3]:r[r.length-1],i.url=i.urlRoot+n,i.save(t,{success:function(e){Galaxy.modal.hide(),d.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?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")}})}else d.default.error("Folder's name is missing.");return!1},serialize_new_folder:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val()}},validate_new_folder:function(e){return""!==e.name},modalBulkImport:function(){if(0===this.findCheckedRows().length)d.default.info("You must select some datasets first.");else{var e=this;this.histories=new h.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?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")})}},importAllIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)r.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,n){d.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var n=r("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=n;var i=r("select[name=dataset_import_bulk] option:selected").text();this.processImportToHistory(n,i),this.modal.enableButton("Import")}},processImportToHistory:function(e,t){var n=[],i=[];this.findCheckedRows().each(function(){var e=r(this).closest("tr").data("id");"F"==e.substring(0,1)?i.push(e):n.push(e)});for(var o=[],s=n.length-1;s>=0;s--){var l=n[s],c=new h.default.HistoryItem;c.url=c.urlRoot+e+"/contents",c.content=l,c.source="library",o.push(c)}for(var s=i.length-1;s>=0;s--){var d=i[s],c=new h.default.HistoryItem;c.url=c.urlRoot+e+"/contents",c.content=d,c.source="library_folder",o.push(c)}this.initChainCallControl({length:o.length,action:"to_history",history_name:t}),a.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(o,t)},updateProgress:function(){this.progress+=this.progressStep,r(".progress-bar-import").width(Math.round(this.progress)+"%");var e=Math.round(this.progress)+"% Complete";r(".completion_span").text(e)},download:function(e,t){var n=[],i=[];this.findCheckedRows().each(function(){var e=r(this).closest("tr").data("id");"F"==e.substring(0,1)?i.push(e):n.push(e)});var a=Galaxy.root+"api/libraries/datasets/download/"+t,o={ld_ids:n,folder_ids:i};this.processDownload(a,o,"get")},processDownload:function(e,t,n){if(e&&t){t="string"==typeof t?t:r.param(t);var i="";r.each(t.split("&"),function(){var e=this.split("=");i+=''}),r('
'+i+"
").appendTo("body").submit().remove(),d.default.info("Your download will begin soon.")}else d.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new h.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),r("#dataset_add_bulk").change(function(t){e.fetchAndDisplayHistoryContents(t.target.value)})}).fail(function(e,t){void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.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 n in t)e.list_extensions.push({id:t[n].extension,text:t[n].extension,description:t[n].description,description_url:t[n].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id=0;u--){var h=l[u].trim();0!==h.length&&c.push(h)}this.initChainCallControl({length:c.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:c,preserve_dirs:e,link_data:t,space_to_tab:n,to_posix_lines:i,source:"admin_path",file_type:o,tag_using_filenames:a,dbkey:s})}else d.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 n=r("#jstree_browser").jstree().get_selected(!0),a=i.filter(n,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"),c=this.modal.$el.find(".posix-checkbox").is(":checked"),u=this.select_extension.value(),h=this.select_genome.value(),f=this.modal.$el.find(".tag-files").is(":checked"),p=a[0].type,_=[];if(a.length<1)d.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var g=a.length-1;g>=0;g--)void 0!==a[g].li_attr.full_path&&_.push(a[g].li_attr.full_path);if(this.initChainCallControl({length:_.length,action:"adding_datasets"}),"folder"===p){var m=t.source+"_folder";this.chainCallImportingFolders({paths:_,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,file_type:u,dbkey:h,tag_using_filenames:f})}else if("file"===p){var m=t.source+"_file";this.chainCallImportingUserdirFiles({paths:_,file_type:u,dbkey:h,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,tag_using_filenames:f})}}},fetchAndDisplayHistoryContents:function(e){var t=new h.default.HistoryContents({id:e}),n=this;t.fetch({success:function(t){var i=n.templateHistoryContents();n.histories.get(e).set({contents:t}),n.modal.$el.find("#selected_history_content").html(i({history_contents:t.models.reverse()})),n.modal.$el.find(".history-import-select-all").bind("click",function(){r("#selected_history_content [type=checkbox]").prop("checked",!0)}),n.modal.$el.find(".history-import-unselect-all").bind("click",function(){r("#selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find("#selected_history_content").find(":checked"),t=[],n=[],i=[];if(e.length<1)d.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),e.each(function(){var e=r(this).closest("li").data("id");if(e){var i=r(this).closest("li").data("name");t.push(e),n.push(i)}});for(var a=t.length-1;a>=0;a--){var o=t[a],s=new h.default.Item;s.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===n[a]?s.set({from_hdca_id:o}):s.set({from_hda_id:o}),i.push(s)}this.initChainCallControl({length:i.length,action:"adding_datasets"}),this.chainCallAddingHdas(i)}},chainCallImportingIntoHistory:function(e,t){var n=this,i=e.pop();if(void 0===i)return 0===this.options.chain_call_control.failed_number?d.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?d.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;s--){var l=new h.default.Item({id:e[s]});o.push(l)}for(var s=t.length-1;s>=0;s--){var c=new h.default.FolderAsModel({id:t[s]});o.push(c)}this.options.chain_call_control.total_number=a,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 h.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")}}))},showLocInfoModal:function(e){var t=this,n=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Location Details",body:n({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(),d.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 r("#folder_list_body").find(":checked")},templateToolBar:function(){return i.template(['
','
','
',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'','",'','','","","","
","",'
',"
",'
',"
"].join(""))},templateLocInfoInModal:function(){return i.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 i.template(['
',"
",'','',"
","
"].join(""))},templateBulkImportInModal:function(){return i.template(["
",'
',"Select history: ",'","
",'
',"or create new: ",'',"","
","
"].join(""))},templateImportIntoHistoryProgressBar:function(){return i.template(['
',"Importing selected items to history <%= _.escape(history_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateAddingDatasetsProgressBar:function(){return i.template(['
',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
",'
','
','0% Complete',"
","
"].join(""))},templateDeletingItemsProgressBar:function(){return i.template(['
',"
",'
','
','0% Complete',"
","
"].join(""))},templateBrowserModal:function(){return i.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 i.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 i.template(['
',"
","1. Select history: ",'","
","
",'
',"
","
"].join(""))},templateHistoryContents:function(){return i.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 i.template(['","",' <%- items_shown %> items shown (change)',"",""," <%- total_items_count %> total",""].join(""))}});t.default={FolderToolbarView:_}}).call(t,n(2),n(1),n(0),n(0))},304:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=n(10),u=a(d),h=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=i.extend(this.options,e),this.options.id&&this.fetchLibrary()},fetchLibrary:function(e){this.options=i.extend(this.options,e),this.model=new c.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?s.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=i.extend(this.options,e),r(".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 n=this.templateLibraryPermissions();this.$el.html(n({library:this.model,is_admin:t}));var a=this;r.get(Galaxy.root+"api/libraries/"+a.id+"/permissions?scope=current").done(function(e){a.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){s.default.error("An error occurred while attempting to fetch library permissions.")}),r("#center [data-toggle]").tooltip(),r("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],n=0;n=0;n--)t.push(e[n].id);return t},savePermissions:function(e){var t=this,n=this._extractIds(this.accessSelectObject.$el.select2("data")),i=this._extractIds(this.addSelectObject.$el.select2("data")),a=this._extractIds(this.manageSelectObject.$el.select2("data")),o=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/libraries/"+t.id+"/permissions?action=set_permissions",{"access_ids[]":n,"add_ids[]":i,"manage_ids[]":a,"modify_ids[]":o}).done(function(e){t.showPermissions({fetched_permissions:e}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set library permissions.")})},templateLibraryPermissions:function(){return i.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:h}}).call(t,n(2),n(1),n(0))},305:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=n(10),u=a(d),h=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=i.extend(this.options,e),this.options.id&&this.fetchFolder()},fetchFolder:function(e){this.options=i.extend(this.options,e),this.model=new c.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?s.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=i.extend(this.options,e),r(".tooltip").remove();var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var n=this.templateFolderPermissions();this.$el.html(n({folder:this.model,is_admin:t}));var a=this;r.get(Galaxy.root+"api/folders/"+a.id+"/permissions?scope=current").done(function(e){a.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){s.default.error("An error occurred while attempting to fetch folder permissions.")}),r("#center [data-toggle]").tooltip(),r("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],n=0;n=0;n--)t.push(e[n].id);return t},savePermissions:function(e){var t=this,n=this._extractIds(this.addSelectObject.$el.select2("data")),i=this._extractIds(this.manageSelectObject.$el.select2("data")),a=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/folders/"+t.id+"/permissions?action=set_permissions",{"add_ids[]":n,"manage_ids[]":i,"modify_ids[]":a}).done(function(e){t.showPermissions({fetched_permissions:e}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set folder permissions.")})},templateFolderPermissions:function(){return i.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:h}}).call(t,n(2),n(1),n(0))},306:function(e,t,n){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(307),a=i(r),o=n(308),s=i(o),l=n(309),c=i(l),d=n(310),u=i(d),h=n(311),f=i(h),p=n(312),_=i(p),g=n(313),m=i(g),v=e.Router.extend({initialize:function(){this.routesHit=0,e.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"toolsheds",sheds:"toolsheds",queue:"queue",workflows:"workflows","status/r/:repositories":"status",status:"status","categories/s/:tool_shed":"categories","category/s/:tool_shed/c/:cateory_id":"repositories","repository/s/:tool_shed/r/:repository_id":"repository"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})}}),y=e.View.extend({app_config:{known_views:["toolsheds","queue","status","categories","repositories","repoository"]},initialize:function(){Galaxy.admintoolshedapp=this,this.admin_toolshed_router=new v,this.admin_toolshed_router.on("route:queue",function(){Galaxy.admintoolshedapp.adminRepoQueueView?Galaxy.admintoolshedapp.adminRepoQueueView.reDraw():Galaxy.admintoolshedapp.adminRepoQueueView=new f.default.RepoQueueView}),this.admin_toolshed_router.on("route:toolsheds",function(){Galaxy.admintoolshedapp.adminShedListView?Galaxy.admintoolshedapp.adminShedListView.reDraw():Galaxy.admintoolshedapp.adminShedListView=new a.default.ShedListView}),this.admin_toolshed_router.on("route:categories",function(e){Galaxy.admintoolshedapp.adminShedCategoriesView?Galaxy.admintoolshedapp.adminShedCategoriesView.reDraw({tool_shed:e.replace(/\//g,"%2f")}):Galaxy.admintoolshedapp.adminShedCategoriesView=new s.default.CategoryView({tool_shed:e.replace(/\//g,"%2f")})}),this.admin_toolshed_router.on("route:repositories",function(e,t){Galaxy.admintoolshedapp.adminShedCategoryView?Galaxy.admintoolshedapp.adminShedCategoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),category_id:t}):Galaxy.admintoolshedapp.adminShedCategoryView=new c.default.Category({tool_shed:e.replace(/\//g,"%2f"),category_id:t})}),this.admin_toolshed_router.on("route:repository",function(e,t){Galaxy.admintoolshedapp.adminRepositoryView?Galaxy.admintoolshedapp.adminRepositoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),repository_id:t}):Galaxy.admintoolshedapp.adminRepositoryView=new u.default.RepoDetails({tool_shed:e.replace(/\//g,"%2f"),repository_id:t})}),this.admin_toolshed_router.on("route:status",function(e){Galaxy.admintoolshedapp.adminRepoStatusView?Galaxy.admintoolshedapp.adminRepoStatusView.reDraw({repositories:e.split("|")}):Galaxy.admintoolshedapp.adminRepoStatusView=new _.default.RepoStatus({repositories:e.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new m.default.Workflows}),e.history.start({pushState:!1})}});t.default={GalaxyApp:y}}).call(t,n(2))},307:function(e,t,n){"use strict";(function(e,i){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),o=r(a),s=n(18),l=r(s),c=e.View.extend({defaults:{tool_sheds:[{url:"https://toolshed.g2.bx.psu.edu/",name:"Galaxy Main Tool Shed"}]},initialize:function(e){this.options=i.defaults(this.options||{},this.defaults),this.model=new o.default.ShedsCollection,this.listenTo(this.model,"sync",this.render),this.model.fetch()},el:"#center",render:function(e){this.options=i.defaults(this.options||{},e,this.defaults);var t=this.templateToolshedList;this.$el.html(t({title:"Configured Galaxy Tool Sheds",tool_sheds:this.model.models,queue:l.default.queueLength()}))},reDraw:function(e){this.$el.empty(),this.render(e)},templateToolshedList:i.template(['
','
<%= title %>
','',"
",'
','
','',"<% _.each(tool_sheds, function(shed) { %>",'',"","","<% }); %>","
",'","
","
",'
',"
"].join(""))});t.default={ShedListView:c}}).call(t,n(2),n(1))},308:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l);n(30);var d=e.View.extend({el:"#center",defaults:{tool_shed:"https://toolshed.g2.bx.psu.edu/"},initialize:function(e){var t=e.tool_shed.replace(/\//g,"%2f");this.options=i.defaults(this.options||e,this.defaults),this.model=new s.default.Categories,this.listenTo(this.model,"sync",this.render),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.model.tool_shed=t,this.model.fetch()},render:function(e){this.options=i.extend(this.options,e),this.options.categories=this.model.models,this.options.queue=c.default.queueLength();var t=this.templateCategoryList;this.$el.html(t(this.options)),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;r("#search_box").autocomplete({source:function(e,n){var i=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:i};r.post(a,o,function(e){console.log(e);var t=c.default.shedParser(e);n(t)})},minLength:3,select:function(n,i){var r=i.item.value,a=(Galaxy.root,t.model.tool_shed,"repository/s/"+t.model.tool_shed+"/r/"+r);e.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(e){this.$el.empty(),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.initialize(e)},templateCategoryList:i.template(['",'
','
Categories in <%= tool_shed.replace(/%2f/g, "/") %>
','',"
",'
','",'
','','',"","","","","","","<% _.each(categories, function(category) { %>","","",'','',"","<% }); %>","
NameDescriptionRepositories
",'"><%= category.get("name") %>',"<%= category.get("description") %><%= category.get("repositories") %>
","
","
"].join(""))});t.default={CategoryView:d}}).call(t,n(2),n(1),n(0))},309:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l);n(30);var d=e.View.extend({el:"#center",initialize:function(e){this.model=new s.default.CategoryCollection,this.listenTo(this.model,"sync",this.render);var t=e.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+t+"&category_id="+e.category_id,this.model.tool_shed=t,this.model.category=e.category_id,this.model.fetch()},render:function(e){this.options=i.extend(this.options,e);var t=this.templateCategoryContents;this.$el.html(t({category:this.model.models[0],tool_shed:this.model.tool_shed,queue:c.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;r("#search_box").autocomplete({source:function(e,n){var i=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:i};r.post(a,o,function(e){var t=c.default.shedParser(e);n(t)})},minLength:3,select:function(n,i){var r=i.item.value,a="repository/s/"+t.model.tool_shed+"/r/"+r;e.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateCategoryContents:i.template(['",'
','
Repositories in <%= category.get("name") %>
','',"
",'
','",'
','','',"",'','',"",'',"","",'<% _.each(category.get("repositories"), function(repository) { %>',"","","","","","","<% }); %>","
OwnerNameSynopsisType
<%= repository.owner %>",'","<%= repository.description %><%= repository.type %>
","
","
"].join(""))});t.default={Category:d}}).call(t,n(2),n(1),n(0))},310:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(127),c=(a(l),n(3)),d=a(c),u=n(8),h=a(u),f=n(11),p=a(f),_=n(18),g=a(_),m=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||{},this.defaults),this.model=new s.default.RepositoryCollection,this.listenTo(this.model,"sync",this.render);var t=e.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+t+"&repository_id="+e.repository_id,this.model.tool_shed_url=e.tool_shed.replace(/%2f/g,"/"),this.model.tool_shed=t,this.model.category=e.repository_id,this.model.fetch()},render:function(e){var t=this.templateRepoDetails,n=this.model.models[0];this.options={repository:n.get("repository"),tool_shed:this.model.tool_shed,queue:g.default.queueLength()};var a=Object.keys(this.options.repository.metadata);this.options.current_changeset=this.options.current_changeset||a[a.length-1],this.options.current_metadata=this.options.repository.metadata[this.options.current_changeset],this.options.current_metadata.tool_shed_url=this.model.tool_shed_url,this.options.tools=this.options.current_metadata.tools,this.options.repository_dependencies_template=this.templateRepoDependencies,this.options.repository_dependency_template=this.templateRepoDependency,this.options.tps_template_global_select=this.templateGlobalSectionSelect,this.options.tps_template_tool_select=this.templateToolSectionSelect,this.options.tps_select_options=this.templatePanelSelectOptions,this.options.tool_dependencies=n.get("tool_dependencies"),this.options.shed_tool_conf=this.templateShedToolConf({shed_tool_confs:n.get("shed_conf")}),console.log(n.get("shed_conf")),this.options.panel_section_dict=n.get("panel_section_dict"),this.options.api_url=Galaxy.root+"api/tool_shed_repositories/install?async=True",this.options=i.extend(this.options,e),this.$el.html(t(this.options)),this.checkInstalled(this.options.current_metadata),this.bindEvents(),r("#center").css("overflow","auto")},bindEvents:function(){var e=this;r("#changeset").on("change",function(){e.options.current_changeset=r("#changeset").find("option:selected").text(),e.options.current_metadata=e.options.repository.metadata[e.options.current_changeset],e.checkInstalled(e.options.current_metadata),e.reDraw()}),r("#tool_panel_section_select").on("change",function(){e.tpsSelection()}),r("#install_repository").on("click",function(t){r("#repository_installation");t.preventDefault();var n={};n.repositories=JSON.stringify([[r("#install_repository").attr("data-tsrid"),r("#changeset").find("option:selected").val()]]),n.tool_shed_repository_ids=JSON.stringify([r("#install_repository").attr("data-tsrid")]),n.tool_shed_url=e.model.tool_shed_url,n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val();e.panelSelect(n);n.tool_panel_section=JSON.stringify(e.panelSelect(n)),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.changeset=r("#changeset").find("option:selected").val();var i=r("#repository_installation").attr("action");e.prepareInstall(n,i)}),r("#queue_install").on("click",function(t){e.options.current_changeset=r("#changeset").find("option:selected").text(),e.options.current_metadata=e.options.repository.metadata[e.options.current_changeset];var n=(e.options.current_changeset,{});i.each(Object.keys(e.options.current_metadata),function(t){n[t]||(n[t]=e.options.current_metadata[t])}),n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val(),n.tool_panel_section=JSON.stringify(e.panelSelect({})),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.tool_shed_url=e.model.tool_shed_url,"/"==n.tool_shed_url.substr(-1)&&(n.tool_shed_url=n.tool_shed_url.substr(0,n.tool_shed_url.length-1)),g.default.addToQueue(n),e.checkInstalled(n)}),r(".tool_panel_section_picker").on("change",function(){r(this).find("option:selected").val()==r("#tool_panel_section_select").find("option:selected").val()?r(this).attr("default","active"):r(this).removeAttr("default")}),r(function(){r("#repository_dependencies").jstree()}),r(".tool_form").on("click",function(){var t=r(this).attr("data-guid"),n=(r(this).attr("data-clean"),r(this).attr("data-name")),i=r(this).attr("data-desc"),a=e.model.tool_shed_url,o=r("#repository_details").attr("data-tsrid"),s=r("#changeset").find("option:selected").val(),l=Galaxy.root+"api/tool_shed/tool_json",c={guid:t,tool_shed_url:a,tsr_id:o,changeset:s};r.get(l,c,function(e){e.cls="ui-portlet-plain";var t=new p.default(e);d.default.deepeach(e.inputs,function(e){e.type&&-1!=["data","data_collection"].indexOf(e.type)&&(e.type="hidden",e.info="Data input '"+e.name+"' ("+d.default.textify(e.extensions)+")")});var r=new h.default.View,a=""+n+" "+i;r.show({closing_events:!0,title:a,body:t.$el,buttons:{Close:function(){r.hide()}}})})})},checkInstalled:function(e){var t=this,n={name:e.name,owner:e.owner},i=!1;t.repoQueued(e);r.get(Galaxy.root+"api/tool_shed_repositories",n,function(n){for(var a=0;a','
Repository information for <%= repository.name %> from <%= repository.owner %>
','',"
",'
','
','','','
','
Changeset
','
','",'','','
Please select a revision and review the settings below before installing.
',"
","
","<%= shed_tool_conf %>","<% if (current_metadata.has_repository_dependencies) { %>",'
Repository dependencies for <%= current_changeset %>
','
','

','','',"

","<% current_metadata.repository_dependency_template = repository_dependency_template; %>",'
','","<%= repository_dependencies_template(current_metadata) %>","
","
","<% } %>","<% if (current_metadata.includes_tool_dependencies) { %>",'
Tool dependencies
','
','

','','',"

",'

','','',"

",'
','",'',"",'','',"","","","",'',"<% _.each(tool_dependencies[current_changeset], function(dependency) { %>",'','","","","","<% }); %>","","
NameVersionType
',"<%= dependency.name %><%= dependency.version %><%= dependency.type %>
","
","
","<% } %>","<% if (current_metadata.includes_tools_for_display_in_tool_panel) { %>",'
Tools – click the name to preview the tool and use the pop-up menu to inspect all metadata
','
','
','',"",'','',"","","","",'',"<% _.each(current_metadata.tools, function(tool) { %>",'','","",'','","","<% }); %>","","
NameDescriptionVersion<%= tps_template_global_select({tps: panel_section_dict, tps_select_options: tps_select_options}) %>
','","<%= tool.description %><%= tool.version %>',"<%= tps_template_tool_select({tool: tool, tps: panel_section_dict, tps_select_options: tps_select_options}) %>","
","
","
","<% } %>","
","
"].join("")),templateRepoDependencies:i.template(['
Repository Dependencies
','
',"
    ","
  • Repository installation requires the following","<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","<% } %>","
  • ","
","
"].join("")),templateRepoDependency:i.template(['
  • ',"Repository <%= repository.name %> revision <%= changeset_revision %> owned by <%= repository.owner %>","<% if (has_repository_dependencies) { %>",'
      ',"<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","
    ","<% } %>","
  • "].join("")),templateShedToolConf:i.template(['
    Shed tool configuration file:
    ','
    ','
    ','",'
    Select the file whose tool_path setting you want used for installing repositories.
    ',"
    ","
    "].join("")),templateToolDependency:i.template(["<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% if (dependency.includes_tool_dependencies) { %>","<% dependency.tool_dependency_template = tool_dependency_template %>","<%= tool_dependency_template(dependency) %>","<% } %>","<% }); %>","<% } %>"].join("")),templateGlobalSectionCreate:i.template(['
    ','
    ','','','
    ',"Add a new tool panel section to contain the installed tools (optional).","
    ","
    ","
    "].join("")),templateGlobalSectionSelect:i.template(['
    ','
    Tool Panel Section
    ','
    ','
    ','",'','
    ',"Select an existing tool panel section to contain the installed tools (optional).","
    ","
    ","
    ","
    "].join("")),templateToolSectionCreate:i.template(['
    ','','',"
    "].join("")),templateToolSectionSelect:i.template(['
    ','",'','
    ',"
    "].join("")),templatePanelSelectOptions:i.template(["<% _.each(sections, function(section) { %>",'',"<% }); %>"].join(""))});t.default={RepoDetails:m}}).call(t,n(2),n(1),n(0))},311:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l),d=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new s.default.RepoQueue,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,n=t.templateRepoQueue,r=t.model.models;t.$el.html(n({title:"Repository Installation Queue",repositories:r,queue:c.default.queueLength()})),i("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t=this;i(".install_one").on("click",function(){var e=t.loadFromQueue(i(this).attr("data-repokey"));t.installFromQueue(e,i(this).attr("data-repokey"))}),i(".remove_one").on("click",function(){var e=i(this).attr("data-repokey"),t=JSON.parse(localStorage.repositories);if(t.hasOwnProperty(e)){var n=t[e].repository.id;delete t[e],i("#queued_repository_"+n).remove()}localStorage.repositories=JSON.stringify(t)}),i("#clear_queue").on("click",function(){localStorage.repositories="{}"}),i("#from_workflow").on("click",function(){e.history.navigate("workflows",{trigger:!0,replace:!0})})},installFromQueue:function(t,n){var r=Object();r.install_tool_dependencies=t.install_tool_dependencies,r.install_repository_dependencies=t.install_repository_dependencies,r.install_resolver_dependencies=t.install_resolver_dependencies,r.tool_panel_section=t.tool_panel_section,r.shed_tool_conf=t.shed_tool_conf,r.repositories=JSON.stringify([[t.repository.id,t.changeset_revision]]),r.tool_shed_repository_ids=JSON.stringify([t.repository.id]),r.tool_shed_url=n.split("|")[0],r.changeset=t.changeset_revision;var a=Galaxy.root+"api/tool_shed_repositories/install?async=True";if(i("#queued_repository_"+t.repository.id).remove(),localStorage.repositories){void 0===n&&(n=c.default.queueKey(t));var o=JSON.parse(localStorage.repositories);o.hasOwnProperty(n)&&(delete o[n],localStorage.repositories=JSON.stringify(o))}i.post(a,r,function(t){var n=JSON.parse(t),r=n.repositories,a="status/r/"+r.join("|");i.post(Galaxy.root+"admin_toolshed/install_repositories",n,function(e){console.log("Initializing repository installation succeeded")}),e.history.navigate(a,{trigger:!0,replace:!0})})},loadFromQueue:function(e){var t=JSON.parse(localStorage.repositories);if(t.hasOwnProperty(e))return t[e]},reDraw:function(e){this.$el.empty(),this.initialize(e),this.model.fetch(),this.render(e)},templateRepoQueue:r.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','','',"",'','','','','','',"","","","<% _.each(repositories, function(repository) { %>",'">','','','','','",'","","<% }); %>","","
    NameOwnerRevisionToolShedInstall
    <%= repository.get("repository").name %><%= repository.get("repository").owner %><%= repository.get("changeset_revision") %><%= repository.get("tool_shed_url") %>','" type="submit" id="install_repository_<%= repository.get("id") %>" name="install_repository" value="Install now" />',"','" type="submit" id="unqueue_repository_<%= repository.get("id") %>" name="unqueue_repository" value="Remove from queue" />',"
    ",'',"
    "].join(""))});t.default={RepoQueueView:d}}).call(t,n(2),n(0),n(1))},312:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l),d=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||[{}],e,this.defaults),this.model=new s.default.RepoStatus,this.listenTo(this.model,"sync",this.render),this.model.url+="?repositories="+this.options.repositories.join("|"),this.model.fetch(),this.timer=setInterval(function(e){var t=["installed","error"],n=!0;i.some(e.model.models,function(e){repo_id=e.get("id");var i=e.get("status").toLowerCase();if(-1===t.indexOf(i))return n=!1,!0}),n?clearInterval(e.timer):e.model.fetch()},2e3,this)},close:function(){clearInterval(this.timer)},render:function(e){this.options=i.extend(this.options,e);var t=this.templateRepoStatus;this.$el.html(t({title:"Repository Status",repositories:this.model.models,queue:c.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateRepoStatus:i.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','',"","",'',"<% _.each(repositories, function(repository) { %>","","","","","","","","<% }); %>","",'',"
    NameDescriptionOwnerRevisionInstallation Status
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    "].join(""))});t.default={RepoStatus:d}}).call(t,n(2),n(1),n(0))},313:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l),d=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new s.default.WorkflowTools,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,n=t.templateWorkflows,r=t.model.models;t.$el.html(n({title:"Workflows Missing Tools",workflows:r,queue:c.default.queueLength()})),i("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t,n=this;i(".show_wf_repo").on("click",function(){var n=i(this).attr("data-toolids"),r=i(this).attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){t=n.repository.id;var i="repository/s/"+r.replace(/:/g,"%3a").replace(/\//g,"%2f")+"/r/"+n.repository.id;e.history.navigate(i,{trigger:!0,replace:!0})})}),i(".queue_wf_repo").on("click",function(){var e=i(this),n=e.attr("data-toolids"),r=e.attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){t=n.repository.id,o={tool_shed_url:r,repository_id:t},i.get(a,o,function(t){var n=Object.keys(t.repository.metadata),i=n[0],a=t.repository.metadata[i];a.tool_shed_url=r,c.default.addToQueue(a),e.remove()})})}),i("#from_workflow").on("click",n.loadWorkflows)},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateWorkflows:r.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','','',"","","","<% _.each(workflows, function(workflow) { %>","",'",'",'','','','","","<% }); %>","",""].join(""))});t.default={Workflows:d}}).call(t,n(2),n(0),n(1))},61:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={tool:"fa-wrench",data_input:"fa-file-o",data_collection_input:"fa-folder-o",subworkflow:"fa-sitemap fa-rotate-270",pause:"fa-pause"}}},[284]); \ No newline at end of file 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.',"
    ","<% } %>",'
    ','
    WorkflowsTool IDsShedNameOwnerActions
    ','
      ','<% _.each(workflow.get("workflows"), function(name) { %>','
    • <%= name %>
    • ',"<% }); %>","
    ","
    ','
      ','<% _.each(workflow.get("tools"), function(tool) { %>','
    • <%= tool %>
    • ',"<% }); %>","
    ","
    <%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %>','
      ','
    • ','" data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
    • ',"
    ","
    ',"",'','',"",'<% 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/bundled/libs.bundled.js b/static/scripts/bundled/libs.bundled.js index 076bf821a63..7789ad4befc 100644 --- a/static/scripts/bundled/libs.bundled.js +++ b/static/scripts/bundled/libs.bundled.js @@ -1,4 +1,4 @@ -!function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n=window.webpackJsonp;window.webpackJsonp=function(i,o,s){for(var a,l,u,c=0,h=[];c0&&e-1 in t)}function a(t,e,n){if(lt.isFunction(e))return lt.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return lt.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(yt.test(e))return lt.filter(e,t,n);e=lt.filter(e,t)}return lt.grep(t,function(t){return it.call(e,t)>-1!==n})}function l(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function u(t){var e={};return lt.each(t.match(Ct)||[],function(t,n){e[n]=!0}),e}function c(){Z.removeEventListener("DOMContentLoaded",c),n.removeEventListener("load",c),lt.ready()}function h(){this.expando=lt.expando+h.uid++}function d(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(jt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Ot.test(n)?lt.parseJSON(n):n)}catch(t){}Et.set(t,e,n)}else n=void 0;return n}function p(t,e,n,i){var r,o=1,s=20,a=i?function(){return i.cur()}:function(){return lt.css(t,e,"")},l=a(),u=n&&n[3]||(lt.cssNumber[e]?"":"px"),c=(lt.cssNumber[e]||"px"!==u&&+l)&&Mt.exec(lt.css(t,e));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do{o=o||".5",c/=o,lt.style(t,e,c+u)}while(o!==(o=a()/l)&&1!==o&&--s)}return n&&(c=+c||+l||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=c,i.end=r)),r}function f(t,e){var n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&<.nodeName(t,e)?lt.merge([t],n):n}function g(t,e){for(var n=0,i=t.length;n-1)r&&r.push(o);else if(u=lt.contains(o.ownerDocument,o),s=f(h.appendChild(o),"script"),u&&g(s),n)for(c=0;o=s[c++];)$t.test(o.type||"")&&n.push(o);return h}function m(){return!0}function y(){return!1}function b(){try{return Z.activeElement}catch(t){}}function w(t,e,n,i,r,o){var s,a;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=void 0);for(a in e)w(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=y;else if(!r)return t;return 1===o&&(s=r,r=function(t){return lt().off(t),s.apply(this,arguments)},r.guid=s.guid||(s.guid=lt.guid++)),t.each(function(){lt.event.add(this,e,r,i,n)})}function _(t,e){return lt.nodeName(t,"table")&<.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function x(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function C(t){var e=Vt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function k(t,e){var n,i,r,o,s,a,l,u;if(1===e.nodeType){if(At.hasData(t)&&(o=At.access(t),s=At.set(e,o),u=o.events)){delete s.handle,s.events={};for(r in u)for(n=0,i=u[r].length;n1&&"string"==typeof p&&!at.checkClone&&zt.test(p))return t.each(function(r){var o=t.eq(r);g&&(e[0]=p.call(this,r,o.html())),T(o,e,n,i)});if(h&&(r=v(e,t[0].ownerDocument,!1,t,i),o=r.firstChild,1===r.childNodes.length&&(r=o),o||i)){for(s=lt.map(f(r,"script"),x),a=s.length;c")).appendTo(e.documentElement),e=Gt[0].contentDocument,e.write(),e.close(),n=E(t,e),Gt.detach()),Yt[t]=n),n}function j(t,e,n){var i,r,o,s,a=t.style;return n=n||Qt(t),s=n?n.getPropertyValue(e)||n[e]:void 0,""!==s&&void 0!==s||lt.contains(t.ownerDocument,t)||(s=lt.style(t,e)),n&&!at.pixelMarginRight()&&Kt.test(s)&&Jt.test(e)&&(i=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=r,a.maxWidth=o),void 0!==s?s+"":s}function D(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function M(t){if(t in oe)return t;for(var e=t[0].toUpperCase()+t.slice(1),n=re.length;n--;)if((t=re[n]+e)in oe)return t}function P(t,e,n){var i=Mt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function N(t,e,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===e?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=lt.css(t,n+Pt[o],!0,r)),i?("content"===n&&(s-=lt.css(t,"padding"+Pt[o],!0,r)),"margin"!==n&&(s-=lt.css(t,"border"+Pt[o]+"Width",!0,r))):(s+=lt.css(t,"padding"+Pt[o],!0,r),"padding"!==n&&(s+=lt.css(t,"border"+Pt[o]+"Width",!0,r)));return s}function R(t,e,n){var i=!0,r="width"===e?t.offsetWidth:t.offsetHeight,o=Qt(t),s="border-box"===lt.css(t,"boxSizing",!1,o);if(r<=0||null==r){if(r=j(t,e,o),(r<0||null==r)&&(r=t.style[e]),Kt.test(r))return r;i=s&&(at.boxSizingReliable()||r===t.style[e]),r=parseFloat(r)||0}return r+N(t,e,n||(s?"border":"content"),i,o)+"px"}function I(t,e){for(var n,i,r,o=[],s=0,a=t.length;s=0&&n=0},isPlainObject:function(t){var e;if("object"!==lt.type(t)||t.nodeType||lt.isWindow(t))return!1;if(t.constructor&&!st.call(t,"constructor")&&!st.call(t.constructor.prototype||{},"isPrototypeOf"))return!1;for(e in t);return void 0===e||st.call(t,e)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?rt[ot.call(t)]||"object":typeof t},globalEval:function(t){var e,n=eval;(t=lt.trim(t))&&(1===t.indexOf("use strict")?(e=Z.createElement("script"),e.text=t,Z.head.appendChild(e).parentNode.removeChild(e)):n(t))},camelCase:function(t){return t.replace(ct,"ms-").replace(ht,dt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var n,i=0;if(s(t))for(n=t.length;i0&&e-1 in t)}function s(t,e,i){if(lt.isFunction(e))return lt.grep(t,function(t,n){return!!e.call(t,n,t)!==i});if(e.nodeType)return lt.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(_t.test(e))return lt.filter(e,t,i);e=lt.filter(e,t)}return lt.grep(t,function(t){return nt.call(e,t)>-1!==i})}function l(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function c(t){var e={};return lt.each(t.match(kt)||[],function(t,i){e[i]=!0}),e}function u(){Z.removeEventListener("DOMContentLoaded",u),i.removeEventListener("load",u),lt.ready()}function h(){this.expando=lt.expando+h.uid++}function d(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(Ot,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:Et.test(i)?lt.parseJSON(i):i)}catch(t){}Mt.set(t,e,i)}else i=void 0;return i}function f(t,e,i,n){var r,a=1,o=20,s=n?function(){return n.cur()}:function(){return lt.css(t,e,"")},l=s(),c=i&&i[3]||(lt.cssNumber[e]?"":"px"),u=(lt.cssNumber[e]||"px"!==c&&+l)&&jt.exec(lt.css(t,e));if(u&&u[3]!==c){c=c||u[3],i=i||[],u=+l||1;do{a=a||".5",u/=a,lt.style(t,e,u+c)}while(a!==(a=s()/l)&&1!==a&&--o)}return i&&(u=+u||+l||0,r=i[1]?u+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=u,n.end=r)),r}function p(t,e){var i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&<.nodeName(t,e)?lt.merge([t],i):i}function m(t,e){for(var i=0,n=t.length;i-1)r&&r.push(a);else if(c=lt.contains(a.ownerDocument,a),o=p(h.appendChild(a),"script"),c&&m(o),i)for(u=0;a=o[u++];)It.test(a.type||"")&&i.push(a);return h}function g(){return!0}function _(){return!1}function y(){try{return Z.activeElement}catch(t){}}function b(t,e,i,n,r,a){var o,s;if("object"==typeof e){"string"!=typeof i&&(n=n||i,i=void 0);for(s in e)b(t,s,i,n,e[s],a);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=_;else if(!r)return t;return 1===a&&(o=r,r=function(t){return lt().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=lt.guid++)),t.each(function(){lt.event.add(this,e,r,n,i)})}function w(t,e){return lt.nodeName(t,"table")&<.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function x(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function k(t){var e=Wt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function C(t,e){var i,n,r,a,o,s,l,c;if(1===e.nodeType){if(At.hasData(t)&&(a=At.access(t),o=At.set(e,a),c=a.events)){delete o.handle,o.events={};for(r in c)for(i=0,n=c[r].length;i1&&"string"==typeof f&&!st.checkClone&&Ut.test(f))return t.each(function(r){var a=t.eq(r);m&&(e[0]=f.call(this,r,a.html())),T(a,e,i,n)});if(h&&(r=v(e,t[0].ownerDocument,!1,t,n),a=r.firstChild,1===r.childNodes.length&&(r=a),a||n)){for(o=lt.map(p(r,"script"),x),s=o.length;u")).appendTo(e.documentElement),e=Xt[0].contentDocument,e.write(),e.close(),i=M(t,e),Xt.detach()),Yt[t]=i),i}function O(t,e,i){var n,r,a,o,s=t.style;return i=i||Qt(t),o=i?i.getPropertyValue(e)||i[e]:void 0,""!==o&&void 0!==o||lt.contains(t.ownerDocument,t)||(o=lt.style(t,e)),i&&!st.pixelMarginRight()&&Kt.test(o)&&Jt.test(e)&&(n=s.width,r=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=i.width,s.width=n,s.minWidth=r,s.maxWidth=a),void 0!==o?o+"":o}function $(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function j(t){if(t in ae)return t;for(var e=t[0].toUpperCase()+t.slice(1),i=re.length;i--;)if((t=re[i]+e)in ae)return t}function D(t,e,i){var n=jt.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function P(t,e,i,n,r){for(var a=i===(n?"border":"content")?4:"width"===e?1:0,o=0;a<4;a+=2)"margin"===i&&(o+=lt.css(t,i+Dt[a],!0,r)),n?("content"===i&&(o-=lt.css(t,"padding"+Dt[a],!0,r)),"margin"!==i&&(o-=lt.css(t,"border"+Dt[a]+"Width",!0,r))):(o+=lt.css(t,"padding"+Dt[a],!0,r),"padding"!==i&&(o+=lt.css(t,"border"+Dt[a]+"Width",!0,r)));return o}function R(t,e,i){var n=!0,r="width"===e?t.offsetWidth:t.offsetHeight,a=Qt(t),o="border-box"===lt.css(t,"boxSizing",!1,a);if(r<=0||null==r){if(r=O(t,e,a),(r<0||null==r)&&(r=t.style[e]),Kt.test(r))return r;n=o&&(st.boxSizingReliable()||r===t.style[e]),r=parseFloat(r)||0}return r+P(t,e,i||(o?"border":"content"),n,a)+"px"}function N(t,e){for(var i,n,r,a=[],o=0,s=t.length;o=0&&i=0},isPlainObject:function(t){var e;if("object"!==lt.type(t)||t.nodeType||lt.isWindow(t))return!1;if(t.constructor&&!ot.call(t,"constructor")&&!ot.call(t.constructor.prototype||{},"isPrototypeOf"))return!1;for(e in t);return void 0===e||ot.call(t,e)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?rt[at.call(t)]||"object":typeof t},globalEval:function(t){var e,i=eval;(t=lt.trim(t))&&(1===t.indexOf("use strict")?(e=Z.createElement("script"),e.text=t,Z.head.appendChild(e).parentNode.removeChild(e)):i(t))},camelCase:function(t){return t.replace(ut,"ms-").replace(ht,dt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var i,n=0;if(o(t))for(i=t.length;nw.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function i(t){return t[$]=!0,t}function r(t){var e=j.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var n=t.split("|"),i=n.length;i--;)w.attrHandle[n[i]]=e}function s(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||z)-(~t.sourceIndex||z);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function a(t){return i(function(e){return e=+e,i(function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function u(){}function c(t){for(var e=0,n=t.length,i="";e1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function p(t,n,i){for(var r=0,o=n.length;r-1&&(i[u]=!(s[u]=h))}}else b=f(b===s?b.splice(v,b.length):b),o?o(null,s,b,l):J.apply(s,b)})}function v(t){for(var e,n,i,r=t.length,o=w.relative[t[0].type],s=o||w.relative[" "],a=o?1:0,l=h(function(t){return t===e},s,!0),u=h(function(t){return Q(e,t)>-1},s,!0),p=[function(t,n,i){var r=!o&&(i||n!==T)||((e=n).nodeType?l(t,n,i):u(t,n,i));return e=null,r}];a1&&d(p),a>1&&c(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(ot,"$1"),n,a0,o=t.length>0,s=function(i,s,a,l,u){var c,h,d,p=0,g="0",v=i&&[],m=[],y=T,b=i||o&&w.find.TAG("*",u),_=H+=null==y?1:Math.random()||.1,x=b.length;for(u&&(T=s===j||s||u);g!==x&&null!=(c=b[g]);g++){if(o&&c){for(h=0,s||c.ownerDocument===j||(O(c),a=!M);d=t[h++];)if(d(c,s||j,a)){l.push(c);break}u&&(H=_)}r&&((c=!d&&c)&&p--,i&&v.push(c))}if(p+=g,r&&g!==p){for(h=0;d=n[h++];)d(v,m,s,a);if(i){if(p>0)for(;g--;)v[g]||m[g]||(m[g]=G.call(l));m=f(m)}J.apply(l,m),u&&!i&&m.length>0&&p+n.length>1&&e.uniqueSort(l)}return u&&(H=_,T=y),v};return r?i(s):s}var y,b,w,_,x,C,k,S,T,A,E,O,j,D,M,P,N,R,I,$="sizzle"+1*new Date,L=t.document,H=0,F=0,q=n(),W=n(),B=n(),U=function(t,e){return t===e&&(E=!0),0},z=1<<31,V={}.hasOwnProperty,X=[],G=X.pop,Y=X.push,J=X.push,K=X.slice,Q=function(t,e){for(var n=0,i=t.length;n+~]|"+tt+")"+tt+"*"),lt=new RegExp("="+tt+"*([^\\]'\"]*?)"+tt+"*\\]","g"),ut=new RegExp(it),ct=new RegExp("^"+et+"$"),ht={ID:new RegExp("^#("+et+")"),CLASS:new RegExp("^\\.("+et+")"),TAG:new RegExp("^("+et+"|[*])"),ATTR:new RegExp("^"+nt),PSEUDO:new RegExp("^"+it),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+tt+"*(even|odd|(([+-]|)(\\d*)n|)"+tt+"*(?:([+-]|)"+tt+"*(\\d+)|))"+tt+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+tt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+tt+"*((?:-\\d)?\\d*)"+tt+"*\\)|)(?=[^-]|$)","i")},dt=/^(?:input|select|textarea|button)$/i,pt=/^h\d$/i,ft=/^[^{]+\{\s*\[native \w/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,vt=/[+~]/,mt=/'|\\/g,yt=new RegExp("\\\\([\\da-f]{1,6}"+tt+"?|("+tt+")|.)","ig"),bt=function(t,e,n){var i="0x"+e-65536;return i!==i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},wt=function(){O()};try{J.apply(X=K.call(L.childNodes),L.childNodes),X[L.childNodes.length].nodeType}catch(t){J={apply:X.length?function(t,e){Y.apply(t,K.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}b=e.support={},x=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},O=e.setDocument=function(t){var e,n,i=t?t.ownerDocument||t:L;return i!==j&&9===i.nodeType&&i.documentElement?(j=i,D=j.documentElement,M=!x(j),(n=j.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",wt,!1):n.attachEvent&&n.attachEvent("onunload",wt)),b.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),b.getElementsByTagName=r(function(t){return t.appendChild(j.createComment("")),!t.getElementsByTagName("*").length}),b.getElementsByClassName=ft.test(j.getElementsByClassName),b.getById=r(function(t){return D.appendChild(t).id=$,!j.getElementsByName||!j.getElementsByName($).length}),b.getById?(w.find.ID=function(t,e){if(void 0!==e.getElementById&&M){var n=e.getElementById(t);return n?[n]:[]}},w.filter.ID=function(t){var e=t.replace(yt,bt);return function(t){return t.getAttribute("id")===e}}):(delete w.find.ID,w.filter.ID=function(t){var e=t.replace(yt,bt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),w.find.TAG=b.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):b.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},w.find.CLASS=b.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&M)return e.getElementsByClassName(t)},N=[],P=[],(b.qsa=ft.test(j.querySelectorAll))&&(r(function(t){D.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+tt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||P.push("\\["+tt+"*(?:value|"+Z+")"),t.querySelectorAll("[id~="+$+"-]").length||P.push("~="),t.querySelectorAll(":checked").length||P.push(":checked"),t.querySelectorAll("a#"+$+"+*").length||P.push(".#.+[+~]")}),r(function(t){var e=j.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&P.push("name"+tt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),P.push(",.*:")})),(b.matchesSelector=ft.test(R=D.matches||D.webkitMatchesSelector||D.mozMatchesSelector||D.oMatchesSelector||D.msMatchesSelector))&&r(function(t){b.disconnectedMatch=R.call(t,"div"),R.call(t,"[s!='']:x"),N.push("!=",it)}),P=P.length&&new RegExp(P.join("|")),N=N.length&&new RegExp(N.join("|")),e=ft.test(D.compareDocumentPosition),I=e||ft.test(D.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},U=e?function(t,e){if(t===e)return E=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!b.sortDetached&&e.compareDocumentPosition(t)===n?t===j||t.ownerDocument===L&&I(L,t)?-1:e===j||e.ownerDocument===L&&I(L,e)?1:A?Q(A,t)-Q(A,e):0:4&n?-1:1)}:function(t,e){if(t===e)return E=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],l=[e];if(!r||!o)return t===j?-1:e===j?1:r?-1:o?1:A?Q(A,t)-Q(A,e):0;if(r===o)return s(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;a[i]===l[i];)i++;return i?s(a[i],l[i]):a[i]===L?-1:l[i]===L?1:0},j):j},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==j&&O(t),n=n.replace(lt,"='$1']"),b.matchesSelector&&M&&!B[n+" "]&&(!N||!N.test(n))&&(!P||!P.test(n)))try{var i=R.call(t,n);if(i||b.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return e(n,j,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==j&&O(t),I(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==j&&O(t);var n=w.attrHandle[e.toLowerCase()],i=n&&V.call(w.attrHandle,e.toLowerCase())?n(t,e,!M):void 0;return void 0!==i?i:b.attributes||!M?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],i=0,r=0;if(E=!b.detectDuplicates,A=!b.sortStable&&t.slice(0),t.sort(U),E){for(;e=t[r++];)e===t[r]&&(i=n.push(r));for(;i--;)t.splice(n[i],1)}return A=null,t},_=e.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=_(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=_(e);return n},w=e.selectors={cacheLength:50,createPseudo:i,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(yt,bt),t[3]=(t[3]||t[4]||t[5]||"").replace(yt,bt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ht.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&ut.test(n)&&(e=C(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(yt,bt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=q[t+" "];return e||(e=new RegExp("(^|"+tt+")"+t+"("+tt+"|$)"))&&q(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,i){return function(r){var o=e.attr(r,t);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&o.indexOf(i)>-1:"$="===n?i&&o.slice(-i.length)===i:"~="===n?(" "+o.replace(rt," ")+" ").indexOf(i)>-1:"|="===n&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var u,c,h,d,p,f,g=o!==s?"nextSibling":"previousSibling",v=e.parentNode,m=a&&e.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(v){if(o){for(;g;){for(d=e;d=d[g];)if(a?d.nodeName.toLowerCase()===m:1===d.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?v.firstChild:v.lastChild],s&&y){for(d=v,h=d[$]||(d[$]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),u=c[t]||[],p=u[0]===H&&u[1],b=p&&u[2],d=p&&v.childNodes[p];d=++p&&d&&d[g]||(b=p=0)||f.pop();)if(1===d.nodeType&&++b&&d===e){c[t]=[H,p,b];break}}else if(y&&(d=e,h=d[$]||(d[$]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),u=c[t]||[],p=u[0]===H&&u[1],b=p),!1===b)for(;(d=++p&&d&&d[g]||(b=p=0)||f.pop())&&((a?d.nodeName.toLowerCase()!==m:1!==d.nodeType)||!++b||(y&&(h=d[$]||(d[$]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),c[t]=[H,b]),d!==e)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(t,n){var r,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[$]?o(n):o.length>1?(r=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?i(function(t,e){for(var i,r=o(t,n),s=r.length;s--;)i=Q(t,r[s]),t[i]=!(e[i]=r[s])}):function(t){return o(t,0,r)}):o}},pseudos:{not:i(function(t){var e=[],n=[],r=k(t.replace(ot,"$1"));return r[$]?i(function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:i(function(t){return function(n){return e(t,n).length>0}}),contains:i(function(t){return t=t.replace(yt,bt),function(e){return(e.textContent||e.innerText||_(e)).indexOf(t)>-1}}),lang:i(function(t){return ct.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(yt,bt).toLowerCase(),function(e){var n;do{if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===D},focus:function(t){return t===j.activeElement&&(!j.hasFocus||j.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!w.pseudos.empty(t)},header:function(t){return pt.test(t.nodeName)},input:function(t){return dt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:a(function(){return[0]}),last:a(function(t,e){return[e-1]}),eq:a(function(t,e,n){return[n<0?n+e:n]}),even:a(function(t,e){for(var n=0;n=0;)t.push(i);return t}),gt:a(function(t,e,n){for(var i=n<0?n+e:n;++i2&&"ID"===(s=o[0]).type&&b.getById&&9===e.nodeType&&M&&w.relative[o[1].type]){if(!(e=(w.find.ID(s.matches[0].replace(yt,bt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=ht.needsContext.test(t)?0:o.length;r--&&(s=o[r],!w.relative[a=s.type]);)if((u=w.find[a])&&(i=u(s.matches[0].replace(yt,bt),vt.test(o[0].type)&&l(e.parentNode)||e))){if(o.splice(r,1),!(t=i.length&&c(o)))return J.apply(n,i),n;break}}return(h||k(t,d))(i,e,!M,n,!e||vt.test(t)&&l(e.parentNode)||e),n},b.sortStable=$.split("").sort(U).join("")===$,b.detectDuplicates=!!E,O(),b.sortDetached=r(function(t){return 1&t.compareDocumentPosition(j.createElement("div"))}),r(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),b.attributes&&r(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(Z,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),e}(n);lt.find=pt,lt.expr=pt.selectors,lt.expr[":"]=lt.expr.pseudos,lt.uniqueSort=lt.unique=pt.uniqueSort,lt.text=pt.getText,lt.isXMLDoc=pt.isXML,lt.contains=pt.contains;var ft=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&<(t).is(n))break;i.push(t)}return i},gt=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},vt=lt.expr.match.needsContext,mt=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,yt=/^.[^:#\[\.,]*$/;lt.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?lt.find.matchesSelector(i,t)?[i]:[]:lt.find.matches(t,lt.grep(e,function(t){return 1===t.nodeType}))},lt.fn.extend({find:function(t){var e,n=this.length,i=[],r=this;if("string"!=typeof t)return this.pushStack(lt(t).filter(function(){for(e=0;e1?lt.unique(i):i),i.selector=this.selector?this.selector+" "+t:t,i},filter:function(t){return this.pushStack(a(this,t||[],!1))},not:function(t){return this.pushStack(a(this,t||[],!0))},is:function(t){return!!a(this,"string"==typeof t&&vt.test(t)?lt(t):t||[],!1).length}});var bt,wt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(lt.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||bt,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:wt.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof lt?e[0]:e,lt.merge(this,lt.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:Z,!0)),mt.test(i[1])&<.isPlainObject(e))for(i in e)lt.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return r=Z.getElementById(i[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=Z,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):lt.isFunction(t)?void 0!==n.ready?n.ready(t):t(lt):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),lt.makeArray(t,this))}).prototype=lt.fn,bt=lt(Z);var _t=/^(?:parents|prev(?:Until|All))/,xt={children:!0,contents:!0,next:!0,prev:!0};lt.fn.extend({has:function(t){var e=lt(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&<.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?lt.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?it.call(lt(t),this[0]):it.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(lt.uniqueSort(lt.merge(this.get(),lt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),lt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return ft(t,"parentNode")},parentsUntil:function(t,e,n){return ft(t,"parentNode",n)},next:function(t){return l(t,"nextSibling")},prev:function(t){return l(t,"previousSibling")},nextAll:function(t){return ft(t,"nextSibling")},prevAll:function(t){return ft(t,"previousSibling")},nextUntil:function(t,e,n){return ft(t,"nextSibling",n)},prevUntil:function(t,e,n){return ft(t,"previousSibling",n)},siblings:function(t){return gt((t.parentNode||{}).firstChild,t)},children:function(t){return gt(t.firstChild)},contents:function(t){return t.contentDocument||lt.merge([],t.childNodes)}},function(t,e){lt.fn[t]=function(n,i){var r=lt.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=lt.filter(i,r)),this.length>1&&(xt[t]||lt.uniqueSort(r),_t.test(t)&&r.reverse()),this.pushStack(r)}});var Ct=/\S+/g;lt.Callbacks=function(t){t="string"==typeof t?u(t):lt.extend({},t);var e,n,i,r,o=[],s=[],a=-1,l=function(){for(r=t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--}),this},has:function(t){return t?lt.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=n||[],n=[t,n.slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},lt.extend({Deferred:function(t){var e=[["resolve","done",lt.Callbacks("once memory"),"resolved"],["reject","fail",lt.Callbacks("once memory"),"rejected"],["notify","progress",lt.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return lt.Deferred(function(n){lt.each(e,function(e,o){var s=lt.isFunction(t[e])&&t[e];r[o[1]](function(){var t=s&&s.apply(this,arguments);t&<.isFunction(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===i?n.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?lt.extend(t,i):i}},r={};return i.pipe=i.then,lt.each(e,function(t,o){var s=o[2],a=o[3];i[o[1]]=s.add,a&&s.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),r[o[0]]=function(){return r[o[0]+"With"](this===r?i:this,arguments),this},r[o[0]+"With"]=s.fireWith}),i.promise(r),t&&t.call(r,r),r},when:function(t){var e,n,i,r=0,o=tt.call(arguments),s=o.length,a=1!==s||t&<.isFunction(t.promise)?s:0,l=1===a?t:lt.Deferred(),u=function(t,n,i){return function(r){n[t]=this,i[t]=arguments.length>1?tt.call(arguments):r,i===e?l.notifyWith(n,i):--a||l.resolveWith(n,i)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);r0||(kt.resolveWith(Z,[lt]),lt.fn.triggerHandler&&(lt(Z).triggerHandler("ready"),lt(Z).off("ready"))))}}),lt.ready.promise=function(t){return kt||(kt=lt.Deferred(),"complete"===Z.readyState||"loading"!==Z.readyState&&!Z.documentElement.doScroll?n.setTimeout(lt.ready):(Z.addEventListener("DOMContentLoaded",c),n.addEventListener("load",c))),kt.promise(t)},lt.ready.promise();var St=function(t,e,n,i,r,o,s){var a=0,l=t.length,u=null==n;if("object"===lt.type(n)){r=!0;for(a in n)St(t,e,a,n[a],!0,o,s)}else if(void 0!==i&&(r=!0,lt.isFunction(i)||(s=!0),u&&(s?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(lt(t),n)})),e))for(;a-1&&void 0!==n&&Et.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Et.remove(this,t)})}}),lt.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=At.get(t,e),n&&(!i||lt.isArray(n)?i=At.access(t,e,lt.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=lt.queue(t,e),i=n.length,r=n.shift(),o=lt._queueHooks(t,e),s=function(){lt.dequeue(t,e)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,s,o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return At.get(t,n)||At.access(t,n,{empty:lt.Callbacks("once memory").add(function(){At.remove(t,[e+"queue",n])})})}}),lt.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length",""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td;var Ht=/<|&#?\w+;/;!function(){var t=Z.createDocumentFragment(),e=t.appendChild(Z.createElement("div")),n=Z.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),at.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",at.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Ft=/^key/,qt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Wt=/^([^.]*)(?:\.(.+)|)/;lt.event={global:{},add:function(t,e,n,i,r){var o,s,a,l,u,c,h,d,p,f,g,v=At.get(t);if(v)for(n.handler&&(o=n,n=o.handler,r=o.selector),n.guid||(n.guid=lt.guid++),(l=v.events)||(l=v.events={}),(s=v.handle)||(s=v.handle=function(e){return void 0!==lt&<.event.triggered!==e.type?lt.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(Ct)||[""],u=e.length;u--;)a=Wt.exec(e[u])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p&&(h=lt.event.special[p]||{},p=(r?h.delegateType:h.bindType)||p,h=lt.event.special[p]||{},c=lt.extend({type:p,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&<.expr.match.needsContext.test(r),namespace:f.join(".")},o),(d=l[p])||(d=l[p]=[],d.delegateCount=0,h.setup&&!1!==h.setup.call(t,i,f,s)||t.addEventListener&&t.addEventListener(p,s)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),lt.event.global[p]=!0)},remove:function(t,e,n,i,r){var o,s,a,l,u,c,h,d,p,f,g,v=At.hasData(t)&&At.get(t);if(v&&(l=v.events)){for(e=(e||"").match(Ct)||[""],u=e.length;u--;)if(a=Wt.exec(e[u])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p){for(h=lt.event.special[p]||{},p=(i?h.delegateType:h.bindType)||p,d=l[p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!r&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(t,c));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,f,v.handle)||lt.removeEvent(t,p,v.handle),delete l[p])}else for(p in l)lt.event.remove(t,p+e[u],n,i,!0);lt.isEmptyObject(l)&&At.remove(t,"handle events")}},dispatch:function(t){t=lt.event.fix(t);var e,n,i,r,o,s=[],a=tt.call(arguments),l=(At.get(this,"events")||{})[t.type]||[],u=lt.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,t)){for(s=lt.event.handlers.call(this,t,l),e=0;(r=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(o.namespace)||(t.handleObj=o,t.data=o.data,void 0!==(i=((lt.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,i,r,o,s=[],a=e.delegateCount,l=t.target;if(a&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==t.type)){for(i=[],n=0;n-1:lt.find(r,this,null,[l]).length),i[r]&&i.push(o);i.length&&s.push({elem:l,handlers:i})}return a]*)\/>/gi,Ut=/\s*$/g;lt.extend({htmlPrefilter:function(t){return t.replace(Bt,"<$1>")},clone:function(t,e,n){var i,r,o,s,a=t.cloneNode(!0),l=lt.contains(t.ownerDocument,t);if(!(at.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||lt.isXMLDoc(t)))for(s=f(a),o=f(t),i=0,r=o.length;i0&&g(s,!l&&f(t,"script")),a},cleanData:function(t){for(var e,n,i,r=lt.event.special,o=0;void 0!==(n=t[o]);o++)if(Tt(n)){if(e=n[At.expando]){if(e.events)for(i in e.events)r[i]?lt.event.remove(n,i):lt.removeEvent(n,i,e.handle);n[At.expando]=void 0}n[Et.expando]&&(n[Et.expando]=void 0)}}}),lt.fn.extend({domManip:T,detach:function(t){return A(this,t,!0)},remove:function(t){return A(this,t)},text:function(t){return St(this,function(t){return void 0===t?lt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return T(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){_(this,t).appendChild(t)}})},prepend:function(){return T(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=_(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return T(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return T(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(lt.cleanData(f(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return lt.clone(this,t,e)})},html:function(t){return St(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Ut.test(t)&&!Lt[(It.exec(t)||["",""])[1].toLowerCase()]){t=lt.htmlPrefilter(t);try{for(;n1)},show:function(){return I(this,!0)},hide:function(){return I(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Nt(this)?lt(this).show():lt(this).hide()})}}),lt.Tween=$,$.prototype={constructor:$,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||lt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(lt.cssNumber[n]?"":"px")},cur:function(){var t=$.propHooks[this.prop];return t&&t.get?t.get(this):$.propHooks._default.get(this)},run:function(t){var e,n=$.propHooks[this.prop];return this.options.duration?this.pos=e=lt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=lt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){lt.fx.step[t.prop]?lt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[lt.cssProps[t.prop]]&&!lt.cssHooks[t.prop]?t.elem[t.prop]=t.now:lt.style(t.elem,t.prop,t.now+t.unit)}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},lt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},lt.fx=$.prototype.init,lt.fx.step={};var se,ae,le=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;lt.Animation=lt.extend(B,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return p(n.elem,t,Mt.exec(e),n),n}]},tweener:function(t,e){lt.isFunction(t)?(e=t,t=["*"]):t=t.match(Ct);for(var n,i=0,r=t.length;i1)},removeAttr:function(t){return this.each(function(){lt.removeAttr(this,t)})}}),lt.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?lt.prop(t,e,n):(1===o&<.isXMLDoc(t)||(e=e.toLowerCase(),r=lt.attrHooks[e]||(lt.expr.match.bool.test(e)?ce:void 0)),void 0!==n?null===n?void lt.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=lt.find.attr(t,e),null==i?void 0:i))},attrHooks:{type:{set:function(t,e){if(!at.radioValue&&"radio"===e&<.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i,r=0,o=e&&e.match(Ct);if(o&&1===t.nodeType)for(;n=o[r++];)i=lt.propFix[n]||n,lt.expr.match.bool.test(n)&&(t[i]=!1),t.removeAttribute(n)}}),ce={set:function(t,e,n){return!1===e?lt.removeAttr(t,n):t.setAttribute(n,n),n}},lt.each(lt.expr.match.bool.source.match(/\w+/g),function(t,e){var n=he[e]||lt.find.attr;he[e]=function(t,e,i){var r,o;return i||(o=he[e],he[e]=r,r=null!=n(t,e,i)?e.toLowerCase():null,he[e]=o),r}});var de=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;lt.fn.extend({prop:function(t,e){return St(this,lt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[lt.propFix[t]||t]})}}),lt.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&<.isXMLDoc(t)||(e=lt.propFix[e]||e,r=lt.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=lt.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),at.optSelected||(lt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),lt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){lt.propFix[this.toLowerCase()]=this});var fe=/[\t\r\n\f]/g;lt.fn.extend({addClass:function(t){var e,n,i,r,o,s,a,l=0;if(lt.isFunction(t))return this.each(function(e){lt(this).addClass(t.call(this,e,U(this)))});if("string"==typeof t&&t)for(e=t.match(Ct)||[];n=this[l++];)if(r=U(n),i=1===n.nodeType&&(" "+r+" ").replace(fe," ")){for(s=0;o=e[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");a=lt.trim(i),r!==a&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,o,s,a,l=0;if(lt.isFunction(t))return this.each(function(e){lt(this).removeClass(t.call(this,e,U(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(Ct)||[];n=this[l++];)if(r=U(n),i=1===n.nodeType&&(" "+r+" ").replace(fe," ")){for(s=0;o=e[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");a=lt.trim(i),r!==a&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):lt.isFunction(t)?this.each(function(n){lt(this).toggleClass(t.call(this,n,U(this),e),e)}):this.each(function(){var e,i,r,o;if("string"===n)for(i=0,r=lt(this),o=t.match(Ct)||[];e=o[i++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==n||(e=U(this),e&&At.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":At.get(this,"__className__")||""))})},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+U(n)+" ").replace(fe," ").indexOf(e)>-1)return!0;return!1}});var ge=/\r/g,ve=/[\x20\t\r\n\f]+/g;lt.fn.extend({val:function(t){var e,n,i,r=this[0];{if(arguments.length)return i=lt.isFunction(t),this.each(function(n){var r;1===this.nodeType&&(r=i?t.call(this,n,lt(this).val()):t,null==r?r="":"number"==typeof r?r+="":lt.isArray(r)&&(r=lt.map(r,function(t){return null==t?"":t+""})),(e=lt.valHooks[this.type]||lt.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))});if(r)return(e=lt.valHooks[r.type]||lt.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:(n=r.value,"string"==typeof n?n.replace(ge,""):null==n?"":n)}}}),lt.extend({valHooks:{option:{get:function(t){var e=lt.find.attr(t,"value");return null!=e?e:lt.trim(lt.text(t)).replace(ve," ")}},select:{get:function(t){for(var e,n,i=t.options,r=t.selectedIndex,o="select-one"===t.type||r<0,s=o?null:[],a=o?r+1:i.length,l=r<0?a:o?r:0;l-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),lt.each(["radio","checkbox"],function(){lt.valHooks[this]={set:function(t,e){if(lt.isArray(e))return t.checked=lt.inArray(lt(t).val(),e)>-1}},at.checkOn||(lt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var me=/^(?:focusinfocus|focusoutblur)$/;lt.extend(lt.event,{trigger:function(t,e,i,r){var o,s,a,l,u,c,h,d=[i||Z],p=st.call(t,"type")?t.type:t,f=st.call(t,"namespace")?t.namespace.split("."):[];if(s=a=i=i||Z,3!==i.nodeType&&8!==i.nodeType&&!me.test(p+lt.event.triggered)&&(p.indexOf(".")>-1&&(f=p.split("."),p=f.shift(),f.sort()),u=p.indexOf(":")<0&&"on"+p,t=t[lt.expando]?t:new lt.Event(p,"object"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=f.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:lt.makeArray(e,[t]),h=lt.event.special[p]||{},r||!h.trigger||!1!==h.trigger.apply(i,e))){if(!r&&!h.noBubble&&!lt.isWindow(i)){for(l=h.delegateType||p,me.test(l+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(i.ownerDocument||Z)&&d.push(a.defaultView||a.parentWindow||n)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)t.type=o>1?l:h.bindType||p,c=(At.get(s,"events")||{})[t.type]&&At.get(s,"handle"),c&&c.apply(s,e),(c=u&&s[u])&&c.apply&&Tt(s)&&(t.result=c.apply(s,e),!1===t.result&&t.preventDefault());return t.type=p,r||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(d.pop(),e)||!Tt(i)||u&<.isFunction(i[p])&&!lt.isWindow(i)&&(a=i[u],a&&(i[u]=null),lt.event.triggered=p,i[p](),lt.event.triggered=void 0,a&&(i[u]=a)),t.result}},simulate:function(t,e,n){var i=lt.extend(new lt.Event,n,{type:t,isSimulated:!0});lt.event.trigger(i,null,e)}}),lt.fn.extend({trigger:function(t,e){return this.each(function(){lt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return lt.event.trigger(t,e,n,!0)}}),lt.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){lt.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),lt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),at.focusin="onfocusin"in n,at.focusin||lt.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){lt.event.simulate(e,t.target,lt.event.fix(t))};lt.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=At.access(i,e);r||i.addEventListener(t,n,!0),At.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=At.access(i,e)-1;r?At.access(i,e,r):(i.removeEventListener(t,n,!0),At.remove(i,e))}}});var ye=n.location,be=lt.now(),we=/\?/;lt.parseJSON=function(t){return JSON.parse(t+"")},lt.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||lt.error("Invalid XML: "+t),e};var _e=/#.*$/,xe=/([?&])_=[^&]*/,Ce=/^(.*?):[ \t]*([^\r\n]*)$/gm,ke=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Se=/^(?:GET|HEAD)$/,Te=/^\/\//,Ae={},Ee={},Oe="*/".concat("*"),je=Z.createElement("a");je.href=ye.href,lt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ye.href,type:"GET",isLocal:ke.test(ye.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Oe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":lt.parseJSON,"text xml":lt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?X(X(t,lt.ajaxSettings),e):X(lt.ajaxSettings,t)},ajaxPrefilter:z(Ae),ajaxTransport:z(Ee),ajax:function(t,e){function i(t,e,i,a){var u,h,y,b,_,C=e;2!==w&&(w=2,l&&n.clearTimeout(l),r=void 0,s=a||"",x.readyState=t>0?4:0,u=t>=200&&t<300||304===t,i&&(b=G(d,x,i)),b=Y(d,b,x,u),u?(d.ifModified&&(_=x.getResponseHeader("Last-Modified"),_&&(lt.lastModified[o]=_),(_=x.getResponseHeader("etag"))&&(lt.etag[o]=_)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=b.state,h=b.data,y=b.error,u=!y)):(y=C,!t&&C||(C="error",t<0&&(t=0))),x.status=t,x.statusText=(e||C)+"",u?g.resolveWith(p,[h,C,x]):g.rejectWith(p,[x,C,y]),x.statusCode(m),m=void 0,c&&f.trigger(u?"ajaxSuccess":"ajaxError",[x,d,u?h:y]),v.fireWith(p,[x,C]),c&&(f.trigger("ajaxComplete",[x,d]),--lt.active||lt.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,o,s,a,l,u,c,h,d=lt.ajaxSetup({},e),p=d.context||d,f=d.context&&(p.nodeType||p.jquery)?lt(p):lt.event,g=lt.Deferred(),v=lt.Callbacks("once memory"),m=d.statusCode||{},y={},b={},w=0,_="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(2===w){if(!a)for(a={};e=Ce.exec(s);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===w?s:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return w||(t=b[n]=b[n]||t,y[t]=e),this},overrideMimeType:function(t){return w||(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(w<2)for(e in t)m[e]=[m[e],t[e]];else x.always(t[x.status]);return this},abort:function(t){var e=t||_;return r&&r.abort(e),i(0,e),this}};if(g.promise(x).complete=v.add,x.success=x.done,x.error=x.fail,d.url=((t||d.url||ye.href)+"").replace(_e,"").replace(Te,ye.protocol+"//"),d.type=e.method||e.type||d.method||d.type,d.dataTypes=lt.trim(d.dataType||"*").toLowerCase().match(Ct)||[""],null==d.crossDomain){u=Z.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=je.protocol+"//"+je.host!=u.protocol+"//"+u.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=lt.param(d.data,d.traditional)),V(Ae,d,e,x),2===w)return x;c=lt.event&&d.global,c&&0==lt.active++&<.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Se.test(d.type),o=d.url,d.hasContent||(d.data&&(o=d.url+=(we.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=xe.test(o)?o.replace(xe,"$1_="+be++):o+(we.test(o)?"&":"?")+"_="+be++)),d.ifModified&&(lt.lastModified[o]&&x.setRequestHeader("If-Modified-Since",lt.lastModified[o]),lt.etag[o]&&x.setRequestHeader("If-None-Match",lt.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||e.contentType)&&x.setRequestHeader("Content-Type",d.contentType),x.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Oe+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)x.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(p,x,d)||2===w))return x.abort();_="abort";for(h in{success:1,error:1,complete:1})x[h](d[h]);if(r=V(Ee,d,e,x)){if(x.readyState=1,c&&f.trigger("ajaxSend",[x,d]),2===w)return x;d.async&&d.timeout>0&&(l=n.setTimeout(function(){x.abort("timeout")},d.timeout));try{w=1,r.send(y,i)}catch(t){if(!(w<2))throw t;i(-1,t)}}else i(-1,"No Transport");return x},getJSON:function(t,e,n){return lt.get(t,e,n,"json")},getScript:function(t,e){return lt.get(t,void 0,e,"script")}}),lt.each(["get","post"],function(t,e){lt[e]=function(t,n,i,r){return lt.isFunction(n)&&(r=r||i,i=n,n=void 0),lt.ajax(lt.extend({url:t,type:e,dataType:r,data:n,success:i},lt.isPlainObject(t)&&t))}}),lt._evalUrl=function(t){return lt.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},lt.fn.extend({wrapAll:function(t){var e;return lt.isFunction(t)?this.each(function(e){lt(this).wrapAll(t.call(this,e))}):(this[0]&&(e=lt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return lt.isFunction(t)?this.each(function(e){lt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=lt(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=lt.isFunction(t);return this.each(function(n){lt(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){lt.nodeName(this,"body")||lt(this).replaceWith(this.childNodes)}).end()}}),lt.expr.filters.hidden=function(t){return!lt.expr.filters.visible(t)},lt.expr.filters.visible=function(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0};var De=/%20/g,Me=/\[\]$/,Pe=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,Re=/^(?:input|select|textarea|keygen)/i;lt.param=function(t,e){var n,i=[],r=function(t,e){e=lt.isFunction(e)?e():null==e?"":e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=lt.ajaxSettings&<.ajaxSettings.traditional),lt.isArray(t)||t.jquery&&!lt.isPlainObject(t))lt.each(t,function(){r(this.name,this.value)});else for(n in t)J(n,t[n],e,r);return i.join("&").replace(De,"+")},lt.fn.extend({serialize:function(){return lt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=lt.prop(this,"elements");return t?lt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!lt(this).is(":disabled")&&Re.test(this.nodeName)&&!Ne.test(t)&&(this.checked||!Rt.test(t))}).map(function(t,e){var n=lt(this).val();return null==n?null:lt.isArray(n)?lt.map(n,function(t){return{name:e.name,value:t.replace(Pe,"\r\n")}}):{name:e.name,value:n.replace(Pe,"\r\n")}}).get()}}),lt.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ie={0:200,1223:204},$e=lt.ajaxSettings.xhr();at.cors=!!$e&&"withCredentials"in $e,at.ajax=$e=!!$e,lt.ajaxTransport(function(t){var e,i;if(at.cors||$e&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(s in r)a.setRequestHeader(s,r[s]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ie[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){e&&i()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),lt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return lt.globalEval(t),t}}}),lt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),lt.ajaxTransport("script",function(t){if(t.crossDomain){var e,n;return{send:function(i,r){e=lt(" diff --git a/templates/webapps/galaxy/galaxy.panels.mako b/templates/webapps/galaxy/galaxy.panels.mako index 605fc6769e8..07468dae4b1 100644 --- a/templates/webapps/galaxy/galaxy.panels.mako +++ b/templates/webapps/galaxy/galaxy.panels.mako @@ -72,15 +72,11 @@ ${h.js( ## TODO: remove when all libs are required directly in modules 'bundled/libs.bundled', - 'bundled/masthead.bundled', + 'bundled/extended.bundled', 'libs/d3', 'libs/require', )} - %if self.galaxy_config.get('bundle', None): - ${h.js('bundled/%s.bundled' % self.galaxy_config.get('bundle'))} - %endif - diff --git a/tools/data_source/upload.py b/tools/data_source/upload.py index 6937f5ce831..feb95b5b231 100644 --- a/tools/data_source/upload.py +++ b/tools/data_source/upload.py @@ -36,11 +36,6 @@ else: assert sys.version_info[:2] >= (2, 7) -def stop_err(msg, ret=1): - sys.stderr.write(msg) - sys.exit(ret) - - def file_err(msg, dataset, json_file): json_file.write(dumps(dict(type='dataset', ext='data', @@ -249,22 +244,18 @@ def add_file(dataset, registry, json_file, output_path): dataset.name = uncompressed_name data_type = 'zip' if not data_type: - # TODO refactor this logic. check_binary isn't guaranteed to be - # correct since it only looks at whether the first 100 chars are - # printable or not. If someone specifies a known unsniffable - # binary datatype and check_binary fails, the file gets mangled. - if check_binary(dataset.path) or Binary.is_ext_unsniffable(dataset.file_type): + if check_binary(dataset.path) or registry.is_extension_unsniffable_binary(dataset.file_type): # We have a binary dataset, but it is not Bam, Sff or Pdf data_type = 'binary' - # binary_ok = False parts = dataset.name.split(".") if len(parts) > 1: ext = parts[-1].strip().lower() - if check_content and not Binary.is_ext_unsniffable(ext): + is_ext_unsniffable_binary = registry.is_extension_unsniffable_binary(ext) + if check_content and not is_ext_unsniffable_binary: file_err('The uploaded binary file contains inappropriate content', dataset, json_file) return - elif Binary.is_ext_unsniffable(ext) and dataset.file_type != ext: - err_msg = "You must manually set the 'File Format' to '%s' when uploading %s files." % (ext.capitalize(), ext) + elif is_ext_unsniffable_binary and dataset.file_type != ext: + err_msg = "You must manually set the 'File Format' to '%s' when uploading %s files." % (ext, ext) file_err(err_msg, dataset, json_file) return if not data_type: