diff --git a/.ci/check_py3_compatibility.sh b/.ci/check_py3_compatibility.sh new file mode 100755 index 00000000000..5b23a549cba --- /dev/null +++ b/.ci/check_py3_compatibility.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +if command -v ack-grep >/dev/null; then + ACK=ack-grep +else + ACK=ack +fi + +export ACK_OPTIONS=" --type python \ +--ignore-dir=.git/ \ +--ignore-dir=.tox/ \ +--ignore-dir=.venv/ \ +--ignore-dir=client/node_modules/ \ +--ignore-dir=database/ \ +--ignore-dir=doc/build/ \ +--ignore-dir=eggs/ \ +--ignore-dir=static/maps/ \ +--ignore-dir=static/scripts/" + +PYTHON2_ONLY_MODULES="__builtin__ _winreg BaseHTTPServer CGIHTTPServer \ +ConfigParser Cookie cookielib copy_reg cPickle cStringIO Dialog dummy_thread \ +FileDialog gdbm htmlentitydefs HTMLParser httplib Queue robotparser \ +ScrolledText SimpleDialog SimpleHTTPServer SimpleXMLRPCServer SocketServer \ +StringIO thread Tix tkColorChooser tkCommonDialog Tkconstants Tkdnd tkFont \ +Tkinter tkFileDialog tkMessageBox tkSimpleDialog ttk urllib urllib2 urlparse \ +xmlrpclib" + +ret=0 +for mod in $PYTHON2_ONLY_MODULES; do + $ACK "^import $mod(\n|\.)|^from $mod import " + if [ $? -eq 0 ]; then ret=1; fi +done + +exit $ret diff --git a/.ci/first_startup.sh b/.ci/first_startup.sh index a05a3cf5388..778f73588d8 100644 --- a/.ci/first_startup.sh +++ b/.ci/first_startup.sh @@ -10,7 +10,7 @@ bash run.sh --daemon && \ sleep 1 i=$((i + 1)) done -kill -9 "$(cat paster.pid)" +kill -9 "$(cat galaxy.pid)" echo "exit code:$EXIT_CODE, showing startup log:" -cat paster.log +cat galaxy.log exit $EXIT_CODE diff --git a/.ci/py3_sources.txt b/.ci/py3_sources.txt deleted file mode 100644 index 9603644ed8d..00000000000 --- a/.ci/py3_sources.txt +++ /dev/null @@ -1,94 +0,0 @@ -client/galaxy/style/source_material/circle.py -contrib/ -cron/ -doc/parse_gx_xsd.py -doc/patch.py -lib/galaxy/actions/ -lib/galaxy/auth/ -lib/galaxy/config.py -lib/galaxy/containers/ -lib/galaxy/dataset_collections/ -lib/galaxy/datatypes/ -lib/galaxy/dependencies/ -lib/galaxy/eggs/ -lib/galaxy/exceptions/ -lib/galaxy/external_services/ -lib/galaxy/forms/ -lib/galaxy/jobs/ -lib/galaxy/managers/ -lib/galaxy/model/ -lib/galaxy/objectstore/ -lib/galaxy/openid/ -lib/galaxy/quota/ -lib/galaxy/sample_tracking/ -lib/galaxy/security/ -lib/galaxy/tags/ -lib/galaxy/tools/ -lib/galaxy/tours/ -lib/galaxy/util/ -lib/galaxy/visualization/ -lib/galaxy/web/base/ -lib/galaxy/web/buildapp.py -lib/galaxy/web/framework/base.py -lib/galaxy/web/framework/decorators.py -lib/galaxy/web/framework/helpers/grids.py -lib/galaxy/web/framework/__init__.py -lib/galaxy/web/framework/middleware/error.py -lib/galaxy/web/framework/middleware/static.py -lib/galaxy/web/framework/middleware/statsd.py -lib/galaxy/web/framework/webapp.py -lib/galaxy/web/__init__.py -lib/galaxy/webapps/galaxy/api/histories.py -lib/galaxy/webapps/galaxy/api/library_datasets.py -lib/galaxy/webapps/galaxy/api/tours.py -lib/galaxy/webapps/galaxy/api/users.py -lib/galaxy/webapps/galaxy/api/workflows.py -lib/galaxy/webapps/galaxy/buildapp.py -lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py -lib/galaxy/webapps/galaxy/controllers/external_services.py -lib/galaxy/webapps/galaxy/controllers/forms.py -lib/galaxy/webapps/galaxy/controllers/history.py -lib/galaxy/webapps/galaxy/controllers/library_common.py -lib/galaxy/webapps/galaxy/controllers/search.py -lib/galaxy/webapps/galaxy/controllers/userskeys.py -lib/galaxy/webapps/reports/config.py -lib/galaxy/webapps/reports/controllers/tools.py -lib/galaxy/webapps/reports/__init__.py -lib/galaxy/webapps/tool_shed/config.py -lib/galaxy/webapps/tool_shed/controllers/groups.py -lib/galaxy/webapps/tool_shed/controllers/user.py -lib/galaxy/webapps/tool_shed/framework/middleware/remoteuser.py -lib/galaxy/webapps/tool_shed/__init__.py -lib/galaxy/webapps/tool_shed/model/__init__.py -lib/galaxy/webapps/tool_shed/search/repo_search.py -lib/galaxy/webapps/tool_shed/util/ratings_util.py -lib/galaxy/webhooks/ -lib/galaxy/work/ -lib/galaxy/workflow/ -lib/galaxy_ext/ -lib/log_tempfile.py -lib/mimeparse.py -lib/psyco_full.py -lib/tool_shed/ -scripts/api/ -scripts/auth/ -scripts/bootstrap_history.py -scripts/build_toolbox.py -scripts/check_eggs.py -scripts/check_galaxy.py -scripts/check_python.py -scripts/cleanup_datasets/ -scripts/communication/ -scripts/data_libraries/build_whoosh_index.py -scripts/db_shell.py -scripts/drmaa_external_runner.py -scripts/metagenomics/ -scripts/microbes/BeautifulSoup.py -scripts/microbes/harvest_bacteria.py -scripts/secret_decoder_ring.py -scripts/tool_shed/api/common.py -scripts/tool_shed/build_ts_whoosh_index.py -scripts/tool_shed/deprecate_repositories_without_metadata.py -test/ -tool_list.py -tools/ diff --git a/.travis.yml b/.travis.yml index bde4abd6f49..b89142fd77b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,18 +9,24 @@ env: - TOX_ENV=py27-unit - TOX_ENV=qunit - TOX_ENV=first_startup - - TOX_ENV=validate-test-tools - TOX_ENV=py27-lint-docstring-include-list - TOX_ENV=check-python-dependencies matrix: + include: + - env: TOX_ENV=validate-test-tools + addons: + apt: + packages: + - libxml2-utils + - env: TOX_ENV=check_py3_compatibility + addons: + apt: + packages: + - ack-grep allow_failures: - env: TOX_ENV=check-python-dependencies -addons: - apt: - packages: - - libxml2-utils install: - pip install tox diff --git a/client/GruntFile.js b/client/GruntFile.js index acc9fd98f1d..104567cdda2 100644 --- a/client/GruntFile.js +++ b/client/GruntFile.js @@ -1,26 +1,13 @@ module.exports = function(grunt) { - "use strict"; - var GALAXY_PATHS = { - dist : '../static/scripts', - maps : '../static/maps', - // this symlink allows us to serve uncompressed scripts in DEV_PATH for use with sourcemaps - srcSymlink : '../static/src', - }, - TOOLSHED_PATHS = { - dist : '../static/toolshed/scripts', - maps : '../static/toolshed/maps', - srcSymlink : '../static/toolshed/src', - }; - - grunt.config.set( 'app', 'galaxy' ); - grunt.config.set( 'paths', GALAXY_PATHS ); - if( grunt.option( 'app' ) === 'toolshed' ){ - grunt.config.set( 'app', grunt.option( 'app' ) ); - grunt.config.set( 'paths', TOOLSHED_PATHS ); - } - + dist: "../static/scripts", + maps: "../static/maps", + // this symlink allows us to serve uncompressed scripts in DEV_PATH for use with sourcemaps + srcSymlink: "../static/src" + }; + grunt.config.set("app", "galaxy"); + grunt.config.set("paths", GALAXY_PATHS); // see the sub directory grunt-tasks/ for individual task definitions - grunt.loadTasks( 'grunt-tasks' ); - grunt.registerTask( 'default', [ 'uglify' ] ); + grunt.loadTasks("grunt-tasks"); + grunt.registerTask("default", ["style"]); }; diff --git a/client/README.md b/client/README.md index e76b8e3ad48..3b99da0f016 100644 --- a/client/README.md +++ b/client/README.md @@ -66,13 +66,3 @@ As mentioned above, 'make client' will also rebuild styles. If you *only* want to run the style task, use the following command from the `client` directory: yarn run style - - -The Toolshed Client Build -========================= - -The toolshed client is not tightly integrated with the rest of the build -system. To build the toolshed client, execute the following command from the -`client` directory. - - yarn run build-toolshed diff --git a/client/galaxy/scripts/apps/admin.js b/client/galaxy/scripts/apps/admin.js index 6d6f745e0f4..6ca5bf2a691 100644 --- a/client/galaxy/scripts/apps/admin.js +++ b/client/galaxy/scripts/apps/admin.js @@ -5,13 +5,13 @@ import GalaxyApp from "galaxy"; import AdminPanel from "./panels/admin-panel"; import FormWrapper from "mvc/form/form-wrapper"; import GridView from "mvc/grid/grid-view"; -import Ui from "mvc/ui/ui-misc"; import QueryStringParsing from "utils/query-string-parsing"; import Router from "layout/router"; import Utils from "utils/utils"; import Page from "layout/page"; -import Vue from "libs/vue"; -import UserAPIKeys from "components/UserAPIKeys.vue"; +import UserAPIKeys from "components/admin/UserAPIKeys.vue"; +import DataTables from "components/admin/DataTables.vue"; +import Vue from "vue"; window.app = function app(options, bootstrapped) { window.Galaxy = new GalaxyApp.GalaxyApp(options, bootstrapped); @@ -28,10 +28,11 @@ window.app = function app(options, bootstrapped) { "(/)admin(/)repositories": "show_repositories", "(/)admin(/)forms": "show_forms", "(/)admin(/)form(/)(:form_id)": "show_form", - "(/)admin/api_keys": "show_user_api_keys" + "(/)admin/api_keys": "show_user_api_keys", + "(/)admin/data_tables": "show_data_tables" }, - authenticate: function(args, name) { + authenticate: function() { return Galaxy.user && Galaxy.user.id && Galaxy.user.get("is_admin"); }, @@ -39,8 +40,7 @@ window.app = function app(options, bootstrapped) { this.page.display( new GridView({ url_base: `${Galaxy.root}admin/users_list`, - url_data: Galaxy.params, - dict_format: true + url_data: Galaxy.params }) ); }, @@ -49,8 +49,7 @@ window.app = function app(options, bootstrapped) { this.page.display( new GridView({ url_base: `${Galaxy.root}admin/roles_list`, - url_data: Galaxy.params, - dict_format: true + url_data: Galaxy.params }) ); }, @@ -59,8 +58,7 @@ window.app = function app(options, bootstrapped) { this.page.display( new GridView({ url_base: `${Galaxy.root}admin/groups_list`, - url_data: Galaxy.params, - dict_format: true + url_data: Galaxy.params }) ); }, @@ -69,8 +67,7 @@ window.app = function app(options, bootstrapped) { this.page.display( new GridView({ url_base: `${Galaxy.root}admin_toolshed/browse_repositories`, - url_data: Galaxy.params, - dict_format: true + url_data: Galaxy.params }) ); }, @@ -79,8 +76,7 @@ window.app = function app(options, bootstrapped) { this.page.display( new GridView({ url_base: `${Galaxy.root}admin/tool_versions_list`, - url_data: Galaxy.params, - dict_format: true + url_data: Galaxy.params }) ); }, @@ -89,24 +85,28 @@ window.app = function app(options, bootstrapped) { this.page.display( new GridView({ url_base: `${Galaxy.root}admin/quotas_list`, - url_data: Galaxy.params, - dict_format: true + url_data: Galaxy.params }) ); }, show_user_api_keys: function() { - var vuemount = document.createElement("div"); - this.page.display(vuemount); - new Vue(UserAPIKeys).$mount(vuemount); + var vueMount = document.createElement("div"); + this.page.display(vueMount); + new Vue(UserAPIKeys).$mount(vueMount); + }, + + show_data_tables: function() { + var vueMount = document.createElement("div"); + this.page.display(vueMount); + new Vue(DataTables).$mount(vueMount); }, show_forms: function() { this.page.display( new GridView({ url_base: `${Galaxy.root}forms/forms_list`, - url_data: Galaxy.params, - dict_format: true + url_data: Galaxy.params }) ); }, diff --git a/client/galaxy/scripts/apps/analysis.js b/client/galaxy/scripts/apps/analysis.js index f4b6ab3ac19..db946e372e8 100644 --- a/client/galaxy/scripts/apps/analysis.js +++ b/client/galaxy/scripts/apps/analysis.js @@ -22,7 +22,7 @@ import Ui from "mvc/ui/ui-misc"; import DatasetError from "mvc/dataset/dataset-error"; import DatasetEditAttributes from "mvc/dataset/dataset-edit-attributes"; import Citations from "components/Citations.vue"; -import Vue from "libs/vue"; +import Vue from "vue"; /** define the 'Analyze Data'/analysis/main/home page for Galaxy * * has a masthead @@ -47,6 +47,7 @@ window.app = function app(options, bootstrapped) { "(/)tours(/)(:tour_id)": "show_tours", "(/)user(/)": "show_user", "(/)user(/)(:form_id)": "show_user_form", + "(/)openids(/)list": "show_openids", "(/)pages(/)create(/)": "show_pages_create", "(/)pages(/)edit(/)": "show_pages_edit", "(/)pages(/)(:action_id)": "show_pages", @@ -76,7 +77,7 @@ window.app = function app(options, bootstrapped) { show_tours: function(tour_id) { if (tour_id) { - Tours.giveTour(tour_id); + Tours.giveTourById(tour_id); } else { this.page.display(new Tours.ToursView()); } @@ -115,8 +116,7 @@ window.app = function app(options, bootstrapped) { show_workflows_published: function() { this.page.display( new GridView({ - url_base: `${Galaxy.root}workflow/list_published`, - dict_format: true + url_base: `${Galaxy.root}workflow/list_published` }) ); }, @@ -157,11 +157,18 @@ window.app = function app(options, bootstrapped) { ); }, + show_openids: function() { + this.page.display( + new GridView({ + url_base: `${Galaxy.root}user/openids_list` + }) + ); + }, + show_datasets: function() { this.page.display( new GridView({ - url_base: `${Galaxy.root}dataset/list`, - dict_format: true + url_base: `${Galaxy.root}dataset/list` }) ); }, diff --git a/client/galaxy/scripts/apps/extended.js b/client/galaxy/scripts/apps/extended.js index 4761a3ce304..a70afc8fb0c 100644 --- a/client/galaxy/scripts/apps/extended.js +++ b/client/galaxy/scripts/apps/extended.js @@ -1,11 +1,37 @@ +import _l from "utils/localization"; +import GalaxyApp from "galaxy"; import WorkflowView from "mvc/workflow/workflow-view"; import Trackster from "viz/trackster"; import Circster from "viz/circster"; +import Phyloviz from "viz/phyloviz"; +import Sweepster from "viz/sweepster"; 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"; +import pagesEditorOnload from "galaxy.pages"; +import Data from "mvc/dataset/data"; +import History from "mvc/history/history-model"; +import StructureView from "mvc/history/history-structure-view"; +import HistoryContents from "mvc/history/history-contents"; +import MultiPanel from "mvc/history/multi-panel"; +import HistoryView from "mvc/history/history-view"; +import HistoryViewEdit from "mvc/history/history-view-edit"; +import HistoryViewAnnotated from "mvc/history/history-view-annotated"; +import HistoryCopyDialog from "mvc/history/copy-dialog"; +import HDAListItemEdit from "mvc/history/hda-li-edit"; +import HDAModel from "mvc/history/hda-model"; +import addLogging from "utils/add-logging"; +import LegacyGridView from "legacy/grid/grid-view"; +import * as run_stats from "reports/run_stats"; +import ToolshedGroups from "toolshed/toolshed.groups"; + +if (window.Galaxy && window.Galaxy.debug === undefined) { + //TODO: (kind of a temporary hack?) Must have Galaxy.logging for some of the imports + //here; remove when imports are all fixed. + addLogging(window.Galaxy, "GalaxyApp"); +} export function mastheadEntry(options) { if (!Galaxy.user) { @@ -34,17 +60,139 @@ export function workflowEntry(options) { new WorkflowView(options); } -function libraryEntry(options) { +export function libraryEntry(options) { new GalaxyLibrary.GalaxyApp(options); } +export function historyEntry(options) { + $("#toggle-deleted").modeButton({ + initialMode: options.initialModeDeleted, + modes: [ + { mode: "showing_deleted", html: _l("Exclude deleted") }, + { mode: "not_showing_deleted", html: _l("Include deleted") } + ] + }); + $("#toggle-hidden").modeButton({ + initialMode: options.initialModeHidden, + modes: [ + { mode: "showing_hidden", html: _l("Exclude hidden") }, + { mode: "not_showing_hidden", html: _l("Include hidden") } + ] + }); + $("#switch").click(function() { + //##HACK:ity hack hack + //##TODO: remove when out of iframe + var hview = + Galaxy.currHistoryPanel || (window.top.Galaxy && window.top.Galaxy.currHistoryPanel) + ? window.top.Galaxy.currHistoryPanel + : null; + if (hview) { + hview.switchToHistory("${ history[ 'id' ] }"); + } else { + window.location = "${ switch_to_url }"; + } + }); + // use_panels effects where the the center_panel() is rendered: + // w/o it renders to the body, w/ it renders to #center - we need to adjust a few things for scrolling to work + if (options.hasMasthead) { + $("#center").addClass("flex-vertical-container"); + } + + let viewClass = options.userIsOwner ? HistoryViewEdit.HistoryViewEdit : HistoryView.HistoryView; + let historyModel = new History.History(options.historyJSON); + + // attach the copy dialog to the import button now that we have a history + $("#import").click(function() { + HistoryCopyDialog(historyModel, { + useImport: true, + // use default datasets option to match the toggle-deleted button + allDatasets: $("#toggle-deleted").modeButton("getMode").mode === "showing_deleted" + }).done(function() { + if (window === window.parent) { + window.location = Galaxy.root; + } else if (Galaxy.currHistoryPanel) { + Galaxy.currHistoryPanel.loadCurrentHistory(); + } + }); + }); + + let historyView = new viewClass({ + el: $("#history-" + options.historyJSON.id), + className: viewClass.prototype.className + " wide", + $scrollContainer: options.hasMasthead + ? function() { + return this.$el.parent(); + } + : undefined, + model: historyModel, + show_deleted: options.showDeletedJson, + show_hidden: options.showHiddenJson, + purgeAllowed: options.allow_user_dataset_purge + }); + historyView.trigger("loading"); + historyModel + .fetchContents({ silent: true }) + .fail(function() { + alert("Galaxy history failed to load"); + }) + .done(function() { + historyView.trigger("loading-done"); + historyView.render(); + }); + $("#toggle-deleted").on("click", function() { + historyView.toggleShowDeleted(); + }); + $("#toggle-hidden").on("click", function() { + historyView.toggleShowHidden(); + }); +} + +export function multiHistoryEntry(options) { + let histories = new History.HistoryCollection([], { + includeDeleted: options.includingDeleted, + order: options.order, + limitOnFirstFetch: options.limit, + limitPerFetch: options.limit, + currentHistoryId: options.current_history_id + }); + + let multipanel = new MultiPanel.MultiPanelColumns({ + el: $("#center").get(0), + histories: histories + }); + + histories.fetchFirst({ silent: true }).done(function() { + multipanel.createColumns(); + multipanel.render(0); + }); +} + export const bundleEntries = { library: libraryEntry, masthead: mastheadEntry, workflow: workflowEntry, trackster: tracksterEntry, circster: circsterEntry, - adminToolshed: adminToolshedEntry + adminToolshed: adminToolshedEntry, + pages: pagesEditorOnload, + phyloviz: Phyloviz.PhylovizView, + createTabularDatasetChunkedView: Data.createTabularDatasetChunkedView, + multiHistory: multiHistoryEntry, + history: historyEntry, + History: History.History, + HistoryContents: HistoryContents.HistoryContents, + SweepsterVisualization: Sweepster.SweepsterVisualization, + SweepsterVisualizationView: Sweepster.SweepsterVisualizationView, + HistoryCopyDialog, + HistoryViewAnnotated, + Trackster, + StructureView, + HDAListItemEdit, + HDAModel, + GalaxyApp, + LegacyGridView, + run_stats, + ToolshedGroups }; window.bundleEntries = bundleEntries; diff --git a/client/galaxy/scripts/apps/panels/admin-panel.js b/client/galaxy/scripts/apps/panels/admin-panel.js index 86ee64fd9ea..de90612c750 100644 --- a/client/galaxy/scripts/apps/panels/admin-panel.js +++ b/client/galaxy/scripts/apps/panels/admin-panel.js @@ -22,7 +22,8 @@ var AdminPanel = Backbone.View.extend({ }, { title: _l("Data tables"), - url: "admin/view_tool_data_tables" + url: "admin/data_tables", + target: "__use_router__" }, { title: _l("Display applications"), diff --git a/client/galaxy/scripts/apps/panels/tool-panel.js b/client/galaxy/scripts/apps/panels/tool-panel.js index 8573a44ff1a..0a2cead12b9 100644 --- a/client/galaxy/scripts/apps/panels/tool-panel.js +++ b/client/galaxy/scripts/apps/panels/tool-panel.js @@ -59,7 +59,7 @@ var ToolPanel = Backbone.View.extend({ self.$("#internal-workflows").append( self._templateAllWorkflow({ title: _l("All workflows"), - href: "workflow" + href: "workflows/list" }) ); _.each(this.stored_workflow_menu_entries, menu_entry => { diff --git a/client/galaxy/scripts/components/Message.vue b/client/galaxy/scripts/components/Message.vue new file mode 100644 index 00000000000..dced6c62e5c --- /dev/null +++ b/client/galaxy/scripts/components/Message.vue @@ -0,0 +1,20 @@ + + + + diff --git a/client/galaxy/scripts/components/admin/BaseGrid.vue b/client/galaxy/scripts/components/admin/BaseGrid.vue new file mode 100644 index 00000000000..d0dc0bc69c2 --- /dev/null +++ b/client/galaxy/scripts/components/admin/BaseGrid.vue @@ -0,0 +1,43 @@ + + + diff --git a/client/galaxy/scripts/components/admin/DataManagerGrid.vue b/client/galaxy/scripts/components/admin/DataManagerGrid.vue new file mode 100644 index 00000000000..50ce7e74c4c --- /dev/null +++ b/client/galaxy/scripts/components/admin/DataManagerGrid.vue @@ -0,0 +1,47 @@ + + + diff --git a/client/galaxy/scripts/components/admin/DataTables.vue b/client/galaxy/scripts/components/admin/DataTables.vue new file mode 100644 index 00000000000..02c1fd6b76b --- /dev/null +++ b/client/galaxy/scripts/components/admin/DataTables.vue @@ -0,0 +1,117 @@ + + + diff --git a/client/galaxy/scripts/components/admin/DataTablesGrid.vue b/client/galaxy/scripts/components/admin/DataTablesGrid.vue new file mode 100644 index 00000000000..a8381edbb86 --- /dev/null +++ b/client/galaxy/scripts/components/admin/DataTablesGrid.vue @@ -0,0 +1,53 @@ + + + diff --git a/client/galaxy/scripts/components/UserAPIKeys.vue b/client/galaxy/scripts/components/admin/UserAPIKeys.vue similarity index 100% rename from client/galaxy/scripts/components/UserAPIKeys.vue rename to client/galaxy/scripts/components/admin/UserAPIKeys.vue diff --git a/client/galaxy/scripts/galaxy.interactive_environments.js b/client/galaxy/scripts/galaxy.interactive_environments.js index 19f41e02f54..e17b3a62835 100644 --- a/client/galaxy/scripts/galaxy.interactive_environments.js +++ b/client/galaxy/scripts/galaxy.interactive_environments.js @@ -6,9 +6,7 @@ export function append_notebook(url) { clear_main_area(); $("#main").append( - `` + `` ); } @@ -21,9 +19,7 @@ export function clear_main_area() { export function display_spinner() { $("#main").append( - `` + `` ); } diff --git a/client/galaxy/scripts/galaxy.js b/client/galaxy/scripts/galaxy.js index cbd968e2ecc..2205e69b799 100644 --- a/client/galaxy/scripts/galaxy.js +++ b/client/galaxy/scripts/galaxy.js @@ -256,6 +256,9 @@ GalaxyApp.prototype.toString = function toString() { return `GalaxyApp(${userEmail})`; }; +// This is not great. Rework to be a singleton-style Galaxy app accessible/created by import +window.Galaxy = window.Galaxy || new GalaxyApp(); + // ============================================================================ export default { GalaxyApp: GalaxyApp diff --git a/client/galaxy/scripts/galaxy.library.js b/client/galaxy/scripts/galaxy.library.js index a94300bbd39..55f2745e8a9 100644 --- a/client/galaxy/scripts/galaxy.library.js +++ b/client/galaxy/scripts/galaxy.library.js @@ -176,7 +176,7 @@ var GalaxyLibrary = Backbone.View.extend({ mod_toastr.info("You must select at least one dataset to download"); Galaxy.libraries.library_router.navigate(`folders/${folder_id}`, { trigger: true, replace: true }); } else { - Galaxy.libraries.folderToolbarView.download(folder_id, format); + Galaxy.libraries.folderToolbarView.download(format); Galaxy.libraries.library_router.navigate(`folders/${folder_id}`, { trigger: false, replace: true }); } }); diff --git a/client/galaxy/scripts/galaxy.pages.js b/client/galaxy/scripts/galaxy.pages.js index 9d16e88e5dd..d5cca10e0cb 100644 --- a/client/galaxy/scripts/galaxy.pages.js +++ b/client/galaxy/scripts/galaxy.pages.js @@ -5,6 +5,8 @@ import "libs/jquery/jquery.wymeditor"; import "libs/jquery/jquery.autocomplete"; import GridView from "mvc/grid/grid-view"; +var WYMeditor = window.WYMeditor; + var CONTROLS = { // Item types. ITEM_HISTORY: "item_history", @@ -154,11 +156,7 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm } show_modal( "Create Link", - `


`, + `


`, { "Make link": function() { // Get URL, name/title. @@ -332,7 +330,6 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm var grid = new GridView({ url_base: item_info.list_ajax_url, - dict_format: true, embedded: true }); Galaxy.modal.show({ @@ -426,7 +423,6 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm var grid = new GridView({ url_base: item_info.list_ajax_url, - dict_format: true, embedded: true }); Galaxy.modal.show({ @@ -493,7 +489,7 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm } }; -export default function editor_onload() { +export default function pagesEditorOnload() { // Generic error handling $(document).ajaxError((e, x) => { // console.log( e, x ); diff --git a/client/galaxy/scripts/layout/modal.js b/client/galaxy/scripts/layout/modal.js index d359f59fef5..4f8120f29a7 100644 --- a/client/galaxy/scripts/layout/modal.js +++ b/client/galaxy/scripts/layout/modal.js @@ -154,9 +154,9 @@ function show_in_overlay(options) { closeButton: true, title: " ", body: $( - `
` + `
` ) }); modal.show({ backdrop: true }); diff --git a/client/galaxy/scripts/layout/router.js b/client/galaxy/scripts/layout/router.js index ccf787a03cd..720aa34a989 100644 --- a/client/galaxy/scripts/layout/router.js +++ b/client/galaxy/scripts/layout/router.js @@ -17,10 +17,8 @@ var Router = Backbone.Router.extend({ data.__identifer = Math.random() .toString(36) .substr(2); - if (!$.isEmptyObject(data)) { - url += url.indexOf("?") == -1 ? "?" : "&"; - url += $.param(data, true); - } + url += url.indexOf("?") == -1 ? "?" : "&"; + url += $.param(data, true); Galaxy.params = data; this.navigate(url, { trigger: true }); }, diff --git a/client/galaxy/scripts/legacy/grid/grid-model.js b/client/galaxy/scripts/legacy/grid/grid-model.js new file mode 100644 index 00000000000..f25a4313abe --- /dev/null +++ b/client/galaxy/scripts/legacy/grid/grid-model.js @@ -0,0 +1,114 @@ +// legacy grid model, used by reports and toolshed +export default Backbone.Model.extend({ + defaults: { + url_base: "", + async: false, + async_ops: [], + categorical_filters: [], + filters: {}, + sort_key: null, + show_item_checkboxes: false, + advanced_search: false, + cur_page: 1, + num_pages: 1, + operation: undefined, + item_ids: undefined + }, + + /** + * Return true if operation can be done asynchronously. + */ + can_async_op: function(op) { + return _.indexOf(this.attributes.async_ops, op) !== -1; + }, + + /** + * Add filtering criterion. + */ + add_filter: function(key, value, append) { + // Update URL arg with new condition. + if (append) { + // Update or append value. + var cur_val = this.attributes.filters[key]; + + var new_val; + if (cur_val === null || cur_val === undefined) { + new_val = value; + } else if (typeof cur_val == "string") { + if (cur_val == "All" || cur_val == value) { + new_val = value; + } else { + // Replace string with array. + var values = []; + values[0] = cur_val; + values[1] = value; + new_val = values; + } + } else { + // Current value is an array. + new_val = cur_val; + if (new_val.indexOf(value) === -1) { + new_val.push(value); + } + } + this.attributes.filters[key] = new_val; + } else { + // Replace value. + this.attributes.filters[key] = value; + } + }, + + /** + * Remove filtering criterion. + */ + remove_filter: function(key, condition) { + var cur_val = this.attributes.filters[key]; + if (cur_val === null || cur_val === undefined) { + return false; + } + + if (typeof cur_val === "string") { + // overwrite/remove condition. + this.attributes.filters[key] = ""; + } else { + // filter contains an array of conditions. + var condition_index = _.indexOf(cur_val, condition); + if (condition_index !== -1) { + cur_val[condition_index] = ""; + } + } + }, + + /** + * Returns URL data for obtaining a new grid. + */ + get_url_data: function() { + var url_data = { + async: this.attributes.async, + sort: this.attributes.sort_key, + page: this.attributes.cur_page, + show_item_checkboxes: this.attributes.show_item_checkboxes, + advanced_search: this.attributes.advanced_search + }; + + // Add operation, item_ids only if they have values. + if (this.attributes.operation) { + url_data.operation = this.attributes.operation; + } + if (this.attributes.item_ids) { + url_data.id = this.attributes.item_ids; + } + + // Add filter arguments to data, placing "f-" in front of all arguments. + var self = this; + _.each(_.pairs(self.attributes.filters), k => { + url_data[`f-${k[0]}`] = k[1]; + }); + return url_data; + }, + + // Return URL for obtaining a new grid + get_url: function(args) { + return `${this.get("url_base")}?${$.param(this.get_url_data())}&${$.param(args)}`; + } +}); diff --git a/client/galaxy/scripts/legacy/grid/grid-template.js b/client/galaxy/scripts/legacy/grid/grid-template.js new file mode 100644 index 00000000000..e5fda7d790f --- /dev/null +++ b/client/galaxy/scripts/legacy/grid/grid-template.js @@ -0,0 +1,547 @@ +// dependencies +import Utils from "utils/utils"; +// grid view templates +export default { + // template + grid: function(options) { + var tmpl = ""; + if (options.embedded) { + tmpl = this.grid_header(options) + this.grid_table(options); + } else { + tmpl = `
${this.grid_header( + options + )}
${this.grid_table( + options + )}`; + } + + // add info text + if (options.info_text) { + tmpl += `
${options.info_text}
`; + } + + // return + return tmpl; + }, + + // template + grid_table: function() { + return ` +
+ + + + +
+
`; + }, + + // template + grid_header: function(options) { + var tmpl = '
'; + if (!options.embedded) { + tmpl += `

${options.title}

`; + } + if (options.global_actions) { + tmpl += '
    '; + var show_popup = options.global_actions.length >= 3; + if (show_popup) { + tmpl += + '
  • Actions
  • ' + + '
    '; + } + for (let action of options.global_actions) { + tmpl += `
  • ${action.label}
  • `; + } + if (show_popup) { + tmpl += "
    "; + } + tmpl += "
"; + } + if (options.insert) { + tmpl += options.insert; + } + + // add grid filters + tmpl += this.grid_filters(options); + tmpl += "
"; + + // return template + return tmpl; + }, + + // template + header: function(options) { + // start + var tmpl = ""; + + // add checkbox + if (options.show_item_checkboxes) { + tmpl += ""; + if (options.items.length > 0) { + tmpl += + '' + + ''; + } + tmpl += ""; + } + + // create header elements + for (let column of options.columns) { + if (column.visible) { + tmpl += ``; + if (column.href) { + tmpl += `${column.label}`; + } else { + tmpl += column.label; + } + tmpl += `${column.extra}`; + } + } + + // finalize + tmpl += ""; + + // return template + return tmpl; + }, + + // template + body: function(options) { + // initialize + var tmpl = ""; + var items_length = options.items.length; + + // empty grid? + if (items_length === 0) { + // No results. + tmpl += 'No Items'; + } + + // create rows + for (let item of options.items) { + // Tag current + tmpl += "`; + } + + // Data columns + for (let column of options.columns) { + if (column.visible) { + // Nowrap + var nowrap = ""; + if (column.nowrap) { + nowrap = 'style="white-space:nowrap;"'; + } + + // get column settings + var column_settings = item.column_config[column.label]; + + // load attributes + var link = column_settings.link; + var value = column_settings.value; + var target = column_settings.target; + + // unescape value + if (jQuery.type(value) === "string") { + value = value.replace(/\/\//g, "/"); + } + + // Attach popup menu? + var id = ""; + var cls = ""; + if (column.attach_popup) { + id = `grid-${item.encode_id}-popup`; + cls = "menubutton"; + if (link !== "") { + cls += " split"; + } + cls += " popup"; + } + + // Check for row wrapping + tmpl += ``; + + // Link + if (link) { + if (options.operations.length !== 0) { + tmpl += `
`; + } + tmpl += `${value}`; + if (options.operations.length !== 0) { + tmpl += "
"; + } + } else { + tmpl += `
`; + } + tmpl += ""; + } + } + tmpl += ""; + } + return tmpl; + }, + + // template + footer: function(options) { + // create template string + var tmpl = ""; + + // paging + if (options.use_paging && options.num_pages > 1) { + // get configuration + var num_page_links = options.num_page_links; + var cur_page_num = options.cur_page_num; + var num_pages = options.num_pages; + + // First pass on min page. + var page_link_range = num_page_links / 2; + var min_page = cur_page_num - page_link_range; + var min_offset = 0; + if (min_page <= 0) { + // Min page is too low. + min_page = 1; + min_offset = page_link_range - (cur_page_num - min_page); + } + + // Set max page. + var max_range = page_link_range + min_offset; + var max_page = cur_page_num + max_range; + var max_offset; + if (max_page <= num_pages) { + // Max page is fine. + max_offset = 0; + } else { + // Max page is too high. + max_page = num_pages; + // +1 to account for the +1 in the loop below. + max_offset = max_range - (max_page + 1 - cur_page_num); + } + + // Second and final pass on min page to add any unused + // offset from max to min. + if (max_offset !== 0) { + min_page -= max_offset; + if (min_page < 1) { + min_page = 1; + } + } + + // template header + tmpl += ''; + if (options.show_item_checkboxes) { + tmpl += ""; + } + tmpl += '' + '' + "Page:"; + + if (min_page > 1) { + tmpl += + '1 ...'; + } + + // create page urls + for (var page_index = min_page; page_index < max_page + 1; page_index++) { + if (page_index == options.cur_page_num) { + tmpl += `${page_index}`; + } else { + tmpl += `${page_index}`; + } + } + + // show last page + if (max_page < num_pages) { + tmpl += `...${num_pages}`; + } + tmpl += ""; + + // Show all link + tmpl += ` + | Show All + + `; + } + + // Grid operations for multiple items. + if (options.show_item_checkboxes) { + // start template + tmpl += ` + + + + + For selected items: + `; + + // configure buttons for operations + for (let operation of options.operations) { + if (operation.allow_multiple) { + tmpl += ` `; + } + } + + // finalize template + tmpl += "" + ""; + } + + // count global operations + var found_global = false; + for (let operation of options.operations) { + if (operation.global_operation) { + found_global = true; + break; + } + } + + // add global operations + if (found_global) { + tmpl += "" + ''; + for (let operation of options.operations) { + if (operation.global_operation) { + tmpl += `${operation.label}`; + } + } + tmpl += "" + ""; + } + + // add legend + if (options.legend) { + tmpl += `${options.legend}`; + } + + // return + return tmpl; + }, + + // template + message: function(options) { + var status = options.status; + if (["success", "ok"].indexOf(status) != -1) { + status = "done"; + } + return `

${_.escape( + options.message + )}

`; + }, + + // template + grid_filters: function(options) { + // get filters + var default_filter_dict = options.default_filter_dict; + var filters = options.filters; + + // show advanced search if flag set or if there are filters for advanced search fields + var advanced_search_display = "none"; + if (options.advanced_search) { + advanced_search_display = "block"; + } + + // identify columns with advanced filtering + var show_advanced_search_link = false; + for (let column of options.columns) { + if (column.filterable == "advanced") { + var column_key = column.key; + var f_key = filters[column_key]; + var d_key = default_filter_dict[column_key]; + if (f_key && d_key && f_key != d_key) { + advanced_search_display = "block"; + } + show_advanced_search_link = true; + } + } + + // hide standard search if advanced is shown + var standard_search_display = "block"; + if (advanced_search_display == "block") { + standard_search_display = "none"; + } + + // + // standard search + // + var tmpl = `"; + + // + // advanced search + // + tmpl += `"; + + // return template + return tmpl; + }, + + // template + grid_column_filter: function(options, column) { + // collect parameters + var filters = options.filters; + var column_label = column.label; + var column_key = column.key; + if (column.filterable == "advanced") { + column_label = column_label.toLowerCase(); + } + + // start + var tmpl = ""; + + if (column.filterable == "advanced") { + tmpl += `${column_label}:`; + } + tmpl += ''; + if (column.is_text) { + tmpl += `
`; + // Carry forward filtering criteria with hidden inputs. + for (let column of options.columns) { + var filter_value = filters[column.key]; + if (filter_value) { + if (filter_value != "All") { + if (column.is_text) { + filter_value = JSON.stringify(filter_value); + } + tmpl += ``; + } + } + } + // Print current filtering criteria and links to delete. + tmpl += ``; + + // add filters + var column_filter = filters[column_key]; + if (column_filter) { + // identify type + var type = jQuery.type(column_filter); + + // single filter value + if (type == "string") { + if (column_filter != "All") { + // append template + tmpl += this.filter_element(column_key, column_filter); + } + } + + // multiple filter values + if (type == "array") { + for (let i in column_filter) { + // copy filters and remove entry + var params = column_filter; + params = params.slice(i); + + // append template + tmpl += this.filter_element(column_key, column_filter[i]); + } + } + } + + // close span + tmpl += ""; + + // Set value, size of search input field. Minimum size is 20 characters. + var value = ""; + var size = 20; + if (column.filterable == "standard") { + value = column.label.toLowerCase(); + if (value.length < 20) { + size = value.length; + } + // +4 to account for space after placeholder + size = size + 4; + } + + // print input field for column + tmpl += ` + + + + +
`; + } else { + // filter criteria + tmpl += ``; + + // add category filters + var seperator = false; + for (var cf_label in options.categorical_filters[column_key]) { + // get category filter + var cf = options.categorical_filters[column_key][cf_label]; + + // each filter will have only a single argument, so get that single argument + var cf_key = ""; + var cf_arg = ""; + for (var key in cf) { + cf_key = key; + cf_arg = cf[key]; + } + + // add seperator + if (seperator) { + tmpl += " | "; + } + seperator = true; + + // add category + var filter = filters[column_key]; + if (filter && cf[column_key] && filter == cf_arg) { + tmpl += `${cf_label}`; + } else { + tmpl += `${cf_label}`; + } + } + tmpl += ""; + } + tmpl += "" + ""; + + // return template + return tmpl; + }, + + // template for filter items + filter_element: function(filter_key, filter_value) { + filter_value = Utils.sanitize(filter_value); + return `${filter_value}`; + } +}; diff --git a/client/galaxy/scripts/legacy/grid/grid-view.js b/client/galaxy/scripts/legacy/grid/grid-view.js new file mode 100644 index 00000000000..05e82077321 --- /dev/null +++ b/client/galaxy/scripts/legacy/grid/grid-view.js @@ -0,0 +1,677 @@ +// This is necessary so that, when nested arrays are used in ajax/post/get methods, square brackets ('[]') are +// not appended to the identifier of a nested array. +jQuery.ajaxSettings.traditional = true; + +// dependencies +import Utils from "utils/utils"; +import GridModel from "legacy/grid/grid-model"; +import Templates from "legacy/grid/grid-template"; +import PopupMenu from "mvc/ui/popup-menu"; +// grid view +export default Backbone.View.extend({ + // model + grid: null, + + // Initialize + initialize: function(grid_config) { + this.grid = new GridModel(); + this.dict_format = grid_config.dict_format; + this.title = grid_config.title; + var self = this; + window.add_tag_to_grid_filter = (tag_name, tag_value) => { + // Put tag name and value together. + var tag = tag_name + (tag_value !== undefined && tag_value !== "" ? `:${tag_value}` : ""); + var advanced_search = $("#advanced-search").is(":visible"); + if (!advanced_search) { + $("#standard-search").slideToggle("fast"); + $("#advanced-search").slideToggle("fast"); + } + self.add_filter_condition("tags", tag); + }; + + // set element + if (this.dict_format) { + this.setElement("
"); + if (grid_config.url_base && !grid_config.items) { + var url_data = grid_config.url_data || {}; + _.each(grid_config.filters, (v, k) => { + url_data[`f-${k}`] = v; + }); + $.ajax({ + url: `${grid_config.url_base}?${$.param(url_data)}`, + success: function(response) { + response.embedded = grid_config.embedded; + response.filters = grid_config.filters || {}; + self.init_grid(response); + } + }); + } else { + this.init_grid(grid_config); + } + } else { + this.setElement("#grid-container"); + this.init_grid(grid_config); + } + + // fix padding + if (grid_config.use_panels) { + $("#center").css({ + padding: "10px", + overflow: "auto" + }); + } + }, + + // refresh frames + handle_refresh: function(refresh_frames) { + if (refresh_frames) { + if ($.inArray("history", refresh_frames) > -1) { + if (window.top.Galaxy && window.top.Galaxy.currHistoryPanel) { + window.top.Galaxy.currHistoryPanel.loadCurrentHistory(); + } + } + } + }, + + // Initialize + init_grid: function(grid_config) { + this.grid.set(grid_config); + + // get options + var options = this.grid.attributes; + + if (this.allow_title_display && options.title) { + Utils.setWindowTitle(options.title); + } + // handle refresh requests + this.handle_refresh(options.refresh_frames); + + // strip protocol and domain + var url = this.grid.get("url_base"); + url = url.replace(/^.*\/\/[^\/]+/, ""); + this.grid.set("url_base", url); + + // append main template + this.$el.html(Templates.grid(options)); + + // update div contents + this.$el.find("#grid-table-header").html(Templates.header(options)); + this.$el.find("#grid-table-body").html(Templates.body(options)); + this.$el.find("#grid-table-footer").html(Templates.footer(options)); + + // update message + if (options.message) { + this.$el.find("#grid-message").html(Templates.message(options)); + var self = this; + if (options.use_hide_message) { + setTimeout(() => { + self.$el.find("#grid-message").html(""); + }, 5000); + } + } + + // configure elements + this.init_grid_elements(); + this.init_grid_controls(); + + // attach global event handler + // TODO: redundant (the onload/standard page handlers do this) - but needed because these are constructed after page ready + if (window.init_refresh_on_change) { + window.init_refresh_on_change(); + } + }, + + // Initialize grid controls + init_grid_controls: function() { + // link + var self = this; + + // Initialize grid operation button. + this.$el.find(".operation-button").each(function() { + $(this).off(); + $(this).click(function() { + self.submit_operation(this); + return false; + }); + }); + + // Initialize text filters to select text on click and use normal font when user is typing. + this.$el.find("input[type=text]").each(function() { + $(this).off(); + $(this) + .click(function() { + $(this).select(); + }) + .keyup(function() { + $(this).css("font-style", "normal"); + }); + }); + + // Initialize sort links. + this.$el.find(".sort-link").each(function() { + $(this).off(); + $(this).click(function() { + self.set_sort_condition($(this).attr("sort_key")); + return false; + }); + }); + + // Initialize text filters. + this.$el.find(".text-filter-form").each(function() { + $(this).off(); + $(this).submit(function() { + var column_key = $(this).attr("column_key"); + var text_input_obj = $(`#input-${column_key}-filter`); + var text_input = text_input_obj.val(); + text_input_obj.val(""); + self.add_filter_condition(column_key, text_input); + return false; + }); + }); + + // Initialize categorical filters. + this.$el.find(".text-filter-val > a").each(function() { + $(this).off(); + $(this).click(function() { + // Remove visible element. + $(this) + .parent() + .remove(); + + // Remove filter condition. + self.remove_filter_condition($(this).attr("filter_key"), $(this).attr("filter_val")); + + // Return + return false; + }); + }); + + // Initialize categorical filters. + this.$el.find(".categorical-filter > a").each(function() { + $(this).off(); + $(this).click(function() { + self.set_categorical_filter($(this).attr("filter_key"), $(this).attr("filter_val")); + return false; + }); + }); + + // Initialize standard, advanced search toggles. + this.$el.find(".advanced-search-toggle").each(function() { + $(this).off(); + $(this).click(() => { + self.$el.find("#standard-search").slideToggle("fast"); + self.$el.find("#advanced-search").slideToggle("fast"); + return false; + }); + }); + + // Add event to check all box + this.$el.find("#check_all").off(); + this.$el.find("#check_all").on("click", () => { + self.check_all_items(); + }); + }, + + // Initialize grid elements. + init_grid_elements: function() { + // Initialize grid selection checkboxes. + this.$el.find(".grid").each(function() { + var checkboxes = $(this).find("input.grid-row-select-checkbox"); + var check_count = $(this).find("span.grid-selected-count"); + var update_checked = () => { + check_count.text($(checkboxes).filter(":checked").length); + }; + + $(checkboxes).each(function() { + $(this).change(update_checked); + }); + update_checked(); + }); + + // Initialize ratings. + if (this.$el.find(".community_rating_star").length !== 0) this.$el.find(".community_rating_star").rating({}); + + // get options + var options = this.grid.attributes; + var self = this; + + // + // add page click events + // + this.$el.find(".page-link > a").each(function() { + $(this).click(function() { + self.set_page($(this).attr("page_num")); + return false; + }); + }); + + // + // add inbound/outbound events + // + this.$el.find(".use-target").each(function() { + $(this).click(function() { + self.execute({ + href: $(this).attr("href"), + target: $(this).attr("target") + }); + return false; + }); + }); + + // empty grid? + var items_length = options.items.length; + if (items_length === 0) { + return; + } + + // add operation popup menus + _.each(options.items, (item, index) => { + var button = self.$(`#grid-${item.encode_id}-popup`).off(); + var popup = new PopupMenu(button); + _.each(options.operations, operation => { + self._add_operation(popup, operation, item); + }); + }); + }, + + /** Add an operation to the items menu */ + _add_operation: function(popup, operation, item) { + var self = this; + var settings = item.operation_config[operation.label]; + if (settings.allowed && operation.allow_popup) { + popup.addItem({ + html: operation.label, + href: settings.url_args, + target: settings.target, + confirmation_text: operation.confirm, + func: function(e) { + e.preventDefault(); + var label = $(e.target).html(); + if (operation.onclick) { + operation.onclick(item.encode_id); + } else { + self.execute(this.findItemByHtml(label)); + } + } + }); + } + }, + + // Add a condition to the grid filter; this adds the condition and refreshes the grid. + add_filter_condition: function(name, value) { + // Do nothing is value is empty. + if (value === "") { + return false; + } + + // Add condition to grid. + this.grid.add_filter(name, value, true); + + // Add button that displays filter and provides a button to delete it. + var t = $(Templates.filter_element(name, value)); + var self = this; + t.click(function() { + // Remove visible element. + $(this).remove(); + + // Remove filter condition. + self.remove_filter_condition(name, value); + }); + + // append to container + var container = this.$el.find(`#${name}-filtering-criteria`); + container.append(t); + + // execute + this.go_page_one(); + this.execute(); + }, + + // Remove a condition to the grid filter; this adds the condition and refreshes the grid. + remove_filter_condition: function(name, value) { + // Remove filter condition. + this.grid.remove_filter(name, value); + + // Execute + this.go_page_one(); + this.execute(); + }, + + // Set sort condition for grid. + set_sort_condition: function(col_key) { + // Set new sort condition. New sort is col_key if sorting new column; if reversing sort on + // currently sorted column, sort is reversed. + var cur_sort = this.grid.get("sort_key"); + var new_sort = col_key; + if (cur_sort.indexOf(col_key) !== -1) { + // Reverse sort. + if (cur_sort.substring(0, 1) !== "-") { + new_sort = `-${col_key}`; + } + } + + // Remove sort arrows elements. + this.$el.find(".sort-arrow").remove(); + + // Add sort arrow element to new sort column. + var sort_arrow = new_sort.substring(0, 1) == "-" ? "↑" : "↓"; + var t = $(`${sort_arrow}`).addClass("sort-arrow"); + + // Add to header + this.$el.find(`#${col_key}-header`).append(t); + + // Update grid. + this.grid.set("sort_key", new_sort); + this.go_page_one(); + this.execute(); + }, + + // Set new value for categorical filter. + set_categorical_filter: function(name, new_value) { + // Update filter hyperlinks to reflect new filter value. + var category_filter = this.grid.get("categorical_filters")[name]; + + var cur_value = this.grid.get("filters")[name]; + var self = this; + this.$el.find(`.${name}-filter`).each(function() { + var text = $.trim($(this).text()); + var filter = category_filter[text]; + var filter_value = filter[name]; + if (filter_value == new_value) { + // Remove filter link since grid will be using this filter. It is assumed that + // this element has a single child, a hyperlink/anchor with text. + $(this).empty(); + $(this).addClass("current-filter"); + $(this).append(text); + } else if (filter_value == cur_value) { + // Add hyperlink for this filter since grid will no longer be using this filter. It is assumed that + // this element has a single child, a hyperlink/anchor. + $(this).empty(); + var t = $(`${text}`); + t.click(() => { + self.set_categorical_filter(name, filter_value); + }); + $(this).removeClass("current-filter"); + $(this).append(t); + } + }); + + // Update grid. + this.grid.add_filter(name, new_value); + this.go_page_one(); + this.execute(); + }, + + // Set page to view. + set_page: function(new_page) { + // Update page hyperlink to reflect new page. + var self = this; + this.$el.find(".page-link").each(function() { + var id = $(this).attr("id"); + + var // Id has form 'page-link- + page_num = parseInt(id.split("-")[2], 10); + + var cur_page = self.grid.get("cur_page"); + var text; + if (page_num === new_page) { + // Remove link to page since grid will be on this page. It is assumed that + // this element has a single child, a hyperlink/anchor with text. + text = $(this) + .children() + .text(); + $(this).empty(); + $(this).addClass("inactive-link"); + $(this).text(text); + } else if (page_num === cur_page) { + // Add hyperlink to this page since grid will no longer be on this page. It is assumed that + // this element has a single child, a hyperlink/anchor. + text = $(this).text(); + $(this).empty(); + $(this).removeClass("inactive-link"); + var t = $(`${text}`); + t.click(() => { + self.set_page(page_num); + }); + $(this).append(t); + } + }); + + if (new_page === "all") { + this.grid.set("cur_page", new_page); + } else { + this.grid.set("cur_page", parseInt(new_page, 10)); + } + this.execute(); + }, + + // confirmation/submission of operation request + submit_operation: function(operation_button, confirmation_text) { + // identify operation + var operation_name = $(operation_button).val(); + + // verify any item is selected + var number_of_checked_ids = this.$el.find('input[name="id"]:checked').length; + if (number_of_checked_ids < 1) { + return false; + } + + // Check to see if there's grid confirmation text for this operation + var operation = _.findWhere(this.grid.attributes.operations, { + label: operation_name + }); + if (operation && !confirmation_text) { + confirmation_text = operation.confirm || ""; + } + + // collect ids + var item_ids = []; + this.$el.find("input[name=id]:checked").each(function() { + item_ids.push($(this).val()); + }); + + // execute operation + var options = { + operation: operation_name, + id: item_ids, + confirmation_text: confirmation_text + }; + if (operation.target == "top" || operation.target == "center") { + options = _.extend(options, { + href: operation.href, + target: operation.target + }); + } + this.execute(options); + return true; + }, + + check_all_items: function() { + var check = this.$(".grid-row-select-checkbox"); + var state = this.$("#check_all").prop("checked"); + _.each(check, c => { + $(c).prop("checked", state); + }); + this.init_grid_elements(); + }, + + // Go back to page one; this is useful when a filter is applied. + go_page_one: function() { + // Need to go back to page 1 if not showing all. + var cur_page = this.grid.get("cur_page"); + if (cur_page !== null && cur_page !== undefined && cur_page !== "all") { + this.grid.set("cur_page", 1); + } + }, + + // + // execute operations and hyperlink requests + // + execute: function(options) { + // get url + var id = null; + var href = null; + var operation = null; + var confirmation_text = null; + var target = null; + + // check for options + if (options) { + // get options + href = options.href; + operation = options.operation; + id = options.id; + confirmation_text = options.confirmation_text; + target = options.target; + + // check if input contains the operation tag + if (href !== undefined && href.indexOf("operation=") != -1) { + // Get operation, id in hyperlink's href. + var href_parts = href.split("?"); + if (href_parts.length > 1) { + var href_parms_str = href_parts[1]; + var href_parms = href_parms_str.split("&"); + for (var index = 0; index < href_parms.length; index++) { + if (href_parms[index].indexOf("operation") != -1) { + // Found operation parm; get operation value. + operation = href_parms[index].split("=")[1]; + operation = operation.replace(/\+/g, " "); + } else if (href_parms[index].indexOf("id") != -1) { + // Found id parm; get id value. + id = href_parms[index].split("=")[1]; + } + } + } + } + } + + // check for operation details + if (operation && id) { + // show confirmation box + if ( + confirmation_text && + confirmation_text !== "" && + confirmation_text != "None" && + confirmation_text != "null" + ) + if (!confirm(confirmation_text)) return false; + + // use small characters for operation?! + operation = operation.toLowerCase(); + + // Update grid. + this.grid.set({ + operation: operation, + item_ids: id + }); + + // Do operation. If operation cannot be performed asynchronously, redirect to location. + if (target == "top") { + window.top.location = `${href}?${$.param(this.grid.get_url_data())}`; + } else if (target == "center") { + $("#galaxy_main").attr("src", `${href}?${$.param(this.grid.get_url_data())}`); + } else if (this.grid.can_async_op(operation) || this.dict_format) { + this.update_grid(); + } else { + this.go_to(target, href); + } + + // done + return false; + } + + // refresh grid + if (href) { + this.go_to(target, href); + return false; + } + + // refresh grid + if (this.grid.get("async") || this.dict_format) { + this.update_grid(); + } else { + this.go_to(target, href); + } + + // done + return false; + }, + + // go to url + go_to: function(target, href) { + // get aysnc status + var async = this.grid.get("async"); + this.grid.set("async", false); + + // get slide status + var advanced_search = this.$el.find("#advanced-search").is(":visible"); + this.grid.set("advanced_search", advanced_search); + + // get default url + if (!href) { + href = `${this.grid.get("url_base")}?${$.param(this.grid.get_url_data())}`; + } + + // clear grid of transient request attributes. + this.grid.set({ + operation: undefined, + item_ids: undefined, + async: async + }); + switch (target) { + case "center": + $("#galaxy_main").attr("src", href); + break; + case "top": + window.top.location = href; + break; + default: + window.location = href; + } + }, + + // Update grid. + update_grid: function() { + // If there's an operation, do POST; otherwise, do GET. + var method = this.grid.get("operation") ? "POST" : "GET"; + + // Show overlay to indicate loading and prevent user actions. + this.$el.find(".loading-elt-overlay").show(); + var self = this; + $.ajax({ + type: method, + url: self.grid.get("url_base"), + data: self.grid.get_url_data(), + error: function() { + alert("Grid refresh failed"); + }, + success: function(response_text) { + // backup + var embedded = self.grid.get("embedded"); + var insert = self.grid.get("insert"); + var advanced_search = self.$el.find("#advanced-search").is(":visible"); + + // request new configuration + var json = self.dict_format ? response_text : $.parseJSON(response_text); + + // update + json.embedded = embedded; + json.insert = insert; + json.advanced_search = advanced_search; + + // Initialize new grid config + self.init_grid(json); + + // Hide loading overlay. + self.$el.find(".loading-elt-overlay").hide(); + }, + complete: function() { + // Clear grid of transient request attributes. + self.grid.set({ + operation: undefined, + item_ids: undefined + }); + } + }); + } +}); diff --git a/client/galaxy/scripts/libs/jquery/jquery.wymeditor.js b/client/galaxy/scripts/libs/jquery/jquery.wymeditor.js index 5fb0e4a9e90..c9205dd14a7 100644 --- a/client/galaxy/scripts/libs/jquery/jquery.wymeditor.js +++ b/client/galaxy/scripts/libs/jquery/jquery.wymeditor.js @@ -4754,3 +4754,5 @@ WYMeditor.WymClassSafari.prototype.getTagForStyle = function(style) { if(/super/.test(style)) return 'sup'; return false; }; + +window.WYMeditor = WYMeditor; diff --git a/client/galaxy/scripts/mvc/collection/list-collection-creator.js b/client/galaxy/scripts/mvc/collection/list-collection-creator.js index ed99b659ca1..5a0072d0503 100644 --- a/client/galaxy/scripts/mvc/collection/list-collection-creator.js +++ b/client/galaxy/scripts/mvc/collection/list-collection-creator.js @@ -278,8 +278,8 @@ var ListCollectionCreator = Backbone.View.extend(BASE_MVC.LoggableMixin) /** describe what is wrong with a particular element if anything */ _isElementInvalid: function(element) { - if (element.history_content_type !== "dataset") { - return _l("is not a dataset"); + if (element.history_content_type === "dataset_collection") { + return _l("is a collection, this is not allowed"); } var validState = element.state === STATES.OK || _.contains(STATES.NOT_READY_STATES, element.state); if (!validState) { diff --git a/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js b/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js index d2754caae16..15a2998f08a 100644 --- a/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js +++ b/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js @@ -1796,7 +1796,8 @@ var pairedCollectionCreatorModal = function _pairedCollectionCreatorModal(datase oncreate: function(creator, response) { Galaxy.modal.hide(); deferred.resolve(response); - } + }, + title: _l("Create a collection of paired datasets") }); if (!window.Galaxy || !Galaxy.modal) { @@ -1805,7 +1806,7 @@ var pairedCollectionCreatorModal = function _pairedCollectionCreatorModal(datase creator = new PairedCollectionCreator(options); Galaxy.modal.show({ - title: _l("Create a collection of paired datasets"), + title: options.title, body: creator.$el, width: "80%", height: "800px", diff --git a/client/galaxy/scripts/mvc/dataset/data.js b/client/galaxy/scripts/mvc/dataset/data.js index a5bb4fc873f..71580ee773d 100644 --- a/client/galaxy/scripts/mvc/dataset/data.js +++ b/client/galaxy/scripts/mvc/dataset/data.js @@ -1,8 +1,6 @@ import _l from "utils/localization"; -// Additional dependencies: jQuery, underscore. -import Modal from "mvc/ui/ui-modal"; -import Frames from "mvc/ui/ui-frames"; import mod_icon_btn from "mvc/ui/icon-button"; +// Additional dependencies: jQuery, underscore. /** * Dataset metedata. */ diff --git a/client/galaxy/scripts/mvc/dataset/dataset-li.js b/client/galaxy/scripts/mvc/dataset/dataset-li.js index 97f8b831b6e..e1b54b1d0ce 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-li.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-li.js @@ -286,47 +286,39 @@ var DatasetListItemView = _super.extend( return this._renderMetaFileDownloadButton(); } - return $( - [ - '`, - '', - "" - ].join("") - ); + return $(` + + + `); }, - /** Render the download button which opens a dropdown with links to download assoc. meta files (indeces, etc.) */ + /** Render the download button which opens a dropdown with links to download assoc. meta files (indices, etc.) */ _renderMetaFileDownloadButton: function() { var urls = this.model.urls; - return $( - [ - '" - ].join("\n") - ); + return $(` + `); }, _renderNametags: function() { diff --git a/client/galaxy/scripts/mvc/grid/grid-model.js b/client/galaxy/scripts/mvc/grid/grid-model.js index 6e3fc1698f9..bd4b3c99350 100644 --- a/client/galaxy/scripts/mvc/grid/grid-model.js +++ b/client/galaxy/scripts/mvc/grid/grid-model.js @@ -17,13 +17,6 @@ export default Backbone.Model.extend({ item_ids: undefined }, - /** - * Return true if operation can be done asynchronously. - */ - can_async_op: function(op) { - return _.indexOf(this.attributes.async_ops, op) !== -1; - }, - /** * Add filtering criterion. */ diff --git a/client/galaxy/scripts/mvc/grid/grid-shared.js b/client/galaxy/scripts/mvc/grid/grid-shared.js index a2eebe703a7..34cb89f75f3 100644 --- a/client/galaxy/scripts/mvc/grid/grid-shared.js +++ b/client/galaxy/scripts/mvc/grid/grid-shared.js @@ -10,7 +10,6 @@ var View = Backbone.View.extend({ $.ajax({ url: `${Galaxy.root + this.item}/${this.model.get("action_id")}?${$.param(Galaxy.params)}`, success: function(response) { - response["dict_format"] = true; self.model.set(response); self.render(); } diff --git a/client/galaxy/scripts/mvc/grid/grid-template.js b/client/galaxy/scripts/mvc/grid/grid-template.js index 8f6afcc240c..e5fda7d790f 100644 --- a/client/galaxy/scripts/mvc/grid/grid-template.js +++ b/client/galaxy/scripts/mvc/grid/grid-template.js @@ -25,16 +25,15 @@ export default { }, // template - grid_table: function(options) { - return ( - '
' + - '' + - '' + - '' + - '' + - "
" + - "
" - ); + grid_table: function() { + return ` +
+ + + + +
+
`; }, // template @@ -51,8 +50,7 @@ export default { '
  • Actions
  • ' + '
    '; } - for (var i in options.global_actions) { - var action = options.global_actions[i]; + for (let action of options.global_actions) { tmpl += `
  • ${action.label}
  • `; @@ -91,8 +89,7 @@ export default { } // create header elements - for (var i in options.columns) { - var column = options.columns[i]; + for (let column of options.columns) { if (column.visible) { tmpl += ``; if (column.href) { @@ -115,23 +112,16 @@ export default { body: function(options) { // initialize var tmpl = ""; - var num_rows_rendered = 0; var items_length = options.items.length; // empty grid? - if (items_length == 0) { + if (items_length === 0) { // No results. tmpl += 'No Items'; - num_rows_rendered = 1; } // create rows - for (var i in options.items) { - // encode ids - var item = options.items[i]; - var encoded_id = item.encode_id; - var popupmenu_id = `grid-${i}-popup`; - + for (let item of options.items) { // Tag current tmpl += "`; } // Data columns - for (var j in options.columns) { - var column = options.columns[j]; + for (let column of options.columns) { if (column.visible) { // Nowrap var nowrap = ""; @@ -173,9 +162,9 @@ export default { var id = ""; var cls = ""; if (column.attach_popup) { - id = `grid-${i}-popup`; + id = `grid-${item.encode_id}-popup`; cls = "menubutton"; - if (link != "") { + if (link !== "") { cls += " split"; } cls += " popup"; @@ -186,25 +175,22 @@ export default { // Link if (link) { - if (options.operations.length != 0) { + if (options.operations.length !== 0) { tmpl += `
    `; } - tmpl += `${value}`; - if (options.operations.length != 0) { + tmpl += `${value}`; + if (options.operations.length !== 0) { tmpl += "
    "; } } else { tmpl += `
    `; + item.encode_id + }" for="${item.encode_id}">${value || ""}
    `; } tmpl += ""; } } tmpl += ""; - num_rows_rendered++; } return tmpl; }, @@ -247,7 +233,7 @@ export default { // Second and final pass on min page to add any unused // offset from max to min. - if (max_offset != 0) { + if (max_offset !== 0) { min_page -= max_offset; if (min_page < 1) { min_page = 1; @@ -271,44 +257,36 @@ export default { if (page_index == options.cur_page_num) { tmpl += `${page_index}`; } else { - tmpl += `${ - page_index - }`; + tmpl += `${page_index}`; } } // show last page if (max_page < num_pages) { - tmpl += `...${ - num_pages - }`; + tmpl += `...${num_pages}`; } tmpl += ""; // Show all link - tmpl += - ' | Show All' + - "" + - ""; + tmpl += ` + | Show All + + `; } // Grid operations for multiple items. if (options.show_item_checkboxes) { // start template - tmpl += - "" + - '' + - "" + - '' + - 'For selected items: '; + tmpl += ` + + + + + For selected items: + `; // configure buttons for operations - for (var i in options.operations) { - var operation = options.operations[i]; + for (let operation of options.operations) { if (operation.allow_multiple) { tmpl += `" + ''; - for (i in options.operations) { - var operation = options.operations[i]; + for (let operation of options.operations) { if (operation.global_operation) { tmpl += `${operation.label}`; } @@ -375,8 +352,7 @@ export default { // identify columns with advanced filtering var show_advanced_search_link = false; - for (var i in options.columns) { - var column = options.columns[i]; + for (let column of options.columns) { if (column.filterable == "advanced") { var column_key = column.key; var f_key = filters[column_key]; @@ -397,13 +373,10 @@ export default { // // standard search // - var tmpl = `",'
    ',"
    "].join(""))});t.default={ShedListView:d}}).call(t,i(1),i(2))},312: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(167),r=a(o),l=i(168),d=a(l);i(157);var c=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=s.defaults(this.options||e,this.defaults),this.model=new r.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=s.extend(this.options,e),this.options.categories=this.model.models,this.options.queue=d.default.queueLength();var t=this.templateCategoryList;this.$el.html(t(this.options)),n("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;n("#search_box").autocomplete({source:function(e,i){var s=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:s};n.post(a,o,function(e){console.log(e);var t=d.default.shedParser(e);i(t)})},minLength:3,select:function(i,s){var n=s.item.value,a=(Galaxy.root,t.model.tool_shed,"repository/s/"+t.model.tool_shed+"/r/"+n);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:s.template(['",'",'
    ','",'
    ','','',"","","","","","","<% _.each(categories, function(category) { %>","","",'','',"","<% }); %>","
    NameDescriptionRepositories
    ",'"><%= category.get("name") %>',"<%= category.get("description") %><%= category.get("repositories") %>
    ","
    ","
    "].join(""))});t.default={CategoryView:c}}).call(t,i(1),i(2),i(0))},313: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(167),r=a(o),l=i(168),d=a(l);i(157);var c=e.View.extend({el:"#center",initialize:function(e){this.model=new r.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=s.extend(this.options,e);var t=this.templateCategoryContents;this.$el.html(t({category:this.model.models[0],tool_shed:this.model.tool_shed,queue:d.default.queueLength()})),n("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;n("#search_box").autocomplete({source:function(e,i){var s=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:s};n.post(a,o,function(e){var t=d.default.shedParser(e);i(t)})},minLength:3,select:function(i,s){var n=s.item.value,a="repository/s/"+t.model.tool_shed+"/r/"+n;e.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateCategoryContents:s.template(['",'
    ','
    Repositories in <%= category.get("name") %>
    ','',"
    ",'
    ','",'
    ','','',"",'','',"",'',"","",'<% _.each(category.get("repositories"), function(repository) { %>',"","","","","","","<% }); %>","
    OwnerNameSynopsisType
    <%= repository.owner %>",'","<%= repository.description %><%= repository.type %>
    ","
    ","
    "].join(""))});t.default={Category:c}}).call(t,i(1),i(2),i(0))},314: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(167),r=a(o),l=i(198),d=(a(l),i(3)),c=a(d),h=i(9),u=a(h),p=i(20),_=a(p),f=i(168),g=a(f),m=e.View.extend({el:"#center",initialize:function(e){this.options=s.defaults(this.options||{},this.defaults),this.model=new r.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,i=this.model.models[0];this.options={repository:i.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=i.get("tool_dependencies"),this.options.shed_tool_conf=this.templateShedToolConf({stc_html:i.get("shed_conf")}),this.options.panel_section_dict=i.get("panel_section_dict"),this.options.api_url=Galaxy.root+"api/tool_shed_repositories/install?async=True",this.options=s.extend(this.options,e),this.$el.html(t(this.options)),this.checkInstalled(this.options.current_metadata),this.bindEvents(),n("#center").css("overflow","auto")},bindEvents:function(){var e=this;n("#changeset").on("change",function(){e.options.current_changeset=n("#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()}),n("#tool_panel_section_select").on("change",function(){e.tpsSelection()}),n("#install_repository").on("click",function(t){n("#repository_installation");t.preventDefault();var i={};i.repositories=JSON.stringify([[n("#install_repository").attr("data-tsrid"),n("#changeset").find("option:selected").val()]]),i.tool_shed_repository_ids=JSON.stringify([n("#install_repository").attr("data-tsrid")]),i.tool_shed_url=e.model.tool_shed_url,i.install_tool_dependencies=n("#install_tool_dependencies").val(),i.install_repository_dependencies=n("#install_repository_dependencies").val(),i.install_resolver_dependencies=n("#install_resolver_dependencies").val();e.panelSelect(i);i.tool_panel_section=JSON.stringify(e.panelSelect(i)),i.shed_tool_conf=n("select[name='shed_tool_conf']").find("option:selected").val(),i.changeset=n("#changeset").find("option:selected").val();var s=n("#repository_installation").attr("action");e.prepareInstall(i,s)}),n("#queue_install").on("click",function(t){e.options.current_changeset=n("#changeset").find("option:selected").text(),e.options.current_metadata=e.options.repository.metadata[e.options.current_changeset];var i=(e.options.current_changeset,{});s.each(Object.keys(e.options.current_metadata),function(t){i[t]||(i[t]=e.options.current_metadata[t])}),i.install_tool_dependencies=n("#install_tool_dependencies").val(),i.install_repository_dependencies=n("#install_repository_dependencies").val(),i.install_resolver_dependencies=n("#install_resolver_dependencies").val(),i.tool_panel_section=JSON.stringify(e.panelSelect({})),i.shed_tool_conf=n("select[name='shed_tool_conf']").find("option:selected").val(),i.tool_shed_url=e.model.tool_shed_url,"/"==i.tool_shed_url.substr(-1)&&(i.tool_shed_url=i.tool_shed_url.substr(0,i.tool_shed_url.length-1)),g.default.addToQueue(i),e.checkInstalled(i)}),n(".tool_panel_section_picker").on("change",function(){n(this).find("option:selected").val()==n("#tool_panel_section_select").find("option:selected").val()?n(this).attr("default","active"):n(this).removeAttr("default")}),n(function(){n("#repository_dependencies").jstree()}),n(".tool_form").on("click",function(){var t=n(this).attr("data-guid"),i=(n(this).attr("data-clean"),n(this).attr("data-name")),s=n(this).attr("data-desc"),a=e.model.tool_shed_url,o=n("#repository_details").attr("data-tsrid"),r=n("#changeset").find("option:selected").val(),l=Galaxy.root+"api/tool_shed/tool_json",d={guid:t,tool_shed_url:a,tsr_id:o,changeset:r};n.get(l,d,function(e){e.cls="ui-portlet-plain";var t=new _.default(e);c.default.deepeach(e.inputs,function(e){e.type&&-1!=["data","data_collection"].indexOf(e.type)&&(e.type="hidden",e.info="Data input '"+e.name+"' ("+c.default.textify(e.extensions)+")")});var n=new u.default.View,a=""+i+" "+s;n.show({closing_events:!0,title:a,body:t.$el,buttons:{Close:function(){n.hide()}}})})})},checkInstalled:function(e){var t=this,i={name:e.name,owner:e.owner},s=!1;t.repoQueued(e);n.get(Galaxy.root+"api/tool_shed_repositories",i,function(i){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:s.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:s.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:s.template(['
    Shed tool configuration file:
    ','
    ','
    ',"<%= stc_html %>",'
    Select the file whose tool_path setting you want used for installing repositories.
    ',"
    ","
    "].join("")),templateToolDependency:s.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:s.template(['
    ','
    ','','','
    ',"Add a new tool panel section to contain the installed tools (optional).","
    ","
    ","
    "].join("")),templateGlobalSectionSelect:s.template(['
    ','
    Tool Panel Section
    ','
    ','
    ','",'','
    ',"Select an existing tool panel section to contain the installed tools (optional).","
    ","
    ","
    ","
    "].join("")),templateToolSectionCreate:s.template(['
    ','','',"
    "].join("")),templateToolSectionSelect:s.template(['
    ','",'','
    ',"
    "].join("")),templatePanelSelectOptions:s.template(["<% _.each(sections, function(section) { %>",'',"<% }); %>"].join(""))});t.default={RepoDetails:m}}).call(t,i(1),i(2),i(0))},315: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(167),r=a(o),l=i(168),d=a(l),c=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new r.default.RepoQueue,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,i=t.templateRepoQueue,n=t.model.models;t.$el.html(i({title:"Repository Installation Queue",repositories:n,queue:d.default.queueLength()})),s("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t=this;s(".install_one").on("click",function(){var e=t.loadFromQueue(s(this).attr("data-repokey"));t.installFromQueue(e,s(this).attr("data-repokey"))}),s(".remove_one").on("click",function(){var e=s(this).attr("data-repokey"),t=JSON.parse(localStorage.repositories);if(t.hasOwnProperty(e)){var i=t[e].repository.id;delete t[e],s("#queued_repository_"+i).remove()}localStorage.repositories=JSON.stringify(t)}),s("#clear_queue").on("click",function(){localStorage.repositories="{}"}),s("#from_workflow").on("click",function(){e.history.navigate("workflows",{trigger:!0,replace:!0})})},installFromQueue:function(t,i){var n=Object();n.install_tool_dependencies=t.install_tool_dependencies,n.install_repository_dependencies=t.install_repository_dependencies,n.install_resolver_dependencies=t.install_resolver_dependencies,n.tool_panel_section=t.tool_panel_section,n.shed_tool_conf=t.shed_tool_conf,n.repositories=JSON.stringify([[t.repository.id,t.changeset_revision]]),n.tool_shed_repository_ids=JSON.stringify([t.repository.id]),n.tool_shed_url=i.split("|")[0],n.changeset=t.changeset_revision;var a=Galaxy.root+"api/tool_shed_repositories/install?async=True";if(s("#queued_repository_"+t.repository.id).remove(),localStorage.repositories){void 0===i&&(i=d.default.queueKey(t));var o=JSON.parse(localStorage.repositories);o.hasOwnProperty(i)&&(delete o[i],localStorage.repositories=JSON.stringify(o))}s.post(a,n,function(t){var i=JSON.parse(t),n=i.repositories,a="status/r/"+n.join("|");s.post(Galaxy.root+"admin_toolshed/install_repositories",i,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:n.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:c}}).call(t,i(1),i(0),i(2))},316: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(167),r=a(o),l=i(168),d=a(l),c=e.View.extend({el:"#center",initialize:function(e){this.options=s.defaults(this.options||[{}],e,this.defaults),this.model=new r.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"],i=!0;s.some(e.model.models,function(e){repo_id=e.get("id");var s=e.get("status").toLowerCase();if(-1===t.indexOf(s))return i=!1,!0}),i?clearInterval(e.timer):e.model.fetch()},2e3,this)},close:function(){clearInterval(this.timer)},render:function(e){this.options=s.extend(this.options,e);var t=this.templateRepoStatus;this.$el.html(t({title:"Repository Status",repositories:this.model.models,queue:d.default.queueLength()})),n("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateRepoStatus:s.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','',"","",'',"<% _.each(repositories, function(repository) { %>","","","","","","","","<% }); %>","",'',"
    NameDescriptionOwnerRevisionInstallation Status
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    "].join(""))});t.default={RepoStatus:c}}).call(t,i(1),i(2),i(0))},317: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(167),r=a(o),l=i(168),d=a(l),c=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new r.default.WorkflowTools,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,i=t.templateWorkflows,n=t.model.models;t.$el.html(i({title:"Workflows Missing Tools",workflows:n,queue:d.default.queueLength()})),s("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t,i=this;s(".show_wf_repo").on("click",function(){var i=s(this).attr("data-toolids"),n=s(this).attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:i};s.get(a,o,function(i){t=i.repository.id;var s="repository/s/"+n.replace(/:/g,"%3a").replace(/\//g,"%2f")+"/r/"+i.repository.id;e.history.navigate(s,{trigger:!0,replace:!0})})}),s(".queue_wf_repo").on("click",function(){var e=s(this),i=e.attr("data-toolids"),n=e.attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:i};s.get(a,o,function(i){t=i.repository.id,o={tool_shed_url:n,repository_id:t},s.get(a,o,function(t){var i=Object.keys(t.repository.metadata),s=i[0],a=t.repository.metadata[s];a.tool_shed_url=n,d.default.addToQueue(a),e.remove()})})}),s("#from_workflow").on("click",i.loadWorkflows)},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateWorkflows:n.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','','',"","","","<% _.each(workflows, function(workflow) { %>","",'",'",'','','','","","<% }); %>","",""].join(""))});t.default={Workflows:c}}).call(t,i(1),i(0),i(2))},4: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}),t.Drilldown=t.Slider=t.Select=t.Radio=t.RadioButton=t.Checkbox=t.ButtonLink=t.ButtonMenu=t.ButtonCheck=t.ButtonIcon=t.Button=t.Upload=t.Hidden=t.Input=t.UnescapedMessage=t.Message=t.Label=void 0;var o=i(22),r=a(o),l=i(46),d=a(l),c=i(23),h=a(c),u=i(47),p=a(u),_=i(12),f=a(_),g=i(9),m=a(g),v=t.Label=e.View.extend({tagName:"label",initialize:function(t){this.model=t&&t.model||new e.Model(t),this.tagName=t.tagName||this.tagName,this.setElement(s("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},title:function(e){this.model.set("title",e)},value:function(){return this.model.get("title")},render:function(){return this.$el.removeClass().addClass("ui-label").addClass(this.model.get("cls")).html(this.model.get("title")),this}}),b=t.Message=e.View.extend({initialize:function(t){this.model=t&&t.model||new e.Model({message:null,status:"info",cls:"",persistent:!1,fade:!0}).set(t),this.listenTo(this.model,"change",this.render,this),this.render()},update:function(e){this.model.set(e)},render:function(){this.$el.removeClass().addClass("ui-message").addClass(this.model.get("cls"));var e=this.model.get("status");if(this.model.get("large")?this.$el.addClass(("success"==e&&"done"||"danger"==e&&"error"||e)+"messagelarge"):this.$el.addClass("alert").addClass("alert-"+e),this.model.get("message")){if(this.$el.html(this.messageForDisplay()),this.$el[this.model.get("fade")?"fadeIn":"show"](),this.timeout&&window.clearTimeout(this.timeout),!this.model.get("persistent")){var t=this;this.timeout=window.setTimeout(function(){t.model.set("message","")},3e3)}}else this.$el.fadeOut();return this},messageForDisplay:function(){return n.escape(this.model.get("message"))}}),y=t.UnescapedMessage=b.extend({messageForDisplay:function(){return this.model.get("message")}}),w=t.Input=e.View.extend({initialize:function(t){this.model=t&&t.model||new e.Model({type:"text",placeholder:"",disabled:!1,readonly:!1,visible:!0,cls:"",area:!1,color:null,style:null}).set(t),this.tagName=this.model.get("area")?"textarea":"input",this.setElement(s("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},events:{input:"_onchange"},value:function(e){return void 0!==e&&this.model.set("value","string"==typeof e?e:""),this.model.get("value")},render:function(){var e=this;this.$el.removeClass().addClass("ui-"+this.tagName).addClass(this.model.get("cls")).addClass(this.model.get("style")).attr("id",this.model.id).attr("type",this.model.get("type")).attr("placeholder",this.model.get("placeholder")).css("color",this.model.get("color")||"").css("border-color",this.model.get("color")||"");var t=this.model.get("datalist");return s.isArray(t)&&t.length>0&&this.$el.autocomplete({source:function(t,i){i(e.model.get("datalist"))},change:function(){e._onchange()}}),this.model.get("value")!==this.$el.val()&&this.$el.val(this.model.get("value")),n.each(["readonly","disabled"],function(t){e.model.get(t)?e.$el.attr(t,!0):e.$el.removeAttr(t)}),this.$el[this.model.get("visible")?"show":"hide"](),this},_onchange:function(){this.value(this.$el.val()),this.model.get("onchange")&&this.model.get("onchange")(this.model.get("value"))}}),x=t.Hidden=e.View.extend({initialize:function(t){this.model=t&&t.model||new e.Model(t),this.setElement(s("
    ").append(this.$info=s("
    ")).append(this.$hidden=s("
    "))),this.listenTo(this.model,"change",this.render,this),this.render()},value:function(e){return void 0!==e&&this.model.set("value",e),this.model.get("value")},render:function(){return this.$el.attr("id",this.model.id),this.$hidden.val(this.model.get("value")),this.model.get("info")?this.$info.show().text(this.model.get("info")):this.$info.hide(),this}}),k=t.Upload=e.View.extend({initialize:function(t){var i=this;this.model=t&&t.model||new e.Model(t),this.setElement(s("
    ").append(this.$info=s("
    ")).append(this.$file=s("").attr("type","file").addClass("ui-margin-bottom")).append(this.$text=s("','
    ',"<% } %>","","","","","",""].join(""))},templateRowFile:function(){return i.template(['',"",'","",'','','','',"","",""].join(""))},templateRowDeletedFile:function(){return i.template(['',"","",'","","","","","","",""].join(""))},templateRowDeletedFolder:function(){return i.template(['',"","",'","","","","","","",""].join(""))}});t.default={FolderRowView:h}}).call(t,n(2),n(1),n(0))},300: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(7),o=r(a),s=n(13),l=r(s),c=n(301),d=r(c),u=n(1),h=r(u),f=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=h.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=h.default.extend(this.options,e),this.setElement("#libraries_element");var t=this.templateLibraryList(),n=null,r=null,a=function(e){return!0===e.get("public")};if(i(".tooltip").hide(),void 0!==e&&(r=void 0!==e.models?e.models:null),null!==this.collection&&null===r)this.sortLibraries(),n=Galaxy.libraries.preferences.get("with_deleted")?this.collection.models:this.collection.where({deleted:!1}),Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a));else if(null!==r){if(Galaxy.libraries.preferences.get("with_deleted"))n=r;else{var o=function(e){return!1===e.get("deleted")};n=h.default.filter(r,o)}Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a))}else n=[];(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_libraries_count=n.length;var s=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&&sthis.options.total_libraries_count+Galaxy.libraries.preferences.get("library_page_size")&&(n=[]),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(n)):(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)),i("#center [data-toggle]").tooltip(),i("#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{ %>",'
    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" />
    • ',"
    ","
    folder",'<%= _.escape(content_item.get("update_time")) %>',"","<% if(edit_mode) { %>",'",'","<% } else if (!edit_mode){%>",'",'','","","<% } %>","
    ",'',"','',"",'/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">','","","<% } %>","
    ",'',"','<%- 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")) %>',"<% } %>","",'','","
    ",'',"','<%- content_item.get("name") %>',"",'<%- content_item.get("description") %>',"","folder","",'<%= _.escape(content_item.get("update_time")) %>',"",'','","
    ',"",'",'',' ','',"",'',"","
    ','',"name","",'',"descriptionsynopsis
    ","<% }%>","
    "].join(""))}});t.default={LibraryListView:f}}).call(t,n(2),n(0))},301:function(e,t,n){"use strict";(function(e,i,r){Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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){i(".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,n=this.$el.find(".input_library_name").val();if(void 0!==n&&n!==e.get("name")){if(!(n.length>2))return void o.default.warning("Library name has to be at least 3 characters long.");e.set("name",n),t=!0}var i=this.$el.find(".input_library_description").val();void 0!==i&&i!==e.get("description")&&(e.set("description",i),t=!0);var r=this.$el.find(".input_library_synopsis").val();if(void 0!==r&&r!==e.get("synopsis")&&(e.set("synopsis",r),t=!0),t){var a=this;e.save(null,{patch:!0,success:function(e){a.edit_mode=!1,a.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")?(i(".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 r.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: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(3),s=a(o),l=n(7),c=a(l),d=n(13),u=a(d),h=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:(0,s.default)("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 u.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(),c.default.success("Library created.")},error:function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occured.")}})}else c.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:h}}).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(4),d=o(c),u=n(7),h=o(u),f=n(13),p=o(f),_=n(10),g=o(_);n(127);var m=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:(0,l.default)("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 p.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(),h.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?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")}})}else h.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)h.default.info("You must select some datasets first.");else{var e=this;this.histories=new p.default.GalaxyHistories,this.histories.fetch().done(function(){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:(0,l.default)("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?h.default.error(t.responseJSON.err_msg):h.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){h.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 p.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 p.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(),h.default.info("Your download will begin soon.")}else h.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new p.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:(0,l.default)("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?h.default.error(t.responseJSON.err_msg):h.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:(0,l.default)("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;d.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;d--){var u=l[d].trim();0!==u.length&&c.push(u)}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 h.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"),d=this.select_extension.value(),u=this.select_genome.value(),f=this.modal.$el.find(".tag-files").is(":checked"),p=a[0].type,_=[];if(a.length<1)h.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:d,dbkey:u,tag_using_filenames:f})}else if("file"===p){var m=t.source+"_file";this.chainCallImportingUserdirFiles({paths:_,file_type:d,dbkey:u,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,tag_using_filenames:f})}}},fetchAndDisplayHistoryContents:function(e){var t=new p.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?h.default.error(t.responseJSON.err_msg):h.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)h.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 p.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?h.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?h.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;s--){var c=new p.default.Item({id:e[s]});o.push(c)}for(var s=t.length-1;s>=0;s--){var d=new p.default.FolderAsModel({id:t[s]});o.push(d)}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 p.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.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:(0,l.default)("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(),h.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:m}}).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(3),o=r(a),s=n(17),l=r(s),c=n(18),d=r(c),u=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 l.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:(0,o.default)("Configured Galaxy Tool Sheds"),tool_sheds:this.model.models,queue:d.default.queueLength()}))},reDraw:function(e){this.$el.empty(),this.render(e)},templateToolshedList:i.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','
    ','',"<% _.each(tool_sheds, function(shed) { %>",'',"","","<% }); %>","
    ",'","
    ","
    ",'
    ',"
    "].join(""))});t.default={ShedListView:u}}).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(4)),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).sort(function(e,t){return parseInt(e.split(":")[0]-t.split(":")[0])}),o={},s=this.options.repository.metadata;a.forEach(function(e){o[e]=s[e]}),this.options.repository.metadata=o,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({stc_html: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(e.options)}),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:
    ','
    ','
    ',"<%= stc_html %>",'
    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(3),s=a(o),l=n(17),c=a(l),d=n(18),u=a(d),h=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new c.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:(0,s.default)("Repository Installation Queue"),repositories:r,queue:u.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=u.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:h}}).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(3),s=a(o),l=n(17),c=a(l),d=n(18),u=a(d),h=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||[{}],e,this.defaults),this.model=new c.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:(0,s.default)("Repository Status"),repositories:this.model.models,queue:u.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:h}}).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(3),s=a(o),l=n(17),c=a(l),d=n(18),u=a(d),h=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new c.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:(0,s.default)("Workflows Missing Tools"),workflows:r,queue:u.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,u.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:h}}).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 +f=!0,p=0,g=o.data.nodes.length;pe.inArray(o.data.nodes[p],v.children)&&(_-=1)),!(f=f&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(m,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[p]):o.data.nodes[p],d,_,{dnd:!0,ref:w.get_node(x.parent()),pos:M,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(n=w.last_error());break}if(f)return"i"===M&&x.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(i=setTimeout(function(e,t){return function(){e.open_node(t)}}(w,x),w.settings.dnd.open_timeout)),t={ins:w,par:d,pos:"i"!==M||"last"!==y||0!==u||w.is_loaded(b)?u:"last"},r.css({left:s+"px",top:l+"px"}).show(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),n={},h=!0,!1}),!0===h))return}else{for(f=!0,p=0,g=o.data.nodes.length;p").html(r).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(n){if("touchmove"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_down){if(!t.is_drag){if(!(Math.abs(n.pageX-t.init_x)>(t.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)||Math.abs(n.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",n)}var i=!1,r=!1,a=!1,o=!1,s=!1,l=!1,c=!1,d=!1,u=!1,h=!1;return t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1,e(e(n.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 i=e(this),r=i.offset();if(this.scrollHeight>this.offsetHeight&&(r.top+i.height()-n.pageYthis.offsetWidth&&(r.left+i.width()-n.pageXo&&n.pageY-co&&o-(n.pageY-c)l&&n.pageX-dl&&l-(n.pageX-d)a&&(u=a-50),s&&h+t.helper_w>s&&(h=s-(t.helper_w+2)),t.helper.css({left:h+"px",top:u+"px"})),e.vakata.dnd._trigger("move",n),!1}},stop:function(n){if("touchend"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_drag)e.vakata.dnd._trigger("stop",n);else if("touchend"===n.type&&n.target===t.target){var i=setTimeout(function(){e(n.target).click()},100);e(n.target).one("click",function(){i&&clearTimeout(i)})}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,n){this.bind=function(){n.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,n){var i,r,a=this._data.search.res,o=[],s=e();if(a&&a.length&&(this._data.search.dom=e(this.element[0].querySelectorAll("#"+e.map(a,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(i=0,r=a.length;i32&&(n.fuzzy=!1),n.fuzzy&&(i=1<=p;l--)if(_=r[t.charAt(l-1)],m[l]=0===o?(m[l+1]<<1|1)&_:(m[l+1]<<1|1)&_|(f[l+1]|f[l])<<1|1|f[l+1],m[l]&i&&(x=a(o,l-1))<=y){if(y=x,b=l-1,k.push(b),!(b>s))break;p=Math.max(1,2*s-b)}if(a(o+1,s)>y)break;f=m}return{isMatch:b>=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,n){this.bind=function(){n.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,n){var i,r;if((t=this.get_node(t))&&t.children&&t.children.length&&(t.children.sort(e.proxy(this.settings.sort,this)),n))for(i=0,r=t.children_d.length;it.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(n,i){i.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(n,i){this.init=function(e,n){var r,a;if(n&&n.types&&n.types.default)for(r in n.types)if("default"!==r&&"#"!==r&&n.types.hasOwnProperty(r))for(a in n.types.default)n.types.default.hasOwnProperty(a)&&n.types[r][a]===t&&(n.types[r][a]=n.types.default[a]);i.init.call(this,e,n),this._model.data["#"].type="#"},this.refresh=function(e,t){i.refresh.call(this,e,t),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",e.proxy(function(e,n){var i,r,a=this._model.data,o=n.nodes,s=this.settings.types,l="default";for(i=0,r=o.length;i .jstree-ocl",e.proxy(function(t){t.stopImmediatePropagation();var n=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(n).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(),n.teardown.call(this)},this.redraw_node=function(t,i,r){if(t=n.redraw_node.call(this,t,i,r)){var a=p.cloneNode(!0);-1!==e.inArray(t.id,this._data.core.selected)&&(a.className+=" jstree-wholerow-clicked"),t.insertBefore(a,t.childNodes[0])}return t}}}})},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=e.Model.extend({urlRoot:Galaxy.root+"api/groups"}),i=e.Collection.extend({url:Galaxy.root+"api/groups",model:n});t.default={Group:n,Groups:i}}).call(t,n(2))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}function r(t){Galaxy.user||(Galaxy.user=new I.default.User(t.user_json)),Galaxy.masthead||(Galaxy.masthead=new N.default.View(t),Galaxy.modal=new O.default.View,e("#masthead").replaceWith(Galaxy.masthead.render().$el))}function a(e){new j.default.GalaxyApp(e)}function o(e){new y.default.GalaxyApp(e)}function s(e){new w.default.GalaxyApp(e)}function l(e){new _.default(e)}function c(e){new T.default.GalaxyApp(e)}function d(t){e("#toggle-deleted").modeButton({initialMode:t.initialModeDeleted,modes:[{mode:"showing_deleted",html:(0,f.default)("Exclude deleted")},{mode:"not_showing_deleted",html:(0,f.default)("Include deleted")}]}),e("#toggle-hidden").modeButton({initialMode:t.initialModeHidden,modes:[{mode:"showing_hidden",html:(0,f.default)("Exclude hidden")},{mode:"not_showing_hidden",html:(0,f.default)("Include hidden")}]}),e("#switch").click(function(){var e=Galaxy.currHistoryPanel||window.top.Galaxy&&window.top.Galaxy.currHistoryPanel?window.top.Galaxy.currHistoryPanel:null;e?e.switchToHistory("${ history[ 'id' ] }"):window.location="${ switch_to_url }"}),t.hasMasthead&&e("#center").addClass("flex-vertical-container");var n=t.userIsOwner?X.default.HistoryViewEdit:J.default.HistoryView,i=new H.default.History(t.historyJSON);e("#import").click(function(){(0,te.default)(i,{useImport:!0,allDatasets:"showing_deleted"===e("#toggle-deleted").modeButton("getMode").mode}).done(function(){window===window.parent?window.location=Galaxy.root:Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.loadCurrentHistory()})});var r=new n({el:e("#history-"+t.historyJSON.id),className:n.prototype.className+" wide",$scrollContainer:t.hasMasthead?function(){return this.$el.parent()}:void 0,model:i,show_deleted:t.showDeletedJson,show_hidden:t.showHiddenJson,purgeAllowed:t.allow_user_dataset_purge});r.trigger("loading"),i.fetchContents({silent:!0}).fail(function(){alert("Galaxy history failed to load")}).done(function(){r.trigger("loading-done"),r.render()}),e("#toggle-deleted").on("click",function(){r.toggleShowDeleted()}),e("#toggle-hidden").on("click",function(){r.toggleShowHidden()})}function u(t){var n=new H.default.HistoryCollection([],{includeDeleted:t.includingDeleted,order:t.order,limitOnFirstFetch:t.limit,limitPerFetch:t.limit,currentHistoryId:t.current_history_id}),i=new q.default.MultiPanelColumns({el:e("#center").get(0),histories:n});n.fetchFirst({silent:!0}).done(function(){i.createColumns(),i.render(0)})}Object.defineProperty(t,"__esModule",{value:!0}),t.bundleEntries=void 0,t.mastheadEntry=r,t.adminToolshedEntry=a,t.tracksterEntry=o,t.circsterEntry=s,t.workflowEntry=l,t.libraryEntry=c,t.historyEntry=d,t.multiHistoryEntry=u;var h=n(3),f=i(h),p=n(64),g=i(p),m=n(302),_=i(m),v=n(116),y=i(v),b=n(311),w=i(b),x=n(313),k=i(x),M=n(314),C=i(M),S=n(315),T=i(S),E=n(325),j=i(E),A=n(67),N=i(A),L=n(66),I=i(L),D=n(9),O=i(D),P=n(333),W=i(P),R=n(23),$=i(R),z=n(30),H=i(z),V=n(335),Y=i(V),F=n(16),G=i(F),U=n(341),q=i(U),B=n(57),J=i(B),Q=n(71),X=i(Q),K=n(343),Z=i(K),ee=n(55),te=i(ee),ne=n(72),ie=i(ne),re=n(37),ae=i(re),oe=n(65),se=i(oe),le=n(344),ce=i(le),de=n(347),ue=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(de),he=n(348),fe=i(he);window.Galaxy&&void 0===window.Galaxy.debug&&(0,se.default)(window.Galaxy,"GalaxyApp");var pe=t.bundleEntries={library:c,masthead:r,workflow:l,trackster:o,circster:s,adminToolshed:a,pages:W.default,phyloviz:k.default.PhylovizView,createTabularDatasetChunkedView:$.default.createTabularDatasetChunkedView,multiHistory:u,history:d,History:H.default.History,HistoryContents:G.default.HistoryContents,SweepsterVisualization:C.default.SweepsterVisualization,SweepsterVisualizationView:C.default.SweepsterVisualizationView,HistoryCopyDialog:te.default,HistoryViewAnnotated:Z.default,Trackster:y.default,StructureView:Y.default,HDAListItemEdit:ie.default,HDAModel:ae.default,GalaxyApp:g.default,LegacyGridView:ce.default,run_stats:ue,ToolshedGroups:fe.default};window.bundleEntries=pe}).call(t,n(0))},function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}function o(t){var n=e("#galaxy_tools").contents();if(0===n.length&&(n=e(document),e(this).removeClass("search_active"),n.find(".toolTitle").removeClass("search_match"),n.find(".toolSectionBody").hide(),n.find(".toolTitle").show(),n.find(".toolPanelLabel").show(),n.find(".toolSectionWrapper").each(function(){"recently_used_wrapper"!==e(this).attr("id")?e(this).show():e(this).hasClass("user_pref_visible")&&e(this).show()}),n.find("#search-no-results").hide(),n.find("#search-spinner").hide(),t)){n.find("#tool-search-query").val("search tools")}}function s(t,n){var i=y.default[n];if(i){var r=e(' ').addClass(i);t.before(r)}}Object.defineProperty(t,"__esModule",{value:!0});var l=n(3),c=a(l),d=n(5),u=a(d),h=n(303),f=a(h),p=n(304),g=a(p),m=n(305),_=a(m),v=n(94),y=a(v),b=n(310),w=a(b),x=n(6),k=a(x),M=n(112),C=a(M),S=n(7);!function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e}(S);n(15),window.workflow_globals=window.workflow_globals||{},t.default=i.View.extend({initialize:function(t){function n(){var t=e('

    ');window.show_modal("Save As a New Workflow",t,{OK:function(){var t=e("#workflow_rename").val().length>0?e("#workflow_rename").val():"SavedAs_"+l.workflow.name,n=e("#wf_annotation").val().length>0?e("#wf_annotation").val():"";e.ajax({url:l.urls.workflow_save_as,type:"POST",data:{workflow_name:t,workflow_annotation:n,workflow_data:function(){return JSON.stringify(l.workflow.to_simple())}}}).done(function(e){window.onbeforeunload=void 0,window.location=Galaxy.root+"workflow/editor?id="+e,hide_modal()}).fail(function(){hide_modal(),alert("Saving this workflow failed. Please contact this site's administrator.")})},Cancel:hide_modal})}function i(){l.workflow.layout(),l.workflow.fit_canvas_to_nodes(),l.scroll_to_nodes(),l.canvas_manager.draw_overview()}function a(){e.jStorage.set("overview-off",!1),e("#overview-border").css("right","0px"),e("#close-viewport").css("background-position","0px 0px")}function s(){e.jStorage.set("overview-off",!0),e("#overview-border").css("right","20000px"),e("#close-viewport").css("background-position","12px 0px")}var l=window.workflow_globals.app=this;this.options=t,this.urls=t&&t.urls||{};var c=function(){if(l.workflow.check_changes_in_active_form(),workflow&&l.workflow.has_changes){var e=function(){window.onbeforeunload=void 0,window.document.location=l.urls.workflow_index};window.show_modal("Close workflow editor","There are unsaved changes to your workflow which will be lost.",{Cancel:hide_modal,"Save Changes":function(){d(null,e)}},{"Don't Save":e})}else window.document.location=l.urls.workflow_index},d=function(t,n){if(show_message("Saving workflow","progress"),l.workflow.check_changes_in_active_form(),!l.workflow.has_changes)return hide_modal(),void(n&&n());l.workflow.rectify_workflow_outputs(),u.default.request({url:Galaxy.root+"api/workflows/"+l.options.id,type:"PUT",data:{workflow:l.workflow.to_simple()},success:function(t){var i=e("
    ").text(t.message);if(t.errors){i.addClass("warningmark");var r=e("
    " style="display:none;" data-id="<%- library.get("id") %>">',"<% if(!edit_mode) { %>",'<% if(library.get("deleted")) { %>','',"<% } else { %>",'',"<% } %>",'<% if(library.get("description")) { %>','<% if( (library.get("description")).length> 80 ) { %>','',"<% } else { %>",'',"<% } %>","<% } else { %>","","<% } %>",'<% if(library.get("synopsis")) { %>','<% if( (library.get("synopsis")).length> 120 ) { %>','',"<% } else { %>",'',"<% } %>","<% } else { %>","","<% } %>","<% } else if(edit_mode){ %>",'','','',"<% } %>",'",""].join(""))}});t.default={LibraryRowView:s}}).call(t,n(2),n(0),n(1))},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(3),s=a(o),l=n(7),c=a(l),d=n(18),u=a(d),h=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:(0,s.default)("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 u.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(),c.default.success("Library created.")},error:function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occured.")}})}else c.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:h}}).call(t,n(2),n(1),n(0))},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(5),d=o(c),u=n(7),h=o(u),f=n(18),p=o(f),g=n(12),m=o(g),_=n(28),v=o(_),y=n(73),b=o(y),w=n(74),x=o(w),k=n(20),M=o(k);n(139);var C=e.View.extend({el:"#center",events:{"click .toolbtn-create-folder":"createFolderFromModal","click .toolbtn-bulk-import":"importToHistoryModal","click .include-deleted-datasets-chk":"checkIncludeDeleted","click .toolbtn-bulk-delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page-size-prompt":"showPageSizePrompt","click .toolbtn-collection-import":"showCollectionSelect"},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){var t=this;e.preventDefault(),e.stopPropagation();var n=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Create New Folder"),body:n(),buttons:{Create:function(){t.createNewFolderEvent()},Close:function(){Galaxy.modal.hide()}}})},createNewFolderEvent:function(){var t=this.serializeNewFolder();if(this.validateNewFolder(t)){var n,i=new p.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(),h.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?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")}})}else h.default.error("Folder's name is missing.");return!1},serializeNewFolder:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val()}},validateNewFolder:function(e){return""!==e.name},importToHistoryModal:function(e){var t=this;e.preventDefault();var n=this.findCheckedRows(),i=this.templateImportIntoHistoryModal();if(0===n.length)h.default.info("You must select some datasets first.");else{this.fetchUserHistories().done(function(){t.modal=Galaxy.modal,t.modal.show({closing_events:!0,title:(0,l.default)("Import into History"),body:i({histories:t.histories.models}),buttons:{Import:function(){t.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")})}},fetchUserHistories:function(){return this.histories=new p.default.GalaxyHistories,this.histories.fetch()},importAllIntoHistory:function(){var e=this;this.modal.disableButton("Import");var t=this.modal.$("input[name=history_name]").val();if(""!==t)this.createNewHistory(t).done(function(t){e.processImportToHistory(t.id,t.name)}).fail(function(e,t,n){h.default.error("An error occurred.")}).always(function(){e.modal.enableButton("Import")});else{var n=r("select[name=import_to_history] option:selected").val(),i=r("select[name=import_to_history] option:selected").text();this.processImportToHistory(n,i),this.modal.enableButton("Import")}},createNewHistory:function(e){return r.post(Galaxy.root+"api/histories",{name:e})},processImportToHistory:function(e,t){for(var n=this.findCheckedItems(),i=[],r=n.dataset_ids.length-1;r>=0;r--){var o=n.dataset_ids[r],s=new p.default.HistoryItem;s.url=s.urlRoot+e+"/contents",s.content=o,s.source="library",i.push(s)}for(var l=n.folder_ids.length-1;l>=0;l--){var c=n.folder_ids[l],s=new p.default.HistoryItem;s.url=s.urlRoot+e+"/contents",s.content=c,s.source="library_folder",i.push(s)}this.initChainCallControl({length:i.length,action:"to_history",history_name:t}),a.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(i,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){var t=this.findCheckedItems(),n=Galaxy.root+"api/libraries/datasets/download/"+e,i={ld_ids:t.dataset_ids,folder_ids:t.folder_ids};this.processDownload(n,i,"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(),h.default.info("Your download will begin soon.")}else h.default.error("An error occurred.")},addFilesFromHistoryModal:function(){var e=this;this.histories=new p.default.GalaxyHistories,this.histories.fetch().done(function(){e.modal=Galaxy.modal;var t=e.templateAddFilesFromHistory();e.modal.show({closing_events:!0,title:(0,l.default)("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?h.default.error(t.responseJSON.err_msg):h.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:(0,l.default)("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;d.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;d--){var u=l[d].trim();0!==u.length&&c.push(u)}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 h.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"),d=this.select_extension.value(),u=this.select_genome.value(),f=this.modal.$el.find(".tag-files").is(":checked"),p=a[0].type,g=[];if(a.length<1)h.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var m=a.length-1;m>=0;m--)void 0!==a[m].li_attr.full_path&&g.push(a[m].li_attr.full_path);if(this.initChainCallControl({length:g.length,action:"adding_datasets"}),"folder"===p){var _=t.source+"_folder";this.chainCallImportingFolders({paths:g,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:c,source:_,file_type:d,dbkey:u,tag_using_filenames:f})}else if("file"===p){var _=t.source+"_file";this.chainCallImportingUserdirFiles({paths:g,file_type:d,dbkey:u,link_data:s,space_to_tab:l,to_posix_lines:c,source:_,tag_using_filenames:f})}}},fetchAndDisplayHistoryContents:function(e){var t=this;new p.default.HistoryContents({id:e}).fetch({success:function(n){var i=t.templateHistoryContents();t.histories.get(e).set({contents:n}),t.modal.$el.find(".library_selected_history_content").html(i({history_contents:n.models.reverse()})),t.modal.$el.find(".history-import-select-all").bind("click",function(){r(".library_selected_history_content [type=checkbox]").prop("checked",!0)}),t.modal.$el.find(".history-import-unselect-all").bind("click",function(){r(".library_selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find(".library_selected_history_content").find(":checked"),t=[],n=[],i=[];if(e.length<1)h.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 p.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?h.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?h.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;s--){var c=new p.default.Item({id:e[s]});o.push(c)}for(var d=t.length-1;d>=0;d--){var u=new p.default.FolderAsModel({id:t[d]});o.push(u)}this.options.chain_call_control.total_number=a,this.chainCallDeletingItems(o)}},showLocInfo:function(){var e=this,t=null;null!==Galaxy.libraries.libraryListView?(t=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(t)):(t=new p.default.Library({id:this.options.parent_library_id}),t.fetch({success:function(){e.showLocInfoModal(t)},error:function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")}}))},showLocInfoModal:function(e){var t=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Location Details"),body:t({library:e,options:this.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(),h.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")},findCheckedItems:function(){var e=[],t=[];return this.findCheckedRows().each(function(){var n=r(this).closest("tr").data("id");"F"==n.substring(0,1)?e.push(n):t.push(n)}),{folder_ids:e,dataset_ids:t}},showCollectionSelect:function(e){var t=this;e.preventDefault();var n=this.findCheckedItems(),i=this.templateCollectionSelectModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create History Collection from Datasets",body:i({selected_datasets:n.dataset_ids.length}),buttons:{Continue:function(){t.showColectionBuilder(n.dataset_ids)},Close:function(){Galaxy.modal.hide()}}}),this.prepareCollectionTypeSelect(),this.prepareHistoryTypeSelect()},prepareCollectionTypeSelect:function(){var e=this;this.collectionType="list",this.select_collection_type=new m.default.View({css:"library-collection-type-select",container:this.modal.$el.find(".library-collection-type-select"),data:[{id:"list",text:"List"},{id:"paired",text:"Paired"},{id:"list:paired",text:"List of Pairs"}],value:"list",onchange:function(t){e.updateCollectionType(t)}})},prepareHistoryTypeSelect:function(){var e=this;this.fetchUserHistories().done(function(){for(var t=[],n=e.histories.length-1;n>=0;n--)t.unshift({id:e.histories.models[n].id,text:e.histories.models[n].get("name")});e.select_collection_history=new m.default.View({css:"library-collection-history-select",container:e.modal.$el.find(".library-collection-history-select"),data:t,value:t[0].id})})},updateCollectionType:function(e){this.collectionType=e},showColectionBuilder:function(t){var n=this,i=[],r=this.modal.$('input[type="radio"]:checked').val();if("selection"===r)for(var a=t.length-1;a>=0;a--){var o={},s=Galaxy.libraries.folderListView.folder_container.get("folder").get(t[a]);o.id=t[a],o.name=s.get("name"),o.deleted=s.get("deleted"),o.state=s.get("state"),i.push(o)}else"folder"===r&&(i=new e.Collection(Galaxy.libraries.folderListView.folder_container.get("folder").where({type:"file"})).toJSON());var l=this.modal.$("input[name=history_name]").val();if(""!==l)this.createNewHistory(l).done(function(e){h.default.success("History created"),n.collectionImport(i,e.id,e.name)}).fail(function(e,t,n){h.default.error("An error occurred.")});else{var c=this.select_collection_history.value(),d=this.select_collection_history.text();this.collectionImport(i,c,d)}},collectionImport:function(e,t,n){var i=this,r="Creating Collection in "+n,a=void 0,o=void 0;if("list"===this.collectionType)a=v.default.ListCollectionCreator,o=function(e,n,r){return e=e.map(function(e){return{id:e.id,name:e.name,src:"ldda"}}),i.createHDCA(e,i.collectionType,n,r,t)},v.default.collectionCreatorModal(e,{creationFn:o,title:r,defaultHideSourceItems:!0},a);else if("paired"===this.collectionType)a=b.default.PairCollectionCreator,o=function(e,n,r){return e=[{name:"forward",src:"ldda",id:e[0].id},{name:"reverse",src:"ldda",id:e[1].id}],i.createHDCA(e,i.collectionType,n,r,t)},v.default.collectionCreatorModal(e,{creationFn:o,title:r,defaultHideSourceItems:!0},a);else if("list:paired"===this.collectionType){var s=e.map(function(e){return{id:e.id,name:e.name,src:"ldda"}});x.default.pairedCollectionCreatorModal(s,{historyId:t,title:r,defaultHideSourceItems:!0})}},createHDCA:function(e,t,n,i,r,a){return new M.default.HistoryDatasetCollection({history_content_type:"dataset_collection",collection_type:t,history_id:r,name:n,hide_source_items:i||!1,element_identifiers:e}).save(a)},templateToolBar:function(){return i.template(['
    ','
    ','
    ',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'
    ','",'","
    ",'",'",'','','","","",'','","","
    ","",'
    ','
    ',"
    "].join(""))},templateLocInfoInModal:function(){return i.template(["
    ",'
    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" />
    • ',"
    ","
    ").addClass("settings").appendTo(this.$el),r=i("
    ").addClass("track-info").hide().appendTo(n);r.append(i("
    ").css("font-weight","bold").text("Track Settings")),e.get("inputs").each(function(e){r.append(e.get("label")+": "+t[e.get("name")]+"
    ")});var a=this,o=(i("
    ").addClass("tile").html(i("").attr("src",Galaxy.root+"images/loading_large_white_bg.gif")))}),this.model.get("track")&&this.draw_tiles()},draw_tiles:function(){var e=this,t=this.model.get("track"),n=this.model.get("regions"),r=this.$el.find("td.tile");t&&i.when(t.data_manager.data_is_ready()).then(function(a){n.each(function(n,a){var o=n.length()/e.TILE_LEN,s=1/o,l=e.model.get("mode");i.when(t.data_manager.get_data(n,l,o,{})).then(function(o){var c=e.canvas_manager.new_canvas();c.width=e.TILE_LEN,c.height=t.get_canvas_height(o,l,s,c.width),t.draw_tile(o,c.getContext("2d"),l,n,s),i(r[a]).empty().append(c)})})})}}),N=e.View.extend({number_input_template:'
    - samples:
    ',select_input_template:'
    <%= options %>
    ',initialize:function(e){this.$el=e.tool_row,this.render()},render:function(){var e=this.model,t=(e.get("type"),this.$el.find(".form-row-input")),n=null;if(t.find(":input").change(function(){e.set("value",i(this).val())}),e instanceof v.default.IntegerToolParameter)n=i(c.template(this.number_input_template)(this.model.toJSON()));else if(e instanceof v.default.SelectToolParameter){var r=c.map(this.$el.find("select option"),function(e){return i(e).val()}),a=r.join(", ");n=i(c.template(this.select_input_template)({options:a}))}n.insertAfter(t);var o=this,l=M.default.create_icon_buttons_menu([{title:(0,s.default)("Add parameter to tree"),icon_class:"plus-button",on_click:function(){e.set("in_ptree",!0),t.hide(),n.show(),i(this).hide(),o.$el.find(".icon-button.toggle").show()}},{title:(0,s.default)("Remove parameter from tree"),icon_class:"toggle",on_click:function(){e.set("in_ptree",!1),n.hide(),t.show(),i(this).hide(),o.$el.find(".icon-button.plus-button").show()}}],{});this.$el.prepend(l.$el),e.get("in_ptree")?(t.hide(),o.$el.find(".icon-button.plus-button").hide()):(o.$el.find(".icon-button.toggle").hide(),n.hide()),c.each(["min","max","num_samples"],function(t){n.find("."+t).change(function(){e.set(t,parseFloat(i(this).val()))})})}}),L=e.View.extend({className:"tree-design",initialize:function(e){this.render()},render:function(){var e=new v.default.ToolFormView({model:this.model.get("tool")});e.render(),this.$el.append(e.$el);var t=this,n=t.model.get("tool").get("inputs");this.$el.find(".form-row").not(".form-actions").each(function(e){new N({model:n.at(e),tool_row:i(this)})})}}),I=e.View.extend({className:"tool-parameter-tree",initialize:function(e){this.model.on("change:tree_data",this.render,this)},render:function(){this.$el.children().remove();var e=this.model.get_tree_params();if(e.length){this.width=100*(2+e.length),this.height=15*this.model.get_num_leaves();var t=this,n=u.layout.cluster().size([this.height,this.width-160]),r=u.svg.diagonal().projection(function(e){return[e.y,e.x]}),a=n.nodes(this.model.get("tree_data")),o=c.uniq(c.pluck(a,"y"));c.each(e,function(e,n){var r=o[n+1],a=i("#center").position().left;t.$el.append(i("
    ").addClass("label").text(e.get("label")).css("left",r+a))});var s=u.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height+30).append("g").attr("transform","translate(40, 20)"),l=(s.selectAll("path.link").data(n.links(a)).enter().append("path").attr("class","link").attr("d",r),s.selectAll("g.node").data(a).enter().append("g").attr("class","node").attr("transform",function(e){return"translate("+e.y+","+e.x+")"}).on("mouseover",function(e){var n=c.pluck(t.model.get_connected_nodes(e),"id");l.filter(function(e){return void 0!==c.find(n,function(t){return t===e.id})}).style("fill","#f00")}).on("mouseout",function(){l.style("fill","#000")}));l.append("circle").attr("r",9),l.append("text").attr("dx",function(e){return e.children?-12:12}).attr("dy",3).attr("text-anchor",function(e){return e.children?"end":"start"}).text(function(e){return e.name})}}}),D=e.View.extend({className:"Sweepster",helpText:"

    Getting Started

    1. Create a parameter tree by using the icons next to the tool's parameter names to add or remove parameters.
    2. Adjust the tree by using parameter inputs to select min, max, and number of samples
    3. Run the tool with different settings by clicking on tree nodes
    ",initialize:function(e){this.canvas_manager=new p.default.CanvasManager(this.$el.parents("body")),this.tool_param_tree_view=new I({model:this.model.get("parameter_tree")}),this.track_collection_container=i("").addClass("tracks"),this.model.get("parameter_tree").on("change:tree_data",this.handle_node_clicks,this);var t=this;this.model.get("tracks").each(function(e){e.get("track").view=t}),this.config=x.default.ConfigSettingCollection.from_models_and_saved_values([{key:"name",label:"Name",type:"text",default_value:""},{key:"a_color",label:"A Color",type:"color",default_value:"#FF0000"},{key:"c_color",label:"C Color",type:"color",default_value:"#00FF00"},{key:"g_color",label:"G Color",type:"color",default_value:"#0000FF"},{key:"t_color",label:"T Color",type:"color",default_value:"#FF00FF"},{key:"n_color",label:"N Color",type:"color",default_value:"#AAAAAA"},{key:"block_color",label:"Block color",type:"color"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color"}],{})},render:function(){var e=new L({model:this.model.get("parameter_tree")});i("#left").append(e.$el);var t=this,n=t.model.get("regions"),r=i("").appendTo(this.track_collection_container);n.each(function(e){r.append(i("',"",'',"<% if(!edit_mode) { %>","","","<% } else if(edit_mode){ %>",'','',"<% } %>","","","","","",""].join(""))},templateRowFile:function(){return i.template(['',"",'","",'','','','',"","",""].join(""))},templateRowDeletedFile:function(){return i.template(['',"","",'","","","","","","",""].join(""))},templateRowDeletedFolder:function(){return i.template(['',"","",'","","","","","","",""].join(""))}});t.default={FolderRowView:h}}).call(t,n(2),n(1),n(0))},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(7),o=r(a),s=n(18),l=r(s),c=n(320),d=r(c),u=n(1),h=r(u),f=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=h.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=h.default.extend(this.options,e),this.setElement("#libraries_element");var t=this.templateLibraryList(),n=null,r=null,a=function(e){return!0===e.get("public")};if(i(".tooltip").hide(),void 0!==e&&(r=void 0!==e.models?e.models:null),null!==this.collection&&null===r)this.sortLibraries(),n=Galaxy.libraries.preferences.get("with_deleted")?this.collection.models:this.collection.where({deleted:!1}),Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a));else if(null!==r){if(Galaxy.libraries.preferences.get("with_deleted"))n=r;else{var o=function(e){return!1===e.get("deleted")};n=h.default.filter(r,o)}Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a))}else n=[];(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_libraries_count=n.length;var s=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&&sthis.options.total_libraries_count+Galaxy.libraries.preferences.get("library_page_size")&&(n=[]),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(n)):(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)),i("#center [data-toggle]").tooltip(),i("#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{ %>",'
    ").text(e.toString()))}),r.children().first().attr("colspan",2);var a=i("
    ").addClass("tiles");i("#right").append(a.append(this.track_collection_container)),t.model.get("tracks").each(function(e){t.add_track(e)});var o=i(this.helpText).addClass("help"),l=M.default.create_icon_buttons_menu([{title:(0,s.default)("Close"),icon_class:"cross-circle",on_click:function(){i(".tooltip").remove(),o.remove()}}]);o.prepend(l.$el.css("float","right")),i("#center").append(o),this.tool_param_tree_view.render(),i("#center").append(this.tool_param_tree_view.$el),this.handle_node_clicks();var d=M.default.create_icon_buttons_menu([{icon_class:"chevron-expand",title:"Set display mode"},{icon_class:"cross-circle",title:(0,s.default)("Close"),on_click:function(){window.location="${h.url_for( controller='visualization', action='list' )}"}}],{tooltip_config:{placement:"bottom"}}),u=["Squish","Pack"],h={};c.each(u,function(e){h[e]=function(){t.model.set("default_mode",e),t.model.get("tracks").each(function(t){t.set("mode",e)})}}),make_popupmenu(d.$el.find(".chevron-expand"),h),d.$el.attr("style","float: right"),i("#right .unified-panel-header-inner").append(d.$el)},get_base_color:function(e){return this.config.get_value(e.toLowerCase()+"_color")||this.config.get_value("n_color")},run_tool_on_dataset:function(e){var t=this.model.get("tool"),n=t.get("name"),r=this.model.get("dataset");t.set_input_values(e.get("values")),i.when(t.rerun(r)).then(function(e){}),show_modal("Running "+n+" on complete dataset",n+" is running on dataset '"+r.get("name")+"'. Outputs are in the dataset's history.",{Ok:function(){hide_modal()}})},add_track:function(e){var t=this,n=this.model.get("parameter_tree");t.model.add_track(e);var i=new A({model:e,canvas_manager:t.canvas_manager});return i.on("run_on_dataset",t.run_tool_on_dataset,t),t.track_collection_container.append(i.$el),i.$el.hover(function(){var i=n.get_leaf(e.get("settings").get("values")),r=c.pluck(n.get_connected_nodes(i),"id");u.select(t.tool_param_tree_view.$el[0]).selectAll("g.node").filter(function(e){return void 0!==c.find(r,function(t){return t===e.id})}).style("fill","#f00")},function(){u.select(t.tool_param_tree_view.$el[0]).selectAll("g.node").style("fill","#000")}),e},handle_node_clicks:function(){var e=this,t=this.model.get("parameter_tree"),n=this.model.get("regions");u.select(this.tool_param_tree_view.$el[0]).selectAll("g.node").on("click",function(r,a){var o=e.model.get("tool"),s=e.model.get("dataset"),l=t.get_node_settings(r),d=i.Deferred();l.length>=10?show_modal("Whoa there cowboy!","You clicked on a node to try "+e.model.get("tool").get("name")+" with "+l.length+" different combinations of settings. You can only run 10 jobs at a time.",{Ok:function(){hide_modal(),d.resolve(!1)}}):d.resolve(!0),i.when(d).then(function(t){if(t){var r=c.map(l,function(t){var i=new T({settings:t,regions:n,mode:e.model.get("default_mode")});return e.add_track(i),i});c.each(r,function(t,r){setTimeout(function(){o.set_input_values(t.get("settings").get("values")),i.when(o.rerun(s,n)).then(function(n){var i=n.first(),r=i.get("track_config");r.dataset=i,r.tool=null,r.prefs=e.config.to_key_value_dict();var a=m.default.object_from_template(r,e,null);a.init_for_tool_data(),t.set("track",a)})},1e4*r)})}})})}});t.default={SweepsterVisualization:j,SweepsterVisualizationView:D}}).call(t,n(2),n(0))},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(5),o=(r(a),n(7)),s=r(o),l=n(4),c=r(l),d=n(18),u=(r(d),n(317)),h=r(u),f=n(319),p=r(f),g=n(321),m=r(g),_=n(322),v=r(_),y=n(138),b=r(y),w=n(323),x=r(w),k=n(324),M=r(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=c.default.SessionStorageModel.extend({defaults:{with_deleted:!1,without_restricted:!1,sort_order:"asc",sort_by:"name",library_page_size:20,folder_page_size:15}}),T=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,n,i,r,a,o){e.GoogleAnalyticsObject=r,e[r]=e[r]||function(){(e[r].q=e[r].q||[]).push(arguments)},e[r].l=1*new Date,a=t.createElement(n),o=t.getElementsByTagName(n)[0],a.async=1,a.src="//www.google-analytics.com/analytics.js",o.parentNode.insertBefore(a,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 m.default.LibraryToolbarView,Galaxy.libraries.libraryListView=new p.default.LibraryListView}),this.library_router.on("route:libraries_page",function(e){null===Galaxy.libraries.libraryToolbarView?(Galaxy.libraries.libraryToolbarView=new m.default.LibraryToolbarView,Galaxy.libraries.libraryListView=new p.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 v.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new h.default.FolderListView({id:e})}),this.library_router.on("route:folder_page",function(e,t){null===Galaxy.libraries.folderToolbarView?(Galaxy.libraries.folderToolbarView=new v.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new h.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===i("#folder_list_body").find(":checked").length?(s.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(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 b.default.LibraryDatasetView({id:t,show_version:!1,show_permissions:!1})}),this.library_router.on("route:dataset_version",function(e,t,n){Galaxy.libraries.datasetView&&Galaxy.libraries.datasetView.$el.unbind("click"),Galaxy.libraries.datasetView=new b.default.LibraryDatasetView({id:t,ldda_id:n,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 b.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 M.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 v.default.FolderToolbarView({id:e}),Galaxy.libraries.folderListView=new h.default.FolderListView({id:e}),Galaxy.libraries.folderToolbarView.showImportModal({source:t}))}),e.history.start({pushState:!1})}});t.default={GalaxyApp:T}}).call(t,n(2),n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){return function(n,i){return n.get("type")===i.get("type")?n.has(e)||i.has(e)?n.has(e)?i.has(e)?n.get(e).toLowerCase()>i.get(e).toLowerCase()?"asc"===t?1:-1:i.get(e).toLowerCase()>n.get(e).toLowerCase()?"asc"===t?-1:1:0:-1:1:0:"folder"===n.get("type")?-1:1}},r=function(e,t){return function(n,i){return n.get(e).toLowerCase()>i.get(e).toLowerCase()?"asc"===t?1:-1:i.get(e).toLowerCase()>n.get(e).toLowerCase()?"asc"===t?-1:1:0}};t.default={generateFolderComparator:i,generateLibraryComparator:r}},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(18),c=a(l),d=n(318),u=a(d),h=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=i.defaults(this.options||{},this.defaults,e),this.modal=null,this.rowViews={},this.collection=new c.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 c.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?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()}})}})},render:function(e){this.options=i.extend(this.options,e);var t=this.templateFolder();r(".tooltip").hide();var n,a=this.folderContainer.attributes.metadata.full_path;if(n=1===a.length?0:a[a.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:n,order:this.current_sort_order})),this.options.dataset_id){var o=i.findWhere(self.rowViews,{id:this.options.dataset_id});o?o.showDatasetDetails():s.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();r("#center [data-toggle]").tooltip(),r("#center").css("overflow","auto")},paginate:function(e){this.options=i.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),n=null;n=this.folder_container.get("folder").models.slice(t,t+Galaxy.libraries.preferences.get("folder_page_size")),this.options.items_shown=n.length,Galaxy.libraries.preferences.get("folder_page_size")*this.options.show_page>this.options.total_items_count+Galaxy.libraries.preferences.get("folder_page_size")&&(n=[]),Galaxy.libraries.folderToolbarView.renderPaginator(this.options),this.collection.reset(n)},rePaint:function(e){this.options=i.extend(this.options,e),this.removeAllRows(),this.renderAll(),this.checkEmptiness()},addAll:function(e){i.each(e,function(e){Galaxy.libraries.folderListView.collection.add(e,{current_sort_order:!1})}),r("#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;i.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 u.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 r(this).data("id")&&r(this).data("id")===e.id}).remove()},removeAllRows:function(){r(".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,n=this;r(":checkbox","#folder_list_body").each(function(){this.checked=t;var e=r(this).closest("tr");t?n.makeDarkRow(e):n.makeWhiteRow(e)})},selectClickedRow:function(e){var t,n,i="";t=r(e.target).closest("tr"),"input"===e.target.localName?(i=e.target,n="input"):"td"===e.target.localName&&(i=t.find(":checkbox")[0],n="td"),i.checked?"td"===n?(i.checked="",this.makeWhiteRow(t)):"input"===n&&this.makeDarkRow(t):"td"===n?(i.checked="selected",this.makeDarkRow(t)):"input"===n&&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?(r('[class*="sort-icon"]').removeClass("fa-sort-alpha-desc").removeClass("fa-sort-alpha-asc"),r(".sort-icon-"+this.current_sort_key).addClass("fa-sort-alpha-asc")):r(".sort-icon-"+this.current_sort_key).addClass("fa-sort-alpha-desc")},templateFolder:function(){return i.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:h}}).call(t,n(2),n(1),n(0))},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(18),c=a(l),d=n(138),u=a(d),h=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=i.defaults(e||{},this.defaults),this.render(this.options)},render:function(e){this.options=i.extend(this.options,e);var t=this.options.model,n=null;return"folder"===t.get("type")||"LibraryFolder"===t.get("model_class")?(this.options.type="folder",this.prepareButtons(t),n=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",n=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(n({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 u.default.LibraryDatasetView({id:this.id})},undeleteDataset:function(e){r(".tooltip").hide();var t=this,n=r(e.target).closest("tr").data("id"),i=Galaxy.libraries.folderListView.collection.get(n);i.url=i.urlRoot+i.id+"?undelete=true",i.destroy({success:function(e,i){Galaxy.libraries.folderListView.collection.remove(n);var r=new c.default.Item(i);Galaxy.libraries.folderListView.collection.add(r),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),s.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?s.default.error("Dataset was not undeleted. "+t.responseJSON.err_msg):s.default.error("An error occured! Dataset was not undeleted. Please try again.")}})},undeleteFolder:function(e){r(".tooltip").hide();var t=r(e.target).closest("tr").data("id"),n=Galaxy.libraries.folderListView.collection.get(t);n.url=n.urlRoot+n.id+"?undelete=true",n.destroy({success:function(e,n){Galaxy.libraries.folderListView.collection.remove(t);var i=new c.default.FolderAsModel(n);Galaxy.libraries.folderListView.collection.add(i),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),s.default.success("Folder undeleted.")},error:function(e,t){void 0!==t.responseJSON?s.default.error("Folder was not undeleted. "+t.responseJSON.err_msg):s.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,n=this.$el.find(".input_folder_name").val();if(void 0!==n&&n!==e.get("name")){if(!(n.length>2))return void s.default.warning("Folder name has to be at least 3 characters long.");e.set("name",n),t=!0}var i=this.$el.find(".input_folder_description").val();if(void 0!==i&&i!==e.get("description")&&(e.set("description",i),t=!0),t){var r=this;e.save(null,{patch:!0,success:function(e){r.options.edit_mode=!1,r.repaint(e),s.default.success("Changes to folder saved.")},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg):s.default.error("An error occured while attempting to update the folder.")}})}else this.options.edit_mode=!1,this.repaint(e),s.default.info("Nothing has changed.")},repaint:function(){r(".tooltip").hide();var e=this.$el;this.render(),e.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},templateRowFolder:function(){return i.template(['
    ",'',"",'<%- content_item.get("name") %>',"",'<%- content_item.get("description") %>',"folder",'<%= _.escape(content_item.get("update_time")) %>',"","<% if(edit_mode) { %>",'",'","<% } else if (!edit_mode){%>",'",'','","","<% } %>","
    ",'',"','',"",'/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">','","","<% } %>","
    ",'',"','<%- 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")) %>',"<% } %>","",'','","
    ",'',"','<%- content_item.get("name") %>',"",'<%- content_item.get("description") %>',"","folder","",'<%= _.escape(content_item.get("update_time")) %>',"",'','","
    ',"",'",'',' ','',"",'',"","
    ','',"name","",'',"descriptionsynopsis
    ","<% }%>","
    "].join(""))}});t.default={LibraryListView:f}}).call(t,n(2),n(0))},function(e,t,n){"use strict";(function(e,i,r){Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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){i(".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,n=this.$el.find(".input_library_name").val();if(void 0!==n&&n!==e.get("name")){if(!(n.length>2))return void o.default.warning("Library name has to be at least 3 characters long.");e.set("name",n),t=!0}var i=this.$el.find(".input_library_description").val();void 0!==i&&i!==e.get("description")&&(e.set("description",i),t=!0);var r=this.$el.find(".input_library_synopsis").val();if(void 0!==r&&r!==e.get("synopsis")&&(e.set("synopsis",r),t=!0),t){var a=this;e.save(null,{patch:!0,success:function(e){a.edit_mode=!1,a.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")?(i(".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 r.template(['
    <%- library.get("name") %>"><%- library.get("name") %>"><%= _.escape(library.get("description")).substring(0, 80) + "..." %><%= _.escape(library.get("description"))%>"><%= _.escape(library.get("synopsis")).substring(0, 120) + "..." %><%= _.escape(library.get("synopsis"))%>','<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',' ',"<% }%>",'','/permissions">','','','','" class="fa fa-ban fa-lg">','',"
    ',"",'',"","","","","",'',"",'<% 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(""))},templateImportIntoHistoryModal: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(""))},templateCollectionSelectModal:function(){return i.template(["
    ",'
    ',"

    Which datasets?

    ",'
    ','",'","
    ","
    ",'
    ',"

    Collection type

    ",'',"
    Which type to choose?
    ","
      ","
    • ","List: Generic collection which groups any number of datasets into a set; similar to file system folder.","
    • ","
    • ","Paired: Simple collection containing exactly two sequence datasets; one reverse and the other forward.","
    • ","
    • ","List of Pairs: Advanced collection containing any number of Pairs; imagine as Pair-type collections inside of a List-type collection.","
    • ","
    ","
    ",'
    ',"

    Select history

    ",''," or create new: ",'',"
    ","
    "].join(""))}});t.default={FolderToolbarView:C}}).call(t,n(2),n(1),n(0),n(0))},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(18),c=a(l),d=n(12),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))},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(18),c=a(l),d=n(12),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))},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(326),a=i(r),o=n(327),s=i(o),l=n(328),c=i(l),d=n(329),u=i(d),h=n(330),f=i(h),p=n(331),g=i(p),m=n(332),_=i(m),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 g.default.RepoStatus({repositories:e.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new _.default.Workflows}),e.history.start({pushState:!1})}});t.default={GalaxyApp:y}}).call(t,n(2))},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(3),o=r(a),s=n(34),l=r(s),c=n(35),d=r(c),u=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 l.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:(0,o.default)("Configured Galaxy Tool Sheds"),tool_sheds:this.model.models,queue:d.default.queueLength()}))},reDraw:function(e){this.$el.empty(),this.render(e)},templateToolshedList:i.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','
    ','',"<% _.each(tool_sheds, function(shed) { %>",'',"","","<% }); %>","
    ",'","
    ","
    ",'
    ',"
    "].join(""))});t.default={ShedListView:u}}).call(t,n(2),n(1))},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(34),s=a(o),l=n(35),c=a(l);n(62);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))},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(34),s=a(o),l=n(35),c=a(l);n(62);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))},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(34),s=a(o),l=n(139),c=(a(l),n(5)),d=a(c),u=n(9),h=a(u),f=n(13),p=a(f),g=n(35),m=a(g),_=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:m.default.queueLength()};var a=Object.keys(this.options.repository.metadata).sort(function(e,t){return parseInt(e.split(":")[0]-t.split(":")[0])}),o={},s=this.options.repository.metadata;a.forEach(function(e){o[e]=s[e]}),this.options.repository.metadata=o,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")}),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(e.options)}),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)),m.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:_}}).call(t,n(2),n(1),n(0))},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(3),s=a(o),l=n(34),c=a(l),d=n(35),u=a(d),h=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new c.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:(0,s.default)("Repository Installation Queue"),repositories:r,queue:u.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=u.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:h}}).call(t,n(2),n(0),n(1))},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(3),s=a(o),l=n(34),c=a(l),d=n(35),u=a(d),h=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||[{}],e,this.defaults),this.model=new c.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:(0,s.default)("Repository Status"),repositories:this.model.models,queue:u.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:h}}).call(t,n(2),n(1),n(0))},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(3),s=a(o),l=n(34),c=a(l),d=n(35),u=a(d),h=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new c.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:(0,s.default)("Workflows Missing Tools"),workflows:r,queue:u.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,u.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:h}}).call(t,n(2),n(0),n(1))},function(e,t,n){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t,n,i,r;switch(e){case h.ITEM_HISTORY:t="History",n="Histories",i="history",r="History";break;case h.ITEM_DATASET:t="Dataset",n="Datasets",i="dataset",r="HistoryDatasetAssociation";break;case h.ITEM_WORKFLOW:t="Workflow",n="Workflows",i="workflow",r="StoredWorkflow";break;case h.ITEM_PAGE:t="Page",n="Pages",i="page",r="Page";break;case h.ITEM_VISUALIZATION:t="Visualization",n="Visualizations",i="visualization",r="Visualization"}var a="list_"+n.toLowerCase()+"_for_selection";return{singular:t,plural:n,controller:i,iclass:r,list_ajax_url:list_objects_url.replace("LIST_ACTION",a)}}function a(t,n,i){var r=set_accessible_url.replace("ITEM_CONTROLLER",t);e.ajax({type:"POST",url:r,data:{id:n,accessible:"True"},error:function(){alert("Making "+i+" accessible failed")}})}function o(){e(document).ajaxError(function(e,t){var n=t.responseText||t.statusText||"Could not connect to server";return show_modal("Server error",n,{"Ignore error":hide_modal}),!1}),e("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"
    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" />
    • ',"
    ","
    "+u.TOOLS+"
    "+u.IFRAME+u.STATUS+"
    ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:(0,l.default)("Superscript"),css:"wym_tools_superscript"},{name:"Subscript",title:(0,l.default)("Subscript"),css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"}]});var t=e.wymeditors(0),n=function(n){show_modal("Saving page","progress"),e.ajax({url:save_url,type:"POST",data:{id:page_id,content:t.xhtml(),annotations:JSON.stringify(new Object),_:"true"},success:function(){n()}})};e("#save-button").click(function(){n(function(){hide_modal()})}),e("#close-button").click(function(){window.document.location=page_list_url});var i=e("");e(".wym_area_top").append(i);var r={};e.each(t._options.containersItems,function(e,n){var i=n.name;r[n.title.replace("_"," ")]=function(){t.container(i)}}),make_popupmenu(i,r);var a=e("").addClass("galaxy-page-editor-button");e(".wym_area_top").append(a),make_popupmenu(a,{"Insert History Link":function(){t.dialog(h.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){t.dialog(h.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){t.dialog(h.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){t.dialog(h.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){t.dialog(h.DIALOG_VISUALIZATION_LINK)}});var o=e("").addClass("galaxy-page-editor-button");e(".wym_area_top").append(o),make_popupmenu(o,{"Embed History":function(){t.dialog(h.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){t.dialog(h.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){t.dialog(h.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){t.dialog(h.DIALOG_EMBED_VISUALIZATION)}})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var s=n(3),l=i(s);n(76),n(107),n(334),n(101);var c=n(25),d=i(c),u=window.WYMeditor,h={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization"};u.editor.prototype.dialog=function(t,n,i){function o(){e("#set_link_id").click(function(){e("#link_attribute_label").text("ID/Name");var t=e(".wym_href");t.addClass("wym_id").removeClass("wym_href"),c&&t.val(e(c).attr("id")),e(this).remove()})}var s=this,l=s.uniqueStamp(),c=s.selected();if(t==u.DIALOG_LINK){c&&(e(s._options.hrefSelector).val(e(c).attr(u.HREF)),e(s._options.srcSelector).val(e(c).attr(u.SRC)),e(s._options.titleSelector).val(e(c).attr(u.TITLE)),e(s._options.altSelector).val(e(c).attr(u.ALT)));var f,p;c&&(f=e(c).attr("href"),void 0==f&&(f=""),void 0==(p=e(c).attr("title"))&&(p="")),show_modal("Create Link","

    ",{"Make link":function(){var t=e(s._options.hrefSelector).val()||"",n=e(".wym_id").val()||"",i=e(s._options.titleSelector).val()||"";if(t||n){s._exec(u.CREATE_LINK,l);var r=e("a[href="+l+"]",s._doc.body);r.attr(u.HREF,t).attr(u.TITLE,i).attr("id",n),0===r.text().indexOf("wym-")&&r.text(i)}hide_modal()},Cancel:function(){hide_modal()}},{},o)}if(t==u.DIALOG_IMAGE)return s._selected_image&&(e(s._options.dialogImageSelector+" "+s._options.srcSelector).val(e(s._selected_image).attr(u.SRC)),e(s._options.dialogImageSelector+" "+s._options.titleSelector).val(e(s._selected_image).attr(u.TITLE)),e(s._options.dialogImageSelector+" "+s._options.altSelector).val(e(s._selected_image).attr(u.ALT))),void show_modal("Image","



    ",{Insert:function(){var t=e(s._options.srcSelector).val();t.length>0&&(s._exec(u.INSERT_IMAGE,l),e("img[src$="+l+"]",s._doc.body).attr(u.SRC,t).attr(u.TITLE,e(s._options.titleSelector).val()).attr(u.ALT,e(s._options.altSelector).val())),hide_modal()},Cancel:function(){hide_modal()}});if(t==u.DIALOG_TABLE&&show_modal("Table","


    ",{Insert:function(){var t=e(s._options.rowsSelector).val(),n=e(s._options.colsSelector).val();if(t>0&&n>0){var i=s._doc.createElement(u.TABLE),r=null,a=e(s._options.captionSelector).val();i.createCaption().innerHTML=a;for(var o=0;o").append(m.$el).append(e("
    ").append('').append("Make the selected "+g.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Insert:function(){var t=!1;null!=e("#make-importable:checked").val()&&(t=!0);new Array;m.$("input[name=id]:checked").each(function(){var n=e(this).val();t&&a(g.controller,n,g.singular);var i=get_name_and_link_url+n,r=i.replace("ITEM_CONTROLLER",g.controller);e.getJSON(r,function(t){s._exec(u.CREATE_LINK,l);var i=e("a[href="+l+"]",s._doc.body).text();""==i||i==l?s.insert(""+g.singular+" '"+t.name+"'"):e("a[href="+l+"]",s._doc.body).attr(u.HREF,t.link).attr(u.TITLE,g.singular+n)})}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})}if(t==h.DIALOG_EMBED_HISTORY||t==h.DIALOG_EMBED_DATASET||t==h.DIALOG_EMBED_WORKFLOW||t==h.DIALOG_EMBED_PAGE||t==h.DIALOG_EMBED_VISUALIZATION){var g;switch(t){case h.DIALOG_EMBED_HISTORY:g=r(h.ITEM_HISTORY);break;case h.DIALOG_EMBED_DATASET:g=r(h.ITEM_DATASET);break;case h.DIALOG_EMBED_WORKFLOW:g=r(h.ITEM_WORKFLOW);break;case h.DIALOG_EMBED_PAGE:g=r(h.ITEM_PAGE);break;case h.DIALOG_EMBED_VISUALIZATION:g=r(h.ITEM_VISUALIZATION)}var m=new d.default({url_base:g.list_ajax_url,embedded:!0});Galaxy.modal.show({title:"Insert Link to "+g.singular,body:e("
    ").append(m.$el).append(e("
    ").append('').append("Make the selected "+g.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Embed:function(){var t=!1;null!=e("#make-importable:checked").val()&&(t=!0),m.$("input[name=id]:checked").each(function(){var n=e(this).val(),i=e("label[for='"+n+"']:first").text();t&&a(g.controller,n,g.singular);var r=g.iclass+"-"+n,o=["
    ","

    ","Embedded Galaxy ",g.singular," '",i,"'","

    ","

    ","[Do not edit this block; Galaxy will fill it in with the annotated ",g.singular.toLowerCase()," when it is displayed.]","

    ","
    "].join("");s.insert(o)}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})}}}).call(t,n(0))},function(module,exports,__webpack_require__){(function(jQuery,$){if(!WYMeditor)var WYMeditor={};!function(){if(window.console&&console.firebug)WYMeditor.console=window.console;else{var e=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];WYMeditor.console={};for(var t=0;t
    "+WYMeditor.TOOLS+"
    "+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"
    "+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"
    "+WYMeditor.LOGO+"
    ",logoHtml:"WYMeditor",iframeHtml:"
    ",editorStyles:[],toolsHtml:"

    {Tools}

      "+WYMeditor.TOOLS_ITEMS+"
    ",toolsItemHtml:"
  • "+WYMeditor.TOOL_TITLE+"
  • ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview"}],containersHtml:"

    {Containers}

      "+WYMeditor.CONTAINERS_ITEMS+"
    ",containersItemHtml:"
  • "+WYMeditor.CONTAINER_TITLE+"
  • ",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:"

    {Classes}

      "+WYMeditor.CLASSES_ITEMS+"
    ",classesItemHtml:"
  • "+WYMeditor.CLASS_TITLE+"
  • ",classesItems:[],statusHtml:"

    {Status}

    ",htmlHtml:"

    {Source_Code}

    ",boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:".wym_submit",cancelSelector:".wym_cancel",previewSelector:"",dialogTypeSelector:".wym_dialog_type",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview",updateSelector:".wymupdate",updateEvent:"click",dialogFeatures:"menubar=no,titlebar=no,toolbar=no,resizable=no,width=560,height=300,top=0,left=0",dialogFeaturesPreview:"menubar=no,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width=560,height=300,top=0,left=0",dialogHtml:""+WYMeditor.DIALOG_TITLE+" %endif diff --git a/templates/webapps/galaxy/dataset/tabular_chunked.mako b/templates/webapps/galaxy/dataset/tabular_chunked.mako index 3203665398c..767c05c1346 100644 --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako @@ -5,10 +5,11 @@ <%def name="javascripts()"> ${parent.javascripts()} + ${h.js("bundled/extended.bundled")} ${h.js( @@ -146,14 +147,14 @@ ## configure left panel %if self.galaxy_config['left_panel']: var lp = new panels.LeftPanel({ el: '#left' }); - force_left_panel = function( x ) { lp.force_panel( x ) }; + window.force_left_panel = function( x ) { lp.force_panel( x ) }; %endif ## configure right panel %if self.galaxy_config['right_panel']: var rp = new panels.RightPanel({ el: '#right' }); window.handle_minwidth_hint = function( x ) { rp.handle_minwidth_hint( x ) }; - force_right_panel = function( x ) { rp.force_panel( x ) }; + window.force_right_panel = function( x ) { rp.force_panel( x ) }; %endif diff --git a/templates/webapps/galaxy/history/display.mako b/templates/webapps/galaxy/history/display.mako index fc0e451423f..65a22e16fb9 100644 --- a/templates/webapps/galaxy/history/display.mako +++ b/templates/webapps/galaxy/history/display.mako @@ -47,18 +47,8 @@ .css( 'height', '100%' ) .addClass( 'flex-vertical-container' ); - require.config({ - baseUrl : "${h.url_for( '/static/scripts' )}", - urlArgs: 'v=${app.server_starttime}' - })([ - 'mvc/history/history-view-annotated', - 'mvc/history/copy-dialog', - ], function( panelMod, historyCopyDialog ){ - // history module is already in the dpn chain from the panel. We can re-scope it here. - var HISTORY = require( 'mvc/history/history-model' ); - var HISTORY_CONTENTS = require( 'mvc/history/history-contents' ); - - var HistoryContentsWithAnnotations = HISTORY_CONTENTS.default.HistoryContents.extend({ + $(function(){ + var HistoryContentsWithAnnotations = window.bundleEntries.HistoryContents.extend({ _buildFetchData : function( options ){ console.log( '_buildFetchData:' ); options = options || {}; @@ -66,10 +56,10 @@ options.view = 'summary'; options.keys = 'annotation,tags'; } - return HISTORY_CONTENTS.default.HistoryContents.prototype._buildFetchData.call( this, options ); + return window.bundleEntries.HistoryContents.prototype._buildFetchData.call( this, options ); } }); - var HistoryWithAnnotations = HISTORY.default.History.extend({ + var HistoryWithAnnotations = window.bundleEntries.History.extend({ contentsClass : HistoryContentsWithAnnotations }); @@ -78,16 +68,16 @@ }); $( '.history-copy-link' ).click( function( ev ){ - historyCopyDialog.default( historyModel, { useImport: true, allowAll: false }) + window.bundleEntries.HistoryCopyDialog( historyModel, { useImport: true, allowAll: false }) .done( function(){ var mainWindow = ( window && ( window !== window.parent ) )? window.top : window; mainWindow.location.href = Galaxy.root; }); }); - window.historyView = new panelMod.default.AnnotatedHistoryView({ + window.historyView = new window.bundleEntries.HistoryViewAnnotated.AnnotatedHistoryView({ el : $( "#history-" + historyJSON.id ), - className : panelMod.default.AnnotatedHistoryView.prototype.className + ' wide', + className : window.bundleEntries.HistoryViewAnnotated.AnnotatedHistoryView.prototype.className + ' wide', model : historyModel, show_deleted : false, show_hidden : false, diff --git a/templates/webapps/galaxy/history/display_structured.mako b/templates/webapps/galaxy/history/display_structured.mako index 681d0cbea5f..c9b4193693b 100644 --- a/templates/webapps/galaxy/history/display_structured.mako +++ b/templates/webapps/galaxy/history/display_structured.mako @@ -141,22 +141,21 @@ hda_dicts.append( hda_dict ) %> ${parent.javascripts()} + ${h.js("bundled/extended.bundled")} ## load edit views for each of the hdas diff --git a/templates/webapps/galaxy/history/structure.mako b/templates/webapps/galaxy/history/structure.mako index a64b24714ea..2b63a2aaae6 100644 --- a/templates/webapps/galaxy/history/structure.mako +++ b/templates/webapps/galaxy/history/structure.mako @@ -6,6 +6,11 @@ ## ----------------------------------------------------------------------------- +<%def name="javascripts()"> +${ parent.javascripts() } +${h.js("bundled/extended.bundled")} + + <%def name="stylesheets()"> ${ parent.stylesheets() } @@ -68,26 +73,18 @@ ${ parent.stylesheets() } <%def name="javascript_app()"> ${ galaxy_client.load( app='app', historyId=historyId, history=history, contents=contents, jobs=jobs, tools=tools ) } diff --git a/templates/webapps/galaxy/history/view.mako b/templates/webapps/galaxy/history/view.mako index f623c0d0a11..e04068d8593 100644 --- a/templates/webapps/galaxy/history/view.mako +++ b/templates/webapps/galaxy/history/view.mako @@ -102,109 +102,22 @@ a.btn { diff --git a/templates/webapps/galaxy/history/view_multiple.mako b/templates/webapps/galaxy/history/view_multiple.mako index 5471404df15..ce6ca7960ee 100644 --- a/templates/webapps/galaxy/history/view_multiple.mako +++ b/templates/webapps/galaxy/history/view_multiple.mako @@ -1,4 +1,3 @@ - <%inherit file="/webapps/galaxy/base_panels.mako"/> <%namespace file="/galaxy_client_app.mako" name="galaxy_client"/> @@ -24,36 +23,16 @@ <%def name="javascript_app()"> -${ galaxy_client.load( app='app', current_history_id=current_history_id, - includingDeleted=include_deleted_histories, order=order, limit=limit ) } -##${ galaxy_client.load( app='app', histories=histories, -## includingDeleted=include_deleted_histories, order=order, limit=limit ) } + +${galaxy_client.load( + app='app', + current_history_id=current_history_id, + includingDeleted=include_deleted_histories, + order=order, + limit=limit +)} diff --git a/templates/webapps/galaxy/page/editor.mako b/templates/webapps/galaxy/page/editor.mako index dbd23baa185..cd4e17cc17a 100644 --- a/templates/webapps/galaxy/page/editor.mako +++ b/templates/webapps/galaxy/page/editor.mako @@ -22,8 +22,8 @@ iframe_base_path = "${h.url_for('/static/wymeditor/iframe/galaxy')}/", save_url = "${h.url_for(controller='page', action='save' )}"; - require(['galaxy.pages'], function(Pages){ - Pages.default(); + $(function(){ + bundleEntries.pages() }); diff --git a/templates/webapps/galaxy/visualization/display.mako b/templates/webapps/galaxy/visualization/display.mako index 4fe42facd92..6540f63f792 100644 --- a/templates/webapps/galaxy/visualization/display.mako +++ b/templates/webapps/galaxy/visualization/display.mako @@ -18,9 +18,7 @@ <%def name="stylesheets()"> ${parent.stylesheets()} - ${h.css( - "trackster" - )} + ${h.css("trackster")} ## Style changes needed for display.