12 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/e14f0956dfc9/ Changeset: e14f0956dfc9 Branch: next-stable User: dannon Date: 2014-05-28 15:47:22 Summary: Cleanup prior to tabular work. Affected #: 3 files diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -633,9 +633,9 @@ }; return { - Dataset: Dataset, + Dataset: Dataset, TabularDataset: TabularDataset, - DatasetCollection: DatasetCollection, + DatasetCollection: DatasetCollection, TabularDatasetChunkedView: TabularDatasetChunkedView, createTabularDatasetChunkedView: createTabularDatasetChunkedView }; diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 templates/webapps/galaxy/dataset/display.mako --- a/templates/webapps/galaxy/dataset/display.mako +++ b/templates/webapps/galaxy/dataset/display.mako @@ -9,7 +9,7 @@ %if item.datatype.CHUNKABLE: <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -17,21 +17,21 @@ }); require(['mvc/data'], function(data) { - // + // // Use tabular data display progressively by deleting data from page body // and then showing dataset view. - // + // $('.page-body').children().remove(); data.createTabularDatasetChunkedView({ // TODO: encode id. - dataset_config: - _.extend( ${h.to_json_string( item.to_dict() )}, + dataset_config: + _.extend( ${h.to_json_string( item.to_dict() )}, { - chunk_url: "${h.url_for( controller='/dataset', action='display', + chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( item.id ))}", first_data_chunk: ${first_chunk} - } + } ), parent_elt: $('.page-body') }); @@ -58,9 +58,9 @@ <%def name="render_item_links( data )"> ## Provide links to save data and import dataset. <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a> - <a + <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}" - class="icon-button import" + class="icon-button import" title="Import dataset"></a></%def> @@ -70,7 +70,7 @@ %if data_to_render: %if truncated: <div class="warningmessagelarge"> - This dataset is large and only the first megabyte is shown below. | + This dataset is large and only the first megabyte is shown below. | <a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div> %endif @@ -100,9 +100,9 @@ | ${get_item_name( item ) | h} </div></div> - + <div class="unified-panel-body"> - <div style="overflow: auto; height: 100%;"> + <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right"> ${self.render_item_links( item )} @@ -110,7 +110,7 @@ <div> ${self.render_item_header( item )} </div> - + ${self.render_item( item, item_data )} </div></div> @@ -123,20 +123,20 @@ About this ${get_class_display_name( item.__class__ )} </div></div> - + <div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4> - + <p>${item.history.user.username | h}</p> - + <div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=identicon&s=150"></div> - ## Page meta. - + ## Page meta. + ## No links for datasets right now. - + ## Tags. <p><h4>Tags</h4> @@ -155,8 +155,8 @@ Yours: ${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )} </div> - </div> + </div></div></div> -</%def> \ No newline at end of file +</%def> diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 templates/webapps/galaxy/dataset/tabular_chunked.mako --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako @@ -8,7 +8,7 @@ ${h.js( "libs/require" )} <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -23,7 +23,7 @@ chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ))}", first_data_chunk: ${chunk} - } + } ), parent_elt: $('body') }); https://bitbucket.org/galaxy/galaxy-central/commits/e0470cb34e7a/ Changeset: e0470cb34e7a Branch: next-stable User: dannon Date: 2014-05-29 14:22:47 Summary: Merge. Affected #: 1 file diff -r e14f0956dfc984a11d495eb59f77131596110ae4 -r e0470cb34e7a14198fa635055abd81def09bba06 job_conf.xml.sample_advanced --- a/job_conf.xml.sample_advanced +++ b/job_conf.xml.sample_advanced @@ -204,6 +204,10 @@ using message queues (in the more traditional mode Galaxy sends files to and pull files from the LWR - this is obviously less appropriate when using a message queue). + + The default_file_action currently requires pycurl be available + to Galaxy (presumably in its virtualenv). Making this dependency + optional is an open task. --><param id="default_file_action">remote_transfer</param></destination> https://bitbucket.org/galaxy/galaxy-central/commits/b99e3eee6217/ Changeset: b99e3eee6217 User: dannon Date: 2014-05-29 14:23:03 Summary: Merge next-stable. Affected #: 3 files diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -640,9 +640,9 @@ }; return { - Dataset: Dataset, + Dataset: Dataset, TabularDataset: TabularDataset, - DatasetCollection: DatasetCollection, + DatasetCollection: DatasetCollection, TabularDatasetChunkedView: TabularDatasetChunkedView, createTabularDatasetChunkedView: createTabularDatasetChunkedView }; diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 templates/webapps/galaxy/dataset/display.mako --- a/templates/webapps/galaxy/dataset/display.mako +++ b/templates/webapps/galaxy/dataset/display.mako @@ -9,7 +9,7 @@ %if item.datatype.CHUNKABLE: <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -17,21 +17,21 @@ }); require(['mvc/data'], function(data) { - // + // // Use tabular data display progressively by deleting data from page body // and then showing dataset view. - // + // $('.page-body').children().remove(); data.createTabularDatasetChunkedView({ // TODO: encode id. - dataset_config: - _.extend( ${h.to_json_string( item.to_dict() )}, + dataset_config: + _.extend( ${h.to_json_string( item.to_dict() )}, { - chunk_url: "${h.url_for( controller='/dataset', action='display', + chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( item.id ))}", first_data_chunk: ${first_chunk} - } + } ), parent_elt: $('.page-body') }); @@ -58,9 +58,9 @@ <%def name="render_item_links( data )"> ## Provide links to save data and import dataset. <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a> - <a + <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}" - class="icon-button import" + class="icon-button import" title="Import dataset"></a></%def> @@ -70,7 +70,7 @@ %if data_to_render: %if truncated: <div class="warningmessagelarge"> - This dataset is large and only the first megabyte is shown below. | + This dataset is large and only the first megabyte is shown below. | <a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div> %endif @@ -100,9 +100,9 @@ | ${get_item_name( item ) | h} </div></div> - + <div class="unified-panel-body"> - <div style="overflow: auto; height: 100%;"> + <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right"> ${self.render_item_links( item )} @@ -110,7 +110,7 @@ <div> ${self.render_item_header( item )} </div> - + ${self.render_item( item, item_data )} </div></div> @@ -123,20 +123,20 @@ About this ${get_class_display_name( item.__class__ )} </div></div> - + <div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4> - + <p>${item.history.user.username | h}</p> - + <div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=identicon&s=150"></div> - ## Page meta. - + ## Page meta. + ## No links for datasets right now. - + ## Tags. <p><h4>Tags</h4> @@ -155,8 +155,8 @@ Yours: ${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )} </div> - </div> + </div></div></div> -</%def> \ No newline at end of file +</%def> diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 templates/webapps/galaxy/dataset/tabular_chunked.mako --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako @@ -8,7 +8,7 @@ ${h.js( "libs/require" )} <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -23,7 +23,7 @@ chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ))}", first_data_chunk: ${chunk} - } + } ), parent_elt: $('body') }); https://bitbucket.org/galaxy/galaxy-central/commits/60aa2c0c0b21/ Changeset: 60aa2c0c0b21 User: dannon Date: 2014-05-29 22:28:08 Summary: merge. Affected #: 1 file diff -r b99e3eee6217db24efa3fad12bd5c00289522056 -r 60aa2c0c0b21f4c52b1f83c7f19d0b148e198ee0 lib/galaxy/visualization/registry.py --- a/lib/galaxy/visualization/registry.py +++ b/lib/galaxy/visualization/registry.py @@ -243,10 +243,11 @@ datatype_class_name = test_result test_result = trans.app.datatypes_registry.get_datatype_class_by_name( datatype_class_name ) if not test_result: - # warn if can't find class, but continue (with other tests) - log.warn( 'visualizations_registry cannot find class (%s)' + - ' for applicability test on: %s, id: %s', datatype_class_name, - target_object, getattr( target_object, 'id', '' ) ) + # but continue (with other tests) if can't find class by that name + #if self.debug: + # log.warn( 'visualizations_registry cannot find class (%s)' + + # ' for applicability test on: %s, id: %s', datatype_class_name, + # target_object, getattr( target_object, 'id', '' ) ) continue #NOTE: tests are OR'd, if any test passes - the visualization can be applied https://bitbucket.org/galaxy/galaxy-central/commits/a37133f7364d/ Changeset: a37133f7364d Branch: next-stable User: dannon Date: 2014-05-30 17:11:32 Summary: Add loading indicator back that disappeared (unintentionally?) in b12b245510be Affected #: 1 file diff -r b8fef1dfa8e8eb5afdeaa96236a0a9990f7c532b -r a37133f7364d75f3749e9eb72c0195b446dce781 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -133,6 +133,16 @@ }, render: function() { + // Add loading indicator. + var loading_indicator = $('<div/>').attr('id', 'loading_indicator'); + + loading_indicator.ajaxStart(function(){ + $(this).show(); + }).ajaxStop(function(){ + $(this).hide(); + }); + + this.$el.append(loading_indicator); // Add data table and header. var data_table = $('<table/>').attr({ id: 'content_table', @@ -170,11 +180,6 @@ }); } }); - $('#loading_indicator').ajaxStart(function(){ - $(this).show(); - }).ajaxStop(function(){ - $(this).hide(); - }); }, /** https://bitbucket.org/galaxy/galaxy-central/commits/79a9d2b2c110/ Changeset: 79a9d2b2c110 User: dannon Date: 2014-05-30 17:11:46 Summary: Merge. Affected #: 1 file diff -r 60aa2c0c0b21f4c52b1f83c7f19d0b148e198ee0 -r 79a9d2b2c11024b5cd3a67ef84f25d9c07029a85 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -133,6 +133,16 @@ }, render: function() { + // Add loading indicator. + var loading_indicator = $('<div/>').attr('id', 'loading_indicator'); + + loading_indicator.ajaxStart(function(){ + $(this).show(); + }).ajaxStop(function(){ + $(this).hide(); + }); + + this.$el.append(loading_indicator); // Add data table and header. var data_table = $('<table/>').attr({ id: 'content_table', @@ -177,11 +187,6 @@ }); } }); - $('#loading_indicator').ajaxStart(function(){ - $(this).show(); - }).ajaxStop(function(){ - $(this).hide(); - }); }, /** https://bitbucket.org/galaxy/galaxy-central/commits/afb293ca337b/ Changeset: afb293ca337b Branch: next-stable User: dannon Date: 2014-05-30 17:33:08 Summary: Pack scripts. Affected #: 1 file diff -r a37133f7364d75f3749e9eb72c0195b446dce781 -r afb293ca337be1e04a34f22a310367d99ff2a38f static/scripts/packed/mvc/data.js --- a/static/scripts/packed/mvc/data.js +++ b/static/scripts/packed/mvc/data.js @@ -1,1 +1,1 @@ -define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}}); \ No newline at end of file +define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}}); \ No newline at end of file https://bitbucket.org/galaxy/galaxy-central/commits/47fbab3029e5/ Changeset: 47fbab3029e5 User: dannon Date: 2014-05-30 17:33:18 Summary: Merge next-stable. Affected #: 1 file diff -r 79a9d2b2c11024b5cd3a67ef84f25d9c07029a85 -r 47fbab3029e5fe1a1f3334bbcfa46c5856c63bc7 static/scripts/packed/mvc/data.js --- a/static/scripts/packed/mvc/data.js +++ b/static/scripts/packed/mvc/data.js @@ -1,1 +1,1 @@ -define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}}); \ No newline at end of file +define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}}); \ No newline at end of file https://bitbucket.org/galaxy/galaxy-central/commits/cded8178bb48/ Changeset: cded8178bb48 Branch: next-stable User: dannon Date: 2014-05-30 17:34:15 Summary: Merge. Affected #: 1 file diff -r afb293ca337be1e04a34f22a310367d99ff2a38f -r cded8178bb4834236d9ae6239c14b928ae2d282b lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -498,7 +498,7 @@ # Check that the file is in the right location local_filename = os.path.abspath( value['path'] ) assert local_filename.startswith( upload_store ), \ - "Filename provided by nginx is not in correct directory" + "Filename provided by nginx (%s) is not in correct directory (%s)" % (local_filename, upload_store) value = dict( filename=value["name"], local_filename=local_filename https://bitbucket.org/galaxy/galaxy-central/commits/f48fbe6866a5/ Changeset: f48fbe6866a5 User: dannon Date: 2014-05-30 17:35:27 Summary: Merge Affected #: 2 files diff -r 3409e283965f58ec4bf96594f980a8e6ee2cb058 -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -133,6 +133,16 @@ }, render: function() { + // Add loading indicator. + var loading_indicator = $('<div/>').attr('id', 'loading_indicator'); + + loading_indicator.ajaxStart(function(){ + $(this).show(); + }).ajaxStop(function(){ + $(this).hide(); + }); + + this.$el.append(loading_indicator); // Add data table and header. var data_table = $('<table/>').attr({ id: 'content_table', @@ -177,11 +187,6 @@ }); } }); - $('#loading_indicator').ajaxStart(function(){ - $(this).show(); - }).ajaxStop(function(){ - $(this).hide(); - }); }, /** diff -r 3409e283965f58ec4bf96594f980a8e6ee2cb058 -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 static/scripts/packed/mvc/data.js --- a/static/scripts/packed/mvc/data.js +++ b/static/scripts/packed/mvc/data.js @@ -1,1 +1,1 @@ -define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}}); \ No newline at end of file +define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}}); \ No newline at end of file https://bitbucket.org/galaxy/galaxy-central/commits/cb1e86b187a3/ Changeset: cb1e86b187a3 Branch: next-stable User: dannon Date: 2014-05-30 17:37:13 Summary: Merge. Affected #: 3 files diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -638,9 +638,9 @@ }; return { - Dataset: Dataset, + Dataset: Dataset, TabularDataset: TabularDataset, - DatasetCollection: DatasetCollection, + DatasetCollection: DatasetCollection, TabularDatasetChunkedView: TabularDatasetChunkedView, createTabularDatasetChunkedView: createTabularDatasetChunkedView }; diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 templates/webapps/galaxy/dataset/display.mako --- a/templates/webapps/galaxy/dataset/display.mako +++ b/templates/webapps/galaxy/dataset/display.mako @@ -9,7 +9,7 @@ %if item.datatype.CHUNKABLE: <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -17,21 +17,21 @@ }); require(['mvc/data'], function(data) { - // + // // Use tabular data display progressively by deleting data from page body // and then showing dataset view. - // + // $('.page-body').children().remove(); data.createTabularDatasetChunkedView({ // TODO: encode id. - dataset_config: - _.extend( ${h.to_json_string( item.to_dict() )}, + dataset_config: + _.extend( ${h.to_json_string( item.to_dict() )}, { - chunk_url: "${h.url_for( controller='/dataset', action='display', + chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( item.id ))}", first_data_chunk: ${first_chunk} - } + } ), parent_elt: $('.page-body') }); @@ -58,9 +58,9 @@ <%def name="render_item_links( data )"> ## Provide links to save data and import dataset. <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a> - <a + <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}" - class="icon-button import" + class="icon-button import" title="Import dataset"></a></%def> @@ -70,7 +70,7 @@ %if data_to_render: %if truncated: <div class="warningmessagelarge"> - This dataset is large and only the first megabyte is shown below. | + This dataset is large and only the first megabyte is shown below. | <a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div> %endif @@ -100,9 +100,9 @@ | ${get_item_name( item ) | h} </div></div> - + <div class="unified-panel-body"> - <div style="overflow: auto; height: 100%;"> + <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right"> ${self.render_item_links( item )} @@ -110,7 +110,7 @@ <div> ${self.render_item_header( item )} </div> - + ${self.render_item( item, item_data )} </div></div> @@ -123,20 +123,20 @@ About this ${get_class_display_name( item.__class__ )} </div></div> - + <div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4> - + <p>${item.history.user.username | h}</p> - + <div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=identicon&s=150"></div> - ## Page meta. - + ## Page meta. + ## No links for datasets right now. - + ## Tags. <p><h4>Tags</h4> @@ -155,8 +155,8 @@ Yours: ${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )} </div> - </div> + </div></div></div> -</%def> \ No newline at end of file +</%def> diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 templates/webapps/galaxy/dataset/tabular_chunked.mako --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako @@ -8,7 +8,7 @@ ${h.js( "libs/require" )} <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -23,7 +23,7 @@ chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ))}", first_data_chunk: ${chunk} - } + } ), parent_elt: $('body') }); https://bitbucket.org/galaxy/galaxy-central/commits/25ab1fe9dbc7/ Changeset: 25ab1fe9dbc7 User: dannon Date: 2014-05-30 17:38:13 Summary: Merge. Affected #: 3 files diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -645,9 +645,9 @@ }; return { - Dataset: Dataset, + Dataset: Dataset, TabularDataset: TabularDataset, - DatasetCollection: DatasetCollection, + DatasetCollection: DatasetCollection, TabularDatasetChunkedView: TabularDatasetChunkedView, createTabularDatasetChunkedView: createTabularDatasetChunkedView }; diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 templates/webapps/galaxy/dataset/display.mako --- a/templates/webapps/galaxy/dataset/display.mako +++ b/templates/webapps/galaxy/dataset/display.mako @@ -9,7 +9,7 @@ %if item.datatype.CHUNKABLE: <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -17,21 +17,21 @@ }); require(['mvc/data'], function(data) { - // + // // Use tabular data display progressively by deleting data from page body // and then showing dataset view. - // + // $('.page-body').children().remove(); data.createTabularDatasetChunkedView({ // TODO: encode id. - dataset_config: - _.extend( ${h.to_json_string( item.to_dict() )}, + dataset_config: + _.extend( ${h.to_json_string( item.to_dict() )}, { - chunk_url: "${h.url_for( controller='/dataset', action='display', + chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( item.id ))}", first_data_chunk: ${first_chunk} - } + } ), parent_elt: $('.page-body') }); @@ -58,9 +58,9 @@ <%def name="render_item_links( data )"> ## Provide links to save data and import dataset. <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a> - <a + <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}" - class="icon-button import" + class="icon-button import" title="Import dataset"></a></%def> @@ -70,7 +70,7 @@ %if data_to_render: %if truncated: <div class="warningmessagelarge"> - This dataset is large and only the first megabyte is shown below. | + This dataset is large and only the first megabyte is shown below. | <a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div> %endif @@ -100,9 +100,9 @@ | ${get_item_name( item ) | h} </div></div> - + <div class="unified-panel-body"> - <div style="overflow: auto; height: 100%;"> + <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right"> ${self.render_item_links( item )} @@ -110,7 +110,7 @@ <div> ${self.render_item_header( item )} </div> - + ${self.render_item( item, item_data )} </div></div> @@ -123,20 +123,20 @@ About this ${get_class_display_name( item.__class__ )} </div></div> - + <div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4> - + <p>${item.history.user.username | h}</p> - + <div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=identicon&s=150"></div> - ## Page meta. - + ## Page meta. + ## No links for datasets right now. - + ## Tags. <p><h4>Tags</h4> @@ -155,8 +155,8 @@ Yours: ${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )} </div> - </div> + </div></div></div> -</%def> \ No newline at end of file +</%def> diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 templates/webapps/galaxy/dataset/tabular_chunked.mako --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako @@ -8,7 +8,7 @@ ${h.js( "libs/require" )} <script type="text/javascript"> - require.config({ + require.config({ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, @@ -23,7 +23,7 @@ chunk_url: "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ))}", first_data_chunk: ${chunk} - } + } ), parent_elt: $('body') }); 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.