From b451c6a13741e1f7f47d759edda67e49ec4e3983 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 9 Oct 2017 16:22:05 -0400 Subject: [PATCH] Use consistent naming for input forms --- .../mvc/dataset/dataset-edit-attributes.js | 6 +- .../webapps/galaxy/controllers/dataset.py | 28 +- .../dataset/dataset-edit-attributes.js.map | 2 +- static/scripts/bundled/admin.bundled.js | 5781 +-- static/scripts/bundled/admin.bundled.js.map | 2 +- static/scripts/bundled/analysis.bundled.js | 25824 +----------- .../scripts/bundled/analysis.bundled.js.map | 2 +- static/scripts/bundled/libs.bundled.js | 32395 +--------------- static/scripts/bundled/libs.bundled.js.map | 2 +- static/scripts/bundled/login.bundled.js | 49 +- static/scripts/bundled/login.bundled.js.map | 2 +- .../mvc/dataset/dataset-edit-attributes.js | 2 +- 12 files changed, 66 insertions(+), 64029 deletions(-) diff --git a/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js b/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js index edeb77b6ed7..d9a1655a49d 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js @@ -126,7 +126,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-tabs', 'mvc/ui/ui-misc', 'mvc/form/form-view var self = this; var form = new Form({ title : 'Edit attributes', - inputs : response.edit_attributes_inputs, + inputs : response.attribute_inputs, operations: { 'submit_editattr' : new Ui.ButtonIcon({ tooltip : 'Save attributes of the dataset.', @@ -150,7 +150,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-tabs', 'mvc/ui/ui-misc', 'mvc/form/form-view var self = this; var form = new Form({ title : 'Convert to new format', - inputs : response.convert_inputs, + inputs : response.datatype_inputs, operations: { 'submit' : new Ui.ButtonIcon({ tooltip : 'Convert the datatype to a new format.', @@ -168,7 +168,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-tabs', 'mvc/ui/ui-misc', 'mvc/form/form-view var self = this; var form = new Form({ title : 'Change datatype', - inputs : response.convert_datatype_inputs, + inputs : response.conversion_inputs, operations: { 'submit' : new Ui.ButtonIcon({ tooltip : 'Change the datatype to a new type.', diff --git a/lib/galaxy/webapps/galaxy/controllers/dataset.py b/lib/galaxy/webapps/galaxy/controllers/dataset.py index 6e12b625a02..98609b6dd4e 100644 --- a/lib/galaxy/webapps/galaxy/controllers/dataset.py +++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py @@ -278,7 +278,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE can_manage_dataset = trans.app.security_agent.can_manage_dataset(current_user_roles, data.dataset) # attribute editing - edit_attributes_inputs = [{ + attribute_inputs = [{ 'name' : 'name', 'type' : 'text', 'label': 'Name:', @@ -299,7 +299,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE if spec.visible: attributes = data.metadata.get_metadata_parameter(name, trans=trans) if type(attributes) is form_builder.SelectField: - edit_attributes_inputs.append({ + attribute_inputs.append({ 'type' : 'select', 'multiple' : attributes.multiple, 'optional' : attributes.optional, @@ -309,7 +309,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE 'value' : attributes.value if attributes.multiple else [attributes.value] }) elif type(attributes) is form_builder.TextField: - edit_attributes_inputs.append({ + attribute_inputs.append({ 'type' : 'text', 'name' : name, 'label' : spec.desc, @@ -317,7 +317,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE 'readonly' : spec.get('readonly') }) if data.missing_meta(): - edit_attributes_inputs.append({ + attribute_inputs.append({ 'name' : 'errormsg', 'type' : 'text', 'label' : 'Error Message', @@ -327,7 +327,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE }) # datatype conversion - convert_inputs = [{ + conversion_inputs = [{ 'type' : 'select', 'name' : 'target_type', 'label' : 'Name:', @@ -336,7 +336,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE }] # datatype changeing - convert_datatype_inputs = [{ + datatype_inputs = [{ 'type' : 'select', 'name' : 'datatype', 'label' : 'New Type:', @@ -401,15 +401,15 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE }) return { - 'display_name': data.get_display_name(), - 'message': message, - 'status': status, - 'dataset_id': dataset_id, + 'display_name' : data.get_display_name(), + 'message' : message, + 'status' : status, + 'dataset_id' : dataset_id, 'can_manage_dataset': can_manage_dataset, - 'edit_attributes_inputs': edit_attributes_inputs, - 'convert_inputs': convert_inputs, - 'convert_datatype_inputs': convert_datatype_inputs, - 'permission_inputs': permission_inputs + 'attribute_inputs' : attribute_inputs, + 'conversion_inputs' : conversion_inputs, + 'datatype_inputs' : datatype_inputs, + 'permission_inputs' : permission_inputs } else: return self.message_exception(trans, 'You do not have permission to edit this dataset\'s ( id: %s ) information.' % str(dataset_id)) diff --git a/static/maps/mvc/dataset/dataset-edit-attributes.js.map b/static/maps/mvc/dataset/dataset-edit-attributes.js.map index b1326b30df5..f51d4749e27 100644 --- a/static/maps/mvc/dataset/dataset-edit-attributes.js.map +++ b/static/maps/mvc/dataset/dataset-edit-attributes.js.map @@ -1 +1 @@ -{"version":3,"file":"dataset-edit-attributes.js","sources":["../../../src/mvc/dataset/dataset-edit-attributes.js"],"names":["define","Utils","Tabs","Ui","Form","View","Backbone","extend","initialize","this","setElement","model","Model","dataset_id","Galaxy","params","render","self","url","root","get","window","console","log","$","ajax","success","response","render_attribute_page","error","error_response","status","message","persistent","cls","display_message","$el","empty","append","_templateHeader","create_tabs","call_ajax","data","post_url","type","reload_history","html","Message","$el_edit_attr","tabs","add","id","title","icon","tooltip","_getAttributesFormTemplate","_getConvertFormTemplate","_getChangeDataTypeFormTemplate","_getPermissionsFormTemplate","showTab","form","inputs","edit_attributes_inputs","operations","submit_editattr","ButtonIcon","onclick","_submit","submit_autocorrect","convert_inputs","submit","convert_datatype_inputs","can_manage_dataset","display_name","permission_inputs","form_data","create","save","detect","target_type","convert_data","change","post_data","permissions","JSON","stringify","update_roles_button","currHistoryPanel","loadCurrentHistory"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"dataset-edit-attributes.js","sources":["../../../src/mvc/dataset/dataset-edit-attributes.js"],"names":["define","Utils","Tabs","Ui","Form","View","Backbone","extend","initialize","this","setElement","model","Model","dataset_id","Galaxy","params","render","self","url","root","get","window","console","log","$","ajax","success","response","render_attribute_page","error","error_response","status","message","persistent","cls","display_message","$el","empty","append","_templateHeader","create_tabs","call_ajax","data","post_url","type","reload_history","html","Message","$el_edit_attr","tabs","add","id","title","icon","tooltip","_getAttributesFormTemplate","_getConvertFormTemplate","_getChangeDataTypeFormTemplate","_getPermissionsFormTemplate","showTab","form","inputs","attribute_inputs","operations","submit_editattr","ButtonIcon","onclick","_submit","submit_autocorrect","datatype_inputs","submit","conversion_inputs","can_manage_dataset","display_name","permission_inputs","form_data","create","save","detect","target_type","convert_data","change","post_data","permissions","JSON","stringify","update_roles_button","currHistoryPanel","loadCurrentHistory"],"mappings":"AACAA,QAAU,cAAe,iBAAkB,iBAAkB,sBAAwB,SAAUC,EAAOC,EAAMC,EAAIC,GAG5G,GAAIC,GAAOC,SAASD,KAAKE,QACrBC,WAAY,WACRC,KAAKC,WAAY,UACjBD,KAAKE,MAAQ,GAAIL,UAASM,OAASC,WAAcC,OAAOC,OAAOF,aAC/DJ,KAAKO,UAKTA,OAAQ,WACJ,GAAIC,GAAOR,KACPS,EAAMJ,OAAOK,KAAO,+BAAiCF,EAAKN,MAAMS,IAAK,aACzEC,QAAOC,QAAQC,IAAKL,GACpBM,EAAEC,MACEP,IAAUA,EACVQ,QAAU,SAAUC,GACjBV,EAAKW,sBAAuBX,EAAMU,IAErCE,MAAU,WACN,GAAIC,IACAC,OAAU,QACVC,QAAW,2CACXC,YAAc,EACdC,IAAO,eAEXjB,GAAKkB,gBAAiBL,EAAgBb,EAAKO,EAAG,0BAM1DI,sBAAuB,SAAUX,EAAMU,GACnC,GAAIK,IACAA,QAAgBL,EAASK,QACzBD,OAAgBJ,EAASI,OACzBE,YAAgB,EAChBC,IAAgBP,EAASI,OAAS,UAEtCd,GAAKmB,IAAIC,QAAQC,OAAQrB,EAAKsB,mBAC9BtB,EAAKkB,gBAAiBH,EAASf,EAAKO,EAAG,sBAEvCP,EAAKuB,YAAab,EAAUV,EAAKO,EAAG,gBAIxCiB,UAAW,SAAUxB,EAAMyB,GACvB,GAAIC,GAAW7B,OAAOK,KAAO,kBAC7BK,GAAEC,MACEmB,KAAM,MACN1B,IAAKyB,EACLD,KAAMA,EACNhB,QAAS,SAAUC,GACfV,EAAKW,sBAAuBX,EAAMU,GAClCV,EAAK4B,kBAEThB,MAAU,WACN,GAAIC,IACAC,OAAU,QACVC,QAAW,iFACXC,YAAc,EACdC,IAAO,eAEXjB,GAAKkB,gBAAiBL,EAAgBb,EAAKO,EAAG,0BAM1DW,gBAAiB,SAAUR,EAAUS,GACjCA,EAAIC,QAAQS,KAAM,GAAI3C,GAAG4C,QAASpB,GAAWS,MAIjDI,YAAa,SAAUb,EAAUqB,GAC7B,GAAI/B,GAAOR,IACXQ,GAAKgC,KAAO,GAAI/C,GAAKG,KACrBY,EAAKgC,KAAKC,KACNC,GAAU,aACVC,MAAU,aACVC,KAAU,aACVC,QAAU,0BACVlB,IAAUnB,EAAKsC,2BAA4B5B,KAG/CV,EAAKgC,KAAKC,KACNC,GAAU,UACVC,MAAU,UACVC,KAAU,UACVC,QAAU,wBACVlB,IAAWnB,EAAKuC,wBAAyB7B,KAG7CV,EAAKgC,KAAKC,KACNC,GAAU,WACVC,MAAU,YACVC,KAAU,cACVC,QAAU,mBACVlB,IAAUnB,EAAKwC,+BAAgC9B,KAGnDV,EAAKgC,KAAKC,KACNC,GAAU,cACVC,MAAU,cACVC,KAAU,UACVC,QAAU,cACVlB,IAAUnB,EAAKyC,4BAA6B/B,KAEhDqB,EAAcV,OAAQrB,EAAKgC,KAAKb,KAChCnB,EAAKgC,KAAKU,QAAS,eAIvBpB,gBAAiB,WACb,MAAO,oHAOXgB,2BAA4B,SAAU5B,GAClC,GAAIV,GAAOR,KACPmD,EAAO,GAAIxD,IACXgD,MAAS,kBACTS,OAASlC,EAASmC,iBAClBC,YACIC,gBAAoB,GAAI7D,GAAG8D,YACvBX,QAAgB,kCAChBD,KAAgB,eAChBD,MAAgB,kBAChBc,QAAgB,WAAajD,EAAKkD,QAASlD,EAAM2C,EAAMjC,EAAU,sBAErEyC,mBAAuB,GAAIjE,GAAG8D,YAC1BX,QAAmB,sGACnBD,KAAmB,WACnBD,MAAmB,cACnBc,QAAmB,WAAajD,EAAKkD,QAASlD,EAAM2C,EAAMjC,EAAU,oBAIhF,OAAOiC,GAAKxB,KAIhBoB,wBAAyB,SAAU7B,GAC/B,GAAIV,GAAOR,KACPmD,EAAO,GAAIxD,IACXgD,MAAS,wBACTS,OAASlC,EAAS0C,gBAClBN,YACQO,OAAW,GAAInE,GAAG8D,YAClBX,QAAW,wCACXF,MAAW,mBACXC,KAAW,eACXa,QAAW,WAAajD,EAAKkD,QAASlD,EAAM2C,EAAMjC,EAAU,gBAIxE,OAAOiC,GAAKxB,KAIhBqB,+BAAgC,SAAU9B,GACtC,GAAIV,GAAOR,KACPmD,EAAO,GAAIxD,IACXgD,MAAS,kBACTS,OAASlC,EAAS4C,kBAClBR,YACQO,OAAW,GAAInE,GAAG8D,YAClBX,QAAW,qCACXF,MAAW,kBACXC,KAAW,eACXa,QAAW,WAAajD,EAAKkD,QAASlD,EAAM2C,EAAMjC,EAAU,eAIxE,OAAOiC,GAAKxB,KAIhBsB,4BAA6B,SAAU/B,GACnC,GACIV,GAAOR,IACX,IAAIkB,EAAS6C,mBAAqB,CAC9B,GAAIZ,GAAO,GAAIxD,IACXgD,MAAS,iCAAmCzB,EAAS8C,aACrDZ,OAASlC,EAAS+C,kBAClBX,YACIO,OAAU,GAAInE,GAAG8D,YACbX,QAAW,oBACXF,MAAW,mBACXC,KAAW,eACXa,QAAW,WAAajD,EAAKkD,QAASlD,EAAM2C,EAAMjC,EAAU,oBAIxE,OAAOiC,GAAKxB,IAGZ,GAAIwB,GAAO,GAAIxD,IACXgD,MAAS,mBACTS,OAASlC,EAAS+C,mBAEtB,OAAOd,GAAKxB,KAKpB+B,QAAS,SAAUlD,EAAM2C,EAAMjC,EAAUiB,GACrC,GAAI+B,GAAYf,EAAKlB,KAAKkC,QAE1B,QADAD,EAAU9D,WAAac,EAASd,WACxB+B,GACJ,IAAK,kBACD+B,EAAUE,KAAO,MACjB,MAEJ,KAAK,cACDF,EAAUG,OAAS,aACnB,MAEJ,KAAK,UAC8B,OAA1BH,EAAUI,aAAwBJ,EAAUI,cAC7CJ,EAAU9D,WAAac,EAASd,WAChC8D,EAAUK,aAAe,UAE7B,MAEJ,KAAK,SACDL,EAAUM,OAAS,MACnB,MAEJ,KAAK,cACD,GAAIC,KACJA,GAAUC,YAAcC,KAAKC,UAAWV,GACxCO,EAAUI,oBAAsB,OAChCJ,EAAUrE,WAAac,EAASd,WAChC8D,EAAYO,EAGpBjE,EAAKwB,UAAWxB,EAAM0D,IAI1B9B,eAAgB,WACPxB,OAAOP,QACRO,OAAOP,OAAOyE,iBAAiBC,uBAK3C,QACInF,KAAQA"} \ No newline at end of file diff --git a/static/scripts/bundled/admin.bundled.js b/static/scripts/bundled/admin.bundled.js index b652b0a8fdd..8f8991f3cfb 100644 --- a/static/scripts/bundled/admin.bundled.js +++ b/static/scripts/bundled/admin.bundled.js @@ -1,5778 +1,5 @@ -webpackJsonp([0],[ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(_) {var jQuery = __webpack_require__(2), - $ = jQuery, - GalaxyApp = __webpack_require__(3).GalaxyApp, - AdminPanel = __webpack_require__(11), - FormWrapper = __webpack_require__(12), - GridView = __webpack_require__(36), - Ui = __webpack_require__(16), - QueryStringParsing = __webpack_require__(40), - Router = __webpack_require__(41), - Utils = __webpack_require__(14), - Page = __webpack_require__(42); - - window.app = function app(options, bootstrapped) { - window.Galaxy = new GalaxyApp(options, bootstrapped); - Galaxy.debug('admin app'); - - /** Routes */ - var AdminRouter = Router.extend({ - routes: { - '(/)admin(/)users': 'show_users', - '(/)admin(/)roles': 'show_roles', - '(/)admin(/)groups': 'show_groups', - '(/)admin(/)tool_versions': 'show_tool_versions', - '(/)admin(/)quotas': 'show_quotas', - '(/)admin(/)forms': 'show_forms', - '(/)admin(/)form(/)(:form_id)': 'show_form' - }, - - authenticate: function (args, name) { - return Galaxy.user && Galaxy.user.id && Galaxy.user.get('is_admin'); - }, - - show_users: function () { - this.page.display(new GridView({ url_base: Galaxy.root + 'admin/users_list', url_data: Galaxy.params, dict_format: true })); - }, - - show_roles: function () { - this.page.display(new GridView({ url_base: Galaxy.root + 'admin/roles_list', url_data: Galaxy.params, dict_format: true })); - }, - - show_groups: function () { - this.page.display(new GridView({ url_base: Galaxy.root + 'admin/groups_list', url_data: Galaxy.params, dict_format: true })); - }, - - show_tool_versions: function () { - this.page.display(new GridView({ url_base: Galaxy.root + 'admin/tool_versions_list', url_data: Galaxy.params, dict_format: true })); - }, - - show_quotas: function () { - this.page.display(new GridView({ url_base: Galaxy.root + 'admin/quotas_list', url_data: Galaxy.params, dict_format: true })); - }, - - show_forms: function () { - this.page.display(new GridView({ url_base: Galaxy.root + 'forms/forms_list', url_data: Galaxy.params, dict_format: true })); - }, - - show_form: function (form_id) { - var id = '?id=' + QueryStringParsing.get('id'); - var form_defs = { - reset_user_password: { - title: 'Reset passwords', - url: 'admin/reset_user_password' + id, - icon: 'fa-user', - submit_title: 'Save new password', - redirect: 'admin/users' - }, - manage_roles_and_groups_for_user: { - url: 'admin/manage_roles_and_groups_for_user' + id, - icon: 'fa-users', - redirect: 'admin/users' - }, - manage_users_and_groups_for_role: { - url: 'admin/manage_users_and_groups_for_role' + id, - redirect: 'admin/roles' - }, - manage_users_and_roles_for_group: { - url: 'admin/manage_users_and_roles_for_group' + id, - redirect: 'admin/groups' - }, - manage_users_and_groups_for_quota: { - url: 'admin/manage_users_and_groups_for_quota' + id, - redirect: 'admin/quotas' - }, - create_role: { - url: 'admin/create_role', - redirect: 'admin/roles' - }, - create_group: { - url: 'admin/create_group', - redirect: 'admin/groups' - }, - create_quota: { - url: 'admin/create_quota', - redirect: 'admin/quotas' - }, - rename_role: { - url: 'admin/rename_role' + id, - redirect: 'admin/roles' - }, - rename_group: { - url: 'admin/rename_group' + id, - redirect: 'admin/groups' - }, - rename_quota: { - url: 'admin/rename_quota' + id, - redirect: 'admin/quotas' - }, - edit_quota: { - url: 'admin/edit_quota' + id, - redirect: 'admin/quotas' - }, - set_quota_default: { - url: 'admin/set_quota_default' + id, - redirect: 'admin/quotas' - }, - create_form: { - url: 'forms/create_form', - redirect: 'admin/forms' - }, - edit_form: { - url: 'forms/edit_form' + id, - redirect: 'admin/forms' - } - }; - this.page.display(new FormWrapper.View(form_defs[form_id])); - } - }); - - $(function () { - _.extend(options.config, { active_view: 'admin' }); - Utils.setWindowTitle("Administration"); - Galaxy.page = new Page.View(_.extend(options, { - Left: AdminPanel, - Router: AdminRouter - })); - }); - }; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ }), -/* 1 */, -/* 2 */, -/* 3 */, -/* 4 */, -/* 5 */, -/* 6 */, -/* 7 */, -/* 8 */, -/* 9 */, -/* 10 */, -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(Backbone, $, _) {var _l = __webpack_require__(7); - - var AdminPanel = Backbone.View.extend({ - initialize: function (page, options) { - var self = this; - this.page = page; - this.root = options.root; - this.config = options.config; - this.settings = options.settings; - this.message = options.message; - this.status = options.status; - this.model = new Backbone.Model({ - title: _l('Administration') - }); - this.categories = new Backbone.Collection([{ - title: 'Server', - items: [{ - title: 'Data types registry', - url: 'admin/view_datatypes_registry' - }, { - title: 'Data tables registry', - url: 'admin/view_tool_data_tables' - }, { - title: 'Display applications', - url: 'admin/display_applications' - }, { - title: 'Manage jobs', - url: 'admin/jobs' - }] - }, { - title: 'Tools and Tool Shed', - items: [{ - title: 'Search Tool Shed', - url: 'admin_toolshed/browse_tool_sheds', - enabled: self.settings.is_tool_shed_installed - }, { - title: 'Search Tool Shed (Beta)', - url: 'admin_toolshed/browse_toolsheds', - enabled: self.settings.is_tool_shed_installed && self.config.enable_beta_ts_api_install - }, { - title: 'Monitor installing repositories', - url: 'admin_toolshed/monitor_repository_installation?installing_repository_ids=' + self.settings.installing_repository_ids, - enabled: self.settings.installing_repository_ids - }, { - title: 'Manage installed tools', - url: 'admin_toolshed/browse_repositories', - enabled: self.settings.is_repo_installed - }, { - title: 'Reset metadata', - url: 'admin_toolshed/reset_metadata_on_selected_installed_repositories', - enabled: self.settings.is_repo_installed - }, { - title: 'Download local tool', - url: 'admin/package_tool' - }, { - title: 'Tool lineage', - url: 'admin/tool_versions', - target: '__use_router__' - }, { - title: 'Reload a tool\'s configuration', - url: 'admin/reload_tool' - }, { - title: 'Review tool migration stages', - url: 'admin/review_tool_migration_stages' - }, { - title: 'View Tool Error Logs', - url: 'admin/tool_errors' - }, { - title: 'Manage Display Whitelist', - url: 'admin/sanitize_whitelist' - }, { - title: 'Manage Tool Dependencies', - url: 'admin/manage_tool_dependencies' - }] - }, { - title: 'User Management', - items: [{ - title: 'Users', - url: 'admin/users', - target: '__use_router__' - }, { - title: 'Groups', - url: 'admin/groups', - target: '__use_router__' - }, { - title: 'Roles', - url: 'admin/roles', - target: '__use_router__' - }, { - title: 'API keys', - url: 'userskeys/all_users' - }, { - title: 'Impersonate a user', - url: 'admin/impersonate', - enabled: self.config.allow_user_impersonation - }] - }, { - title: 'Data', - items: [{ - title: 'Quotas', - url: 'admin/quotas', - target: '__use_router__', - enabled: self.config.enable_quotas - }, { - title: 'Data libraries', - url: 'library_admin/browse_libraries' - }, { - title: 'Roles', - url: 'admin/roles', - target: '__use_router__' - }, { - title: 'Local data', - url: 'data_manager' - }] - }, { - title: 'Form Definitions', - items: [{ - title: 'Form definitions', - url: 'admin/forms', - target: '__use_router__' - }] - }, { - title: 'Sample Tracking', - items: [{ - title: 'Sequencers and external services', - url: 'external_service/browse_external_services' - }, { - title: 'Request types', - url: 'request_type/browse_request_types' - }, { - title: 'Sequencing requests', - url: 'requests_admin/browse_requests' - }, { - title: 'Find samples', - url: 'requests_common/find_samples?cntrller=requests_admin' - }] - }]); - this.setElement(this._template()); - }, - - render: function () { - var self = this; - this.$el.empty(); - this.categories.each(function (category) { - var $section = $(self._templateSection(category.attributes)); - var $entries = $section.find('.ui-side-section-body'); - _.each(category.get('items'), function (item) { - if (item.enabled === undefined || item.enabled) { - var $link = $('').attr({ href: self.root + item.url }).text(_l(item.title)); - if (item.target == '__use_router__') { - $link.on('click', function (e) { - e.preventDefault();self.page.router.push(item.url); - }); - } else { - $link.attr('target', 'galaxy_main'); - } - $entries.append($('
').addClass('ui-side-section-body-title').append($link)); - } - }); - self.$el.append($section); - }); - this.page.$('#galaxy_main').prop('src', this.root + 'admin/center?message=' + this.message + '&status=' + this.status); - }, - - _templateSection: function (options) { - return ['
', '
' + _l(options.title) + '
', '
', '
'].join(''); - }, - - _template: function () { - return '
'; - }, - - toString: function () { - return 'adminPanel'; - } - }); - - module.exports = AdminPanel; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(2), __webpack_require__(1))) - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(Backbone, $) {/** Generic form view */ - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(13), __webpack_require__(16)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Form, Ui) { - - var View = Backbone.View.extend({ - - initialize: function (options) { - this.model = new Backbone.Model(options); - this.url = this.model.get('url'); - this.redirect = this.model.get('redirect'); - this.setElement('
'); - this.render(); - }, - - render: function () { - var self = this; - $.ajax({ - url: Galaxy.root + this.url, - type: 'GET' - }).done(function (response) { - var options = $.extend({}, self.model.attributes, response); - var form = new Form({ - title: options.title, - message: options.message, - status: options.status || 'warning', - icon: options.icon, - inputs: options.inputs, - buttons: { - 'submit': new Ui.Button({ - tooltip: options.submit_tooltip, - title: options.submit_title || 'Save', - icon: options.submit_icon || 'fa-save', - cls: 'btn btn-primary ui-clear-float', - onclick: function () { - self._submit(form); - } - }) - } - }); - self.$el.empty().append(form.$el); - }).fail(function (response) { - self.$el.empty().append(new Ui.Message({ - message: 'Failed to load resource ' + self.url + '.', - status: 'danger', - persistent: true - }).$el); - }); - }, - - _submit: function (form) { - var self = this; - $.ajax({ - url: Galaxy.root + self.url, - data: JSON.stringify(form.data.create()), - type: 'PUT', - contentType: 'application/json' - }).done(function (response) { - var success_message = { message: response.message, status: 'success', persistent: false }; - if (self.redirect) { - window.location = Galaxy.root + self.redirect + '?' + $.param(success_message); - } else { - form.data.matchModel(response, function (input, input_id) { - form.field_list[input_id].value(input.value); - }); - self._showMessage(form, success_message); - } - }).fail(function (response) { - self._showMessage(form, { message: response.responseJSON.err_msg, status: 'danger', persistent: false }); - }); - }, - - _showMessage: function (form, options) { - var $panel = form.$el.parents().filter(function () { - return ['auto', 'scroll'].indexOf($(this).css('overflow')) != -1; - }).first(); - $panel.animate({ scrollTop: 0 }, 500); - form.message.update(options); - } - }); - - return { - View: View - }; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(2))) - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(Backbone, _, $) {/** - This is the main class of the form plugin. It is referenced as 'app' in lower level modules. - */ - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(14), __webpack_require__(15), __webpack_require__(16), __webpack_require__(23), __webpack_require__(35)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, Portlet, Ui, FormSection, FormData) { - return Backbone.View.extend({ - initialize: function (options) { - this.model = new Backbone.Model({ - initial_errors: false, - cls: 'ui-portlet-limited', - icon: null, - always_refresh: true, - status: 'warning', - onchange: function () {} - }).set(options); - this.setElement('
'); - this.render(); - }, - - /** Update available options */ - update: function (new_model) { - var self = this; - this.data.matchModel(new_model, function (node, input_id) { - var input = self.input_list[input_id]; - if (input && input.options) { - if (!_.isEqual(input.options, node.options)) { - input.options = node.options; - var field = self.field_list[input_id]; - if (field.update) { - var new_options = []; - if (['data', 'data_collection', 'drill_down'].indexOf(input.type) != -1) { - new_options = input.options; - } else { - for (var i in node.options) { - var opt = node.options[i]; - if (opt.length > 2) { - new_options.push({ label: opt[0], value: opt[1] }); - } - } - } - field.update(new_options); - field.trigger('change'); - Galaxy.emit.debug('form-view::update()', 'Updating options for ' + input_id); - } - } - } - }); - }, - - /** Set form into wait mode */ - wait: function (active) { - for (var i in this.input_list) { - var field = this.field_list[i]; - var input = this.input_list[i]; - if (input.is_dynamic && field.wait && field.unwait) { - field[active ? 'wait' : 'unwait'](); - } - } - }, - - /** Highlight and scroll to input element (currently only used for error notifications) */ - highlight: function (input_id, message, silent) { - var input_element = this.element_list[input_id]; - if (input_element) { - input_element.error(message || 'Please verify this parameter.'); - this.portlet.expand(); - this.trigger('expand', input_id); - if (!silent) { - var $panel = this.$el.parents().filter(function () { - return ['auto', 'scroll'].indexOf($(this).css('overflow')) != -1; - }).first(); - $panel.animate({ scrollTop: $panel.scrollTop() + input_element.$el.offset().top - 120 }, 500); - } - } - }, - - /** Highlights errors */ - errors: function (options) { - this.trigger('reset'); - if (options && options.errors) { - var error_messages = this.data.matchResponse(options.errors); - for (var input_id in this.element_list) { - var input = this.element_list[input_id]; - if (error_messages[input_id]) { - this.highlight(input_id, error_messages[input_id], true); - } - } - } - }, - - /** Render tool form */ - render: function () { - var self = this; - this.off('change'); - this.off('reset'); - // contains the dom field elements as created by the parameter factory i.e. form-parameters - this.field_list = {}; - // contains input definitions/dictionaries as provided by the parameters to_dict() function through the api - this.input_list = {}; - // contains the dom elements of each input element i.e. form-input which wraps the actual input field - this.element_list = {}; - // converts the form into a json data structure - this.data = new FormData.Manager(this); - this._renderForm(); - this.data.create(); - this.model.get('initial_errors') && this.errors(this.model.attributes); - // add listener which triggers on checksum change, and reset the form input wrappers - var current_check = this.data.checksum(); - this.on('change', function (input_id) { - var input = self.input_list[input_id]; - if (!input || input.refresh_on_change || self.model.get('always_refresh')) { - var new_check = self.data.checksum(); - if (new_check != current_check) { - current_check = new_check; - self.model.get('onchange')(); - } - } - }); - this.on('reset', function () { - _.each(self.element_list, function (input_element) { - input_element.reset(); - }); - }); - return this; - }, - - /** Renders/appends dom elements of the form */ - _renderForm: function () { - $('.tooltip').remove(); - var options = this.model.attributes; - this.message = new Ui.UnescapedMessage(); - this.section = new FormSection.View(this, { inputs: options.inputs }); - this.portlet = new Portlet.View({ - icon: options.icon, - title: options.title, - cls: options.cls, - operations: options.operations, - buttons: options.buttons, - collapsible: options.collapsible, - collapsed: options.collapsed, - onchange_title: options.onchange_title - }); - this.portlet.append(this.message.$el); - this.portlet.append(this.section.$el); - this.$el.empty(); - options.inputs && this.$el.append(this.portlet.$el); - options.message && this.message.update({ persistent: true, status: options.status, message: options.message }); - Galaxy.emit.debug('form-view::initialize()', 'Completed'); - } - }); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(1), __webpack_require__(2))) - -/***/ }), -/* 14 */, -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(Backbone, _, $) {!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(14), __webpack_require__(16)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, Ui) { - var View = Backbone.View.extend({ - visible: false, - initialize: function (options) { - var self = this; - this.model = options && options.model || new Backbone.Model({ - id: Utils.uid(), - cls: 'ui-portlet', - title: '', - icon: '', - buttons: null, - body: null, - scrollable: true, - nopadding: false, - operations: null, - collapsible: false, - collapsible_button: false, - collapsed: false, - onchange_title: null - }).set(options); - this.setElement(this._template()); - - // link all dom elements - this.$body = this.$('.portlet-body'); - this.$title_text = this.$('.portlet-title-text'); - this.$title_icon = this.$('.portlet-title-icon'); - this.$header = this.$('.portlet-header'); - this.$content = this.$('.portlet-content'); - this.$backdrop = this.$('.portlet-backdrop'); - this.$buttons = this.$('.portlet-buttons'); - this.$operations = this.$('.portlet-operations'); - - // add body to component list - this.model.get('body') && this.append(this.model.get('body')); - - // add icon for collapsible option - this.collapsible_button = new Ui.ButtonIcon({ - icon: 'fa-eye', - tooltip: 'Collapse/Expand', - cls: 'ui-button-icon-plain', - onclick: function () { - self[self.collapsed ? 'expand' : 'collapse'](); - } - }); - this.render(); - }, - - render: function () { - var self = this; - var options = this.model.attributes; - this.$el.removeClass().addClass(options.cls).attr('id', options.id); - this.$header[options.title ? 'show' : 'hide'](); - this.$title_text.html(options.title); - _.each([this.$content, this.$body], function ($el) { - $el[options.nopadding ? 'addClass' : 'removeClass']('no-padding'); - }); - - // render title icon - if (options.icon) { - this.$title_icon.removeClass().addClass('portlet-title-icon fa').addClass(options.icon).show(); - } else { - this.$title_icon.hide(); - } - - // make portlet collapsible - this.$title_text[options.collapsible ? 'addClass' : 'removeClass']('no-highlight collapsible').off(); - if (options.collapsible) { - this.$title_text.on('click', function () { - self[self.collapsed ? 'expand' : 'collapse'](); - }); - options.collapsed ? this.collapse() : this.expand(); - } - - // allow title editing - this.$title_text.prop('disabled', !options.onchange_title); - options.onchange_title && this.$title_text.make_text_editable({ - on_finish: function (new_title) { - options.onchange_title(new_title); - } - }); - - // render buttons - if (options.buttons) { - this.$buttons.empty().show(); - $.each(this.model.get('buttons'), function (name, item) { - item.$el.prop('id', name); - self.$buttons.append(item.$el); - }); - } else { - this.$buttons.hide(); - } - - // render operations - this.$operations.empty; - if (options.collapsible_button) { - this.$operations.append(this.collapsible_button.$el); - } - if (options.operations) { - $.each(options.operations, function (name, item) { - item.$el.prop('id', name); - self.$operations.append(item.$el); - }); - } - return this; - }, - - /** Append new doms to body */ - append: function ($el) { - this.$body.append($el); - }, - - /** Remove all content */ - empty: function () { - this.$body.empty(); - }, - - /** Return header element */ - header: function () { - return this.$header; - }, - - /** Return body element */ - body: function () { - return this.$body; - }, - - /** Show portlet */ - show: function () { - this.visible = true; - this.$el.fadeIn('fast'); - }, - - /** Hide portlet */ - hide: function () { - this.visible = false; - this.$el.hide(); - }, - - /** Enable a particular button */ - enableButton: function (id) { - this.$buttons.find('#' + id).prop('disabled', false); - }, - - /** Disable a particular button */ - disableButton: function (id) { - this.$buttons.find('#' + id).prop('disabled', true); - }, - - /** Hide a particular operation */ - hideOperation: function (id) { - this.$operations.find('#' + id).hide(); - }, - - /** Show a particular operation */ - showOperation: function (id) { - this.$operations.find('#' + id).show(); - }, - - /** Replaces the event callback of an existing operation */ - setOperation: function (id, callback) { - this.$operations.find('#' + id).off('click').on('click', callback); - }, - - /** Change title */ - title: function (new_title) { - new_title && this.$title_text.html(new_title); - return this.$title_text.html(); - }, - - /** Collapse portlet */ - collapse: function () { - this.collapsed = true; - this.$content.height('0%'); - this.$body.hide(); - this.collapsible_button.setIcon('fa-eye-slash'); - }, - - /** Expand portlet */ - expand: function () { - this.collapsed = false; - this.$content.height('100%'); - this.$body.fadeIn('fast'); - this.collapsible_button.setIcon('fa-eye'); - }, - - /** Disable content access */ - disable: function () { - this.$backdrop.show(); - }, - - /** Enable content access */ - enable: function () { - this.$backdrop.hide(); - }, - - _template: function () { - return $('
').append($('
').addClass('portlet-header').append($('
').addClass('portlet-operations')).append($('
').addClass('portlet-title').append($('').addClass('portlet-title-icon')).append($('').addClass('portlet-title-text')))).append($('
').addClass('portlet-content').append($('
').addClass('portlet-body')).append($('
').addClass('portlet-buttons'))).append($('
').addClass('portlet-backdrop')); - } - }); - return { - View: View - }; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(1), __webpack_require__(2))) - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(Backbone, $, _) {/** - * This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc. - */ - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(14), __webpack_require__(17), __webpack_require__(19), __webpack_require__(20), __webpack_require__(21), __webpack_require__(18), __webpack_require__(22)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, Select, Slider, Options, Drilldown, Buttons, Modal) { - - /** Label wrapper */ - var Label = Backbone.View.extend({ - tagName: 'label', - initialize: function (options) { - this.model = options && options.model || new Backbone.Model(options); - this.tagName = options.tagName || this.tagName; - this.setElement($('<' + this.tagName + '/>')); - this.listenTo(this.model, 'change', this.render, this); - this.render(); - }, - title: function (new_title) { - this.model.set('title', new_title); - }, - value: function () { - return this.model.get('title'); - }, - render: function () { - this.$el.removeClass().addClass('ui-label').addClass(this.model.get('cls')).html(this.model.get('title')); - return this; - } - }); - - /** Displays messages used e.g. in the tool form */ - var Message = Backbone.View.extend({ - initialize: function (options) { - this.model = options && options.model || new Backbone.Model({ - message: null, - status: 'info', - cls: '', - persistent: false, - fade: true - }).set(options); - this.listenTo(this.model, 'change', this.render, this); - this.render(); - }, - update: function (options) { - this.model.set(options); - }, - render: function () { - this.$el.removeClass().addClass('ui-message').addClass(this.model.get('cls')); - var status = this.model.get('status'); - if (this.model.get('large')) { - this.$el.addClass((status == 'success' && 'done' || status == 'danger' && 'error' || status) + 'messagelarge'); - } else { - this.$el.addClass('alert').addClass('alert-' + status); - } - if (this.model.get('message')) { - this.$el.html(this.messageForDisplay()); - this.$el[this.model.get('fade') ? 'fadeIn' : 'show'](); - this.timeout && window.clearTimeout(this.timeout); - if (!this.model.get('persistent')) { - var self = this; - this.timeout = window.setTimeout(function () { - self.model.set('message', ''); - }, 3000); - } - } else { - this.$el.fadeOut(); - } - return this; - }, - messageForDisplay: function () { - return _.escape(this.model.get('message')); - } - }); - - var UnescapedMessage = Message.extend({ - messageForDisplay: function () { - return this.model.get('message'); - } - }); - - /** Renders an input element used e.g. in the tool form */ - var Input = Backbone.View.extend({ - initialize: function (options) { - this.model = options && options.model || new Backbone.Model({ - type: 'text', - placeholder: '', - disabled: false, - readonly: false, - visible: true, - cls: '', - area: false, - color: null, - style: null - }).set(options); - this.tagName = this.model.get('area') ? 'textarea' : 'input'; - this.setElement($('<' + this.tagName + '/>')); - this.listenTo(this.model, 'change', this.render, this); - this.render(); - }, - events: { - 'input': '_onchange' - }, - value: function (new_val) { - new_val !== undefined && this.model.set('value', typeof new_val === 'string' ? new_val : ''); - return this.model.get('value'); - }, - render: function () { - var self = 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 datalist = this.model.get('datalist'); - if ($.isArray(datalist) && datalist.length > 0) { - this.$el.autocomplete({ source: function (request, response) { - response(self.model.get('datalist')); - }, - change: function () { - self._onchange(); - } }); - } - if (this.model.get('value') !== this.$el.val()) { - this.$el.val(this.model.get('value')); - } - _.each(['readonly', 'disabled'], function (attr_name) { - self.model.get(attr_name) ? self.$el.attr(attr_name, true) : self.$el.removeAttr(attr_name); - }); - this.$el[this.model.get('visible') ? 'show' : 'hide'](); - return this; - }, - _onchange: function () { - this.value(this.$el.val()); - this.model.get('onchange') && this.model.get('onchange')(this.model.get('value')); - } - }); - - /** Creates a hidden element input field used e.g. in the tool form */ - var Hidden = Backbone.View.extend({ - initialize: function (options) { - this.model = options && options.model || new Backbone.Model(options); - this.setElement($('
').append(this.$info = $('
')).append(this.$hidden = $('
'))); - this.listenTo(this.model, 'change', this.render, this); - this.render(); - }, - value: function (new_val) { - new_val !== undefined && this.model.set('value', new_val); - return this.model.get('value'); - }, - render: function () { - 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(); - return this; - } - }); - - /** Creates a upload element input field */ - var Upload = Backbone.View.extend({ - initialize: function (options) { - var self = this; - this.model = options && options.model || new Backbone.Model(options); - this.setElement($('
').append(this.$info = $('
')).append(this.$file = $('').attr('type', 'file').addClass('ui-margin-bottom')).append(this.$text = $('', '
', '
'].join(''); - } - }); - - //============================================================================== - return { - CitationView: CitationView, - CitationListView: CitationListView - }; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) - -/***/ }), -/* 68 */, -/* 69 */, -/* 70 */, -/* 71 */, -/* 72 */, -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// from: https://raw.githubusercontent.com/umdjs/umd/master/jqueryPlugin.js - // Uses AMD or browser globals to create a jQuery plugin. - (function (factory) { - if (true) { - //TODO: So...this turns out to be an all or nothing thing. If I load jQuery in the define below, it will - // (of course) wipe the old jquery *and all the plugins loaded into it*. So the define below *is still - // relying on jquery being loaded globally* in order to preserve plugins. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - // Browser globals - factory(jQuery); - } - })(function (jQuery) { - 'use_strict'; - - var $ = jQuery; - - // ============================================================================ - /** - * Make an element with text editable: (a) when user clicks on text, a textbox/area - * is provided for editing; (b) when enter key pressed, element's text is set and on_finish - * is called. - */ - $.fn.make_text_editable = function (config_dict) { - // Get config options. - var num_cols = "num_cols" in config_dict ? config_dict.num_cols : 30, - num_rows = "num_rows" in config_dict ? config_dict.num_rows : 4, - use_textarea = "use_textarea" in config_dict ? config_dict.use_textarea : false, - on_finish = "on_finish" in config_dict ? config_dict.on_finish : null, - help_text = "help_text" in config_dict ? config_dict.help_text : null; - - // Add element behavior. - var container = $(this); - container.addClass("editable-text").click(function (e) { - // If there's already an input element, editing is active, so do nothing. - if ($(this).children(":input").length > 0) { - return; - } - - container.removeClass("editable-text"); - - // Handler for setting element text. - var set_text = function (new_text) { - container.find(":input").remove(); - - if (new_text !== "") { - container.text(new_text); - } else { - // No text; need a line so that there is a click target. - container.html("
"); - } - container.addClass("editable-text"); - - if (on_finish) { - on_finish(new_text); - } - }; - - // Create input element(s) for editing. - var cur_text = "cur_text" in config_dict ? config_dict.cur_text : container.text(), - input_elt, - button_elt; - - if (use_textarea) { - input_elt = $("',"
","
"].join("")}});return{CitationView:n,CitationListView:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(67),i(61),i(7),i(6)],s=function(e,t,i,n){"use strict";var s=e.FoldoutListItemView,l=e.ListItemView,d=s.extend({className:s.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(e){this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,s.prototype.initialize.call(this,e)},_setUpListeners:function(){s.prototype._setUpListeners.call(this),this.listenTo(this.model,"change",function(e,t){a.has(e.changed,"deleted")?this.render():a.has(e.changed,"element_count")&&this.$("> .title-bar .subtitle").replaceWith(this._renderSubtitle())})},_renderSubtitle:function(){return o(this.templates.subtitle(this.model.toJSON(),this))},_getFoldoutPanelOptions:function(){var e=s.prototype._getFoldoutPanelOptions.call(this);return a.extend(e,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCListItemView("+e+")"}});d.prototype.templates=function(){var e=a.extend({},s.prototype.templates.warnings,{error:i.wrapTemplate(["<% if( model.error ){ %>",'
',n("There was an error getting the data for this collection"),": <%- model.error %>","
","<% } %>"]),purged:i.wrapTemplate(["<% if( model.purged ){ %>",'
',n("This collection has been deleted and removed from disk"),"
","<% } %>"]),deleted:i.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
',n("This collection has been deleted"),"
","<% } %>"])}),t=i.wrapTemplate(['
','
','<%- collection.element_identifier || collection.name %>',"
",'
',"
"],"collection"),o=i.wrapTemplate(['
','<% var countText = collection.element_count? ( collection.element_count + " " ) : ""; %>','<% if( collection.collection_type === "list" ){ %>',n("a list of <%- countText %>datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',n("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',n("a list of <%- countText %>dataset pairs"),'<% } else if( collection.collection_type === "list:list" ){ %>',n("a list of <%- countText %>dataset lists"),"<% } %>","
"],"collection");return a.extend({},s.prototype.templates,{warnings:e,titleBar:t,subtitle:o})}();var c=l.extend({className:l.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DCEListItemView.initialize:",e),l.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCEListItemView("+e+")"}});c.prototype.templates=function(){var e=i.wrapTemplate(['
','
','<%- element.element_identifier %>',"
",'
',"
"],"element");return a.extend({},l.prototype.templates,{titleBar:e})}();var h=t.DatasetListItemView.extend({className:t.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DatasetDCEListItemView.initialize:",e),t.DatasetListItemView.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):r.when()},toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetDCEListItemView("+e+")"}});h.prototype.templates=function(){var e=i.wrapTemplate(['
','','
','<%- element.element_identifier %>',"
","
"],"element");return a.extend({},t.DatasetListItemView.prototype.templates,{titleBar:e})}();var u=d.extend({className:d.prototype.className+" dataset-collection-element",_swapNewRender:function(e){d.prototype._swapNewRender.call(this,e);var t=this.model.get("state")||"ok";return this.$el.addClass("state-"+t),this.$el},toString:function(){var e=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+e+")"}});return{DCListItemView:d,DCEListItemView:c,DatasetDCEListItemView:h,NestedDCDCEListItemView:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(86),i(7),i(6)],s=function(e,t,i){"use strict";var n={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(e){return a.extend(e,e.object,{element_id:e.id}),delete e.object,e},constructor:function(e,t){e=this._mergeObject(e),this.idAttribute="element_id",o.Model.apply(this,arguments)},parse:function(e,t){var i=e;return i=this._mergeObject(i)}},s=o.Model.extend(t.LoggableMixin).extend(n).extend({_logNamespace:"collections"}),l=o.Collection.extend(t.LoggableMixin).extend({_logNamespace:"collections",model:s,toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),d=e.DatasetAssociation.extend(t.mixin(n,{url:function(){return this.has("history_id")?Galaxy.root+"api/histories/"+this.get("history_id")+"/contents/"+this.get("id"):(console.warn("no endpoint for non-hdas within a collection yet"),Galaxy.root+"api/datasets")},defaults:a.extend({},e.DatasetAssociation.prototype.defaults,n.defaults),_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")+"&hdca_id="+this.get("parent_hdca_id")+"&element_identifier="+this.get("element_identifier")},constructor:function(e,t){this.debug("\t DatasetDCE.constructor:",e,t),n.constructor.call(this,e,t)},hasDetails:function(){return this.elements&&this.elements.length},toString:function(){var e=this.get("element_identifier");return["DatasetDCE(",e,")"].join("")}})),c=l.extend({model:d,toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),h=o.Model.extend(t.LoggableMixin).extend(t.SearchableModelMixin).extend({_logNamespace:"collections",defaults:{collection_type:null,deleted:!1},collectionClass:l,initialize:function(e,t){this.debug(this+"(DatasetCollection).initialize:",e,t,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var e=this.get("elements")||[];this.unset("elements",{silent:!0});var t=this;return a.each(e,function(e,i){a.extend(e,{parent_hdca_id:t.get("id")})}),this.elements=new this.collectionClass(e),this.elements},toJSON:function(){var e=o.Model.prototype.toJSON.call(this);return this.elements&&(e.elements=this.elements.toJSON()),e},inReadyState:function(){var e=this.get("populated");return this.isDeletedOrPurged()||e},hasDetails:function(){return 0!==this.elements.length},getVisibleContents:function(e){return this.elements},parse:function(e,t){var i=o.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},delete:function(e){return this.get("deleted")?r.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},e)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name","tags"],toString:function(){var e=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+e.join(",")+")"}}),u=h.extend({collectionClass:c,toString:function(){return"List"+h.prototype.toString.call(this)}}),p=u.extend({toString:function(){return"Pair"+h.prototype.toString.call(this)}}),f=h.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",e,")"].join("")}})),g=l.extend({model:f,toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),m=p.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedPairDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",e,")"].join("")}})),v=g.extend({model:m,toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),_=h.extend({collectionClass:v,toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}}),y=u.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedListDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedListDCDCE(",e,")"].join("")}})),w=g.extend({model:y,toString:function(){return["NestedListDCDCECollection(",this.length,")"].join("")}}),b=h.extend({collectionClass:w,toString:function(){return["ListOfListsDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:u,PairDatasetCollection:p,ListPairedDatasetCollection:_,ListOfListsDatasetCollection:b}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(63),i(18),i(7),i(83),i(8),i(101),i(6),i(98)],s=function(e,t,i,n,s,d,c){"use strict";function h(e,t){var i=e.toJSON(),n=m(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=t.map(function(e){return{id:e.id,name:e.name,src:"dataset"===e.history_content_type?"hda":"hdca"}}),e.createHDCA(t,"list",i,n)}});return n}var u="collections",p=a.View.extend(i.LoggableMixin).extend({_logNamespace:u,tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.selected=e.selected||!1},render:function(){return this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})),this.selected&&this.$el.addClass("selected"),this},template:o.template(['',"<%- element.name %>","",'"].join("")),select:function(e){this.$el.toggleClass("selected",e),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var e=this,t=this.$el.parent().width();this.$el.animate({"margin-right":t},"fast",function(){e.trigger("discard",{source:e}),e.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(e){e.stopPropagation(),this.select(e)},_clickName:function(e){e.stopPropagation(),e.preventDefault();var t=([c("Enter a new name for the element"),":\n(",c("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(c("Enter a new name for the element")+":",this.element.name));t&&(this.element.name=t,this.render())},_clickDiscard:function(e){e.stopPropagation(),this.discard()},_dragstart:function(e){e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(e){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"DatasetCollectionElementView()"}}),f=a.View.extend(i.LoggableMixin).extend(n.CollectionCreatorMixin).extend({_logNamespace:u,elementViewClass:p,collectionClass:e.HistoryListDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},footerSettings:{".hide-originals":"hideOriginals"},initialize:function(e){this.metric("ListCollectionCreator.initialize",e);var t=this;o.each(this.defaultAttributes,function(i,n){i=e[n]||i,t[n]=i}),t.initialElements=e.elements||[],this._setUpCommonSettings(e),this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(e){e.hasOwnProperty("id")||(e.id=o.uniqueId())}),this.workingElements},_validateElements:function(){var e=this;return e.invalidElements=[],this.workingElements=this.workingElements.filter(function(t){var i=e._isElementInvalid(t);return i&&e.invalidElements.push({element:t,text:i}),!i}),this.workingElements},_isElementInvalid:function(e){if("dataset"!==e.history_content_type)return c("is not a dataset");var i=e.state===t.OK||o.contains(t.NOT_READY_STATES,e.state);return i?e.deleted||e.purged?c("has been deleted or purged"):null:c("has errored, is paused, or is not accessible")},_mangleDuplicateNames:function(){var e=900,t=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+t+")",t+=1,t>=e)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(e){},render:function(e,t){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(e,t){var i=this,n=l("
"),s=i.$list();o.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),i.workingElements.forEach(function(e){var t=i._createElementView(e);n.append(t.$el)}),i._renderClearSelected(),s.empty().append(n.children()),o.invoke(i.elementViews,"render"),s.height()>s.css("max-height")?s.css("border-width","1px 0px 1px 0px"):s.css("border-width","0px")},_createElementView:function(e){var t=new this.elementViewClass({element:e,selected:o.has(this.selectedIds,e.id)});return this.elementViews.push(t),this._listenToElementView(t),t},_listenToElementView:function(e){var t=this;t.listenTo(e,{select:function(e){var i=e.source.element;e.selected?t.selectedIds[i.id]=!0:delete t.selectedIds[i.id],t.trigger("elements:select",e)},discard:function(e){t.trigger("elements:discard",e)}})},addElementView:function(e){},removeElementView:function(e){delete this.selectedIds[e.element.id],this._renderClearSelected(),this.elementViews=o.without(this.elementViews,e),this.stopListening(e)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(e){return e},createList:function(e){if(!this.workingElements.length){var t=c("No valid elements for final list")+". ";return t+=''+c("Cancel")+" ",t+=c("or"),t+=' '+c("start over")+".",void this._showAlert(t)}var i=this,n=this.workingElements.map(function(e){return i._elementToJSON(e)});return i.blocking=!0,i.creationFn(n,e,i.hideOriginals).always(function(){i.blocking=!1}).fail(function(e,t,n){i.trigger("error",{xhr:e,status:t,message:c("An error occurred while creating this collection")})}).done(function(e,t,n){i.trigger("collection:created",e,t,n),i.metric("collection:created",e),"function"==typeof i.oncreate&&i.oncreate.call(this,e,t,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(e){this._renderClearSelected()}),this.on("elements:discard",function(e){var t=e.source.element;this.removeElementView(e.source),this.workingElements=o.without(this.workingElements,t),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(e){this.error(e);var t=this,i=e.message||c("An error occurred");if(e.xhr){var n=e.xhr,s=e.message;i+=0===n.readyState&&0===n.status?": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes."):n.responseJSON?":
"+JSON.stringify(n.responseJSON)+"
":": "+s}t._showAlert(i,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=r('
');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=2,n=e.offset(),s=e.scrollTop(),a=t-n.top,o=n.top+e.outerHeight()-t;a>=0&&a=0&&oe&&a-o','',c("More help"),"",'","
",'
','','',"
"].join("")),middle:o.template(['",'
',"
"].join("")),footer:o.template(['
','
','","
",'
','','
',c("Name"),":
","
","
",'
','
','",'
','",'","
","
",'
','","
","
"].join("")),helpContent:o.template(["

",c(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"

","
    ","
  • ",c(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
  • ","
  • ",c(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
  • ","
  • ",c(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
  • ","
  • ",c(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
  • ","
  • ",c(['Click the "Cancel" button to exit the interface.'].join("")),"
  • ","

","

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

"].join("")),invalidElements:o.template([c("The following selections could not be included due to problems:"),"
    <% _.each( problems, function( problem ){ %>","
  • <%- problem.element.name %>: <%- problem.text %>
  • ","<% }); %>
"].join("")),noElementsLeft:o.template(['
  • ',c("No elements left! "),c("Would you like to "),'',c("start over"),"?","
  • "].join("")),invalidInitial:o.template(['
    ','
    ','',"<% if( _.size( problems ) ){ %>",c("The following selections could not be included due to problems"),":","
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    ","<% } else if( _.size( elements ) < 1 ){ %>",c("No datasets were selected"),".","<% } %>","
    ",c("At least one element is needed for the collection"),". ",c("You may need to "),'',c("cancel")," ",c("and reselect new elements"),".","
    ","
    ","
    ",'"].join(""))}),toString:function(){return"ListCollectionCreator"}}),g=function(e,t,i){var n,a=l.Deferred(),r=Galaxy.modal||new s.View;return t=o.defaults(t||{},{elements:e,oncancel:function(){r.hide(),a.reject("cancelled")},oncreate:function(e,t){r.hide(),a.resolve(t)}}),n=new i(t),r.show({title:t.title||c("Create a collection"),body:n.$el,width:"80%",height:"100%",closing_events:!0}),n.render(),window._collectionCreator=n,a},m=function(e,t){return t=t||{},t.title=c("Create a collection from a list of datasets"),g(e,t,f)};return{DatasetCollectionElementView:p,ListCollectionCreator:f,collectionCreatorModal:g,listCollectionCreatorModal:m,createListCollection:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(3),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(67),i(18),i(26),i(7),i(6)],s=function(e,t,i,n,s){"use strict";var d="dataset",c=e.ListItemView,h=c.extend({_logNamespace:d,className:c.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log(this+".initialize:",e),c.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_setUpListeners:function(){c.prototype._setUpListeners.call(this);var e=this;return e.listenTo(e.model,{change:function(t){e.model.changedAttributes().state&&e.model.inReadyState()&&e.expanded&&!e.model.hasDetails()?e.model.fetch({silent:!0}).done(function(){e.render()}):a.has(t.changed,"tags")&&1===a.keys(t.changed).length?e.$(".nametags").html(e._renderNametags()):e.render()}})},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):o.when()},remove:function(e,t){var i=this;e=e||this.fxSpeed,this.$el.fadeOut(e,function(){r.View.prototype.remove.call(i),t&&t.call(i)})},_swapNewRender:function(e){return c.prototype._swapNewRender.call(this,e),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),this.$el},_renderPrimaryActions:function(){ +return[this._renderDisplayButton()]},_renderDisplayButton:function(){var e=this.model.get("state");if(e===t.NOT_VIEWABLE||e===t.DISCARDED||!this.model.get("accessible"))return null;var n={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))n.disabled=!0,n.title=s("Cannot display datasets removed from disk");else if(e===t.UPLOAD)n.disabled=!0,n.title=s("This dataset must finish uploading before it can be viewed");else if(e===t.NEW)n.disabled=!0,n.title=s("This dataset is not yet viewable");else{n.title=s("View data"),n.href=this.model.urls.display;var a=this;n.onclick=function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.addDataset(a.model.get("id")),e.preventDefault())}}return n.faIcon="fa-eye",i(n)},_renderDetails:function(){if(this.model.get("state")===t.NOT_VIEWABLE)return l(this.templates.noAccess(this.model.toJSON(),this));var e=c.prototype._renderDetails.call(this);return e.find(".actions .left").empty().append(this._renderSecondaryActions()),e.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),e.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(e),e},_renderSummary:function(){var e=this.model.toJSON(),t=this.templates.summaries[e.state];return(t=t||this.templates.summaries.unknown)(e,this)},_renderDetailMessages:function(){var e=this,t=l('
    '),i=e.model.toJSON();return a.each(e.templates.detailMessages,function(n){t.append(l(n(i,e)))}),t},_renderDisplayApplications:function(){return this.model.isDeletedOrPurged()?"":[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){switch(this.debug("_renderSecondaryActions"),this.model.get("state")){case t.NOT_VIEWABLE:return[];case t.OK:case t.FAILED_METADATA:case t.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return i({title:s("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle",onclick:function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:"Dataset details",url:this.href}),e.preventDefault(),e.stopPropagation())}})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:a.isEmpty(this.model.get("meta_files"))?l(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var e=this.model.urls;return l(['"].join("\n"))},_renderNametags:function(){var e=a.template(["<% _.each(_.sortBy(_.uniq(tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<%- tag.slice(5) %>',"<% } %>","<% }); %>"].join(""));return e({tags:this.model.get("tags")})},events:a.extend(a.clone(c.prototype.events),{"click .display-btn":function(e){this.trigger("display",this,e)},"click .params-btn":function(e){this.trigger("params",this,e)},"click .download-btn":function(e){this.trigger("download",this,e)}}),toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetListItemView("+e+")"}});return h.prototype.templates=function(){var e=a.extend({},c.prototype.templates.warnings,{failed_metadata:n.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','
    ',s("An error occurred setting the metadata for this dataset"),"
    ","<% } %>"]),error:n.wrapTemplate(["<% if( model.error ){ %>",'
    ',s("There was an error getting the data for this dataset"),": <%- model.error %>","
    ","<% } %>"]),purged:n.wrapTemplate(["<% if( model.purged ){ %>",'
    ',s("This dataset has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:n.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',s("This dataset has been deleted"),"
    ","<% } %>"])}),i=n.wrapTemplate(['
    ','
    ','
    ','
    ','
    ',"
    ","<% if( !dataset.deleted && !dataset.purged ){ %>",'
    ','
    ','
    ',"<% if( dataset.peek ){ %>",'
    <%= dataset.peek %>
    ',"<% } %>","<% } %>","
    "],"dataset"),o=n.wrapTemplate(['
    ','
    ',s("You do not have permission to view this dataset"),"
    ","
    "],"dataset"),r={};r[t.OK]=r[t.FAILED_METADATA]=n.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'
    ','<%- dataset.misc_blurb %>',"
    ","<% } %>","<% if( dataset.file_ext ){ %>",'
    ','",'<%- dataset.file_ext %>',"
    ","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'
    ','",'',"<%- dataset.metadata_dbkey %>","","
    ","<% } %>","<% if( dataset.misc_info ){ %>",'
    ','<%- dataset.misc_info %>',"
    ","<% } %>"],"dataset"),r[t.NEW]=n.wrapTemplate(["
    ",s("This is a new dataset and not all of its data are available yet"),"
    "],"dataset"),r[t.NOT_VIEWABLE]=n.wrapTemplate(["
    ",s("You do not have permission to view this dataset"),"
    "],"dataset"),r[t.DISCARDED]=n.wrapTemplate(["
    ",s("The job creating this dataset was cancelled before completion"),"
    "],"dataset"),r[t.QUEUED]=n.wrapTemplate(["
    ",s("This job is waiting to run"),"
    "],"dataset"),r[t.RUNNING]=n.wrapTemplate(["
    ",s("This job is currently running"),"
    "],"dataset"),r[t.UPLOAD]=n.wrapTemplate(["
    ",s("This dataset is currently uploading"),"
    "],"dataset"),r[t.SETTING_METADATA]=n.wrapTemplate(["
    ",s("Metadata is being auto-detected"),"
    "],"dataset"),r[t.PAUSED]=n.wrapTemplate(["
    ",s('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"
    "],"dataset"),r[t.ERROR]=n.wrapTemplate(["<% if( !dataset.purged ){ %>","
    <%- dataset.misc_blurb %>
    ","<% } %>",'',s("An error occurred with this dataset"),":",'
    <%- dataset.misc_info %>
    '],"dataset"),r[t.EMPTY]=n.wrapTemplate(["
    ",s("No data"),": <%- dataset.misc_blurb %>
    "],"dataset"),r.unknown=n.wrapTemplate(['
    Error: unknown dataset state: "<%- dataset.state %>"
    '],"dataset");var l={resubmitted:n.wrapTemplate(["<% if( model.resubmitted ){ %>",'
    ',s("The job creating this dataset has been resubmitted"),"
    ","<% } %>"])},d=n.wrapTemplate(["<% _.each( apps, function( app ){ %>",'
    ','<%- app.label %> ','',"<% _.each( app.links, function( link ){ %>",'',"<% print( _l( link.text ) ); %>"," ","<% }); %>","","
    ","<% }); %>"],"apps");return a.extend({},c.prototype.templates,{warnings:e,details:i,noAccess:o,summaries:r,detailMessages:l,displayApplications:d})}(),{DatasetListItemView:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(10),i(5)],s=function(e,t){var i=a.View.extend({initialize:function(e){this.model=new a.Model(e),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement("
    "),this.render()},render:function(){var i=this;o.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(n){var s=o.extend({},i.model.attributes,n),a=new e({title:s.title,message:s.message,status:s.status||"warning",icon:s.icon,inputs:s.inputs,buttons:{submit:new t.Button({tooltip:s.submit_tooltip,title:s.submit_title||"Save",icon:s.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){i._submit(a)}})}});i.$el.empty().append(a.$el)}).fail(function(e){i.$el.empty().append(new t.Message({message:"Failed to load resource "+i.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e){var t=this;o.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(i){var n={message:i.message,status:"success",persistent:!1};t.redirect?window.location=Galaxy.root+t.redirect+"?"+o.param(n):(e.data.matchModel(i,function(t,i){e.field_list[i].value(t.value)}),t._showMessage(e,n))}).fail(function(i){t._showMessage(e,{message:i.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(e,t){var i=e.$el.parents().filter(function(){return["auto","scroll"].indexOf(o(this).css("overflow"))!=-1}).first();i.animate({scrollTop:0},500),e.message.update(t)}});return{View:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1))},function(e,t,i){var n,s;(function(a){n=[i(59),i(91),i(6)],s=function(e,t,i){"use strict";function n(e){return function(t,i){return this.isNew()&&(i=i||{},i.url=this.urlRoot+this.get("history_id")+"/contents",t=t||{},t.type="dataset_collection"),e.call(this,t,i)}}var s=t.HistoryContentMixin,o=e.ListDatasetCollection,r=e.PairDatasetCollection,l=e.ListPairedDatasetCollection,d=e.ListOfListsDatasetCollection,c=o.extend(s).extend({defaults:a.extend(a.clone(o.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list",model_class:"HistoryDatasetCollectionAssociation"}),save:n(o.prototype.save),toString:function(){return"History"+o.prototype.toString.call(this)}}),h=r.extend(s).extend({defaults:a.extend(a.clone(r.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"paired",model_class:"HistoryDatasetCollectionAssociation"}),save:n(r.prototype.save),toString:function(){return"History"+r.prototype.toString.call(this)}}),u=l.extend(s).extend({defaults:a.extend(a.clone(l.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list:paired",model_class:"HistoryDatasetCollectionAssociation"}),save:n(l.prototype.save),toString:function(){return"History"+l.prototype.toString.call(this)}}),p=d.extend(s).extend({defaults:a.extend(a.clone(d.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list:list",model_class:"HistoryDatasetCollectionAssociation"}),save:n(d.prototype.save),toString:function(){return["HistoryListOfListsDatasetCollection(",this.get("name"),")"].join("")}});return{HistoryListDatasetCollection:c,HistoryPairDatasetCollection:h,HistoryListPairedDatasetCollection:u,HistoryListOfListsDatasetCollection:p}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o,r){n=[i(82),i(89),i(63),i(66),i(7),i(156)],s=function(e,t,i,n,s,l){"use strict";var d=e.PaginatedCollection,c=d.extend(s.LoggableMixin).extend({_logNamespace:"history",model:function(e,n){if("dataset"===e.history_content_type)return new t.HistoryDatasetAssociation(e,n);if("dataset_collection"===e.history_content_type){switch(e.collection_type){case"list":return new i.HistoryListDatasetCollection(e,n);case"paired":return new i.HistoryPairDatasetCollection(e,n);case"list:paired":return new i.HistoryListPairedDatasetCollection(e,n);case"list:list":return new i.HistoryListOfListsDatasetCollection(e,n)}var s="Unknown collection_type: "+e.collection_type;return console.warn(s,e),{validationError:s}}return{validationError:"Unknown history_content_type: "+e.history_content_type}},limitPerPage:500,limitPerProgressiveFetch:500,order:"hid",urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(e,t){t=t||{},d.prototype.initialize.call(this,e,t),this.history=t.history||null,this.setHistoryId(t.historyId||null),this.includeDeleted=t.includeDeleted||this.includeDeleted,this.includeHidden=t.includeHidden||this.includeHidden,this.model.prototype.idAttribute="type_id"},setHistoryId:function(e){this.historyId=e,this._setUpWebStorage()},_setUpWebStorage:function(e){if(this.historyId)return this.storage=new n.HistoryPrefs({id:n.HistoryPrefs.historyStorageKey(this.historyId)}),this.trigger("new-storage",this.storage,this),this.on({"include-deleted":function(e){this.storage.includeDeleted(e)},"include-hidden":function(e){this.storage.includeHidden(e)}}),this.includeDeleted=this.storage.includeDeleted()||!1,this.includeHidden=this.storage.includeHidden()||!1,this},comparators:a.extend(a.clone(d.prototype.comparators),{name:s.buildComparator("name",{ascending:!0}),"name-dsc":s.buildComparator("name",{ascending:!1}),hid:s.buildComparator("hid",{ascending:!1}),"hid-asc":s.buildComparator("hid",{ascending:!0})}),running:function(){return this.filter(function(e){return!e.inReadyState()})},runningAndActive:function(){return this.filter(function(e){return!e.inReadyState()&&e.get("visible")&&!e.get("deleted")})},getByHid:function(e){return this.findWhere({hid:e})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},hidden:function(){return this.filter(function(e){return e.hidden()})},deleted:function(){return this.filter(function(e){return e.get("deleted")})},visibleAndUndeleted:function(){return this.filter(function(e){return e.get("visible")&&!e.get("deleted")})},setIncludeDeleted:function(e,t){if(a.isBoolean(e)&&e!==this.includeDeleted){if(this.includeDeleted=e,a.result(t,"silent"))return;this.trigger("include-deleted",e,this)}},setIncludeHidden:function(e,t){if(a.isBoolean(e)&&e!==this.includeHidden){if(this.includeHidden=e,t=t||{},a.result(t,"silent"))return;this.trigger("include-hidden",e,this)}},fetch:function(e){if(e=e||{},this.historyId&&!e.details){var t=n.HistoryPrefs.get(this.historyId).toJSON();a.isEmpty(t.expandedIds)||(e.details=a.values(t.expandedIds).join(","))}return d.prototype.fetch.call(this,e)},_buildFetchData:function(e){return a.extend(d.prototype._buildFetchData.call(this,e),{v:"dev"})},_fetchParams:d.prototype._fetchParams.concat(["v","details"]),_buildFetchFilters:function(e){var t=d.prototype._buildFetchFilters.call(this,e)||{},i={};return this.includeDeleted||(i.deleted=!1,i.purged=!1),this.includeHidden||(i.visible=!0),a.defaults(t,i)},getTotalItemCount:function(){return this.history.contentsShown()},fetchUpdated:function(e,t){return e&&(t=t||{filters:{}},t.remove=!1,t.filters={"update_time-ge":e.toISOString(),visible:""}),this.fetch(t)},fetchDeleted:function(e){e=e||{};var t=this;return e.filters=a.extend(e.filters,{deleted:!0,purged:void 0}),e.remove=!1,t.trigger("fetching-deleted",t),t.fetch(e).always(function(){t.trigger("fetching-deleted-done",t)})},fetchHidden:function(e){e=e||{};var t=this;return e.filters=a.extend(e.filters,{visible:!1}),e.remove=!1,t.trigger("fetching-hidden",t),t.fetch(e).always(function(){t.trigger("fetching-hidden-done",t)})},fetchAllDetails:function(e){e=e||{};var t={details:"all"};return e.data=a.extend(e.data||{},t),this.fetch(e)},fetchCollectionCounts:function(e){return e=e||{},e.keys=["type_id","element_count"].join(","),e.filters=a.extend(e.filters||{},{history_content_type:"dataset_collection"}),e.remove=!1,this.fetch(e)},_filterAndUpdate:function(e,t){var i=this,n=i.model.prototype.idAttribute,s=[t];return i.fetch({filters:e,remove:!1}).then(function(e){return e=e.reduce(function(e,t,s){var a=i.get(t[n]);return a?e.concat(a):e},[]),i.ajaxQueue("save",s,e)})},ajaxQueue:function(e,t,i){return i=i||this.models,new l.AjaxQueue(i.slice().reverse().map(function(i,n){var s=a.isString(e)?i[e]:e;return function(){return s.apply(i,t)}})).deferred},progressivelyFetchDetails:function(e){function i(t){t=t||0;var o=a.extend(a.clone(e),{view:"summary",keys:d,limit:r,offset:t,reset:0===t,remove:!1});a.defer(function(){s.fetch.call(s,o).fail(n.reject).done(function(e){n.notify(e,r,t),e.length!==r?(s.allFetched=!0,n.resolve(e,r,t)):i(t+r)})})}e=e||{};var n=o.Deferred(),s=this,r=e.limitPerCall||s.limitPerProgressiveFetch,l=t.HistoryDatasetAssociation.prototype.searchAttributes,d=l.join(",");return i(),n},isCopyable:function(e){var t=["HistoryDatasetAssociation","HistoryDatasetCollectionAssociation"];return a.isObject(e)&&e.id&&a.contains(t,e.model_class)},copy:function(e){var t,i,n;a.isString(e)?(t=e,n="hda",i="dataset"):(t=e.id,n={HistoryDatasetAssociation:"hda",LibraryDatasetDatasetAssociation:"ldda",HistoryDatasetCollectionAssociation:"hdca"}[e.model_class]||"hda",i="hdca"===n?"dataset_collection":"dataset");var s=this,r=o.ajax(this.url(),{method:"POST",contentType:"application/json",data:JSON.stringify({content:t,source:n,type:i})}).done(function(e){s.add([e],{parse:!0})}).fail(function(e,a,o){s.trigger("error",s,r,{},"Error copying contents",{type:i,id:t,source:n})});return r},createHDCA:function(e,t,i,n,s){var a=this.model({history_content_type:"dataset_collection",collection_type:t,history_id:this.historyId,name:i,hide_source_items:n||!1,element_identifiers:e});return a.save(s)},haveSearchDetails:function(){return this.allFetched&&this.all(function(e){return a.has(e.attributes,"annotation")})},matches:function(e){return this.filter(function(t){return t.matches(e)})},clone:function(){var e=r.Collection.prototype.clone.call(this);return e.historyId=this.historyId,e},toString:function(){return["HistoryContents(",[this.historyId,this.length].join(),")"].join("")}});return{HistoryContents:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(64),i(66),i(82),i(4),i(7),i(6)],s=function(e,t,i,n,s,d){"use strict";var c=a.Model.extend(s.LoggableMixin).extend(s.mixin(s.SearchableModelMixin,{_logNamespace:"history",UPDATE_DELAY:4e3,defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",deleted:!1,contents_active:{},contents_states:{}},urlRoot:Galaxy.root+"api/histories",contentsClass:e.HistoryContents,searchAttributes:["name","annotation","tags"],searchAliases:{title:"name",tag:"tags"},initialize:function(e,t){t=t||{},this.logger=t.logger||null,this.log(this+".initialize:",e,t),this.contents=new this.contentsClass([],{history:this,historyId:this.get("id"),order:t.order}),this._setUpListeners(),this._setUpCollectionListeners(),this.updateTimeoutId=null},_setUpListeners:function(){return this.on({error:function(e,t,i,n,s){this.clearUpdateTimeout()},"change:id":function(e,t){this.contents&&(this.contents.historyId=t)}})},_setUpCollectionListeners:function(){return this.contents?this.listenTo(this.contents,{error:function(){this.trigger.apply(this,o.makeArray(arguments))}}):this},contentsShown:function(){var e=this.get("contents_active"),t=e.active||0;return t+=this.contents.includeDeleted?e.deleted:0,t+=this.contents.includeHidden?e.hidden:0},nice_size:function(){var e=this.get("size");return e?n.bytesToString(e,!0,2):d("(empty)")},toJSON:function(){return r.extend(a.Model.prototype.toJSON.call(this),{nice_size:this.nice_size()})},get:function(e){return"nice_size"===e?this.nice_size():a.Model.prototype.get.apply(this,arguments)},ownedByCurrUser:function(){return!(!Galaxy||!Galaxy.user)&&(!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.get("user_id"))},numOfUnfinishedJobs:function(){var e=this.get("non_ready_jobs");return e?e.length:0},numOfUnfinishedShownContents:function(){return this.contents.runningAndActive().length||0},_fetchContentRelatedAttributes:function(){var e=["size","non_ready_jobs","contents_active","hid_counter"];return this.fetch({data:l.param({keys:e.join(",")})})},refresh:function(e){e=e||{};var t=this,i=t.lastUpdateTime;this.contents.allFetched=!1;var n=0!==t.contents.currentPage?function(){return t.contents.fetchPage(t.contents.currentPage)}:function(){return t.contents.fetchUpdated(i)};return n().done(function(i,n,s){var a;try{a=new Date(s.getResponseHeader("Date"))}catch(e){}t.lastUpdateTime=a||new Date,t.checkForUpdates(e)})},checkForUpdates:function(e){function t(){n.clearUpdateTimeout(),n.updateTimeoutId=setTimeout(function(){n.refresh(e)},i)}e=e||{};var i=this.UPDATE_DELAY,n=this;if(n.id){var s=this.numOfUnfinishedShownContents();s>0?t():n._fetchContentRelatedAttributes().done(function(e){n.numOfUnfinishedJobs()>0?t():n.trigger("ready")})}},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},parse:function(e,t){var i=a.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},fetchWithContents:function(e,t){e=e||{};var i=this;return e.view="dev-detailed",this.fetch(e).then(function(e){return i.contents.history=i,i.contents.setHistoryId(e.id),i.fetchContents(t)})},fetchContents:function(e){e=e||{};var t=this;return t.lastUpdateTime=new Date,t.contents.fetchCurrentPage(e)},_delete:function(e){return this.get("deleted")?o.when():this.save({deleted:!0},e)},purge:function(e){return this.get("purged")?o.when():this.save({deleted:!0,purged:!0},e)},undelete:function(e){return this.get("deleted")?this.save({deleted:!1},e):o.when()},copy:function(e,t,i){if(e=void 0===e||e,!this.id)throw new Error("You must set the history ID before copying it.");var n={history_id:this.id};e&&(n.current=!0),t&&(n.name=t),i||(n.all_datasets=!1),n.view="dev-detailed";var s=this,a=o.post(this.urlRoot,n);return e?a.then(function(e){var t=new c(e);return t.setAsCurrent().done(function(){s.trigger("copied",s,e)})}):a.done(function(e){s.trigger("copied",s,e)})},setAsCurrent:function(){var e=this,t=o.getJSON(Galaxy.root+"history/set_as_current?id="+this.id);return t.done(function(){e.trigger("set-as-current",e)}),t},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}})),h=i.InfinitelyScrollingCollection,u=h.extend(s.LoggableMixin).extend({_logNamespace:"history",model:c,order:"update_time",limitOnFirstFetch:10,limitPerFetch:10,initialize:function(e,t){t=t||{},this.log("HistoryCollection.initialize",e,t),h.prototype.initialize.call(this,e,t),this.includeDeleted=t.includeDeleted||!1,this.currentHistoryId=t.currentHistoryId,this.setUpListeners()},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot},setUpListeners:function(){return this.on({"change:deleted":function(e){this.debug("change:deleted",this.includeDeleted,e.get("deleted")),!this.includeDeleted&&e.get("deleted")&&this.remove(e)},copied:function(e,t){this.setCurrent(new c(t,[]))},"set-as-current":function(e){var t=this.currentHistoryId;this.trigger("no-longer-current",t),this.currentHistoryId=e.id}})},_buildFetchData:function(e){return r.extend(h.prototype._buildFetchData.call(this,e),{view:"dev-detailed"})},_buildFetchFilters:function(e){var t=h.prototype._buildFetchFilters.call(this,e)||{},i={};return this.includeDeleted?i.deleted=null:(i.deleted=!1,i.purged=!1),r.defaults(t,i)},fetchFirst:function(e){var t=this,i=l.when();return this.currentHistoryId&&(i=h.prototype.fetchFirst.call(t,{silent:!0,limit:1,filters:{purged:"",deleted:"","encoded_id-in":this.currentHistoryId}})),i.then(function(){return e=e||{},e.offset=0,t.fetchMore(e)})},comparators:r.extend(r.clone(h.prototype.comparators),{name:s.buildComparator("name",{ascending:!0}),"name-dsc":s.buildComparator("name",{ascending:!1}),size:s.buildComparator("size",{ascending:!1}),"size-asc":s.buildComparator("size",{ascending:!0})}),sort:function(e){e=e||{};var t=e.silent,i=this.remove(this.get(this.currentHistoryId));return h.prototype.sort.call(this,r.defaults({silent:!0},e)),this.unshift(i,{silent:!0}),t||this.trigger("sort",this,e),this},create:function(e,t,i,n){var s=this,a=o.getJSON(Galaxy.root+"history/create_new_current");return a.done(function(e){s.setCurrent(new c(e,[],i||{}))})},setCurrent:function(e,t){return t=t||{},this.unshift(e,t),this.currentHistoryId=e.get("id"),t.silent||this.trigger("new-current",e,this),this},toString:function(){return"HistoryCollection("+this.length+",current:"+this.currentHistoryId+")"}});return{History:c,HistoryCollection:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(3),i(1))},function(e,t,i){var n,s;(function(a){n=[i(7)],s=function(e){"use strict";var t=e.SessionStorageModel.extend({defaults:{expandedIds:{},show_deleted:!1,show_hidden:!1},addExpanded:function(e){var t=this.get("expandedIds");t[e.id]=e.get("id"),this.save("expandedIds",t)},removeExpanded:function(e){var t=this.get("expandedIds");delete t[e.id],this.save("expandedIds",t)},isExpanded:function(e){return a.result(this.get("expandedIds"),e,!1)},allExpanded:function(){return a.values(this.get("expandedIds"))},clearExpanded:function(){this.set("expandedIds",{})},includeDeleted:function(e){return a.isUndefined(e)||this.set("show_deleted",e),this.get("show_deleted")},includeHidden:function(e){return a.isUndefined(e)||this.set("show_hidden",e),this.get("show_hidden")},toString:function(){return"HistoryPrefs("+this.id+")"}},{storageKeyPrefix:"history:",historyStorageKey:function(e){if(!e)throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+e);return t.storageKeyPrefix+e},get:function(e){return new t({id:t.historyStorageKey(e)})},clearAll:function(e){for(var i in sessionStorage)0===i.indexOf(t.storageKeyPrefix)&&sessionStorage.removeItem(i)}});return{HistoryPrefs:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(7),i(6)],s=function(e,t){"use strict";var i="list",n=a.View.extend(e.LoggableMixin).extend({_logNamespace:i,initialize:function(e){this.expanded=e.expanded||!1,this.log("\t expanded:",this.expanded),this.fxSpeed=void 0!==e.fxSpeed?e.fxSpeed:this.fxSpeed},fxSpeed:"fast",render:function(e){var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){var e=o(this.templates.el(this.model.toJSON(),this));return this.expanded&&this.$details(e).replaceWith(this._renderDetails().show()),e},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;0===t?(i._swapNewRender(e),i.trigger("rendered",i)):o(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",r.isFunction(this.className)?this.className():this.className).append(e.children())},_setUpBehaviors:function(e){e=e||this.$el,e.find("[title]").tooltip({placement:"bottom"})},$details:function(e){return e=e||this.$el,e.find("> .details")},_renderDetails:function(){var e=o(this.templates.details(this.model.toJSON(),this));return this._setUpBehaviors(e),e},toggleExpanded:function(e){return e=void 0===e?!this.expanded:e,e?this.expand():this.collapse(),this},expand:function(){var e=this;return e._fetchModelDetails().always(function(){e._expand()})},_fetchModelDetails:function(){return this.model.hasDetails()?l.when():this.model.fetch()},_expand:function(){var e=this,t=e._renderDetails();e.$details().replaceWith(t),e.expanded=!0,e.$details().slideDown(e.fxSpeed,function(){e.trigger("expanded",e)})},collapse:function(){this.debug(this+"(ExpandableView).collapse");var e=this;e.expanded=!1,this.$details().slideUp(e.fxSpeed,function(){e.trigger("collapsed",e)})}}),s=n.extend(e.mixin(e.SelectableViewMixin,e.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(t){n.prototype.initialize.call(this,t),e.SelectableViewMixin.initialize.call(this,t),e.DraggableViewMixin.initialize.call(this,t),this._setUpListeners()},_setUpListeners:function(){return this.on("selectable",function(e){e?this.$(".primary-actions").hide():this.$(".primary-actions").show()},this),this},_buildNewRender:function(){var e=n.prototype._buildNewRender.call(this);return e.children(".warnings").replaceWith(this._renderWarnings()),e.children(".title-bar").replaceWith(this._renderTitleBar()),e.children(".primary-actions").append(this._renderPrimaryActions()),e.find("> .title-bar .subtitle").replaceWith(this._renderSubtitle()),e},_swapNewRender:function(e){return n.prototype._swapNewRender.call(this,e),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var e=this,t=o('
    '),i=e.model.toJSON();return r.each(e.templates.warnings,function(n){t.append(o(n(i,e)))}),t},_renderTitleBar:function(){return o(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return o(this.templates.subtitle(this.model.toJSON(),this))},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(e){e.stopPropagation(),e.altKey?(this.toggleSelect(e),this.selectable||this.showSelector()):this.toggleExpanded()},_keyDownTitleBar:function(e){var t=32,i=13;return!e||"keydown"!==e.type||e.keyCode!==t&&e.keyCode!==i||(this.toggleExpanded(),e.stopPropagation(),!1)},toString:function(){var e=this.model?this.model+"":"(no model)";return"ListItemView("+e+")"}}));s.prototype.templates=function(){var t=e.wrapTemplate(['
    ','
    ','
    ','',"
    ",'
    ','
    ','
    ',"
    "]),i={},n=e.wrapTemplate(['
    ','','
    ','<%- element.name %>',"
    ",'
    ',"
    "],"element"),s=e.wrapTemplate(['
    ']),a=e.wrapTemplate(['
    ']);return{el:t,warnings:i,titleBar:n,subtitle:s,details:a}}();var d=s.extend({foldoutStyle:"foldout",foldoutPanelClass:null,initialize:function(e){"drilldown"===this.foldoutStyle&&(this.expanded=!1),this.foldoutStyle=e.foldoutStyle||this.foldoutStyle,this.foldoutPanelClass=e.foldoutPanelClass||this.foldoutPanelClass,s.prototype.initialize.call(this,e),this.foldout=this._createFoldoutPanel()},_renderDetails:function(){if("drilldown"===this.foldoutStyle)return o();var e=s.prototype._renderDetails.call(this);return this._attachFoldout(this.foldout,e)},_createFoldoutPanel:function(){var e=this.model,t=this._getFoldoutPanelClass(e),i=this._getFoldoutPanelOptions(e),n=new t(r.extend(i,{model:e}));return n},_getFoldoutPanelClass:function(){return this.foldoutPanelClass},_getFoldoutPanelOptions:function(){return{foldoutStyle:this.foldoutStyle,fxSpeed:this.fxSpeed}},_attachFoldout:function(e,t){return t=t||this.$("> .details"),this.foldout=e.render(0),e.$("> .controls").hide(),t.append(e.$el)},expand:function(){var e=this;return e._fetchModelDetails().always(function(){"foldout"===e.foldoutStyle?e._expand():"drilldown"===e.foldoutStyle&&e._expandByDrilldown()})},_expandByDrilldown:function(){var e=this;e.listenTo(e.foldout,"close",function(){e.trigger("collapsed:drilldown",e,e.foldout)}),e.trigger("expanded:drilldown",e,e.foldout)}});return d.prototype.templates=function(){var t=e.wrapTemplate(['
    ',"
    "],"collection");return r.extend({},s.prototype.templates,{ +details:t})}(),{ExpandableView:n,ListItemView:s,FoldoutListItemView:d}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(3),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(3),i(27),i(17),i(47)],s=function(e,t,i,n){"use strict";var s={hidden:!1,show:function(){this.set("hidden",!1)},hide:function(){this.set("hidden",!0)},toggle:function(){this.set("hidden",!this.get("hidden"))},is_visible:function(){return!this.attributes.hidden}},r=a.Model.extend({defaults:{name:null,label:null,type:null,value:null,html:null,num_samples:5},initialize:function(e){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new r(this.toJSON())},set_value:function(e){this.set("value",e||"")}}),l=a.Collection.extend({model:r}),d=r.extend({}),c=r.extend({set_value:function(e){this.set("value",parseInt(e,10))},get_samples:function(){return d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}}),h=c.extend({set_value:function(e){this.set("value",parseFloat(e))}}),u=r.extend({get_samples:function(){return e.map(this.get("options"),function(e){return e[0]})}});r.subModelTypes={integer:c,float:h,data:d,select:u};var p=a.Model.extend({defaults:{id:null,name:null,description:null,target:null,inputs:[],outputs:[]},urlRoot:Galaxy.root+"api/tools",initialize:function(t){this.set("inputs",new l(e.map(t.inputs,function(e){var t=r.subModelTypes[e.type]||r;return new t(e)})))},toJSON:function(){var e=a.Model.prototype.toJSON.call(this);return e.inputs=this.get("inputs").map(function(e){return e.toJSON()}),e},remove_inputs:function(e){var t=this,i=t.get("inputs").filter(function(t){return e.indexOf(t.get("type"))!==-1});t.get("inputs").remove(i)},copy:function(e){var t=new p(this.toJSON());if(e){var i=new a.Collection;t.get("inputs").each(function(e){e.get_samples()&&i.push(e)}),t.set("inputs",i)}return t},apply_search_results:function(t){return e.indexOf(t,this.attributes.id)!==-1?this.show():this.hide(),this.is_visible()},set_input_value:function(e,t){this.get("inputs").find(function(t){return t.get("name")===e}).set("value",t)},set_input_values:function(t){var i=this;e.each(e.keys(t),function(e){i.set_input_value(e,t[e])})},run:function(){return this._run()},rerun:function(e,t){return this._run({action:"rerun",target_dataset_id:e.id,regions:t})},get_inputs_dict:function(){var e={};return this.get("inputs").each(function(t){e[t.get("name")]=t.get("value")}),e},_run:function(n){var s=e.extend({tool_id:this.id,inputs:this.get_inputs_dict()},n),a=o.Deferred(),r=new t.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(s),dataType:"json",contentType:"application/json",type:"POST"},interval:2e3,success_fn:function(e){return"pending"!==e}});return o.when(r.go()).then(function(e){a.resolve(new i.DatasetCollection(e))}),a}});e.extend(p.prototype,s);var f=(a.View.extend({}),a.Collection.extend({model:p})),g=a.Model.extend(s),m=a.Model.extend({defaults:{elems:[],open:!1},clear_search_results:function(){e.each(this.attributes.elems,function(e){e.show()}),this.show(),this.set("open",!1)},apply_search_results:function(t){var i,n=!0;e.each(this.attributes.elems,function(e){e instanceof g?(i=e,i.hide()):e instanceof p&&e.apply_search_results(t)&&(n=!1,i&&i.show())}),n?this.hide():(this.show(),this.set("open",!0))}});e.extend(m.prototype,s);var v=a.Model.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,clear_btn_url:"",visible:!0,query:"",results:null,clear_key:27},urlRoot:Galaxy.root+"api/tools",initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var e=this.attributes.query;if(e.length");e.append(E.tool_link(this.model.toJSON()));var t=this.model.get("form_style",null);if("upload1"===this.model.id)e.find("a").on("click",function(e){e.preventDefault(),Galaxy.upload.show()});else if("regular"===t){var i=this;e.find("a").on("click",function(e){e.preventDefault(),Galaxy.router.push("/",{tool_id:i.model.id,version:i.model.get("version")})})}return this.$el.append(e),this}}),b=y.extend({tagName:"div",className:"toolPanelLabel",render:function(){return this.$el.append(o("").text(this.model.attributes.text)),this}}),x=y.extend({tagName:"div",className:"toolSectionWrapper",initialize:function(){y.prototype.initialize.call(this),this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(E.panel_section(this.model.toJSON()));var t=this.$el.find(".toolSectionBody");return e.each(this.model.attributes.elems,function(e){if(e instanceof p){var i=new w({model:e,className:"toolTitle"});i.render(),t.append(i.$el)}else if(e instanceof g){var n=new b({model:e});n.render(),t.append(n.$el)}}),this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast")}}),C=a.View.extend({tagName:"div",id:"tool-search",className:"bar",events:{click:"focus_and_select","keyup :input":"query_changed","change :input":"query_changed","click #search-clear-btn":"clear"},render:function(){return this.$el.append(E.tool_search(this.model.toJSON())),this.model.is_visible()||this.$el.hide(),o("#messagebox").is(":visible")&&this.$el.css("top","95px"),this.$el.find("[title]").tooltip(),this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){return this.model.clear_search(),this.$el.find(":input").val(""),this.focus_and_select(),!1},query_changed:function(e){return this.model.attributes.clear_key&&this.model.attributes.clear_key===e.which?(this.clear(),!1):void this.model.set("query",this.$el.find(":input").val())}}),$=a.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.model.get("tool_search").on("change:results",this.handle_search_results,this)},render:function(){var e=this,t=new C({model:this.model.get("tool_search")});return t.render(),e.$el.append(t.$el),this.model.get("layout").each(function(t){if(t instanceof m){var i=new x({model:t});i.render(),e.$el.append(i.$el)}else if(t instanceof p){var n=new w({model:t,className:"toolTitleNoSection"});n.render(),e.$el.append(n.$el)}else if(t instanceof g){var s=new b({model:t});s.render(),e.$el.append(s.$el)}}),e.$el.find("a.tool-link").click(function(t){var i=o(this).attr("class").split(/\s+/)[0],n=e.model.get("tools").get(i);e.trigger("tool_link_click",t,n)}),this},handle_search_results:function(){var e=this.model.get("tool_search").get("results");e&&0===e.length?o("#search-no-results").show():o("#search-no-results").hide()}}),k=a.View.extend({className:"toolForm",render:function(){this.$el.children().remove(),this.$el.append(E.tool_form(this.model.toJSON()))}}),E=(a.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new $({collection:this.collection}),this.tool_form_view=new k},render:function(){this.tool_panel_view.render(),this.tool_panel_view.$el.css("float","left"),this.$el.append(this.tool_panel_view.$el),this.tool_form_view.$el.hide(),this.$el.append(this.tool_form_view.$el);var e=this;this.tool_panel_view.on("tool_link_click",function(t,i){t.preventDefault(),e.show_tool(i)})},show_tool:function(e){var t=this;e.fetch().done(function(){t.tool_form_view.model=e,t.tool_form_view.render(),t.tool_form_view.$el.show(),o("#left").width("650px")})}}),{tool_search:e.template(['',' ',''].join("")),panel_section:e.template(['",'