galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
February 2015
- 2 participants
- 305 discussions
commit/galaxy-central: dan: Comment out igv local external display application link by default, since it is confusing users (most do not have a local igv running).
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3947a9273550/
Changeset: 3947a9273550
User: dan
Date: 2015-02-11 20:39:38+00:00
Summary: Comment out igv local external display application link by default, since it is confusing users (most do not have a local igv running).
Affected #: 1 file
diff -r 11d7c10c1b5e2778f6a96bfa5e3e0e950a619634 -r 3947a92735506923a0f51abe36263bbc0aecfb79 tool-data/shared/igv/igv_build_sites.txt.sample
--- a/tool-data/shared/igv/igv_build_sites.txt.sample
+++ b/tool-data/shared/igv/igv_build_sites.txt.sample
@@ -1,4 +1,4 @@
#site_id site_name site_url dbkey ivg_build_name
web_link_main web current http://www.broadinstitute.org/igv/projects/current/igv.php hg19,hg_g1k_v37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum hg19,b37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum
#web_jnlp_1.5 web 1.5 http://www.broadinstitute.org/igvdata/jws/prod hg19,hg_g1k_v37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum hg19,b37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum
-local_default local http://localhost:60151/load hg19,hg_g1k_v37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum hg19,b37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum
\ No newline at end of file
+#local_default local http://localhost:60151/load hg19,hg_g1k_v37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum hg19,b37,hg18,1kg_ref,hg17,hg16,mm9,mm8,mm7,panTro2,rheMac2,rn4,canFam2,bosTau6,bosTau4,bosTau3,susScrofa,galGal3,cavPor3,monDom5,xenTro2,taeGut1,zebrafish,danRer6,danRer7,gasAcu1,Aplysia,Plasmodium_3D7_v2.1,Plasmodium_3D7_v5.5,Plasmodium_6.1,PlasmoDB_7.0,pvivax,GSM552910,sacCer1,sacCer2,sk1,Y55,sacCer62,spombe_709,spombe_1.55,candida,mg8,spur_2.1,spur_2.5,spur_3.0,WS201,ce6,ce4,dm3,dm2,dmel_5.9,dmel_r5.22,dmel_r5.33,tcas_2.0,tcas_3.0,ncrassa_v3,nc10,Glamblia_2.0,me49,tb927,tbgambi,lmjr,anidulans_4.1,NC_009012,U00096.2,NC_000913.2,NC_002655.2,CSavignyi_v2.1,tair8,tair9,tair10,O_Sativa_r6,osativa_6.1,B73,ZmB73_5a,ppatens_1.2,D.discoideum
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: martenson: rename the link from toolform to the Tool Shed
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/11d7c10c1b5e/
Changeset: 11d7c10c1b5e
User: martenson
Date: 2015-02-11 19:31:13+00:00
Summary: rename the link from toolform to the Tool Shed
Affected #: 3 files
diff -r c6915ffcd27c174d0d4c298855ce923d56bd2c62 -r 11d7c10c1b5e2778f6a96bfa5e3e0e950a619634 client/galaxy/scripts/mvc/tools/tools-form-base.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-base.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-base.js
@@ -290,7 +290,7 @@
if (this.options.sharable_url) {
menu_button.addMenu({
icon : 'fa-external-link',
- title : 'Open in Toolshed',
+ title : 'See in Tool Shed',
tooltip : 'Access the repository',
onclick : function() {
window.open(self.options.sharable_url);
diff -r c6915ffcd27c174d0d4c298855ce923d56bd2c62 -r 11d7c10c1b5e2778f6a96bfa5e3e0e950a619634 static/scripts/mvc/tools/tools-form-base.js
--- a/static/scripts/mvc/tools/tools-form-base.js
+++ b/static/scripts/mvc/tools/tools-form-base.js
@@ -290,7 +290,7 @@
if (this.options.sharable_url) {
menu_button.addMenu({
icon : 'fa-external-link',
- title : 'Open in Toolshed',
+ title : 'See in Tool Shed',
tooltip : 'Access the repository',
onclick : function() {
window.open(self.options.sharable_url);
diff -r c6915ffcd27c174d0d4c298855ce923d56bd2c62 -r 11d7c10c1b5e2778f6a96bfa5e3e0e950a619634 static/scripts/packed/mvc/tools/tools-form-base.js
--- a/static/scripts/packed/mvc/tools/tools-form-base.js
+++ b/static/scripts/packed/mvc/tools/tools-form-base.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,narrow:false,initial_errors:false,cls_portlet:"ui-portlet-limited"};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this.build(this.options)},build:function(n){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);l.options.inputs=n&&n.inputs;this._renderForm(n);var m=this.tree.finalize();if(n.initial_errors){this._errors(n)}this.on("refresh",function(){var o=l.tree.finalize();if(!_.isEqual(o,m)){m=o;l.deferred.reset();l.deferred.execute(function(){l._updateModel(m)})}});this.on("reset",function(){for(var o in this.element_list){this.element_list[o].reset()}});this.trigger("refresh")},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_renderForm:function(t){var s=this;this.message=new k.Message();var m=new k.ButtonMenu({icon:"fa-cubes",title:(!t.narrow&&"Versions")||null,tooltip:"Select another tool version"});if(t.versions&&t.versions.length>1){for(var o in t.versions){var q=t.versions[o];if(q!=t.version){m.addMenu({title:"Switch to "+q,version:q,icon:"fa-cube",onclick:function(){s.options.id=s.options.id.replace(s.options.version,this.version);s.options.version=this.version;s.deferred.reset();s.deferred.execute(function(){s._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!t.narrow&&"Options")||null,tooltip:"View available options"});if(t.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/t/"+t.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+t.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+t.id+"/download"}})}if(t.requirements&&t.requirements.length>0){p.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;s.message.update({persistent:true,message:c.requirements(t),status:"info"})}else{this.visible=false;s.message.update({message:""})}}})}if(this.options.sharable_url){p.addMenu({icon:"fa-external-link",title:"Open in Toolshed",tooltip:"Access the repository",onclick:function(){window.open(s.options.sharable_url)}})}this.section=new j.View(s,{inputs:t.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+t.name+"</b> "+t.description+" (Galaxy Tool Version "+t.version+")",cls:this.options.cls_portlet,operations:{menu:p,versions:m},buttons:this.buttons});this.portlet.append(this.message.$el.addClass("ui-margin-top"));this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(t.help!=""){this.$el.append(c.help(t.help))}if(t.citations){var r=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=t.id;var n=new a.CitationListView({el:r,collection:l});n.render();l.fetch();this.$el.append(r)}if(t.message){this.message.update({persistent:true,status:"warning",message:t.message})}console.debug("tools-form-base::initialize() - Completed.")}})});
\ No newline at end of file
+define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,narrow:false,initial_errors:false,cls_portlet:"ui-portlet-limited"};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this.build(this.options)},build:function(n){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);l.options.inputs=n&&n.inputs;this._renderForm(n);var m=this.tree.finalize();if(n.initial_errors){this._errors(n)}this.on("refresh",function(){var o=l.tree.finalize();if(!_.isEqual(o,m)){m=o;l.deferred.reset();l.deferred.execute(function(){l._updateModel(m)})}});this.on("reset",function(){for(var o in this.element_list){this.element_list[o].reset()}});this.trigger("refresh")},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_renderForm:function(t){var s=this;this.message=new k.Message();var m=new k.ButtonMenu({icon:"fa-cubes",title:(!t.narrow&&"Versions")||null,tooltip:"Select another tool version"});if(t.versions&&t.versions.length>1){for(var o in t.versions){var q=t.versions[o];if(q!=t.version){m.addMenu({title:"Switch to "+q,version:q,icon:"fa-cube",onclick:function(){s.options.id=s.options.id.replace(s.options.version,this.version);s.options.version=this.version;s.deferred.reset();s.deferred.execute(function(){s._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!t.narrow&&"Options")||null,tooltip:"View available options"});if(t.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/t/"+t.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+t.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+t.id+"/download"}})}if(t.requirements&&t.requirements.length>0){p.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;s.message.update({persistent:true,message:c.requirements(t),status:"info"})}else{this.visible=false;s.message.update({message:""})}}})}if(this.options.sharable_url){p.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(s.options.sharable_url)}})}this.section=new j.View(s,{inputs:t.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+t.name+"</b> "+t.description+" (Galaxy Tool Version "+t.version+")",cls:this.options.cls_portlet,operations:{menu:p,versions:m},buttons:this.buttons});this.portlet.append(this.message.$el.addClass("ui-margin-top"));this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(t.help!=""){this.$el.append(c.help(t.help))}if(t.citations){var r=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=t.id;var n=new a.CitationListView({el:r,collection:l});n.render();l.fetch();this.$el.append(r)}if(t.message){this.message.update({persistent:true,status:"warning",message:t.message})}console.debug("tools-form-base::initialize() - Completed.")}})});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: UI, history multi-view: pressing enter in the history copy dialog will copy the history and close the dialog
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c6915ffcd27c/
Changeset: c6915ffcd27c
User: carlfeberhard
Date: 2015-02-11 18:52:40+00:00
Summary: UI, history multi-view: pressing enter in the history copy dialog will copy the history and close the dialog
Affected #: 3 files
diff -r c171738e365b598c2ea43a0b09dd9c458d4431b1 -r c6915ffcd27c174d0d4c298855ce923d56bd2c62 client/galaxy/scripts/mvc/history/multi-panel.js
--- a/client/galaxy/scripts/mvc/history/multi-panel.js
+++ b/client/galaxy/scripts/mvc/history/multi-panel.js
@@ -46,6 +46,11 @@
Galaxy.modal.hide();
});
}
+ function checkNameAndCopy(){
+ var name = Galaxy.modal.$( '#copy-modal-title' ).val();
+ if( !validateName( name ) ){ return; }
+ copyHistory( name );
+ }
Galaxy.modal.show( _.extend({
title : _l( 'Copying history' ) + ' "' + historyName + '"',
@@ -58,14 +63,15 @@
].join('')),
buttons : {
'Cancel' : function(){ Galaxy.modal.hide(); },
- 'Copy' : function(){
- var name = Galaxy.modal.$( '#copy-modal-title' ).val();
- if( !validateName( name ) ){ return; }
- copyHistory( name );
- }
+ 'Copy' : checkNameAndCopy
}
}, options ));
$( '#copy-modal-title' ).focus().select();
+ $( '#copy-modal-title' ).on( 'keydown', function( ev ){
+ if( ev.keyCode === 13 ){
+ checkNameAndCopy();
+ }
+ });
}
diff -r c171738e365b598c2ea43a0b09dd9c458d4431b1 -r c6915ffcd27c174d0d4c298855ce923d56bd2c62 static/scripts/mvc/history/multi-panel.js
--- a/static/scripts/mvc/history/multi-panel.js
+++ b/static/scripts/mvc/history/multi-panel.js
@@ -46,6 +46,11 @@
Galaxy.modal.hide();
});
}
+ function checkNameAndCopy(){
+ var name = Galaxy.modal.$( '#copy-modal-title' ).val();
+ if( !validateName( name ) ){ return; }
+ copyHistory( name );
+ }
Galaxy.modal.show( _.extend({
title : _l( 'Copying history' ) + ' "' + historyName + '"',
@@ -58,14 +63,15 @@
].join('')),
buttons : {
'Cancel' : function(){ Galaxy.modal.hide(); },
- 'Copy' : function(){
- var name = Galaxy.modal.$( '#copy-modal-title' ).val();
- if( !validateName( name ) ){ return; }
- copyHistory( name );
- }
+ 'Copy' : checkNameAndCopy
}
}, options ));
$( '#copy-modal-title' ).focus().select();
+ $( '#copy-modal-title' ).on( 'keydown', function( ev ){
+ if( ev.keyCode === 13 ){
+ checkNameAndCopy();
+ }
+ });
}
diff -r c171738e365b598c2ea43a0b09dd9c458d4431b1 -r c6915ffcd27c174d0d4c298855ce923d56bd2c62 static/scripts/packed/mvc/history/multi-panel.js
--- a/static/scripts/packed/mvc/history/multi-panel.js
+++ b/static/scripts/packed/mvc/history/multi-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/history/history-panel-edit","mvc/base-mvc","utils/ajax-queue","ui/mode-button","ui/search-input"],function(d,l,z,a){window.HISTORY_MODEL=d;function g(H,E){E=E||{};if(!(Galaxy&&Galaxy.modal)){return H.copy()}var F=H.get("name"),C="Copy of '"+F+"'";function D(J){if(!J){if(!Galaxy.modal.$("#invalid-title").size()){var I=$("<p/>").attr("id","invalid-title").css({color:"red","margin-top":"8px"}).addClass("bg-danger").text(_l("Please enter a valid history title"));Galaxy.modal.$(".modal-body").append(I)}return false}return J}function G(I){var J=$('<p><span class="fa fa-spinner fa-spin"></span> Copying history...</p>').css("margin-top","8px");Galaxy.modal.$(".modal-body").append(J);H.copy(true,I).fail(function(){alert(_l("History could not be copied. Please contact a Galaxy administrator"))}).always(function(){Galaxy.modal.hide()})}Galaxy.modal.show(_.extend({title:_l("Copying history")+' "'+F+'"',body:$(['<label for="copy-modal-title">',_l("Enter a title for the copied history"),":","</label><br />",'<input id="copy-modal-title" class="form-control" style="width: 100%" value="',C,'" />'].join("")),buttons:{Cancel:function(){Galaxy.modal.hide()},Copy:function(){var I=Galaxy.modal.$("#copy-modal-title").val();if(!D(I)){return}G(I)}}},E));$("#copy-modal-title").focus().select()}var B=Backbone.View.extend(z.LoggableMixin).extend({tagName:"div",className:"history-column flex-column flex-row-container",id:function q(){if(!this.model){return""}return"history-column-"+this.model.get("id")},initialize:function c(C){C=C||{};this.panel=C.panel||this.createPanel(C);this.setUpListeners()},createPanel:function u(D){D=_.extend({model:this.model,dragItems:true},D);var C=new l.HistoryPanelEdit(D);C._renderEmptyMessage=this.__patch_renderEmptyMessage;return C},__patch_renderEmptyMessage:function(E){var D=this,F=_.chain(this.model.get("state_ids")).values().flatten().value().length,C=D.$emptyMessage(E);if(!_.isEmpty(D.hdaViews)){C.hide()}else{if(F&&!this.model.contents.length){C.empty().append($('<span class="fa fa-spinner fa-spin"></span><i>loading datasets...</i>')).show()}else{if(D.searchFor){C.text(D.noneFoundMsg).show()}else{C.text(D.emptyMsg).show()}}}return C},setUpListeners:function f(){var C=this;this.once("rendered",function(){C.trigger("rendered:initial",C)});this.setUpPanelListeners()},setUpPanelListeners:function k(){var C=this;this.listenTo(this.panel,{rendered:function(){C.trigger("rendered",C)}},this)},inView:function(C,D){var F=this.$el.offset().left,E=F+this.$el.width();if(E<C){return false}if(F>D){return false}return true},$panel:function e(){return this.$(".history-panel")},render:function A(D){D=(D!==undefined)?(D):("fast");var C=this.model?this.model.toJSON():{};this.$el.html(this.template(C));this.renderPanel(D);this.setUpBehaviors();return this},setUpBehaviors:function v(){},template:function w(D){D=D||{};var C=['<div class="panel-controls clear flex-row">',this.controlsLeftTemplate(),'<div class="pull-right">','<button class="delete-history btn btn-default">',D.deleted?_l("Undelete"):_l("Delete"),"</button>",'<button class="copy-history btn btn-default">',_l("Copy"),"</button>","</div>","</div>",'<div class="inner flex-row flex-column-container">','<div id="history-',D.id,'" class="history-column history-panel flex-column"></div>',"</div>"].join("");return $(C)},controlsLeftTemplate:function(){return(this.currentHistory)?['<div class="pull-left">','<button class="create-new btn btn-default">',_l("Create new"),"</button> ","</div>"].join(""):['<div class="pull-left">','<button class="switch-to btn btn-default">',_l("Switch to"),"</button>","</div>"].join("")},renderPanel:function h(C){C=(C!==undefined)?(C):("fast");this.panel.setElement(this.$panel()).render(C);return this},events:{"click .switch-to.btn":function(){this.model.setAsCurrent()},"click .delete-history.btn":function(){var C=this,D;if(this.model.get("deleted")){D=this.model.undelete()}else{D=this.model._delete()}D.fail(function(G,E,F){alert(_l("Could not delete the history")+":\n"+F)}).done(function(E){C.render()})},"click .copy-history.btn":"copy"},copy:function s(){g(this.model)},toString:function(){return"HistoryPanelColumn("+(this.panel?this.panel:"")+")"}});var m=Backbone.View.extend(z.LoggableMixin).extend({initialize:function c(C){C=C||{};this.log(this+".init",C);if(!C.currentHistoryId){throw new Error(this+" requires a currentHistoryId in the options")}this.currentHistoryId=C.currentHistoryId;this.options={columnWidth:312,borderWidth:1,columnGap:8,headerHeight:29,footerHeight:0,controlsHeight:20};this.order=C.order||"update";this.hdaQueue=new a.NamedAjaxQueue([],false);this.collection=null;this.setCollection(C.histories||[]);this.columnMap={};this.createColumns(C.columnOptions);this.setUpListeners()},setUpListeners:function f(){},setCollection:function y(D){var C=this;C.stopListening(C.collection);C.collection=D;C.sortCollection(C.order,{silent:true});C.setUpCollectionListeners();C.trigger("new-collection",C);return C},setUpCollectionListeners:function(){var C=this,D=C.collection;C.listenTo(D,{add:C.addAsCurrentColumn,"set-as-current":C.setCurrentHistory,"change:deleted":C.handleDeletedHistory,sort:function(){C.renderColumns(0)}})},setCurrentHistory:function p(D){var C=this.columnMap[this.currentHistoryId];if(C){C.currentHistory=false;C.$el.height("")}this.currentHistoryId=D.id;var E=this.columnMap[this.currentHistoryId];E.currentHistory=true;this.sortCollection();multipanel._recalcFirstColumnHeight();return E},handleDeletedHistory:function b(D){if(D.get("deleted")){this.log("handleDeletedHistory",this.collection.includeDeleted,D);var C=this;column=C.columnMap[D.id];if(!column){return}if(column.model.id===this.currentHistoryId){}else{if(!C.collection.includeDeleted){C.removeColumn(column)}}}},sortCollection:function(C,D){C=C||this.order;var E=this.currentHistoryId;switch(C){case"name":this.collection.comparator=function(F){return[F.id!==E,F.get("name").toLowerCase()]};break;case"size":this.collection.comparator=function(F){return[F.id!==E,F.get("size")]};break;default:this.collection.comparator=function(F){return[F.id!==E,Date(F.get("update_time"))]}}this.collection.sort(D);return this.collection},setOrder:function(C){if(["update","name","size"].indexOf(C)===-1){C="update"}this.order=C;this.sortCollection();return this},create:function(C){return this.collection.create({current:true})},createColumns:function r(D){D=D||{};var C=this;this.columnMap={};C.collection.each(function(E,F){var G=C.createColumn(E,D);C.columnMap[E.id]=G})},createColumn:function t(E,C){C=_.extend({},C,{model:E});var D=new B(C);if(E.id===this.currentHistoryId){D.currentHistory=true}this.setUpColumnListeners(D);return D},sortedFilteredColumns:function(C){C=C||this.filters;if(!C||!C.length){return this.sortedColumns()}var D=this;return D.sortedColumns().filter(function(G,F){var E=G.currentHistory||_.every(C.map(function(H){return H.call(G)}));return E})},sortedColumns:function(){var D=this;var C=this.collection.map(function(F,E){return D.columnMap[F.id]});return C},addColumn:function o(E,C){C=C!==undefined?C:true;var D=this.createColumn(E);this.columnMap[E.id]=D;if(C){this.renderColumns()}return D},addAsCurrentColumn:function o(E){var D=this,C=this.addColumn(E,false);this.setCurrentHistory(E);C.once("rendered",function(){D.queueHdaFetch(C)});return C},removeColumn:function x(E,D){D=D!==undefined?D:true;this.log("removeColumn",E);if(!E){return}var F=this,C=this.options.columnWidth+this.options.columnGap;E.$el.fadeOut("fast",function(){if(D){$(this).remove();F.$(".middle").width(F.$(".middle").width()-C);F.checkColumnsInView();F._recalcFirstColumnHeight()}F.stopListening(E.panel);F.stopListening(E);delete F.columnMap[E.model.id];E.remove()})},setUpColumnListeners:function n(C){var D=this;D.listenTo(C,{"in-view":D.queueHdaFetch});D.listenTo(C.panel,{"view:draggable:dragstart":function(H,F,E,G){D._dropData=JSON.parse(H.dataTransfer.getData("text"));D.currentColumnDropTargetOn()},"view:draggable:dragend":function(H,F,E,G){D._dropData=null;D.currentColumnDropTargetOff()},"droptarget:drop":function(G,H,F){var I=D._dropData.filter(function(J){return(_.isObject(J)&&J.id&&J.model_class==="HistoryDatasetAssociation")});D._dropData=null;var E=new a.NamedAjaxQueue();I.forEach(function(J){E.add({name:"copy-"+J.id,fn:function(){return F.model.contents.copy(J.id)}})});E.start();E.done(function(J){F.model.fetch()})}})},columnMapLength:function(){return Object.keys(this.columnMap).length},render:function A(D){D=D!==undefined?D:this.fxSpeed;var C=this;C.log(C+".render");C.$el.html(C.template(C.options));C.renderColumns(D);C.setUpBehaviors();C.trigger("rendered",C);return C},template:function w(C){C=C||{};var D=[];if(this.options.headerHeight){D=D.concat(['<div class="loading-overlay flex-row"><div class="loading-overlay-message">loading...</div></div>','<div class="header flex-column-container">','<div class="header-control header-control-left flex-column">','<button class="done btn btn-default">',_l("Done"),"</button>",'<button class="include-deleted btn btn-default"></button>','<div class="order btn-group">','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',_l("Order histories by")+'... <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="javascript:void(0);" class="order-update">',_l("Time of last update"),"</a></li>",'<li><a href="javascript:void(0);" class="order-name">',_l("Name"),"</a></li>",'<li><a href="javascript:void(0);" class="order-size">',_l("Size"),"</a></li>","</ul>","</div>",'<div id="search-histories" class="header-search"></div>',"</div>",'<div class="header-control header-control-center flex-column">','<div class="header-info">',"</div>","</div>",'<div class="header-control header-control-right flex-column">','<div id="search-datasets" class="header-search"></div>','<button id="toggle-deleted" class="btn btn-default">',_l("Include deleted datasets"),"</button>",'<button id="toggle-hidden" class="btn btn-default">',_l("Include hidden datasets"),"</button>","</div>","</div>"])}D=D.concat(['<div class="outer-middle flex-row flex-row-container">','<div class="middle flex-column-container flex-row"></div>',"</div>",'<div class="footer flex-column-container">',"</div>"]);return $(D.join(""))},renderColumns:function j(F){F=F!==undefined?F:this.fxSpeed;var E=this,C=E.sortedFilteredColumns();E.$(".middle").width(C.length*(this.options.columnWidth+this.options.columnGap)+this.options.columnGap+16);var D=E.$(".middle");D.empty();C.forEach(function(H,G){H.$el.appendTo(D);H.delegateEvents();E.renderColumn(H,F)});if(this.searchFor&&C.length<=1){}else{E.checkColumnsInView();this._recalcFirstColumnHeight()}return C},renderColumn:function(C,D){D=D!==undefined?D:this.fxSpeed;return C.render(D)},queueHdaFetch:function i(E){if(E.model.contents.length===0&&!E.model.get("empty")){var C={},D=_.values(E.panel.storage.get("expandedIds")).join();if(D){C.dataset_details=D}this.hdaQueue.add({name:E.model.id,fn:function(){var F=E.model.contents.fetch({data:C,silent:true});return F.done(function(G){E.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},queueHdaFetchDetails:function(C){if((C.model.contents.length===0&&!C.model.get("empty"))||(!C.model.contents.haveDetails())){this.hdaQueue.add({name:C.model.id,fn:function(){var D=C.model.contents.fetch({data:{details:"all"},silent:true});return D.done(function(E){C.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},renderInfo:function(C){this.$(".header .header-info").text(C)},events:{"click .done.btn":"close","click .create-new.btn":"create","click .order .order-update":function(C){this.setOrder("update")},"click .order .order-name":function(C){this.setOrder("name")},"click .order .order-size":function(C){this.setOrder("size")}},close:function(D){var C="/";if(Galaxy&&Galaxy.options&&Galaxy.options.root){C=Galaxy.options.root}else{if(galaxy_config&&galaxy_config.root){C=galaxy_config.root}}window.location=C},includeDeletedHistories:function(){window.location+=(/\?/.test(window.location.toString()))?("&"):("?")+"include_deleted_histories=True"},excludeDeletedHistories:function(){window.location=window.location.toString().replace(/[&\?]include_deleted_histories=True/g,"")},setUpBehaviors:function(){var D=this;D.$(".include-deleted").modeButton({initialMode:this.collection.includeDeleted?"exclude":"include",switchModesOnClick:false,modes:[{mode:"include",html:_l("Include deleted histories"),onclick:_.bind(D.includeDeletedHistories,D)},{mode:"exclude",html:_l("Exclude deleted histories"),onclick:_.bind(D.excludeDeletedHistories,D)}]});D.$("#search-histories").searchInput({name:"search-histories",placeholder:_l("search histories"),onsearch:function(E){D.searchFor=E;D.filters=[function(){return this.model.matchesAll(D.searchFor)}];D.renderColumns(0)},onclear:function(E){D.searchFor=null;D.filters=[];D.renderColumns(0)}});D.$("#search-datasets").searchInput({name:"search-datasets",placeholder:_l("search all datasets"),onfirstsearch:function(E){D.hdaQueue.clear();D.$("#search-datasets").searchInput("toggle-loading");D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E);D.queueHdaFetchDetails(F)});D.hdaQueue.progress(function(F){D.renderInfo([_l("searching"),(F.curr+1),_l("of"),F.total].join(" "))});D.hdaQueue.deferred.done(function(){D.renderInfo("");D.$("#search-datasets").searchInput("toggle-loading")})},onsearch:function(E){D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E)})},onclear:function(E){D.searchFor=null;D.sortedFilteredColumns().forEach(function(F){F.panel.clearSearch()})}});D.$("#toggle-deleted").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude deleted datasets")},{mode:"include",html:_l("Include deleted datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowDeleted(E,false)},F*200)})});D.$("#toggle-hidden").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude hidden datasets")},{mode:"include",html:_l("Include hidden datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowHidden(E,false)},F*200)})});$(window).resize(function(){D._recalcFirstColumnHeight()});var C=_.debounce(_.bind(this.checkColumnsInView,this),100);this.$(".middle").parent().scroll(C)},_recalcFirstColumnHeight:function(){var C=this.$(".history-column").first(),E=this.$(".middle").height(),D=C.find(".panel-controls").height();C.height(E).find(".inner").height(E-D)},_viewport:function(){var C=this.$(".middle").parent().offset().left;return{left:C,right:C+this.$(".middle").parent().width()}},columnsInView:function(){var C=this._viewport();return this.sortedFilteredColumns().filter(function(D){return D.currentHistory||D.inView(C.left,C.right)})},checkColumnsInView:function(){this.columnsInView().forEach(function(C){C.trigger("in-view",C)})},currentColumnDropTargetOn:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=function(D){};C.panel.dropTargetOn()},currentColumnDropTargetOff:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=l.HistoryPanelEdit.prototype.dataDrop;C.panel.dropTargetOff()},toString:function(){return"MultiPanelColumns("+(this.columns?this.columns.length:0)+")"}});return{MultiPanelColumns:m}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/history/history-panel-edit","mvc/base-mvc","utils/ajax-queue","ui/mode-button","ui/search-input"],function(d,l,z,a){window.HISTORY_MODEL=d;function g(I,E){E=E||{};if(!(Galaxy&&Galaxy.modal)){return I.copy()}var F=I.get("name"),C="Copy of '"+F+"'";function D(K){if(!K){if(!Galaxy.modal.$("#invalid-title").size()){var J=$("<p/>").attr("id","invalid-title").css({color:"red","margin-top":"8px"}).addClass("bg-danger").text(_l("Please enter a valid history title"));Galaxy.modal.$(".modal-body").append(J)}return false}return K}function G(J){var K=$('<p><span class="fa fa-spinner fa-spin"></span> Copying history...</p>').css("margin-top","8px");Galaxy.modal.$(".modal-body").append(K);I.copy(true,J).fail(function(){alert(_l("History could not be copied. Please contact a Galaxy administrator"))}).always(function(){Galaxy.modal.hide()})}function H(){var J=Galaxy.modal.$("#copy-modal-title").val();if(!D(J)){return}G(J)}Galaxy.modal.show(_.extend({title:_l("Copying history")+' "'+F+'"',body:$(['<label for="copy-modal-title">',_l("Enter a title for the copied history"),":","</label><br />",'<input id="copy-modal-title" class="form-control" style="width: 100%" value="',C,'" />'].join("")),buttons:{Cancel:function(){Galaxy.modal.hide()},Copy:H}},E));$("#copy-modal-title").focus().select();$("#copy-modal-title").on("keydown",function(J){if(J.keyCode===13){H()}})}var B=Backbone.View.extend(z.LoggableMixin).extend({tagName:"div",className:"history-column flex-column flex-row-container",id:function q(){if(!this.model){return""}return"history-column-"+this.model.get("id")},initialize:function c(C){C=C||{};this.panel=C.panel||this.createPanel(C);this.setUpListeners()},createPanel:function u(D){D=_.extend({model:this.model,dragItems:true},D);var C=new l.HistoryPanelEdit(D);C._renderEmptyMessage=this.__patch_renderEmptyMessage;return C},__patch_renderEmptyMessage:function(E){var D=this,F=_.chain(this.model.get("state_ids")).values().flatten().value().length,C=D.$emptyMessage(E);if(!_.isEmpty(D.hdaViews)){C.hide()}else{if(F&&!this.model.contents.length){C.empty().append($('<span class="fa fa-spinner fa-spin"></span><i>loading datasets...</i>')).show()}else{if(D.searchFor){C.text(D.noneFoundMsg).show()}else{C.text(D.emptyMsg).show()}}}return C},setUpListeners:function f(){var C=this;this.once("rendered",function(){C.trigger("rendered:initial",C)});this.setUpPanelListeners()},setUpPanelListeners:function k(){var C=this;this.listenTo(this.panel,{rendered:function(){C.trigger("rendered",C)}},this)},inView:function(C,D){var F=this.$el.offset().left,E=F+this.$el.width();if(E<C){return false}if(F>D){return false}return true},$panel:function e(){return this.$(".history-panel")},render:function A(D){D=(D!==undefined)?(D):("fast");var C=this.model?this.model.toJSON():{};this.$el.html(this.template(C));this.renderPanel(D);this.setUpBehaviors();return this},setUpBehaviors:function v(){},template:function w(D){D=D||{};var C=['<div class="panel-controls clear flex-row">',this.controlsLeftTemplate(),'<div class="pull-right">','<button class="delete-history btn btn-default">',D.deleted?_l("Undelete"):_l("Delete"),"</button>",'<button class="copy-history btn btn-default">',_l("Copy"),"</button>","</div>","</div>",'<div class="inner flex-row flex-column-container">','<div id="history-',D.id,'" class="history-column history-panel flex-column"></div>',"</div>"].join("");return $(C)},controlsLeftTemplate:function(){return(this.currentHistory)?['<div class="pull-left">','<button class="create-new btn btn-default">',_l("Create new"),"</button> ","</div>"].join(""):['<div class="pull-left">','<button class="switch-to btn btn-default">',_l("Switch to"),"</button>","</div>"].join("")},renderPanel:function h(C){C=(C!==undefined)?(C):("fast");this.panel.setElement(this.$panel()).render(C);return this},events:{"click .switch-to.btn":function(){this.model.setAsCurrent()},"click .delete-history.btn":function(){var C=this,D;if(this.model.get("deleted")){D=this.model.undelete()}else{D=this.model._delete()}D.fail(function(G,E,F){alert(_l("Could not delete the history")+":\n"+F)}).done(function(E){C.render()})},"click .copy-history.btn":"copy"},copy:function s(){g(this.model)},toString:function(){return"HistoryPanelColumn("+(this.panel?this.panel:"")+")"}});var m=Backbone.View.extend(z.LoggableMixin).extend({initialize:function c(C){C=C||{};this.log(this+".init",C);if(!C.currentHistoryId){throw new Error(this+" requires a currentHistoryId in the options")}this.currentHistoryId=C.currentHistoryId;this.options={columnWidth:312,borderWidth:1,columnGap:8,headerHeight:29,footerHeight:0,controlsHeight:20};this.order=C.order||"update";this.hdaQueue=new a.NamedAjaxQueue([],false);this.collection=null;this.setCollection(C.histories||[]);this.columnMap={};this.createColumns(C.columnOptions);this.setUpListeners()},setUpListeners:function f(){},setCollection:function y(D){var C=this;C.stopListening(C.collection);C.collection=D;C.sortCollection(C.order,{silent:true});C.setUpCollectionListeners();C.trigger("new-collection",C);return C},setUpCollectionListeners:function(){var C=this,D=C.collection;C.listenTo(D,{add:C.addAsCurrentColumn,"set-as-current":C.setCurrentHistory,"change:deleted":C.handleDeletedHistory,sort:function(){C.renderColumns(0)}})},setCurrentHistory:function p(D){var C=this.columnMap[this.currentHistoryId];if(C){C.currentHistory=false;C.$el.height("")}this.currentHistoryId=D.id;var E=this.columnMap[this.currentHistoryId];E.currentHistory=true;this.sortCollection();multipanel._recalcFirstColumnHeight();return E},handleDeletedHistory:function b(D){if(D.get("deleted")){this.log("handleDeletedHistory",this.collection.includeDeleted,D);var C=this;column=C.columnMap[D.id];if(!column){return}if(column.model.id===this.currentHistoryId){}else{if(!C.collection.includeDeleted){C.removeColumn(column)}}}},sortCollection:function(C,D){C=C||this.order;var E=this.currentHistoryId;switch(C){case"name":this.collection.comparator=function(F){return[F.id!==E,F.get("name").toLowerCase()]};break;case"size":this.collection.comparator=function(F){return[F.id!==E,F.get("size")]};break;default:this.collection.comparator=function(F){return[F.id!==E,Date(F.get("update_time"))]}}this.collection.sort(D);return this.collection},setOrder:function(C){if(["update","name","size"].indexOf(C)===-1){C="update"}this.order=C;this.sortCollection();return this},create:function(C){return this.collection.create({current:true})},createColumns:function r(D){D=D||{};var C=this;this.columnMap={};C.collection.each(function(E,F){var G=C.createColumn(E,D);C.columnMap[E.id]=G})},createColumn:function t(E,C){C=_.extend({},C,{model:E});var D=new B(C);if(E.id===this.currentHistoryId){D.currentHistory=true}this.setUpColumnListeners(D);return D},sortedFilteredColumns:function(C){C=C||this.filters;if(!C||!C.length){return this.sortedColumns()}var D=this;return D.sortedColumns().filter(function(G,F){var E=G.currentHistory||_.every(C.map(function(H){return H.call(G)}));return E})},sortedColumns:function(){var D=this;var C=this.collection.map(function(F,E){return D.columnMap[F.id]});return C},addColumn:function o(E,C){C=C!==undefined?C:true;var D=this.createColumn(E);this.columnMap[E.id]=D;if(C){this.renderColumns()}return D},addAsCurrentColumn:function o(E){var D=this,C=this.addColumn(E,false);this.setCurrentHistory(E);C.once("rendered",function(){D.queueHdaFetch(C)});return C},removeColumn:function x(E,D){D=D!==undefined?D:true;this.log("removeColumn",E);if(!E){return}var F=this,C=this.options.columnWidth+this.options.columnGap;E.$el.fadeOut("fast",function(){if(D){$(this).remove();F.$(".middle").width(F.$(".middle").width()-C);F.checkColumnsInView();F._recalcFirstColumnHeight()}F.stopListening(E.panel);F.stopListening(E);delete F.columnMap[E.model.id];E.remove()})},setUpColumnListeners:function n(C){var D=this;D.listenTo(C,{"in-view":D.queueHdaFetch});D.listenTo(C.panel,{"view:draggable:dragstart":function(H,F,E,G){D._dropData=JSON.parse(H.dataTransfer.getData("text"));D.currentColumnDropTargetOn()},"view:draggable:dragend":function(H,F,E,G){D._dropData=null;D.currentColumnDropTargetOff()},"droptarget:drop":function(G,H,F){var I=D._dropData.filter(function(J){return(_.isObject(J)&&J.id&&J.model_class==="HistoryDatasetAssociation")});D._dropData=null;var E=new a.NamedAjaxQueue();I.forEach(function(J){E.add({name:"copy-"+J.id,fn:function(){return F.model.contents.copy(J.id)}})});E.start();E.done(function(J){F.model.fetch()})}})},columnMapLength:function(){return Object.keys(this.columnMap).length},render:function A(D){D=D!==undefined?D:this.fxSpeed;var C=this;C.log(C+".render");C.$el.html(C.template(C.options));C.renderColumns(D);C.setUpBehaviors();C.trigger("rendered",C);return C},template:function w(C){C=C||{};var D=[];if(this.options.headerHeight){D=D.concat(['<div class="loading-overlay flex-row"><div class="loading-overlay-message">loading...</div></div>','<div class="header flex-column-container">','<div class="header-control header-control-left flex-column">','<button class="done btn btn-default">',_l("Done"),"</button>",'<button class="include-deleted btn btn-default"></button>','<div class="order btn-group">','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',_l("Order histories by")+'... <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="javascript:void(0);" class="order-update">',_l("Time of last update"),"</a></li>",'<li><a href="javascript:void(0);" class="order-name">',_l("Name"),"</a></li>",'<li><a href="javascript:void(0);" class="order-size">',_l("Size"),"</a></li>","</ul>","</div>",'<div id="search-histories" class="header-search"></div>',"</div>",'<div class="header-control header-control-center flex-column">','<div class="header-info">',"</div>","</div>",'<div class="header-control header-control-right flex-column">','<div id="search-datasets" class="header-search"></div>','<button id="toggle-deleted" class="btn btn-default">',_l("Include deleted datasets"),"</button>",'<button id="toggle-hidden" class="btn btn-default">',_l("Include hidden datasets"),"</button>","</div>","</div>"])}D=D.concat(['<div class="outer-middle flex-row flex-row-container">','<div class="middle flex-column-container flex-row"></div>',"</div>",'<div class="footer flex-column-container">',"</div>"]);return $(D.join(""))},renderColumns:function j(F){F=F!==undefined?F:this.fxSpeed;var E=this,C=E.sortedFilteredColumns();E.$(".middle").width(C.length*(this.options.columnWidth+this.options.columnGap)+this.options.columnGap+16);var D=E.$(".middle");D.empty();C.forEach(function(H,G){H.$el.appendTo(D);H.delegateEvents();E.renderColumn(H,F)});if(this.searchFor&&C.length<=1){}else{E.checkColumnsInView();this._recalcFirstColumnHeight()}return C},renderColumn:function(C,D){D=D!==undefined?D:this.fxSpeed;return C.render(D)},queueHdaFetch:function i(E){if(E.model.contents.length===0&&!E.model.get("empty")){var C={},D=_.values(E.panel.storage.get("expandedIds")).join();if(D){C.dataset_details=D}this.hdaQueue.add({name:E.model.id,fn:function(){var F=E.model.contents.fetch({data:C,silent:true});return F.done(function(G){E.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},queueHdaFetchDetails:function(C){if((C.model.contents.length===0&&!C.model.get("empty"))||(!C.model.contents.haveDetails())){this.hdaQueue.add({name:C.model.id,fn:function(){var D=C.model.contents.fetch({data:{details:"all"},silent:true});return D.done(function(E){C.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},renderInfo:function(C){this.$(".header .header-info").text(C)},events:{"click .done.btn":"close","click .create-new.btn":"create","click .order .order-update":function(C){this.setOrder("update")},"click .order .order-name":function(C){this.setOrder("name")},"click .order .order-size":function(C){this.setOrder("size")}},close:function(D){var C="/";if(Galaxy&&Galaxy.options&&Galaxy.options.root){C=Galaxy.options.root}else{if(galaxy_config&&galaxy_config.root){C=galaxy_config.root}}window.location=C},includeDeletedHistories:function(){window.location+=(/\?/.test(window.location.toString()))?("&"):("?")+"include_deleted_histories=True"},excludeDeletedHistories:function(){window.location=window.location.toString().replace(/[&\?]include_deleted_histories=True/g,"")},setUpBehaviors:function(){var D=this;D.$(".include-deleted").modeButton({initialMode:this.collection.includeDeleted?"exclude":"include",switchModesOnClick:false,modes:[{mode:"include",html:_l("Include deleted histories"),onclick:_.bind(D.includeDeletedHistories,D)},{mode:"exclude",html:_l("Exclude deleted histories"),onclick:_.bind(D.excludeDeletedHistories,D)}]});D.$("#search-histories").searchInput({name:"search-histories",placeholder:_l("search histories"),onsearch:function(E){D.searchFor=E;D.filters=[function(){return this.model.matchesAll(D.searchFor)}];D.renderColumns(0)},onclear:function(E){D.searchFor=null;D.filters=[];D.renderColumns(0)}});D.$("#search-datasets").searchInput({name:"search-datasets",placeholder:_l("search all datasets"),onfirstsearch:function(E){D.hdaQueue.clear();D.$("#search-datasets").searchInput("toggle-loading");D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E);D.queueHdaFetchDetails(F)});D.hdaQueue.progress(function(F){D.renderInfo([_l("searching"),(F.curr+1),_l("of"),F.total].join(" "))});D.hdaQueue.deferred.done(function(){D.renderInfo("");D.$("#search-datasets").searchInput("toggle-loading")})},onsearch:function(E){D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E)})},onclear:function(E){D.searchFor=null;D.sortedFilteredColumns().forEach(function(F){F.panel.clearSearch()})}});D.$("#toggle-deleted").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude deleted datasets")},{mode:"include",html:_l("Include deleted datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowDeleted(E,false)},F*200)})});D.$("#toggle-hidden").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude hidden datasets")},{mode:"include",html:_l("Include hidden datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowHidden(E,false)},F*200)})});$(window).resize(function(){D._recalcFirstColumnHeight()});var C=_.debounce(_.bind(this.checkColumnsInView,this),100);this.$(".middle").parent().scroll(C)},_recalcFirstColumnHeight:function(){var C=this.$(".history-column").first(),E=this.$(".middle").height(),D=C.find(".panel-controls").height();C.height(E).find(".inner").height(E-D)},_viewport:function(){var C=this.$(".middle").parent().offset().left;return{left:C,right:C+this.$(".middle").parent().width()}},columnsInView:function(){var C=this._viewport();return this.sortedFilteredColumns().filter(function(D){return D.currentHistory||D.inView(C.left,C.right)})},checkColumnsInView:function(){this.columnsInView().forEach(function(C){C.trigger("in-view",C)})},currentColumnDropTargetOn:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=function(D){};C.panel.dropTargetOn()},currentColumnDropTargetOff:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=l.HistoryPanelEdit.prototype.dataDrop;C.panel.dropTargetOff()},toString:function(){return"MultiPanelColumns("+(this.columns?this.columns.length:0)+")"}});return{MultiPanelColumns:m}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: UI, history multi-view: use Galaxy.options.root or galaxy_config.root for 'Done' button if available
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c171738e365b/
Changeset: c171738e365b
User: carlfeberhard
Date: 2015-02-11 18:42:12+00:00
Summary: UI, history multi-view: use Galaxy.options.root or galaxy_config.root for 'Done' button if available
Affected #: 5 files
diff -r bc6a54c340fb81096d73ea76122eca3675117df8 -r c171738e365b598c2ea43a0b09dd9c458d4431b1 client/galaxy/scripts/mvc/collection/paired-collection-creator.js
--- a/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
+++ b/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
@@ -390,6 +390,7 @@
return paired;
},
+ /** autopair by exact match */
autopairSimple : autoPairFnBuilder({
scoreThreshold: function(){ return 1.0; },
match : function _match( params ){
@@ -404,6 +405,7 @@
}
}),
+ /** autopair by levenshtein edit distance scoring */
autopairLevenshtein : autoPairFnBuilder({
scoreThreshold: function(){ return this.matchPercentage; },
match : function _matches( params ){
@@ -420,6 +422,7 @@
}
}),
+ /** autopair by longest common substrings scoring */
autopairLCS : autoPairFnBuilder({
scoreThreshold: function(){ return this.matchPercentage; },
match : function _matches( params ){
diff -r bc6a54c340fb81096d73ea76122eca3675117df8 -r c171738e365b598c2ea43a0b09dd9c458d4431b1 client/galaxy/scripts/mvc/history/multi-panel.js
--- a/client/galaxy/scripts/mvc/history/multi-panel.js
+++ b/client/galaxy/scripts/mvc/history/multi-panel.js
@@ -504,16 +504,6 @@
return this.collection.create({ current: true });
},
- ///** delete the current history */
- //deleteCurrent : function deleteCurrent(){
- // var multipanel = this,
- // currentColumn = multipanel.columnMap[ multipanel.currentHistoryId ];
- // currentColumn.model._delete()
- // .done( function(){
- // multipanel.create();
- // });
- //},
-
// ------------------------------------------------------------------------ columns
/** create columns from collection */
createColumns : function createColumns( columnOptions ){
@@ -877,7 +867,7 @@
/** */
events : {
// will move to the server root (gen. Analyze data)
- 'click .done.btn' : function(){ window.location = '/'; },
+ 'click .done.btn' : 'close',
//TODO:?? could just go back - but that's not always correct/desired behav.
//'click .done.btn' : function(){ window.history.back(); },
// creates a new empty history and makes it current
@@ -890,6 +880,17 @@
//'dragstart .list-item .title-bar' : function( e ){ console.debug( 'ok' ); }
},
+ close : function( ev ){
+ //TODO: switch to pushState/router
+ var destination = '/';
+ if( Galaxy && Galaxy.options && Galaxy.options.root ){
+ destination = Galaxy.options.root;
+ } else if( galaxy_config && galaxy_config.root ){
+ destination = galaxy_config.root;
+ }
+ window.location = destination;
+ },
+
/** Include deleted histories in the collection */
includeDeletedHistories : function(){
//TODO: better through API/limit+offset
diff -r bc6a54c340fb81096d73ea76122eca3675117df8 -r c171738e365b598c2ea43a0b09dd9c458d4431b1 static/scripts/mvc/collection/paired-collection-creator.js
--- a/static/scripts/mvc/collection/paired-collection-creator.js
+++ b/static/scripts/mvc/collection/paired-collection-creator.js
@@ -390,6 +390,7 @@
return paired;
},
+ /** autopair by exact match */
autopairSimple : autoPairFnBuilder({
scoreThreshold: function(){ return 1.0; },
match : function _match( params ){
@@ -404,6 +405,7 @@
}
}),
+ /** autopair by levenshtein edit distance scoring */
autopairLevenshtein : autoPairFnBuilder({
scoreThreshold: function(){ return this.matchPercentage; },
match : function _matches( params ){
@@ -420,6 +422,7 @@
}
}),
+ /** autopair by longest common substrings scoring */
autopairLCS : autoPairFnBuilder({
scoreThreshold: function(){ return this.matchPercentage; },
match : function _matches( params ){
diff -r bc6a54c340fb81096d73ea76122eca3675117df8 -r c171738e365b598c2ea43a0b09dd9c458d4431b1 static/scripts/mvc/history/multi-panel.js
--- a/static/scripts/mvc/history/multi-panel.js
+++ b/static/scripts/mvc/history/multi-panel.js
@@ -504,16 +504,6 @@
return this.collection.create({ current: true });
},
- ///** delete the current history */
- //deleteCurrent : function deleteCurrent(){
- // var multipanel = this,
- // currentColumn = multipanel.columnMap[ multipanel.currentHistoryId ];
- // currentColumn.model._delete()
- // .done( function(){
- // multipanel.create();
- // });
- //},
-
// ------------------------------------------------------------------------ columns
/** create columns from collection */
createColumns : function createColumns( columnOptions ){
@@ -877,7 +867,7 @@
/** */
events : {
// will move to the server root (gen. Analyze data)
- 'click .done.btn' : function(){ window.location = '/'; },
+ 'click .done.btn' : 'close',
//TODO:?? could just go back - but that's not always correct/desired behav.
//'click .done.btn' : function(){ window.history.back(); },
// creates a new empty history and makes it current
@@ -890,6 +880,17 @@
//'dragstart .list-item .title-bar' : function( e ){ console.debug( 'ok' ); }
},
+ close : function( ev ){
+ //TODO: switch to pushState/router
+ var destination = '/';
+ if( Galaxy && Galaxy.options && Galaxy.options.root ){
+ destination = Galaxy.options.root;
+ } else if( galaxy_config && galaxy_config.root ){
+ destination = galaxy_config.root;
+ }
+ window.location = destination;
+ },
+
/** Include deleted histories in the collection */
includeDeletedHistories : function(){
//TODO: better through API/limit+offset
diff -r bc6a54c340fb81096d73ea76122eca3675117df8 -r c171738e365b598c2ea43a0b09dd9c458d4431b1 static/scripts/packed/mvc/history/multi-panel.js
--- a/static/scripts/packed/mvc/history/multi-panel.js
+++ b/static/scripts/packed/mvc/history/multi-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/history/history-panel-edit","mvc/base-mvc","utils/ajax-queue","ui/mode-button","ui/search-input"],function(d,l,z,a){window.HISTORY_MODEL=d;function g(H,E){E=E||{};if(!(Galaxy&&Galaxy.modal)){return H.copy()}var F=H.get("name"),C="Copy of '"+F+"'";function D(J){if(!J){if(!Galaxy.modal.$("#invalid-title").size()){var I=$("<p/>").attr("id","invalid-title").css({color:"red","margin-top":"8px"}).addClass("bg-danger").text(_l("Please enter a valid history title"));Galaxy.modal.$(".modal-body").append(I)}return false}return J}function G(I){var J=$('<p><span class="fa fa-spinner fa-spin"></span> Copying history...</p>').css("margin-top","8px");Galaxy.modal.$(".modal-body").append(J);H.copy(true,I).fail(function(){alert(_l("History could not be copied. Please contact a Galaxy administrator"))}).always(function(){Galaxy.modal.hide()})}Galaxy.modal.show(_.extend({title:_l("Copying history")+' "'+F+'"',body:$(['<label for="copy-modal-title">',_l("Enter a title for the copied history"),":","</label><br />",'<input id="copy-modal-title" class="form-control" style="width: 100%" value="',C,'" />'].join("")),buttons:{Cancel:function(){Galaxy.modal.hide()},Copy:function(){var I=Galaxy.modal.$("#copy-modal-title").val();if(!D(I)){return}G(I)}}},E));$("#copy-modal-title").focus().select()}var B=Backbone.View.extend(z.LoggableMixin).extend({tagName:"div",className:"history-column flex-column flex-row-container",id:function q(){if(!this.model){return""}return"history-column-"+this.model.get("id")},initialize:function c(C){C=C||{};this.panel=C.panel||this.createPanel(C);this.setUpListeners()},createPanel:function u(D){D=_.extend({model:this.model,dragItems:true},D);var C=new l.HistoryPanelEdit(D);C._renderEmptyMessage=this.__patch_renderEmptyMessage;return C},__patch_renderEmptyMessage:function(E){var D=this,F=_.chain(this.model.get("state_ids")).values().flatten().value().length,C=D.$emptyMessage(E);if(!_.isEmpty(D.hdaViews)){C.hide()}else{if(F&&!this.model.contents.length){C.empty().append($('<span class="fa fa-spinner fa-spin"></span><i>loading datasets...</i>')).show()}else{if(D.searchFor){C.text(D.noneFoundMsg).show()}else{C.text(D.emptyMsg).show()}}}return C},setUpListeners:function f(){var C=this;this.once("rendered",function(){C.trigger("rendered:initial",C)});this.setUpPanelListeners()},setUpPanelListeners:function k(){var C=this;this.listenTo(this.panel,{rendered:function(){C.trigger("rendered",C)}},this)},inView:function(C,D){var F=this.$el.offset().left,E=F+this.$el.width();if(E<C){return false}if(F>D){return false}return true},$panel:function e(){return this.$(".history-panel")},render:function A(D){D=(D!==undefined)?(D):("fast");var C=this.model?this.model.toJSON():{};this.$el.html(this.template(C));this.renderPanel(D);this.setUpBehaviors();return this},setUpBehaviors:function v(){},template:function w(D){D=D||{};var C=['<div class="panel-controls clear flex-row">',this.controlsLeftTemplate(),'<div class="pull-right">','<button class="delete-history btn btn-default">',D.deleted?_l("Undelete"):_l("Delete"),"</button>",'<button class="copy-history btn btn-default">',_l("Copy"),"</button>","</div>","</div>",'<div class="inner flex-row flex-column-container">','<div id="history-',D.id,'" class="history-column history-panel flex-column"></div>',"</div>"].join("");return $(C)},controlsLeftTemplate:function(){return(this.currentHistory)?['<div class="pull-left">','<button class="create-new btn btn-default">',_l("Create new"),"</button> ","</div>"].join(""):['<div class="pull-left">','<button class="switch-to btn btn-default">',_l("Switch to"),"</button>","</div>"].join("")},renderPanel:function h(C){C=(C!==undefined)?(C):("fast");this.panel.setElement(this.$panel()).render(C);return this},events:{"click .switch-to.btn":function(){this.model.setAsCurrent()},"click .delete-history.btn":function(){var C=this,D;if(this.model.get("deleted")){D=this.model.undelete()}else{D=this.model._delete()}D.fail(function(G,E,F){alert(_l("Could not delete the history")+":\n"+F)}).done(function(E){C.render()})},"click .copy-history.btn":"copy"},copy:function s(){g(this.model)},toString:function(){return"HistoryPanelColumn("+(this.panel?this.panel:"")+")"}});var m=Backbone.View.extend(z.LoggableMixin).extend({initialize:function c(C){C=C||{};this.log(this+".init",C);if(!C.currentHistoryId){throw new Error(this+" requires a currentHistoryId in the options")}this.currentHistoryId=C.currentHistoryId;this.options={columnWidth:312,borderWidth:1,columnGap:8,headerHeight:29,footerHeight:0,controlsHeight:20};this.order=C.order||"update";this.hdaQueue=new a.NamedAjaxQueue([],false);this.collection=null;this.setCollection(C.histories||[]);this.columnMap={};this.createColumns(C.columnOptions);this.setUpListeners()},setUpListeners:function f(){},setCollection:function y(D){var C=this;C.stopListening(C.collection);C.collection=D;C.sortCollection(C.order,{silent:true});C.setUpCollectionListeners();C.trigger("new-collection",C);return C},setUpCollectionListeners:function(){var C=this,D=C.collection;C.listenTo(D,{add:C.addAsCurrentColumn,"set-as-current":C.setCurrentHistory,"change:deleted":C.handleDeletedHistory,sort:function(){C.renderColumns(0)}})},setCurrentHistory:function p(D){var C=this.columnMap[this.currentHistoryId];if(C){C.currentHistory=false;C.$el.height("")}this.currentHistoryId=D.id;var E=this.columnMap[this.currentHistoryId];E.currentHistory=true;this.sortCollection();multipanel._recalcFirstColumnHeight();return E},handleDeletedHistory:function b(D){if(D.get("deleted")){this.log("handleDeletedHistory",this.collection.includeDeleted,D);var C=this;column=C.columnMap[D.id];if(!column){return}if(column.model.id===this.currentHistoryId){}else{if(!C.collection.includeDeleted){C.removeColumn(column)}}}},sortCollection:function(C,D){C=C||this.order;var E=this.currentHistoryId;switch(C){case"name":this.collection.comparator=function(F){return[F.id!==E,F.get("name").toLowerCase()]};break;case"size":this.collection.comparator=function(F){return[F.id!==E,F.get("size")]};break;default:this.collection.comparator=function(F){return[F.id!==E,Date(F.get("update_time"))]}}this.collection.sort(D);return this.collection},setOrder:function(C){if(["update","name","size"].indexOf(C)===-1){C="update"}this.order=C;this.sortCollection();return this},create:function(C){return this.collection.create({current:true})},createColumns:function r(D){D=D||{};var C=this;this.columnMap={};C.collection.each(function(E,F){var G=C.createColumn(E,D);C.columnMap[E.id]=G})},createColumn:function t(E,C){C=_.extend({},C,{model:E});var D=new B(C);if(E.id===this.currentHistoryId){D.currentHistory=true}this.setUpColumnListeners(D);return D},sortedFilteredColumns:function(C){C=C||this.filters;if(!C||!C.length){return this.sortedColumns()}var D=this;return D.sortedColumns().filter(function(G,F){var E=G.currentHistory||_.every(C.map(function(H){return H.call(G)}));return E})},sortedColumns:function(){var D=this;var C=this.collection.map(function(F,E){return D.columnMap[F.id]});return C},addColumn:function o(E,C){C=C!==undefined?C:true;var D=this.createColumn(E);this.columnMap[E.id]=D;if(C){this.renderColumns()}return D},addAsCurrentColumn:function o(E){var D=this,C=this.addColumn(E,false);this.setCurrentHistory(E);C.once("rendered",function(){D.queueHdaFetch(C)});return C},removeColumn:function x(E,D){D=D!==undefined?D:true;this.log("removeColumn",E);if(!E){return}var F=this,C=this.options.columnWidth+this.options.columnGap;E.$el.fadeOut("fast",function(){if(D){$(this).remove();F.$(".middle").width(F.$(".middle").width()-C);F.checkColumnsInView();F._recalcFirstColumnHeight()}F.stopListening(E.panel);F.stopListening(E);delete F.columnMap[E.model.id];E.remove()})},setUpColumnListeners:function n(C){var D=this;D.listenTo(C,{"in-view":D.queueHdaFetch});D.listenTo(C.panel,{"view:draggable:dragstart":function(H,F,E,G){D._dropData=JSON.parse(H.dataTransfer.getData("text"));D.currentColumnDropTargetOn()},"view:draggable:dragend":function(H,F,E,G){D._dropData=null;D.currentColumnDropTargetOff()},"droptarget:drop":function(G,H,F){var I=D._dropData.filter(function(J){return(_.isObject(J)&&J.id&&J.model_class==="HistoryDatasetAssociation")});D._dropData=null;var E=new a.NamedAjaxQueue();I.forEach(function(J){E.add({name:"copy-"+J.id,fn:function(){return F.model.contents.copy(J.id)}})});E.start();E.done(function(J){F.model.fetch()})}})},columnMapLength:function(){return Object.keys(this.columnMap).length},render:function A(D){D=D!==undefined?D:this.fxSpeed;var C=this;C.log(C+".render");C.$el.html(C.template(C.options));C.renderColumns(D);C.setUpBehaviors();C.trigger("rendered",C);return C},template:function w(C){C=C||{};var D=[];if(this.options.headerHeight){D=D.concat(['<div class="loading-overlay flex-row"><div class="loading-overlay-message">loading...</div></div>','<div class="header flex-column-container">','<div class="header-control header-control-left flex-column">','<button class="done btn btn-default">',_l("Done"),"</button>",'<button class="include-deleted btn btn-default"></button>','<div class="order btn-group">','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',_l("Order histories by")+'... <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="javascript:void(0);" class="order-update">',_l("Time of last update"),"</a></li>",'<li><a href="javascript:void(0);" class="order-name">',_l("Name"),"</a></li>",'<li><a href="javascript:void(0);" class="order-size">',_l("Size"),"</a></li>","</ul>","</div>",'<div id="search-histories" class="header-search"></div>',"</div>",'<div class="header-control header-control-center flex-column">','<div class="header-info">',"</div>","</div>",'<div class="header-control header-control-right flex-column">','<div id="search-datasets" class="header-search"></div>','<button id="toggle-deleted" class="btn btn-default">',_l("Include deleted datasets"),"</button>",'<button id="toggle-hidden" class="btn btn-default">',_l("Include hidden datasets"),"</button>","</div>","</div>"])}D=D.concat(['<div class="outer-middle flex-row flex-row-container">','<div class="middle flex-column-container flex-row"></div>',"</div>",'<div class="footer flex-column-container">',"</div>"]);return $(D.join(""))},renderColumns:function j(F){F=F!==undefined?F:this.fxSpeed;var E=this,C=E.sortedFilteredColumns();E.$(".middle").width(C.length*(this.options.columnWidth+this.options.columnGap)+this.options.columnGap+16);var D=E.$(".middle");D.empty();C.forEach(function(H,G){H.$el.appendTo(D);H.delegateEvents();E.renderColumn(H,F)});if(this.searchFor&&C.length<=1){}else{E.checkColumnsInView();this._recalcFirstColumnHeight()}return C},renderColumn:function(C,D){D=D!==undefined?D:this.fxSpeed;return C.render(D)},queueHdaFetch:function i(E){if(E.model.contents.length===0&&!E.model.get("empty")){var C={},D=_.values(E.panel.storage.get("expandedIds")).join();if(D){C.dataset_details=D}this.hdaQueue.add({name:E.model.id,fn:function(){var F=E.model.contents.fetch({data:C,silent:true});return F.done(function(G){E.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},queueHdaFetchDetails:function(C){if((C.model.contents.length===0&&!C.model.get("empty"))||(!C.model.contents.haveDetails())){this.hdaQueue.add({name:C.model.id,fn:function(){var D=C.model.contents.fetch({data:{details:"all"},silent:true});return D.done(function(E){C.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},renderInfo:function(C){this.$(".header .header-info").text(C)},events:{"click .done.btn":function(){window.location="/"},"click .create-new.btn":"create","click .order .order-update":function(C){this.setOrder("update")},"click .order .order-name":function(C){this.setOrder("name")},"click .order .order-size":function(C){this.setOrder("size")}},includeDeletedHistories:function(){window.location+=(/\?/.test(window.location.toString()))?("&"):("?")+"include_deleted_histories=True"},excludeDeletedHistories:function(){window.location=window.location.toString().replace(/[&\?]include_deleted_histories=True/g,"")},setUpBehaviors:function(){var D=this;D.$(".include-deleted").modeButton({initialMode:this.collection.includeDeleted?"exclude":"include",switchModesOnClick:false,modes:[{mode:"include",html:_l("Include deleted histories"),onclick:_.bind(D.includeDeletedHistories,D)},{mode:"exclude",html:_l("Exclude deleted histories"),onclick:_.bind(D.excludeDeletedHistories,D)}]});D.$("#search-histories").searchInput({name:"search-histories",placeholder:_l("search histories"),onsearch:function(E){D.searchFor=E;D.filters=[function(){return this.model.matchesAll(D.searchFor)}];D.renderColumns(0)},onclear:function(E){D.searchFor=null;D.filters=[];D.renderColumns(0)}});D.$("#search-datasets").searchInput({name:"search-datasets",placeholder:_l("search all datasets"),onfirstsearch:function(E){D.hdaQueue.clear();D.$("#search-datasets").searchInput("toggle-loading");D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E);D.queueHdaFetchDetails(F)});D.hdaQueue.progress(function(F){D.renderInfo([_l("searching"),(F.curr+1),_l("of"),F.total].join(" "))});D.hdaQueue.deferred.done(function(){D.renderInfo("");D.$("#search-datasets").searchInput("toggle-loading")})},onsearch:function(E){D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E)})},onclear:function(E){D.searchFor=null;D.sortedFilteredColumns().forEach(function(F){F.panel.clearSearch()})}});D.$("#toggle-deleted").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude deleted datasets")},{mode:"include",html:_l("Include deleted datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowDeleted(E,false)},F*200)})});D.$("#toggle-hidden").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude hidden datasets")},{mode:"include",html:_l("Include hidden datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowHidden(E,false)},F*200)})});$(window).resize(function(){D._recalcFirstColumnHeight()});var C=_.debounce(_.bind(this.checkColumnsInView,this),100);this.$(".middle").parent().scroll(C)},_recalcFirstColumnHeight:function(){var C=this.$(".history-column").first(),E=this.$(".middle").height(),D=C.find(".panel-controls").height();C.height(E).find(".inner").height(E-D)},_viewport:function(){var C=this.$(".middle").parent().offset().left;return{left:C,right:C+this.$(".middle").parent().width()}},columnsInView:function(){var C=this._viewport();return this.sortedFilteredColumns().filter(function(D){return D.currentHistory||D.inView(C.left,C.right)})},checkColumnsInView:function(){this.columnsInView().forEach(function(C){C.trigger("in-view",C)})},currentColumnDropTargetOn:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=function(D){};C.panel.dropTargetOn()},currentColumnDropTargetOff:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=l.HistoryPanelEdit.prototype.dataDrop;C.panel.dropTargetOff()},toString:function(){return"MultiPanelColumns("+(this.columns?this.columns.length:0)+")"}});return{MultiPanelColumns:m}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/history/history-panel-edit","mvc/base-mvc","utils/ajax-queue","ui/mode-button","ui/search-input"],function(d,l,z,a){window.HISTORY_MODEL=d;function g(H,E){E=E||{};if(!(Galaxy&&Galaxy.modal)){return H.copy()}var F=H.get("name"),C="Copy of '"+F+"'";function D(J){if(!J){if(!Galaxy.modal.$("#invalid-title").size()){var I=$("<p/>").attr("id","invalid-title").css({color:"red","margin-top":"8px"}).addClass("bg-danger").text(_l("Please enter a valid history title"));Galaxy.modal.$(".modal-body").append(I)}return false}return J}function G(I){var J=$('<p><span class="fa fa-spinner fa-spin"></span> Copying history...</p>').css("margin-top","8px");Galaxy.modal.$(".modal-body").append(J);H.copy(true,I).fail(function(){alert(_l("History could not be copied. Please contact a Galaxy administrator"))}).always(function(){Galaxy.modal.hide()})}Galaxy.modal.show(_.extend({title:_l("Copying history")+' "'+F+'"',body:$(['<label for="copy-modal-title">',_l("Enter a title for the copied history"),":","</label><br />",'<input id="copy-modal-title" class="form-control" style="width: 100%" value="',C,'" />'].join("")),buttons:{Cancel:function(){Galaxy.modal.hide()},Copy:function(){var I=Galaxy.modal.$("#copy-modal-title").val();if(!D(I)){return}G(I)}}},E));$("#copy-modal-title").focus().select()}var B=Backbone.View.extend(z.LoggableMixin).extend({tagName:"div",className:"history-column flex-column flex-row-container",id:function q(){if(!this.model){return""}return"history-column-"+this.model.get("id")},initialize:function c(C){C=C||{};this.panel=C.panel||this.createPanel(C);this.setUpListeners()},createPanel:function u(D){D=_.extend({model:this.model,dragItems:true},D);var C=new l.HistoryPanelEdit(D);C._renderEmptyMessage=this.__patch_renderEmptyMessage;return C},__patch_renderEmptyMessage:function(E){var D=this,F=_.chain(this.model.get("state_ids")).values().flatten().value().length,C=D.$emptyMessage(E);if(!_.isEmpty(D.hdaViews)){C.hide()}else{if(F&&!this.model.contents.length){C.empty().append($('<span class="fa fa-spinner fa-spin"></span><i>loading datasets...</i>')).show()}else{if(D.searchFor){C.text(D.noneFoundMsg).show()}else{C.text(D.emptyMsg).show()}}}return C},setUpListeners:function f(){var C=this;this.once("rendered",function(){C.trigger("rendered:initial",C)});this.setUpPanelListeners()},setUpPanelListeners:function k(){var C=this;this.listenTo(this.panel,{rendered:function(){C.trigger("rendered",C)}},this)},inView:function(C,D){var F=this.$el.offset().left,E=F+this.$el.width();if(E<C){return false}if(F>D){return false}return true},$panel:function e(){return this.$(".history-panel")},render:function A(D){D=(D!==undefined)?(D):("fast");var C=this.model?this.model.toJSON():{};this.$el.html(this.template(C));this.renderPanel(D);this.setUpBehaviors();return this},setUpBehaviors:function v(){},template:function w(D){D=D||{};var C=['<div class="panel-controls clear flex-row">',this.controlsLeftTemplate(),'<div class="pull-right">','<button class="delete-history btn btn-default">',D.deleted?_l("Undelete"):_l("Delete"),"</button>",'<button class="copy-history btn btn-default">',_l("Copy"),"</button>","</div>","</div>",'<div class="inner flex-row flex-column-container">','<div id="history-',D.id,'" class="history-column history-panel flex-column"></div>',"</div>"].join("");return $(C)},controlsLeftTemplate:function(){return(this.currentHistory)?['<div class="pull-left">','<button class="create-new btn btn-default">',_l("Create new"),"</button> ","</div>"].join(""):['<div class="pull-left">','<button class="switch-to btn btn-default">',_l("Switch to"),"</button>","</div>"].join("")},renderPanel:function h(C){C=(C!==undefined)?(C):("fast");this.panel.setElement(this.$panel()).render(C);return this},events:{"click .switch-to.btn":function(){this.model.setAsCurrent()},"click .delete-history.btn":function(){var C=this,D;if(this.model.get("deleted")){D=this.model.undelete()}else{D=this.model._delete()}D.fail(function(G,E,F){alert(_l("Could not delete the history")+":\n"+F)}).done(function(E){C.render()})},"click .copy-history.btn":"copy"},copy:function s(){g(this.model)},toString:function(){return"HistoryPanelColumn("+(this.panel?this.panel:"")+")"}});var m=Backbone.View.extend(z.LoggableMixin).extend({initialize:function c(C){C=C||{};this.log(this+".init",C);if(!C.currentHistoryId){throw new Error(this+" requires a currentHistoryId in the options")}this.currentHistoryId=C.currentHistoryId;this.options={columnWidth:312,borderWidth:1,columnGap:8,headerHeight:29,footerHeight:0,controlsHeight:20};this.order=C.order||"update";this.hdaQueue=new a.NamedAjaxQueue([],false);this.collection=null;this.setCollection(C.histories||[]);this.columnMap={};this.createColumns(C.columnOptions);this.setUpListeners()},setUpListeners:function f(){},setCollection:function y(D){var C=this;C.stopListening(C.collection);C.collection=D;C.sortCollection(C.order,{silent:true});C.setUpCollectionListeners();C.trigger("new-collection",C);return C},setUpCollectionListeners:function(){var C=this,D=C.collection;C.listenTo(D,{add:C.addAsCurrentColumn,"set-as-current":C.setCurrentHistory,"change:deleted":C.handleDeletedHistory,sort:function(){C.renderColumns(0)}})},setCurrentHistory:function p(D){var C=this.columnMap[this.currentHistoryId];if(C){C.currentHistory=false;C.$el.height("")}this.currentHistoryId=D.id;var E=this.columnMap[this.currentHistoryId];E.currentHistory=true;this.sortCollection();multipanel._recalcFirstColumnHeight();return E},handleDeletedHistory:function b(D){if(D.get("deleted")){this.log("handleDeletedHistory",this.collection.includeDeleted,D);var C=this;column=C.columnMap[D.id];if(!column){return}if(column.model.id===this.currentHistoryId){}else{if(!C.collection.includeDeleted){C.removeColumn(column)}}}},sortCollection:function(C,D){C=C||this.order;var E=this.currentHistoryId;switch(C){case"name":this.collection.comparator=function(F){return[F.id!==E,F.get("name").toLowerCase()]};break;case"size":this.collection.comparator=function(F){return[F.id!==E,F.get("size")]};break;default:this.collection.comparator=function(F){return[F.id!==E,Date(F.get("update_time"))]}}this.collection.sort(D);return this.collection},setOrder:function(C){if(["update","name","size"].indexOf(C)===-1){C="update"}this.order=C;this.sortCollection();return this},create:function(C){return this.collection.create({current:true})},createColumns:function r(D){D=D||{};var C=this;this.columnMap={};C.collection.each(function(E,F){var G=C.createColumn(E,D);C.columnMap[E.id]=G})},createColumn:function t(E,C){C=_.extend({},C,{model:E});var D=new B(C);if(E.id===this.currentHistoryId){D.currentHistory=true}this.setUpColumnListeners(D);return D},sortedFilteredColumns:function(C){C=C||this.filters;if(!C||!C.length){return this.sortedColumns()}var D=this;return D.sortedColumns().filter(function(G,F){var E=G.currentHistory||_.every(C.map(function(H){return H.call(G)}));return E})},sortedColumns:function(){var D=this;var C=this.collection.map(function(F,E){return D.columnMap[F.id]});return C},addColumn:function o(E,C){C=C!==undefined?C:true;var D=this.createColumn(E);this.columnMap[E.id]=D;if(C){this.renderColumns()}return D},addAsCurrentColumn:function o(E){var D=this,C=this.addColumn(E,false);this.setCurrentHistory(E);C.once("rendered",function(){D.queueHdaFetch(C)});return C},removeColumn:function x(E,D){D=D!==undefined?D:true;this.log("removeColumn",E);if(!E){return}var F=this,C=this.options.columnWidth+this.options.columnGap;E.$el.fadeOut("fast",function(){if(D){$(this).remove();F.$(".middle").width(F.$(".middle").width()-C);F.checkColumnsInView();F._recalcFirstColumnHeight()}F.stopListening(E.panel);F.stopListening(E);delete F.columnMap[E.model.id];E.remove()})},setUpColumnListeners:function n(C){var D=this;D.listenTo(C,{"in-view":D.queueHdaFetch});D.listenTo(C.panel,{"view:draggable:dragstart":function(H,F,E,G){D._dropData=JSON.parse(H.dataTransfer.getData("text"));D.currentColumnDropTargetOn()},"view:draggable:dragend":function(H,F,E,G){D._dropData=null;D.currentColumnDropTargetOff()},"droptarget:drop":function(G,H,F){var I=D._dropData.filter(function(J){return(_.isObject(J)&&J.id&&J.model_class==="HistoryDatasetAssociation")});D._dropData=null;var E=new a.NamedAjaxQueue();I.forEach(function(J){E.add({name:"copy-"+J.id,fn:function(){return F.model.contents.copy(J.id)}})});E.start();E.done(function(J){F.model.fetch()})}})},columnMapLength:function(){return Object.keys(this.columnMap).length},render:function A(D){D=D!==undefined?D:this.fxSpeed;var C=this;C.log(C+".render");C.$el.html(C.template(C.options));C.renderColumns(D);C.setUpBehaviors();C.trigger("rendered",C);return C},template:function w(C){C=C||{};var D=[];if(this.options.headerHeight){D=D.concat(['<div class="loading-overlay flex-row"><div class="loading-overlay-message">loading...</div></div>','<div class="header flex-column-container">','<div class="header-control header-control-left flex-column">','<button class="done btn btn-default">',_l("Done"),"</button>",'<button class="include-deleted btn btn-default"></button>','<div class="order btn-group">','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',_l("Order histories by")+'... <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="javascript:void(0);" class="order-update">',_l("Time of last update"),"</a></li>",'<li><a href="javascript:void(0);" class="order-name">',_l("Name"),"</a></li>",'<li><a href="javascript:void(0);" class="order-size">',_l("Size"),"</a></li>","</ul>","</div>",'<div id="search-histories" class="header-search"></div>',"</div>",'<div class="header-control header-control-center flex-column">','<div class="header-info">',"</div>","</div>",'<div class="header-control header-control-right flex-column">','<div id="search-datasets" class="header-search"></div>','<button id="toggle-deleted" class="btn btn-default">',_l("Include deleted datasets"),"</button>",'<button id="toggle-hidden" class="btn btn-default">',_l("Include hidden datasets"),"</button>","</div>","</div>"])}D=D.concat(['<div class="outer-middle flex-row flex-row-container">','<div class="middle flex-column-container flex-row"></div>',"</div>",'<div class="footer flex-column-container">',"</div>"]);return $(D.join(""))},renderColumns:function j(F){F=F!==undefined?F:this.fxSpeed;var E=this,C=E.sortedFilteredColumns();E.$(".middle").width(C.length*(this.options.columnWidth+this.options.columnGap)+this.options.columnGap+16);var D=E.$(".middle");D.empty();C.forEach(function(H,G){H.$el.appendTo(D);H.delegateEvents();E.renderColumn(H,F)});if(this.searchFor&&C.length<=1){}else{E.checkColumnsInView();this._recalcFirstColumnHeight()}return C},renderColumn:function(C,D){D=D!==undefined?D:this.fxSpeed;return C.render(D)},queueHdaFetch:function i(E){if(E.model.contents.length===0&&!E.model.get("empty")){var C={},D=_.values(E.panel.storage.get("expandedIds")).join();if(D){C.dataset_details=D}this.hdaQueue.add({name:E.model.id,fn:function(){var F=E.model.contents.fetch({data:C,silent:true});return F.done(function(G){E.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},queueHdaFetchDetails:function(C){if((C.model.contents.length===0&&!C.model.get("empty"))||(!C.model.contents.haveDetails())){this.hdaQueue.add({name:C.model.id,fn:function(){var D=C.model.contents.fetch({data:{details:"all"},silent:true});return D.done(function(E){C.panel.renderItems()})}});if(!this.hdaQueue.running){this.hdaQueue.start()}}},renderInfo:function(C){this.$(".header .header-info").text(C)},events:{"click .done.btn":"close","click .create-new.btn":"create","click .order .order-update":function(C){this.setOrder("update")},"click .order .order-name":function(C){this.setOrder("name")},"click .order .order-size":function(C){this.setOrder("size")}},close:function(D){var C="/";if(Galaxy&&Galaxy.options&&Galaxy.options.root){C=Galaxy.options.root}else{if(galaxy_config&&galaxy_config.root){C=galaxy_config.root}}window.location=C},includeDeletedHistories:function(){window.location+=(/\?/.test(window.location.toString()))?("&"):("?")+"include_deleted_histories=True"},excludeDeletedHistories:function(){window.location=window.location.toString().replace(/[&\?]include_deleted_histories=True/g,"")},setUpBehaviors:function(){var D=this;D.$(".include-deleted").modeButton({initialMode:this.collection.includeDeleted?"exclude":"include",switchModesOnClick:false,modes:[{mode:"include",html:_l("Include deleted histories"),onclick:_.bind(D.includeDeletedHistories,D)},{mode:"exclude",html:_l("Exclude deleted histories"),onclick:_.bind(D.excludeDeletedHistories,D)}]});D.$("#search-histories").searchInput({name:"search-histories",placeholder:_l("search histories"),onsearch:function(E){D.searchFor=E;D.filters=[function(){return this.model.matchesAll(D.searchFor)}];D.renderColumns(0)},onclear:function(E){D.searchFor=null;D.filters=[];D.renderColumns(0)}});D.$("#search-datasets").searchInput({name:"search-datasets",placeholder:_l("search all datasets"),onfirstsearch:function(E){D.hdaQueue.clear();D.$("#search-datasets").searchInput("toggle-loading");D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E);D.queueHdaFetchDetails(F)});D.hdaQueue.progress(function(F){D.renderInfo([_l("searching"),(F.curr+1),_l("of"),F.total].join(" "))});D.hdaQueue.deferred.done(function(){D.renderInfo("");D.$("#search-datasets").searchInput("toggle-loading")})},onsearch:function(E){D.searchFor=E;D.sortedFilteredColumns().forEach(function(F){F.panel.searchItems(E)})},onclear:function(E){D.searchFor=null;D.sortedFilteredColumns().forEach(function(F){F.panel.clearSearch()})}});D.$("#toggle-deleted").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude deleted datasets")},{mode:"include",html:_l("Include deleted datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowDeleted(E,false)},F*200)})});D.$("#toggle-hidden").modeButton({initialMode:"include",modes:[{mode:"exclude",html:_l("Exclude hidden datasets")},{mode:"include",html:_l("Include hidden datasets")}]}).click(function(){var E=$(this).modeButton("getMode").mode==="exclude";D.sortedFilteredColumns().forEach(function(G,F){_.delay(function(){G.panel.toggleShowHidden(E,false)},F*200)})});$(window).resize(function(){D._recalcFirstColumnHeight()});var C=_.debounce(_.bind(this.checkColumnsInView,this),100);this.$(".middle").parent().scroll(C)},_recalcFirstColumnHeight:function(){var C=this.$(".history-column").first(),E=this.$(".middle").height(),D=C.find(".panel-controls").height();C.height(E).find(".inner").height(E-D)},_viewport:function(){var C=this.$(".middle").parent().offset().left;return{left:C,right:C+this.$(".middle").parent().width()}},columnsInView:function(){var C=this._viewport();return this.sortedFilteredColumns().filter(function(D){return D.currentHistory||D.inView(C.left,C.right)})},checkColumnsInView:function(){this.columnsInView().forEach(function(C){C.trigger("in-view",C)})},currentColumnDropTargetOn:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=function(D){};C.panel.dropTargetOn()},currentColumnDropTargetOff:function(){var C=this.columnMap[this.currentHistoryId];if(!C){return}C.panel.dataDropped=l.HistoryPanelEdit.prototype.dataDrop;C.panel.dropTargetOff()},toString:function(){return"MultiPanelColumns("+(this.columns?this.columns.length:0)+")"}});return{MultiPanelColumns:m}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fdb5e1329ef2/
Changeset: fdb5e1329ef2
User: carlfeberhard
Date: 2015-02-11 18:15:53+00:00
Summary: UI, paired collection creator: add metrics for init, creation, and filter-change
Affected #: 3 files
diff -r 86ac99a2896b87915e35b81db1320fdfe73bf556 -r fdb5e1329ef2de9a712f5139bcd71ee4ac278f24 client/galaxy/scripts/mvc/collection/paired-collection-creator.js
--- a/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
+++ b/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
@@ -188,6 +188,7 @@
/** set up initial options, instance vars, behaviors, and autopair (if set to do so) */
initialize : function( attributes ){
+ this.metric( 'PairedCollectionCreator.initialize', attributes );
//this.debug( '-- PairedCollectionCreator:', attributes );
attributes = _.defaults( attributes, {
@@ -584,6 +585,7 @@
.done( function( response, message, xhr ){
//this.info( 'ok', response, message, xhr );
creator.trigger( 'collection:created', response, message, xhr );
+ creator.metric( 'collection:created', response );
if( typeof creator.oncreate === 'function' ){
creator.oncreate.call( this, response, message, xhr );
}
@@ -883,6 +885,7 @@
this.$( '.forward-unpaired-filter input' ).val(),
this.$( '.reverse-unpaired-filter input' ).val()
];
+ this.metric( 'filter-change', this.filters );
this._renderFilters();
this._renderUnpaired();
});
@@ -1028,12 +1031,14 @@
/** unpair all paired and do other super neat stuff which I'm not really sure about yet... */
_clickUnpairAll : function( ev ){
+ this.metric( 'unpairAll' );
this.unpairAll();
},
/** attempt to autopair */
_clickAutopair : function( ev ){
- this.autoPair();
+ var paired = this.autoPair();
+ this.metric( 'autopair', paired.length, this.unpaired.length );
this.trigger( 'autopair' );
},
diff -r 86ac99a2896b87915e35b81db1320fdfe73bf556 -r fdb5e1329ef2de9a712f5139bcd71ee4ac278f24 static/scripts/mvc/collection/paired-collection-creator.js
--- a/static/scripts/mvc/collection/paired-collection-creator.js
+++ b/static/scripts/mvc/collection/paired-collection-creator.js
@@ -188,6 +188,7 @@
/** set up initial options, instance vars, behaviors, and autopair (if set to do so) */
initialize : function( attributes ){
+ this.metric( 'PairedCollectionCreator.initialize', attributes );
//this.debug( '-- PairedCollectionCreator:', attributes );
attributes = _.defaults( attributes, {
@@ -584,6 +585,7 @@
.done( function( response, message, xhr ){
//this.info( 'ok', response, message, xhr );
creator.trigger( 'collection:created', response, message, xhr );
+ creator.metric( 'collection:created', response );
if( typeof creator.oncreate === 'function' ){
creator.oncreate.call( this, response, message, xhr );
}
@@ -883,6 +885,7 @@
this.$( '.forward-unpaired-filter input' ).val(),
this.$( '.reverse-unpaired-filter input' ).val()
];
+ this.metric( 'filter-change', this.filters );
this._renderFilters();
this._renderUnpaired();
});
@@ -1028,12 +1031,14 @@
/** unpair all paired and do other super neat stuff which I'm not really sure about yet... */
_clickUnpairAll : function( ev ){
+ this.metric( 'unpairAll' );
this.unpairAll();
},
/** attempt to autopair */
_clickAutopair : function( ev ){
- this.autoPair();
+ var paired = this.autoPair();
+ this.metric( 'autopair', paired.length, this.unpaired.length );
this.trigger( 'autopair' );
},
diff -r 86ac99a2896b87915e35b81db1320fdfe73bf556 -r fdb5e1329ef2de9a712f5139bcd71ee4ac278f24 static/scripts/packed/mvc/collection/paired-collection-creator.js
--- a/static/scripts/packed/mvc/collection/paired-collection-creator.js
+++ b/static/scripts/packed/mvc/collection/paired-collection-creator.js
@@ -1,1 +1,1 @@
-define(["utils/levenshtein","utils/natural-sort","mvc/base-mvc","utils/localization"],function(h,b,f,c){var i=Backbone.View.extend(f.LoggableMixin).extend({tagName:"li",className:"dataset paired",initialize:function(l){this.pair=l.pair||{}},template:_.template(['<span class="forward-dataset-name flex-column"><%= pair.forward.name %></span>','<span class="pair-name-column flex-column">','<span class="pair-name"><%= pair.name %></span>',"</span>",'<span class="reverse-dataset-name flex-column"><%= pair.reverse.name %></span>'].join("")),render:function(){this.$el.attr("draggable",true).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container");return this},events:{dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(l){l.currentTarget.style.opacity="0.4";if(l.originalEvent){l=l.originalEvent}l.dataTransfer.effectAllowed="move";l.dataTransfer.setData("text/plain",JSON.stringify(this.pair));this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(l){l.currentTarget.style.opacity="1.0";this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(l){this.$el.parent().trigger(l)},toString:function(){return"PairView("+this.pair.name+")"}});function g(m){m=m||{};m.createPair=m.createPair||function l(r){this.debug("creating pair:",r.listA[r.indexA].name,r.listB[r.indexB].name);r=r||{};return this._pair(r.listA.splice(r.indexA,1)[0],r.listB.splice(r.indexB,1)[0],{silent:true})};var o=[];function q(){if(!o.length){o=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]}return o}m.preprocessMatch=m.preprocessMatch||function n(s){var r=q.call(this);return _.extend(s,{matchTo:s.matchTo.name.replace(r[0],""),possible:s.possible.name.replace(r[1],"")})};return function p(t){this.debug("autopair _strategy ---------------------------");t=t||{};var r=t.listA,A=t.listB,z=0,y,v={score:0,index:null},x=[];this.debug("starting list lens:",r.length,A.length);this.debug("bestMatch (starting):",JSON.stringify(v,null," "));while(z<r.length){var w=r[z];v.score=0;for(y=0;y<A.length;y++){var u=A[y];this.debug(z+":"+w.name);this.debug(y+":"+u.name);if(r[z]!==A[y]){v=m.match.call(this,m.preprocessMatch.call(this,{matchTo:w,possible:u,index:y,bestMatch:v}));this.debug("bestMatch:",JSON.stringify(v,null," "));if(v.score===1){this.debug("breaking early due to perfect match");break}}}var s=m.scoreThreshold.call(this);this.debug("scoreThreshold:",s);this.debug("bestMatch.score:",v.score);if(v.score>=s){this.debug("creating pair");x.push(m.createPair.call(this,{listA:r,indexA:z,listB:A,indexB:v.index}));this.debug("list lens now:",r.length,A.length)}else{z+=1}if(!r.length||!A.length){return x}}this.debug("paired:",JSON.stringify(x,null," "));this.debug("autopair _strategy ---------------------------");return x}}var k=Backbone.View.extend(f.LoggableMixin).extend({className:"collection-creator flex-row-container",initialize:function(l){l=_.defaults(l,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:true,strategy:"lcs",matchPercentage:0.9,twoPassAutopairing:true});this.initialList=l.datasets;this.historyId=l.historyId;this.filters=this.commonFilters[l.filters]||this.commonFilters[this.DEFAULT_FILTERS];if(_.isArray(l.filters)){this.filters=l.filters}this.automaticallyPair=l.automaticallyPair;this.strategy=this.strategies[l.strategy]||this.strategies[this.DEFAULT_STRATEGY];if(_.isFunction(l.strategy)){this.strategy=l.strategy}this.matchPercentage=l.matchPercentage;this.twoPassAutopairing=l.twoPassAutopairing;this.removeExtensions=true;this.oncancel=l.oncancel;this.oncreate=l.oncreate;this.autoscrollDist=l.autoscrollDist||24;this.unpairedPanelHidden=false;this.pairedPanelHidden=false;this.$dragging=null;this._setUpBehaviors();this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[];this.unpaired=[];this.selectedIds=[];this._sortInitialList();this._ensureIds();this.unpaired=this.initialList.slice(0);if(this.automaticallyPair){this.autoPair();this.once("rendered:initial",function(){this.trigger("autopair")})}},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(l){l.sort(function(n,m){return b(n.name,m.name)});return l},_ensureIds:function(){this.initialList.forEach(function(l){if(!l.hasOwnProperty("id")){l.id=_.uniqueId()}});return this.initialList},_splitByFilters:function(){var o=this.filters.map(function(p){return new RegExp(p)}),m=[[],[]];function n(p,q){return q.test(p.name)}this.unpaired.forEach(function l(p){o.forEach(function(r,q){if(n(p,r)){m[q].push(p)}})});return m},_addToUnpaired:function(m){var l=function(n,p){if(n===p){return n}var o=Math.floor((p-n)/2)+n,q=b(m.name,this.unpaired[o].name);if(q<0){return l(n,o)}else{if(q>0){return l(o+1,p)}}while(this.unpaired[o]&&this.unpaired[o].name===m.name){o++}return o}.bind(this);this.unpaired.splice(l(0,this.unpaired.length),0,m)},autoPair:function(n){var m=this._splitByFilters(),l=[];if(this.twoPassAutopairing){l=this.autopairSimple({listA:m[0],listB:m[1]});m=this._splitByFilters()}n=n||this.strategy;m=this._splitByFilters();l=l.concat(this[n].call(this,{listA:m[0],listB:m[1]}));return l},autopairSimple:g({scoreThreshold:function(){return 1},match:function j(l){l=l||{};if(l.matchTo===l.possible){return{index:l.index,score:1}}return l.bestMatch}}),autopairLevenshtein:g({scoreThreshold:function(){return this.matchPercentage},match:function e(m){m=m||{};var n=h(m.matchTo,m.possible),l=1-(n/(Math.max(m.matchTo.length,m.possible.length)));if(l>m.bestMatch.score){return{index:m.index,score:l}}return m.bestMatch}}),autopairLCS:g({scoreThreshold:function(){return this.matchPercentage},match:function e(n){n=n||{};var l=this._naiveStartingAndEndingLCS(n.matchTo,n.possible).length,m=l/(Math.max(n.matchTo.length,n.possible.length));if(m>n.bestMatch.score){return{index:n.index,score:m}}return n.bestMatch}}),_naiveStartingAndEndingLCS:function(o,m){var p="",q="",n=0,l=0;while(n<o.length&&n<m.length){if(o[n]!==m[n]){break}p+=o[n];n+=1}if(n===o.length){return o}if(n===m.length){return m}n=(o.length-1);l=(m.length-1);while(n>=0&&l>=0){if(o[n]!==m[l]){break}q=[o[n],q].join("");n-=1;l-=1}return p+q},_pair:function(n,l,m){m=m||{};var o=this._createPair(n,l,m.name);this.paired.push(o);this.unpaired=_.without(this.unpaired,n,l);if(!m.silent){this.trigger("pair:new",o)}return o},_createPair:function(n,l,m){if(!(n&&l)||(n===l)){throw new Error("Bad pairing: "+[JSON.stringify(n),JSON.stringify(l)])}m=m||this._guessNameForPair(n,l);return{forward:n,name:m,reverse:l}},_guessNameForPair:function(o,m,q){q=(q!==undefined)?(q):(this.removeExtensions);var l=o.name,p=m.name,n=this._naiveStartingAndEndingLCS(l.replace(this.filters[0],""),p.replace(this.filters[1],""));if(q){var r=n.lastIndexOf(".");if(r>0){var s=n.slice(r,n.length);n=n.replace(s,"");l=l.replace(s,"");p=p.replace(s,"")}}return n||(l+" & "+p)},_unpair:function(m,l){l=l||{};if(!m){throw new Error("Bad pair: "+JSON.stringify(m))}this.paired=_.without(this.paired,m);this._addToUnpaired(m.forward);this._addToUnpaired(m.reverse);if(!l.silent){this.trigger("pair:unpair",[m])}return m},unpairAll:function(){var l=[];while(this.paired.length){l.push(this._unpair(this.paired[0],{silent:true}))}this.trigger("pair:unpair",l)},_pairToJSON:function(m,l){l=l||"hda";return{collection_type:"paired",src:"new_collection",name:m.name,element_identifiers:[{name:"forward",id:m.forward.id,src:l},{name:"reverse",id:m.reverse.id,src:l}]}},createList:function(n){var o=this,m="/api/histories/"+this.historyId+"/contents/dataset_collections";var l={type:"dataset_collection",collection_type:"list:paired",name:_.escape(n||o.$(".collection-name").val()),element_identifiers:o.paired.map(function(p){return o._pairToJSON(p)})};return jQuery.ajax(m,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(l)}).fail(function(r,p,q){o._ajaxErrHandler(r,p,q)}).done(function(p,q,r){o.trigger("collection:created",p,q,r);if(typeof o.oncreate==="function"){o.oncreate.call(this,p,q,r)}})},_ajaxErrHandler:function(o,l,n){this.error(o,l,n);var m=c("An error occurred while creating this collection");if(o){if(o.readyState===0&&o.status===0){m+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes.")}else{if(o.responseJSON){m+="<br /><pre>"+JSON.stringify(o.responseJSON)+"</pre>"}else{m+=": "+n}}}creator._showAlert(m,"alert-danger")},render:function(l,m){this.$el.empty().html(k.templates.main());this._renderHeader(l);this._renderMiddle(l);this._renderFooter(l);this._addPluginComponents();this.trigger("rendered",this);return this},_renderHeader:function(m,n){var l=this.$(".header").empty().html(k.templates.header()).find(".help-content").prepend($(k.templates.helpContent()));this._renderFilters();return l},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(m,n){var l=this.$(".middle").empty().html(k.templates.middle());if(this.unpairedPanelHidden){this.$(".unpaired-columns").hide()}else{if(this.pairedPanelHidden){this.$(".paired-columns").hide()}}this._renderUnpaired();this._renderPaired();return l},_renderUnpaired:function(q,r){var o=this,p,m,l=[],n=this._splitByFilters();this.$(".forward-column .title").text([n[0].length,c("unpaired forward")].join(" "));this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[0].length));this.$(".reverse-column .title").text([n[1].length,c("unpaired reverse")].join(" "));this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[1].length));this.$(".unpaired-columns .column-datasets").empty();this.$(".autopair-link").toggle(this.unpaired.length!==0);if(this.unpaired.length===0){this._renderUnpairedEmpty();return}m=n[1].map(function(t,s){if((n[0][s]!==undefined)&&(n[0][s]!==t)){l.push(o._renderPairButton())}return o._renderUnpairedDataset(t)});p=n[0].map(function(s){return o._renderUnpairedDataset(s)});if(!p.length&&!m.length){this._renderUnpairedNotShown();return}this.$(".unpaired-columns .forward-column .column-datasets").append(p).add(this.$(".unpaired-columns .paired-column .column-datasets").append(l)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(m));this._adjUnpairedOnScrollbar()},_renderUnpairedDisplayStr:function(l){return["(",l," ",c("filtered out"),")"].join("")},_renderUnpairedDataset:function(l){return $("<li/>").attr("id","dataset-"+l.id).addClass("dataset unpaired").attr("draggable",true).addClass(l.selected?"selected":"").append($("<span/>").addClass("dataset-name").text(l.name)).data("dataset",l)},_renderPairButton:function(){return $("<li/>").addClass("dataset unpaired").append($("<span/>").addClass("dataset-name").text(c("Pair these datasets")))},_renderUnpairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no remaining unpaired datasets")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_renderUnpairedNotShown:function(){var l=$('<div class="empty-message"></div>').text("("+c("no datasets were found matching the current filters")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_adjUnpairedOnScrollbar:function(){var o=this.$(".unpaired-columns").last(),p=this.$(".unpaired-columns .reverse-column .dataset").first();if(!p.size()){return}var l=o.offset().left+o.outerWidth(),n=p.offset().left+p.outerWidth(),m=Math.floor(l)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",(m>0)?m:0)},_renderPaired:function(m,n){this.$(".paired-column-title .title").text([this.paired.length,c("paired")].join(" "));this.$(".unpair-all-link").toggle(this.paired.length!==0);if(this.paired.length===0){this._renderPairedEmpty();return}else{this.$(".remove-extensions-link").show()}this.$(".paired-columns .column-datasets").empty();var l=this;this.paired.forEach(function(q,o){var p=new i({pair:q});l.$(".paired-columns .column-datasets").append(p.render().$el).append(['<button class="unpair-btn">','<span class="fa fa-unlink" title="',c("Unpair"),'"></span>',"</button>"].join(""))})},_renderPairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no paired datasets yet")+")");this.$(".paired-columns .column-datasets").empty().prepend(l);return l},_renderFooter:function(m,n){var l=this.$(".footer").empty().html(k.templates.footer());this.$(".remove-extensions").prop("checked",this.removeExtensions);if(typeof this.oncancel==="function"){this.$(".cancel-create.btn").show()}return l},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link");this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(l){function m(p,o){return['<button class="filter-choice btn" ','data-forward="',p,'" data-reverse="',o,'">',c("Forward"),": ",p,", ",c("Reverse"),": ",o,"</button>"].join("")}var n=$(_.template(['<div class="choose-filters">','<div class="help">',c("Choose from the following filters to change which unpaired reads are shown in the display"),":</div>",_.values(this.commonFilters).map(function(o){return m(o[0],o[1])}).join(""),"</div>"].join(""))({}));return this.$(l).popover({container:".collection-creator",placement:"bottom",html:true,content:n})},_validationWarning:function(m,l){var n="validation-warning";if(m==="name"){m=this.$(".collection-name").add(this.$(".collection-name-prompt"));this.$(".collection-name").focus().select()}if(l){m=m||this.$("."+n);m.removeClass(n)}else{m.addClass(n)}},_setUpBehaviors:function(){this.once("rendered",function(){this.trigger("rendered:initial",this)});this.on("pair:new",function(){this._renderUnpaired();this._renderPaired();this.$(".paired-columns").scrollTop(8000000)});this.on("pair:unpair",function(l){this._renderUnpaired();this._renderPaired();this.splitView()});this.on("filter-change",function(){this.filters=[this.$(".forward-unpaired-filter input").val(),this.$(".reverse-unpaired-filter input").val()];this._renderFilters();this._renderUnpaired()});this.on("autopair",function(){this._renderUnpaired();this._renderPaired();var l,m=null;if(this.paired.length){m="alert-success";l=this.paired.length+" "+c("pairs created");if(!this.unpaired.length){l+=": "+c("all datasets have been successfully paired");this.hideUnpaired();this.$(".collection-name").focus()}}else{l=c("Could not automatically create any pairs from the given dataset names")}this._showAlert(l,m)});return this},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .header .alert button":"_hideAlert","click .forward-column .column-title":"_clickShowOnlyUnpaired","click .reverse-column .column-title":"_clickShowOnlyUnpaired","click .unpair-all-link":"_clickUnpairAll","change .forward-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .forward-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .autopair-link":"_clickAutopair","click .choose-filters .filter-choice":"_clickFilterChoice","click .clear-filters-link":"_clearFilters","change .reverse-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .reverse-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .forward-column .dataset.unpaired":"_clickUnpairedDataset","click .reverse-column .dataset.unpaired":"_clickUnpairedDataset","click .paired-column .dataset.unpaired":"_clickPairRow","click .unpaired-columns":"clearSelectedUnpaired","mousedown .unpaired-columns .dataset":"_mousedownUnpaired","click .paired-column-title":"_clickShowOnlyPaired","mousedown .flexible-partition-drag":"_startPartitionDrag","click .paired-columns .dataset.paired":"selectPair","click .paired-columns":"clearSelectedPaired","click .paired-columns .pair-name":"_clickPairName","click .unpair-btn":"_clickUnpair","dragover .paired-columns .column-datasets":"_dragoverPairedColumns","drop .paired-columns .column-datasets":"_dropPairedColumns","pair.dragstart .paired-columns .column-datasets":"_pairDragstart","pair.dragend .paired-columns .column-datasets":"_pairDragend","change .remove-extensions":function(l){this.toggleExtensions()},"change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","click .cancel-create":function(l){if(typeof this.oncancel==="function"){this.oncancel.call(this)}},"click .create-collection":"_clickCreate"},_clickMoreHelp:function(l){this.$(".main-help").addClass("expanded");this.$(".more-help").hide()},_clickLessHelp:function(l){this.$(".main-help").removeClass("expanded");this.$(".more-help").show()},_showAlert:function(m,l){l=l||"alert-danger";this.$(".main-help").hide();this.$(".header .alert").attr("class","alert alert-dismissable").addClass(l).show().find(".alert-message").html(m)},_hideAlert:function(l){this.$(".main-help").show();this.$(".header .alert").hide()},_clickShowOnlyUnpaired:function(l){if(this.$(".paired-columns").is(":visible")){this.hidePaired()}else{this.splitView()}},_clickShowOnlyPaired:function(l){if(this.$(".unpaired-columns").is(":visible")){this.hideUnpaired()}else{this.splitView()}},hideUnpaired:function(l,m){this.unpairedPanelHidden=true;this.pairedPanelHidden=false;this._renderMiddle(l,m)},hidePaired:function(l,m){this.unpairedPanelHidden=false;this.pairedPanelHidden=true;this._renderMiddle(l,m)},splitView:function(l,m){this.unpairedPanelHidden=this.pairedPanelHidden=false;this._renderMiddle(l,m);return this},_clickUnpairAll:function(l){this.unpairAll()},_clickAutopair:function(l){this.autoPair();this.trigger("autopair")},_clickFilterChoice:function(m){var l=$(m.currentTarget);this.$(".forward-unpaired-filter input").val(l.data("forward"));this.$(".reverse-unpaired-filter input").val(l.data("reverse"));this._hideChooseFilters();this.trigger("filter-change")},_hideChooseFilters:function(){this.$(".choose-filters-link").popover("hide");this.$(".popover").css("display","none")},_clearFilters:function(l){this.$(".forward-unpaired-filter input").val("");this.$(".reverse-unpaired-filter input").val("");this.trigger("filter-change")},_clickUnpairedDataset:function(l){l.stopPropagation();return this.toggleSelectUnpaired($(l.currentTarget))},toggleSelectUnpaired:function(n,m){m=m||{};var o=n.data("dataset"),l=m.force!==undefined?m.force:!n.hasClass("selected");if(!n.size()||o===undefined){return n}if(l){n.addClass("selected");if(!m.waitToPair){this.pairAllSelected()}}else{n.removeClass("selected")}return n},pairAllSelected:function(m){m=m||{};var n=this,o=[],l=[],p=[];n.$(".unpaired-columns .forward-column .dataset.selected").each(function(){o.push($(this).data("dataset"))});n.$(".unpaired-columns .reverse-column .dataset.selected").each(function(){l.push($(this).data("dataset"))});o.length=l.length=Math.min(o.length,l.length);o.forEach(function(r,q){try{p.push(n._pair(r,l[q],{silent:true}))}catch(s){n.error(s)}});if(p.length&&!m.silent){this.trigger("pair:new",p)}return p},clearSelectedUnpaired:function(){this.$(".unpaired-columns .dataset.selected").removeClass("selected")},_mousedownUnpaired:function(n){if(n.shiftKey){var m=this,l=$(n.target).addClass("selected"),o=function(p){m.$(p.target).filter(".dataset").addClass("selected")};l.parent().on("mousemove",o);$(document).one("mouseup",function(p){l.parent().off("mousemove",o);m.pairAllSelected()})}},_clickPairRow:function(n){var o=$(n.currentTarget).index(),m=$(".unpaired-columns .forward-column .dataset").eq(o).data("dataset"),l=$(".unpaired-columns .reverse-column .dataset").eq(o).data("dataset");this._pair(m,l)},_startPartitionDrag:function(m){var l=this,p=m.pageY;$("body").css("cursor","ns-resize");l.$(".flexible-partition-drag").css("color","black");function o(q){l.$(".flexible-partition-drag").css("color","");$("body").css("cursor","").unbind("mousemove",n)}function n(q){var r=q.pageY-p;if(!l.adjPartition(r)){$("body").trigger("mouseup")}l._adjUnpairedOnScrollbar();p+=r}$("body").mousemove(n);$("body").one("mouseup",o)},adjPartition:function(m){var l=this.$(".unpaired-columns"),n=this.$(".paired-columns"),o=parseInt(l.css("height"),10),p=parseInt(n.css("height"),10);o=Math.max(10,o+m);p=p-m;var q=m<0;if(q){if(this.unpairedPanelHidden){return false}else{if(o<=10){this.hideUnpaired();return false}}}else{if(this.unpairedPanelHidden){l.show();this.unpairedPanelHidden=false}}if(!q){if(this.pairedPanelHidden){return false}else{if(p<=15){this.hidePaired();return false}}}else{if(this.pairedPanelHidden){n.show();this.pairedPanelHidden=false}}l.css({height:o+"px",flex:"0 0 auto"});return true},selectPair:function(l){l.stopPropagation();$(l.currentTarget).toggleClass("selected")},clearSelectedPaired:function(l){this.$(".paired-columns .dataset.selected").removeClass("selected")},_clickPairName:function(o){o.stopPropagation();var q=$(o.currentTarget),n=q.parent().parent(),m=n.index(".dataset.paired"),p=this.paired[m],l=prompt("Enter a new name for the pair:",p.name);if(l){p.name=l;p.customizedName=true;q.text(p.name)}},_clickUnpair:function(m){var l=Math.floor($(m.currentTarget).index(".unpair-btn"));this._unpair(this.paired[l])},_dragoverPairedColumns:function(o){o.preventDefault();var m=this.$(".paired-columns .column-datasets");this._checkForAutoscroll(m,o.originalEvent.clientY);var n=this._getNearestPairedDatasetLi(o.originalEvent.clientY);$(".paired-drop-placeholder").remove();var l=$('<div class="paired-drop-placeholder"></div>');if(!n.size()){m.append(l)}else{n.before(l)}},_checkForAutoscroll:function(l,r){var p=2;var q=l.offset(),o=l.scrollTop(),m=r-q.top,n=(q.top+l.outerHeight())-r;if(m>=0&&m<this.autoscrollDist){l.scrollTop(o-p)}else{if(n>=0&&n<this.autoscrollDist){l.scrollTop(o+p)}}},_getNearestPairedDatasetLi:function(r){var o=4,m=this.$(".paired-columns .column-datasets li").toArray();for(var n=0;n<m.length;n++){var q=$(m[n]),p=q.offset().top,l=Math.floor(q.outerHeight()/2)+o;if(p+l>r&&p-l<r){return q}}return $()},_dropPairedColumns:function(m){m.preventDefault();m.dataTransfer.dropEffect="move";var l=this._getNearestPairedDatasetLi(m.originalEvent.clientY);if(l.size()){this.$dragging.insertBefore(l)}else{this.$dragging.insertAfter(this.$(".paired-columns .unpair-btn").last())}this._syncPairsToDom();return false},_syncPairsToDom:function(){var l=[];this.$(".paired-columns .dataset.paired").each(function(){l.push($(this).data("pair"))});this.paired=l;this._renderPaired()},_pairDragstart:function(m,n){n.$el.addClass("selected");var l=this.$(".paired-columns .dataset.selected");this.$dragging=l},_pairDragend:function(l,m){$(".paired-drop-placeholder").remove();this.$dragging=null},toggleExtensions:function(m){var l=this;l.removeExtensions=(m!==undefined)?(m):(!l.removeExtensions);_.each(l.paired,function(n){if(n.customizedName){return}n.name=l._guessNameForPair(n.forward,n.reverse)});l._renderPaired();l._renderFooter()},_changeName:function(l){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(l){if(l.keyCode===13){this._clickCreate()}},_getName:function(){return _.escape(this.$(".collection-name").val())},_clickCreate:function(m){var l=this._getName();if(!l){this._validationWarning("name")}else{this.createList()}},_printList:function(m){var l=this;_.each(m,function(n){if(m===l.paired){l._printPair(n)}else{}})},_printPair:function(l){this.debug(l.forward.name,l.reverse.name,": ->",l.name)},toString:function(){return"PairedCollectionCreator"}});k.templates=k.templates||{main:_.template(['<div class="header flex-row no-flex"></div>','<div class="middle flex-row flex-row-container"></div>','<div class="footer flex-row no-flex">'].join("")),header:_.template(['<div class="main-help well clear">','<a class="more-help" href="javascript:void(0);">',c("More help"),"</a>",'<div class="help-content">','<a class="less-help" href="javascript:void(0);">',c("Less"),"</a>","</div>","</div>",'<div class="alert alert-dismissable">','<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>','<span class="alert-message"></span>',"</div>",'<div class="column-headers vertically-spaced flex-column-container">','<div class="forward-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired forward"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter forward-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>",'<div class="paired-column flex-column no-flex column">','<div class="column-header">','<a class="choose-filters-link" href="javascript:void(0)">',c("Choose filters"),"</a>",'<a class="clear-filters-link" href="javascript:void(0);">',c("Clear filters"),"</a><br />",'<a class="autopair-link" href="javascript:void(0);">',c("Auto-pair"),"</a>","</div>","</div>",'<div class="reverse-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired reverse"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter reverse-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>","</div>"].join("")),middle:_.template(['<div class="unpaired-columns flex-column-container scroll-container flex-row">','<div class="forward-column flex-column column">','<ol class="column-datasets"></ol>',"</div>",'<div class="paired-column flex-column no-flex column">','<ol class="column-datasets"></ol>',"</div>",'<div class="reverse-column flex-column column">','<ol class="column-datasets"></ol>',"</div>","</div>",'<div class="flexible-partition">','<div class="flexible-partition-drag" title="',c("Drag to change"),'"></div>','<div class="column-header">','<div class="column-title paired-column-title">','<span class="title"></span>',"</div>",'<a class="unpair-all-link" href="javascript:void(0);">',c("Unpair all"),"</a>","</div>","</div>",'<div class="paired-columns flex-column-container scroll-container flex-row">','<ol class="column-datasets"></ol>',"</div>"].join("")),footer:_.template(['<div class="attributes clear">','<div class="clear">','<label class="remove-extensions-prompt pull-right">',c("Remove file extensions from pair names"),"?",'<input class="remove-extensions pull-right" type="checkbox" />',"</label>","</div>",'<div class="clear">','<input class="collection-name form-control pull-right" ','placeholder="',c("Enter a name for your new list"),'" />','<div class="collection-name-prompt pull-right">',c("Name"),":</div>","</div>","</div>",'<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',c("Cancel"),"</button>",'<div class="create-other btn-group dropup">','<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">',c("Create a different kind of collection"),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="#">',c("Create a <i>single</i> pair"),"</a></li>",'<li><a href="#">',c("Create a list of <i>unpaired</i> datasets"),"</a></li>","</ul>","</div>","</div>",'<div class="main-options pull-right">','<button class="create-collection btn btn-primary">',c("Create list"),"</button>","</div>","</div>"].join("")),helpContent:_.template(["<p>",c(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections can be passed to tools and workflows in order to have analyses done on each member of ","the entire group. This interface allows you to create a collection, choose which datasets are paired, ","and re-order the final collection."].join("")),"</p>","<p>",c(['Unpaired datasets are shown in the <i data-target=".unpaired-columns">unpaired section</i> ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the <i data-target=".paired-columns">paired section</i>.',"<ul>To pair datasets, you can:","<li>Click a dataset in the ",'<i data-target=".unpaired-columns .forward-column .column-datasets,','.unpaired-columns .forward-column">forward column</i> ',"to select it then click a dataset in the ",'<i data-target=".unpaired-columns .reverse-column .column-datasets,','.unpaired-columns .reverse-column">reverse column</i>.',"</li>",'<li>Click one of the "Pair these datasets" buttons in the ','<i data-target=".unpaired-columns .paired-column .column-datasets,','.unpaired-columns .paired-column">middle column</i> ',"to pair the datasets in a particular row.","</li>",'<li>Click <i data-target=".autopair-link">"Auto-pair"</i> ',"to have your datasets automatically paired based on name.","</li>","</ul>"].join("")),"</p>","<p>",c(["<ul>You can filter what is shown in the unpaired sections by:","<li>Entering partial dataset names in either the ",'<i data-target=".forward-unpaired-filter input">forward filter</i> or ','<i data-target=".reverse-unpaired-filter input">reverse filter</i>.',"</li>","<li>Choosing from a list of preset filters by clicking the ",'<i data-target=".choose-filters-link">"Choose filters" link</i>.',"</li>","<li>Entering regular expressions to match dataset names. See: ",'<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expre…"',' target="_blank">MDN\'s JavaScript Regular Expression Tutorial</a>. ',"Note: forward slashes (\\) are not needed.","</li>","<li>Clearing the filters by clicking the ",'<i data-target=".clear-filters-link">"Clear filters" link</i>.',"</li>","</ul>"].join("")),"</p>","<p>",c(["To unpair individual dataset pairs, click the ",'<i data-target=".unpair-btn">unpair buttons ( <span class="fa fa-unlink"></span> )</i>. ','Click the <i data-target=".unpair-all-link">"Unpair all" link</i> to unpair all pairs.'].join("")),"</p>","<p>",c(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','<i data-target=".remove-extensions-prompt">"Remove file extensions from pair names?"</i> control.'].join("")),"</p>","<p>",c(['Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ','click <i data-target=".create-collection">"Create list"</i>. ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"</p>"].join(""))};(function(){jQuery.fn.extend({hoverhighlight:function l(n,m){n=n||"body";if(!this.size()){return this}$(this).each(function(){var p=$(this),o=p.data("target");if(o){p.mouseover(function(q){$(o,n).css({background:m})}).mouseout(function(q){$(o).css({background:""})})}});return this}})}());var d=function a(n,l){l=_.defaults(l||{},{datasets:n,oncancel:function(){Galaxy.modal.hide()},oncreate:function(){Galaxy.modal.hide();Galaxy.currHistoryPanel.refreshContents()}});if(!window.Galaxy||!Galaxy.modal){throw new Error("Galaxy or Galaxy.modal not found")}var m=new k(l);Galaxy.modal.show({title:"Create a collection of paired datasets",body:m.$el,width:"80%",height:"800px",closing_events:true});m.render();window.PCC=m;return m};return{PairedCollectionCreator:k,pairedCollectionCreatorModal:d}});
\ No newline at end of file
+define(["utils/levenshtein","utils/natural-sort","mvc/base-mvc","utils/localization"],function(h,b,f,c){var i=Backbone.View.extend(f.LoggableMixin).extend({tagName:"li",className:"dataset paired",initialize:function(l){this.pair=l.pair||{}},template:_.template(['<span class="forward-dataset-name flex-column"><%= pair.forward.name %></span>','<span class="pair-name-column flex-column">','<span class="pair-name"><%= pair.name %></span>',"</span>",'<span class="reverse-dataset-name flex-column"><%= pair.reverse.name %></span>'].join("")),render:function(){this.$el.attr("draggable",true).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container");return this},events:{dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(l){l.currentTarget.style.opacity="0.4";if(l.originalEvent){l=l.originalEvent}l.dataTransfer.effectAllowed="move";l.dataTransfer.setData("text/plain",JSON.stringify(this.pair));this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(l){l.currentTarget.style.opacity="1.0";this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(l){this.$el.parent().trigger(l)},toString:function(){return"PairView("+this.pair.name+")"}});function g(m){m=m||{};m.createPair=m.createPair||function l(r){this.debug("creating pair:",r.listA[r.indexA].name,r.listB[r.indexB].name);r=r||{};return this._pair(r.listA.splice(r.indexA,1)[0],r.listB.splice(r.indexB,1)[0],{silent:true})};var o=[];function q(){if(!o.length){o=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]}return o}m.preprocessMatch=m.preprocessMatch||function n(s){var r=q.call(this);return _.extend(s,{matchTo:s.matchTo.name.replace(r[0],""),possible:s.possible.name.replace(r[1],"")})};return function p(t){this.debug("autopair _strategy ---------------------------");t=t||{};var r=t.listA,A=t.listB,z=0,y,v={score:0,index:null},x=[];this.debug("starting list lens:",r.length,A.length);this.debug("bestMatch (starting):",JSON.stringify(v,null," "));while(z<r.length){var w=r[z];v.score=0;for(y=0;y<A.length;y++){var u=A[y];this.debug(z+":"+w.name);this.debug(y+":"+u.name);if(r[z]!==A[y]){v=m.match.call(this,m.preprocessMatch.call(this,{matchTo:w,possible:u,index:y,bestMatch:v}));this.debug("bestMatch:",JSON.stringify(v,null," "));if(v.score===1){this.debug("breaking early due to perfect match");break}}}var s=m.scoreThreshold.call(this);this.debug("scoreThreshold:",s);this.debug("bestMatch.score:",v.score);if(v.score>=s){this.debug("creating pair");x.push(m.createPair.call(this,{listA:r,indexA:z,listB:A,indexB:v.index}));this.debug("list lens now:",r.length,A.length)}else{z+=1}if(!r.length||!A.length){return x}}this.debug("paired:",JSON.stringify(x,null," "));this.debug("autopair _strategy ---------------------------");return x}}var k=Backbone.View.extend(f.LoggableMixin).extend({className:"collection-creator flex-row-container",initialize:function(l){this.metric("PairedCollectionCreator.initialize",l);l=_.defaults(l,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:true,strategy:"lcs",matchPercentage:0.9,twoPassAutopairing:true});this.initialList=l.datasets;this.historyId=l.historyId;this.filters=this.commonFilters[l.filters]||this.commonFilters[this.DEFAULT_FILTERS];if(_.isArray(l.filters)){this.filters=l.filters}this.automaticallyPair=l.automaticallyPair;this.strategy=this.strategies[l.strategy]||this.strategies[this.DEFAULT_STRATEGY];if(_.isFunction(l.strategy)){this.strategy=l.strategy}this.matchPercentage=l.matchPercentage;this.twoPassAutopairing=l.twoPassAutopairing;this.removeExtensions=true;this.oncancel=l.oncancel;this.oncreate=l.oncreate;this.autoscrollDist=l.autoscrollDist||24;this.unpairedPanelHidden=false;this.pairedPanelHidden=false;this.$dragging=null;this._setUpBehaviors();this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[];this.unpaired=[];this.selectedIds=[];this._sortInitialList();this._ensureIds();this.unpaired=this.initialList.slice(0);if(this.automaticallyPair){this.autoPair();this.once("rendered:initial",function(){this.trigger("autopair")})}},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(l){l.sort(function(n,m){return b(n.name,m.name)});return l},_ensureIds:function(){this.initialList.forEach(function(l){if(!l.hasOwnProperty("id")){l.id=_.uniqueId()}});return this.initialList},_splitByFilters:function(){var o=this.filters.map(function(p){return new RegExp(p)}),m=[[],[]];function n(p,q){return q.test(p.name)}this.unpaired.forEach(function l(p){o.forEach(function(r,q){if(n(p,r)){m[q].push(p)}})});return m},_addToUnpaired:function(m){var l=function(n,p){if(n===p){return n}var o=Math.floor((p-n)/2)+n,q=b(m.name,this.unpaired[o].name);if(q<0){return l(n,o)}else{if(q>0){return l(o+1,p)}}while(this.unpaired[o]&&this.unpaired[o].name===m.name){o++}return o}.bind(this);this.unpaired.splice(l(0,this.unpaired.length),0,m)},autoPair:function(n){var m=this._splitByFilters(),l=[];if(this.twoPassAutopairing){l=this.autopairSimple({listA:m[0],listB:m[1]});m=this._splitByFilters()}n=n||this.strategy;m=this._splitByFilters();l=l.concat(this[n].call(this,{listA:m[0],listB:m[1]}));return l},autopairSimple:g({scoreThreshold:function(){return 1},match:function j(l){l=l||{};if(l.matchTo===l.possible){return{index:l.index,score:1}}return l.bestMatch}}),autopairLevenshtein:g({scoreThreshold:function(){return this.matchPercentage},match:function e(m){m=m||{};var n=h(m.matchTo,m.possible),l=1-(n/(Math.max(m.matchTo.length,m.possible.length)));if(l>m.bestMatch.score){return{index:m.index,score:l}}return m.bestMatch}}),autopairLCS:g({scoreThreshold:function(){return this.matchPercentage},match:function e(n){n=n||{};var l=this._naiveStartingAndEndingLCS(n.matchTo,n.possible).length,m=l/(Math.max(n.matchTo.length,n.possible.length));if(m>n.bestMatch.score){return{index:n.index,score:m}}return n.bestMatch}}),_naiveStartingAndEndingLCS:function(o,m){var p="",q="",n=0,l=0;while(n<o.length&&n<m.length){if(o[n]!==m[n]){break}p+=o[n];n+=1}if(n===o.length){return o}if(n===m.length){return m}n=(o.length-1);l=(m.length-1);while(n>=0&&l>=0){if(o[n]!==m[l]){break}q=[o[n],q].join("");n-=1;l-=1}return p+q},_pair:function(n,l,m){m=m||{};var o=this._createPair(n,l,m.name);this.paired.push(o);this.unpaired=_.without(this.unpaired,n,l);if(!m.silent){this.trigger("pair:new",o)}return o},_createPair:function(n,l,m){if(!(n&&l)||(n===l)){throw new Error("Bad pairing: "+[JSON.stringify(n),JSON.stringify(l)])}m=m||this._guessNameForPair(n,l);return{forward:n,name:m,reverse:l}},_guessNameForPair:function(o,m,q){q=(q!==undefined)?(q):(this.removeExtensions);var l=o.name,p=m.name,n=this._naiveStartingAndEndingLCS(l.replace(this.filters[0],""),p.replace(this.filters[1],""));if(q){var r=n.lastIndexOf(".");if(r>0){var s=n.slice(r,n.length);n=n.replace(s,"");l=l.replace(s,"");p=p.replace(s,"")}}return n||(l+" & "+p)},_unpair:function(m,l){l=l||{};if(!m){throw new Error("Bad pair: "+JSON.stringify(m))}this.paired=_.without(this.paired,m);this._addToUnpaired(m.forward);this._addToUnpaired(m.reverse);if(!l.silent){this.trigger("pair:unpair",[m])}return m},unpairAll:function(){var l=[];while(this.paired.length){l.push(this._unpair(this.paired[0],{silent:true}))}this.trigger("pair:unpair",l)},_pairToJSON:function(m,l){l=l||"hda";return{collection_type:"paired",src:"new_collection",name:m.name,element_identifiers:[{name:"forward",id:m.forward.id,src:l},{name:"reverse",id:m.reverse.id,src:l}]}},createList:function(n){var o=this,m="/api/histories/"+this.historyId+"/contents/dataset_collections";var l={type:"dataset_collection",collection_type:"list:paired",name:_.escape(n||o.$(".collection-name").val()),element_identifiers:o.paired.map(function(p){return o._pairToJSON(p)})};return jQuery.ajax(m,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(l)}).fail(function(r,p,q){o._ajaxErrHandler(r,p,q)}).done(function(p,q,r){o.trigger("collection:created",p,q,r);o.metric("collection:created",p);if(typeof o.oncreate==="function"){o.oncreate.call(this,p,q,r)}})},_ajaxErrHandler:function(o,l,n){this.error(o,l,n);var m=c("An error occurred while creating this collection");if(o){if(o.readyState===0&&o.status===0){m+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes.")}else{if(o.responseJSON){m+="<br /><pre>"+JSON.stringify(o.responseJSON)+"</pre>"}else{m+=": "+n}}}creator._showAlert(m,"alert-danger")},render:function(l,m){this.$el.empty().html(k.templates.main());this._renderHeader(l);this._renderMiddle(l);this._renderFooter(l);this._addPluginComponents();this.trigger("rendered",this);return this},_renderHeader:function(m,n){var l=this.$(".header").empty().html(k.templates.header()).find(".help-content").prepend($(k.templates.helpContent()));this._renderFilters();return l},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(m,n){var l=this.$(".middle").empty().html(k.templates.middle());if(this.unpairedPanelHidden){this.$(".unpaired-columns").hide()}else{if(this.pairedPanelHidden){this.$(".paired-columns").hide()}}this._renderUnpaired();this._renderPaired();return l},_renderUnpaired:function(q,r){var o=this,p,m,l=[],n=this._splitByFilters();this.$(".forward-column .title").text([n[0].length,c("unpaired forward")].join(" "));this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[0].length));this.$(".reverse-column .title").text([n[1].length,c("unpaired reverse")].join(" "));this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[1].length));this.$(".unpaired-columns .column-datasets").empty();this.$(".autopair-link").toggle(this.unpaired.length!==0);if(this.unpaired.length===0){this._renderUnpairedEmpty();return}m=n[1].map(function(t,s){if((n[0][s]!==undefined)&&(n[0][s]!==t)){l.push(o._renderPairButton())}return o._renderUnpairedDataset(t)});p=n[0].map(function(s){return o._renderUnpairedDataset(s)});if(!p.length&&!m.length){this._renderUnpairedNotShown();return}this.$(".unpaired-columns .forward-column .column-datasets").append(p).add(this.$(".unpaired-columns .paired-column .column-datasets").append(l)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(m));this._adjUnpairedOnScrollbar()},_renderUnpairedDisplayStr:function(l){return["(",l," ",c("filtered out"),")"].join("")},_renderUnpairedDataset:function(l){return $("<li/>").attr("id","dataset-"+l.id).addClass("dataset unpaired").attr("draggable",true).addClass(l.selected?"selected":"").append($("<span/>").addClass("dataset-name").text(l.name)).data("dataset",l)},_renderPairButton:function(){return $("<li/>").addClass("dataset unpaired").append($("<span/>").addClass("dataset-name").text(c("Pair these datasets")))},_renderUnpairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no remaining unpaired datasets")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_renderUnpairedNotShown:function(){var l=$('<div class="empty-message"></div>').text("("+c("no datasets were found matching the current filters")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_adjUnpairedOnScrollbar:function(){var o=this.$(".unpaired-columns").last(),p=this.$(".unpaired-columns .reverse-column .dataset").first();if(!p.size()){return}var l=o.offset().left+o.outerWidth(),n=p.offset().left+p.outerWidth(),m=Math.floor(l)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",(m>0)?m:0)},_renderPaired:function(m,n){this.$(".paired-column-title .title").text([this.paired.length,c("paired")].join(" "));this.$(".unpair-all-link").toggle(this.paired.length!==0);if(this.paired.length===0){this._renderPairedEmpty();return}else{this.$(".remove-extensions-link").show()}this.$(".paired-columns .column-datasets").empty();var l=this;this.paired.forEach(function(q,o){var p=new i({pair:q});l.$(".paired-columns .column-datasets").append(p.render().$el).append(['<button class="unpair-btn">','<span class="fa fa-unlink" title="',c("Unpair"),'"></span>',"</button>"].join(""))})},_renderPairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no paired datasets yet")+")");this.$(".paired-columns .column-datasets").empty().prepend(l);return l},_renderFooter:function(m,n){var l=this.$(".footer").empty().html(k.templates.footer());this.$(".remove-extensions").prop("checked",this.removeExtensions);if(typeof this.oncancel==="function"){this.$(".cancel-create.btn").show()}return l},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link");this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(l){function m(p,o){return['<button class="filter-choice btn" ','data-forward="',p,'" data-reverse="',o,'">',c("Forward"),": ",p,", ",c("Reverse"),": ",o,"</button>"].join("")}var n=$(_.template(['<div class="choose-filters">','<div class="help">',c("Choose from the following filters to change which unpaired reads are shown in the display"),":</div>",_.values(this.commonFilters).map(function(o){return m(o[0],o[1])}).join(""),"</div>"].join(""))({}));return this.$(l).popover({container:".collection-creator",placement:"bottom",html:true,content:n})},_validationWarning:function(m,l){var n="validation-warning";if(m==="name"){m=this.$(".collection-name").add(this.$(".collection-name-prompt"));this.$(".collection-name").focus().select()}if(l){m=m||this.$("."+n);m.removeClass(n)}else{m.addClass(n)}},_setUpBehaviors:function(){this.once("rendered",function(){this.trigger("rendered:initial",this)});this.on("pair:new",function(){this._renderUnpaired();this._renderPaired();this.$(".paired-columns").scrollTop(8000000)});this.on("pair:unpair",function(l){this._renderUnpaired();this._renderPaired();this.splitView()});this.on("filter-change",function(){this.filters=[this.$(".forward-unpaired-filter input").val(),this.$(".reverse-unpaired-filter input").val()];this.metric("filter-change",this.filters);this._renderFilters();this._renderUnpaired()});this.on("autopair",function(){this._renderUnpaired();this._renderPaired();var l,m=null;if(this.paired.length){m="alert-success";l=this.paired.length+" "+c("pairs created");if(!this.unpaired.length){l+=": "+c("all datasets have been successfully paired");this.hideUnpaired();this.$(".collection-name").focus()}}else{l=c("Could not automatically create any pairs from the given dataset names")}this._showAlert(l,m)});return this},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .header .alert button":"_hideAlert","click .forward-column .column-title":"_clickShowOnlyUnpaired","click .reverse-column .column-title":"_clickShowOnlyUnpaired","click .unpair-all-link":"_clickUnpairAll","change .forward-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .forward-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .autopair-link":"_clickAutopair","click .choose-filters .filter-choice":"_clickFilterChoice","click .clear-filters-link":"_clearFilters","change .reverse-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .reverse-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .forward-column .dataset.unpaired":"_clickUnpairedDataset","click .reverse-column .dataset.unpaired":"_clickUnpairedDataset","click .paired-column .dataset.unpaired":"_clickPairRow","click .unpaired-columns":"clearSelectedUnpaired","mousedown .unpaired-columns .dataset":"_mousedownUnpaired","click .paired-column-title":"_clickShowOnlyPaired","mousedown .flexible-partition-drag":"_startPartitionDrag","click .paired-columns .dataset.paired":"selectPair","click .paired-columns":"clearSelectedPaired","click .paired-columns .pair-name":"_clickPairName","click .unpair-btn":"_clickUnpair","dragover .paired-columns .column-datasets":"_dragoverPairedColumns","drop .paired-columns .column-datasets":"_dropPairedColumns","pair.dragstart .paired-columns .column-datasets":"_pairDragstart","pair.dragend .paired-columns .column-datasets":"_pairDragend","change .remove-extensions":function(l){this.toggleExtensions()},"change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","click .cancel-create":function(l){if(typeof this.oncancel==="function"){this.oncancel.call(this)}},"click .create-collection":"_clickCreate"},_clickMoreHelp:function(l){this.$(".main-help").addClass("expanded");this.$(".more-help").hide()},_clickLessHelp:function(l){this.$(".main-help").removeClass("expanded");this.$(".more-help").show()},_showAlert:function(m,l){l=l||"alert-danger";this.$(".main-help").hide();this.$(".header .alert").attr("class","alert alert-dismissable").addClass(l).show().find(".alert-message").html(m)},_hideAlert:function(l){this.$(".main-help").show();this.$(".header .alert").hide()},_clickShowOnlyUnpaired:function(l){if(this.$(".paired-columns").is(":visible")){this.hidePaired()}else{this.splitView()}},_clickShowOnlyPaired:function(l){if(this.$(".unpaired-columns").is(":visible")){this.hideUnpaired()}else{this.splitView()}},hideUnpaired:function(l,m){this.unpairedPanelHidden=true;this.pairedPanelHidden=false;this._renderMiddle(l,m)},hidePaired:function(l,m){this.unpairedPanelHidden=false;this.pairedPanelHidden=true;this._renderMiddle(l,m)},splitView:function(l,m){this.unpairedPanelHidden=this.pairedPanelHidden=false;this._renderMiddle(l,m);return this},_clickUnpairAll:function(l){this.metric("unpairAll");this.unpairAll()},_clickAutopair:function(m){var l=this.autoPair();this.metric("autopair",l.length,this.unpaired.length);this.trigger("autopair")},_clickFilterChoice:function(m){var l=$(m.currentTarget);this.$(".forward-unpaired-filter input").val(l.data("forward"));this.$(".reverse-unpaired-filter input").val(l.data("reverse"));this._hideChooseFilters();this.trigger("filter-change")},_hideChooseFilters:function(){this.$(".choose-filters-link").popover("hide");this.$(".popover").css("display","none")},_clearFilters:function(l){this.$(".forward-unpaired-filter input").val("");this.$(".reverse-unpaired-filter input").val("");this.trigger("filter-change")},_clickUnpairedDataset:function(l){l.stopPropagation();return this.toggleSelectUnpaired($(l.currentTarget))},toggleSelectUnpaired:function(n,m){m=m||{};var o=n.data("dataset"),l=m.force!==undefined?m.force:!n.hasClass("selected");if(!n.size()||o===undefined){return n}if(l){n.addClass("selected");if(!m.waitToPair){this.pairAllSelected()}}else{n.removeClass("selected")}return n},pairAllSelected:function(m){m=m||{};var n=this,o=[],l=[],p=[];n.$(".unpaired-columns .forward-column .dataset.selected").each(function(){o.push($(this).data("dataset"))});n.$(".unpaired-columns .reverse-column .dataset.selected").each(function(){l.push($(this).data("dataset"))});o.length=l.length=Math.min(o.length,l.length);o.forEach(function(r,q){try{p.push(n._pair(r,l[q],{silent:true}))}catch(s){n.error(s)}});if(p.length&&!m.silent){this.trigger("pair:new",p)}return p},clearSelectedUnpaired:function(){this.$(".unpaired-columns .dataset.selected").removeClass("selected")},_mousedownUnpaired:function(n){if(n.shiftKey){var m=this,l=$(n.target).addClass("selected"),o=function(p){m.$(p.target).filter(".dataset").addClass("selected")};l.parent().on("mousemove",o);$(document).one("mouseup",function(p){l.parent().off("mousemove",o);m.pairAllSelected()})}},_clickPairRow:function(n){var o=$(n.currentTarget).index(),m=$(".unpaired-columns .forward-column .dataset").eq(o).data("dataset"),l=$(".unpaired-columns .reverse-column .dataset").eq(o).data("dataset");this._pair(m,l)},_startPartitionDrag:function(m){var l=this,p=m.pageY;$("body").css("cursor","ns-resize");l.$(".flexible-partition-drag").css("color","black");function o(q){l.$(".flexible-partition-drag").css("color","");$("body").css("cursor","").unbind("mousemove",n)}function n(q){var r=q.pageY-p;if(!l.adjPartition(r)){$("body").trigger("mouseup")}l._adjUnpairedOnScrollbar();p+=r}$("body").mousemove(n);$("body").one("mouseup",o)},adjPartition:function(m){var l=this.$(".unpaired-columns"),n=this.$(".paired-columns"),o=parseInt(l.css("height"),10),p=parseInt(n.css("height"),10);o=Math.max(10,o+m);p=p-m;var q=m<0;if(q){if(this.unpairedPanelHidden){return false}else{if(o<=10){this.hideUnpaired();return false}}}else{if(this.unpairedPanelHidden){l.show();this.unpairedPanelHidden=false}}if(!q){if(this.pairedPanelHidden){return false}else{if(p<=15){this.hidePaired();return false}}}else{if(this.pairedPanelHidden){n.show();this.pairedPanelHidden=false}}l.css({height:o+"px",flex:"0 0 auto"});return true},selectPair:function(l){l.stopPropagation();$(l.currentTarget).toggleClass("selected")},clearSelectedPaired:function(l){this.$(".paired-columns .dataset.selected").removeClass("selected")},_clickPairName:function(o){o.stopPropagation();var q=$(o.currentTarget),n=q.parent().parent(),m=n.index(".dataset.paired"),p=this.paired[m],l=prompt("Enter a new name for the pair:",p.name);if(l){p.name=l;p.customizedName=true;q.text(p.name)}},_clickUnpair:function(m){var l=Math.floor($(m.currentTarget).index(".unpair-btn"));this._unpair(this.paired[l])},_dragoverPairedColumns:function(o){o.preventDefault();var m=this.$(".paired-columns .column-datasets");this._checkForAutoscroll(m,o.originalEvent.clientY);var n=this._getNearestPairedDatasetLi(o.originalEvent.clientY);$(".paired-drop-placeholder").remove();var l=$('<div class="paired-drop-placeholder"></div>');if(!n.size()){m.append(l)}else{n.before(l)}},_checkForAutoscroll:function(l,r){var p=2;var q=l.offset(),o=l.scrollTop(),m=r-q.top,n=(q.top+l.outerHeight())-r;if(m>=0&&m<this.autoscrollDist){l.scrollTop(o-p)}else{if(n>=0&&n<this.autoscrollDist){l.scrollTop(o+p)}}},_getNearestPairedDatasetLi:function(r){var o=4,m=this.$(".paired-columns .column-datasets li").toArray();for(var n=0;n<m.length;n++){var q=$(m[n]),p=q.offset().top,l=Math.floor(q.outerHeight()/2)+o;if(p+l>r&&p-l<r){return q}}return $()},_dropPairedColumns:function(m){m.preventDefault();m.dataTransfer.dropEffect="move";var l=this._getNearestPairedDatasetLi(m.originalEvent.clientY);if(l.size()){this.$dragging.insertBefore(l)}else{this.$dragging.insertAfter(this.$(".paired-columns .unpair-btn").last())}this._syncPairsToDom();return false},_syncPairsToDom:function(){var l=[];this.$(".paired-columns .dataset.paired").each(function(){l.push($(this).data("pair"))});this.paired=l;this._renderPaired()},_pairDragstart:function(m,n){n.$el.addClass("selected");var l=this.$(".paired-columns .dataset.selected");this.$dragging=l},_pairDragend:function(l,m){$(".paired-drop-placeholder").remove();this.$dragging=null},toggleExtensions:function(m){var l=this;l.removeExtensions=(m!==undefined)?(m):(!l.removeExtensions);_.each(l.paired,function(n){if(n.customizedName){return}n.name=l._guessNameForPair(n.forward,n.reverse)});l._renderPaired();l._renderFooter()},_changeName:function(l){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(l){if(l.keyCode===13){this._clickCreate()}},_getName:function(){return _.escape(this.$(".collection-name").val())},_clickCreate:function(m){var l=this._getName();if(!l){this._validationWarning("name")}else{this.createList()}},_printList:function(m){var l=this;_.each(m,function(n){if(m===l.paired){l._printPair(n)}else{}})},_printPair:function(l){this.debug(l.forward.name,l.reverse.name,": ->",l.name)},toString:function(){return"PairedCollectionCreator"}});k.templates=k.templates||{main:_.template(['<div class="header flex-row no-flex"></div>','<div class="middle flex-row flex-row-container"></div>','<div class="footer flex-row no-flex">'].join("")),header:_.template(['<div class="main-help well clear">','<a class="more-help" href="javascript:void(0);">',c("More help"),"</a>",'<div class="help-content">','<a class="less-help" href="javascript:void(0);">',c("Less"),"</a>","</div>","</div>",'<div class="alert alert-dismissable">','<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>','<span class="alert-message"></span>',"</div>",'<div class="column-headers vertically-spaced flex-column-container">','<div class="forward-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired forward"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter forward-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>",'<div class="paired-column flex-column no-flex column">','<div class="column-header">','<a class="choose-filters-link" href="javascript:void(0)">',c("Choose filters"),"</a>",'<a class="clear-filters-link" href="javascript:void(0);">',c("Clear filters"),"</a><br />",'<a class="autopair-link" href="javascript:void(0);">',c("Auto-pair"),"</a>","</div>","</div>",'<div class="reverse-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired reverse"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter reverse-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>","</div>"].join("")),middle:_.template(['<div class="unpaired-columns flex-column-container scroll-container flex-row">','<div class="forward-column flex-column column">','<ol class="column-datasets"></ol>',"</div>",'<div class="paired-column flex-column no-flex column">','<ol class="column-datasets"></ol>',"</div>",'<div class="reverse-column flex-column column">','<ol class="column-datasets"></ol>',"</div>","</div>",'<div class="flexible-partition">','<div class="flexible-partition-drag" title="',c("Drag to change"),'"></div>','<div class="column-header">','<div class="column-title paired-column-title">','<span class="title"></span>',"</div>",'<a class="unpair-all-link" href="javascript:void(0);">',c("Unpair all"),"</a>","</div>","</div>",'<div class="paired-columns flex-column-container scroll-container flex-row">','<ol class="column-datasets"></ol>',"</div>"].join("")),footer:_.template(['<div class="attributes clear">','<div class="clear">','<label class="remove-extensions-prompt pull-right">',c("Remove file extensions from pair names"),"?",'<input class="remove-extensions pull-right" type="checkbox" />',"</label>","</div>",'<div class="clear">','<input class="collection-name form-control pull-right" ','placeholder="',c("Enter a name for your new list"),'" />','<div class="collection-name-prompt pull-right">',c("Name"),":</div>","</div>","</div>",'<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',c("Cancel"),"</button>",'<div class="create-other btn-group dropup">','<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">',c("Create a different kind of collection"),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="#">',c("Create a <i>single</i> pair"),"</a></li>",'<li><a href="#">',c("Create a list of <i>unpaired</i> datasets"),"</a></li>","</ul>","</div>","</div>",'<div class="main-options pull-right">','<button class="create-collection btn btn-primary">',c("Create list"),"</button>","</div>","</div>"].join("")),helpContent:_.template(["<p>",c(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections can be passed to tools and workflows in order to have analyses done on each member of ","the entire group. This interface allows you to create a collection, choose which datasets are paired, ","and re-order the final collection."].join("")),"</p>","<p>",c(['Unpaired datasets are shown in the <i data-target=".unpaired-columns">unpaired section</i> ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the <i data-target=".paired-columns">paired section</i>.',"<ul>To pair datasets, you can:","<li>Click a dataset in the ",'<i data-target=".unpaired-columns .forward-column .column-datasets,','.unpaired-columns .forward-column">forward column</i> ',"to select it then click a dataset in the ",'<i data-target=".unpaired-columns .reverse-column .column-datasets,','.unpaired-columns .reverse-column">reverse column</i>.',"</li>",'<li>Click one of the "Pair these datasets" buttons in the ','<i data-target=".unpaired-columns .paired-column .column-datasets,','.unpaired-columns .paired-column">middle column</i> ',"to pair the datasets in a particular row.","</li>",'<li>Click <i data-target=".autopair-link">"Auto-pair"</i> ',"to have your datasets automatically paired based on name.","</li>","</ul>"].join("")),"</p>","<p>",c(["<ul>You can filter what is shown in the unpaired sections by:","<li>Entering partial dataset names in either the ",'<i data-target=".forward-unpaired-filter input">forward filter</i> or ','<i data-target=".reverse-unpaired-filter input">reverse filter</i>.',"</li>","<li>Choosing from a list of preset filters by clicking the ",'<i data-target=".choose-filters-link">"Choose filters" link</i>.',"</li>","<li>Entering regular expressions to match dataset names. See: ",'<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expre…"',' target="_blank">MDN\'s JavaScript Regular Expression Tutorial</a>. ',"Note: forward slashes (\\) are not needed.","</li>","<li>Clearing the filters by clicking the ",'<i data-target=".clear-filters-link">"Clear filters" link</i>.',"</li>","</ul>"].join("")),"</p>","<p>",c(["To unpair individual dataset pairs, click the ",'<i data-target=".unpair-btn">unpair buttons ( <span class="fa fa-unlink"></span> )</i>. ','Click the <i data-target=".unpair-all-link">"Unpair all" link</i> to unpair all pairs.'].join("")),"</p>","<p>",c(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','<i data-target=".remove-extensions-prompt">"Remove file extensions from pair names?"</i> control.'].join("")),"</p>","<p>",c(['Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ','click <i data-target=".create-collection">"Create list"</i>. ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"</p>"].join(""))};(function(){jQuery.fn.extend({hoverhighlight:function l(n,m){n=n||"body";if(!this.size()){return this}$(this).each(function(){var p=$(this),o=p.data("target");if(o){p.mouseover(function(q){$(o,n).css({background:m})}).mouseout(function(q){$(o).css({background:""})})}});return this}})}());var d=function a(n,l){l=_.defaults(l||{},{datasets:n,oncancel:function(){Galaxy.modal.hide()},oncreate:function(){Galaxy.modal.hide();Galaxy.currHistoryPanel.refreshContents()}});if(!window.Galaxy||!Galaxy.modal){throw new Error("Galaxy or Galaxy.modal not found")}var m=new k(l);Galaxy.modal.show({title:"Create a collection of paired datasets",body:m.$el,width:"80%",height:"800px",closing_events:true});m.render();window.PCC=m;return m};return{PairedCollectionCreator:k,pairedCollectionCreatorModal:d}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/bc6a54c340fb/
Changeset: bc6a54c340fb
User: carlfeberhard
Date: 2015-02-11 18:16:20+00:00
Summary: Merge
Affected #: 1 file
diff -r fdb5e1329ef2de9a712f5139bcd71ee4ac278f24 -r bc6a54c340fb81096d73ea76122eca3675117df8 test/base/test_data.py
--- a/test/base/test_data.py
+++ b/test/base/test_data.py
@@ -75,7 +75,7 @@
def __init__(self, repository, environ):
self.repository = repository
self.updated = False
- repo_cache = environ.get("GALAXY_TEST_DATA_REPO_CACHE", "test-data-repos")
+ repo_cache = environ.get("GALAXY_TEST_DATA_REPO_CACHE", "test-data-cache")
m = hashlib.md5()
m.update(repository)
repo_path = os.path.join(repo_cache, m.hexdigest())
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Fix incorrect constant pointed out by Nicola.
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1d9da5a9edfa/
Changeset: 1d9da5a9edfa
User: jmchilton
Date: 2015-02-11 18:15:21+00:00
Summary: Fix incorrect constant pointed out by Nicola.
https://bitbucket.org/galaxy/galaxy-central/pull-request/664/remove-test-da….
Affected #: 1 file
diff -r 86ac99a2896b87915e35b81db1320fdfe73bf556 -r 1d9da5a9edfa536e8755ecafdb9f7a23694d6761 test/base/test_data.py
--- a/test/base/test_data.py
+++ b/test/base/test_data.py
@@ -75,7 +75,7 @@
def __init__(self, repository, environ):
self.repository = repository
self.updated = False
- repo_cache = environ.get("GALAXY_TEST_DATA_REPO_CACHE", "test-data-repos")
+ repo_cache = environ.get("GALAXY_TEST_DATA_REPO_CACHE", "test-data-cache")
m = hashlib.md5()
m.update(repository)
repo_path = os.path.join(repo_cache, m.hexdigest())
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: ToolForm: Reduce number of refresh events
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/86ac99a2896b/
Changeset: 86ac99a2896b
User: guerler
Date: 2015-02-11 18:12:06+00:00
Summary: ToolForm: Reduce number of refresh events
Affected #: 9 files
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 client/galaxy/scripts/mvc/tools/tools-form-base.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-base.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-base.js
@@ -93,7 +93,7 @@
this._renderForm(options);
// rebuild the underlying data structure
- this.tree.finalize();
+ var current_state = this.tree.finalize();
// show errors on startup
if (options.initial_errors) {
@@ -102,9 +102,15 @@
// add refresh listener
this.on('refresh', function() {
- // by using/resetting the deferred ajax queue the number of redundant calls is reduced
- self.deferred.reset();
- self.deferred.execute(function(){self._updateModel()});
+ var new_state = self.tree.finalize();
+ if (!_.isEqual(new_state, current_state)) {
+ // backup current state
+ current_state = new_state;
+
+ // by using/resetting the deferred ajax queue the number of redundant calls is reduced
+ self.deferred.reset();
+ self.deferred.execute(function(){self._updateModel(current_state)});
+ }
});
// add reset listener
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 client/galaxy/scripts/mvc/tools/tools-form-workflow.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
@@ -274,15 +274,15 @@
/** Request a new model for an already created tool form and updates the form inputs
*/
- _updateModel: function() {
+ _updateModel: function(current_state) {
// link self
var self = this;
// create the request dictionary
- var current_state = {
+ current_state = {
tool_id : this.options.id,
tool_version : this.options.version,
- inputs : this.tree.finalize()
+ inputs : current_state
}
// log tool state
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 client/galaxy/scripts/mvc/tools/tools-form.js
--- a/client/galaxy/scripts/mvc/tools/tools-form.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form.js
@@ -115,7 +115,7 @@
});
// log tool state
- console.debug('tools-form::_refreshForm() - Refreshing states.');
+ console.debug('tools-form::_refreshForm() - Sending current state (see below).');
console.debug(current_state);
// activates/disables spinner for dynamic fields to indicate that they are currently being updated
@@ -188,7 +188,7 @@
self.deferred.done(process_id);
// log success
- console.debug('tools-form::_refreshForm() - States refreshed.');
+ console.debug('tools-form::_refreshForm() - Received new model (see below).');
console.debug(new_model);
},
error : function(response) {
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 static/scripts/mvc/tools/tools-form-base.js
--- a/static/scripts/mvc/tools/tools-form-base.js
+++ b/static/scripts/mvc/tools/tools-form-base.js
@@ -93,7 +93,7 @@
this._renderForm(options);
// rebuild the underlying data structure
- this.tree.finalize();
+ var current_state = this.tree.finalize();
// show errors on startup
if (options.initial_errors) {
@@ -102,9 +102,15 @@
// add refresh listener
this.on('refresh', function() {
- // by using/resetting the deferred ajax queue the number of redundant calls is reduced
- self.deferred.reset();
- self.deferred.execute(function(){self._updateModel()});
+ var new_state = self.tree.finalize();
+ if (!_.isEqual(new_state, current_state)) {
+ // backup current state
+ current_state = new_state;
+
+ // by using/resetting the deferred ajax queue the number of redundant calls is reduced
+ self.deferred.reset();
+ self.deferred.execute(function(){self._updateModel(current_state)});
+ }
});
// add reset listener
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 static/scripts/mvc/tools/tools-form-workflow.js
--- a/static/scripts/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/mvc/tools/tools-form-workflow.js
@@ -274,15 +274,15 @@
/** Request a new model for an already created tool form and updates the form inputs
*/
- _updateModel: function() {
+ _updateModel: function(current_state) {
// link self
var self = this;
// create the request dictionary
- var current_state = {
+ current_state = {
tool_id : this.options.id,
tool_version : this.options.version,
- inputs : this.tree.finalize()
+ inputs : current_state
}
// log tool state
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -115,7 +115,7 @@
});
// log tool state
- console.debug('tools-form::_refreshForm() - Refreshing states.');
+ console.debug('tools-form::_refreshForm() - Sending current state (see below).');
console.debug(current_state);
// activates/disables spinner for dynamic fields to indicate that they are currently being updated
@@ -188,7 +188,7 @@
self.deferred.done(process_id);
// log success
- console.debug('tools-form::_refreshForm() - States refreshed.');
+ console.debug('tools-form::_refreshForm() - Received new model (see below).');
console.debug(new_model);
},
error : function(response) {
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 static/scripts/packed/mvc/tools/tools-form-base.js
--- a/static/scripts/packed/mvc/tools/tools-form-base.js
+++ b/static/scripts/packed/mvc/tools/tools-form-base.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,narrow:false,initial_errors:false,cls_portlet:"ui-portlet-limited"};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this.build(this.options)},build:function(m){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);l.options.inputs=m&&m.inputs;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_renderForm:function(t){var s=this;this.message=new k.Message();var m=new k.ButtonMenu({icon:"fa-cubes",title:(!t.narrow&&"Versions")||null,tooltip:"Select another tool version"});if(t.versions&&t.versions.length>1){for(var o in t.versions){var q=t.versions[o];if(q!=t.version){m.addMenu({title:"Switch to "+q,version:q,icon:"fa-cube",onclick:function(){s.options.id=s.options.id.replace(s.options.version,this.version);s.options.version=this.version;s.deferred.reset();s.deferred.execute(function(){s._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!t.narrow&&"Options")||null,tooltip:"View available options"});if(t.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/t/"+t.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+t.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+t.id+"/download"}})}if(t.requirements&&t.requirements.length>0){p.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;s.message.update({persistent:true,message:c.requirements(t),status:"info"})}else{this.visible=false;s.message.update({message:""})}}})}if(this.options.sharable_url){p.addMenu({icon:"fa-external-link",title:"Open in Toolshed",tooltip:"Access the repository",onclick:function(){window.open(s.options.sharable_url)}})}this.section=new j.View(s,{inputs:t.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+t.name+"</b> "+t.description+" (Galaxy Tool Version "+t.version+")",cls:this.options.cls_portlet,operations:{menu:p,versions:m},buttons:this.buttons});this.portlet.append(this.message.$el.addClass("ui-margin-top"));this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(t.help!=""){this.$el.append(c.help(t.help))}if(t.citations){var r=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=t.id;var n=new a.CitationListView({el:r,collection:l});n.render();l.fetch();this.$el.append(r)}if(t.message){this.message.update({persistent:true,status:"warning",message:t.message})}console.debug("tools-form-base::initialize() - Completed.")}})});
\ No newline at end of file
+define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,narrow:false,initial_errors:false,cls_portlet:"ui-portlet-limited"};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this.build(this.options)},build:function(n){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);l.options.inputs=n&&n.inputs;this._renderForm(n);var m=this.tree.finalize();if(n.initial_errors){this._errors(n)}this.on("refresh",function(){var o=l.tree.finalize();if(!_.isEqual(o,m)){m=o;l.deferred.reset();l.deferred.execute(function(){l._updateModel(m)})}});this.on("reset",function(){for(var o in this.element_list){this.element_list[o].reset()}});this.trigger("refresh")},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_renderForm:function(t){var s=this;this.message=new k.Message();var m=new k.ButtonMenu({icon:"fa-cubes",title:(!t.narrow&&"Versions")||null,tooltip:"Select another tool version"});if(t.versions&&t.versions.length>1){for(var o in t.versions){var q=t.versions[o];if(q!=t.version){m.addMenu({title:"Switch to "+q,version:q,icon:"fa-cube",onclick:function(){s.options.id=s.options.id.replace(s.options.version,this.version);s.options.version=this.version;s.deferred.reset();s.deferred.execute(function(){s._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!t.narrow&&"Options")||null,tooltip:"View available options"});if(t.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(t.biostar_url+"/t/"+t.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+t.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+t.id+"/download"}})}if(t.requirements&&t.requirements.length>0){p.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;s.message.update({persistent:true,message:c.requirements(t),status:"info"})}else{this.visible=false;s.message.update({message:""})}}})}if(this.options.sharable_url){p.addMenu({icon:"fa-external-link",title:"Open in Toolshed",tooltip:"Access the repository",onclick:function(){window.open(s.options.sharable_url)}})}this.section=new j.View(s,{inputs:t.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+t.name+"</b> "+t.description+" (Galaxy Tool Version "+t.version+")",cls:this.options.cls_portlet,operations:{menu:p,versions:m},buttons:this.buttons});this.portlet.append(this.message.$el.addClass("ui-margin-top"));this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(t.help!=""){this.$el.append(c.help(t.help))}if(t.citations){var r=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=t.id;var n=new a.CitationListView({el:r,collection:l});n.render();l.fetch();this.$el.append(r)}if(t.message){this.message.update({persistent:true,status:"warning",message:t.message})}console.debug("tools-form-base::initialize() - Completed.")}})});
\ No newline at end of file
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 static/scripts/packed/mvc/tools/tools-form-workflow.js
--- a/static/scripts/packed/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/packed/mvc/tools/tools-form-workflow.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.post_job_actions=this.node.post_job_actions||{};this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";this.options.is_dynamic=false;this.options.narrow=true;this.options.initial_errors=true;this.options.cls_portlet="ui-portlet-narrow";b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var f=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(f){d[b.uuid()]={name:"pja__"+f+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+f])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}};d[b.uuid()]={name:"pja__"+f+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+f])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:""});var f={label:"Add Actions: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e={tool_id:this.options.id,tool_version:this.options.version,inputs:this.tree.finalize()};console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"api/workflows/build_module";b.request({type:"POST",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.post_job_actions=this.node.post_job_actions||{};this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";this.options.is_dynamic=false;this.options.narrow=true;this.options.initial_errors=true;this.options.cls_portlet="ui-portlet-narrow";b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var f=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(f){d[b.uuid()]={name:"pja__"+f+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+f])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}};d[b.uuid()]={name:"pja__"+f+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+f])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:""});var f={label:"Add Actions: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(e){var d=this;e={tool_id:this.options.id,tool_version:this.options.version,inputs:e};console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"api/workflows/build_module";b.request({type:"POST",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
diff -r 12b6e7c9d5667d280de5c1cfcbe7946bed324510 -r 86ac99a2896b87915e35b81db1320fdfe73bf556 static/scripts/packed/mvc/tools/tools-form.js
--- a/static/scripts/packed/mvc/tools/tools-form.js
+++ b/static/scripts/packed/mvc/tools/tools-form.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-misc","mvc/tools/tools-form-base","mvc/tools/tools-jobs"],function(c,e,b,a){var d=b.extend({initialize:function(g){var f=this;this.job_handler=new a(this);this.buttons={execute:new e.Button({icon:"fa-check",tooltip:"Execute: "+g.name,title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){f.job_handler.submit()}})};b.prototype.initialize.call(this,g)},_buildModel:function(){var f=this;var g=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){g+="job_id="+this.options.job_id}else{if(this.options.dataset_id){g+="dataset_id="+this.options.dataset_id}else{g+="tool_version="+this.options.version+"&";var i=top.location.href;var j=i.indexOf("?");if(i.indexOf("tool_id=")!=-1&&j!==-1){g+=i.slice(j+1)}}}var h=this.deferred.register();c.request({type:"GET",url:g,success:function(k){f.build(k);f.message.update({status:"success",message:"Now you are using '"+f.options.name+"' version "+f.options.version+".",persistent:false});f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(k)},error:function(k){f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(k);var l=k.error||"Uncaught error.";f.modal.show({title:"Tool cannot be executed",body:l,buttons:{Close:function(){f.modal.hide()}}})}})},_updateModel:function(){var f=this;var g=this.tree.finalize({data:function(l){try{if(l&&l.values[0].src==="hda"){return f.content.get({id:l.values[0].id,src:"hda"}).id_uncoded}}catch(k){console.debug("tools-form::_updateModel - Invalid or empty data input value.")}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(g);function j(n){for(var l in f.input_list){var m=f.field_list[l];var k=f.input_list[l];if(k.is_dynamic&&m.wait&&m.unwait){if(n){m.wait()}else{m.unwait()}}}}j(true);var i=this.deferred.register();var h=galaxy_config.root+"api/tools/"+this.options.id+"/build?tool_version="+this.options.version;c.request({type:"GET",url:h,data:g,success:function(k){f.tree.matchModel(k,function(m,q){var l=f.input_list[m];if(l&&l.options){if(!_.isEqual(l.options,q.options)){l.options=q.options;var r=f.field_list[m];if(r.update){var p=[];if((["data","data_collection","drill_down"]).indexOf(l.type)!=-1){p=l.options}else{for(var o in q.options){var n=q.options[o];if(n.length>2){p.push({label:n[0],value:n[1]})}}}r.update(p);r.trigger("change");console.debug("Updating options for "+m)}}}});j(false);f.deferred.done(i);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(k)},error:function(k){f.deferred.done(i);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(k)}})}});return{View:d}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-misc","mvc/tools/tools-form-base","mvc/tools/tools-jobs"],function(c,e,b,a){var d=b.extend({initialize:function(g){var f=this;this.job_handler=new a(this);this.buttons={execute:new e.Button({icon:"fa-check",tooltip:"Execute: "+g.name,title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){f.job_handler.submit()}})};b.prototype.initialize.call(this,g)},_buildModel:function(){var f=this;var g=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){g+="job_id="+this.options.job_id}else{if(this.options.dataset_id){g+="dataset_id="+this.options.dataset_id}else{g+="tool_version="+this.options.version+"&";var i=top.location.href;var j=i.indexOf("?");if(i.indexOf("tool_id=")!=-1&&j!==-1){g+=i.slice(j+1)}}}var h=this.deferred.register();c.request({type:"GET",url:g,success:function(k){f.build(k);f.message.update({status:"success",message:"Now you are using '"+f.options.name+"' version "+f.options.version+".",persistent:false});f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(k)},error:function(k){f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(k);var l=k.error||"Uncaught error.";f.modal.show({title:"Tool cannot be executed",body:l,buttons:{Close:function(){f.modal.hide()}}})}})},_updateModel:function(){var f=this;var g=this.tree.finalize({data:function(l){try{if(l&&l.values[0].src==="hda"){return f.content.get({id:l.values[0].id,src:"hda"}).id_uncoded}}catch(k){console.debug("tools-form::_updateModel - Invalid or empty data input value.")}return null}});console.debug("tools-form::_refreshForm() - Sending current state (see below).");console.debug(g);function j(n){for(var l in f.input_list){var m=f.field_list[l];var k=f.input_list[l];if(k.is_dynamic&&m.wait&&m.unwait){if(n){m.wait()}else{m.unwait()}}}}j(true);var i=this.deferred.register();var h=galaxy_config.root+"api/tools/"+this.options.id+"/build?tool_version="+this.options.version;c.request({type:"GET",url:h,data:g,success:function(k){f.tree.matchModel(k,function(m,q){var l=f.input_list[m];if(l&&l.options){if(!_.isEqual(l.options,q.options)){l.options=q.options;var r=f.field_list[m];if(r.update){var p=[];if((["data","data_collection","drill_down"]).indexOf(l.type)!=-1){p=l.options}else{for(var o in q.options){var n=q.options[o];if(n.length>2){p.push({label:n[0],value:n[1]})}}}r.update(p);r.trigger("change");console.debug("Updating options for "+m)}}}});j(false);f.deferred.done(i);console.debug("tools-form::_refreshForm() - Received new model (see below).");console.debug(k)},error:function(k){f.deferred.done(i);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(k)}})}});return{View:d}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: UI, paired collection creator: in-file TODO's, cleanup, change modal/creator render order to allow auto focus on name input
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/43b1d5b62c62/
Changeset: 43b1d5b62c62
User: carlfeberhard
Date: 2015-02-11 17:55:25+00:00
Summary: UI, paired collection creator: in-file TODO's, cleanup, change modal/creator render order to allow auto focus on name input
Affected #: 3 files
diff -r d00255be341d2b08af3fceeb2c8f46d3d6ce610b -r 43b1d5b62c62bfd40c86ac201d6cf8a6f388e29b client/galaxy/scripts/mvc/collection/paired-collection-creator.js
--- a/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
+++ b/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
@@ -6,10 +6,6 @@
], function( levenshteinDistance, naturalSort, baseMVC, _l ){
/* ============================================================================
TODO:
- _adjPairedOnScrollBar
- parition drag now doesn't stop when dragging down
- can push footer out of modal
- only *after* partition is all the way down once?
PROGRAMMATICALLY:
@@ -84,6 +80,7 @@
});
+// ============================================================================
/** returns an autopair function that uses the provided options.match function */
function autoPairFnBuilder( options ){
options = options || {};
@@ -182,6 +179,7 @@
}
+// ============================================================================
/** An interface for building collections of paired datasets.
*/
var PairedCollectionCreator = Backbone.View.extend( baseMVC.LoggableMixin ).extend({
@@ -254,8 +252,8 @@
/** map of common filter pairs by name */
commonFilters : {
- none : [ '', '' ],
- illumina : [ '_1', '_2' ]
+ illumina : [ '_1', '_2' ],
+ Rs : [ '_R1', '_R2' ]
},
/** which commonFilter to use by default */
DEFAULT_FILTERS : 'illumina',
@@ -469,7 +467,6 @@
/** create a pair from fwd and rev, removing them from unpaired, and placing the new pair in paired */
_pair : function( fwd, rev, options ){
options = options || {};
- //TODO: eventing, options
//this.debug( '_pair:', fwd, rev );
var pair = this._createPair( fwd, rev, options.name );
this.paired.push( pair );
@@ -493,19 +490,22 @@
/** try to find a good pair name for the given fwd and rev datasets */
_guessNameForPair : function( fwd, rev, removeExtensions ){
removeExtensions = ( removeExtensions !== undefined )?( removeExtensions ):( this.removeExtensions );
- var lcs = this._naiveStartingAndEndingLCS(
-//TODO: won't work with regex
- fwd.name.replace( this.filters[0], '' ),
- rev.name.replace( this.filters[1], '' )
- );
+ var fwdName = fwd.name,
+ revName = rev.name,
+ lcs = this._naiveStartingAndEndingLCS(
+ fwdName.replace( this.filters[0], '' ),
+ revName.replace( this.filters[1], '' )
+ );
if( removeExtensions ){
var lastDotIndex = lcs.lastIndexOf( '.' );
if( lastDotIndex > 0 ){
- lcs = lcs.slice( 0, lastDotIndex );
+ var extension = lcs.slice( lastDotIndex, lcs.length );
+ lcs = lcs.replace( extension, '' );
+ fwdName = fwdName.replace( extension, '' );
+ revName = revName.replace( extension, '' );
}
}
- //TODO: optionally remove extension
- return lcs || ( fwd.name + ' & ' + rev.name );
+ return lcs || ( fwdName + ' & ' + revName );
},
/** unpair a pair, removing it from paired, and adding the fwd,rev datasets back into unpaired */
@@ -535,7 +535,8 @@
// ------------------------------------------------------------------------ API
/** convert a pair into JSON compatible with the collections API */
- _pairToJSON : function( pair ){
+ _pairToJSON : function( pair, src ){
+ src = src || 'hda';
//TODO: consider making this the pair structure when created instead
return {
collection_type : 'paired',
@@ -544,13 +545,11 @@
element_identifiers : [{
name : 'forward',
id : pair.forward.id,
- //TODO: isn't necessarily true
- src : 'hda'
+ src : src
}, {
name : 'reverse',
id : pair.reverse.id,
- //TODO: isn't necessarily true
- src : 'hda'
+ src : src
}]
};
},
@@ -560,14 +559,9 @@
*/
createList : function( name ){
var creator = this,
- url;
- if( creator.historyId ){
url = '/api/histories/' + this.historyId + '/contents/dataset_collections';
- //} else {
- //
- }
-//TODO:?? Can't we use ListPairedCollection.create()
+ //TODO: use ListPairedCollection.create()
var ajaxData = {
type : 'dataset_collection',
collection_type : 'list:paired',
@@ -647,7 +641,6 @@
var $middle = this.$( '.middle' ).empty().html( PairedCollectionCreator.templates.middle() );
// (re-) hide the un/paired panels based on instance vars
- //TODO: use replaceWith
if( this.unpairedPanelHidden ){
this.$( '.unpaired-columns' ).hide();
} else if( this.pairedPanelHidden ){
@@ -701,7 +694,8 @@
return;
}
// add to appropo cols
- //TODO: not the best way to render
+ //TODO: not the best way to render - consider rendering the entire unpaired-columns section in a fragment
+ // and swapping out that
this.$( '.unpaired-columns .forward-column .column-datasets' ).append( $fwd )
.add( this.$( '.unpaired-columns .paired-column .column-datasets' ).append( $prd ) )
.add( this.$( '.unpaired-columns .reverse-column .column-datasets' ).append( $rev ) );
@@ -776,12 +770,11 @@
this.$( '.paired-columns .column-datasets' ).empty();
var creator = this;
this.paired.forEach( function( pair, i ){
-//TODO: cache these?
+ //TODO: cache these?
var pairView = new PairView({ pair: pair });
creator.$( '.paired-columns .column-datasets' )
.append( pairView.render().$el )
.append([
-//TODO: data-index="i"
'<button class="unpair-btn">',
'<span class="fa fa-unlink" title="', _l( 'Unpair' ), '"></span>',
'</button>'
@@ -828,9 +821,9 @@
'<div class="help">',
_l( 'Choose from the following filters to change which unpaired reads are shown in the display' ),
':</div>',
- //TODO: connect with common filters
- filterChoice( '_1', '_2' ),
- filterChoice( '_R1', '_R2' ),
+ _.values( this.commonFilters ).map( function( filterSet ){
+ return filterChoice( filterSet[0], filterSet[1] );
+ }).join( '' ),
'</div>'
].join(''))({}));
@@ -927,7 +920,7 @@
'click .forward-column .column-title' : '_clickShowOnlyUnpaired',
'click .reverse-column .column-title' : '_clickShowOnlyUnpaired',
'click .unpair-all-link' : '_clickUnpairAll',
- //TODO: this seems kinda backasswards
+ //TODO: this seems kinda backasswards - re-sending jq event as a backbone event, can we listen directly?
'change .forward-unpaired-filter input' : function( ev ){ this.trigger( 'filter-change' ); },
'focus .forward-unpaired-filter input' : function( ev ){ $( ev.currentTarget ).select(); },
'click .autopair-link' : '_clickAutopair',
@@ -995,7 +988,6 @@
this.$( '.header .alert' ).hide();
},
- //TODO: consolidate these
/** toggle between showing only unpaired and split view */
_clickShowOnlyUnpaired : function( ev ){
//this.debug( 'click unpaired', ev.currentTarget );
@@ -1107,7 +1099,6 @@
fwds = [],
revs = [],
pairs = [];
- //TODO: could be made more concise
creator.$( '.unpaired-columns .forward-column .dataset.selected' ).each( function(){
fwds.push( $( this ).data( 'dataset' ) );
});
@@ -1163,12 +1154,10 @@
fwd = $( '.unpaired-columns .forward-column .dataset' ).eq( rowIndex ).data( 'dataset' ),
rev = $( '.unpaired-columns .reverse-column .dataset' ).eq( rowIndex ).data( 'dataset' );
//this.debug( 'row:', rowIndex, fwd, rev );
- //TODO: animate
this._pair( fwd, rev );
},
// ........................................................................ divider/partition
-//TODO: simplify
/** start dragging the visible divider/partition between unpaired and paired panes */
_startPartitionDrag : function( ev ){
var creator = this,
@@ -1208,7 +1197,6 @@
unpairedHi = Math.max( 10, unpairedHi + adj );
pairedHi = pairedHi - adj;
-//TODO: seems like shouldn't need this (it should be part of the hide/show/splitView)
var movingUpwards = adj < 0;
// when the divider gets close to the top - lock into hiding the unpaired section
if( movingUpwards ){
@@ -1272,7 +1260,7 @@
pair.name = response;
// set a flag (which won't be passed in json creation) for manual naming so we don't overwrite these
// when adding/removing extensions
- //TODO: kinda hacky
+ //hackish
pair.customizedName = true;
$name.text( pair.name );
}
@@ -1281,10 +1269,8 @@
/** unpair this pair */
_clickUnpair : function( ev ){
//if( !ev.currentTarget ){ return true; }
- //TODO: this is a hack bc each paired rev now has two elems (dataset, button)
var pairIndex = Math.floor( $( ev.currentTarget ).index( '.unpair-btn' ) );
//this.debug( 'pair:', pairIndex );
- //TODO: animate
this._unpair( this.paired[ pairIndex ] );
},
@@ -1367,7 +1353,7 @@
/** resync the creator's list of paired based on the DOM order of pairs */
_syncPairsToDom : function(){
var newPaired = [];
-//TODO: ugh
+ //TODO: doesn't seem wise to use the dom to store these - can't we sync another way?
this.$( '.paired-columns .dataset.paired' ).each( function(){
newPaired.push( $( this ).data( 'pair' ) );
});
@@ -1702,7 +1688,7 @@
throw new Error( 'Galaxy or Galaxy.modal not found' );
}
- var creator = new PairedCollectionCreator( options ).render();
+ var creator = new PairedCollectionCreator( options );
Galaxy.modal.show({
title : 'Create a collection of paired datasets',
body : creator.$el,
@@ -1710,6 +1696,7 @@
height : '800px',
closing_events: true
});
+ creator.render();
//TODO: remove modal header
window.PCC = creator;
return creator;
diff -r d00255be341d2b08af3fceeb2c8f46d3d6ce610b -r 43b1d5b62c62bfd40c86ac201d6cf8a6f388e29b static/scripts/mvc/collection/paired-collection-creator.js
--- a/static/scripts/mvc/collection/paired-collection-creator.js
+++ b/static/scripts/mvc/collection/paired-collection-creator.js
@@ -6,10 +6,6 @@
], function( levenshteinDistance, naturalSort, baseMVC, _l ){
/* ============================================================================
TODO:
- _adjPairedOnScrollBar
- parition drag now doesn't stop when dragging down
- can push footer out of modal
- only *after* partition is all the way down once?
PROGRAMMATICALLY:
@@ -84,6 +80,7 @@
});
+// ============================================================================
/** returns an autopair function that uses the provided options.match function */
function autoPairFnBuilder( options ){
options = options || {};
@@ -182,6 +179,7 @@
}
+// ============================================================================
/** An interface for building collections of paired datasets.
*/
var PairedCollectionCreator = Backbone.View.extend( baseMVC.LoggableMixin ).extend({
@@ -254,8 +252,8 @@
/** map of common filter pairs by name */
commonFilters : {
- none : [ '', '' ],
- illumina : [ '_1', '_2' ]
+ illumina : [ '_1', '_2' ],
+ Rs : [ '_R1', '_R2' ]
},
/** which commonFilter to use by default */
DEFAULT_FILTERS : 'illumina',
@@ -469,7 +467,6 @@
/** create a pair from fwd and rev, removing them from unpaired, and placing the new pair in paired */
_pair : function( fwd, rev, options ){
options = options || {};
- //TODO: eventing, options
//this.debug( '_pair:', fwd, rev );
var pair = this._createPair( fwd, rev, options.name );
this.paired.push( pair );
@@ -493,19 +490,22 @@
/** try to find a good pair name for the given fwd and rev datasets */
_guessNameForPair : function( fwd, rev, removeExtensions ){
removeExtensions = ( removeExtensions !== undefined )?( removeExtensions ):( this.removeExtensions );
- var lcs = this._naiveStartingAndEndingLCS(
-//TODO: won't work with regex
- fwd.name.replace( this.filters[0], '' ),
- rev.name.replace( this.filters[1], '' )
- );
+ var fwdName = fwd.name,
+ revName = rev.name,
+ lcs = this._naiveStartingAndEndingLCS(
+ fwdName.replace( this.filters[0], '' ),
+ revName.replace( this.filters[1], '' )
+ );
if( removeExtensions ){
var lastDotIndex = lcs.lastIndexOf( '.' );
if( lastDotIndex > 0 ){
- lcs = lcs.slice( 0, lastDotIndex );
+ var extension = lcs.slice( lastDotIndex, lcs.length );
+ lcs = lcs.replace( extension, '' );
+ fwdName = fwdName.replace( extension, '' );
+ revName = revName.replace( extension, '' );
}
}
- //TODO: optionally remove extension
- return lcs || ( fwd.name + ' & ' + rev.name );
+ return lcs || ( fwdName + ' & ' + revName );
},
/** unpair a pair, removing it from paired, and adding the fwd,rev datasets back into unpaired */
@@ -535,7 +535,8 @@
// ------------------------------------------------------------------------ API
/** convert a pair into JSON compatible with the collections API */
- _pairToJSON : function( pair ){
+ _pairToJSON : function( pair, src ){
+ src = src || 'hda';
//TODO: consider making this the pair structure when created instead
return {
collection_type : 'paired',
@@ -544,13 +545,11 @@
element_identifiers : [{
name : 'forward',
id : pair.forward.id,
- //TODO: isn't necessarily true
- src : 'hda'
+ src : src
}, {
name : 'reverse',
id : pair.reverse.id,
- //TODO: isn't necessarily true
- src : 'hda'
+ src : src
}]
};
},
@@ -560,14 +559,9 @@
*/
createList : function( name ){
var creator = this,
- url;
- if( creator.historyId ){
url = '/api/histories/' + this.historyId + '/contents/dataset_collections';
- //} else {
- //
- }
-//TODO:?? Can't we use ListPairedCollection.create()
+ //TODO: use ListPairedCollection.create()
var ajaxData = {
type : 'dataset_collection',
collection_type : 'list:paired',
@@ -647,7 +641,6 @@
var $middle = this.$( '.middle' ).empty().html( PairedCollectionCreator.templates.middle() );
// (re-) hide the un/paired panels based on instance vars
- //TODO: use replaceWith
if( this.unpairedPanelHidden ){
this.$( '.unpaired-columns' ).hide();
} else if( this.pairedPanelHidden ){
@@ -701,7 +694,8 @@
return;
}
// add to appropo cols
- //TODO: not the best way to render
+ //TODO: not the best way to render - consider rendering the entire unpaired-columns section in a fragment
+ // and swapping out that
this.$( '.unpaired-columns .forward-column .column-datasets' ).append( $fwd )
.add( this.$( '.unpaired-columns .paired-column .column-datasets' ).append( $prd ) )
.add( this.$( '.unpaired-columns .reverse-column .column-datasets' ).append( $rev ) );
@@ -776,12 +770,11 @@
this.$( '.paired-columns .column-datasets' ).empty();
var creator = this;
this.paired.forEach( function( pair, i ){
-//TODO: cache these?
+ //TODO: cache these?
var pairView = new PairView({ pair: pair });
creator.$( '.paired-columns .column-datasets' )
.append( pairView.render().$el )
.append([
-//TODO: data-index="i"
'<button class="unpair-btn">',
'<span class="fa fa-unlink" title="', _l( 'Unpair' ), '"></span>',
'</button>'
@@ -828,9 +821,9 @@
'<div class="help">',
_l( 'Choose from the following filters to change which unpaired reads are shown in the display' ),
':</div>',
- //TODO: connect with common filters
- filterChoice( '_1', '_2' ),
- filterChoice( '_R1', '_R2' ),
+ _.values( this.commonFilters ).map( function( filterSet ){
+ return filterChoice( filterSet[0], filterSet[1] );
+ }).join( '' ),
'</div>'
].join(''))({}));
@@ -927,7 +920,7 @@
'click .forward-column .column-title' : '_clickShowOnlyUnpaired',
'click .reverse-column .column-title' : '_clickShowOnlyUnpaired',
'click .unpair-all-link' : '_clickUnpairAll',
- //TODO: this seems kinda backasswards
+ //TODO: this seems kinda backasswards - re-sending jq event as a backbone event, can we listen directly?
'change .forward-unpaired-filter input' : function( ev ){ this.trigger( 'filter-change' ); },
'focus .forward-unpaired-filter input' : function( ev ){ $( ev.currentTarget ).select(); },
'click .autopair-link' : '_clickAutopair',
@@ -995,7 +988,6 @@
this.$( '.header .alert' ).hide();
},
- //TODO: consolidate these
/** toggle between showing only unpaired and split view */
_clickShowOnlyUnpaired : function( ev ){
//this.debug( 'click unpaired', ev.currentTarget );
@@ -1107,7 +1099,6 @@
fwds = [],
revs = [],
pairs = [];
- //TODO: could be made more concise
creator.$( '.unpaired-columns .forward-column .dataset.selected' ).each( function(){
fwds.push( $( this ).data( 'dataset' ) );
});
@@ -1163,12 +1154,10 @@
fwd = $( '.unpaired-columns .forward-column .dataset' ).eq( rowIndex ).data( 'dataset' ),
rev = $( '.unpaired-columns .reverse-column .dataset' ).eq( rowIndex ).data( 'dataset' );
//this.debug( 'row:', rowIndex, fwd, rev );
- //TODO: animate
this._pair( fwd, rev );
},
// ........................................................................ divider/partition
-//TODO: simplify
/** start dragging the visible divider/partition between unpaired and paired panes */
_startPartitionDrag : function( ev ){
var creator = this,
@@ -1208,7 +1197,6 @@
unpairedHi = Math.max( 10, unpairedHi + adj );
pairedHi = pairedHi - adj;
-//TODO: seems like shouldn't need this (it should be part of the hide/show/splitView)
var movingUpwards = adj < 0;
// when the divider gets close to the top - lock into hiding the unpaired section
if( movingUpwards ){
@@ -1272,7 +1260,7 @@
pair.name = response;
// set a flag (which won't be passed in json creation) for manual naming so we don't overwrite these
// when adding/removing extensions
- //TODO: kinda hacky
+ //hackish
pair.customizedName = true;
$name.text( pair.name );
}
@@ -1281,10 +1269,8 @@
/** unpair this pair */
_clickUnpair : function( ev ){
//if( !ev.currentTarget ){ return true; }
- //TODO: this is a hack bc each paired rev now has two elems (dataset, button)
var pairIndex = Math.floor( $( ev.currentTarget ).index( '.unpair-btn' ) );
//this.debug( 'pair:', pairIndex );
- //TODO: animate
this._unpair( this.paired[ pairIndex ] );
},
@@ -1367,7 +1353,7 @@
/** resync the creator's list of paired based on the DOM order of pairs */
_syncPairsToDom : function(){
var newPaired = [];
-//TODO: ugh
+ //TODO: doesn't seem wise to use the dom to store these - can't we sync another way?
this.$( '.paired-columns .dataset.paired' ).each( function(){
newPaired.push( $( this ).data( 'pair' ) );
});
@@ -1702,7 +1688,7 @@
throw new Error( 'Galaxy or Galaxy.modal not found' );
}
- var creator = new PairedCollectionCreator( options ).render();
+ var creator = new PairedCollectionCreator( options );
Galaxy.modal.show({
title : 'Create a collection of paired datasets',
body : creator.$el,
@@ -1710,6 +1696,7 @@
height : '800px',
closing_events: true
});
+ creator.render();
//TODO: remove modal header
window.PCC = creator;
return creator;
diff -r d00255be341d2b08af3fceeb2c8f46d3d6ce610b -r 43b1d5b62c62bfd40c86ac201d6cf8a6f388e29b static/scripts/packed/mvc/collection/paired-collection-creator.js
--- a/static/scripts/packed/mvc/collection/paired-collection-creator.js
+++ b/static/scripts/packed/mvc/collection/paired-collection-creator.js
@@ -1,1 +1,1 @@
-define(["utils/levenshtein","utils/natural-sort","mvc/base-mvc","utils/localization"],function(h,b,f,c){var i=Backbone.View.extend(f.LoggableMixin).extend({tagName:"li",className:"dataset paired",initialize:function(l){this.pair=l.pair||{}},template:_.template(['<span class="forward-dataset-name flex-column"><%= pair.forward.name %></span>','<span class="pair-name-column flex-column">','<span class="pair-name"><%= pair.name %></span>',"</span>",'<span class="reverse-dataset-name flex-column"><%= pair.reverse.name %></span>'].join("")),render:function(){this.$el.attr("draggable",true).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container");return this},events:{dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(l){l.currentTarget.style.opacity="0.4";if(l.originalEvent){l=l.originalEvent}l.dataTransfer.effectAllowed="move";l.dataTransfer.setData("text/plain",JSON.stringify(this.pair));this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(l){l.currentTarget.style.opacity="1.0";this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(l){this.$el.parent().trigger(l)},toString:function(){return"PairView("+this.pair.name+")"}});function g(m){m=m||{};m.createPair=m.createPair||function l(r){this.debug("creating pair:",r.listA[r.indexA].name,r.listB[r.indexB].name);r=r||{};return this._pair(r.listA.splice(r.indexA,1)[0],r.listB.splice(r.indexB,1)[0],{silent:true})};var o=[];function q(){if(!o.length){o=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]}return o}m.preprocessMatch=m.preprocessMatch||function n(s){var r=q.call(this);return _.extend(s,{matchTo:s.matchTo.name.replace(r[0],""),possible:s.possible.name.replace(r[1],"")})};return function p(t){this.debug("autopair _strategy ---------------------------");t=t||{};var r=t.listA,A=t.listB,z=0,y,v={score:0,index:null},x=[];this.debug("starting list lens:",r.length,A.length);this.debug("bestMatch (starting):",JSON.stringify(v,null," "));while(z<r.length){var w=r[z];v.score=0;for(y=0;y<A.length;y++){var u=A[y];this.debug(z+":"+w.name);this.debug(y+":"+u.name);if(r[z]!==A[y]){v=m.match.call(this,m.preprocessMatch.call(this,{matchTo:w,possible:u,index:y,bestMatch:v}));this.debug("bestMatch:",JSON.stringify(v,null," "));if(v.score===1){this.debug("breaking early due to perfect match");break}}}var s=m.scoreThreshold.call(this);this.debug("scoreThreshold:",s);this.debug("bestMatch.score:",v.score);if(v.score>=s){this.debug("creating pair");x.push(m.createPair.call(this,{listA:r,indexA:z,listB:A,indexB:v.index}));this.debug("list lens now:",r.length,A.length)}else{z+=1}if(!r.length||!A.length){return x}}this.debug("paired:",JSON.stringify(x,null," "));this.debug("autopair _strategy ---------------------------");return x}}var k=Backbone.View.extend(f.LoggableMixin).extend({className:"collection-creator flex-row-container",initialize:function(l){l=_.defaults(l,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:true,strategy:"lcs",matchPercentage:0.9,twoPassAutopairing:true});this.initialList=l.datasets;this.historyId=l.historyId;this.filters=this.commonFilters[l.filters]||this.commonFilters[this.DEFAULT_FILTERS];if(_.isArray(l.filters)){this.filters=l.filters}this.automaticallyPair=l.automaticallyPair;this.strategy=this.strategies[l.strategy]||this.strategies[this.DEFAULT_STRATEGY];if(_.isFunction(l.strategy)){this.strategy=l.strategy}this.matchPercentage=l.matchPercentage;this.twoPassAutopairing=l.twoPassAutopairing;this.removeExtensions=true;this.oncancel=l.oncancel;this.oncreate=l.oncreate;this.autoscrollDist=l.autoscrollDist||24;this.unpairedPanelHidden=false;this.pairedPanelHidden=false;this.$dragging=null;this._setUpBehaviors();this._dataSetUp()},commonFilters:{none:["",""],illumina:["_1","_2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[];this.unpaired=[];this.selectedIds=[];this._sortInitialList();this._ensureIds();this.unpaired=this.initialList.slice(0);if(this.automaticallyPair){this.autoPair();this.once("rendered:initial",function(){this.trigger("autopair")})}},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(l){l.sort(function(n,m){return b(n.name,m.name)});return l},_ensureIds:function(){this.initialList.forEach(function(l){if(!l.hasOwnProperty("id")){l.id=_.uniqueId()}});return this.initialList},_splitByFilters:function(){var o=this.filters.map(function(p){return new RegExp(p)}),m=[[],[]];function n(p,q){return q.test(p.name)}this.unpaired.forEach(function l(p){o.forEach(function(r,q){if(n(p,r)){m[q].push(p)}})});return m},_addToUnpaired:function(m){var l=function(n,p){if(n===p){return n}var o=Math.floor((p-n)/2)+n,q=b(m.name,this.unpaired[o].name);if(q<0){return l(n,o)}else{if(q>0){return l(o+1,p)}}while(this.unpaired[o]&&this.unpaired[o].name===m.name){o++}return o}.bind(this);this.unpaired.splice(l(0,this.unpaired.length),0,m)},autoPair:function(n){var m=this._splitByFilters(),l=[];if(this.twoPassAutopairing){l=this.autopairSimple({listA:m[0],listB:m[1]});m=this._splitByFilters()}n=n||this.strategy;m=this._splitByFilters();l=l.concat(this[n].call(this,{listA:m[0],listB:m[1]}));return l},autopairSimple:g({scoreThreshold:function(){return 1},match:function j(l){l=l||{};if(l.matchTo===l.possible){return{index:l.index,score:1}}return l.bestMatch}}),autopairLevenshtein:g({scoreThreshold:function(){return this.matchPercentage},match:function e(m){m=m||{};var n=h(m.matchTo,m.possible),l=1-(n/(Math.max(m.matchTo.length,m.possible.length)));if(l>m.bestMatch.score){return{index:m.index,score:l}}return m.bestMatch}}),autopairLCS:g({scoreThreshold:function(){return this.matchPercentage},match:function e(n){n=n||{};var l=this._naiveStartingAndEndingLCS(n.matchTo,n.possible).length,m=l/(Math.max(n.matchTo.length,n.possible.length));if(m>n.bestMatch.score){return{index:n.index,score:m}}return n.bestMatch}}),_naiveStartingAndEndingLCS:function(o,m){var p="",q="",n=0,l=0;while(n<o.length&&n<m.length){if(o[n]!==m[n]){break}p+=o[n];n+=1}if(n===o.length){return o}if(n===m.length){return m}n=(o.length-1);l=(m.length-1);while(n>=0&&l>=0){if(o[n]!==m[l]){break}q=[o[n],q].join("");n-=1;l-=1}return p+q},_pair:function(n,l,m){m=m||{};var o=this._createPair(n,l,m.name);this.paired.push(o);this.unpaired=_.without(this.unpaired,n,l);if(!m.silent){this.trigger("pair:new",o)}return o},_createPair:function(n,l,m){if(!(n&&l)||(n===l)){throw new Error("Bad pairing: "+[JSON.stringify(n),JSON.stringify(l)])}m=m||this._guessNameForPair(n,l);return{forward:n,name:m,reverse:l}},_guessNameForPair:function(n,l,o){o=(o!==undefined)?(o):(this.removeExtensions);var m=this._naiveStartingAndEndingLCS(n.name.replace(this.filters[0],""),l.name.replace(this.filters[1],""));if(o){var p=m.lastIndexOf(".");if(p>0){m=m.slice(0,p)}}return m||(n.name+" & "+l.name)},_unpair:function(m,l){l=l||{};if(!m){throw new Error("Bad pair: "+JSON.stringify(m))}this.paired=_.without(this.paired,m);this._addToUnpaired(m.forward);this._addToUnpaired(m.reverse);if(!l.silent){this.trigger("pair:unpair",[m])}return m},unpairAll:function(){var l=[];while(this.paired.length){l.push(this._unpair(this.paired[0],{silent:true}))}this.trigger("pair:unpair",l)},_pairToJSON:function(l){return{collection_type:"paired",src:"new_collection",name:l.name,element_identifiers:[{name:"forward",id:l.forward.id,src:"hda"},{name:"reverse",id:l.reverse.id,src:"hda"}]}},createList:function(n){var o=this,m;if(o.historyId){m="/api/histories/"+this.historyId+"/contents/dataset_collections"}var l={type:"dataset_collection",collection_type:"list:paired",name:_.escape(n||o.$(".collection-name").val()),element_identifiers:o.paired.map(function(p){return o._pairToJSON(p)})};return jQuery.ajax(m,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(l)}).fail(function(r,p,q){o._ajaxErrHandler(r,p,q)}).done(function(p,q,r){o.trigger("collection:created",p,q,r);if(typeof o.oncreate==="function"){o.oncreate.call(this,p,q,r)}})},_ajaxErrHandler:function(o,l,n){this.error(o,l,n);var m=c("An error occurred while creating this collection");if(o){if(o.readyState===0&&o.status===0){m+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes.")}else{if(o.responseJSON){m+="<br /><pre>"+JSON.stringify(o.responseJSON)+"</pre>"}else{m+=": "+n}}}creator._showAlert(m,"alert-danger")},render:function(l,m){this.$el.empty().html(k.templates.main());this._renderHeader(l);this._renderMiddle(l);this._renderFooter(l);this._addPluginComponents();this.trigger("rendered",this);return this},_renderHeader:function(m,n){var l=this.$(".header").empty().html(k.templates.header()).find(".help-content").prepend($(k.templates.helpContent()));this._renderFilters();return l},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(m,n){var l=this.$(".middle").empty().html(k.templates.middle());if(this.unpairedPanelHidden){this.$(".unpaired-columns").hide()}else{if(this.pairedPanelHidden){this.$(".paired-columns").hide()}}this._renderUnpaired();this._renderPaired();return l},_renderUnpaired:function(q,r){var o=this,p,m,l=[],n=this._splitByFilters();this.$(".forward-column .title").text([n[0].length,c("unpaired forward")].join(" "));this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[0].length));this.$(".reverse-column .title").text([n[1].length,c("unpaired reverse")].join(" "));this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[1].length));this.$(".unpaired-columns .column-datasets").empty();this.$(".autopair-link").toggle(this.unpaired.length!==0);if(this.unpaired.length===0){this._renderUnpairedEmpty();return}m=n[1].map(function(t,s){if((n[0][s]!==undefined)&&(n[0][s]!==t)){l.push(o._renderPairButton())}return o._renderUnpairedDataset(t)});p=n[0].map(function(s){return o._renderUnpairedDataset(s)});if(!p.length&&!m.length){this._renderUnpairedNotShown();return}this.$(".unpaired-columns .forward-column .column-datasets").append(p).add(this.$(".unpaired-columns .paired-column .column-datasets").append(l)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(m));this._adjUnpairedOnScrollbar()},_renderUnpairedDisplayStr:function(l){return["(",l," ",c("filtered out"),")"].join("")},_renderUnpairedDataset:function(l){return $("<li/>").attr("id","dataset-"+l.id).addClass("dataset unpaired").attr("draggable",true).addClass(l.selected?"selected":"").append($("<span/>").addClass("dataset-name").text(l.name)).data("dataset",l)},_renderPairButton:function(){return $("<li/>").addClass("dataset unpaired").append($("<span/>").addClass("dataset-name").text(c("Pair these datasets")))},_renderUnpairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no remaining unpaired datasets")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_renderUnpairedNotShown:function(){var l=$('<div class="empty-message"></div>').text("("+c("no datasets were found matching the current filters")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_adjUnpairedOnScrollbar:function(){var o=this.$(".unpaired-columns").last(),p=this.$(".unpaired-columns .reverse-column .dataset").first();if(!p.size()){return}var l=o.offset().left+o.outerWidth(),n=p.offset().left+p.outerWidth(),m=Math.floor(l)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",(m>0)?m:0)},_renderPaired:function(m,n){this.$(".paired-column-title .title").text([this.paired.length,c("paired")].join(" "));this.$(".unpair-all-link").toggle(this.paired.length!==0);if(this.paired.length===0){this._renderPairedEmpty();return}else{this.$(".remove-extensions-link").show()}this.$(".paired-columns .column-datasets").empty();var l=this;this.paired.forEach(function(q,o){var p=new i({pair:q});l.$(".paired-columns .column-datasets").append(p.render().$el).append(['<button class="unpair-btn">','<span class="fa fa-unlink" title="',c("Unpair"),'"></span>',"</button>"].join(""))})},_renderPairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no paired datasets yet")+")");this.$(".paired-columns .column-datasets").empty().prepend(l);return l},_renderFooter:function(m,n){var l=this.$(".footer").empty().html(k.templates.footer());this.$(".remove-extensions").prop("checked",this.removeExtensions);if(typeof this.oncancel==="function"){this.$(".cancel-create.btn").show()}return l},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link");this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(l){function m(p,o){return['<button class="filter-choice btn" ','data-forward="',p,'" data-reverse="',o,'">',c("Forward"),": ",p,", ",c("Reverse"),": ",o,"</button>"].join("")}var n=$(_.template(['<div class="choose-filters">','<div class="help">',c("Choose from the following filters to change which unpaired reads are shown in the display"),":</div>",m("_1","_2"),m("_R1","_R2"),"</div>"].join(""))({}));return this.$(l).popover({container:".collection-creator",placement:"bottom",html:true,content:n})},_validationWarning:function(m,l){var n="validation-warning";if(m==="name"){m=this.$(".collection-name").add(this.$(".collection-name-prompt"));this.$(".collection-name").focus().select()}if(l){m=m||this.$("."+n);m.removeClass(n)}else{m.addClass(n)}},_setUpBehaviors:function(){this.once("rendered",function(){this.trigger("rendered:initial",this)});this.on("pair:new",function(){this._renderUnpaired();this._renderPaired();this.$(".paired-columns").scrollTop(8000000)});this.on("pair:unpair",function(l){this._renderUnpaired();this._renderPaired();this.splitView()});this.on("filter-change",function(){this.filters=[this.$(".forward-unpaired-filter input").val(),this.$(".reverse-unpaired-filter input").val()];this._renderFilters();this._renderUnpaired()});this.on("autopair",function(){this._renderUnpaired();this._renderPaired();var l,m=null;if(this.paired.length){m="alert-success";l=this.paired.length+" "+c("pairs created");if(!this.unpaired.length){l+=": "+c("all datasets have been successfully paired");this.hideUnpaired();this.$(".collection-name").focus()}}else{l=c("Could not automatically create any pairs from the given dataset names")}this._showAlert(l,m)});return this},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .header .alert button":"_hideAlert","click .forward-column .column-title":"_clickShowOnlyUnpaired","click .reverse-column .column-title":"_clickShowOnlyUnpaired","click .unpair-all-link":"_clickUnpairAll","change .forward-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .forward-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .autopair-link":"_clickAutopair","click .choose-filters .filter-choice":"_clickFilterChoice","click .clear-filters-link":"_clearFilters","change .reverse-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .reverse-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .forward-column .dataset.unpaired":"_clickUnpairedDataset","click .reverse-column .dataset.unpaired":"_clickUnpairedDataset","click .paired-column .dataset.unpaired":"_clickPairRow","click .unpaired-columns":"clearSelectedUnpaired","mousedown .unpaired-columns .dataset":"_mousedownUnpaired","click .paired-column-title":"_clickShowOnlyPaired","mousedown .flexible-partition-drag":"_startPartitionDrag","click .paired-columns .dataset.paired":"selectPair","click .paired-columns":"clearSelectedPaired","click .paired-columns .pair-name":"_clickPairName","click .unpair-btn":"_clickUnpair","dragover .paired-columns .column-datasets":"_dragoverPairedColumns","drop .paired-columns .column-datasets":"_dropPairedColumns","pair.dragstart .paired-columns .column-datasets":"_pairDragstart","pair.dragend .paired-columns .column-datasets":"_pairDragend","change .remove-extensions":function(l){this.toggleExtensions()},"change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","click .cancel-create":function(l){if(typeof this.oncancel==="function"){this.oncancel.call(this)}},"click .create-collection":"_clickCreate"},_clickMoreHelp:function(l){this.$(".main-help").addClass("expanded");this.$(".more-help").hide()},_clickLessHelp:function(l){this.$(".main-help").removeClass("expanded");this.$(".more-help").show()},_showAlert:function(m,l){l=l||"alert-danger";this.$(".main-help").hide();this.$(".header .alert").attr("class","alert alert-dismissable").addClass(l).show().find(".alert-message").html(m)},_hideAlert:function(l){this.$(".main-help").show();this.$(".header .alert").hide()},_clickShowOnlyUnpaired:function(l){if(this.$(".paired-columns").is(":visible")){this.hidePaired()}else{this.splitView()}},_clickShowOnlyPaired:function(l){if(this.$(".unpaired-columns").is(":visible")){this.hideUnpaired()}else{this.splitView()}},hideUnpaired:function(l,m){this.unpairedPanelHidden=true;this.pairedPanelHidden=false;this._renderMiddle(l,m)},hidePaired:function(l,m){this.unpairedPanelHidden=false;this.pairedPanelHidden=true;this._renderMiddle(l,m)},splitView:function(l,m){this.unpairedPanelHidden=this.pairedPanelHidden=false;this._renderMiddle(l,m);return this},_clickUnpairAll:function(l){this.unpairAll()},_clickAutopair:function(l){this.autoPair();this.trigger("autopair")},_clickFilterChoice:function(m){var l=$(m.currentTarget);this.$(".forward-unpaired-filter input").val(l.data("forward"));this.$(".reverse-unpaired-filter input").val(l.data("reverse"));this._hideChooseFilters();this.trigger("filter-change")},_hideChooseFilters:function(){this.$(".choose-filters-link").popover("hide");this.$(".popover").css("display","none")},_clearFilters:function(l){this.$(".forward-unpaired-filter input").val("");this.$(".reverse-unpaired-filter input").val("");this.trigger("filter-change")},_clickUnpairedDataset:function(l){l.stopPropagation();return this.toggleSelectUnpaired($(l.currentTarget))},toggleSelectUnpaired:function(n,m){m=m||{};var o=n.data("dataset"),l=m.force!==undefined?m.force:!n.hasClass("selected");if(!n.size()||o===undefined){return n}if(l){n.addClass("selected");if(!m.waitToPair){this.pairAllSelected()}}else{n.removeClass("selected")}return n},pairAllSelected:function(m){m=m||{};var n=this,o=[],l=[],p=[];n.$(".unpaired-columns .forward-column .dataset.selected").each(function(){o.push($(this).data("dataset"))});n.$(".unpaired-columns .reverse-column .dataset.selected").each(function(){l.push($(this).data("dataset"))});o.length=l.length=Math.min(o.length,l.length);o.forEach(function(r,q){try{p.push(n._pair(r,l[q],{silent:true}))}catch(s){n.error(s)}});if(p.length&&!m.silent){this.trigger("pair:new",p)}return p},clearSelectedUnpaired:function(){this.$(".unpaired-columns .dataset.selected").removeClass("selected")},_mousedownUnpaired:function(n){if(n.shiftKey){var m=this,l=$(n.target).addClass("selected"),o=function(p){m.$(p.target).filter(".dataset").addClass("selected")};l.parent().on("mousemove",o);$(document).one("mouseup",function(p){l.parent().off("mousemove",o);m.pairAllSelected()})}},_clickPairRow:function(n){var o=$(n.currentTarget).index(),m=$(".unpaired-columns .forward-column .dataset").eq(o).data("dataset"),l=$(".unpaired-columns .reverse-column .dataset").eq(o).data("dataset");this._pair(m,l)},_startPartitionDrag:function(m){var l=this,p=m.pageY;$("body").css("cursor","ns-resize");l.$(".flexible-partition-drag").css("color","black");function o(q){l.$(".flexible-partition-drag").css("color","");$("body").css("cursor","").unbind("mousemove",n)}function n(q){var r=q.pageY-p;if(!l.adjPartition(r)){$("body").trigger("mouseup")}l._adjUnpairedOnScrollbar();p+=r}$("body").mousemove(n);$("body").one("mouseup",o)},adjPartition:function(m){var l=this.$(".unpaired-columns"),n=this.$(".paired-columns"),o=parseInt(l.css("height"),10),p=parseInt(n.css("height"),10);o=Math.max(10,o+m);p=p-m;var q=m<0;if(q){if(this.unpairedPanelHidden){return false}else{if(o<=10){this.hideUnpaired();return false}}}else{if(this.unpairedPanelHidden){l.show();this.unpairedPanelHidden=false}}if(!q){if(this.pairedPanelHidden){return false}else{if(p<=15){this.hidePaired();return false}}}else{if(this.pairedPanelHidden){n.show();this.pairedPanelHidden=false}}l.css({height:o+"px",flex:"0 0 auto"});return true},selectPair:function(l){l.stopPropagation();$(l.currentTarget).toggleClass("selected")},clearSelectedPaired:function(l){this.$(".paired-columns .dataset.selected").removeClass("selected")},_clickPairName:function(o){o.stopPropagation();var q=$(o.currentTarget),n=q.parent().parent(),m=n.index(".dataset.paired"),p=this.paired[m],l=prompt("Enter a new name for the pair:",p.name);if(l){p.name=l;p.customizedName=true;q.text(p.name)}},_clickUnpair:function(m){var l=Math.floor($(m.currentTarget).index(".unpair-btn"));this._unpair(this.paired[l])},_dragoverPairedColumns:function(o){o.preventDefault();var m=this.$(".paired-columns .column-datasets");this._checkForAutoscroll(m,o.originalEvent.clientY);var n=this._getNearestPairedDatasetLi(o.originalEvent.clientY);$(".paired-drop-placeholder").remove();var l=$('<div class="paired-drop-placeholder"></div>');if(!n.size()){m.append(l)}else{n.before(l)}},_checkForAutoscroll:function(l,r){var p=2;var q=l.offset(),o=l.scrollTop(),m=r-q.top,n=(q.top+l.outerHeight())-r;if(m>=0&&m<this.autoscrollDist){l.scrollTop(o-p)}else{if(n>=0&&n<this.autoscrollDist){l.scrollTop(o+p)}}},_getNearestPairedDatasetLi:function(r){var o=4,m=this.$(".paired-columns .column-datasets li").toArray();for(var n=0;n<m.length;n++){var q=$(m[n]),p=q.offset().top,l=Math.floor(q.outerHeight()/2)+o;if(p+l>r&&p-l<r){return q}}return $()},_dropPairedColumns:function(m){m.preventDefault();m.dataTransfer.dropEffect="move";var l=this._getNearestPairedDatasetLi(m.originalEvent.clientY);if(l.size()){this.$dragging.insertBefore(l)}else{this.$dragging.insertAfter(this.$(".paired-columns .unpair-btn").last())}this._syncPairsToDom();return false},_syncPairsToDom:function(){var l=[];this.$(".paired-columns .dataset.paired").each(function(){l.push($(this).data("pair"))});this.paired=l;this._renderPaired()},_pairDragstart:function(m,n){n.$el.addClass("selected");var l=this.$(".paired-columns .dataset.selected");this.$dragging=l},_pairDragend:function(l,m){$(".paired-drop-placeholder").remove();this.$dragging=null},toggleExtensions:function(m){var l=this;l.removeExtensions=(m!==undefined)?(m):(!l.removeExtensions);_.each(l.paired,function(n){if(n.customizedName){return}n.name=l._guessNameForPair(n.forward,n.reverse)});l._renderPaired();l._renderFooter()},_changeName:function(l){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(l){if(l.keyCode===13){this._clickCreate()}},_getName:function(){return _.escape(this.$(".collection-name").val())},_clickCreate:function(m){var l=this._getName();if(!l){this._validationWarning("name")}else{this.createList()}},_printList:function(m){var l=this;_.each(m,function(n){if(m===l.paired){l._printPair(n)}else{}})},_printPair:function(l){this.debug(l.forward.name,l.reverse.name,": ->",l.name)},toString:function(){return"PairedCollectionCreator"}});k.templates=k.templates||{main:_.template(['<div class="header flex-row no-flex"></div>','<div class="middle flex-row flex-row-container"></div>','<div class="footer flex-row no-flex">'].join("")),header:_.template(['<div class="main-help well clear">','<a class="more-help" href="javascript:void(0);">',c("More help"),"</a>",'<div class="help-content">','<a class="less-help" href="javascript:void(0);">',c("Less"),"</a>","</div>","</div>",'<div class="alert alert-dismissable">','<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>','<span class="alert-message"></span>',"</div>",'<div class="column-headers vertically-spaced flex-column-container">','<div class="forward-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired forward"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter forward-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>",'<div class="paired-column flex-column no-flex column">','<div class="column-header">','<a class="choose-filters-link" href="javascript:void(0)">',c("Choose filters"),"</a>",'<a class="clear-filters-link" href="javascript:void(0);">',c("Clear filters"),"</a><br />",'<a class="autopair-link" href="javascript:void(0);">',c("Auto-pair"),"</a>","</div>","</div>",'<div class="reverse-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired reverse"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter reverse-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>","</div>"].join("")),middle:_.template(['<div class="unpaired-columns flex-column-container scroll-container flex-row">','<div class="forward-column flex-column column">','<ol class="column-datasets"></ol>',"</div>",'<div class="paired-column flex-column no-flex column">','<ol class="column-datasets"></ol>',"</div>",'<div class="reverse-column flex-column column">','<ol class="column-datasets"></ol>',"</div>","</div>",'<div class="flexible-partition">','<div class="flexible-partition-drag" title="',c("Drag to change"),'"></div>','<div class="column-header">','<div class="column-title paired-column-title">','<span class="title"></span>',"</div>",'<a class="unpair-all-link" href="javascript:void(0);">',c("Unpair all"),"</a>","</div>","</div>",'<div class="paired-columns flex-column-container scroll-container flex-row">','<ol class="column-datasets"></ol>',"</div>"].join("")),footer:_.template(['<div class="attributes clear">','<div class="clear">','<label class="remove-extensions-prompt pull-right">',c("Remove file extensions from pair names"),"?",'<input class="remove-extensions pull-right" type="checkbox" />',"</label>","</div>",'<div class="clear">','<input class="collection-name form-control pull-right" ','placeholder="',c("Enter a name for your new list"),'" />','<div class="collection-name-prompt pull-right">',c("Name"),":</div>","</div>","</div>",'<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',c("Cancel"),"</button>",'<div class="create-other btn-group dropup">','<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">',c("Create a different kind of collection"),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="#">',c("Create a <i>single</i> pair"),"</a></li>",'<li><a href="#">',c("Create a list of <i>unpaired</i> datasets"),"</a></li>","</ul>","</div>","</div>",'<div class="main-options pull-right">','<button class="create-collection btn btn-primary">',c("Create list"),"</button>","</div>","</div>"].join("")),helpContent:_.template(["<p>",c(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections can be passed to tools and workflows in order to have analyses done on each member of ","the entire group. This interface allows you to create a collection, choose which datasets are paired, ","and re-order the final collection."].join("")),"</p>","<p>",c(['Unpaired datasets are shown in the <i data-target=".unpaired-columns">unpaired section</i> ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the <i data-target=".paired-columns">paired section</i>.',"<ul>To pair datasets, you can:","<li>Click a dataset in the ",'<i data-target=".unpaired-columns .forward-column .column-datasets,','.unpaired-columns .forward-column">forward column</i> ',"to select it then click a dataset in the ",'<i data-target=".unpaired-columns .reverse-column .column-datasets,','.unpaired-columns .reverse-column">reverse column</i>.',"</li>",'<li>Click one of the "Pair these datasets" buttons in the ','<i data-target=".unpaired-columns .paired-column .column-datasets,','.unpaired-columns .paired-column">middle column</i> ',"to pair the datasets in a particular row.","</li>",'<li>Click <i data-target=".autopair-link">"Auto-pair"</i> ',"to have your datasets automatically paired based on name.","</li>","</ul>"].join("")),"</p>","<p>",c(["<ul>You can filter what is shown in the unpaired sections by:","<li>Entering partial dataset names in either the ",'<i data-target=".forward-unpaired-filter input">forward filter</i> or ','<i data-target=".reverse-unpaired-filter input">reverse filter</i>.',"</li>","<li>Choosing from a list of preset filters by clicking the ",'<i data-target=".choose-filters-link">"Choose filters" link</i>.',"</li>","<li>Entering regular expressions to match dataset names. See: ",'<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expre…"',' target="_blank">MDN\'s JavaScript Regular Expression Tutorial</a>. ',"Note: forward slashes (\\) are not needed.","</li>","<li>Clearing the filters by clicking the ",'<i data-target=".clear-filters-link">"Clear filters" link</i>.',"</li>","</ul>"].join("")),"</p>","<p>",c(["To unpair individual dataset pairs, click the ",'<i data-target=".unpair-btn">unpair buttons ( <span class="fa fa-unlink"></span> )</i>. ','Click the <i data-target=".unpair-all-link">"Unpair all" link</i> to unpair all pairs.'].join("")),"</p>","<p>",c(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','<i data-target=".remove-extensions-prompt">"Remove file extensions from pair names?"</i> control.'].join("")),"</p>","<p>",c(['Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ','click <i data-target=".create-collection">"Create list"</i>. ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"</p>"].join(""))};(function(){jQuery.fn.extend({hoverhighlight:function l(n,m){n=n||"body";if(!this.size()){return this}$(this).each(function(){var p=$(this),o=p.data("target");if(o){p.mouseover(function(q){$(o,n).css({background:m})}).mouseout(function(q){$(o).css({background:""})})}});return this}})}());var d=function a(n,l){l=_.defaults(l||{},{datasets:n,oncancel:function(){Galaxy.modal.hide()},oncreate:function(){Galaxy.modal.hide();Galaxy.currHistoryPanel.refreshContents()}});if(!window.Galaxy||!Galaxy.modal){throw new Error("Galaxy or Galaxy.modal not found")}var m=new k(l).render();Galaxy.modal.show({title:"Create a collection of paired datasets",body:m.$el,width:"80%",height:"800px",closing_events:true});window.PCC=m;return m};return{PairedCollectionCreator:k,pairedCollectionCreatorModal:d}});
\ No newline at end of file
+define(["utils/levenshtein","utils/natural-sort","mvc/base-mvc","utils/localization"],function(h,b,f,c){var i=Backbone.View.extend(f.LoggableMixin).extend({tagName:"li",className:"dataset paired",initialize:function(l){this.pair=l.pair||{}},template:_.template(['<span class="forward-dataset-name flex-column"><%= pair.forward.name %></span>','<span class="pair-name-column flex-column">','<span class="pair-name"><%= pair.name %></span>',"</span>",'<span class="reverse-dataset-name flex-column"><%= pair.reverse.name %></span>'].join("")),render:function(){this.$el.attr("draggable",true).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container");return this},events:{dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(l){l.currentTarget.style.opacity="0.4";if(l.originalEvent){l=l.originalEvent}l.dataTransfer.effectAllowed="move";l.dataTransfer.setData("text/plain",JSON.stringify(this.pair));this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(l){l.currentTarget.style.opacity="1.0";this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(l){this.$el.parent().trigger(l)},toString:function(){return"PairView("+this.pair.name+")"}});function g(m){m=m||{};m.createPair=m.createPair||function l(r){this.debug("creating pair:",r.listA[r.indexA].name,r.listB[r.indexB].name);r=r||{};return this._pair(r.listA.splice(r.indexA,1)[0],r.listB.splice(r.indexB,1)[0],{silent:true})};var o=[];function q(){if(!o.length){o=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]}return o}m.preprocessMatch=m.preprocessMatch||function n(s){var r=q.call(this);return _.extend(s,{matchTo:s.matchTo.name.replace(r[0],""),possible:s.possible.name.replace(r[1],"")})};return function p(t){this.debug("autopair _strategy ---------------------------");t=t||{};var r=t.listA,A=t.listB,z=0,y,v={score:0,index:null},x=[];this.debug("starting list lens:",r.length,A.length);this.debug("bestMatch (starting):",JSON.stringify(v,null," "));while(z<r.length){var w=r[z];v.score=0;for(y=0;y<A.length;y++){var u=A[y];this.debug(z+":"+w.name);this.debug(y+":"+u.name);if(r[z]!==A[y]){v=m.match.call(this,m.preprocessMatch.call(this,{matchTo:w,possible:u,index:y,bestMatch:v}));this.debug("bestMatch:",JSON.stringify(v,null," "));if(v.score===1){this.debug("breaking early due to perfect match");break}}}var s=m.scoreThreshold.call(this);this.debug("scoreThreshold:",s);this.debug("bestMatch.score:",v.score);if(v.score>=s){this.debug("creating pair");x.push(m.createPair.call(this,{listA:r,indexA:z,listB:A,indexB:v.index}));this.debug("list lens now:",r.length,A.length)}else{z+=1}if(!r.length||!A.length){return x}}this.debug("paired:",JSON.stringify(x,null," "));this.debug("autopair _strategy ---------------------------");return x}}var k=Backbone.View.extend(f.LoggableMixin).extend({className:"collection-creator flex-row-container",initialize:function(l){l=_.defaults(l,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:true,strategy:"lcs",matchPercentage:0.9,twoPassAutopairing:true});this.initialList=l.datasets;this.historyId=l.historyId;this.filters=this.commonFilters[l.filters]||this.commonFilters[this.DEFAULT_FILTERS];if(_.isArray(l.filters)){this.filters=l.filters}this.automaticallyPair=l.automaticallyPair;this.strategy=this.strategies[l.strategy]||this.strategies[this.DEFAULT_STRATEGY];if(_.isFunction(l.strategy)){this.strategy=l.strategy}this.matchPercentage=l.matchPercentage;this.twoPassAutopairing=l.twoPassAutopairing;this.removeExtensions=true;this.oncancel=l.oncancel;this.oncreate=l.oncreate;this.autoscrollDist=l.autoscrollDist||24;this.unpairedPanelHidden=false;this.pairedPanelHidden=false;this.$dragging=null;this._setUpBehaviors();this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[];this.unpaired=[];this.selectedIds=[];this._sortInitialList();this._ensureIds();this.unpaired=this.initialList.slice(0);if(this.automaticallyPair){this.autoPair();this.once("rendered:initial",function(){this.trigger("autopair")})}},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(l){l.sort(function(n,m){return b(n.name,m.name)});return l},_ensureIds:function(){this.initialList.forEach(function(l){if(!l.hasOwnProperty("id")){l.id=_.uniqueId()}});return this.initialList},_splitByFilters:function(){var o=this.filters.map(function(p){return new RegExp(p)}),m=[[],[]];function n(p,q){return q.test(p.name)}this.unpaired.forEach(function l(p){o.forEach(function(r,q){if(n(p,r)){m[q].push(p)}})});return m},_addToUnpaired:function(m){var l=function(n,p){if(n===p){return n}var o=Math.floor((p-n)/2)+n,q=b(m.name,this.unpaired[o].name);if(q<0){return l(n,o)}else{if(q>0){return l(o+1,p)}}while(this.unpaired[o]&&this.unpaired[o].name===m.name){o++}return o}.bind(this);this.unpaired.splice(l(0,this.unpaired.length),0,m)},autoPair:function(n){var m=this._splitByFilters(),l=[];if(this.twoPassAutopairing){l=this.autopairSimple({listA:m[0],listB:m[1]});m=this._splitByFilters()}n=n||this.strategy;m=this._splitByFilters();l=l.concat(this[n].call(this,{listA:m[0],listB:m[1]}));return l},autopairSimple:g({scoreThreshold:function(){return 1},match:function j(l){l=l||{};if(l.matchTo===l.possible){return{index:l.index,score:1}}return l.bestMatch}}),autopairLevenshtein:g({scoreThreshold:function(){return this.matchPercentage},match:function e(m){m=m||{};var n=h(m.matchTo,m.possible),l=1-(n/(Math.max(m.matchTo.length,m.possible.length)));if(l>m.bestMatch.score){return{index:m.index,score:l}}return m.bestMatch}}),autopairLCS:g({scoreThreshold:function(){return this.matchPercentage},match:function e(n){n=n||{};var l=this._naiveStartingAndEndingLCS(n.matchTo,n.possible).length,m=l/(Math.max(n.matchTo.length,n.possible.length));if(m>n.bestMatch.score){return{index:n.index,score:m}}return n.bestMatch}}),_naiveStartingAndEndingLCS:function(o,m){var p="",q="",n=0,l=0;while(n<o.length&&n<m.length){if(o[n]!==m[n]){break}p+=o[n];n+=1}if(n===o.length){return o}if(n===m.length){return m}n=(o.length-1);l=(m.length-1);while(n>=0&&l>=0){if(o[n]!==m[l]){break}q=[o[n],q].join("");n-=1;l-=1}return p+q},_pair:function(n,l,m){m=m||{};var o=this._createPair(n,l,m.name);this.paired.push(o);this.unpaired=_.without(this.unpaired,n,l);if(!m.silent){this.trigger("pair:new",o)}return o},_createPair:function(n,l,m){if(!(n&&l)||(n===l)){throw new Error("Bad pairing: "+[JSON.stringify(n),JSON.stringify(l)])}m=m||this._guessNameForPair(n,l);return{forward:n,name:m,reverse:l}},_guessNameForPair:function(o,m,q){q=(q!==undefined)?(q):(this.removeExtensions);var l=o.name,p=m.name,n=this._naiveStartingAndEndingLCS(l.replace(this.filters[0],""),p.replace(this.filters[1],""));if(q){var r=n.lastIndexOf(".");if(r>0){var s=n.slice(r,n.length);n=n.replace(s,"");l=l.replace(s,"");p=p.replace(s,"")}}return n||(l+" & "+p)},_unpair:function(m,l){l=l||{};if(!m){throw new Error("Bad pair: "+JSON.stringify(m))}this.paired=_.without(this.paired,m);this._addToUnpaired(m.forward);this._addToUnpaired(m.reverse);if(!l.silent){this.trigger("pair:unpair",[m])}return m},unpairAll:function(){var l=[];while(this.paired.length){l.push(this._unpair(this.paired[0],{silent:true}))}this.trigger("pair:unpair",l)},_pairToJSON:function(m,l){l=l||"hda";return{collection_type:"paired",src:"new_collection",name:m.name,element_identifiers:[{name:"forward",id:m.forward.id,src:l},{name:"reverse",id:m.reverse.id,src:l}]}},createList:function(n){var o=this,m="/api/histories/"+this.historyId+"/contents/dataset_collections";var l={type:"dataset_collection",collection_type:"list:paired",name:_.escape(n||o.$(".collection-name").val()),element_identifiers:o.paired.map(function(p){return o._pairToJSON(p)})};return jQuery.ajax(m,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(l)}).fail(function(r,p,q){o._ajaxErrHandler(r,p,q)}).done(function(p,q,r){o.trigger("collection:created",p,q,r);if(typeof o.oncreate==="function"){o.oncreate.call(this,p,q,r)}})},_ajaxErrHandler:function(o,l,n){this.error(o,l,n);var m=c("An error occurred while creating this collection");if(o){if(o.readyState===0&&o.status===0){m+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes.")}else{if(o.responseJSON){m+="<br /><pre>"+JSON.stringify(o.responseJSON)+"</pre>"}else{m+=": "+n}}}creator._showAlert(m,"alert-danger")},render:function(l,m){this.$el.empty().html(k.templates.main());this._renderHeader(l);this._renderMiddle(l);this._renderFooter(l);this._addPluginComponents();this.trigger("rendered",this);return this},_renderHeader:function(m,n){var l=this.$(".header").empty().html(k.templates.header()).find(".help-content").prepend($(k.templates.helpContent()));this._renderFilters();return l},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(m,n){var l=this.$(".middle").empty().html(k.templates.middle());if(this.unpairedPanelHidden){this.$(".unpaired-columns").hide()}else{if(this.pairedPanelHidden){this.$(".paired-columns").hide()}}this._renderUnpaired();this._renderPaired();return l},_renderUnpaired:function(q,r){var o=this,p,m,l=[],n=this._splitByFilters();this.$(".forward-column .title").text([n[0].length,c("unpaired forward")].join(" "));this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[0].length));this.$(".reverse-column .title").text([n[1].length,c("unpaired reverse")].join(" "));this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-n[1].length));this.$(".unpaired-columns .column-datasets").empty();this.$(".autopair-link").toggle(this.unpaired.length!==0);if(this.unpaired.length===0){this._renderUnpairedEmpty();return}m=n[1].map(function(t,s){if((n[0][s]!==undefined)&&(n[0][s]!==t)){l.push(o._renderPairButton())}return o._renderUnpairedDataset(t)});p=n[0].map(function(s){return o._renderUnpairedDataset(s)});if(!p.length&&!m.length){this._renderUnpairedNotShown();return}this.$(".unpaired-columns .forward-column .column-datasets").append(p).add(this.$(".unpaired-columns .paired-column .column-datasets").append(l)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(m));this._adjUnpairedOnScrollbar()},_renderUnpairedDisplayStr:function(l){return["(",l," ",c("filtered out"),")"].join("")},_renderUnpairedDataset:function(l){return $("<li/>").attr("id","dataset-"+l.id).addClass("dataset unpaired").attr("draggable",true).addClass(l.selected?"selected":"").append($("<span/>").addClass("dataset-name").text(l.name)).data("dataset",l)},_renderPairButton:function(){return $("<li/>").addClass("dataset unpaired").append($("<span/>").addClass("dataset-name").text(c("Pair these datasets")))},_renderUnpairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no remaining unpaired datasets")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_renderUnpairedNotShown:function(){var l=$('<div class="empty-message"></div>').text("("+c("no datasets were found matching the current filters")+")");this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(l);return l},_adjUnpairedOnScrollbar:function(){var o=this.$(".unpaired-columns").last(),p=this.$(".unpaired-columns .reverse-column .dataset").first();if(!p.size()){return}var l=o.offset().left+o.outerWidth(),n=p.offset().left+p.outerWidth(),m=Math.floor(l)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",(m>0)?m:0)},_renderPaired:function(m,n){this.$(".paired-column-title .title").text([this.paired.length,c("paired")].join(" "));this.$(".unpair-all-link").toggle(this.paired.length!==0);if(this.paired.length===0){this._renderPairedEmpty();return}else{this.$(".remove-extensions-link").show()}this.$(".paired-columns .column-datasets").empty();var l=this;this.paired.forEach(function(q,o){var p=new i({pair:q});l.$(".paired-columns .column-datasets").append(p.render().$el).append(['<button class="unpair-btn">','<span class="fa fa-unlink" title="',c("Unpair"),'"></span>',"</button>"].join(""))})},_renderPairedEmpty:function(){var l=$('<div class="empty-message"></div>').text("("+c("no paired datasets yet")+")");this.$(".paired-columns .column-datasets").empty().prepend(l);return l},_renderFooter:function(m,n){var l=this.$(".footer").empty().html(k.templates.footer());this.$(".remove-extensions").prop("checked",this.removeExtensions);if(typeof this.oncancel==="function"){this.$(".cancel-create.btn").show()}return l},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link");this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(l){function m(p,o){return['<button class="filter-choice btn" ','data-forward="',p,'" data-reverse="',o,'">',c("Forward"),": ",p,", ",c("Reverse"),": ",o,"</button>"].join("")}var n=$(_.template(['<div class="choose-filters">','<div class="help">',c("Choose from the following filters to change which unpaired reads are shown in the display"),":</div>",_.values(this.commonFilters).map(function(o){return m(o[0],o[1])}).join(""),"</div>"].join(""))({}));return this.$(l).popover({container:".collection-creator",placement:"bottom",html:true,content:n})},_validationWarning:function(m,l){var n="validation-warning";if(m==="name"){m=this.$(".collection-name").add(this.$(".collection-name-prompt"));this.$(".collection-name").focus().select()}if(l){m=m||this.$("."+n);m.removeClass(n)}else{m.addClass(n)}},_setUpBehaviors:function(){this.once("rendered",function(){this.trigger("rendered:initial",this)});this.on("pair:new",function(){this._renderUnpaired();this._renderPaired();this.$(".paired-columns").scrollTop(8000000)});this.on("pair:unpair",function(l){this._renderUnpaired();this._renderPaired();this.splitView()});this.on("filter-change",function(){this.filters=[this.$(".forward-unpaired-filter input").val(),this.$(".reverse-unpaired-filter input").val()];this._renderFilters();this._renderUnpaired()});this.on("autopair",function(){this._renderUnpaired();this._renderPaired();var l,m=null;if(this.paired.length){m="alert-success";l=this.paired.length+" "+c("pairs created");if(!this.unpaired.length){l+=": "+c("all datasets have been successfully paired");this.hideUnpaired();this.$(".collection-name").focus()}}else{l=c("Could not automatically create any pairs from the given dataset names")}this._showAlert(l,m)});return this},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .header .alert button":"_hideAlert","click .forward-column .column-title":"_clickShowOnlyUnpaired","click .reverse-column .column-title":"_clickShowOnlyUnpaired","click .unpair-all-link":"_clickUnpairAll","change .forward-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .forward-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .autopair-link":"_clickAutopair","click .choose-filters .filter-choice":"_clickFilterChoice","click .clear-filters-link":"_clearFilters","change .reverse-unpaired-filter input":function(l){this.trigger("filter-change")},"focus .reverse-unpaired-filter input":function(l){$(l.currentTarget).select()},"click .forward-column .dataset.unpaired":"_clickUnpairedDataset","click .reverse-column .dataset.unpaired":"_clickUnpairedDataset","click .paired-column .dataset.unpaired":"_clickPairRow","click .unpaired-columns":"clearSelectedUnpaired","mousedown .unpaired-columns .dataset":"_mousedownUnpaired","click .paired-column-title":"_clickShowOnlyPaired","mousedown .flexible-partition-drag":"_startPartitionDrag","click .paired-columns .dataset.paired":"selectPair","click .paired-columns":"clearSelectedPaired","click .paired-columns .pair-name":"_clickPairName","click .unpair-btn":"_clickUnpair","dragover .paired-columns .column-datasets":"_dragoverPairedColumns","drop .paired-columns .column-datasets":"_dropPairedColumns","pair.dragstart .paired-columns .column-datasets":"_pairDragstart","pair.dragend .paired-columns .column-datasets":"_pairDragend","change .remove-extensions":function(l){this.toggleExtensions()},"change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","click .cancel-create":function(l){if(typeof this.oncancel==="function"){this.oncancel.call(this)}},"click .create-collection":"_clickCreate"},_clickMoreHelp:function(l){this.$(".main-help").addClass("expanded");this.$(".more-help").hide()},_clickLessHelp:function(l){this.$(".main-help").removeClass("expanded");this.$(".more-help").show()},_showAlert:function(m,l){l=l||"alert-danger";this.$(".main-help").hide();this.$(".header .alert").attr("class","alert alert-dismissable").addClass(l).show().find(".alert-message").html(m)},_hideAlert:function(l){this.$(".main-help").show();this.$(".header .alert").hide()},_clickShowOnlyUnpaired:function(l){if(this.$(".paired-columns").is(":visible")){this.hidePaired()}else{this.splitView()}},_clickShowOnlyPaired:function(l){if(this.$(".unpaired-columns").is(":visible")){this.hideUnpaired()}else{this.splitView()}},hideUnpaired:function(l,m){this.unpairedPanelHidden=true;this.pairedPanelHidden=false;this._renderMiddle(l,m)},hidePaired:function(l,m){this.unpairedPanelHidden=false;this.pairedPanelHidden=true;this._renderMiddle(l,m)},splitView:function(l,m){this.unpairedPanelHidden=this.pairedPanelHidden=false;this._renderMiddle(l,m);return this},_clickUnpairAll:function(l){this.unpairAll()},_clickAutopair:function(l){this.autoPair();this.trigger("autopair")},_clickFilterChoice:function(m){var l=$(m.currentTarget);this.$(".forward-unpaired-filter input").val(l.data("forward"));this.$(".reverse-unpaired-filter input").val(l.data("reverse"));this._hideChooseFilters();this.trigger("filter-change")},_hideChooseFilters:function(){this.$(".choose-filters-link").popover("hide");this.$(".popover").css("display","none")},_clearFilters:function(l){this.$(".forward-unpaired-filter input").val("");this.$(".reverse-unpaired-filter input").val("");this.trigger("filter-change")},_clickUnpairedDataset:function(l){l.stopPropagation();return this.toggleSelectUnpaired($(l.currentTarget))},toggleSelectUnpaired:function(n,m){m=m||{};var o=n.data("dataset"),l=m.force!==undefined?m.force:!n.hasClass("selected");if(!n.size()||o===undefined){return n}if(l){n.addClass("selected");if(!m.waitToPair){this.pairAllSelected()}}else{n.removeClass("selected")}return n},pairAllSelected:function(m){m=m||{};var n=this,o=[],l=[],p=[];n.$(".unpaired-columns .forward-column .dataset.selected").each(function(){o.push($(this).data("dataset"))});n.$(".unpaired-columns .reverse-column .dataset.selected").each(function(){l.push($(this).data("dataset"))});o.length=l.length=Math.min(o.length,l.length);o.forEach(function(r,q){try{p.push(n._pair(r,l[q],{silent:true}))}catch(s){n.error(s)}});if(p.length&&!m.silent){this.trigger("pair:new",p)}return p},clearSelectedUnpaired:function(){this.$(".unpaired-columns .dataset.selected").removeClass("selected")},_mousedownUnpaired:function(n){if(n.shiftKey){var m=this,l=$(n.target).addClass("selected"),o=function(p){m.$(p.target).filter(".dataset").addClass("selected")};l.parent().on("mousemove",o);$(document).one("mouseup",function(p){l.parent().off("mousemove",o);m.pairAllSelected()})}},_clickPairRow:function(n){var o=$(n.currentTarget).index(),m=$(".unpaired-columns .forward-column .dataset").eq(o).data("dataset"),l=$(".unpaired-columns .reverse-column .dataset").eq(o).data("dataset");this._pair(m,l)},_startPartitionDrag:function(m){var l=this,p=m.pageY;$("body").css("cursor","ns-resize");l.$(".flexible-partition-drag").css("color","black");function o(q){l.$(".flexible-partition-drag").css("color","");$("body").css("cursor","").unbind("mousemove",n)}function n(q){var r=q.pageY-p;if(!l.adjPartition(r)){$("body").trigger("mouseup")}l._adjUnpairedOnScrollbar();p+=r}$("body").mousemove(n);$("body").one("mouseup",o)},adjPartition:function(m){var l=this.$(".unpaired-columns"),n=this.$(".paired-columns"),o=parseInt(l.css("height"),10),p=parseInt(n.css("height"),10);o=Math.max(10,o+m);p=p-m;var q=m<0;if(q){if(this.unpairedPanelHidden){return false}else{if(o<=10){this.hideUnpaired();return false}}}else{if(this.unpairedPanelHidden){l.show();this.unpairedPanelHidden=false}}if(!q){if(this.pairedPanelHidden){return false}else{if(p<=15){this.hidePaired();return false}}}else{if(this.pairedPanelHidden){n.show();this.pairedPanelHidden=false}}l.css({height:o+"px",flex:"0 0 auto"});return true},selectPair:function(l){l.stopPropagation();$(l.currentTarget).toggleClass("selected")},clearSelectedPaired:function(l){this.$(".paired-columns .dataset.selected").removeClass("selected")},_clickPairName:function(o){o.stopPropagation();var q=$(o.currentTarget),n=q.parent().parent(),m=n.index(".dataset.paired"),p=this.paired[m],l=prompt("Enter a new name for the pair:",p.name);if(l){p.name=l;p.customizedName=true;q.text(p.name)}},_clickUnpair:function(m){var l=Math.floor($(m.currentTarget).index(".unpair-btn"));this._unpair(this.paired[l])},_dragoverPairedColumns:function(o){o.preventDefault();var m=this.$(".paired-columns .column-datasets");this._checkForAutoscroll(m,o.originalEvent.clientY);var n=this._getNearestPairedDatasetLi(o.originalEvent.clientY);$(".paired-drop-placeholder").remove();var l=$('<div class="paired-drop-placeholder"></div>');if(!n.size()){m.append(l)}else{n.before(l)}},_checkForAutoscroll:function(l,r){var p=2;var q=l.offset(),o=l.scrollTop(),m=r-q.top,n=(q.top+l.outerHeight())-r;if(m>=0&&m<this.autoscrollDist){l.scrollTop(o-p)}else{if(n>=0&&n<this.autoscrollDist){l.scrollTop(o+p)}}},_getNearestPairedDatasetLi:function(r){var o=4,m=this.$(".paired-columns .column-datasets li").toArray();for(var n=0;n<m.length;n++){var q=$(m[n]),p=q.offset().top,l=Math.floor(q.outerHeight()/2)+o;if(p+l>r&&p-l<r){return q}}return $()},_dropPairedColumns:function(m){m.preventDefault();m.dataTransfer.dropEffect="move";var l=this._getNearestPairedDatasetLi(m.originalEvent.clientY);if(l.size()){this.$dragging.insertBefore(l)}else{this.$dragging.insertAfter(this.$(".paired-columns .unpair-btn").last())}this._syncPairsToDom();return false},_syncPairsToDom:function(){var l=[];this.$(".paired-columns .dataset.paired").each(function(){l.push($(this).data("pair"))});this.paired=l;this._renderPaired()},_pairDragstart:function(m,n){n.$el.addClass("selected");var l=this.$(".paired-columns .dataset.selected");this.$dragging=l},_pairDragend:function(l,m){$(".paired-drop-placeholder").remove();this.$dragging=null},toggleExtensions:function(m){var l=this;l.removeExtensions=(m!==undefined)?(m):(!l.removeExtensions);_.each(l.paired,function(n){if(n.customizedName){return}n.name=l._guessNameForPair(n.forward,n.reverse)});l._renderPaired();l._renderFooter()},_changeName:function(l){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(l){if(l.keyCode===13){this._clickCreate()}},_getName:function(){return _.escape(this.$(".collection-name").val())},_clickCreate:function(m){var l=this._getName();if(!l){this._validationWarning("name")}else{this.createList()}},_printList:function(m){var l=this;_.each(m,function(n){if(m===l.paired){l._printPair(n)}else{}})},_printPair:function(l){this.debug(l.forward.name,l.reverse.name,": ->",l.name)},toString:function(){return"PairedCollectionCreator"}});k.templates=k.templates||{main:_.template(['<div class="header flex-row no-flex"></div>','<div class="middle flex-row flex-row-container"></div>','<div class="footer flex-row no-flex">'].join("")),header:_.template(['<div class="main-help well clear">','<a class="more-help" href="javascript:void(0);">',c("More help"),"</a>",'<div class="help-content">','<a class="less-help" href="javascript:void(0);">',c("Less"),"</a>","</div>","</div>",'<div class="alert alert-dismissable">','<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>','<span class="alert-message"></span>',"</div>",'<div class="column-headers vertically-spaced flex-column-container">','<div class="forward-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired forward"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter forward-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>",'<div class="paired-column flex-column no-flex column">','<div class="column-header">','<a class="choose-filters-link" href="javascript:void(0)">',c("Choose filters"),"</a>",'<a class="clear-filters-link" href="javascript:void(0);">',c("Clear filters"),"</a><br />",'<a class="autopair-link" href="javascript:void(0);">',c("Auto-pair"),"</a>","</div>","</div>",'<div class="reverse-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',c("Unpaired reverse"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter reverse-unpaired-filter pull-left">','<input class="search-query" placeholder="',c("Filter this list"),'" />',"</div>","</div>","</div>","</div>"].join("")),middle:_.template(['<div class="unpaired-columns flex-column-container scroll-container flex-row">','<div class="forward-column flex-column column">','<ol class="column-datasets"></ol>',"</div>",'<div class="paired-column flex-column no-flex column">','<ol class="column-datasets"></ol>',"</div>",'<div class="reverse-column flex-column column">','<ol class="column-datasets"></ol>',"</div>","</div>",'<div class="flexible-partition">','<div class="flexible-partition-drag" title="',c("Drag to change"),'"></div>','<div class="column-header">','<div class="column-title paired-column-title">','<span class="title"></span>',"</div>",'<a class="unpair-all-link" href="javascript:void(0);">',c("Unpair all"),"</a>","</div>","</div>",'<div class="paired-columns flex-column-container scroll-container flex-row">','<ol class="column-datasets"></ol>',"</div>"].join("")),footer:_.template(['<div class="attributes clear">','<div class="clear">','<label class="remove-extensions-prompt pull-right">',c("Remove file extensions from pair names"),"?",'<input class="remove-extensions pull-right" type="checkbox" />',"</label>","</div>",'<div class="clear">','<input class="collection-name form-control pull-right" ','placeholder="',c("Enter a name for your new list"),'" />','<div class="collection-name-prompt pull-right">',c("Name"),":</div>","</div>","</div>",'<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',c("Cancel"),"</button>",'<div class="create-other btn-group dropup">','<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">',c("Create a different kind of collection"),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="#">',c("Create a <i>single</i> pair"),"</a></li>",'<li><a href="#">',c("Create a list of <i>unpaired</i> datasets"),"</a></li>","</ul>","</div>","</div>",'<div class="main-options pull-right">','<button class="create-collection btn btn-primary">',c("Create list"),"</button>","</div>","</div>"].join("")),helpContent:_.template(["<p>",c(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections can be passed to tools and workflows in order to have analyses done on each member of ","the entire group. This interface allows you to create a collection, choose which datasets are paired, ","and re-order the final collection."].join("")),"</p>","<p>",c(['Unpaired datasets are shown in the <i data-target=".unpaired-columns">unpaired section</i> ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the <i data-target=".paired-columns">paired section</i>.',"<ul>To pair datasets, you can:","<li>Click a dataset in the ",'<i data-target=".unpaired-columns .forward-column .column-datasets,','.unpaired-columns .forward-column">forward column</i> ',"to select it then click a dataset in the ",'<i data-target=".unpaired-columns .reverse-column .column-datasets,','.unpaired-columns .reverse-column">reverse column</i>.',"</li>",'<li>Click one of the "Pair these datasets" buttons in the ','<i data-target=".unpaired-columns .paired-column .column-datasets,','.unpaired-columns .paired-column">middle column</i> ',"to pair the datasets in a particular row.","</li>",'<li>Click <i data-target=".autopair-link">"Auto-pair"</i> ',"to have your datasets automatically paired based on name.","</li>","</ul>"].join("")),"</p>","<p>",c(["<ul>You can filter what is shown in the unpaired sections by:","<li>Entering partial dataset names in either the ",'<i data-target=".forward-unpaired-filter input">forward filter</i> or ','<i data-target=".reverse-unpaired-filter input">reverse filter</i>.',"</li>","<li>Choosing from a list of preset filters by clicking the ",'<i data-target=".choose-filters-link">"Choose filters" link</i>.',"</li>","<li>Entering regular expressions to match dataset names. See: ",'<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expre…"',' target="_blank">MDN\'s JavaScript Regular Expression Tutorial</a>. ',"Note: forward slashes (\\) are not needed.","</li>","<li>Clearing the filters by clicking the ",'<i data-target=".clear-filters-link">"Clear filters" link</i>.',"</li>","</ul>"].join("")),"</p>","<p>",c(["To unpair individual dataset pairs, click the ",'<i data-target=".unpair-btn">unpair buttons ( <span class="fa fa-unlink"></span> )</i>. ','Click the <i data-target=".unpair-all-link">"Unpair all" link</i> to unpair all pairs.'].join("")),"</p>","<p>",c(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','<i data-target=".remove-extensions-prompt">"Remove file extensions from pair names?"</i> control.'].join("")),"</p>","<p>",c(['Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ','click <i data-target=".create-collection">"Create list"</i>. ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"</p>"].join(""))};(function(){jQuery.fn.extend({hoverhighlight:function l(n,m){n=n||"body";if(!this.size()){return this}$(this).each(function(){var p=$(this),o=p.data("target");if(o){p.mouseover(function(q){$(o,n).css({background:m})}).mouseout(function(q){$(o).css({background:""})})}});return this}})}());var d=function a(n,l){l=_.defaults(l||{},{datasets:n,oncancel:function(){Galaxy.modal.hide()},oncreate:function(){Galaxy.modal.hide();Galaxy.currHistoryPanel.refreshContents()}});if(!window.Galaxy||!Galaxy.modal){throw new Error("Galaxy or Galaxy.modal not found")}var m=new k(l);Galaxy.modal.show({title:"Create a collection of paired datasets",body:m.$el,width:"80%",height:"800px",closing_events:true});m.render();window.PCC=m;return m};return{PairedCollectionCreator:k,pairedCollectionCreatorModal:d}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Merged in dan/galaxy-central-prs/stable (pull request #666)
by commits-noreply@bitbucket.org 11 Feb '15
by commits-noreply@bitbucket.org 11 Feb '15
11 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/577b270034b4/
Changeset: 577b270034b4
Branch: stable
User: jmchilton
Date: 2015-02-11 17:54:36+00:00
Summary: Merged in dan/galaxy-central-prs/stable (pull request #666)
[STABLE] Several Fixes for Tool Data Tables
Affected #: 1 file
diff -r 32e4527bab2d79f0797c28500a379b6b6c7a3900 -r 577b270034b48d90e58ffbea296e700d229545c9 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -335,11 +335,13 @@
def get_named_fields_list( self ):
rval = []
- named_colums = self.get_column_name_list()
+ named_columns = self.get_column_name_list()
for fields in self.get_fields():
field_dict = {}
for i, field in enumerate( fields ):
- field_name = named_colums[i]
+ if i == len( named_columns ):
+ break
+ field_name = named_columns[i]
if field_name is None:
field_name = i #check that this is supposed to be 0 based.
field_dict[ field_name ] = field
@@ -366,6 +368,7 @@
self.columns[ name ] = index
self.largest_index = index
else:
+ self.largest_index = 0
for column_elem in config_element.findall( 'column' ):
name = column_elem.get( 'name', None )
assert name is not None, "Required 'name' attribute missing from column def"
@@ -495,7 +498,7 @@
try:
data_table_fh = open( filename, 'r+b' )
except IOError, e:
- log.warning( 'Error opening data table file (%s) with r+b, assuming file does not exist and will open as wb: %s', self.filename, e )
+ log.warning( 'Error opening data table file (%s) with r+b, assuming file does not exist and will open as wb: %s', filename, e )
data_table_fh = open( filename, 'wb' )
if os.stat( filename )[6] != 0:
# ensure last existing line ends with new line
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0d61e421e06c/
Changeset: 0d61e421e06c
Branch: stable
User: dan
Date: 2015-02-11 17:33:49+00:00
Summary: Fix for Data Tables persisting when .loc file doesn't exist.
Affected #: 1 file
diff -r 0b9127ab708d7d8497e80169a3b8636aea1e37c6 -r 0d61e421e06c25f7658b8405574a2aafa63d04f0 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -495,7 +495,7 @@
try:
data_table_fh = open( filename, 'r+b' )
except IOError, e:
- log.warning( 'Error opening data table file (%s) with r+b, assuming file does not exist and will open as wb: %s', self.filename, e )
+ log.warning( 'Error opening data table file (%s) with r+b, assuming file does not exist and will open as wb: %s', filename, e )
data_table_fh = open( filename, 'wb' )
if os.stat( filename )[6] != 0:
# ensure last existing line ends with new line
https://bitbucket.org/galaxy/galaxy-central/commits/7df1519a9fbe/
Changeset: 7df1519a9fbe
Branch: stable
User: dan
Date: 2015-02-11 17:37:59+00:00
Summary: Fix for TabularToolDataTable.get_named_fields_list() when a data line has extra columns.
Affected #: 1 file
diff -r 0d61e421e06c25f7658b8405574a2aafa63d04f0 -r 7df1519a9fbecfc8c07e0dde3bf9845714c9a2ac lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -335,11 +335,13 @@
def get_named_fields_list( self ):
rval = []
- named_colums = self.get_column_name_list()
+ named_columns = self.get_column_name_list()
for fields in self.get_fields():
field_dict = {}
for i, field in enumerate( fields ):
- field_name = named_colums[i]
+ if i == len( named_columns ):
+ break
+ field_name = named_columns[i]
if field_name is None:
field_name = i #check that this is supposed to be 0 based.
field_dict[ field_name ] = field
https://bitbucket.org/galaxy/galaxy-central/commits/ca653e8d044d/
Changeset: ca653e8d044d
Branch: stable
User: dan
Date: 2015-02-11 17:40:33+00:00
Summary: Fix for parsing Tool Data Table columns that are defined as individual xml elements.
Affected #: 1 file
diff -r 7df1519a9fbecfc8c07e0dde3bf9845714c9a2ac -r ca653e8d044d29e15d4ff3266e333aa75c09e5d7 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -368,6 +368,7 @@
self.columns[ name ] = index
self.largest_index = index
else:
+ self.largest_index = 0
for column_elem in config_element.findall( 'column' ):
name = column_elem.get( 'name', None )
assert name is not None, "Required 'name' attribute missing from column def"
https://bitbucket.org/galaxy/galaxy-central/commits/577b270034b4/
Changeset: 577b270034b4
Branch: stable
User: jmchilton
Date: 2015-02-11 17:54:36+00:00
Summary: Merged in dan/galaxy-central-prs/stable (pull request #666)
[STABLE] Several Fixes for Tool Data Tables
Affected #: 1 file
diff -r 32e4527bab2d79f0797c28500a379b6b6c7a3900 -r 577b270034b48d90e58ffbea296e700d229545c9 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -335,11 +335,13 @@
def get_named_fields_list( self ):
rval = []
- named_colums = self.get_column_name_list()
+ named_columns = self.get_column_name_list()
for fields in self.get_fields():
field_dict = {}
for i, field in enumerate( fields ):
- field_name = named_colums[i]
+ if i == len( named_columns ):
+ break
+ field_name = named_columns[i]
if field_name is None:
field_name = i #check that this is supposed to be 0 based.
field_dict[ field_name ] = field
@@ -366,6 +368,7 @@
self.columns[ name ] = index
self.largest_index = index
else:
+ self.largest_index = 0
for column_elem in config_element.findall( 'column' ):
name = column_elem.get( 'name', None )
assert name is not None, "Required 'name' attribute missing from column def"
@@ -495,7 +498,7 @@
try:
data_table_fh = open( filename, 'r+b' )
except IOError, e:
- log.warning( 'Error opening data table file (%s) with r+b, assuming file does not exist and will open as wb: %s', self.filename, e )
+ log.warning( 'Error opening data table file (%s) with r+b, assuming file does not exist and will open as wb: %s', filename, e )
data_table_fh = open( filename, 'wb' )
if os.stat( filename )[6] != 0:
# ensure last existing line ends with new line
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0