From 5e3187405abd4792c87e9fcce5f363077eef542f Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 13 Oct 2017 12:45:17 -0400 Subject: [PATCH] Bundle toastr in common libs --- client/webpack.config.js | 1 + static/scripts/bundled/analysis.bundled.js | 4 ++-- static/scripts/bundled/analysis.bundled.js.map | 2 +- static/scripts/bundled/libs.bundled.js | 14 +++++++------- static/scripts/bundled/libs.bundled.js.map | 2 +- static/scripts/bundled/login.bundled.js | 2 +- static/scripts/bundled/login.bundled.js.map | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/client/webpack.config.js b/client/webpack.config.js index 86e1ec2c504..4a44176fc2d 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -28,6 +28,7 @@ var commonLibs = [ // mvc "libs/underscore", "libs/backbone", + "libs/toastr", // all pages get these "ui/autocom_tagging", "layout/modal", diff --git a/static/scripts/bundled/analysis.bundled.js b/static/scripts/bundled/analysis.bundled.js index bcbfaa5872e..8ca19e3b62a 100644 --- a/static/scripts/bundled/analysis.bundled.js +++ b/static/scripts/bundled/analysis.bundled.js @@ -1,4 +1,4 @@ -webpackJsonp([2,1],[,,,,,function(e,t,i){"use strict";(function(n,s,o){var a,r;a=[i(3),i(17),i(29),i(18),i(30),i(10),i(7)],void 0!==(r=function(e,t,i,a,r,l,d){var c=n.View.extend({tagName:"label",initialize:function(e){this.model=e&&e.model||new n.Model(e),this.tagName=e.tagName||this.tagName,this.setElement(s("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},title:function(e){this.model.set("title",e)},value:function(){return this.model.get("title")},render:function(){return this.$el.removeClass().addClass("ui-label").addClass(this.model.get("cls")).html(this.model.get("title")),this}}),h=n.View.extend({initialize:function(e){this.model=e&&e.model||new n.Model({message:null,status:"info",cls:"",persistent:!1,fade:!0}).set(e),this.listenTo(this.model,"change",this.render,this),this.render()},update:function(e){this.model.set(e)},render:function(){this.$el.removeClass().addClass("ui-message").addClass(this.model.get("cls"));var e=this.model.get("status");if(this.model.get("large")?this.$el.addClass(("success"==e&&"done"||"danger"==e&&"error"||e)+"messagelarge"):this.$el.addClass("alert").addClass("alert-"+e),this.model.get("message")){if(this.$el.html(this.messageForDisplay()),this.$el[this.model.get("fade")?"fadeIn":"show"](),this.timeout&&window.clearTimeout(this.timeout),!this.model.get("persistent")){var t=this;this.timeout=window.setTimeout(function(){t.model.set("message","")},3e3)}}else this.$el.fadeOut();return this},messageForDisplay:function(){return o.escape(this.model.get("message"))}}),u=h.extend({messageForDisplay:function(){return this.model.get("message")}}),p=n.View.extend({initialize:function(e){this.model=e&&e.model||new n.Model({type:"text",placeholder:"",disabled:!1,readonly:!1,visible:!0,cls:"",area:!1,color:null,style:null}).set(e),this.tagName=this.model.get("area")?"textarea":"input",this.setElement(s("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},events:{input:"_onchange"},value:function(e){return void 0!==e&&this.model.set("value","string"==typeof e?e:""),this.model.get("value")},render:function(){var e=this;this.$el.removeClass().addClass("ui-"+this.tagName).addClass(this.model.get("cls")).addClass(this.model.get("style")).attr("id",this.model.id).attr("type",this.model.get("type")).attr("placeholder",this.model.get("placeholder")).css("color",this.model.get("color")||"").css("border-color",this.model.get("color")||"");var t=this.model.get("datalist");return s.isArray(t)&&t.length>0&&this.$el.autocomplete({source:function(t,i){i(e.model.get("datalist"))},change:function(){e._onchange()}}),this.model.get("value")!==this.$el.val()&&this.$el.val(this.model.get("value")),o.each(["readonly","disabled"],function(t){e.model.get(t)?e.$el.attr(t,!0):e.$el.removeAttr(t)}),this.$el[this.model.get("visible")?"show":"hide"](),this},_onchange:function(){this.value(this.$el.val()),this.model.get("onchange")&&this.model.get("onchange")(this.model.get("value"))}}),f=n.View.extend({initialize:function(e){this.model=e&&e.model||new n.Model(e),this.setElement(s("
").append(this.$info=s("
")).append(this.$hidden=s("
"))),this.listenTo(this.model,"change",this.render,this),this.render()},value:function(e){return void 0!==e&&this.model.set("value",e),this.model.get("value")},render:function(){return this.$el.attr("id",this.model.id),this.$hidden.val(this.model.get("value")),this.model.get("info")?this.$info.show().text(this.model.get("info")):this.$info.hide(),this}}),g=n.View.extend({initialize:function(e){var t=this;this.model=e&&e.model||new n.Model(e),this.setElement(s("
").append(this.$info=s("
")).append(this.$file=s("").attr("type","file").addClass("ui-margin-bottom")).append(this.$text=s("',"
","
"].join("")}});return{CitationView:s,CitationListView:o}}.apply(t,s))&&(e.exports=o)}).call(t,i(1))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e){var t=i(0),n=t,s=i(42).GalaxyApp,o=i(44),a=i(123),r=i(134),l=i(43),d=i(63),c=i(58),h=i(148),u=i(149),p=i(69),f=i(16),g=i(150),m=i(151),v=i(155),_=i(77),y=i(11),w=i(3),b=i(5),x=i(156),C=i(157);window.app=function(t,i){window.Galaxy=new s(t,i),Galaxy.debug("analysis app");var $=o.extend({routes:{"(/)":"home","(/)root*":"home","(/)tours(/)(:tour_id)":"show_tours","(/)user(/)":"show_user","(/)user(/)(:form_id)":"show_user_form","(/)workflow(/)":"show_workflows","(/)workflow/run(/)":"show_run","(/)pages(/)create(/)":"show_pages_create","(/)pages(/)edit(/)":"show_pages_edit","(/)pages(/)(:action_id)":"show_pages","(/)visualizations(/)edit(/)":"show_visualizations_edit","(/)visualizations/(:action_id)":"show_visualizations","(/)workflows/list_published(/)":"show_workflows_published","(/)histories(/)rename(/)":"show_histories_rename","(/)histories(/)permissions(/)":"show_histories_permissions","(/)histories(/)(:action_id)":"show_histories","(/)datasets(/)list(/)":"show_datasets","(/)workflow/import_workflow":"show_import_workflow","(/)custom_builds":"show_custom_builds","(/)datasets/edit":"show_dataset_edit_attributes","(/)datasets/error":"show_dataset_error"},require_login:["show_user","show_user_form","show_workflows"],authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id||-1==this.require_login.indexOf(t)},show_tours:function(e){e?p.giveTour(e):this.page.display(new p.ToursView)},show_user:function(){this.page.display(new h.View)},show_user_form:function(e){var t=new h.Model({user_id:Galaxy.params.id});this.page.display(new c.View(t.get(e)))},show_visualizations:function(e){this.page.display(new g.View({action_id:e,plural:"Visualizations",item:"visualization"}))},show_visualizations_edit:function(){this.page.display(new c.View({url:"visualization/edit?id="+y.get("id"),redirect:"visualizations/list"}))},show_workflows_published:function(){this.page.display(new f({url_base:Galaxy.root+"workflow/list_published",dict_format:!0}))},show_histories:function(e){this.page.display(new v.View({action_id:e}))},show_histories_rename:function(){this.page.display(new c.View({url:"history/rename?id="+y.get("id"),redirect:"histories/list"}))},show_histories_permissions:function(){this.page.display(new c.View({url:"history/permissions?id="+y.get("id"),redirect:"histories/list"}))},show_datasets:function(){this.page.display(new f({url_base:Galaxy.root+"dataset/list",dict_format:!0}))},show_pages:function(e){this.page.display(new g.View({action_id:e,plural:"Pages",item:"page"}))},show_pages_create:function(){this.page.display(new c.View({url:"page/create",redirect:"pages/list"}))},show_pages_edit:function(){this.page.display(new c.View({url:"page/edit?id="+y.get("id"),redirect:"pages/list"}))},show_workflows:function(){this.page.display(new m.View)},show_run:function(){this._loadWorkflow()},show_import_workflow:function(){this.page.display(new m.ImportWorkflowView)},show_custom_builds:function(){var e=this,t=this.page.historyPanel.historyView;if(!t||!t.model||!t.model.id)return void window.setTimeout(function(){e.show_custom_builds()},500);this.page.display(new u.View)},show_dataset_edit_attributes:function(){this.page.display(new C.View)},show_dataset_error:function(){this.page.display(new x.View)},home:function(e){e.tool_id||e.job_id?"upload1"===e.tool_id?(this.page.toolPanel.upload.show(),this._loadCenterIframe("welcome")):this._loadToolForm(e):e.workflow_id?this._loadWorkflow():e.m_c?this._loadCenterIframe(e.m_c+"/"+e.m_a):this._loadCenterIframe("welcome")},_loadToolForm:function(e){e.id=decodeURIComponent(e.tool_id),this.page.display(new d.View(e))},_loadCenterIframe:function(e,t){t=t||Galaxy.root,e=t+e,this.page.$("#galaxy_main").prop("src",e)},_loadWorkflow:function(){var e=this;w.get({url:Galaxy.root+"api/workflows/"+w.getQueryString("id")+"/download?style=run",success:function(t){e.page.display(new _.View(t))},error:function(t){var i=t.err_msg||"Error occurred while loading the resource.",n={message:i,status:"danger",persistent:!0};e.page.display(new b.Message(n))}})}});n(function(){Galaxy.page=new l.View(e.extend(t,{Left:a,Right:r,Router:$}))})}}).call(t,i(2))},function(e,t,i){"use strict";(function(t,n){var s=i(91),o=i(124),a=i(4),r=(i(77),t.View.extend({initialize:function(e,i){var n=i.config;this.root=i.root,this.stored_workflow_menu_entries=n.stored_workflow_menu_entries||[];var r=new s.ToolSearch({hidden:!1}),l=new s.ToolCollection(n.toolbox);this.tool_panel=new s.ToolPanel({tool_search:r,tools:l,layout:n.toolbox_in_panel}),this.tool_panel_view=new s.ToolPanelView({model:this.tool_panel}),this.upload_button=new o({nginx_upload_path:n.nginx_upload_path,ftp_upload_site:n.ftp_upload_site,default_genome:n.default_genome,default_extension:n.default_extension}),Galaxy.upload=this.upload_button,this.model=new t.Model({title:a("Tools"),buttons:[this.upload_button]}),this.setElement(this._template())},render:function(){var e=this;this.tool_panel.get("layout").size()>0&&(this.$el.prepend(this.tool_panel_view.$el),this.tool_panel_view.render()),e.$("#internal-workflows").append(e._templateAllWorkflow({title:a("All workflows"),href:"workflow"})),n.each(this.stored_workflow_menu_entries,function(t){e.$("#internal-workflows").append(e._templateWorkflowLink({title:t.stored_workflow.name,href:"workflow/run?id="+t.encoded_stored_workflow_id}))})},_templateTool:function(e){return['"].join("")},_templateAllWorkflow:function(e){return['"].join("")},_templateWorkflowLink:function(e){return['"].join("")},_template:function(){return['
','",'
','
','
',"",a("Workflows"),"","
",'
','
',"
","
"].join("")},toString:function(){return"toolPanel"}}));e.exports=r}).call(t,i(1),i(2))},function(e,t,i){"use strict";(function(n){var s,o;s=[i(3),i(7),i(62),i(125),i(126),i(129),i(131)],void 0!==(o=function(e,t,i,s,o,a,r){return n.View.extend({options:{nginx_upload_path:"",ftp_upload_site:"n/a",default_genome:"?",default_extension:"auto",height:500,width:900,auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."}},list_extensions:[],list_genomes:[],initialize:function(t){var i=this;this.options=e.merge(t,this.options),this.ui_button=new s.View({onclick:function(e){e.preventDefault(),i.show()},onunload:function(){var e=i.ui_button.model.get("percentage",0);if(e>0&&e<100)return"Several uploads are queued."}}),this.setElement(this.ui_button.$el);var i=this;e.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){for(var t in e)i.list_extensions.push({id:e[t].extension,text:e[t].extension,description:e[t].description,description_url:e[t].description_url,composite_files:e[t].composite_files});i.list_extensions.sort(function(e,t){var i=e.text&&e.text.toLowerCase(),n=t.text&&t.text.toLowerCase();return i>n?1:it.text?1:e.text0){var n={file_count:e.length,dbkey:e[0].get("genome","?"),file_type:e[0].get("extension","auto")};for(var s in e){var o=e[s];if(o.set("status","running"),!(o.get("file_size")>0)){i.error_message="Upload content incomplete.",o.set("status","error"),o.set("info",i.error_message);break}var a="files_"+s+"|";switch(n[a+"type"]="upload_dataset",n[a+"space_to_tab"]=o.get("space_to_tab")&&"Yes"||null,n[a+"to_posix_lines"]=o.get("to_posix_lines")&&"Yes"||null,n[a+"dbkey"]=o.get("genome",null),n[a+"file_type"]=o.get("extension",null),o.get("file_mode")){case"new":n[a+"url_paste"]=o.get("url_paste");break;case"ftp":n[a+"ftp_files"]=o.get("file_path");break;case"local":i.files.push({name:a+"file_data",file:o.get("file_data")})}}i.payload.inputs=JSON.stringify(n)}return i}})}.apply(t,s))&&(e.exports=o)}).call(t,i(1))},function(e,t,i){"use strict";(function(i,n){var s,o;s=[],void 0!==(o=function(){return{View:i.View.extend({initialize:function(e){var t=this;this.model=e&&e.model||new i.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",percentage:0,status:"",onunload:function(){},onclick:function(){}}).set(e),this.setElement(this._template()),this.$progress=this.$(".progress-bar"),this.listenTo(this.model,"change",this.render,this),this.render(),n(window).on("beforeunload",function(){return t.model.get("onunload")()})},render:function(){var e=this.model.attributes;this.$el.off("click").on("click",function(t){e.onclick(t)}).tooltip({title:this.model.get("tooltip"),placement:"bottom"}),this.$progress.removeClass().addClass("progress-bar").addClass("progress-bar-notransition").addClass(""!=e.status&&"progress-bar-"+e.status).css({width:e.percentage+"%"})},_template:function(){return'
'}})}}.apply(t,s))&&(e.exports=o)}).call(t,i(1),i(0))},function(e,t,i){"use strict";(function(n,s,o){var a,r;a=[i(3),i(21),i(127),i(46),i(47),i(12),i(14),i(5),i(128),i(48)],void 0!==(r=function(e,t,i,a,r,l,d,c,h){return n.View.extend({upload_size:0,collection:new t.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.$uploadbox=this.$(".upload-box"),this.$uploadtable=this.$(".upload-table"),this.btnLocal=new c.Button({id:"btn-local",title:"Choose local file",onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new c.Button({id:"btn-ftp",title:"Choose FTP file",onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new c.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new c.Button({id:"btn-start",title:"Start",onclick:function(){t._eventStart()}}),this.btnStop=new c.Button({id:"btn-stop",title:"Pause",onclick:function(){t._eventStop()}}),this.btnReset=new c.Button({id:"btn-reset",title:"Reset",onclick:function(){t._eventReset()}}),this.btnClose=new c.Button({id:"btn-close",title:"Close",onclick:function(){t.app.modal.hide()}}),s.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$uploadbox.uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$uploadbox.addClass("highlight")},ondragleave:function(){t.$uploadbox.removeClass("highlight")}}),this.ftp=new l.View({title:"FTP files",container:this.btnFtp.$el}),this.select_extension=new d.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:s.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t._changeExtension(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new r({$el:o(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new d.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t._changeGenome(e)}}),this.loader=new h({$container:this.$uploadbox,collection:this.collection,new_content:function(e){var n=new i(t,{model:e});return t.$uploadtable.find("> tbody:first").append(n.$el),n.render(),n}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this.render()},render:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running,s=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[n?"enable":"disable"](),this.btnFtp[n?"enable":"disable"](),this.btnCreate[n?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[s?"show":"hide"](),this.$(".upload-helper")[s?"hide":"show"]()},_eventAnnounce:function(e,i){this.counter.announce++;var n=new t.Model({id:e,file_name:i.name,file_size:i.size,file_mode:i.mode||"local",file_path:i.path,file_data:i});this.render(),this.collection.add(n)},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"success"}),this.ui_button.model.set("percentage",this._uploadPercentage(100,i.get("file_size"))),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.success++,this.render(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this.render()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this.render()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this.render()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new a({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(0!=this.counter.announce&&0==this.counter.running){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this._uploadFtp(),this.uploadbox.start(),this.render()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),o(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){if(0==this.counter.running){this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this.render()}},_changeExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},_changeGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_uploadFtp:function(){var e=this,t=[];this.collection.each(function(i){"queued"==i.get("status")&&"ftp"==i.get("file_mode")&&(e.uploadbox.remove(i.id),t.push(i))}),t.length>0&&o.uploadpost({data:this.app.toData(t),url:this.app.options.nginx_upload_path,success:function(i){s.each(t,function(t){e._eventSuccess(t.id)})},error:function(i){s.each(t,function(t){e._eventError(t.id,i)})}})},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'
Drop files here
'}})}.apply(t,a))&&(e.exports=r)}).call(t,i(1),i(2),i(0))},function(e,t,i){"use strict";(function(n,s,o){var a,r;a=[i(3),i(21),i(45),i(12),i(14)],void 0!==(r=function(e,t,i,a,r){return n.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$settings=this.$(".upload-settings"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new a.View({title:"Upload configuration",container:this.$(".upload-settings"),placement:"bottom"});var n=this.app.select_genome.value(),o=this.app.select_extension.value();this.select_genome=new r.View({css:"upload-genome",data:i.app.list_genomes,container:this.$(".upload-genome"),value:n,onchange:function(e){i.model.set("genome",e)}}),this.select_extension=new r.View({css:"upload-extension",data:i.app.list_extensions,container:this.$(".upload-extension"),value:o,onchange:function(e){i.model.set("extension",e)}}),this.model.set({genome:n,extension:o}),this.$symbol.on("click",function(){i._removeRow()}),this.$(".upload-extension-info").on("click",function(e){i.app.showExtensionInfo({$el:s(e.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(e){e.preventDefault()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:s(e.target).val(),file_size:s(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:genome",function(){i._refreshGenome()}),this.listenTo(this.model,"change:extension",function(){i._refreshExtension()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()})},render:function(){this._refreshType(),this._refreshPercentage(),this._refreshStatus(),this._refreshInfo(),this._refreshGenome(),this._refreshExtension(),this._refreshFileSize()},remove:function(){this.select_genome.remove(),this.select_extension.remove(),n.View.prototype.remove.apply(this)},_refreshType:function(){var t=this.model.attributes;this.$title.html(o.escape(t.file_name)),this.$size.html(e.bytesToString(t.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==t.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==t.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==t.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),t?(this.select_genome.enable(),this.select_extension.enable()):(this.select_genome.disable(),this.select_extension.disable()),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(e.bytesToString(this.model.get("file_size")))},_removeRow:function(){-1!==["init","success","error"].indexOf(this.model.get("status"))&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new i(this).$el),this.settings.show())},_template:function(e){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
',"
","
"].join("")}});return{CitationView:s,CitationListView:o}}.apply(t,s))&&(e.exports=o)}).call(t,i(1))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e){var t=i(0),n=t,s=i(42).GalaxyApp,o=i(44),a=i(125),r=i(136),l=i(43),d=i(63),c=i(58),h=i(150),u=i(151),p=i(70),f=i(16),g=i(152),m=i(153),v=i(155),_=i(78),y=i(11),w=i(3),b=i(5),x=i(156),C=i(157);window.app=function(t,i){window.Galaxy=new s(t,i),Galaxy.debug("analysis app");var $=o.extend({routes:{"(/)":"home","(/)root*":"home","(/)tours(/)(:tour_id)":"show_tours","(/)user(/)":"show_user","(/)user(/)(:form_id)":"show_user_form","(/)workflow(/)":"show_workflows","(/)workflow/run(/)":"show_run","(/)pages(/)create(/)":"show_pages_create","(/)pages(/)edit(/)":"show_pages_edit","(/)pages(/)(:action_id)":"show_pages","(/)visualizations(/)edit(/)":"show_visualizations_edit","(/)visualizations/(:action_id)":"show_visualizations","(/)workflows/list_published(/)":"show_workflows_published","(/)histories(/)rename(/)":"show_histories_rename","(/)histories(/)permissions(/)":"show_histories_permissions","(/)histories(/)(:action_id)":"show_histories","(/)datasets(/)list(/)":"show_datasets","(/)workflow/import_workflow":"show_import_workflow","(/)custom_builds":"show_custom_builds","(/)datasets/edit":"show_dataset_edit_attributes","(/)datasets/error":"show_dataset_error"},require_login:["show_user","show_user_form","show_workflows"],authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id||-1==this.require_login.indexOf(t)},show_tours:function(e){e?p.giveTour(e):this.page.display(new p.ToursView)},show_user:function(){this.page.display(new h.View)},show_user_form:function(e){var t=new h.Model({user_id:Galaxy.params.id});this.page.display(new c.View(t.get(e)))},show_visualizations:function(e){this.page.display(new g.View({action_id:e,plural:"Visualizations",item:"visualization"}))},show_visualizations_edit:function(){this.page.display(new c.View({url:"visualization/edit?id="+y.get("id"),redirect:"visualizations/list"}))},show_workflows_published:function(){this.page.display(new f({url_base:Galaxy.root+"workflow/list_published",dict_format:!0}))},show_histories:function(e){this.page.display(new v.View({action_id:e}))},show_histories_rename:function(){this.page.display(new c.View({url:"history/rename?id="+y.get("id"),redirect:"histories/list"}))},show_histories_permissions:function(){this.page.display(new c.View({url:"history/permissions?id="+y.get("id"),redirect:"histories/list"}))},show_datasets:function(){this.page.display(new f({url_base:Galaxy.root+"dataset/list",dict_format:!0}))},show_pages:function(e){this.page.display(new g.View({action_id:e,plural:"Pages",item:"page"}))},show_pages_create:function(){this.page.display(new c.View({url:"page/create",redirect:"pages/list"}))},show_pages_edit:function(){this.page.display(new c.View({url:"page/edit?id="+y.get("id"),redirect:"pages/list"}))},show_workflows:function(){this.page.display(new m.View)},show_run:function(){this._loadWorkflow()},show_import_workflow:function(){this.page.display(new m.ImportWorkflowView)},show_custom_builds:function(){var e=this,t=this.page.historyPanel.historyView;if(!t||!t.model||!t.model.id)return void window.setTimeout(function(){e.show_custom_builds()},500);this.page.display(new u.View)},show_dataset_edit_attributes:function(){this.page.display(new C.View)},show_dataset_error:function(){this.page.display(new x.View)},home:function(e){e.tool_id||e.job_id?"upload1"===e.tool_id?(this.page.toolPanel.upload.show(),this._loadCenterIframe("welcome")):this._loadToolForm(e):e.workflow_id?this._loadWorkflow():e.m_c?this._loadCenterIframe(e.m_c+"/"+e.m_a):this._loadCenterIframe("welcome")},_loadToolForm:function(e){e.id=decodeURIComponent(e.tool_id),this.page.display(new d.View(e))},_loadCenterIframe:function(e,t){t=t||Galaxy.root,e=t+e,this.page.$("#galaxy_main").prop("src",e)},_loadWorkflow:function(){var e=this;w.get({url:Galaxy.root+"api/workflows/"+w.getQueryString("id")+"/download?style=run",success:function(t){e.page.display(new _.View(t))},error:function(t){var i=t.err_msg||"Error occurred while loading the resource.",n={message:i,status:"danger",persistent:!0};e.page.display(new b.Message(n))}})}});n(function(){Galaxy.page=new l.View(e.extend(t,{Left:a,Right:r,Router:$}))})}}).call(t,i(2))},function(e,t,i){"use strict";(function(t,n){var s=i(92),o=i(126),a=i(4),r=(i(78),t.View.extend({initialize:function(e,i){var n=i.config;this.root=i.root,this.stored_workflow_menu_entries=n.stored_workflow_menu_entries||[];var r=new s.ToolSearch({hidden:!1}),l=new s.ToolCollection(n.toolbox);this.tool_panel=new s.ToolPanel({tool_search:r,tools:l,layout:n.toolbox_in_panel}),this.tool_panel_view=new s.ToolPanelView({model:this.tool_panel}),this.upload_button=new o({nginx_upload_path:n.nginx_upload_path,ftp_upload_site:n.ftp_upload_site,default_genome:n.default_genome,default_extension:n.default_extension}),Galaxy.upload=this.upload_button,this.model=new t.Model({title:a("Tools"),buttons:[this.upload_button]}),this.setElement(this._template())},render:function(){var e=this;this.tool_panel.get("layout").size()>0&&(this.$el.prepend(this.tool_panel_view.$el),this.tool_panel_view.render()),e.$("#internal-workflows").append(e._templateAllWorkflow({title:a("All workflows"),href:"workflow"})),n.each(this.stored_workflow_menu_entries,function(t){e.$("#internal-workflows").append(e._templateWorkflowLink({title:t.stored_workflow.name,href:"workflow/run?id="+t.encoded_stored_workflow_id}))})},_templateTool:function(e){return['"].join("")},_templateAllWorkflow:function(e){return['"].join("")},_templateWorkflowLink:function(e){return['"].join("")},_template:function(){return['
','",'
','
','
',"",a("Workflows"),"","
",'
','
',"
","
"].join("")},toString:function(){return"toolPanel"}}));e.exports=r}).call(t,i(1),i(2))},function(e,t,i){"use strict";(function(n){var s,o;s=[i(3),i(7),i(62),i(127),i(128),i(131),i(133)],void 0!==(o=function(e,t,i,s,o,a,r){return n.View.extend({options:{nginx_upload_path:"",ftp_upload_site:"n/a",default_genome:"?",default_extension:"auto",height:500,width:900,auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."}},list_extensions:[],list_genomes:[],initialize:function(t){var i=this;this.options=e.merge(t,this.options),this.ui_button=new s.View({onclick:function(e){e.preventDefault(),i.show()},onunload:function(){var e=i.ui_button.model.get("percentage",0);if(e>0&&e<100)return"Several uploads are queued."}}),this.setElement(this.ui_button.$el);var i=this;e.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){for(var t in e)i.list_extensions.push({id:e[t].extension,text:e[t].extension,description:e[t].description,description_url:e[t].description_url,composite_files:e[t].composite_files});i.list_extensions.sort(function(e,t){var i=e.text&&e.text.toLowerCase(),n=t.text&&t.text.toLowerCase();return i>n?1:it.text?1:e.text0){var n={file_count:e.length,dbkey:e[0].get("genome","?"),file_type:e[0].get("extension","auto")};for(var s in e){var o=e[s];if(o.set("status","running"),!(o.get("file_size")>0)){i.error_message="Upload content incomplete.",o.set("status","error"),o.set("info",i.error_message);break}var a="files_"+s+"|";switch(n[a+"type"]="upload_dataset",n[a+"space_to_tab"]=o.get("space_to_tab")&&"Yes"||null,n[a+"to_posix_lines"]=o.get("to_posix_lines")&&"Yes"||null,n[a+"dbkey"]=o.get("genome",null),n[a+"file_type"]=o.get("extension",null),o.get("file_mode")){case"new":n[a+"url_paste"]=o.get("url_paste");break;case"ftp":n[a+"ftp_files"]=o.get("file_path");break;case"local":i.files.push({name:a+"file_data",file:o.get("file_data")})}}i.payload.inputs=JSON.stringify(n)}return i}})}.apply(t,s))&&(e.exports=o)}).call(t,i(1))},function(e,t,i){"use strict";(function(i,n){var s,o;s=[],void 0!==(o=function(){return{View:i.View.extend({initialize:function(e){var t=this;this.model=e&&e.model||new i.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",percentage:0,status:"",onunload:function(){},onclick:function(){}}).set(e),this.setElement(this._template()),this.$progress=this.$(".progress-bar"),this.listenTo(this.model,"change",this.render,this),this.render(),n(window).on("beforeunload",function(){return t.model.get("onunload")()})},render:function(){var e=this.model.attributes;this.$el.off("click").on("click",function(t){e.onclick(t)}).tooltip({title:this.model.get("tooltip"),placement:"bottom"}),this.$progress.removeClass().addClass("progress-bar").addClass("progress-bar-notransition").addClass(""!=e.status&&"progress-bar-"+e.status).css({width:e.percentage+"%"})},_template:function(){return'
'}})}}.apply(t,s))&&(e.exports=o)}).call(t,i(1),i(0))},function(e,t,i){"use strict";(function(n,s,o){var a,r;a=[i(3),i(21),i(129),i(46),i(47),i(12),i(14),i(5),i(130),i(48)],void 0!==(r=function(e,t,i,a,r,l,d,c,h){return n.View.extend({upload_size:0,collection:new t.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.$uploadbox=this.$(".upload-box"),this.$uploadtable=this.$(".upload-table"),this.btnLocal=new c.Button({id:"btn-local",title:"Choose local file",onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new c.Button({id:"btn-ftp",title:"Choose FTP file",onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new c.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new c.Button({id:"btn-start",title:"Start",onclick:function(){t._eventStart()}}),this.btnStop=new c.Button({id:"btn-stop",title:"Pause",onclick:function(){t._eventStop()}}),this.btnReset=new c.Button({id:"btn-reset",title:"Reset",onclick:function(){t._eventReset()}}),this.btnClose=new c.Button({id:"btn-close",title:"Close",onclick:function(){t.app.modal.hide()}}),s.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$uploadbox.uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$uploadbox.addClass("highlight")},ondragleave:function(){t.$uploadbox.removeClass("highlight")}}),this.ftp=new l.View({title:"FTP files",container:this.btnFtp.$el}),this.select_extension=new d.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:s.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t._changeExtension(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new r({$el:o(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new d.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t._changeGenome(e)}}),this.loader=new h({$container:this.$uploadbox,collection:this.collection,new_content:function(e){var n=new i(t,{model:e});return t.$uploadtable.find("> tbody:first").append(n.$el),n.render(),n}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this.render()},render:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running,s=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[n?"enable":"disable"](),this.btnFtp[n?"enable":"disable"](),this.btnCreate[n?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[s?"show":"hide"](),this.$(".upload-helper")[s?"hide":"show"]()},_eventAnnounce:function(e,i){this.counter.announce++;var n=new t.Model({id:e,file_name:i.name,file_size:i.size,file_mode:i.mode||"local",file_path:i.path,file_data:i});this.render(),this.collection.add(n)},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"success"}),this.ui_button.model.set("percentage",this._uploadPercentage(100,i.get("file_size"))),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.success++,this.render(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this.render()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this.render()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this.render()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new a({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(0!=this.counter.announce&&0==this.counter.running){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this._uploadFtp(),this.uploadbox.start(),this.render()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),o(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){if(0==this.counter.running){this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this.render()}},_changeExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},_changeGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_uploadFtp:function(){var e=this,t=[];this.collection.each(function(i){"queued"==i.get("status")&&"ftp"==i.get("file_mode")&&(e.uploadbox.remove(i.id),t.push(i))}),t.length>0&&o.uploadpost({data:this.app.toData(t),url:this.app.options.nginx_upload_path,success:function(i){s.each(t,function(t){e._eventSuccess(t.id)})},error:function(i){s.each(t,function(t){e._eventError(t.id,i)})}})},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'
Drop files here
'}})}.apply(t,a))&&(e.exports=r)}).call(t,i(1),i(2),i(0))},function(e,t,i){"use strict";(function(n,s,o){var a,r;a=[i(3),i(21),i(45),i(12),i(14)],void 0!==(r=function(e,t,i,a,r){return n.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$settings=this.$(".upload-settings"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new a.View({title:"Upload configuration",container:this.$(".upload-settings"),placement:"bottom"});var n=this.app.select_genome.value(),o=this.app.select_extension.value();this.select_genome=new r.View({css:"upload-genome",data:i.app.list_genomes,container:this.$(".upload-genome"),value:n,onchange:function(e){i.model.set("genome",e)}}),this.select_extension=new r.View({css:"upload-extension",data:i.app.list_extensions,container:this.$(".upload-extension"),value:o,onchange:function(e){i.model.set("extension",e)}}),this.model.set({genome:n,extension:o}),this.$symbol.on("click",function(){i._removeRow()}),this.$(".upload-extension-info").on("click",function(e){i.app.showExtensionInfo({$el:s(e.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(e){e.preventDefault()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:s(e.target).val(),file_size:s(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:genome",function(){i._refreshGenome()}),this.listenTo(this.model,"change:extension",function(){i._refreshExtension()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()})},render:function(){this._refreshType(),this._refreshPercentage(),this._refreshStatus(),this._refreshInfo(),this._refreshGenome(),this._refreshExtension(),this._refreshFileSize()},remove:function(){this.select_genome.remove(),this.select_extension.remove(),n.View.prototype.remove.apply(this)},_refreshType:function(){var t=this.model.attributes;this.$title.html(o.escape(t.file_name)),this.$size.html(e.bytesToString(t.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==t.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==t.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==t.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),t?(this.select_genome.enable(),this.select_extension.enable()):(this.select_genome.disable(),this.select_extension.disable()),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(e.bytesToString(this.model.get("file_size")))},_removeRow:function(){-1!==["init","success","error"].indexOf(this.model.get("status"))&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new i(this).$el),this.settings.show())},_template:function(e){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
', '
', '
'].join('');\n }\n });\n\n //==============================================================================\n return {\n CitationView: CitationView,\n CitationListView: CitationListView\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 94 */,\n/* 95 */,\n/* 96 */,\n/* 97 */,\n/* 98 */,\n/* 99 */,\n/* 100 */,\n/* 101 */,\n/* 102 */,\n/* 103 */,\n/* 104 */,\n/* 105 */,\n/* 106 */,\n/* 107 */,\n/* 108 */,\n/* 109 */,\n/* 110 */,\n/* 111 */,\n/* 112 */,\n/* 113 */,\n/* 114 */,\n/* 115 */,\n/* 116 */,\n/* 117 */,\n/* 118 */,\n/* 119 */,\n/* 120 */,\n/* 121 */,\n/* 122 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(_) {\n\nvar jQuery = __webpack_require__(0),\n $ = jQuery,\n GalaxyApp = __webpack_require__(42).GalaxyApp,\n Router = __webpack_require__(44),\n ToolPanel = __webpack_require__(123),\n HistoryPanel = __webpack_require__(134),\n Page = __webpack_require__(43),\n ToolForm = __webpack_require__(63),\n FormWrapper = __webpack_require__(58),\n UserPreferences = __webpack_require__(148),\n CustomBuilds = __webpack_require__(149),\n Tours = __webpack_require__(69),\n GridView = __webpack_require__(16),\n GridShared = __webpack_require__(150),\n Workflows = __webpack_require__(151),\n HistoryList = __webpack_require__(155),\n ToolFormComposite = __webpack_require__(77),\n QueryStringParsing = __webpack_require__(11),\n Utils = __webpack_require__(3),\n Ui = __webpack_require__(5),\n DatasetError = __webpack_require__(156),\n DatasetEditAttributes = __webpack_require__(157);\n\n/** define the 'Analyze Data'/analysis/main/home page for Galaxy\n * * has a masthead\n * * a left tool menu to allow the user to load tools in the center panel\n * * a right history menu that shows the user's current data\n * * a center panel\n * Both panels (generally) persist while the center panel shows any\n * UI needed for the current step of an analysis, like:\n * * tool forms to set tool parameters,\n * * tables showing the contents of datasets\n * * etc.\n */\nwindow.app = function app(options, bootstrapped) {\n window.Galaxy = new GalaxyApp(options, bootstrapped);\n Galaxy.debug('analysis app');\n\n /** Routes */\n var AnalysisRouter = Router.extend({\n routes: {\n '(/)': 'home',\n '(/)root*': 'home',\n '(/)tours(/)(:tour_id)': 'show_tours',\n '(/)user(/)': 'show_user',\n '(/)user(/)(:form_id)': 'show_user_form',\n '(/)workflow(/)': 'show_workflows',\n '(/)workflow/run(/)': 'show_run',\n '(/)pages(/)create(/)': 'show_pages_create',\n '(/)pages(/)edit(/)': 'show_pages_edit',\n '(/)pages(/)(:action_id)': 'show_pages',\n '(/)visualizations(/)edit(/)': 'show_visualizations_edit',\n '(/)visualizations/(:action_id)': 'show_visualizations',\n '(/)workflows/list_published(/)': 'show_workflows_published',\n '(/)histories(/)rename(/)': 'show_histories_rename',\n '(/)histories(/)permissions(/)': 'show_histories_permissions',\n '(/)histories(/)(:action_id)': 'show_histories',\n '(/)datasets(/)list(/)': 'show_datasets',\n '(/)workflow/import_workflow': 'show_import_workflow',\n '(/)custom_builds': 'show_custom_builds',\n '(/)datasets/edit': 'show_dataset_edit_attributes',\n '(/)datasets/error': 'show_dataset_error'\n },\n\n require_login: ['show_user', 'show_user_form', 'show_workflows'],\n\n authenticate: function authenticate(args, name) {\n return Galaxy.user && Galaxy.user.id || this.require_login.indexOf(name) == -1;\n },\n\n show_tours: function show_tours(tour_id) {\n if (tour_id) {\n Tours.giveTour(tour_id);\n } else {\n this.page.display(new Tours.ToursView());\n }\n },\n\n show_user: function show_user() {\n this.page.display(new UserPreferences.View());\n },\n\n show_user_form: function show_user_form(form_id) {\n var model = new UserPreferences.Model({ user_id: Galaxy.params.id });\n this.page.display(new FormWrapper.View(model.get(form_id)));\n },\n\n show_visualizations: function show_visualizations(action_id) {\n this.page.display(new GridShared.View({ action_id: action_id, plural: 'Visualizations', item: 'visualization' }));\n },\n\n show_visualizations_edit: function show_visualizations_edit() {\n this.page.display(new FormWrapper.View({ url: 'visualization/edit?id=' + QueryStringParsing.get('id'), redirect: 'visualizations/list' }));\n },\n\n show_workflows_published: function show_workflows_published() {\n this.page.display(new GridView({ url_base: Galaxy.root + 'workflow/list_published', dict_format: true }));\n },\n\n show_histories: function show_histories(action_id) {\n this.page.display(new HistoryList.View({ action_id: action_id }));\n },\n\n show_histories_rename: function show_histories_rename() {\n this.page.display(new FormWrapper.View({ url: 'history/rename?id=' + QueryStringParsing.get('id'), redirect: 'histories/list' }));\n },\n\n show_histories_permissions: function show_histories_permissions() {\n this.page.display(new FormWrapper.View({ url: 'history/permissions?id=' + QueryStringParsing.get('id'), redirect: 'histories/list' }));\n },\n\n show_datasets: function show_datasets() {\n this.page.display(new GridView({ url_base: Galaxy.root + 'dataset/list', dict_format: true }));\n },\n\n show_pages: function show_pages(action_id) {\n this.page.display(new GridShared.View({ action_id: action_id, plural: 'Pages', item: 'page' }));\n },\n\n show_pages_create: function show_pages_create() {\n this.page.display(new FormWrapper.View({ url: 'page/create', redirect: 'pages/list' }));\n },\n\n show_pages_edit: function show_pages_edit() {\n this.page.display(new FormWrapper.View({ url: 'page/edit?id=' + QueryStringParsing.get('id'), redirect: 'pages/list' }));\n },\n\n show_workflows: function show_workflows() {\n this.page.display(new Workflows.View());\n },\n\n show_run: function show_run() {\n this._loadWorkflow();\n },\n\n show_import_workflow: function show_import_workflow() {\n this.page.display(new Workflows.ImportWorkflowView());\n },\n\n show_custom_builds: function show_custom_builds() {\n var self = this;\n var historyPanel = this.page.historyPanel.historyView;\n if (!historyPanel || !historyPanel.model || !historyPanel.model.id) {\n window.setTimeout(function () {\n self.show_custom_builds();\n }, 500);\n return;\n }\n this.page.display(new CustomBuilds.View());\n },\n\n show_dataset_edit_attributes: function show_dataset_edit_attributes() {\n this.page.display(new DatasetEditAttributes.View());\n },\n\n show_dataset_error: function show_dataset_error() {\n this.page.display(new DatasetError.View());\n },\n\n /** */\n home: function home(params) {\n // TODO: to router, remove Globals\n // load a tool by id (tool_id) or rerun a previous tool execution (job_id)\n if (params.tool_id || params.job_id) {\n if (params.tool_id === 'upload1') {\n this.page.toolPanel.upload.show();\n this._loadCenterIframe('welcome');\n } else {\n this._loadToolForm(params);\n }\n } else {\n // show the workflow run form\n if (params.workflow_id) {\n this._loadWorkflow();\n // load the center iframe with controller.action: galaxy.org/?m_c=history&m_a=list -> history/list\n } else if (params.m_c) {\n this._loadCenterIframe(params.m_c + '/' + params.m_a);\n // show the workflow run form\n } else {\n this._loadCenterIframe('welcome');\n }\n }\n },\n\n /** load the center panel with a tool form described by the given params obj */\n _loadToolForm: function _loadToolForm(params) {\n //TODO: load tool form code async\n params.id = decodeURIComponent(params.tool_id);\n this.page.display(new ToolForm.View(params));\n },\n\n /** load the center panel iframe using the given url */\n _loadCenterIframe: function _loadCenterIframe(url, root) {\n root = root || Galaxy.root;\n url = root + url;\n this.page.$('#galaxy_main').prop('src', url);\n },\n\n /** load workflow by its url in run mode */\n _loadWorkflow: function _loadWorkflow() {\n var self = this;\n Utils.get({\n url: Galaxy.root + 'api/workflows/' + Utils.getQueryString('id') + '/download?style=run',\n success: function success(response) {\n self.page.display(new ToolFormComposite.View(response));\n },\n error: function error(response) {\n var error_msg = response.err_msg || 'Error occurred while loading the resource.';\n var options = { 'message': error_msg, 'status': 'danger', 'persistent': true };\n self.page.display(new Ui.Message(options));\n }\n });\n }\n });\n\n // render and start the router\n $(function () {\n Galaxy.page = new Page.View(_.extend(options, {\n Left: ToolPanel,\n Right: HistoryPanel,\n Router: AnalysisRouter\n }));\n });\n};\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, _) {\n\nvar Tools = __webpack_require__(91),\n Upload = __webpack_require__(124),\n _l = __webpack_require__(4),\n ToolForm = __webpack_require__(77);\n\nvar ToolPanel = Backbone.View.extend({\n initialize: function initialize(page, options) {\n // access configuration options\n var config = options.config;\n this.root = options.root;\n\n /** @type {Object[]} descriptions of user's workflows to be shown in the tool menu */\n this.stored_workflow_menu_entries = config.stored_workflow_menu_entries || [];\n\n // create tool search, tool panel, and tool panel view.\n var tool_search = new Tools.ToolSearch({\n hidden: false\n });\n var tools = new Tools.ToolCollection(config.toolbox);\n this.tool_panel = new Tools.ToolPanel({\n tool_search: tool_search,\n tools: tools,\n layout: config.toolbox_in_panel\n });\n this.tool_panel_view = new Tools.ToolPanelView({ model: this.tool_panel });\n\n // add upload modal\n this.upload_button = new Upload({\n nginx_upload_path: config.nginx_upload_path,\n ftp_upload_site: config.ftp_upload_site,\n default_genome: config.default_genome,\n default_extension: config.default_extension\n });\n\n // add uploader button to Galaxy object\n Galaxy.upload = this.upload_button;\n\n // components for panel definition\n this.model = new Backbone.Model({\n title: _l('Tools'),\n buttons: [this.upload_button]\n });\n\n // build body template\n this.setElement(this._template());\n },\n\n render: function render() {\n // if there are tools, render panel and display everything\n var self = this;\n if (this.tool_panel.get('layout').size() > 0) {\n this.$el.prepend(this.tool_panel_view.$el);\n this.tool_panel_view.render();\n }\n // build the dom for the workflow portion of the tool menu\n // add internal workflow list\n self.$('#internal-workflows').append(self._templateAllWorkflow({\n title: _l('All workflows'),\n href: 'workflow'\n }));\n _.each(this.stored_workflow_menu_entries, function (menu_entry) {\n self.$('#internal-workflows').append(self._templateWorkflowLink({\n title: menu_entry.stored_workflow.name,\n href: 'workflow/run?id=' + menu_entry.encoded_stored_workflow_id\n }));\n });\n },\n\n /** build a link to one tool */\n _templateTool: function _templateTool(tool) {\n return [''].join('');\n },\n\n /** build a link to 'All Workflows' */\n _templateAllWorkflow: function _templateAllWorkflow(tool) {\n return ['
',\n // global\n '', tool.title, '', '
'].join('');\n },\n\n /** build links to workflows in toolpanel */\n _templateWorkflowLink: function _templateWorkflowLink(wf) {\n return [''].join('');\n },\n\n /** override to include inital menu dom and workflow section */\n _template: function _template() {\n return ['
', '
', '
', '', _l('Search did not match any tools.'), '', '
', '
', '
', '
', '
', '', _l('Workflows'), '', '
', '
', '
', '
', '
'].join('');\n },\n\n toString: function toString() {\n return 'toolPanel';\n }\n});\n\nmodule.exports = ToolPanel;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(2)))\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** Upload app contains the upload progress button and upload modal, compiles model data for API request **/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3), __webpack_require__(7), __webpack_require__(62), __webpack_require__(125), __webpack_require__(126), __webpack_require__(129), __webpack_require__(131)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, Modal, Tabs, UploadButton, UploadViewDefault, UploadViewComposite, UploadViewCollection) {\n return Backbone.View.extend({\n options: {\n nginx_upload_path: '',\n ftp_upload_site: 'n/a',\n default_genome: '?',\n default_extension: 'auto',\n height: 500,\n width: 900,\n auto: {\n id: 'auto',\n text: 'Auto-detect',\n description: 'This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed.'\n }\n },\n\n // contains all available dataset extensions/types\n list_extensions: [],\n\n // contains all available genomes\n list_genomes: [],\n\n initialize: function initialize(options) {\n var self = this;\n this.options = Utils.merge(options, this.options);\n\n // create view for upload/progress button\n this.ui_button = new UploadButton.View({\n onclick: function onclick(e) {\n e.preventDefault();\n self.show();\n },\n onunload: function onunload() {\n var percentage = self.ui_button.model.get('percentage', 0);\n if (percentage > 0 && percentage < 100) {\n return 'Several uploads are queued.';\n }\n }\n });\n\n // set element to button view\n this.setElement(this.ui_button.$el);\n\n // load extensions\n var self = this;\n Utils.get({\n url: Galaxy.root + 'api/datatypes?extension_only=False',\n success: function success(datatypes) {\n for (var key in datatypes) {\n self.list_extensions.push({\n id: datatypes[key].extension,\n text: datatypes[key].extension,\n description: datatypes[key].description,\n description_url: datatypes[key].description_url,\n composite_files: datatypes[key].composite_files\n });\n }\n self.list_extensions.sort(function (a, b) {\n var a_text = a.text && a.text.toLowerCase();\n var b_text = b.text && b.text.toLowerCase();\n return a_text > b_text ? 1 : a_text < b_text ? -1 : 0;\n });\n if (!self.options.datatypes_disable_auto) {\n self.list_extensions.unshift(self.options.auto);\n }\n }\n });\n\n // load genomes\n Utils.get({\n url: Galaxy.root + 'api/genomes',\n success: function success(genomes) {\n for (var key in genomes) {\n self.list_genomes.push({\n id: genomes[key][1],\n text: genomes[key][0]\n });\n }\n self.list_genomes.sort(function (a, b) {\n if (a.id == self.options.default_genome) {\n return -1;\n }\n if (b.id == self.options.default_genome) {\n return 1;\n }\n return a.text > b.text ? 1 : a.text < b.text ? -1 : 0;\n });\n }\n });\n },\n\n /** Show/hide upload dialog */\n show: function show() {\n var self = this;\n if (!Galaxy.currHistoryPanel || !Galaxy.currHistoryPanel.model) {\n window.setTimeout(function () {\n self.show();\n }, 500);\n return;\n }\n this.current_user = Galaxy.user.id;\n if (!this.modal) {\n this.tabs = new Tabs.View();\n this.default_view = new UploadViewDefault(this);\n this.tabs.add({\n id: 'regular',\n title: 'Regular',\n $el: this.default_view.$el\n });\n this.composite_view = new UploadViewComposite(this);\n this.tabs.add({\n id: 'composite',\n title: 'Composite',\n $el: this.composite_view.$el\n });\n this.collection_view = new UploadViewCollection(this);\n this.tabs.add({\n id: 'collection',\n title: 'Collection',\n $el: this.collection_view.$el\n });\n this.modal = new Modal.View({\n title: 'Download from web or upload from disk',\n body: this.tabs.$el,\n height: this.options.height,\n width: this.options.width,\n closing_events: true,\n title_separator: false\n });\n }\n this.modal.show();\n },\n\n /** Refresh user and current history */\n currentHistory: function currentHistory() {\n return this.current_user && Galaxy.currHistoryPanel.model.get('id');\n },\n\n /** Get ftp configuration */\n currentFtp: function currentFtp() {\n return this.current_user && this.options.ftp_upload_site;\n },\n\n /**\n * Package API data from array of models\n * @param{Array} items - Upload items/rows filtered from a collection\n */\n toData: function toData(items, history_id) {\n // create dictionary for data submission\n var data = {\n payload: {\n 'tool_id': 'upload1',\n 'history_id': history_id || this.currentHistory(),\n 'inputs': {}\n },\n files: [],\n error_message: null\n // add upload tools input data\n };if (items && items.length > 0) {\n var inputs = {\n 'file_count': items.length,\n 'dbkey': items[0].get('genome', '?'),\n 'file_type': items[0].get('extension', 'auto')\n };\n for (var index in items) {\n var it = items[index];\n it.set('status', 'running');\n if (it.get('file_size') > 0) {\n var prefix = 'files_' + index + '|';\n inputs[prefix + 'type'] = 'upload_dataset';\n inputs[prefix + 'space_to_tab'] = it.get('space_to_tab') && 'Yes' || null;\n inputs[prefix + 'to_posix_lines'] = it.get('to_posix_lines') && 'Yes' || null;\n inputs[prefix + 'dbkey'] = it.get('genome', null);\n inputs[prefix + 'file_type'] = it.get('extension', null);\n switch (it.get('file_mode')) {\n case 'new':\n inputs[prefix + 'url_paste'] = it.get('url_paste');\n break;\n case 'ftp':\n inputs[prefix + 'ftp_files'] = it.get('file_path');\n break;\n case 'local':\n data.files.push({ name: prefix + 'file_data', file: it.get('file_data') });\n }\n } else {\n data.error_message = 'Upload content incomplete.';\n it.set('status', 'error');\n it.set('info', data.error_message);\n break;\n }\n }\n data.payload.inputs = JSON.stringify(inputs);\n }\n return data;\n }\n });\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** View for upload/progress bar button */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n var View = Backbone.View.extend({\n initialize: function initialize(options) {\n var self = this;\n this.model = options && options.model || new Backbone.Model({\n icon: 'fa-upload',\n tooltip: 'Download from URL or upload files from disk',\n label: 'Load Data',\n percentage: 0,\n status: '',\n onunload: function onunload() {},\n onclick: function onclick() {}\n }).set(options);\n this.setElement(this._template());\n this.$progress = this.$('.progress-bar');\n this.listenTo(this.model, 'change', this.render, this);\n this.render();\n $(window).on('beforeunload', function () {\n return self.model.get('onunload')();\n });\n },\n\n render: function render() {\n var self = this;\n var options = this.model.attributes;\n this.$el.off('click').on('click', function (e) {\n options.onclick(e);\n }).tooltip({ title: this.model.get('tooltip'), placement: 'bottom' });\n this.$progress.removeClass().addClass('progress-bar').addClass('progress-bar-notransition').addClass(options.status != '' && 'progress-bar-' + options.status).css({ width: options.percentage + '%' });\n },\n\n /** Template */\n _template: function _template() {\n return '
' + '
' + '
' + '' + '' + '' + '
' + '
';\n }\n });\n return { View: View };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, _, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** Renders contents of the default uploader */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3), __webpack_require__(21), __webpack_require__(127), __webpack_require__(46), __webpack_require__(47), __webpack_require__(12), __webpack_require__(14), __webpack_require__(5), __webpack_require__(128), __webpack_require__(48)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, UploadModel, UploadRow, UploadFtp, UploadExtension, Popover, Select, Ui, LazyLimited) {\n\n return Backbone.View.extend({\n // current upload size in bytes\n upload_size: 0,\n\n // contains upload row models\n collection: new UploadModel.Collection(),\n\n // keeps track of the current uploader state\n counter: {\n announce: 0,\n success: 0,\n error: 0,\n running: 0,\n reset: function reset() {\n this.announce = this.success = this.error = this.running = 0;\n }\n },\n\n initialize: function initialize(app) {\n var self = this;\n this.app = app;\n this.options = app.options;\n this.list_extensions = app.list_extensions;\n this.list_genomes = app.list_genomes;\n this.ui_button = app.ui_button;\n this.ftp_upload_site = app.currentFtp();\n\n // build template\n this.setElement(this._template());\n this.$uploadbox = this.$('.upload-box');\n this.$uploadtable = this.$('.upload-table');\n\n // append buttons to dom\n this.btnLocal = new Ui.Button({ id: 'btn-local', title: 'Choose local file', onclick: function onclick() {\n self.uploadbox.select();\n }, icon: 'fa fa-laptop' });\n this.btnFtp = new Ui.Button({ id: 'btn-ftp', title: 'Choose FTP file', onclick: function onclick() {\n self._eventFtp();\n }, icon: 'fa fa-folder-open-o' });\n this.btnCreate = new Ui.Button({ id: 'btn-new', title: 'Paste/Fetch data', onclick: function onclick() {\n self._eventCreate();\n }, icon: 'fa fa-edit' });\n this.btnStart = new Ui.Button({ id: 'btn-start', title: 'Start', onclick: function onclick() {\n self._eventStart();\n } });\n this.btnStop = new Ui.Button({ id: 'btn-stop', title: 'Pause', onclick: function onclick() {\n self._eventStop();\n } });\n this.btnReset = new Ui.Button({ id: 'btn-reset', title: 'Reset', onclick: function onclick() {\n self._eventReset();\n } });\n this.btnClose = new Ui.Button({ id: 'btn-close', title: 'Close', onclick: function onclick() {\n self.app.modal.hide();\n } });\n _.each([this.btnLocal, this.btnFtp, this.btnCreate, this.btnStop, this.btnReset, this.btnStart, this.btnClose], function (button) {\n self.$('.upload-buttons').prepend(button.$el);\n });\n\n // file upload\n this.uploadbox = this.$uploadbox.uploadbox({\n url: this.app.options.nginx_upload_path,\n announce: function announce(index, file) {\n self._eventAnnounce(index, file);\n },\n initialize: function initialize(index) {\n return self.app.toData([self.collection.get(index)], self.history_id);\n },\n progress: function progress(index, percentage) {\n self._eventProgress(index, percentage);\n },\n success: function success(index, message) {\n self._eventSuccess(index, message);\n },\n error: function error(index, message) {\n self._eventError(index, message);\n },\n complete: function complete() {\n self._eventComplete();\n },\n ondragover: function ondragover() {\n self.$uploadbox.addClass('highlight');\n },\n ondragleave: function ondragleave() {\n self.$uploadbox.removeClass('highlight');\n }\n });\n\n // add ftp file viewer\n this.ftp = new Popover.View({ title: 'FTP files', container: this.btnFtp.$el });\n\n // select extension\n this.select_extension = new Select.View({\n css: 'upload-footer-selection',\n container: this.$('.upload-footer-extension'),\n data: _.filter(this.list_extensions, function (ext) {\n return !ext.composite_files;\n }),\n value: this.options.default_extension,\n onchange: function onchange(extension) {\n self._changeExtension(extension);\n }\n });\n\n // handle extension info popover\n this.$('.upload-footer-extension-info').on('click', function (e) {\n new UploadExtension({\n $el: $(e.target),\n title: self.select_extension.text(),\n extension: self.select_extension.value(),\n list: self.list_extensions,\n placement: 'top'\n });\n }).on('mousedown', function (e) {\n e.preventDefault();\n });\n\n // genome extension\n this.select_genome = new Select.View({\n css: 'upload-footer-selection',\n container: this.$('.upload-footer-genome'),\n data: this.list_genomes,\n value: this.options.default_genome,\n onchange: function onchange(genome) {\n self._changeGenome(genome);\n }\n });\n\n // Lazy load helper\n this.loader = new LazyLimited({\n $container: this.$uploadbox,\n collection: this.collection,\n new_content: function new_content(model) {\n var upload_row = new UploadRow(self, { model: model });\n self.$uploadtable.find('> tbody:first').append(upload_row.$el);\n upload_row.render();\n return upload_row;\n }\n });\n\n // events\n this.collection.on('remove', function (model) {\n self._eventRemove(model);\n });\n this.render();\n },\n\n render: function render() {\n var message = '';\n if (this.counter.announce == 0) {\n if (this.uploadbox.compatible()) {\n message = ' ';\n } else {\n message = 'Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.';\n }\n } else {\n if (this.counter.running == 0) {\n message = 'You added ' + this.counter.announce + ' file(s) to the queue. Add more files or click \\'Start\\' to proceed.';\n } else {\n message = 'Please wait...' + this.counter.announce + ' out of ' + this.counter.running + ' remaining.';\n }\n }\n this.$('.upload-top-info').html(message);\n var enable_reset = this.counter.running == 0 && this.counter.announce + this.counter.success + this.counter.error > 0;\n var enable_start = this.counter.running == 0 && this.counter.announce > 0;\n var enable_sources = this.counter.running == 0;\n var show_table = this.counter.announce + this.counter.success + this.counter.error > 0;\n this.btnReset[enable_reset ? 'enable' : 'disable']();\n this.btnStart[enable_start ? 'enable' : 'disable']();\n this.btnStart.$el[enable_start ? 'addClass' : 'removeClass']('btn-primary');\n this.btnStop[this.counter.running > 0 ? 'enable' : 'disable']();\n this.btnLocal[enable_sources ? 'enable' : 'disable']();\n this.btnFtp[enable_sources ? 'enable' : 'disable']();\n this.btnCreate[enable_sources ? 'enable' : 'disable']();\n this.btnFtp.$el[this.ftp_upload_site ? 'show' : 'hide']();\n this.$('.upload-table')[show_table ? 'show' : 'hide']();\n this.$('.upload-helper')[show_table ? 'hide' : 'show']();\n },\n\n /** A new file has been dropped/selected through the uploadbox plugin */\n _eventAnnounce: function _eventAnnounce(index, file) {\n this.counter.announce++;\n var new_model = new UploadModel.Model({\n id: index,\n file_name: file.name,\n file_size: file.size,\n file_mode: file.mode || 'local',\n file_path: file.path,\n file_data: file\n });\n this.render();\n this.collection.add(new_model);\n },\n\n /** Progress */\n _eventProgress: function _eventProgress(index, percentage) {\n var it = this.collection.get(index);\n it.set('percentage', percentage);\n this.ui_button.model.set('percentage', this._uploadPercentage(percentage, it.get('file_size')));\n },\n\n /** Success */\n _eventSuccess: function _eventSuccess(index, message) {\n var it = this.collection.get(index);\n it.set({ 'percentage': 100, 'status': 'success' });\n this.ui_button.model.set('percentage', this._uploadPercentage(100, it.get('file_size')));\n this.upload_completed += it.get('file_size') * 100;\n this.counter.announce--;\n this.counter.success++;\n this.render();\n Galaxy.currHistoryPanel.refreshContents();\n },\n\n /** Error */\n _eventError: function _eventError(index, message) {\n var it = this.collection.get(index);\n it.set({ 'percentage': 100, 'status': 'error', 'info': message });\n this.ui_button.model.set({ 'percentage': this._uploadPercentage(100, it.get('file_size')), 'status': 'danger' });\n this.upload_completed += it.get('file_size') * 100;\n this.counter.announce--;\n this.counter.error++;\n this.render();\n },\n\n /** Queue is done */\n _eventComplete: function _eventComplete() {\n this.collection.each(function (model) {\n model.get('status') == 'queued' && model.set('status', 'init');\n });\n this.counter.running = 0;\n this.render();\n },\n\n /** Remove model from upload list */\n _eventRemove: function _eventRemove(model) {\n var status = model.get('status');\n if (status == 'success') {\n this.counter.success--;\n } else if (status == 'error') {\n this.counter.error--;\n } else {\n this.counter.announce--;\n }\n this.uploadbox.remove(model.id);\n this.render();\n },\n\n //\n // events triggered by this view\n //\n\n /** Show/hide ftp popup */\n _eventFtp: function _eventFtp() {\n if (!this.ftp.visible) {\n this.ftp.empty();\n var self = this;\n this.ftp.append(new UploadFtp({\n collection: this.collection,\n ftp_upload_site: this.ftp_upload_site,\n onadd: function onadd(ftp_file) {\n return self.uploadbox.add([{\n mode: 'ftp',\n name: ftp_file.path,\n size: ftp_file.size,\n path: ftp_file.path\n }]);\n },\n onremove: function onremove(model_index) {\n self.collection.remove(model_index);\n }\n }).$el);\n this.ftp.show();\n } else {\n this.ftp.hide();\n }\n },\n\n /** Create a new file */\n _eventCreate: function _eventCreate() {\n this.uploadbox.add([{ name: 'New File', size: 0, mode: 'new' }]);\n },\n\n /** Start upload process */\n _eventStart: function _eventStart() {\n if (this.counter.announce != 0 && this.counter.running == 0) {\n // prepare upload process\n var self = this;\n this.upload_size = 0;\n this.upload_completed = 0;\n this.collection.each(function (model) {\n if (model.get('status') == 'init') {\n model.set('status', 'queued');\n self.upload_size += model.get('file_size');\n }\n });\n this.ui_button.model.set({ 'percentage': 0, 'status': 'success' });\n this.counter.running = this.counter.announce;\n this.history_id = this.app.currentHistory();\n\n // package ftp files separately, and remove them from queue\n this._uploadFtp();\n\n // queue remaining files\n this.uploadbox.start();\n this.render();\n }\n },\n\n /** Pause upload process */\n _eventStop: function _eventStop() {\n if (this.counter.running > 0) {\n this.ui_button.model.set('status', 'info');\n $('.upload-top-info').html('Queue will pause after completing the current file...');\n this.uploadbox.stop();\n }\n },\n\n /** Remove all */\n _eventReset: function _eventReset() {\n if (this.counter.running == 0) {\n var self = this;\n this.collection.reset();\n this.counter.reset();\n this.uploadbox.reset();\n this.select_extension.value(this.options.default_extension);\n this.select_genome.value(this.options.default_genome);\n this.ui_button.model.set('percentage', 0);\n this.render();\n }\n },\n\n /** Update extension for all models */\n _changeExtension: function _changeExtension(extension, defaults_only) {\n var self = this;\n this.collection.each(function (model) {\n if (model.get('status') == 'init' && (model.get('extension') == self.options.default_extension || !defaults_only)) {\n model.set('extension', extension);\n }\n });\n },\n\n /** Update genome for all models */\n _changeGenome: function _changeGenome(genome, defaults_only) {\n var self = this;\n this.collection.each(function (model) {\n if (model.get('status') == 'init' && (model.get('genome') == self.options.default_genome || !defaults_only)) {\n model.set('genome', genome);\n }\n });\n },\n\n /** Package and upload ftp files in a single request */\n _uploadFtp: function _uploadFtp() {\n var self = this;\n var list = [];\n this.collection.each(function (model) {\n if (model.get('status') == 'queued' && model.get('file_mode') == 'ftp') {\n self.uploadbox.remove(model.id);\n list.push(model);\n }\n });\n if (list.length > 0) {\n $.uploadpost({\n data: this.app.toData(list),\n url: this.app.options.nginx_upload_path,\n success: function success(message) {\n _.each(list, function (model) {\n self._eventSuccess(model.id);\n });\n },\n error: function error(message) {\n _.each(list, function (model) {\n self._eventError(model.id, message);\n });\n }\n });\n }\n },\n\n /** Calculate percentage of all queued uploads */\n _uploadPercentage: function _uploadPercentage(percentage, size) {\n return (this.upload_completed + percentage * size) / this.upload_size;\n },\n\n /** Template */\n _template: function _template() {\n return '
' + '
' + '
' + '
' + '
' + '
Drop files here
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
NameSizeTypeGenomeSettingsStatus' + '
' + '
' + '
' + 'Type (set all):' + '' + ' ' + 'Genome (set all):' + '' + '
' + '
' + '
';\n }\n });\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(2), __webpack_require__(0)))\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $, _) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** Renders the default uploader rows */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3), __webpack_require__(21), __webpack_require__(45), __webpack_require__(12), __webpack_require__(14)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, UploadModel, UploadSettings, Popover, Select) {\n return Backbone.View.extend({\n /** Dictionary of upload states and associated icons */\n status_classes: {\n init: 'upload-icon-button fa fa-trash-o',\n queued: 'upload-icon fa fa-spinner fa-spin',\n running: 'upload-icon fa fa-spinner fa-spin',\n success: 'upload-icon-button fa fa-check',\n error: 'upload-icon-button fa fa-exclamation-triangle'\n },\n\n initialize: function initialize(app, options) {\n var self = this;\n this.app = app;\n this.model = options.model;\n this.setElement(this._template(options.model));\n this.$mode = this.$('.upload-mode');\n this.$title = this.$('.upload-title');\n this.$text = this.$('.upload-text');\n this.$size = this.$('.upload-size');\n this.$info_text = this.$('.upload-info-text');\n this.$info_progress = this.$('.upload-info-progress');\n this.$text_content = this.$('.upload-text-content');\n this.$settings = this.$('.upload-settings');\n this.$symbol = this.$('.upload-symbol');\n this.$progress_bar = this.$('.upload-progress-bar');\n this.$percentage = this.$('.upload-percentage');\n\n // append popup to settings icon\n this.settings = new Popover.View({\n title: 'Upload configuration',\n container: this.$('.upload-settings'),\n placement: 'bottom'\n });\n\n // identify default genome and extension values\n var default_genome = this.app.select_genome.value();\n var default_extension = this.app.select_extension.value();\n\n // create select genomes\n this.select_genome = new Select.View({\n css: 'upload-genome',\n data: self.app.list_genomes,\n container: this.$('.upload-genome'),\n value: default_genome,\n onchange: function onchange(genome) {\n self.model.set('genome', genome);\n }\n });\n\n // create select extension\n this.select_extension = new Select.View({\n css: 'upload-extension',\n data: self.app.list_extensions,\n container: this.$('.upload-extension'),\n value: default_extension,\n onchange: function onchange(extension) {\n self.model.set('extension', extension);\n }\n });\n\n // initialize genome and extension values\n this.model.set({ 'genome': default_genome, 'extension': default_extension });\n\n // handle click event\n this.$symbol.on('click', function () {\n self._removeRow();\n });\n\n // handle extension info popover\n this.$('.upload-extension-info').on('click', function (e) {\n self.app.showExtensionInfo({\n $el: $(e.target),\n title: self.select_extension.text(),\n extension: self.select_extension.value()\n });\n }).on('mousedown', function (e) {\n e.preventDefault();\n });\n\n // handle settings popover\n this.$settings.on('click', function (e) {\n self._showSettings();\n }).on('mousedown', function (e) {\n e.preventDefault();\n });\n\n // handle text editing event\n this.$text_content.on('change input', function (e) {\n self.model.set({ 'url_paste': $(e.target).val(),\n 'file_size': $(e.target).val().length });\n });\n\n // model events\n this.listenTo(this.model, 'change:percentage', function () {\n self._refreshPercentage();\n });\n this.listenTo(this.model, 'change:status', function () {\n self._refreshStatus();\n });\n this.listenTo(this.model, 'change:info', function () {\n self._refreshInfo();\n });\n this.listenTo(this.model, 'change:genome', function () {\n self._refreshGenome();\n });\n this.listenTo(this.model, 'change:extension', function () {\n self._refreshExtension();\n });\n this.listenTo(this.model, 'change:file_size', function () {\n self._refreshFileSize();\n });\n },\n\n render: function render() {\n this._refreshType();\n this._refreshPercentage();\n this._refreshStatus();\n this._refreshInfo();\n this._refreshGenome();\n this._refreshExtension();\n this._refreshFileSize();\n },\n\n /** Remove view */\n remove: function remove() {\n this.select_genome.remove();\n this.select_extension.remove();\n Backbone.View.prototype.remove.apply(this);\n },\n\n /** Render type */\n _refreshType: function _refreshType() {\n var options = this.model.attributes;\n this.$title.html(_.escape(options.file_name));\n this.$size.html(Utils.bytesToString(options.file_size));\n this.$mode.removeClass().addClass('upload-mode').addClass('text-primary');\n if (options.file_mode == 'new') {\n this.$text.css({ 'width': this.$el.width() - 16 + 'px', 'top': this.$el.height() - 8 + 'px' }).show();\n this.$el.height(this.$el.height() - 8 + this.$text.height() + 16);\n this.$mode.addClass('fa fa-edit');\n } else if (options.file_mode == 'local') {\n this.$mode.addClass('fa fa-laptop');\n } else if (options.file_mode == 'ftp') {\n this.$mode.addClass('fa fa-folder-open-o');\n }\n },\n\n /** Update extension */\n _refreshExtension: function _refreshExtension() {\n this.select_extension.value(this.model.get('extension'));\n },\n\n /** Update genome */\n _refreshGenome: function _refreshGenome() {\n this.select_genome.value(this.model.get('genome'));\n },\n\n /** Refresh info text */\n _refreshInfo: function _refreshInfo() {\n var info = this.model.get('info');\n if (info) {\n this.$info_text.html('Failed: ' + info).show();\n } else {\n this.$info_text.hide();\n }\n },\n\n /** Refresh percentage status */\n _refreshPercentage: function _refreshPercentage() {\n var percentage = parseInt(this.model.get('percentage'));\n this.$progress_bar.css({ width: percentage + '%' });\n this.$percentage.html(percentage != 100 ? percentage + '%' : 'Adding to history...');\n },\n\n /** Refresh status */\n _refreshStatus: function _refreshStatus() {\n var status = this.model.get('status');\n this.$symbol.removeClass().addClass('upload-symbol').addClass(this.status_classes[status]);\n this.model.set('enabled', status == 'init');\n var enabled = this.model.get('enabled');\n this.$text_content.attr('disabled', !enabled);\n if (enabled) {\n this.select_genome.enable();\n this.select_extension.enable();\n } else {\n this.select_genome.disable();\n this.select_extension.disable();\n }\n if (status == 'success') {\n this.$el.addClass('success');\n this.$percentage.html('100%');\n }\n if (status == 'error') {\n this.$el.addClass('danger');\n this.$info_progress.hide();\n }\n },\n\n /** Refresh file size */\n _refreshFileSize: function _refreshFileSize() {\n this.$size.html(Utils.bytesToString(this.model.get('file_size')));\n },\n\n /** Remove row */\n _removeRow: function _removeRow() {\n if (['init', 'success', 'error'].indexOf(this.model.get('status')) !== -1) {\n this.app.collection.remove(this.model);\n }\n },\n\n /** Attach file info popup */\n _showSettings: function _showSettings() {\n if (!this.settings.visible) {\n this.settings.empty();\n this.settings.append(new UploadSettings(this).$el);\n this.settings.show();\n } else {\n this.settings.hide();\n }\n },\n\n /** View template */\n _template: function _template(options) {\n return '' + '' + '
' + '
' + '
' + '
' + '
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
' + '',\n '
',\n '
'\n ].join( '' );\n }\n});\n\n//==============================================================================\nreturn {\n CitationView : CitationView,\n CitationListView : CitationListView\n};\n\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/citation/citation-view.js","var jQuery = require( 'jquery' ),\n $ = jQuery,\n GalaxyApp = require( 'galaxy' ).GalaxyApp,\n Router = require( 'layout/router' ),\n ToolPanel = require( './panels/tool-panel' ),\n HistoryPanel = require( './panels/history-panel' ),\n Page = require( 'layout/page' ),\n ToolForm = require( 'mvc/tool/tool-form' ),\n FormWrapper = require( 'mvc/form/form-wrapper' ),\n UserPreferences = require( 'mvc/user/user-preferences' ),\n CustomBuilds = require( 'mvc/user/user-custom-builds' ),\n Tours = require( 'mvc/tours' ),\n GridView = require( 'mvc/grid/grid-view' ),\n GridShared = require( 'mvc/grid/grid-shared' ),\n Workflows = require( 'mvc/workflow/workflow' ),\n HistoryList = require( 'mvc/history/history-list' ),\n ToolFormComposite = require( 'mvc/tool/tool-form-composite' ),\n QueryStringParsing = require( 'utils/query-string-parsing' ),\n Utils = require( 'utils/utils' ),\n Ui = require( 'mvc/ui/ui-misc' ),\n DatasetError = require( 'mvc/dataset/dataset-error' ),\n DatasetEditAttributes = require('mvc/dataset/dataset-edit-attributes');\n\n/** define the 'Analyze Data'/analysis/main/home page for Galaxy\n * * has a masthead\n * * a left tool menu to allow the user to load tools in the center panel\n * * a right history menu that shows the user's current data\n * * a center panel\n * Both panels (generally) persist while the center panel shows any\n * UI needed for the current step of an analysis, like:\n * * tool forms to set tool parameters,\n * * tables showing the contents of datasets\n * * etc.\n */\nwindow.app = function app( options, bootstrapped ){\n window.Galaxy = new GalaxyApp( options, bootstrapped );\n Galaxy.debug( 'analysis app' );\n\n /** Routes */\n var AnalysisRouter = Router.extend({\n routes : {\n '(/)' : 'home',\n '(/)root*' : 'home',\n '(/)tours(/)(:tour_id)' : 'show_tours',\n '(/)user(/)' : 'show_user',\n '(/)user(/)(:form_id)' : 'show_user_form',\n '(/)workflow(/)' : 'show_workflows',\n '(/)workflow/run(/)' : 'show_run',\n '(/)pages(/)create(/)' : 'show_pages_create',\n '(/)pages(/)edit(/)' : 'show_pages_edit',\n '(/)pages(/)(:action_id)' : 'show_pages',\n '(/)visualizations(/)edit(/)' : 'show_visualizations_edit',\n '(/)visualizations/(:action_id)' : 'show_visualizations',\n '(/)workflows/list_published(/)' : 'show_workflows_published',\n '(/)histories(/)rename(/)' : 'show_histories_rename',\n '(/)histories(/)permissions(/)' : 'show_histories_permissions',\n '(/)histories(/)(:action_id)' : 'show_histories',\n '(/)datasets(/)list(/)' : 'show_datasets',\n '(/)workflow/import_workflow' : 'show_import_workflow',\n '(/)custom_builds' : 'show_custom_builds',\n '(/)datasets/edit': 'show_dataset_edit_attributes',\n '(/)datasets/error': 'show_dataset_error'\n },\n\n require_login: [\n 'show_user',\n 'show_user_form',\n 'show_workflows'\n ],\n\n authenticate: function( args, name ) {\n return ( Galaxy.user && Galaxy.user.id ) || this.require_login.indexOf( name ) == -1;\n },\n\n show_tours : function( tour_id ){\n if ( tour_id ){\n Tours.giveTour( tour_id );\n } else {\n this.page.display( new Tours.ToursView() );\n }\n },\n\n show_user : function(){\n this.page.display( new UserPreferences.View() );\n },\n\n show_user_form : function( form_id ) {\n var model = new UserPreferences.Model( { user_id: Galaxy.params.id } );\n this.page.display( new FormWrapper.View ( model.get( form_id ) ) );\n },\n\n show_visualizations : function( action_id ) {\n this.page.display( new GridShared.View( { action_id: action_id, plural: 'Visualizations', item: 'visualization' } ) );\n },\n\n show_visualizations_edit : function() {\n this.page.display( new FormWrapper.View ( { url : 'visualization/edit?id=' + QueryStringParsing.get( 'id' ), redirect: 'visualizations/list' } ) );\n },\n\n show_workflows_published : function() {\n this.page.display( new GridView( { url_base: Galaxy.root + 'workflow/list_published', dict_format: true } ) );\n },\n\n show_histories : function( action_id ) {\n this.page.display( new HistoryList.View( { action_id: action_id } ) );\n },\n\n show_histories_rename : function() {\n this.page.display( new FormWrapper.View ( { url : 'history/rename?id=' + QueryStringParsing.get( 'id' ), redirect: 'histories/list' } ) );\n },\n\n show_histories_permissions : function() {\n this.page.display( new FormWrapper.View ( { url : 'history/permissions?id=' + QueryStringParsing.get( 'id' ), redirect: 'histories/list' } ) );\n },\n\n show_datasets : function() {\n this.page.display( new GridView( { url_base: Galaxy.root + 'dataset/list', dict_format: true } ) );\n },\n\n show_pages : function( action_id ) {\n this.page.display( new GridShared.View( { action_id: action_id, plural: 'Pages', item: 'page' } ) );\n },\n\n show_pages_create : function() {\n this.page.display( new FormWrapper.View ( { url : 'page/create', redirect: 'pages/list' } ) );\n },\n\n show_pages_edit : function() {\n this.page.display( new FormWrapper.View ( { url : 'page/edit?id=' + QueryStringParsing.get( 'id' ), redirect: 'pages/list' } ) );\n },\n\n show_workflows : function(){\n this.page.display( new Workflows.View() );\n },\n\n show_run : function() {\n this._loadWorkflow();\n },\n\n show_import_workflow : function() {\n this.page.display( new Workflows.ImportWorkflowView() );\n },\n\n show_custom_builds : function() {\n var self = this;\n var historyPanel = this.page.historyPanel.historyView;\n if ( !historyPanel || !historyPanel.model || !historyPanel.model.id ) {\n window.setTimeout(function() { self.show_custom_builds() }, 500)\n return;\n }\n this.page.display( new CustomBuilds.View() );\n },\n\n show_dataset_edit_attributes : function() {\n this.page.display( new DatasetEditAttributes.View() );\n },\n\n show_dataset_error : function() {\n this.page.display( new DatasetError.View() );\n },\n\n /** */\n home : function( params ){\n // TODO: to router, remove Globals\n // load a tool by id (tool_id) or rerun a previous tool execution (job_id)\n if( params.tool_id || params.job_id ) {\n if ( params.tool_id === 'upload1' ) {\n this.page.toolPanel.upload.show();\n this._loadCenterIframe( 'welcome' );\n } else {\n this._loadToolForm( params );\n }\n } else {\n // show the workflow run form\n if( params.workflow_id ){\n this._loadWorkflow();\n // load the center iframe with controller.action: galaxy.org/?m_c=history&m_a=list -> history/list\n } else if( params.m_c ){\n this._loadCenterIframe( params.m_c + '/' + params.m_a );\n // show the workflow run form\n } else {\n this._loadCenterIframe( 'welcome' );\n }\n }\n },\n\n /** load the center panel with a tool form described by the given params obj */\n _loadToolForm : function( params ){\n //TODO: load tool form code async\n params.id = decodeURIComponent( params.tool_id );\n this.page.display( new ToolForm.View( params ) );\n },\n\n /** load the center panel iframe using the given url */\n _loadCenterIframe : function( url, root ){\n root = root || Galaxy.root;\n url = root + url;\n this.page.$( '#galaxy_main' ).prop( 'src', url );\n },\n\n /** load workflow by its url in run mode */\n _loadWorkflow: function() {\n var self = this;\n Utils.get({\n url: Galaxy.root + 'api/workflows/' + Utils.getQueryString( 'id' ) + '/download?style=run',\n success: function( response ) {\n self.page.display( new ToolFormComposite.View( response ) );\n },\n error: function( response ) {\n var error_msg = response.err_msg || 'Error occurred while loading the resource.';\n var options = { 'message': error_msg, 'status': 'danger', 'persistent': true };\n self.page.display( new Ui.Message( options ) );\n }\n });\n }\n });\n\n // render and start the router\n $(function(){\n Galaxy.page = new Page.View( _.extend( options, {\n Left : ToolPanel,\n Right : HistoryPanel,\n Router : AnalysisRouter\n } ) );\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/apps/analysis.js","var Tools = require( 'mvc/tool/tools' ),\n Upload = require( 'mvc/upload/upload-view' ),\n _l = require( 'utils/localization' ),\n ToolForm = require( 'mvc/tool/tool-form-composite' );\n\nvar ToolPanel = Backbone.View.extend({\n initialize: function( page, options ) {\n // access configuration options\n var config = options.config;\n this.root = options.root;\n\n /** @type {Object[]} descriptions of user's workflows to be shown in the tool menu */\n this.stored_workflow_menu_entries = config.stored_workflow_menu_entries || [];\n\n // create tool search, tool panel, and tool panel view.\n var tool_search = new Tools.ToolSearch({\n hidden : false\n });\n var tools = new Tools.ToolCollection( config.toolbox );\n this.tool_panel = new Tools.ToolPanel({\n tool_search : tool_search,\n tools : tools,\n layout : config.toolbox_in_panel\n });\n this.tool_panel_view = new Tools.ToolPanelView({ model: this.tool_panel });\n\n // add upload modal\n this.upload_button = new Upload({\n nginx_upload_path : config.nginx_upload_path,\n ftp_upload_site : config.ftp_upload_site,\n default_genome : config.default_genome,\n default_extension : config.default_extension,\n });\n\n // add uploader button to Galaxy object\n Galaxy.upload = this.upload_button;\n\n // components for panel definition\n this.model = new Backbone.Model({\n title : _l( 'Tools' ),\n buttons : [ this.upload_button ]\n });\n\n // build body template\n this.setElement( this._template() );\n },\n\n render : function(){\n // if there are tools, render panel and display everything\n var self = this;\n if ( this.tool_panel.get( 'layout' ).size() > 0 ) {\n this.$el.prepend( this.tool_panel_view.$el );\n this.tool_panel_view.render();\n }\n // build the dom for the workflow portion of the tool menu\n // add internal workflow list\n self.$( '#internal-workflows' ).append( self._templateAllWorkflow({\n title : _l( 'All workflows' ),\n href : 'workflow'\n }));\n _.each( this.stored_workflow_menu_entries, function( menu_entry ){\n self.$( '#internal-workflows' ).append( self._templateWorkflowLink({\n title : menu_entry.stored_workflow.name,\n href : 'workflow/run?id=' + menu_entry.encoded_stored_workflow_id\n }));\n });\n },\n\n /** build a link to one tool */\n _templateTool: function( tool ) {\n return [\n '
',\n '', tool.title, '',\n '
'\n ].join('');\n },\n\n /** build a link to 'All Workflows' */\n _templateAllWorkflow: function( tool ) {\n return [\n '
',\n // global\n '', tool.title, '',\n '
'\n ].join('');\n },\n\n /** build links to workflows in toolpanel */\n _templateWorkflowLink: function( wf ) {\n return [\n '
',\n '', wf.title, '',\n '
'\n ].join('');\n },\n\n /** override to include inital menu dom and workflow section */\n _template : function() {\n return [\n '
',\n '
',\n '
',\n '', _l( 'Search did not match any tools.' ), '',\n '
',\n '
',\n '
',\n '
',\n '
',\n '', _l( 'Workflows' ), '',\n '
',\n '
',\n '
',\n '
',\n '
'\n ].join('');\n },\n\n toString : function() { return 'toolPanel' }\n});\n\nmodule.exports = ToolPanel;\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/apps/panels/tool-panel.js","/** Upload app contains the upload progress button and upload modal, compiles model data for API request **/\ndefine([ 'utils/utils', 'mvc/ui/ui-modal', 'mvc/ui/ui-tabs', 'mvc/upload/upload-button', 'mvc/upload/default/default-view', 'mvc/upload/composite/composite-view', 'mvc/upload/collection/collection-view' ],\nfunction( Utils, Modal, Tabs, UploadButton, UploadViewDefault, UploadViewComposite, UploadViewCollection ) {\n return Backbone.View.extend({\n options : {\n nginx_upload_path : '',\n ftp_upload_site : 'n/a',\n default_genome : '?',\n default_extension : 'auto',\n height : 500,\n width : 900,\n auto : {\n id : 'auto',\n text : 'Auto-detect',\n description : 'This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed.'\n }\n },\n\n // contains all available dataset extensions/types\n list_extensions: [],\n\n // contains all available genomes\n list_genomes: [],\n\n initialize: function( options ) {\n var self = this;\n this.options = Utils.merge( options, this.options );\n\n // create view for upload/progress button\n this.ui_button = new UploadButton.View({\n onclick : function(e) {\n e.preventDefault();\n self.show()\n },\n onunload : function() {\n var percentage = self.ui_button.model.get('percentage', 0);\n if (percentage > 0 && percentage < 100) {\n return 'Several uploads are queued.';\n }\n }\n });\n\n // set element to button view\n this.setElement( this.ui_button.$el );\n\n // load extensions\n var self = this;\n Utils.get({\n url : Galaxy.root + 'api/datatypes?extension_only=False',\n success : function( datatypes ) {\n for ( var key in datatypes ) {\n self.list_extensions.push({\n id : datatypes[ key ].extension,\n text : datatypes[ key ].extension,\n description : datatypes[ key ].description,\n description_url : datatypes[ key ].description_url,\n composite_files : datatypes[ key ].composite_files\n });\n }\n self.list_extensions.sort( function( a, b ) {\n var a_text = a.text && a.text.toLowerCase();\n var b_text = b.text && b.text.toLowerCase();\n return a_text > b_text ? 1 : a_text < b_text ? -1 : 0;\n });\n if ( !self.options.datatypes_disable_auto ) {\n self.list_extensions.unshift( self.options.auto );\n }\n }\n });\n\n // load genomes\n Utils.get({\n url : Galaxy.root + 'api/genomes',\n success : function( genomes ) {\n for ( var key in genomes ) {\n self.list_genomes.push({\n id : genomes[ key ][ 1 ],\n text : genomes[ key ][ 0 ]\n });\n }\n self.list_genomes.sort( function( a, b ) {\n if ( a.id == self.options.default_genome ) { return -1; }\n if ( b.id == self.options.default_genome ) { return 1; }\n return a.text > b.text ? 1 : a.text < b.text ? -1 : 0;\n });\n }\n });\n },\n\n /** Show/hide upload dialog */\n show: function () {\n var self = this;\n if ( !Galaxy.currHistoryPanel || !Galaxy.currHistoryPanel.model ) {\n window.setTimeout(function() { self.show() }, 500)\n return;\n }\n this.current_user = Galaxy.user.id;\n if ( !this.modal ) {\n this.tabs = new Tabs.View();\n this.default_view = new UploadViewDefault( this );\n this.tabs.add({\n id : 'regular',\n title : 'Regular',\n $el : this.default_view.$el\n });\n this.composite_view = new UploadViewComposite( this );\n this.tabs.add({\n id : 'composite',\n title : 'Composite',\n $el : this.composite_view.$el\n });\n this.collection_view = new UploadViewCollection( this );\n this.tabs.add({\n id : 'collection',\n title : 'Collection',\n $el : this.collection_view.$el\n });\n this.modal = new Modal.View({\n title : 'Download from web or upload from disk',\n body : this.tabs.$el,\n height : this.options.height,\n width : this.options.width,\n closing_events : true,\n title_separator : false\n });\n }\n this.modal.show();\n },\n\n /** Refresh user and current history */\n currentHistory: function() {\n return this.current_user && Galaxy.currHistoryPanel.model.get( 'id' );\n },\n\n /** Get ftp configuration */\n currentFtp: function() {\n return this.current_user && this.options.ftp_upload_site;\n },\n\n /**\n * Package API data from array of models\n * @param{Array} items - Upload items/rows filtered from a collection\n */\n toData: function( items, history_id ) {\n // create dictionary for data submission\n var data = {\n payload: {\n 'tool_id' : 'upload1',\n 'history_id' : history_id || this.currentHistory(),\n 'inputs' : {}\n },\n files: [],\n error_message: null\n }\n // add upload tools input data\n if ( items && items.length > 0 ) {\n var inputs = {\n 'file_count' : items.length,\n 'dbkey' : items[ 0 ].get( 'genome', '?' ),\n 'file_type' : items[ 0 ].get( 'extension', 'auto' )\n };\n for ( var index in items ) {\n var it = items[ index ];\n it.set( 'status', 'running' );\n if ( it.get( 'file_size' ) > 0 ) {\n var prefix = 'files_' + index + '|';\n inputs[ prefix + 'type' ] = 'upload_dataset';\n inputs[ prefix + 'space_to_tab' ] = it.get( 'space_to_tab' ) && 'Yes' || null;\n inputs[ prefix + 'to_posix_lines' ] = it.get( 'to_posix_lines' ) && 'Yes' || null;\n inputs[ prefix + 'dbkey' ] = it.get( 'genome', null );\n inputs[ prefix + 'file_type' ] = it.get( 'extension', null );\n switch ( it.get( 'file_mode' ) ) {\n case 'new':\n inputs[ prefix + 'url_paste' ] = it.get( 'url_paste' );\n break;\n case 'ftp':\n inputs[ prefix + 'ftp_files' ] = it.get( 'file_path' );\n break;\n case 'local':\n data.files.push( { name: prefix + 'file_data', file: it.get( 'file_data' ) } );\n }\n } else {\n data.error_message = 'Upload content incomplete.';\n it.set( 'status', 'error' );\n it.set( 'info', data.error_message );\n break;\n }\n }\n data.payload.inputs = JSON.stringify( inputs );\n }\n return data;\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/upload/upload-view.js","/** View for upload/progress bar button */\ndefine( [], function() {\n var View = Backbone.View.extend({\n initialize: function( options ) {\n var self = this;\n this.model = options && options.model || new Backbone.Model({\n icon : 'fa-upload',\n tooltip : 'Download from URL or upload files from disk',\n label : 'Load Data',\n percentage : 0,\n status : '',\n onunload : function(){},\n onclick : function(){}\n }).set( options );\n this.setElement( this._template() );\n this.$progress = this.$( '.progress-bar' );\n this.listenTo( this.model, 'change', this.render, this );\n this.render();\n $( window ).on( 'beforeunload', function() {\n return self.model.get( 'onunload' )();\n });\n },\n\n render: function() {\n var self = this;\n var options = this.model.attributes;\n this.$el.off( 'click' ).on( 'click', function( e ) { options.onclick( e ) } )\n .tooltip( { title: this.model.get('tooltip'), placement: 'bottom' } );\n this.$progress.removeClass()\n .addClass( 'progress-bar' )\n .addClass( 'progress-bar-notransition' )\n .addClass( options.status != '' && 'progress-bar-' + options.status )\n .css( { width : options.percentage + '%' } );\n },\n\n /** Template */\n _template: function() {\n return '
' +\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '
' +\n '
';\n }\n });\n return { View : View };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/upload/upload-button.js","/** Renders contents of the default uploader */\ndefine([ 'utils/utils', 'mvc/upload/upload-model', 'mvc/upload/default/default-row', 'mvc/upload/upload-ftp', 'mvc/upload/upload-extension', 'mvc/ui/ui-popover', 'mvc/ui/ui-select', 'mvc/ui/ui-misc', 'mvc/lazy/lazy-limited', 'utils/uploadbox'],\nfunction( Utils, UploadModel, UploadRow, UploadFtp, UploadExtension, Popover, Select, Ui, LazyLimited ) {\n\n return Backbone.View.extend({\n // current upload size in bytes\n upload_size: 0,\n\n // contains upload row models\n collection : new UploadModel.Collection(),\n\n // keeps track of the current uploader state\n counter : {\n announce : 0,\n success : 0,\n error : 0,\n running : 0,\n reset : function() { this.announce = this.success = this.error = this.running = 0 }\n },\n\n initialize : function( app ) {\n var self = this;\n this.app = app;\n this.options = app.options;\n this.list_extensions = app.list_extensions;\n this.list_genomes = app.list_genomes;\n this.ui_button = app.ui_button;\n this.ftp_upload_site = app.currentFtp();\n\n // build template\n this.setElement( this._template() );\n this.$uploadbox = this.$( '.upload-box' );\n this.$uploadtable = this.$( '.upload-table' );\n\n // append buttons to dom\n this.btnLocal = new Ui.Button( { id: 'btn-local', title: 'Choose local file', onclick: function() { self.uploadbox.select() }, icon: 'fa fa-laptop' } );\n this.btnFtp = new Ui.Button( { id: 'btn-ftp', title: 'Choose FTP file', onclick: function() { self._eventFtp() }, icon: 'fa fa-folder-open-o' } );\n this.btnCreate = new Ui.Button( { id: 'btn-new', title: 'Paste/Fetch data', onclick: function() { self._eventCreate() }, icon: 'fa fa-edit' } );\n this.btnStart = new Ui.Button( { id: 'btn-start', title: 'Start', onclick: function() { self._eventStart() } } );\n this.btnStop = new Ui.Button( { id: 'btn-stop', title: 'Pause', onclick: function() { self._eventStop() } } );\n this.btnReset = new Ui.Button( { id: 'btn-reset', title: 'Reset', onclick: function() { self._eventReset() } } );\n this.btnClose = new Ui.Button( { id: 'btn-close', title: 'Close', onclick: function() { self.app.modal.hide() } } );\n _.each( [ this.btnLocal, this.btnFtp, this.btnCreate, this.btnStop, this.btnReset, this.btnStart, this.btnClose ], function( button ) {\n self.$( '.upload-buttons' ).prepend( button.$el );\n });\n\n // file upload\n this.uploadbox = this.$uploadbox.uploadbox({\n url : this.app.options.nginx_upload_path,\n announce : function( index, file ) { self._eventAnnounce( index, file ) },\n initialize : function( index ) { return self.app.toData( [ self.collection.get( index ) ], self.history_id ) },\n progress : function( index, percentage ) { self._eventProgress( index, percentage ) },\n success : function( index, message ) { self._eventSuccess( index, message ) },\n error : function( index, message ) { self._eventError( index, message ) },\n complete : function() { self._eventComplete() },\n ondragover : function() { self.$uploadbox.addClass( 'highlight' ) },\n ondragleave : function() { self.$uploadbox.removeClass( 'highlight' ) }\n });\n\n // add ftp file viewer\n this.ftp = new Popover.View( { title: 'FTP files', container: this.btnFtp.$el } );\n\n // select extension\n this.select_extension = new Select.View({\n css : 'upload-footer-selection',\n container : this.$( '.upload-footer-extension' ),\n data : _.filter( this.list_extensions, function( ext ) { return !ext.composite_files } ),\n value : this.options.default_extension,\n onchange : function( extension ) { self._changeExtension( extension ) }\n });\n\n // handle extension info popover\n this.$( '.upload-footer-extension-info' ).on( 'click', function( e ) {\n new UploadExtension({\n $el : $( e.target ),\n title : self.select_extension.text(),\n extension : self.select_extension.value(),\n list : self.list_extensions,\n placement : 'top'\n });\n }).on( 'mousedown', function( e ) { e.preventDefault() } );\n\n // genome extension\n this.select_genome = new Select.View({\n css : 'upload-footer-selection',\n container : this.$( '.upload-footer-genome' ),\n data : this.list_genomes,\n value : this.options.default_genome,\n onchange : function( genome ) { self._changeGenome(genome) }\n });\n\n // Lazy load helper\n this.loader = new LazyLimited({\n $container : this.$uploadbox,\n collection : this.collection,\n new_content : function( model ) {\n var upload_row = new UploadRow( self, { model: model } )\n self.$uploadtable.find( '> tbody:first' ).append( upload_row.$el );\n upload_row.render();\n return upload_row;\n }\n });\n\n // events\n this.collection.on( 'remove', function( model ) { self._eventRemove( model ) } );\n this.render();\n },\n\n render: function () {\n var message = '';\n if( this.counter.announce == 0 ) {\n if (this.uploadbox.compatible()) {\n message = ' ';\n } else {\n message = 'Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.';\n }\n } else {\n if ( this.counter.running == 0 ) {\n message = 'You added ' + this.counter.announce + ' file(s) to the queue. Add more files or click \\'Start\\' to proceed.';\n } else {\n message = 'Please wait...' + this.counter.announce + ' out of ' + this.counter.running + ' remaining.';\n }\n }\n this.$( '.upload-top-info' ).html( message );\n var enable_reset = this.counter.running == 0 && this.counter.announce + this.counter.success + this.counter.error > 0;\n var enable_start = this.counter.running == 0 && this.counter.announce > 0;\n var enable_sources = this.counter.running == 0;\n var show_table = this.counter.announce + this.counter.success + this.counter.error > 0;\n this.btnReset[ enable_reset ? 'enable' : 'disable' ]();\n this.btnStart[ enable_start ? 'enable' : 'disable' ]();\n this.btnStart.$el[ enable_start ? 'addClass' : 'removeClass' ]( 'btn-primary' );\n this.btnStop[ this.counter.running > 0 ? 'enable' : 'disable' ]();\n this.btnLocal[ enable_sources ? 'enable' : 'disable' ]();\n this.btnFtp[ enable_sources ? 'enable' : 'disable' ]();\n this.btnCreate[ enable_sources ? 'enable' : 'disable' ]();\n this.btnFtp.$el[ this.ftp_upload_site ? 'show' : 'hide' ]();\n this.$( '.upload-table' )[ show_table ? 'show' : 'hide' ]();\n this.$( '.upload-helper' )[ show_table ? 'hide' : 'show' ]();\n },\n\n /** A new file has been dropped/selected through the uploadbox plugin */\n _eventAnnounce: function( index, file ) {\n this.counter.announce++;\n var new_model = new UploadModel.Model({\n id : index,\n file_name : file.name,\n file_size : file.size,\n file_mode : file.mode || 'local',\n file_path : file.path,\n file_data : file\n });\n this.render();\n this.collection.add( new_model );\n },\n\n /** Progress */\n _eventProgress: function( index, percentage ) {\n var it = this.collection.get( index );\n it.set( 'percentage', percentage );\n this.ui_button.model.set( 'percentage', this._uploadPercentage( percentage, it.get( 'file_size' ) ) );\n },\n\n /** Success */\n _eventSuccess: function( index, message ) {\n var it = this.collection.get( index );\n it.set( { 'percentage': 100, 'status': 'success' } );\n this.ui_button.model.set( 'percentage', this._uploadPercentage( 100, it.get( 'file_size' ) ) );\n this.upload_completed += it.get( 'file_size' ) * 100;\n this.counter.announce--;\n this.counter.success++;\n this.render();\n Galaxy.currHistoryPanel.refreshContents();\n },\n\n /** Error */\n _eventError: function( index, message ) {\n var it = this.collection.get( index );\n it.set( { 'percentage': 100, 'status': 'error', 'info': message } );\n this.ui_button.model.set( { 'percentage': this._uploadPercentage( 100, it.get( 'file_size' ) ), 'status': 'danger' } );\n this.upload_completed += it.get( 'file_size' ) * 100;\n this.counter.announce--;\n this.counter.error++;\n this.render();\n },\n\n /** Queue is done */\n _eventComplete: function() {\n this.collection.each( function( model ) { model.get( 'status' ) == 'queued' && model.set( 'status', 'init' ) } );\n this.counter.running = 0;\n this.render();\n },\n\n /** Remove model from upload list */\n _eventRemove: function( model ) {\n var status = model.get( 'status' );\n if ( status == 'success' ) {\n this.counter.success--;\n } else if ( status == 'error' ) {\n this.counter.error--;\n } else {\n this.counter.announce--;\n }\n this.uploadbox.remove( model.id );\n this.render();\n },\n\n //\n // events triggered by this view\n //\n\n /** Show/hide ftp popup */\n _eventFtp: function() {\n if ( !this.ftp.visible ) {\n this.ftp.empty();\n var self = this;\n this.ftp.append( ( new UploadFtp({\n collection : this.collection,\n ftp_upload_site : this.ftp_upload_site,\n onadd : function( ftp_file ) {\n return self.uploadbox.add([{\n mode: 'ftp',\n name: ftp_file.path,\n size: ftp_file.size,\n path: ftp_file.path\n }]);\n },\n onremove: function( model_index ) {\n self.collection.remove( model_index );\n }\n } ) ).$el );\n this.ftp.show();\n } else {\n this.ftp.hide();\n }\n },\n\n /** Create a new file */\n _eventCreate: function (){\n this.uploadbox.add( [ { name: 'New File', size: 0, mode: 'new' } ] );\n },\n\n /** Start upload process */\n _eventStart: function() {\n if ( this.counter.announce != 0 && this.counter.running == 0 ) {\n // prepare upload process\n var self = this;\n this.upload_size = 0;\n this.upload_completed = 0;\n this.collection.each( function( model ) {\n if( model.get( 'status' ) == 'init' ) {\n model.set( 'status', 'queued' );\n self.upload_size += model.get( 'file_size' );\n }\n });\n this.ui_button.model.set( { 'percentage': 0, 'status': 'success' } );\n this.counter.running = this.counter.announce;\n this.history_id = this.app.currentHistory();\n\n // package ftp files separately, and remove them from queue\n this._uploadFtp();\n\n // queue remaining files\n this.uploadbox.start();\n this.render();\n }\n },\n\n /** Pause upload process */\n _eventStop: function() {\n if ( this.counter.running > 0 ) {\n this.ui_button.model.set( 'status', 'info' );\n $( '.upload-top-info' ).html( 'Queue will pause after completing the current file...' );\n this.uploadbox.stop();\n }\n },\n\n /** Remove all */\n _eventReset: function() {\n if ( this.counter.running == 0 ){\n var self = this;\n this.collection.reset();\n this.counter.reset();\n this.uploadbox.reset();\n this.select_extension.value( this.options.default_extension );\n this.select_genome.value( this.options.default_genome );\n this.ui_button.model.set( 'percentage', 0 );\n this.render();\n }\n },\n\n /** Update extension for all models */\n _changeExtension: function( extension, defaults_only ) {\n var self = this;\n this.collection.each( function( model ) {\n if ( model.get( 'status' ) == 'init' && ( model.get( 'extension' ) == self.options.default_extension || !defaults_only ) ) {\n model.set( 'extension', extension );\n }\n });\n },\n\n /** Update genome for all models */\n _changeGenome: function( genome, defaults_only ) {\n var self = this;\n this.collection.each( function( model ) {\n if ( model.get( 'status' ) == 'init' && ( model.get( 'genome' ) == self.options.default_genome || !defaults_only ) ) {\n model.set( 'genome', genome );\n }\n });\n },\n\n /** Package and upload ftp files in a single request */\n _uploadFtp: function() {\n var self = this;\n var list = [];\n this.collection.each( function( model ) {\n if( model.get( 'status' ) == 'queued' && model.get( 'file_mode' ) == 'ftp' ) {\n self.uploadbox.remove( model.id );\n list.push( model );\n }\n });\n if(list.length > 0) {\n $.uploadpost({\n data : this.app.toData( list ),\n url : this.app.options.nginx_upload_path,\n success : function( message ) { _.each( list, function( model ) { self._eventSuccess( model.id ) } ) },\n error : function( message ) { _.each( list, function( model ) { self._eventError( model.id, message ) } ) }\n });\n }\n },\n\n /** Calculate percentage of all queued uploads */\n _uploadPercentage: function( percentage, size ) {\n return ( this.upload_completed + ( percentage * size ) ) / this.upload_size;\n },\n\n /** Template */\n _template: function() {\n return '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
Drop files here
' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '
NameSizeTypeGenomeSettingsStatus' +\n '
' +\n '
' +\n '
' +\n 'Type (set all):' +\n '' +\n ' ' +\n 'Genome (set all):' +\n '' +\n '
' +\n '
' +\n '
';\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/upload/default/default-view.js","/** Renders the default uploader rows */\ndefine( [ 'utils/utils', 'mvc/upload/upload-model', 'mvc/upload/upload-settings', 'mvc/ui/ui-popover', 'mvc/ui/ui-select' ],\nfunction( Utils, UploadModel, UploadSettings, Popover, Select ) {\n return Backbone.View.extend({\n /** Dictionary of upload states and associated icons */\n status_classes : {\n init : 'upload-icon-button fa fa-trash-o',\n queued : 'upload-icon fa fa-spinner fa-spin',\n running : 'upload-icon fa fa-spinner fa-spin',\n success : 'upload-icon-button fa fa-check',\n error : 'upload-icon-button fa fa-exclamation-triangle'\n },\n\n initialize: function( app, options ) {\n var self = this;\n this.app = app;\n this.model = options.model;\n this.setElement( this._template( options.model ) );\n this.$mode = this.$( '.upload-mode' );\n this.$title = this.$( '.upload-title' );\n this.$text = this.$( '.upload-text' );\n this.$size = this.$( '.upload-size' );\n this.$info_text = this.$( '.upload-info-text' );\n this.$info_progress = this.$( '.upload-info-progress' );\n this.$text_content = this.$( '.upload-text-content' );\n this.$settings = this.$( '.upload-settings' );\n this.$symbol = this.$( '.upload-symbol' );\n this.$progress_bar = this.$( '.upload-progress-bar' );\n this.$percentage = this.$( '.upload-percentage' );\n\n // append popup to settings icon\n this.settings = new Popover.View({\n title : 'Upload configuration',\n container : this.$( '.upload-settings' ),\n placement : 'bottom'\n });\n\n // identify default genome and extension values\n var default_genome = this.app.select_genome.value();\n var default_extension = this.app.select_extension.value();\n\n // create select genomes\n this.select_genome = new Select.View({\n css : 'upload-genome',\n data : self.app.list_genomes,\n container : this.$( '.upload-genome' ),\n value : default_genome,\n onchange : function( genome ) { self.model.set( 'genome', genome ) }\n });\n\n // create select extension\n this.select_extension = new Select.View({\n css : 'upload-extension',\n data : self.app.list_extensions,\n container : this.$( '.upload-extension' ),\n value : default_extension,\n onchange : function( extension ) { self.model.set('extension', extension) }\n });\n\n // initialize genome and extension values\n this.model.set( { 'genome': default_genome, 'extension': default_extension } );\n\n // handle click event\n this.$symbol.on('click', function() { self._removeRow(); });\n\n // handle extension info popover\n this.$( '.upload-extension-info' ).on( 'click' , function( e ) {\n self.app.showExtensionInfo({\n $el : $( e.target ),\n title : self.select_extension.text(),\n extension : self.select_extension.value()\n });\n }).on( 'mousedown', function( e ) { e.preventDefault() } );\n\n // handle settings popover\n this.$settings.on( 'click' , function( e ) { self._showSettings() } )\n .on( 'mousedown', function( e ) { e.preventDefault() });\n\n // handle text editing event\n this.$text_content.on( 'change input', function( e ) {\n self.model.set( { 'url_paste': $( e.target ).val(),\n 'file_size': $( e.target ).val().length } );\n });\n\n // model events\n this.listenTo( this.model, 'change:percentage', function() { self._refreshPercentage() } );\n this.listenTo( this.model, 'change:status', function() { self._refreshStatus() } );\n this.listenTo( this.model, 'change:info', function() { self._refreshInfo() } );\n this.listenTo( this.model, 'change:genome', function() { self._refreshGenome() } );\n this.listenTo( this.model, 'change:extension', function() { self._refreshExtension() } );\n this.listenTo( this.model, 'change:file_size', function() { self._refreshFileSize() } );\n },\n\n render: function() {\n this._refreshType();\n this._refreshPercentage();\n this._refreshStatus();\n this._refreshInfo()\n this._refreshGenome();\n this._refreshExtension();\n this._refreshFileSize()\n },\n\n /** Remove view */\n remove: function() {\n this.select_genome.remove();\n this.select_extension.remove();\n Backbone.View.prototype.remove.apply( this );\n },\n\n /** Render type */\n _refreshType: function() {\n var options = this.model.attributes;\n this.$title.html( _.escape( options.file_name ) );\n this.$size.html( Utils.bytesToString ( options.file_size ) );\n this.$mode.removeClass().addClass( 'upload-mode' ).addClass( 'text-primary' );\n if ( options.file_mode == 'new' ) {\n this.$text.css( { 'width' : this.$el.width() - 16 + 'px', 'top' : this.$el.height() - 8 + 'px' } ).show();\n this.$el.height( this.$el.height() - 8 + this.$text.height() + 16 );\n this.$mode.addClass( 'fa fa-edit' );\n } else if ( options.file_mode == 'local' ) {\n this.$mode.addClass( 'fa fa-laptop' );\n } else if ( options.file_mode == 'ftp' ) {\n this.$mode.addClass( 'fa fa-folder-open-o' );\n }\n },\n\n /** Update extension */\n _refreshExtension: function() {\n this.select_extension.value( this.model.get( 'extension' ) );\n },\n\n /** Update genome */\n _refreshGenome: function() {\n this.select_genome.value( this.model.get( 'genome' ) );\n },\n\n /** Refresh info text */\n _refreshInfo: function() {\n var info = this.model.get( 'info' );\n if ( info ) {\n this.$info_text.html( 'Failed: ' + info ).show();\n } else {\n this.$info_text.hide();\n }\n },\n\n /** Refresh percentage status */\n _refreshPercentage : function() {\n var percentage = parseInt( this.model.get( 'percentage' ) );\n this.$progress_bar.css( { width : percentage + '%' } );\n this.$percentage.html( percentage != 100 ? percentage + '%' : 'Adding to history...' );\n },\n\n /** Refresh status */\n _refreshStatus : function() {\n var status = this.model.get( 'status' );\n this.$symbol.removeClass().addClass( 'upload-symbol' ).addClass( this.status_classes[ status ] );\n this.model.set( 'enabled', status == 'init' );\n var enabled = this.model.get( 'enabled' );\n this.$text_content.attr( 'disabled', !enabled );\n if ( enabled ) {\n this.select_genome.enable();\n this.select_extension.enable();\n } else {\n this.select_genome.disable();\n this.select_extension.disable();\n }\n if ( status == 'success' ) {\n this.$el.addClass( 'success' );\n this.$percentage.html( '100%' );\n }\n if ( status == 'error' ) {\n this.$el.addClass( 'danger' );\n this.$info_progress.hide();\n }\n },\n\n /** Refresh file size */\n _refreshFileSize: function() {\n this.$size.html( Utils.bytesToString ( this.model.get( 'file_size' ) ) );\n },\n\n /** Remove row */\n _removeRow: function() {\n if ( [ 'init', 'success', 'error' ].indexOf( this.model.get( 'status' ) ) !== -1 ) {\n this.app.collection.remove( this.model );\n }\n },\n\n /** Attach file info popup */\n _showSettings : function() {\n if ( !this.settings.visible ) {\n this.settings.empty();\n this.settings.append( ( new UploadSettings( this ) ).$el );\n this.settings.show();\n } else {\n this.settings.hide();\n }\n },\n\n /** View template */\n _template: function( options ) {\n return '' +\n '' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
' +\n '', '
', '
'].join('');\n }\n });\n\n //==============================================================================\n return {\n CitationView: CitationView,\n CitationListView: CitationListView\n };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 95 */,\n/* 96 */,\n/* 97 */,\n/* 98 */,\n/* 99 */,\n/* 100 */,\n/* 101 */,\n/* 102 */,\n/* 103 */,\n/* 104 */,\n/* 105 */,\n/* 106 */,\n/* 107 */,\n/* 108 */,\n/* 109 */,\n/* 110 */,\n/* 111 */,\n/* 112 */,\n/* 113 */,\n/* 114 */,\n/* 115 */,\n/* 116 */,\n/* 117 */,\n/* 118 */,\n/* 119 */,\n/* 120 */,\n/* 121 */,\n/* 122 */,\n/* 123 */,\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(_) {\n\nvar jQuery = __webpack_require__(0),\n $ = jQuery,\n GalaxyApp = __webpack_require__(42).GalaxyApp,\n Router = __webpack_require__(44),\n ToolPanel = __webpack_require__(125),\n HistoryPanel = __webpack_require__(136),\n Page = __webpack_require__(43),\n ToolForm = __webpack_require__(63),\n FormWrapper = __webpack_require__(58),\n UserPreferences = __webpack_require__(150),\n CustomBuilds = __webpack_require__(151),\n Tours = __webpack_require__(70),\n GridView = __webpack_require__(16),\n GridShared = __webpack_require__(152),\n Workflows = __webpack_require__(153),\n HistoryList = __webpack_require__(155),\n ToolFormComposite = __webpack_require__(78),\n QueryStringParsing = __webpack_require__(11),\n Utils = __webpack_require__(3),\n Ui = __webpack_require__(5),\n DatasetError = __webpack_require__(156),\n DatasetEditAttributes = __webpack_require__(157);\n\n/** define the 'Analyze Data'/analysis/main/home page for Galaxy\n * * has a masthead\n * * a left tool menu to allow the user to load tools in the center panel\n * * a right history menu that shows the user's current data\n * * a center panel\n * Both panels (generally) persist while the center panel shows any\n * UI needed for the current step of an analysis, like:\n * * tool forms to set tool parameters,\n * * tables showing the contents of datasets\n * * etc.\n */\nwindow.app = function app(options, bootstrapped) {\n window.Galaxy = new GalaxyApp(options, bootstrapped);\n Galaxy.debug('analysis app');\n\n /** Routes */\n var AnalysisRouter = Router.extend({\n routes: {\n '(/)': 'home',\n '(/)root*': 'home',\n '(/)tours(/)(:tour_id)': 'show_tours',\n '(/)user(/)': 'show_user',\n '(/)user(/)(:form_id)': 'show_user_form',\n '(/)workflow(/)': 'show_workflows',\n '(/)workflow/run(/)': 'show_run',\n '(/)pages(/)create(/)': 'show_pages_create',\n '(/)pages(/)edit(/)': 'show_pages_edit',\n '(/)pages(/)(:action_id)': 'show_pages',\n '(/)visualizations(/)edit(/)': 'show_visualizations_edit',\n '(/)visualizations/(:action_id)': 'show_visualizations',\n '(/)workflows/list_published(/)': 'show_workflows_published',\n '(/)histories(/)rename(/)': 'show_histories_rename',\n '(/)histories(/)permissions(/)': 'show_histories_permissions',\n '(/)histories(/)(:action_id)': 'show_histories',\n '(/)datasets(/)list(/)': 'show_datasets',\n '(/)workflow/import_workflow': 'show_import_workflow',\n '(/)custom_builds': 'show_custom_builds',\n '(/)datasets/edit': 'show_dataset_edit_attributes',\n '(/)datasets/error': 'show_dataset_error'\n },\n\n require_login: ['show_user', 'show_user_form', 'show_workflows'],\n\n authenticate: function authenticate(args, name) {\n return Galaxy.user && Galaxy.user.id || this.require_login.indexOf(name) == -1;\n },\n\n show_tours: function show_tours(tour_id) {\n if (tour_id) {\n Tours.giveTour(tour_id);\n } else {\n this.page.display(new Tours.ToursView());\n }\n },\n\n show_user: function show_user() {\n this.page.display(new UserPreferences.View());\n },\n\n show_user_form: function show_user_form(form_id) {\n var model = new UserPreferences.Model({ user_id: Galaxy.params.id });\n this.page.display(new FormWrapper.View(model.get(form_id)));\n },\n\n show_visualizations: function show_visualizations(action_id) {\n this.page.display(new GridShared.View({ action_id: action_id, plural: 'Visualizations', item: 'visualization' }));\n },\n\n show_visualizations_edit: function show_visualizations_edit() {\n this.page.display(new FormWrapper.View({ url: 'visualization/edit?id=' + QueryStringParsing.get('id'), redirect: 'visualizations/list' }));\n },\n\n show_workflows_published: function show_workflows_published() {\n this.page.display(new GridView({ url_base: Galaxy.root + 'workflow/list_published', dict_format: true }));\n },\n\n show_histories: function show_histories(action_id) {\n this.page.display(new HistoryList.View({ action_id: action_id }));\n },\n\n show_histories_rename: function show_histories_rename() {\n this.page.display(new FormWrapper.View({ url: 'history/rename?id=' + QueryStringParsing.get('id'), redirect: 'histories/list' }));\n },\n\n show_histories_permissions: function show_histories_permissions() {\n this.page.display(new FormWrapper.View({ url: 'history/permissions?id=' + QueryStringParsing.get('id'), redirect: 'histories/list' }));\n },\n\n show_datasets: function show_datasets() {\n this.page.display(new GridView({ url_base: Galaxy.root + 'dataset/list', dict_format: true }));\n },\n\n show_pages: function show_pages(action_id) {\n this.page.display(new GridShared.View({ action_id: action_id, plural: 'Pages', item: 'page' }));\n },\n\n show_pages_create: function show_pages_create() {\n this.page.display(new FormWrapper.View({ url: 'page/create', redirect: 'pages/list' }));\n },\n\n show_pages_edit: function show_pages_edit() {\n this.page.display(new FormWrapper.View({ url: 'page/edit?id=' + QueryStringParsing.get('id'), redirect: 'pages/list' }));\n },\n\n show_workflows: function show_workflows() {\n this.page.display(new Workflows.View());\n },\n\n show_run: function show_run() {\n this._loadWorkflow();\n },\n\n show_import_workflow: function show_import_workflow() {\n this.page.display(new Workflows.ImportWorkflowView());\n },\n\n show_custom_builds: function show_custom_builds() {\n var self = this;\n var historyPanel = this.page.historyPanel.historyView;\n if (!historyPanel || !historyPanel.model || !historyPanel.model.id) {\n window.setTimeout(function () {\n self.show_custom_builds();\n }, 500);\n return;\n }\n this.page.display(new CustomBuilds.View());\n },\n\n show_dataset_edit_attributes: function show_dataset_edit_attributes() {\n this.page.display(new DatasetEditAttributes.View());\n },\n\n show_dataset_error: function show_dataset_error() {\n this.page.display(new DatasetError.View());\n },\n\n /** */\n home: function home(params) {\n // TODO: to router, remove Globals\n // load a tool by id (tool_id) or rerun a previous tool execution (job_id)\n if (params.tool_id || params.job_id) {\n if (params.tool_id === 'upload1') {\n this.page.toolPanel.upload.show();\n this._loadCenterIframe('welcome');\n } else {\n this._loadToolForm(params);\n }\n } else {\n // show the workflow run form\n if (params.workflow_id) {\n this._loadWorkflow();\n // load the center iframe with controller.action: galaxy.org/?m_c=history&m_a=list -> history/list\n } else if (params.m_c) {\n this._loadCenterIframe(params.m_c + '/' + params.m_a);\n // show the workflow run form\n } else {\n this._loadCenterIframe('welcome');\n }\n }\n },\n\n /** load the center panel with a tool form described by the given params obj */\n _loadToolForm: function _loadToolForm(params) {\n //TODO: load tool form code async\n params.id = decodeURIComponent(params.tool_id);\n this.page.display(new ToolForm.View(params));\n },\n\n /** load the center panel iframe using the given url */\n _loadCenterIframe: function _loadCenterIframe(url, root) {\n root = root || Galaxy.root;\n url = root + url;\n this.page.$('#galaxy_main').prop('src', url);\n },\n\n /** load workflow by its url in run mode */\n _loadWorkflow: function _loadWorkflow() {\n var self = this;\n Utils.get({\n url: Galaxy.root + 'api/workflows/' + Utils.getQueryString('id') + '/download?style=run',\n success: function success(response) {\n self.page.display(new ToolFormComposite.View(response));\n },\n error: function error(response) {\n var error_msg = response.err_msg || 'Error occurred while loading the resource.';\n var options = { 'message': error_msg, 'status': 'danger', 'persistent': true };\n self.page.display(new Ui.Message(options));\n }\n });\n }\n });\n\n // render and start the router\n $(function () {\n Galaxy.page = new Page.View(_.extend(options, {\n Left: ToolPanel,\n Right: HistoryPanel,\n Router: AnalysisRouter\n }));\n });\n};\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, _) {\n\nvar Tools = __webpack_require__(92),\n Upload = __webpack_require__(126),\n _l = __webpack_require__(4),\n ToolForm = __webpack_require__(78);\n\nvar ToolPanel = Backbone.View.extend({\n initialize: function initialize(page, options) {\n // access configuration options\n var config = options.config;\n this.root = options.root;\n\n /** @type {Object[]} descriptions of user's workflows to be shown in the tool menu */\n this.stored_workflow_menu_entries = config.stored_workflow_menu_entries || [];\n\n // create tool search, tool panel, and tool panel view.\n var tool_search = new Tools.ToolSearch({\n hidden: false\n });\n var tools = new Tools.ToolCollection(config.toolbox);\n this.tool_panel = new Tools.ToolPanel({\n tool_search: tool_search,\n tools: tools,\n layout: config.toolbox_in_panel\n });\n this.tool_panel_view = new Tools.ToolPanelView({ model: this.tool_panel });\n\n // add upload modal\n this.upload_button = new Upload({\n nginx_upload_path: config.nginx_upload_path,\n ftp_upload_site: config.ftp_upload_site,\n default_genome: config.default_genome,\n default_extension: config.default_extension\n });\n\n // add uploader button to Galaxy object\n Galaxy.upload = this.upload_button;\n\n // components for panel definition\n this.model = new Backbone.Model({\n title: _l('Tools'),\n buttons: [this.upload_button]\n });\n\n // build body template\n this.setElement(this._template());\n },\n\n render: function render() {\n // if there are tools, render panel and display everything\n var self = this;\n if (this.tool_panel.get('layout').size() > 0) {\n this.$el.prepend(this.tool_panel_view.$el);\n this.tool_panel_view.render();\n }\n // build the dom for the workflow portion of the tool menu\n // add internal workflow list\n self.$('#internal-workflows').append(self._templateAllWorkflow({\n title: _l('All workflows'),\n href: 'workflow'\n }));\n _.each(this.stored_workflow_menu_entries, function (menu_entry) {\n self.$('#internal-workflows').append(self._templateWorkflowLink({\n title: menu_entry.stored_workflow.name,\n href: 'workflow/run?id=' + menu_entry.encoded_stored_workflow_id\n }));\n });\n },\n\n /** build a link to one tool */\n _templateTool: function _templateTool(tool) {\n return [''].join('');\n },\n\n /** build a link to 'All Workflows' */\n _templateAllWorkflow: function _templateAllWorkflow(tool) {\n return ['
',\n // global\n '', tool.title, '', '
'].join('');\n },\n\n /** build links to workflows in toolpanel */\n _templateWorkflowLink: function _templateWorkflowLink(wf) {\n return [''].join('');\n },\n\n /** override to include inital menu dom and workflow section */\n _template: function _template() {\n return ['
', '
', '
', '', _l('Search did not match any tools.'), '', '
', '
', '
', '
', '
', '', _l('Workflows'), '', '
', '
', '
', '
', '
'].join('');\n },\n\n toString: function toString() {\n return 'toolPanel';\n }\n});\n\nmodule.exports = ToolPanel;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(2)))\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** Upload app contains the upload progress button and upload modal, compiles model data for API request **/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3), __webpack_require__(7), __webpack_require__(62), __webpack_require__(127), __webpack_require__(128), __webpack_require__(131), __webpack_require__(133)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, Modal, Tabs, UploadButton, UploadViewDefault, UploadViewComposite, UploadViewCollection) {\n return Backbone.View.extend({\n options: {\n nginx_upload_path: '',\n ftp_upload_site: 'n/a',\n default_genome: '?',\n default_extension: 'auto',\n height: 500,\n width: 900,\n auto: {\n id: 'auto',\n text: 'Auto-detect',\n description: 'This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed.'\n }\n },\n\n // contains all available dataset extensions/types\n list_extensions: [],\n\n // contains all available genomes\n list_genomes: [],\n\n initialize: function initialize(options) {\n var self = this;\n this.options = Utils.merge(options, this.options);\n\n // create view for upload/progress button\n this.ui_button = new UploadButton.View({\n onclick: function onclick(e) {\n e.preventDefault();\n self.show();\n },\n onunload: function onunload() {\n var percentage = self.ui_button.model.get('percentage', 0);\n if (percentage > 0 && percentage < 100) {\n return 'Several uploads are queued.';\n }\n }\n });\n\n // set element to button view\n this.setElement(this.ui_button.$el);\n\n // load extensions\n var self = this;\n Utils.get({\n url: Galaxy.root + 'api/datatypes?extension_only=False',\n success: function success(datatypes) {\n for (var key in datatypes) {\n self.list_extensions.push({\n id: datatypes[key].extension,\n text: datatypes[key].extension,\n description: datatypes[key].description,\n description_url: datatypes[key].description_url,\n composite_files: datatypes[key].composite_files\n });\n }\n self.list_extensions.sort(function (a, b) {\n var a_text = a.text && a.text.toLowerCase();\n var b_text = b.text && b.text.toLowerCase();\n return a_text > b_text ? 1 : a_text < b_text ? -1 : 0;\n });\n if (!self.options.datatypes_disable_auto) {\n self.list_extensions.unshift(self.options.auto);\n }\n }\n });\n\n // load genomes\n Utils.get({\n url: Galaxy.root + 'api/genomes',\n success: function success(genomes) {\n for (var key in genomes) {\n self.list_genomes.push({\n id: genomes[key][1],\n text: genomes[key][0]\n });\n }\n self.list_genomes.sort(function (a, b) {\n if (a.id == self.options.default_genome) {\n return -1;\n }\n if (b.id == self.options.default_genome) {\n return 1;\n }\n return a.text > b.text ? 1 : a.text < b.text ? -1 : 0;\n });\n }\n });\n },\n\n /** Show/hide upload dialog */\n show: function show() {\n var self = this;\n if (!Galaxy.currHistoryPanel || !Galaxy.currHistoryPanel.model) {\n window.setTimeout(function () {\n self.show();\n }, 500);\n return;\n }\n this.current_user = Galaxy.user.id;\n if (!this.modal) {\n this.tabs = new Tabs.View();\n this.default_view = new UploadViewDefault(this);\n this.tabs.add({\n id: 'regular',\n title: 'Regular',\n $el: this.default_view.$el\n });\n this.composite_view = new UploadViewComposite(this);\n this.tabs.add({\n id: 'composite',\n title: 'Composite',\n $el: this.composite_view.$el\n });\n this.collection_view = new UploadViewCollection(this);\n this.tabs.add({\n id: 'collection',\n title: 'Collection',\n $el: this.collection_view.$el\n });\n this.modal = new Modal.View({\n title: 'Download from web or upload from disk',\n body: this.tabs.$el,\n height: this.options.height,\n width: this.options.width,\n closing_events: true,\n title_separator: false\n });\n }\n this.modal.show();\n },\n\n /** Refresh user and current history */\n currentHistory: function currentHistory() {\n return this.current_user && Galaxy.currHistoryPanel.model.get('id');\n },\n\n /** Get ftp configuration */\n currentFtp: function currentFtp() {\n return this.current_user && this.options.ftp_upload_site;\n },\n\n /**\n * Package API data from array of models\n * @param{Array} items - Upload items/rows filtered from a collection\n */\n toData: function toData(items, history_id) {\n // create dictionary for data submission\n var data = {\n payload: {\n 'tool_id': 'upload1',\n 'history_id': history_id || this.currentHistory(),\n 'inputs': {}\n },\n files: [],\n error_message: null\n // add upload tools input data\n };if (items && items.length > 0) {\n var inputs = {\n 'file_count': items.length,\n 'dbkey': items[0].get('genome', '?'),\n 'file_type': items[0].get('extension', 'auto')\n };\n for (var index in items) {\n var it = items[index];\n it.set('status', 'running');\n if (it.get('file_size') > 0) {\n var prefix = 'files_' + index + '|';\n inputs[prefix + 'type'] = 'upload_dataset';\n inputs[prefix + 'space_to_tab'] = it.get('space_to_tab') && 'Yes' || null;\n inputs[prefix + 'to_posix_lines'] = it.get('to_posix_lines') && 'Yes' || null;\n inputs[prefix + 'dbkey'] = it.get('genome', null);\n inputs[prefix + 'file_type'] = it.get('extension', null);\n switch (it.get('file_mode')) {\n case 'new':\n inputs[prefix + 'url_paste'] = it.get('url_paste');\n break;\n case 'ftp':\n inputs[prefix + 'ftp_files'] = it.get('file_path');\n break;\n case 'local':\n data.files.push({ name: prefix + 'file_data', file: it.get('file_data') });\n }\n } else {\n data.error_message = 'Upload content incomplete.';\n it.set('status', 'error');\n it.set('info', data.error_message);\n break;\n }\n }\n data.payload.inputs = JSON.stringify(inputs);\n }\n return data;\n }\n });\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** View for upload/progress bar button */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n var View = Backbone.View.extend({\n initialize: function initialize(options) {\n var self = this;\n this.model = options && options.model || new Backbone.Model({\n icon: 'fa-upload',\n tooltip: 'Download from URL or upload files from disk',\n label: 'Load Data',\n percentage: 0,\n status: '',\n onunload: function onunload() {},\n onclick: function onclick() {}\n }).set(options);\n this.setElement(this._template());\n this.$progress = this.$('.progress-bar');\n this.listenTo(this.model, 'change', this.render, this);\n this.render();\n $(window).on('beforeunload', function () {\n return self.model.get('onunload')();\n });\n },\n\n render: function render() {\n var self = this;\n var options = this.model.attributes;\n this.$el.off('click').on('click', function (e) {\n options.onclick(e);\n }).tooltip({ title: this.model.get('tooltip'), placement: 'bottom' });\n this.$progress.removeClass().addClass('progress-bar').addClass('progress-bar-notransition').addClass(options.status != '' && 'progress-bar-' + options.status).css({ width: options.percentage + '%' });\n },\n\n /** Template */\n _template: function _template() {\n return '
' + '
' + '
' + '' + '' + '' + '
' + '
';\n }\n });\n return { View: View };\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))\n\n/***/ }),\n/* 128 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, _, $) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** Renders contents of the default uploader */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3), __webpack_require__(21), __webpack_require__(129), __webpack_require__(46), __webpack_require__(47), __webpack_require__(12), __webpack_require__(14), __webpack_require__(5), __webpack_require__(130), __webpack_require__(48)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, UploadModel, UploadRow, UploadFtp, UploadExtension, Popover, Select, Ui, LazyLimited) {\n\n return Backbone.View.extend({\n // current upload size in bytes\n upload_size: 0,\n\n // contains upload row models\n collection: new UploadModel.Collection(),\n\n // keeps track of the current uploader state\n counter: {\n announce: 0,\n success: 0,\n error: 0,\n running: 0,\n reset: function reset() {\n this.announce = this.success = this.error = this.running = 0;\n }\n },\n\n initialize: function initialize(app) {\n var self = this;\n this.app = app;\n this.options = app.options;\n this.list_extensions = app.list_extensions;\n this.list_genomes = app.list_genomes;\n this.ui_button = app.ui_button;\n this.ftp_upload_site = app.currentFtp();\n\n // build template\n this.setElement(this._template());\n this.$uploadbox = this.$('.upload-box');\n this.$uploadtable = this.$('.upload-table');\n\n // append buttons to dom\n this.btnLocal = new Ui.Button({ id: 'btn-local', title: 'Choose local file', onclick: function onclick() {\n self.uploadbox.select();\n }, icon: 'fa fa-laptop' });\n this.btnFtp = new Ui.Button({ id: 'btn-ftp', title: 'Choose FTP file', onclick: function onclick() {\n self._eventFtp();\n }, icon: 'fa fa-folder-open-o' });\n this.btnCreate = new Ui.Button({ id: 'btn-new', title: 'Paste/Fetch data', onclick: function onclick() {\n self._eventCreate();\n }, icon: 'fa fa-edit' });\n this.btnStart = new Ui.Button({ id: 'btn-start', title: 'Start', onclick: function onclick() {\n self._eventStart();\n } });\n this.btnStop = new Ui.Button({ id: 'btn-stop', title: 'Pause', onclick: function onclick() {\n self._eventStop();\n } });\n this.btnReset = new Ui.Button({ id: 'btn-reset', title: 'Reset', onclick: function onclick() {\n self._eventReset();\n } });\n this.btnClose = new Ui.Button({ id: 'btn-close', title: 'Close', onclick: function onclick() {\n self.app.modal.hide();\n } });\n _.each([this.btnLocal, this.btnFtp, this.btnCreate, this.btnStop, this.btnReset, this.btnStart, this.btnClose], function (button) {\n self.$('.upload-buttons').prepend(button.$el);\n });\n\n // file upload\n this.uploadbox = this.$uploadbox.uploadbox({\n url: this.app.options.nginx_upload_path,\n announce: function announce(index, file) {\n self._eventAnnounce(index, file);\n },\n initialize: function initialize(index) {\n return self.app.toData([self.collection.get(index)], self.history_id);\n },\n progress: function progress(index, percentage) {\n self._eventProgress(index, percentage);\n },\n success: function success(index, message) {\n self._eventSuccess(index, message);\n },\n error: function error(index, message) {\n self._eventError(index, message);\n },\n complete: function complete() {\n self._eventComplete();\n },\n ondragover: function ondragover() {\n self.$uploadbox.addClass('highlight');\n },\n ondragleave: function ondragleave() {\n self.$uploadbox.removeClass('highlight');\n }\n });\n\n // add ftp file viewer\n this.ftp = new Popover.View({ title: 'FTP files', container: this.btnFtp.$el });\n\n // select extension\n this.select_extension = new Select.View({\n css: 'upload-footer-selection',\n container: this.$('.upload-footer-extension'),\n data: _.filter(this.list_extensions, function (ext) {\n return !ext.composite_files;\n }),\n value: this.options.default_extension,\n onchange: function onchange(extension) {\n self._changeExtension(extension);\n }\n });\n\n // handle extension info popover\n this.$('.upload-footer-extension-info').on('click', function (e) {\n new UploadExtension({\n $el: $(e.target),\n title: self.select_extension.text(),\n extension: self.select_extension.value(),\n list: self.list_extensions,\n placement: 'top'\n });\n }).on('mousedown', function (e) {\n e.preventDefault();\n });\n\n // genome extension\n this.select_genome = new Select.View({\n css: 'upload-footer-selection',\n container: this.$('.upload-footer-genome'),\n data: this.list_genomes,\n value: this.options.default_genome,\n onchange: function onchange(genome) {\n self._changeGenome(genome);\n }\n });\n\n // Lazy load helper\n this.loader = new LazyLimited({\n $container: this.$uploadbox,\n collection: this.collection,\n new_content: function new_content(model) {\n var upload_row = new UploadRow(self, { model: model });\n self.$uploadtable.find('> tbody:first').append(upload_row.$el);\n upload_row.render();\n return upload_row;\n }\n });\n\n // events\n this.collection.on('remove', function (model) {\n self._eventRemove(model);\n });\n this.render();\n },\n\n render: function render() {\n var message = '';\n if (this.counter.announce == 0) {\n if (this.uploadbox.compatible()) {\n message = ' ';\n } else {\n message = 'Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.';\n }\n } else {\n if (this.counter.running == 0) {\n message = 'You added ' + this.counter.announce + ' file(s) to the queue. Add more files or click \\'Start\\' to proceed.';\n } else {\n message = 'Please wait...' + this.counter.announce + ' out of ' + this.counter.running + ' remaining.';\n }\n }\n this.$('.upload-top-info').html(message);\n var enable_reset = this.counter.running == 0 && this.counter.announce + this.counter.success + this.counter.error > 0;\n var enable_start = this.counter.running == 0 && this.counter.announce > 0;\n var enable_sources = this.counter.running == 0;\n var show_table = this.counter.announce + this.counter.success + this.counter.error > 0;\n this.btnReset[enable_reset ? 'enable' : 'disable']();\n this.btnStart[enable_start ? 'enable' : 'disable']();\n this.btnStart.$el[enable_start ? 'addClass' : 'removeClass']('btn-primary');\n this.btnStop[this.counter.running > 0 ? 'enable' : 'disable']();\n this.btnLocal[enable_sources ? 'enable' : 'disable']();\n this.btnFtp[enable_sources ? 'enable' : 'disable']();\n this.btnCreate[enable_sources ? 'enable' : 'disable']();\n this.btnFtp.$el[this.ftp_upload_site ? 'show' : 'hide']();\n this.$('.upload-table')[show_table ? 'show' : 'hide']();\n this.$('.upload-helper')[show_table ? 'hide' : 'show']();\n },\n\n /** A new file has been dropped/selected through the uploadbox plugin */\n _eventAnnounce: function _eventAnnounce(index, file) {\n this.counter.announce++;\n var new_model = new UploadModel.Model({\n id: index,\n file_name: file.name,\n file_size: file.size,\n file_mode: file.mode || 'local',\n file_path: file.path,\n file_data: file\n });\n this.render();\n this.collection.add(new_model);\n },\n\n /** Progress */\n _eventProgress: function _eventProgress(index, percentage) {\n var it = this.collection.get(index);\n it.set('percentage', percentage);\n this.ui_button.model.set('percentage', this._uploadPercentage(percentage, it.get('file_size')));\n },\n\n /** Success */\n _eventSuccess: function _eventSuccess(index, message) {\n var it = this.collection.get(index);\n it.set({ 'percentage': 100, 'status': 'success' });\n this.ui_button.model.set('percentage', this._uploadPercentage(100, it.get('file_size')));\n this.upload_completed += it.get('file_size') * 100;\n this.counter.announce--;\n this.counter.success++;\n this.render();\n Galaxy.currHistoryPanel.refreshContents();\n },\n\n /** Error */\n _eventError: function _eventError(index, message) {\n var it = this.collection.get(index);\n it.set({ 'percentage': 100, 'status': 'error', 'info': message });\n this.ui_button.model.set({ 'percentage': this._uploadPercentage(100, it.get('file_size')), 'status': 'danger' });\n this.upload_completed += it.get('file_size') * 100;\n this.counter.announce--;\n this.counter.error++;\n this.render();\n },\n\n /** Queue is done */\n _eventComplete: function _eventComplete() {\n this.collection.each(function (model) {\n model.get('status') == 'queued' && model.set('status', 'init');\n });\n this.counter.running = 0;\n this.render();\n },\n\n /** Remove model from upload list */\n _eventRemove: function _eventRemove(model) {\n var status = model.get('status');\n if (status == 'success') {\n this.counter.success--;\n } else if (status == 'error') {\n this.counter.error--;\n } else {\n this.counter.announce--;\n }\n this.uploadbox.remove(model.id);\n this.render();\n },\n\n //\n // events triggered by this view\n //\n\n /** Show/hide ftp popup */\n _eventFtp: function _eventFtp() {\n if (!this.ftp.visible) {\n this.ftp.empty();\n var self = this;\n this.ftp.append(new UploadFtp({\n collection: this.collection,\n ftp_upload_site: this.ftp_upload_site,\n onadd: function onadd(ftp_file) {\n return self.uploadbox.add([{\n mode: 'ftp',\n name: ftp_file.path,\n size: ftp_file.size,\n path: ftp_file.path\n }]);\n },\n onremove: function onremove(model_index) {\n self.collection.remove(model_index);\n }\n }).$el);\n this.ftp.show();\n } else {\n this.ftp.hide();\n }\n },\n\n /** Create a new file */\n _eventCreate: function _eventCreate() {\n this.uploadbox.add([{ name: 'New File', size: 0, mode: 'new' }]);\n },\n\n /** Start upload process */\n _eventStart: function _eventStart() {\n if (this.counter.announce != 0 && this.counter.running == 0) {\n // prepare upload process\n var self = this;\n this.upload_size = 0;\n this.upload_completed = 0;\n this.collection.each(function (model) {\n if (model.get('status') == 'init') {\n model.set('status', 'queued');\n self.upload_size += model.get('file_size');\n }\n });\n this.ui_button.model.set({ 'percentage': 0, 'status': 'success' });\n this.counter.running = this.counter.announce;\n this.history_id = this.app.currentHistory();\n\n // package ftp files separately, and remove them from queue\n this._uploadFtp();\n\n // queue remaining files\n this.uploadbox.start();\n this.render();\n }\n },\n\n /** Pause upload process */\n _eventStop: function _eventStop() {\n if (this.counter.running > 0) {\n this.ui_button.model.set('status', 'info');\n $('.upload-top-info').html('Queue will pause after completing the current file...');\n this.uploadbox.stop();\n }\n },\n\n /** Remove all */\n _eventReset: function _eventReset() {\n if (this.counter.running == 0) {\n var self = this;\n this.collection.reset();\n this.counter.reset();\n this.uploadbox.reset();\n this.select_extension.value(this.options.default_extension);\n this.select_genome.value(this.options.default_genome);\n this.ui_button.model.set('percentage', 0);\n this.render();\n }\n },\n\n /** Update extension for all models */\n _changeExtension: function _changeExtension(extension, defaults_only) {\n var self = this;\n this.collection.each(function (model) {\n if (model.get('status') == 'init' && (model.get('extension') == self.options.default_extension || !defaults_only)) {\n model.set('extension', extension);\n }\n });\n },\n\n /** Update genome for all models */\n _changeGenome: function _changeGenome(genome, defaults_only) {\n var self = this;\n this.collection.each(function (model) {\n if (model.get('status') == 'init' && (model.get('genome') == self.options.default_genome || !defaults_only)) {\n model.set('genome', genome);\n }\n });\n },\n\n /** Package and upload ftp files in a single request */\n _uploadFtp: function _uploadFtp() {\n var self = this;\n var list = [];\n this.collection.each(function (model) {\n if (model.get('status') == 'queued' && model.get('file_mode') == 'ftp') {\n self.uploadbox.remove(model.id);\n list.push(model);\n }\n });\n if (list.length > 0) {\n $.uploadpost({\n data: this.app.toData(list),\n url: this.app.options.nginx_upload_path,\n success: function success(message) {\n _.each(list, function (model) {\n self._eventSuccess(model.id);\n });\n },\n error: function error(message) {\n _.each(list, function (model) {\n self._eventError(model.id, message);\n });\n }\n });\n }\n },\n\n /** Calculate percentage of all queued uploads */\n _uploadPercentage: function _uploadPercentage(percentage, size) {\n return (this.upload_completed + percentage * size) / this.upload_size;\n },\n\n /** Template */\n _template: function _template() {\n return '
' + '
' + '
' + '
' + '
' + '
Drop files here
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
NameSizeTypeGenomeSettingsStatus' + '
' + '
' + '
' + 'Type (set all):' + '' + ' ' + 'Genome (set all):' + '' + '
' + '
' + '
';\n }\n });\n}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(2), __webpack_require__(0)))\n\n/***/ }),\n/* 129 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Backbone, $, _) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\n/** Renders the default uploader rows */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3), __webpack_require__(21), __webpack_require__(45), __webpack_require__(12), __webpack_require__(14)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Utils, UploadModel, UploadSettings, Popover, Select) {\n return Backbone.View.extend({\n /** Dictionary of upload states and associated icons */\n status_classes: {\n init: 'upload-icon-button fa fa-trash-o',\n queued: 'upload-icon fa fa-spinner fa-spin',\n running: 'upload-icon fa fa-spinner fa-spin',\n success: 'upload-icon-button fa fa-check',\n error: 'upload-icon-button fa fa-exclamation-triangle'\n },\n\n initialize: function initialize(app, options) {\n var self = this;\n this.app = app;\n this.model = options.model;\n this.setElement(this._template(options.model));\n this.$mode = this.$('.upload-mode');\n this.$title = this.$('.upload-title');\n this.$text = this.$('.upload-text');\n this.$size = this.$('.upload-size');\n this.$info_text = this.$('.upload-info-text');\n this.$info_progress = this.$('.upload-info-progress');\n this.$text_content = this.$('.upload-text-content');\n this.$settings = this.$('.upload-settings');\n this.$symbol = this.$('.upload-symbol');\n this.$progress_bar = this.$('.upload-progress-bar');\n this.$percentage = this.$('.upload-percentage');\n\n // append popup to settings icon\n this.settings = new Popover.View({\n title: 'Upload configuration',\n container: this.$('.upload-settings'),\n placement: 'bottom'\n });\n\n // identify default genome and extension values\n var default_genome = this.app.select_genome.value();\n var default_extension = this.app.select_extension.value();\n\n // create select genomes\n this.select_genome = new Select.View({\n css: 'upload-genome',\n data: self.app.list_genomes,\n container: this.$('.upload-genome'),\n value: default_genome,\n onchange: function onchange(genome) {\n self.model.set('genome', genome);\n }\n });\n\n // create select extension\n this.select_extension = new Select.View({\n css: 'upload-extension',\n data: self.app.list_extensions,\n container: this.$('.upload-extension'),\n value: default_extension,\n onchange: function onchange(extension) {\n self.model.set('extension', extension);\n }\n });\n\n // initialize genome and extension values\n this.model.set({ 'genome': default_genome, 'extension': default_extension });\n\n // handle click event\n this.$symbol.on('click', function () {\n self._removeRow();\n });\n\n // handle extension info popover\n this.$('.upload-extension-info').on('click', function (e) {\n self.app.showExtensionInfo({\n $el: $(e.target),\n title: self.select_extension.text(),\n extension: self.select_extension.value()\n });\n }).on('mousedown', function (e) {\n e.preventDefault();\n });\n\n // handle settings popover\n this.$settings.on('click', function (e) {\n self._showSettings();\n }).on('mousedown', function (e) {\n e.preventDefault();\n });\n\n // handle text editing event\n this.$text_content.on('change input', function (e) {\n self.model.set({ 'url_paste': $(e.target).val(),\n 'file_size': $(e.target).val().length });\n });\n\n // model events\n this.listenTo(this.model, 'change:percentage', function () {\n self._refreshPercentage();\n });\n this.listenTo(this.model, 'change:status', function () {\n self._refreshStatus();\n });\n this.listenTo(this.model, 'change:info', function () {\n self._refreshInfo();\n });\n this.listenTo(this.model, 'change:genome', function () {\n self._refreshGenome();\n });\n this.listenTo(this.model, 'change:extension', function () {\n self._refreshExtension();\n });\n this.listenTo(this.model, 'change:file_size', function () {\n self._refreshFileSize();\n });\n },\n\n render: function render() {\n this._refreshType();\n this._refreshPercentage();\n this._refreshStatus();\n this._refreshInfo();\n this._refreshGenome();\n this._refreshExtension();\n this._refreshFileSize();\n },\n\n /** Remove view */\n remove: function remove() {\n this.select_genome.remove();\n this.select_extension.remove();\n Backbone.View.prototype.remove.apply(this);\n },\n\n /** Render type */\n _refreshType: function _refreshType() {\n var options = this.model.attributes;\n this.$title.html(_.escape(options.file_name));\n this.$size.html(Utils.bytesToString(options.file_size));\n this.$mode.removeClass().addClass('upload-mode').addClass('text-primary');\n if (options.file_mode == 'new') {\n this.$text.css({ 'width': this.$el.width() - 16 + 'px', 'top': this.$el.height() - 8 + 'px' }).show();\n this.$el.height(this.$el.height() - 8 + this.$text.height() + 16);\n this.$mode.addClass('fa fa-edit');\n } else if (options.file_mode == 'local') {\n this.$mode.addClass('fa fa-laptop');\n } else if (options.file_mode == 'ftp') {\n this.$mode.addClass('fa fa-folder-open-o');\n }\n },\n\n /** Update extension */\n _refreshExtension: function _refreshExtension() {\n this.select_extension.value(this.model.get('extension'));\n },\n\n /** Update genome */\n _refreshGenome: function _refreshGenome() {\n this.select_genome.value(this.model.get('genome'));\n },\n\n /** Refresh info text */\n _refreshInfo: function _refreshInfo() {\n var info = this.model.get('info');\n if (info) {\n this.$info_text.html('Failed: ' + info).show();\n } else {\n this.$info_text.hide();\n }\n },\n\n /** Refresh percentage status */\n _refreshPercentage: function _refreshPercentage() {\n var percentage = parseInt(this.model.get('percentage'));\n this.$progress_bar.css({ width: percentage + '%' });\n this.$percentage.html(percentage != 100 ? percentage + '%' : 'Adding to history...');\n },\n\n /** Refresh status */\n _refreshStatus: function _refreshStatus() {\n var status = this.model.get('status');\n this.$symbol.removeClass().addClass('upload-symbol').addClass(this.status_classes[status]);\n this.model.set('enabled', status == 'init');\n var enabled = this.model.get('enabled');\n this.$text_content.attr('disabled', !enabled);\n if (enabled) {\n this.select_genome.enable();\n this.select_extension.enable();\n } else {\n this.select_genome.disable();\n this.select_extension.disable();\n }\n if (status == 'success') {\n this.$el.addClass('success');\n this.$percentage.html('100%');\n }\n if (status == 'error') {\n this.$el.addClass('danger');\n this.$info_progress.hide();\n }\n },\n\n /** Refresh file size */\n _refreshFileSize: function _refreshFileSize() {\n this.$size.html(Utils.bytesToString(this.model.get('file_size')));\n },\n\n /** Remove row */\n _removeRow: function _removeRow() {\n if (['init', 'success', 'error'].indexOf(this.model.get('status')) !== -1) {\n this.app.collection.remove(this.model);\n }\n },\n\n /** Attach file info popup */\n _showSettings: function _showSettings() {\n if (!this.settings.visible) {\n this.settings.empty();\n this.settings.append(new UploadSettings(this).$el);\n this.settings.show();\n } else {\n this.settings.hide();\n }\n },\n\n /** View template */\n _template: function _template(options) {\n return '' + '' + '
' + '
' + '
' + '
' + '
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
' + '',\n '
',\n '
'\n ].join( '' );\n }\n});\n\n//==============================================================================\nreturn {\n CitationView : CitationView,\n CitationListView : CitationListView\n};\n\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/citation/citation-view.js","var jQuery = require( 'jquery' ),\n $ = jQuery,\n GalaxyApp = require( 'galaxy' ).GalaxyApp,\n Router = require( 'layout/router' ),\n ToolPanel = require( './panels/tool-panel' ),\n HistoryPanel = require( './panels/history-panel' ),\n Page = require( 'layout/page' ),\n ToolForm = require( 'mvc/tool/tool-form' ),\n FormWrapper = require( 'mvc/form/form-wrapper' ),\n UserPreferences = require( 'mvc/user/user-preferences' ),\n CustomBuilds = require( 'mvc/user/user-custom-builds' ),\n Tours = require( 'mvc/tours' ),\n GridView = require( 'mvc/grid/grid-view' ),\n GridShared = require( 'mvc/grid/grid-shared' ),\n Workflows = require( 'mvc/workflow/workflow' ),\n HistoryList = require( 'mvc/history/history-list' ),\n ToolFormComposite = require( 'mvc/tool/tool-form-composite' ),\n QueryStringParsing = require( 'utils/query-string-parsing' ),\n Utils = require( 'utils/utils' ),\n Ui = require( 'mvc/ui/ui-misc' ),\n DatasetError = require( 'mvc/dataset/dataset-error' ),\n DatasetEditAttributes = require('mvc/dataset/dataset-edit-attributes');\n\n/** define the 'Analyze Data'/analysis/main/home page for Galaxy\n * * has a masthead\n * * a left tool menu to allow the user to load tools in the center panel\n * * a right history menu that shows the user's current data\n * * a center panel\n * Both panels (generally) persist while the center panel shows any\n * UI needed for the current step of an analysis, like:\n * * tool forms to set tool parameters,\n * * tables showing the contents of datasets\n * * etc.\n */\nwindow.app = function app( options, bootstrapped ){\n window.Galaxy = new GalaxyApp( options, bootstrapped );\n Galaxy.debug( 'analysis app' );\n\n /** Routes */\n var AnalysisRouter = Router.extend({\n routes : {\n '(/)' : 'home',\n '(/)root*' : 'home',\n '(/)tours(/)(:tour_id)' : 'show_tours',\n '(/)user(/)' : 'show_user',\n '(/)user(/)(:form_id)' : 'show_user_form',\n '(/)workflow(/)' : 'show_workflows',\n '(/)workflow/run(/)' : 'show_run',\n '(/)pages(/)create(/)' : 'show_pages_create',\n '(/)pages(/)edit(/)' : 'show_pages_edit',\n '(/)pages(/)(:action_id)' : 'show_pages',\n '(/)visualizations(/)edit(/)' : 'show_visualizations_edit',\n '(/)visualizations/(:action_id)' : 'show_visualizations',\n '(/)workflows/list_published(/)' : 'show_workflows_published',\n '(/)histories(/)rename(/)' : 'show_histories_rename',\n '(/)histories(/)permissions(/)' : 'show_histories_permissions',\n '(/)histories(/)(:action_id)' : 'show_histories',\n '(/)datasets(/)list(/)' : 'show_datasets',\n '(/)workflow/import_workflow' : 'show_import_workflow',\n '(/)custom_builds' : 'show_custom_builds',\n '(/)datasets/edit': 'show_dataset_edit_attributes',\n '(/)datasets/error': 'show_dataset_error'\n },\n\n require_login: [\n 'show_user',\n 'show_user_form',\n 'show_workflows'\n ],\n\n authenticate: function( args, name ) {\n return ( Galaxy.user && Galaxy.user.id ) || this.require_login.indexOf( name ) == -1;\n },\n\n show_tours : function( tour_id ){\n if ( tour_id ){\n Tours.giveTour( tour_id );\n } else {\n this.page.display( new Tours.ToursView() );\n }\n },\n\n show_user : function(){\n this.page.display( new UserPreferences.View() );\n },\n\n show_user_form : function( form_id ) {\n var model = new UserPreferences.Model( { user_id: Galaxy.params.id } );\n this.page.display( new FormWrapper.View ( model.get( form_id ) ) );\n },\n\n show_visualizations : function( action_id ) {\n this.page.display( new GridShared.View( { action_id: action_id, plural: 'Visualizations', item: 'visualization' } ) );\n },\n\n show_visualizations_edit : function() {\n this.page.display( new FormWrapper.View ( { url : 'visualization/edit?id=' + QueryStringParsing.get( 'id' ), redirect: 'visualizations/list' } ) );\n },\n\n show_workflows_published : function() {\n this.page.display( new GridView( { url_base: Galaxy.root + 'workflow/list_published', dict_format: true } ) );\n },\n\n show_histories : function( action_id ) {\n this.page.display( new HistoryList.View( { action_id: action_id } ) );\n },\n\n show_histories_rename : function() {\n this.page.display( new FormWrapper.View ( { url : 'history/rename?id=' + QueryStringParsing.get( 'id' ), redirect: 'histories/list' } ) );\n },\n\n show_histories_permissions : function() {\n this.page.display( new FormWrapper.View ( { url : 'history/permissions?id=' + QueryStringParsing.get( 'id' ), redirect: 'histories/list' } ) );\n },\n\n show_datasets : function() {\n this.page.display( new GridView( { url_base: Galaxy.root + 'dataset/list', dict_format: true } ) );\n },\n\n show_pages : function( action_id ) {\n this.page.display( new GridShared.View( { action_id: action_id, plural: 'Pages', item: 'page' } ) );\n },\n\n show_pages_create : function() {\n this.page.display( new FormWrapper.View ( { url : 'page/create', redirect: 'pages/list' } ) );\n },\n\n show_pages_edit : function() {\n this.page.display( new FormWrapper.View ( { url : 'page/edit?id=' + QueryStringParsing.get( 'id' ), redirect: 'pages/list' } ) );\n },\n\n show_workflows : function(){\n this.page.display( new Workflows.View() );\n },\n\n show_run : function() {\n this._loadWorkflow();\n },\n\n show_import_workflow : function() {\n this.page.display( new Workflows.ImportWorkflowView() );\n },\n\n show_custom_builds : function() {\n var self = this;\n var historyPanel = this.page.historyPanel.historyView;\n if ( !historyPanel || !historyPanel.model || !historyPanel.model.id ) {\n window.setTimeout(function() { self.show_custom_builds() }, 500)\n return;\n }\n this.page.display( new CustomBuilds.View() );\n },\n\n show_dataset_edit_attributes : function() {\n this.page.display( new DatasetEditAttributes.View() );\n },\n\n show_dataset_error : function() {\n this.page.display( new DatasetError.View() );\n },\n\n /** */\n home : function( params ){\n // TODO: to router, remove Globals\n // load a tool by id (tool_id) or rerun a previous tool execution (job_id)\n if( params.tool_id || params.job_id ) {\n if ( params.tool_id === 'upload1' ) {\n this.page.toolPanel.upload.show();\n this._loadCenterIframe( 'welcome' );\n } else {\n this._loadToolForm( params );\n }\n } else {\n // show the workflow run form\n if( params.workflow_id ){\n this._loadWorkflow();\n // load the center iframe with controller.action: galaxy.org/?m_c=history&m_a=list -> history/list\n } else if( params.m_c ){\n this._loadCenterIframe( params.m_c + '/' + params.m_a );\n // show the workflow run form\n } else {\n this._loadCenterIframe( 'welcome' );\n }\n }\n },\n\n /** load the center panel with a tool form described by the given params obj */\n _loadToolForm : function( params ){\n //TODO: load tool form code async\n params.id = decodeURIComponent( params.tool_id );\n this.page.display( new ToolForm.View( params ) );\n },\n\n /** load the center panel iframe using the given url */\n _loadCenterIframe : function( url, root ){\n root = root || Galaxy.root;\n url = root + url;\n this.page.$( '#galaxy_main' ).prop( 'src', url );\n },\n\n /** load workflow by its url in run mode */\n _loadWorkflow: function() {\n var self = this;\n Utils.get({\n url: Galaxy.root + 'api/workflows/' + Utils.getQueryString( 'id' ) + '/download?style=run',\n success: function( response ) {\n self.page.display( new ToolFormComposite.View( response ) );\n },\n error: function( response ) {\n var error_msg = response.err_msg || 'Error occurred while loading the resource.';\n var options = { 'message': error_msg, 'status': 'danger', 'persistent': true };\n self.page.display( new Ui.Message( options ) );\n }\n });\n }\n });\n\n // render and start the router\n $(function(){\n Galaxy.page = new Page.View( _.extend( options, {\n Left : ToolPanel,\n Right : HistoryPanel,\n Router : AnalysisRouter\n } ) );\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/apps/analysis.js","var Tools = require( 'mvc/tool/tools' ),\n Upload = require( 'mvc/upload/upload-view' ),\n _l = require( 'utils/localization' ),\n ToolForm = require( 'mvc/tool/tool-form-composite' );\n\nvar ToolPanel = Backbone.View.extend({\n initialize: function( page, options ) {\n // access configuration options\n var config = options.config;\n this.root = options.root;\n\n /** @type {Object[]} descriptions of user's workflows to be shown in the tool menu */\n this.stored_workflow_menu_entries = config.stored_workflow_menu_entries || [];\n\n // create tool search, tool panel, and tool panel view.\n var tool_search = new Tools.ToolSearch({\n hidden : false\n });\n var tools = new Tools.ToolCollection( config.toolbox );\n this.tool_panel = new Tools.ToolPanel({\n tool_search : tool_search,\n tools : tools,\n layout : config.toolbox_in_panel\n });\n this.tool_panel_view = new Tools.ToolPanelView({ model: this.tool_panel });\n\n // add upload modal\n this.upload_button = new Upload({\n nginx_upload_path : config.nginx_upload_path,\n ftp_upload_site : config.ftp_upload_site,\n default_genome : config.default_genome,\n default_extension : config.default_extension,\n });\n\n // add uploader button to Galaxy object\n Galaxy.upload = this.upload_button;\n\n // components for panel definition\n this.model = new Backbone.Model({\n title : _l( 'Tools' ),\n buttons : [ this.upload_button ]\n });\n\n // build body template\n this.setElement( this._template() );\n },\n\n render : function(){\n // if there are tools, render panel and display everything\n var self = this;\n if ( this.tool_panel.get( 'layout' ).size() > 0 ) {\n this.$el.prepend( this.tool_panel_view.$el );\n this.tool_panel_view.render();\n }\n // build the dom for the workflow portion of the tool menu\n // add internal workflow list\n self.$( '#internal-workflows' ).append( self._templateAllWorkflow({\n title : _l( 'All workflows' ),\n href : 'workflow'\n }));\n _.each( this.stored_workflow_menu_entries, function( menu_entry ){\n self.$( '#internal-workflows' ).append( self._templateWorkflowLink({\n title : menu_entry.stored_workflow.name,\n href : 'workflow/run?id=' + menu_entry.encoded_stored_workflow_id\n }));\n });\n },\n\n /** build a link to one tool */\n _templateTool: function( tool ) {\n return [\n '
',\n '', tool.title, '',\n '
'\n ].join('');\n },\n\n /** build a link to 'All Workflows' */\n _templateAllWorkflow: function( tool ) {\n return [\n '
',\n // global\n '', tool.title, '',\n '
'\n ].join('');\n },\n\n /** build links to workflows in toolpanel */\n _templateWorkflowLink: function( wf ) {\n return [\n '
',\n '', wf.title, '',\n '
'\n ].join('');\n },\n\n /** override to include inital menu dom and workflow section */\n _template : function() {\n return [\n '
',\n '
',\n '
',\n '', _l( 'Search did not match any tools.' ), '',\n '
',\n '
',\n '
',\n '
',\n '
',\n '', _l( 'Workflows' ), '',\n '
',\n '
',\n '
',\n '
',\n '
'\n ].join('');\n },\n\n toString : function() { return 'toolPanel' }\n});\n\nmodule.exports = ToolPanel;\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/apps/panels/tool-panel.js","/** Upload app contains the upload progress button and upload modal, compiles model data for API request **/\ndefine([ 'utils/utils', 'mvc/ui/ui-modal', 'mvc/ui/ui-tabs', 'mvc/upload/upload-button', 'mvc/upload/default/default-view', 'mvc/upload/composite/composite-view', 'mvc/upload/collection/collection-view' ],\nfunction( Utils, Modal, Tabs, UploadButton, UploadViewDefault, UploadViewComposite, UploadViewCollection ) {\n return Backbone.View.extend({\n options : {\n nginx_upload_path : '',\n ftp_upload_site : 'n/a',\n default_genome : '?',\n default_extension : 'auto',\n height : 500,\n width : 900,\n auto : {\n id : 'auto',\n text : 'Auto-detect',\n description : 'This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed.'\n }\n },\n\n // contains all available dataset extensions/types\n list_extensions: [],\n\n // contains all available genomes\n list_genomes: [],\n\n initialize: function( options ) {\n var self = this;\n this.options = Utils.merge( options, this.options );\n\n // create view for upload/progress button\n this.ui_button = new UploadButton.View({\n onclick : function(e) {\n e.preventDefault();\n self.show()\n },\n onunload : function() {\n var percentage = self.ui_button.model.get('percentage', 0);\n if (percentage > 0 && percentage < 100) {\n return 'Several uploads are queued.';\n }\n }\n });\n\n // set element to button view\n this.setElement( this.ui_button.$el );\n\n // load extensions\n var self = this;\n Utils.get({\n url : Galaxy.root + 'api/datatypes?extension_only=False',\n success : function( datatypes ) {\n for ( var key in datatypes ) {\n self.list_extensions.push({\n id : datatypes[ key ].extension,\n text : datatypes[ key ].extension,\n description : datatypes[ key ].description,\n description_url : datatypes[ key ].description_url,\n composite_files : datatypes[ key ].composite_files\n });\n }\n self.list_extensions.sort( function( a, b ) {\n var a_text = a.text && a.text.toLowerCase();\n var b_text = b.text && b.text.toLowerCase();\n return a_text > b_text ? 1 : a_text < b_text ? -1 : 0;\n });\n if ( !self.options.datatypes_disable_auto ) {\n self.list_extensions.unshift( self.options.auto );\n }\n }\n });\n\n // load genomes\n Utils.get({\n url : Galaxy.root + 'api/genomes',\n success : function( genomes ) {\n for ( var key in genomes ) {\n self.list_genomes.push({\n id : genomes[ key ][ 1 ],\n text : genomes[ key ][ 0 ]\n });\n }\n self.list_genomes.sort( function( a, b ) {\n if ( a.id == self.options.default_genome ) { return -1; }\n if ( b.id == self.options.default_genome ) { return 1; }\n return a.text > b.text ? 1 : a.text < b.text ? -1 : 0;\n });\n }\n });\n },\n\n /** Show/hide upload dialog */\n show: function () {\n var self = this;\n if ( !Galaxy.currHistoryPanel || !Galaxy.currHistoryPanel.model ) {\n window.setTimeout(function() { self.show() }, 500)\n return;\n }\n this.current_user = Galaxy.user.id;\n if ( !this.modal ) {\n this.tabs = new Tabs.View();\n this.default_view = new UploadViewDefault( this );\n this.tabs.add({\n id : 'regular',\n title : 'Regular',\n $el : this.default_view.$el\n });\n this.composite_view = new UploadViewComposite( this );\n this.tabs.add({\n id : 'composite',\n title : 'Composite',\n $el : this.composite_view.$el\n });\n this.collection_view = new UploadViewCollection( this );\n this.tabs.add({\n id : 'collection',\n title : 'Collection',\n $el : this.collection_view.$el\n });\n this.modal = new Modal.View({\n title : 'Download from web or upload from disk',\n body : this.tabs.$el,\n height : this.options.height,\n width : this.options.width,\n closing_events : true,\n title_separator : false\n });\n }\n this.modal.show();\n },\n\n /** Refresh user and current history */\n currentHistory: function() {\n return this.current_user && Galaxy.currHistoryPanel.model.get( 'id' );\n },\n\n /** Get ftp configuration */\n currentFtp: function() {\n return this.current_user && this.options.ftp_upload_site;\n },\n\n /**\n * Package API data from array of models\n * @param{Array} items - Upload items/rows filtered from a collection\n */\n toData: function( items, history_id ) {\n // create dictionary for data submission\n var data = {\n payload: {\n 'tool_id' : 'upload1',\n 'history_id' : history_id || this.currentHistory(),\n 'inputs' : {}\n },\n files: [],\n error_message: null\n }\n // add upload tools input data\n if ( items && items.length > 0 ) {\n var inputs = {\n 'file_count' : items.length,\n 'dbkey' : items[ 0 ].get( 'genome', '?' ),\n 'file_type' : items[ 0 ].get( 'extension', 'auto' )\n };\n for ( var index in items ) {\n var it = items[ index ];\n it.set( 'status', 'running' );\n if ( it.get( 'file_size' ) > 0 ) {\n var prefix = 'files_' + index + '|';\n inputs[ prefix + 'type' ] = 'upload_dataset';\n inputs[ prefix + 'space_to_tab' ] = it.get( 'space_to_tab' ) && 'Yes' || null;\n inputs[ prefix + 'to_posix_lines' ] = it.get( 'to_posix_lines' ) && 'Yes' || null;\n inputs[ prefix + 'dbkey' ] = it.get( 'genome', null );\n inputs[ prefix + 'file_type' ] = it.get( 'extension', null );\n switch ( it.get( 'file_mode' ) ) {\n case 'new':\n inputs[ prefix + 'url_paste' ] = it.get( 'url_paste' );\n break;\n case 'ftp':\n inputs[ prefix + 'ftp_files' ] = it.get( 'file_path' );\n break;\n case 'local':\n data.files.push( { name: prefix + 'file_data', file: it.get( 'file_data' ) } );\n }\n } else {\n data.error_message = 'Upload content incomplete.';\n it.set( 'status', 'error' );\n it.set( 'info', data.error_message );\n break;\n }\n }\n data.payload.inputs = JSON.stringify( inputs );\n }\n return data;\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/upload/upload-view.js","/** View for upload/progress bar button */\ndefine( [], function() {\n var View = Backbone.View.extend({\n initialize: function( options ) {\n var self = this;\n this.model = options && options.model || new Backbone.Model({\n icon : 'fa-upload',\n tooltip : 'Download from URL or upload files from disk',\n label : 'Load Data',\n percentage : 0,\n status : '',\n onunload : function(){},\n onclick : function(){}\n }).set( options );\n this.setElement( this._template() );\n this.$progress = this.$( '.progress-bar' );\n this.listenTo( this.model, 'change', this.render, this );\n this.render();\n $( window ).on( 'beforeunload', function() {\n return self.model.get( 'onunload' )();\n });\n },\n\n render: function() {\n var self = this;\n var options = this.model.attributes;\n this.$el.off( 'click' ).on( 'click', function( e ) { options.onclick( e ) } )\n .tooltip( { title: this.model.get('tooltip'), placement: 'bottom' } );\n this.$progress.removeClass()\n .addClass( 'progress-bar' )\n .addClass( 'progress-bar-notransition' )\n .addClass( options.status != '' && 'progress-bar-' + options.status )\n .css( { width : options.percentage + '%' } );\n },\n\n /** Template */\n _template: function() {\n return '
' +\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '
' +\n '
';\n }\n });\n return { View : View };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/upload/upload-button.js","/** Renders contents of the default uploader */\ndefine([ 'utils/utils', 'mvc/upload/upload-model', 'mvc/upload/default/default-row', 'mvc/upload/upload-ftp', 'mvc/upload/upload-extension', 'mvc/ui/ui-popover', 'mvc/ui/ui-select', 'mvc/ui/ui-misc', 'mvc/lazy/lazy-limited', 'utils/uploadbox'],\nfunction( Utils, UploadModel, UploadRow, UploadFtp, UploadExtension, Popover, Select, Ui, LazyLimited ) {\n\n return Backbone.View.extend({\n // current upload size in bytes\n upload_size: 0,\n\n // contains upload row models\n collection : new UploadModel.Collection(),\n\n // keeps track of the current uploader state\n counter : {\n announce : 0,\n success : 0,\n error : 0,\n running : 0,\n reset : function() { this.announce = this.success = this.error = this.running = 0 }\n },\n\n initialize : function( app ) {\n var self = this;\n this.app = app;\n this.options = app.options;\n this.list_extensions = app.list_extensions;\n this.list_genomes = app.list_genomes;\n this.ui_button = app.ui_button;\n this.ftp_upload_site = app.currentFtp();\n\n // build template\n this.setElement( this._template() );\n this.$uploadbox = this.$( '.upload-box' );\n this.$uploadtable = this.$( '.upload-table' );\n\n // append buttons to dom\n this.btnLocal = new Ui.Button( { id: 'btn-local', title: 'Choose local file', onclick: function() { self.uploadbox.select() }, icon: 'fa fa-laptop' } );\n this.btnFtp = new Ui.Button( { id: 'btn-ftp', title: 'Choose FTP file', onclick: function() { self._eventFtp() }, icon: 'fa fa-folder-open-o' } );\n this.btnCreate = new Ui.Button( { id: 'btn-new', title: 'Paste/Fetch data', onclick: function() { self._eventCreate() }, icon: 'fa fa-edit' } );\n this.btnStart = new Ui.Button( { id: 'btn-start', title: 'Start', onclick: function() { self._eventStart() } } );\n this.btnStop = new Ui.Button( { id: 'btn-stop', title: 'Pause', onclick: function() { self._eventStop() } } );\n this.btnReset = new Ui.Button( { id: 'btn-reset', title: 'Reset', onclick: function() { self._eventReset() } } );\n this.btnClose = new Ui.Button( { id: 'btn-close', title: 'Close', onclick: function() { self.app.modal.hide() } } );\n _.each( [ this.btnLocal, this.btnFtp, this.btnCreate, this.btnStop, this.btnReset, this.btnStart, this.btnClose ], function( button ) {\n self.$( '.upload-buttons' ).prepend( button.$el );\n });\n\n // file upload\n this.uploadbox = this.$uploadbox.uploadbox({\n url : this.app.options.nginx_upload_path,\n announce : function( index, file ) { self._eventAnnounce( index, file ) },\n initialize : function( index ) { return self.app.toData( [ self.collection.get( index ) ], self.history_id ) },\n progress : function( index, percentage ) { self._eventProgress( index, percentage ) },\n success : function( index, message ) { self._eventSuccess( index, message ) },\n error : function( index, message ) { self._eventError( index, message ) },\n complete : function() { self._eventComplete() },\n ondragover : function() { self.$uploadbox.addClass( 'highlight' ) },\n ondragleave : function() { self.$uploadbox.removeClass( 'highlight' ) }\n });\n\n // add ftp file viewer\n this.ftp = new Popover.View( { title: 'FTP files', container: this.btnFtp.$el } );\n\n // select extension\n this.select_extension = new Select.View({\n css : 'upload-footer-selection',\n container : this.$( '.upload-footer-extension' ),\n data : _.filter( this.list_extensions, function( ext ) { return !ext.composite_files } ),\n value : this.options.default_extension,\n onchange : function( extension ) { self._changeExtension( extension ) }\n });\n\n // handle extension info popover\n this.$( '.upload-footer-extension-info' ).on( 'click', function( e ) {\n new UploadExtension({\n $el : $( e.target ),\n title : self.select_extension.text(),\n extension : self.select_extension.value(),\n list : self.list_extensions,\n placement : 'top'\n });\n }).on( 'mousedown', function( e ) { e.preventDefault() } );\n\n // genome extension\n this.select_genome = new Select.View({\n css : 'upload-footer-selection',\n container : this.$( '.upload-footer-genome' ),\n data : this.list_genomes,\n value : this.options.default_genome,\n onchange : function( genome ) { self._changeGenome(genome) }\n });\n\n // Lazy load helper\n this.loader = new LazyLimited({\n $container : this.$uploadbox,\n collection : this.collection,\n new_content : function( model ) {\n var upload_row = new UploadRow( self, { model: model } )\n self.$uploadtable.find( '> tbody:first' ).append( upload_row.$el );\n upload_row.render();\n return upload_row;\n }\n });\n\n // events\n this.collection.on( 'remove', function( model ) { self._eventRemove( model ) } );\n this.render();\n },\n\n render: function () {\n var message = '';\n if( this.counter.announce == 0 ) {\n if (this.uploadbox.compatible()) {\n message = ' ';\n } else {\n message = 'Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.';\n }\n } else {\n if ( this.counter.running == 0 ) {\n message = 'You added ' + this.counter.announce + ' file(s) to the queue. Add more files or click \\'Start\\' to proceed.';\n } else {\n message = 'Please wait...' + this.counter.announce + ' out of ' + this.counter.running + ' remaining.';\n }\n }\n this.$( '.upload-top-info' ).html( message );\n var enable_reset = this.counter.running == 0 && this.counter.announce + this.counter.success + this.counter.error > 0;\n var enable_start = this.counter.running == 0 && this.counter.announce > 0;\n var enable_sources = this.counter.running == 0;\n var show_table = this.counter.announce + this.counter.success + this.counter.error > 0;\n this.btnReset[ enable_reset ? 'enable' : 'disable' ]();\n this.btnStart[ enable_start ? 'enable' : 'disable' ]();\n this.btnStart.$el[ enable_start ? 'addClass' : 'removeClass' ]( 'btn-primary' );\n this.btnStop[ this.counter.running > 0 ? 'enable' : 'disable' ]();\n this.btnLocal[ enable_sources ? 'enable' : 'disable' ]();\n this.btnFtp[ enable_sources ? 'enable' : 'disable' ]();\n this.btnCreate[ enable_sources ? 'enable' : 'disable' ]();\n this.btnFtp.$el[ this.ftp_upload_site ? 'show' : 'hide' ]();\n this.$( '.upload-table' )[ show_table ? 'show' : 'hide' ]();\n this.$( '.upload-helper' )[ show_table ? 'hide' : 'show' ]();\n },\n\n /** A new file has been dropped/selected through the uploadbox plugin */\n _eventAnnounce: function( index, file ) {\n this.counter.announce++;\n var new_model = new UploadModel.Model({\n id : index,\n file_name : file.name,\n file_size : file.size,\n file_mode : file.mode || 'local',\n file_path : file.path,\n file_data : file\n });\n this.render();\n this.collection.add( new_model );\n },\n\n /** Progress */\n _eventProgress: function( index, percentage ) {\n var it = this.collection.get( index );\n it.set( 'percentage', percentage );\n this.ui_button.model.set( 'percentage', this._uploadPercentage( percentage, it.get( 'file_size' ) ) );\n },\n\n /** Success */\n _eventSuccess: function( index, message ) {\n var it = this.collection.get( index );\n it.set( { 'percentage': 100, 'status': 'success' } );\n this.ui_button.model.set( 'percentage', this._uploadPercentage( 100, it.get( 'file_size' ) ) );\n this.upload_completed += it.get( 'file_size' ) * 100;\n this.counter.announce--;\n this.counter.success++;\n this.render();\n Galaxy.currHistoryPanel.refreshContents();\n },\n\n /** Error */\n _eventError: function( index, message ) {\n var it = this.collection.get( index );\n it.set( { 'percentage': 100, 'status': 'error', 'info': message } );\n this.ui_button.model.set( { 'percentage': this._uploadPercentage( 100, it.get( 'file_size' ) ), 'status': 'danger' } );\n this.upload_completed += it.get( 'file_size' ) * 100;\n this.counter.announce--;\n this.counter.error++;\n this.render();\n },\n\n /** Queue is done */\n _eventComplete: function() {\n this.collection.each( function( model ) { model.get( 'status' ) == 'queued' && model.set( 'status', 'init' ) } );\n this.counter.running = 0;\n this.render();\n },\n\n /** Remove model from upload list */\n _eventRemove: function( model ) {\n var status = model.get( 'status' );\n if ( status == 'success' ) {\n this.counter.success--;\n } else if ( status == 'error' ) {\n this.counter.error--;\n } else {\n this.counter.announce--;\n }\n this.uploadbox.remove( model.id );\n this.render();\n },\n\n //\n // events triggered by this view\n //\n\n /** Show/hide ftp popup */\n _eventFtp: function() {\n if ( !this.ftp.visible ) {\n this.ftp.empty();\n var self = this;\n this.ftp.append( ( new UploadFtp({\n collection : this.collection,\n ftp_upload_site : this.ftp_upload_site,\n onadd : function( ftp_file ) {\n return self.uploadbox.add([{\n mode: 'ftp',\n name: ftp_file.path,\n size: ftp_file.size,\n path: ftp_file.path\n }]);\n },\n onremove: function( model_index ) {\n self.collection.remove( model_index );\n }\n } ) ).$el );\n this.ftp.show();\n } else {\n this.ftp.hide();\n }\n },\n\n /** Create a new file */\n _eventCreate: function (){\n this.uploadbox.add( [ { name: 'New File', size: 0, mode: 'new' } ] );\n },\n\n /** Start upload process */\n _eventStart: function() {\n if ( this.counter.announce != 0 && this.counter.running == 0 ) {\n // prepare upload process\n var self = this;\n this.upload_size = 0;\n this.upload_completed = 0;\n this.collection.each( function( model ) {\n if( model.get( 'status' ) == 'init' ) {\n model.set( 'status', 'queued' );\n self.upload_size += model.get( 'file_size' );\n }\n });\n this.ui_button.model.set( { 'percentage': 0, 'status': 'success' } );\n this.counter.running = this.counter.announce;\n this.history_id = this.app.currentHistory();\n\n // package ftp files separately, and remove them from queue\n this._uploadFtp();\n\n // queue remaining files\n this.uploadbox.start();\n this.render();\n }\n },\n\n /** Pause upload process */\n _eventStop: function() {\n if ( this.counter.running > 0 ) {\n this.ui_button.model.set( 'status', 'info' );\n $( '.upload-top-info' ).html( 'Queue will pause after completing the current file...' );\n this.uploadbox.stop();\n }\n },\n\n /** Remove all */\n _eventReset: function() {\n if ( this.counter.running == 0 ){\n var self = this;\n this.collection.reset();\n this.counter.reset();\n this.uploadbox.reset();\n this.select_extension.value( this.options.default_extension );\n this.select_genome.value( this.options.default_genome );\n this.ui_button.model.set( 'percentage', 0 );\n this.render();\n }\n },\n\n /** Update extension for all models */\n _changeExtension: function( extension, defaults_only ) {\n var self = this;\n this.collection.each( function( model ) {\n if ( model.get( 'status' ) == 'init' && ( model.get( 'extension' ) == self.options.default_extension || !defaults_only ) ) {\n model.set( 'extension', extension );\n }\n });\n },\n\n /** Update genome for all models */\n _changeGenome: function( genome, defaults_only ) {\n var self = this;\n this.collection.each( function( model ) {\n if ( model.get( 'status' ) == 'init' && ( model.get( 'genome' ) == self.options.default_genome || !defaults_only ) ) {\n model.set( 'genome', genome );\n }\n });\n },\n\n /** Package and upload ftp files in a single request */\n _uploadFtp: function() {\n var self = this;\n var list = [];\n this.collection.each( function( model ) {\n if( model.get( 'status' ) == 'queued' && model.get( 'file_mode' ) == 'ftp' ) {\n self.uploadbox.remove( model.id );\n list.push( model );\n }\n });\n if(list.length > 0) {\n $.uploadpost({\n data : this.app.toData( list ),\n url : this.app.options.nginx_upload_path,\n success : function( message ) { _.each( list, function( model ) { self._eventSuccess( model.id ) } ) },\n error : function( message ) { _.each( list, function( model ) { self._eventError( model.id, message ) } ) }\n });\n }\n },\n\n /** Calculate percentage of all queued uploads */\n _uploadPercentage: function( percentage, size ) {\n return ( this.upload_completed + ( percentage * size ) ) / this.upload_size;\n },\n\n /** Template */\n _template: function() {\n return '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
Drop files here
' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '' +\n '
NameSizeTypeGenomeSettingsStatus' +\n '
' +\n '
' +\n '
' +\n 'Type (set all):' +\n '' +\n ' ' +\n 'Genome (set all):' +\n '' +\n '
' +\n '
' +\n '
';\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/mvc/upload/default/default-view.js","/** Renders the default uploader rows */\ndefine( [ 'utils/utils', 'mvc/upload/upload-model', 'mvc/upload/upload-settings', 'mvc/ui/ui-popover', 'mvc/ui/ui-select' ],\nfunction( Utils, UploadModel, UploadSettings, Popover, Select ) {\n return Backbone.View.extend({\n /** Dictionary of upload states and associated icons */\n status_classes : {\n init : 'upload-icon-button fa fa-trash-o',\n queued : 'upload-icon fa fa-spinner fa-spin',\n running : 'upload-icon fa fa-spinner fa-spin',\n success : 'upload-icon-button fa fa-check',\n error : 'upload-icon-button fa fa-exclamation-triangle'\n },\n\n initialize: function( app, options ) {\n var self = this;\n this.app = app;\n this.model = options.model;\n this.setElement( this._template( options.model ) );\n this.$mode = this.$( '.upload-mode' );\n this.$title = this.$( '.upload-title' );\n this.$text = this.$( '.upload-text' );\n this.$size = this.$( '.upload-size' );\n this.$info_text = this.$( '.upload-info-text' );\n this.$info_progress = this.$( '.upload-info-progress' );\n this.$text_content = this.$( '.upload-text-content' );\n this.$settings = this.$( '.upload-settings' );\n this.$symbol = this.$( '.upload-symbol' );\n this.$progress_bar = this.$( '.upload-progress-bar' );\n this.$percentage = this.$( '.upload-percentage' );\n\n // append popup to settings icon\n this.settings = new Popover.View({\n title : 'Upload configuration',\n container : this.$( '.upload-settings' ),\n placement : 'bottom'\n });\n\n // identify default genome and extension values\n var default_genome = this.app.select_genome.value();\n var default_extension = this.app.select_extension.value();\n\n // create select genomes\n this.select_genome = new Select.View({\n css : 'upload-genome',\n data : self.app.list_genomes,\n container : this.$( '.upload-genome' ),\n value : default_genome,\n onchange : function( genome ) { self.model.set( 'genome', genome ) }\n });\n\n // create select extension\n this.select_extension = new Select.View({\n css : 'upload-extension',\n data : self.app.list_extensions,\n container : this.$( '.upload-extension' ),\n value : default_extension,\n onchange : function( extension ) { self.model.set('extension', extension) }\n });\n\n // initialize genome and extension values\n this.model.set( { 'genome': default_genome, 'extension': default_extension } );\n\n // handle click event\n this.$symbol.on('click', function() { self._removeRow(); });\n\n // handle extension info popover\n this.$( '.upload-extension-info' ).on( 'click' , function( e ) {\n self.app.showExtensionInfo({\n $el : $( e.target ),\n title : self.select_extension.text(),\n extension : self.select_extension.value()\n });\n }).on( 'mousedown', function( e ) { e.preventDefault() } );\n\n // handle settings popover\n this.$settings.on( 'click' , function( e ) { self._showSettings() } )\n .on( 'mousedown', function( e ) { e.preventDefault() });\n\n // handle text editing event\n this.$text_content.on( 'change input', function( e ) {\n self.model.set( { 'url_paste': $( e.target ).val(),\n 'file_size': $( e.target ).val().length } );\n });\n\n // model events\n this.listenTo( this.model, 'change:percentage', function() { self._refreshPercentage() } );\n this.listenTo( this.model, 'change:status', function() { self._refreshStatus() } );\n this.listenTo( this.model, 'change:info', function() { self._refreshInfo() } );\n this.listenTo( this.model, 'change:genome', function() { self._refreshGenome() } );\n this.listenTo( this.model, 'change:extension', function() { self._refreshExtension() } );\n this.listenTo( this.model, 'change:file_size', function() { self._refreshFileSize() } );\n },\n\n render: function() {\n this._refreshType();\n this._refreshPercentage();\n this._refreshStatus();\n this._refreshInfo()\n this._refreshGenome();\n this._refreshExtension();\n this._refreshFileSize()\n },\n\n /** Remove view */\n remove: function() {\n this.select_genome.remove();\n this.select_extension.remove();\n Backbone.View.prototype.remove.apply( this );\n },\n\n /** Render type */\n _refreshType: function() {\n var options = this.model.attributes;\n this.$title.html( _.escape( options.file_name ) );\n this.$size.html( Utils.bytesToString ( options.file_size ) );\n this.$mode.removeClass().addClass( 'upload-mode' ).addClass( 'text-primary' );\n if ( options.file_mode == 'new' ) {\n this.$text.css( { 'width' : this.$el.width() - 16 + 'px', 'top' : this.$el.height() - 8 + 'px' } ).show();\n this.$el.height( this.$el.height() - 8 + this.$text.height() + 16 );\n this.$mode.addClass( 'fa fa-edit' );\n } else if ( options.file_mode == 'local' ) {\n this.$mode.addClass( 'fa fa-laptop' );\n } else if ( options.file_mode == 'ftp' ) {\n this.$mode.addClass( 'fa fa-folder-open-o' );\n }\n },\n\n /** Update extension */\n _refreshExtension: function() {\n this.select_extension.value( this.model.get( 'extension' ) );\n },\n\n /** Update genome */\n _refreshGenome: function() {\n this.select_genome.value( this.model.get( 'genome' ) );\n },\n\n /** Refresh info text */\n _refreshInfo: function() {\n var info = this.model.get( 'info' );\n if ( info ) {\n this.$info_text.html( 'Failed: ' + info ).show();\n } else {\n this.$info_text.hide();\n }\n },\n\n /** Refresh percentage status */\n _refreshPercentage : function() {\n var percentage = parseInt( this.model.get( 'percentage' ) );\n this.$progress_bar.css( { width : percentage + '%' } );\n this.$percentage.html( percentage != 100 ? percentage + '%' : 'Adding to history...' );\n },\n\n /** Refresh status */\n _refreshStatus : function() {\n var status = this.model.get( 'status' );\n this.$symbol.removeClass().addClass( 'upload-symbol' ).addClass( this.status_classes[ status ] );\n this.model.set( 'enabled', status == 'init' );\n var enabled = this.model.get( 'enabled' );\n this.$text_content.attr( 'disabled', !enabled );\n if ( enabled ) {\n this.select_genome.enable();\n this.select_extension.enable();\n } else {\n this.select_genome.disable();\n this.select_extension.disable();\n }\n if ( status == 'success' ) {\n this.$el.addClass( 'success' );\n this.$percentage.html( '100%' );\n }\n if ( status == 'error' ) {\n this.$el.addClass( 'danger' );\n this.$info_progress.hide();\n }\n },\n\n /** Refresh file size */\n _refreshFileSize: function() {\n this.$size.html( Utils.bytesToString ( this.model.get( 'file_size' ) ) );\n },\n\n /** Remove row */\n _removeRow: function() {\n if ( [ 'init', 'success', 'error' ].indexOf( this.model.get( 'status' ) ) !== -1 ) {\n this.app.collection.remove( this.model );\n }\n },\n\n /** Attach file info popup */\n _showSettings : function() {\n if ( !this.settings.visible ) {\n this.settings.empty();\n this.settings.append( ( new UploadSettings( this ) ).$el );\n this.settings.show();\n } else {\n this.settings.hide();\n }\n },\n\n /** View template */\n _template: function( options ) {\n return '' +\n '' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
' +\n '",at.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Ft=/^key/,qt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Wt=/^([^.]*)(?:\.(.+)|)/;lt.event={global:{},add:function(t,e,i,n,o){var s,r,a,l,u,c,h,d,p,f,g,m=Et.get(t);if(m)for(i.handler&&(s=i,i=s.handler,o=s.selector),i.guid||(i.guid=lt.guid++),(l=m.events)||(l=m.events={}),(r=m.handle)||(r=m.handle=function(e){return void 0!==lt&<.event.triggered!==e.type?lt.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(Ct)||[""],u=e.length;u--;)a=Wt.exec(e[u])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p&&(h=lt.event.special[p]||{},p=(o?h.delegateType:h.bindType)||p,h=lt.event.special[p]||{},c=lt.extend({type:p,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&<.expr.match.needsContext.test(o),namespace:f.join(".")},s),(d=l[p])||(d=l[p]=[],d.delegateCount=0,h.setup&&!1!==h.setup.call(t,n,f,r)||t.addEventListener&&t.addEventListener(p,r)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=i.guid)),o?d.splice(d.delegateCount++,0,c):d.push(c),lt.event.global[p]=!0)},remove:function(t,e,i,n,o){var s,r,a,l,u,c,h,d,p,f,g,m=Et.hasData(t)&&Et.get(t);if(m&&(l=m.events)){for(e=(e||"").match(Ct)||[""],u=e.length;u--;)if(a=Wt.exec(e[u])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p){for(h=lt.event.special[p]||{},p=(n?h.delegateType:h.bindType)||p,d=l[p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=s=d.length;s--;)c=d[s],!o&&g!==c.origType||i&&i.guid!==c.guid||a&&!a.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(d.splice(s,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(t,c));r&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,f,m.handle)||lt.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)lt.event.remove(t,p+e[u],i,n,!0);lt.isEmptyObject(l)&&Et.remove(t,"handle events")}},dispatch:function(t){t=lt.event.fix(t);var e,i,n,o,s,r=[],a=tt.call(arguments),l=(Et.get(this,"events")||{})[t.type]||[],u=lt.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,t)){for(r=lt.event.handlers.call(this,t,l),e=0;(o=r[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(s.namespace)||(t.handleObj=s,t.data=s.data,void 0!==(n=((lt.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,a))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,o,s,r=[],a=e.delegateCount,l=t.target;if(a&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==t.type)){for(n=[],i=0;i-1:lt.find(o,this,null,[l]).length),n[o]&&n.push(s);n.length&&r.push({elem:l,handlers:n})}return a]*)\/>/gi,Bt=/\s*$/g;lt.extend({htmlPrefilter:function(t){return t.replace(zt,"<$1>")},clone:function(t,e,i){var n,o,s,r,a=t.cloneNode(!0),l=lt.contains(t.ownerDocument,t);if(!(at.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||lt.isXMLDoc(t)))for(r=f(a),s=f(t),n=0,o=s.length;n0&&g(r,!l&&f(t,"script")),a},cleanData:function(t){for(var e,i,n,o=lt.event.special,s=0;void 0!==(i=t[s]);s++)if(Tt(i)){if(e=i[Et.expando]){if(e.events)for(n in e.events)o[n]?lt.event.remove(i,n):lt.removeEvent(i,n,e.handle);i[Et.expando]=void 0}i[At.expando]&&(i[At.expando]=void 0)}}}),lt.fn.extend({domManip:T,detach:function(t){return E(this,t,!0)},remove:function(t){return E(this,t)},text:function(t){return kt(this,function(t){return void 0===t?lt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return T(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){_(this,t).appendChild(t)}})},prepend:function(){return T(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=_(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return T(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return T(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(lt.cleanData(f(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return lt.clone(this,t,e)})},html:function(t){return kt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Bt.test(t)&&!Ht[(It.exec(t)||["",""])[1].toLowerCase()]){t=lt.htmlPrefilter(t);try{for(;i1)},show:function(){return I(this,!0)},hide:function(){return I(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Rt(this)?lt(this).show():lt(this).hide()})}}),lt.Tween=L,L.prototype={constructor:L,init:function(t,e,i,n,o,s){this.elem=t,this.prop=i,this.easing=o||lt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(lt.cssNumber[i]?"":"px")},cur:function(){var t=L.propHooks[this.prop];return t&&t.get?t.get(this):L.propHooks._default.get(this)},run:function(t){var e,i=L.propHooks[this.prop];return this.options.duration?this.pos=e=lt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=lt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){lt.fx.step[t.prop]?lt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[lt.cssProps[t.prop]]&&!lt.cssHooks[t.prop]?t.elem[t.prop]=t.now:lt.style(t.elem,t.prop,t.now+t.unit)}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},lt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},lt.fx=L.prototype.init,lt.fx.step={};var re,ae,le=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;lt.Animation=lt.extend(z,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return p(i.elem,t,Pt.exec(e),i),i}]},tweener:function(t,e){lt.isFunction(t)?(e=t,t=["*"]):t=t.match(Ct);for(var i,n=0,o=t.length;n1)},removeAttr:function(t){return this.each(function(){lt.removeAttr(this,t)})}}),lt.extend({attr:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?lt.prop(t,e,i):(1===s&<.isXMLDoc(t)||(e=e.toLowerCase(),o=lt.attrHooks[e]||(lt.expr.match.bool.test(e)?ce:void 0)),void 0!==i?null===i?void lt.removeAttr(t,e):o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:(t.setAttribute(e,i+""),i):o&&"get"in o&&null!==(n=o.get(t,e))?n:(n=lt.find.attr(t,e),null==n?void 0:n))},attrHooks:{type:{set:function(t,e){if(!at.radioValue&&"radio"===e&<.nodeName(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n,o=0,s=e&&e.match(Ct);if(s&&1===t.nodeType)for(;i=s[o++];)n=lt.propFix[i]||i,lt.expr.match.bool.test(i)&&(t[n]=!1),t.removeAttribute(i)}}),ce={set:function(t,e,i){return!1===e?lt.removeAttr(t,i):t.setAttribute(i,i),i}},lt.each(lt.expr.match.bool.source.match(/\w+/g),function(t,e){var i=he[e]||lt.find.attr;he[e]=function(t,e,n){var o,s;return n||(s=he[e],he[e]=o,o=null!=i(t,e,n)?e.toLowerCase():null,he[e]=s),o}});var de=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;lt.fn.extend({prop:function(t,e){return kt(this,lt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[lt.propFix[t]||t]})}}),lt.extend({prop:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&<.isXMLDoc(t)||(e=lt.propFix[e]||e,o=lt.propHooks[e]),void 0!==i?o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:t[e]=i:o&&"get"in o&&null!==(n=o.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=lt.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),at.optSelected||(lt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),lt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){lt.propFix[this.toLowerCase()]=this});var fe=/[\t\r\n\f]/g;lt.fn.extend({addClass:function(t){var e,i,n,o,s,r,a,l=0;if(lt.isFunction(t))return this.each(function(e){lt(this).addClass(t.call(this,e,B(this)))});if("string"==typeof t&&t)for(e=t.match(Ct)||[];i=this[l++];)if(o=B(i),n=1===i.nodeType&&(" "+o+" ").replace(fe," ")){for(r=0;s=e[r++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");a=lt.trim(n),o!==a&&i.setAttribute("class",a)}return this},removeClass:function(t){var e,i,n,o,s,r,a,l=0;if(lt.isFunction(t))return this.each(function(e){lt(this).removeClass(t.call(this,e,B(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(Ct)||[];i=this[l++];)if(o=B(i),n=1===i.nodeType&&(" "+o+" ").replace(fe," ")){for(r=0;s=e[r++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");a=lt.trim(n),o!==a&&i.setAttribute("class",a)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):lt.isFunction(t)?this.each(function(i){lt(this).toggleClass(t.call(this,i,B(this),e),e)}):this.each(function(){var e,n,o,s;if("string"===i)for(n=0,o=lt(this),s=t.match(Ct)||[];e=s[n++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==i||(e=B(this),e&&Et.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Et.get(this,"__className__")||""))})},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+B(i)+" ").replace(fe," ").indexOf(e)>-1)return!0;return!1}});var ge=/\r/g,me=/[\x20\t\r\n\f]+/g;lt.fn.extend({val:function(t){var e,i,n,o=this[0];{if(arguments.length)return n=lt.isFunction(t),this.each(function(i){var o;1===this.nodeType&&(o=n?t.call(this,i,lt(this).val()):t,null==o?o="":"number"==typeof o?o+="":lt.isArray(o)&&(o=lt.map(o,function(t){return null==t?"":t+""})),(e=lt.valHooks[this.type]||lt.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return(e=lt.valHooks[o.type]||lt.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(o,"value"))?i:(i=o.value,"string"==typeof i?i.replace(ge,""):null==i?"":i)}}}),lt.extend({valHooks:{option:{get:function(t){var e=lt.find.attr(t,"value");return null!=e?e:lt.trim(lt.text(t)).replace(me," ")}},select:{get:function(t){for(var e,i,n=t.options,o=t.selectedIndex,s="select-one"===t.type||o<0,r=s?null:[],a=s?o+1:n.length,l=o<0?a:s?o:0;l-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),lt.each(["radio","checkbox"],function(){lt.valHooks[this]={set:function(t,e){if(lt.isArray(e))return t.checked=lt.inArray(lt(t).val(),e)>-1}},at.checkOn||(lt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var ve=/^(?:focusinfocus|focusoutblur)$/;lt.extend(lt.event,{trigger:function(t,e,n,o){var s,r,a,l,u,c,h,d=[n||Z],p=rt.call(t,"type")?t.type:t,f=rt.call(t,"namespace")?t.namespace.split("."):[];if(r=a=n=n||Z,3!==n.nodeType&&8!==n.nodeType&&!ve.test(p+lt.event.triggered)&&(p.indexOf(".")>-1&&(f=p.split("."),p=f.shift(),f.sort()),u=p.indexOf(":")<0&&"on"+p,t=t[lt.expando]?t:new lt.Event(p,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=f.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:lt.makeArray(e,[t]),h=lt.event.special[p]||{},o||!h.trigger||!1!==h.trigger.apply(n,e))){if(!o&&!h.noBubble&&!lt.isWindow(n)){for(l=h.delegateType||p,ve.test(l+p)||(r=r.parentNode);r;r=r.parentNode)d.push(r),a=r;a===(n.ownerDocument||Z)&&d.push(a.defaultView||a.parentWindow||i)}for(s=0;(r=d[s++])&&!t.isPropagationStopped();)t.type=s>1?l:h.bindType||p,c=(Et.get(r,"events")||{})[t.type]&&Et.get(r,"handle"),c&&c.apply(r,e),(c=u&&r[u])&&c.apply&&Tt(r)&&(t.result=c.apply(r,e),!1===t.result&&t.preventDefault());return t.type=p,o||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(d.pop(),e)||!Tt(n)||u&<.isFunction(n[p])&&!lt.isWindow(n)&&(a=n[u],a&&(n[u]=null),lt.event.triggered=p,n[p](),lt.event.triggered=void 0,a&&(n[u]=a)),t.result}},simulate:function(t,e,i){var n=lt.extend(new lt.Event,i,{type:t,isSimulated:!0});lt.event.trigger(n,null,e)}}),lt.fn.extend({trigger:function(t,e){return this.each(function(){lt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return lt.event.trigger(t,e,i,!0)}}),lt.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){lt.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),lt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),at.focusin="onfocusin"in i,at.focusin||lt.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){lt.event.simulate(e,t.target,lt.event.fix(t))};lt.event.special[e]={setup:function(){var n=this.ownerDocument||this,o=Et.access(n,e);o||n.addEventListener(t,i,!0),Et.access(n,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=Et.access(n,e)-1;o?Et.access(n,e,o):(n.removeEventListener(t,i,!0),Et.remove(n,e))}}});var ye=i.location,be=lt.now(),we=/\?/;lt.parseJSON=function(t){return JSON.parse(t+"")},lt.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||lt.error("Invalid XML: "+t),e};var _e=/#.*$/,xe=/([?&])_=[^&]*/,Ce=/^(.*?):[ \t]*([^\r\n]*)$/gm,Se=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ke=/^(?:GET|HEAD)$/,Te=/^\/\//,Ee={},Ae={},De="*/".concat("*"),Me=Z.createElement("a");Me.href=ye.href,lt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ye.href,type:"GET",isLocal:Se.test(ye.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":De,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":lt.parseJSON,"text xml":lt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?G(G(t,lt.ajaxSettings),e):G(lt.ajaxSettings,t)},ajaxPrefilter:U(Ee),ajaxTransport:U(Ae),ajax:function(t,e){function n(t,e,n,a){var u,h,y,b,_,C=e;2!==w&&(w=2,l&&i.clearTimeout(l),o=void 0,r=a||"",x.readyState=t>0?4:0,u=t>=200&&t<300||304===t,n&&(b=X(d,x,n)),b=Y(d,b,x,u),u?(d.ifModified&&(_=x.getResponseHeader("Last-Modified"),_&&(lt.lastModified[s]=_),(_=x.getResponseHeader("etag"))&&(lt.etag[s]=_)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=b.state,h=b.data,y=b.error,u=!y)):(y=C,!t&&C||(C="error",t<0&&(t=0))),x.status=t,x.statusText=(e||C)+"",u?g.resolveWith(p,[h,C,x]):g.rejectWith(p,[x,C,y]),x.statusCode(v),v=void 0,c&&f.trigger(u?"ajaxSuccess":"ajaxError",[x,d,u?h:y]),m.fireWith(p,[x,C]),c&&(f.trigger("ajaxComplete",[x,d]),--lt.active||lt.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var o,s,r,a,l,u,c,h,d=lt.ajaxSetup({},e),p=d.context||d,f=d.context&&(p.nodeType||p.jquery)?lt(p):lt.event,g=lt.Deferred(),m=lt.Callbacks("once memory"),v=d.statusCode||{},y={},b={},w=0,_="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(2===w){if(!a)for(a={};e=Ce.exec(r);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===w?r:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return w||(t=b[i]=b[i]||t,y[t]=e),this},overrideMimeType:function(t){return w||(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(w<2)for(e in t)v[e]=[v[e],t[e]];else x.always(t[x.status]);return this},abort:function(t){var e=t||_;return o&&o.abort(e),n(0,e),this}};if(g.promise(x).complete=m.add,x.success=x.done,x.error=x.fail,d.url=((t||d.url||ye.href)+"").replace(_e,"").replace(Te,ye.protocol+"//"),d.type=e.method||e.type||d.method||d.type,d.dataTypes=lt.trim(d.dataType||"*").toLowerCase().match(Ct)||[""],null==d.crossDomain){u=Z.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=Me.protocol+"//"+Me.host!=u.protocol+"//"+u.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=lt.param(d.data,d.traditional)),V(Ee,d,e,x),2===w)return x;c=lt.event&&d.global,c&&0==lt.active++&<.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!ke.test(d.type),s=d.url,d.hasContent||(d.data&&(s=d.url+=(we.test(s)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=xe.test(s)?s.replace(xe,"$1_="+be++):s+(we.test(s)?"&":"?")+"_="+be++)),d.ifModified&&(lt.lastModified[s]&&x.setRequestHeader("If-Modified-Since",lt.lastModified[s]),lt.etag[s]&&x.setRequestHeader("If-None-Match",lt.etag[s])),(d.data&&d.hasContent&&!1!==d.contentType||e.contentType)&&x.setRequestHeader("Content-Type",d.contentType),x.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+De+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)x.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(p,x,d)||2===w))return x.abort();_="abort";for(h in{success:1,error:1,complete:1})x[h](d[h]);if(o=V(Ae,d,e,x)){if(x.readyState=1,c&&f.trigger("ajaxSend",[x,d]),2===w)return x;d.async&&d.timeout>0&&(l=i.setTimeout(function(){x.abort("timeout")},d.timeout));try{w=1,o.send(y,n)}catch(t){if(!(w<2))throw t;n(-1,t)}}else n(-1,"No Transport");return x},getJSON:function(t,e,i){return lt.get(t,e,i,"json")},getScript:function(t,e){return lt.get(t,void 0,e,"script")}}),lt.each(["get","post"],function(t,e){lt[e]=function(t,i,n,o){return lt.isFunction(i)&&(o=o||n,n=i,i=void 0),lt.ajax(lt.extend({url:t,type:e,dataType:o,data:i,success:n},lt.isPlainObject(t)&&t))}}),lt._evalUrl=function(t){return lt.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},lt.fn.extend({wrapAll:function(t){var e;return lt.isFunction(t)?this.each(function(e){lt(this).wrapAll(t.call(this,e))}):(this[0]&&(e=lt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return lt.isFunction(t)?this.each(function(e){lt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=lt(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=lt.isFunction(t);return this.each(function(i){lt(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(){return this.parent().each(function(){lt.nodeName(this,"body")||lt(this).replaceWith(this.childNodes)}).end()}}),lt.expr.filters.hidden=function(t){return!lt.expr.filters.visible(t)},lt.expr.filters.visible=function(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0};var Oe=/%20/g,Pe=/\[\]$/,je=/\r?\n/g,Re=/^(?:submit|button|image|reset|file)$/i,Ne=/^(?:input|select|textarea|keygen)/i;lt.param=function(t,e){var i,n=[],o=function(t,e){e=lt.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=lt.ajaxSettings&<.ajaxSettings.traditional),lt.isArray(t)||t.jquery&&!lt.isPlainObject(t))lt.each(t,function(){o(this.name,this.value)});else for(i in t)J(i,t[i],e,o);return n.join("&").replace(Oe,"+")},lt.fn.extend({serialize:function(){return lt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=lt.prop(this,"elements");return t?lt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!lt(this).is(":disabled")&&Ne.test(this.nodeName)&&!Re.test(t)&&(this.checked||!Nt.test(t))}).map(function(t,e){var i=lt(this).val();return null==i?null:lt.isArray(i)?lt.map(i,function(t){return{name:e.name,value:t.replace(je,"\r\n")}}):{name:e.name,value:i.replace(je,"\r\n")}}).get()}}),lt.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Ie={0:200,1223:204},Le=lt.ajaxSettings.xhr();at.cors=!!Le&&"withCredentials"in Le,at.ajax=Le=!!Le,lt.ajaxTransport(function(t){var e,n;if(at.cors||Le&&!t.crossDomain)return{send:function(o,s){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(r in o)a.setRequestHeader(r,o[r]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Ie[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&i.setTimeout(function(){e&&n()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),lt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return lt.globalEval(t),t}}}),lt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),lt.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=lt("