commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/45932ad3f1ce/ Changeset: 45932ad3f1ce User: dannon Date: 2015-01-12 22:47:12+00:00 Summary: Trailing whitespace in parameters.basic. Affected #: 1 file diff -r 85e8fb54b2851454a000cab23d57ce102af6aa30 -r 45932ad3f1ce1b0455413d3d9c097510493a14c9 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -487,7 +487,7 @@ d['truevalue'] = self.truevalue d['falsevalue'] = self.falsevalue return d - + @property def legal_values( self ): return [ self.truevalue, self.falsevalue ] @@ -670,7 +670,7 @@ def get_label( self ): # BaseURLToolParameters are ultimately "hidden" parameters return None - + def to_dict( self, trans, view='collection', value_mapper=None ): d = super( BaseURLToolParameter, self ).to_dict( trans ) d['value'] = self.get_value( trans ) @@ -1033,7 +1033,7 @@ # Found selected option. value = option[1] d[ 'value' ] = value - + d['display'] = self.display d['multiple'] = self.multiple d['is_dynamic'] = self.is_dynamic @@ -1114,7 +1114,7 @@ 'display' : self.display, 'multiple' : self.multiple }) - + return d def _get_dbkey_names( self, trans=None ): @@ -1316,10 +1316,10 @@ # add data reference d['data_ref'] = self.data_ref - + # add numerical flag d['numerical'] = self.numerical - + # return return d @@ -2111,7 +2111,7 @@ d['multiple'] = self.multiple d['is_dynamic'] = True d['options'] = {'hda': [], 'hdca': []} - + # return default content if context is not available if other_values is None: return d @@ -2120,7 +2120,7 @@ dataset_matcher = DatasetMatcher( trans, self, None, other_values ) history = trans.history multiple = self.multiple - + # add datasets for hda in history.active_datasets_children_and_roles: match = dataset_matcher.hda_match( hda ) @@ -2133,7 +2133,7 @@ 'name' : m.name, 'src' : 'hda' }) - + # add dataset collections dataset_collection_matcher = DatasetCollectionMatcher( dataset_matcher ) for hdca in history.active_dataset_collections: @@ -2352,7 +2352,7 @@ d['multiple'] = self.multiple d['is_dynamic'] = False d['options'] = {'hda': [], 'hdca': []} - + # return default content if context is not available if other_values is None: return d @@ -2360,7 +2360,7 @@ # prepare dataset/collection matching dataset_matcher = DatasetMatcher( trans, self, None, other_values ) history = trans.history - + # append directly matched collections for hdca in self.match_collections( trans, history, dataset_matcher ): d['options']['hdca'].append({ https://bitbucket.org/galaxy/galaxy-central/commits/50e31bdc72cf/ Changeset: 50e31bdc72cf User: dannon Date: 2015-01-12 22:50:10+00:00 Summary: Make SelectToolParameter behave the same way as DrillDownSelectToolParameter for (deprecated) dynamic_options w/ trans. TODO: Revisit this and figure out what the replacement for dynamic_options is. Affected #: 1 file diff -r 45932ad3f1ce1b0455413d3d9c097510493a14c9 -r 50e31bdc72cf9cfdf619342926ac894d1314a469 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -782,8 +782,11 @@ if self.options: return self.options.get_options( trans, other_values ) elif self.dynamic_options: + call_other_values = {"__trans__": trans} + if other_values: + call_other_values.update( other_values.dict ) try: - return eval( self.dynamic_options, self.tool.code_namespace, other_values ) + return eval( self.dynamic_options, self.tool.code_namespace, call_other_values ) except Exception: return [] else: https://bitbucket.org/galaxy/galaxy-central/commits/336f89e2f013/ Changeset: 336f89e2f013 User: dannon Date: 2015-01-12 22:50:25+00:00 Summary: Merge. Affected #: 10 files diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 client/galaxy/scripts/viz/trackster.js --- a/client/galaxy/scripts/viz/trackster.js +++ b/client/galaxy/scripts/viz/trackster.js @@ -12,7 +12,6 @@ [ // load js libraries 'utils/utils', - 'mvc/ui/icon-button', 'libs/jquery/jquery.event.drag', 'libs/jquery/jquery.event.hover', 'libs/jquery/jquery.mousewheel', @@ -32,9 +31,8 @@ }); // trackster viewer -define( ["libs/underscore", "base", "viz/trackster/tracks", "viz/visualization"], - function(_, base, tracks, visualization) { - +define( ["libs/underscore", "base", "viz/trackster/tracks", "viz/visualization", "mvc/ui/icon-button" ], + function(_, base, tracks, visualization, mod_icon_btn) { /** * User interface controls for trackster */ diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 config/datatypes_conf.xml.sample --- a/config/datatypes_conf.xml.sample +++ b/config/datatypes_conf.xml.sample @@ -140,6 +140,7 @@ <datatype extension="rgb" type="galaxy.datatypes.images:Rgb" mimetype="image/rgb"/><datatype extension="pbm" type="galaxy.datatypes.images:Pbm" mimetype="image/pbm"/><datatype extension="pgm" type="galaxy.datatypes.images:Pgm" mimetype="image/pgm"/> + <datatype extension="rna_eps" type="galaxy.datatypes.sequence:RNADotPlotMatrix" mimetype="image/eps" display_in_upload="True"/><datatype extension="eps" type="galaxy.datatypes.images:Eps" mimetype="image/eps"/><datatype extension="rast" type="galaxy.datatypes.images:Rast" mimetype="image/rast"/><datatype extension="laj" type="galaxy.datatypes.images:Laj"/> @@ -304,6 +305,7 @@ <sniffer type="galaxy.datatypes.text:Arff"/><sniffer type="galaxy.datatypes.text:Ipynb"/><sniffer type="galaxy.datatypes.text:Json"/> + <sniffer type="galaxy.datatypes.sequence:RNADotPlotMatrix"/><sniffer type="galaxy.datatypes.images:Jpg"/><sniffer type="galaxy.datatypes.images:Png"/><sniffer type="galaxy.datatypes.images:Tiff"/> diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 eggs.ini --- a/eggs.ini +++ b/eggs.ini @@ -15,7 +15,7 @@ bx_python = 0.7.2 Cheetah = 2.2.2 MarkupSafe = 0.12 -mercurial = 2.2.3 +mercurial = 3.2.4 MySQL_python = 1.2.3c1 PyRods = 3.2.4 numpy = 1.6.0 diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 lib/galaxy/datatypes/sequence.py --- a/lib/galaxy/datatypes/sequence.py +++ b/lib/galaxy/datatypes/sequence.py @@ -17,7 +17,7 @@ from galaxy.datatypes.checkers import is_gzip from galaxy.datatypes.sniff import get_test_fname, get_headers from galaxy.datatypes.metadata import MetadataElement - +from galaxy.datatypes.util.image_util import check_image_type try: eggs.require( "bx-python" ) @@ -814,3 +814,34 @@ except: return False + +class RNADotPlotMatrix( data.Data ): + file_ext = "rna_eps" + + def set_peek( self, dataset, is_multi_byte=False ): + if not dataset.dataset.purged: + dataset.peek = 'RNA Dot Plot format (Postscript derivative)' + dataset.blurb = data.nice_size( dataset.get_size() ) + else: + dataset.peek = 'file does not exist' + dataset.blurb = 'file purged from disk' + + def sniff(self, filename): + """Determine if the file is in RNA dot plot format.""" + if check_image_type( filename, ['EPS'] ): + seq = False + coor = False + pairs = False + with open( filename ) as handle: + for line in handle: + line = line.strip() + if line: + if line.startswith('/sequence'): + seq = True + elif line.startswith('/coor'): + coor = True + elif line.startswith('/pairs'): + pairs = True + if seq and coor and pairs: + return True + return False \ No newline at end of file diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 lib/galaxy/datatypes/util/image_util.py --- a/lib/galaxy/datatypes/util/image_util.py +++ b/lib/galaxy/datatypes/util/image_util.py @@ -71,6 +71,4 @@ return 'pbm' if format == 'PGM': return 'pgm' - if format == 'EPS': - return 'eps' return None diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 lib/galaxy/tools/toolbox/base.py --- a/lib/galaxy/tools/toolbox/base.py +++ b/lib/galaxy/tools/toolbox/base.py @@ -394,7 +394,7 @@ section.elems.stub_label( section_id ) self._integrated_tool_panel.append_section( key, section ) elif elem.tag == 'label': - section.stub_label( key ) + self._integrated_tool_panel.stub_label( key ) def _write_integrated_tool_panel_config_file( self ): """ diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 lib/tool_shed/util/hg_util.py --- a/lib/tool_shed/util/hg_util.py +++ b/lib/tool_shed/util/hg_util.py @@ -16,7 +16,7 @@ from mercurial import commands from mercurial import hg from mercurial import ui -from mercurial.changegroup import readbundle +from mercurial.exchange import readbundle from mercurial.changegroup import readexactly from tool_shed.util import basic_util @@ -26,7 +26,7 @@ INITIAL_CHANGELOG_HASH = '000000000000' def add_changeset( repo_ui, repo, path_to_filename_in_archive ): - commands.add( repo_ui, repo, path_to_filename_in_archive ) + commands.add( repo_ui, repo, str( path_to_filename_in_archive ) ) def archive_repository_revision( app, repository, archive_dir, changeset_revision ): '''Create an un-versioned archive of a repository.''' @@ -49,7 +49,7 @@ command line) to a json object. """ # See http://www.wstein.org/home/wstein/www/home/was/patches/hg_json - hg_unbundle10_obj = readbundle( fh, None ) + hg_unbundle10_obj = readbundle( None, fh, None ) groups = [ group for group in unpack_groups( hg_unbundle10_obj ) ] return json.dumps( groups, indent=4 ) diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 static/scripts/packed/viz/trackster.js --- a/static/scripts/packed/viz/trackster.js +++ b/static/scripts/packed/viz/trackster.js @@ -1,1 +1,1 @@ -var ui=null;var view=null;var browser_router=null;require(["utils/utils","mvc/ui/icon-button","libs/jquery/jquery.event.drag","libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel","libs/jquery/jquery-ui","libs/jquery/select2","libs/farbtastic","libs/jquery/jquery.form","libs/jquery/jquery.rating"],function(b,a){b.cssLoadFile("static/style/jquery.rating.css");b.cssLoadFile("static/style/autocomplete_tagging.css");b.cssLoadFile("static/style/jquery-ui/smoothness/jquery-ui.css");b.cssLoadFile("static/style/library.css");b.cssLoadFile("static/style/trackster.css")});define(["libs/underscore","base","viz/trackster/tracks","viz/visualization"],function(b,e,a,c){var d=e.Base.extend({initialize:function(g){this.baseURL=g},save_viz:function(){Galaxy.modal.show({title:"Saving...",body:"progress"});var g=[];$(".bookmark").each(function(){g.push({position:$(this).children(".position").text(),annotation:$(this).children(".annotation").text()})});var h=(view.overview_drawable?view.overview_drawable.config.get_value("name"):null),j={view:view.to_dict(),viewport:{chrom:view.chrom,start:view.low,end:view.high,overview:h},bookmarks:g};return $.ajax({url:galaxy_config.root+"visualization/save",type:"POST",dataType:"json",data:{id:view.vis_id,title:view.config.get_value("name"),dbkey:view.dbkey,type:"trackster",vis_json:JSON.stringify(j)}}).success(function(k){Galaxy.modal.hide();view.vis_id=k.vis_id;view.has_changes=false;window.history.pushState({},"",k.url+window.location.hash)}).error(function(){Galaxy.modal.show({title:"Could Not Save",body:"Could not save visualization. Please try again later.",buttons:{Cancel:function(){Galaxy.modal.hide()}}})})},createButtonMenu:function(){var g=this,h=mod_icon_btn.create_icon_buttons_menu([{icon_class:"plus-button",title:"Add tracks",on_click:function(){c.select_datasets(galaxy_config.root+"visualization/list_current_history_datasets",galaxy_config.root+"api/datasets",{"f-dbkey":view.dbkey},function(j){b.each(j,function(k){view.add_drawable(a.object_from_template(k,view,view))})})}},{icon_class:"block--plus",title:"Add group",on_click:function(){view.add_drawable(new a.DrawableGroup(view,view,{name:"New Group"}))}},{icon_class:"bookmarks",title:"Bookmarks",on_click:function(){force_right_panel(($("div#right").css("right")=="0px"?"hide":"show"))}},{icon_class:"globe",title:"Circster",on_click:function(){window.location=g.baseURL+"visualization/circster?id="+view.vis_id}},{icon_class:"disk--arrow",title:"Save",on_click:function(){g.save_viz()}},{icon_class:"cross-circle",title:"Close",on_click:function(){g.handle_unsaved_changes(view)}}],{tooltip_config:{placement:"bottom"}});this.buttonMenu=h;return h},add_bookmarks:function(){var g=this,h=this.baseURL;Galaxy.modal.show({title:"Select dataset for new bookmarks",body:"progress"});$.ajax({url:this.baseURL+"/visualization/list_histories",data:{"f-dbkey":view.dbkey},error:function(){alert("Grid failed")},success:function(j){Galaxy.modal.show({title:"Select dataset for new bookmarks",body:j,buttons:{Cancel:function(){Galaxy.modal.hide()},Insert:function(){$("input[name=id]:checked,input[name=ldda_ids]:checked").first().each(function(){var k,l=$(this).val();if($(this).attr("name")==="id"){k={hda_id:l}}else{k={ldda_id:l}}$.ajax({url:this.baseURL+"/visualization/bookmarks_from_dataset",data:k,dataType:"json"}).then(function(m){for(i=0;i<m.data.length;i++){var n=m.data[i];g.add_bookmark(n[0],n[1])}})});Galaxy.modal.hide()}}})}})},add_bookmark:function(l,j,g){var n=$("#right .unified-panel-body"),p=$("<div/>").addClass("bookmark").appendTo(n);var q=$("<div/>").addClass("position").appendTo(p),m=$("<a href=''/>").text(l).appendTo(q).click(function(){view.go_to(l);return false}),k=$("<div/>").text(j).appendTo(p);if(g){var o=$("<div/>").addClass("delete-icon-container").prependTo(p).click(function(){p.slideUp("fast");p.remove();view.has_changes=true;return false}),h=$("<a href=''/>").addClass("icon-button delete").appendTo(o);k.make_text_editable({num_rows:3,use_textarea:true,help_text:"Edit bookmark note"}).addClass("annotation")}view.has_changes=true;return p},create_visualization:function(m,g,l,n,k){var j=this,h=new a.TracksterView(b.extend(m,{header:false}));h.editor=true;$.when(h.load_chroms_deferred).then(function(y){if(g){var w=g.chrom,o=g.start,t=g.end,q=g.overview;if(w&&(o!==undefined)&&t){h.change_chrom(w,o,t)}else{h.change_chrom(y[0].chrom)}}else{h.change_chrom(y[0].chrom)}if(l){var r,p,s;for(var u=0;u<l.length;u++){h.add_drawable(a.object_from_template(l[u],h,h))}}var x;for(var u=0;u<h.drawables.length;u++){if(h.drawables[u].config.get_value("name")===q){h.set_overview(h.drawables[u]);break}}if(n){var v;for(var u=0;u<n.length;u++){v=n[u];j.add_bookmark(v.position,v.annotation,k)}}h.has_changes=false});this.set_up_router({view:h});return h},set_up_router:function(g){new c.TrackBrowserRouter(g);Backbone.history.start()},init_keyboard_nav:function(g){$(document).keyup(function(h){if($(h.srcElement).is(":input")){return}switch(h.which){case 37:g.move_fraction(0.25);break;case 38:var j=Math.round(g.viewport_container.height()/15);g.viewport_container.scrollTop(g.viewport_container.scrollTop()-20);break;case 39:g.move_fraction(-0.25);break;case 40:var j=Math.round(g.viewport_container.height()/15);g.viewport_container.scrollTop(g.viewport_container.scrollTop()+20);break}})},handle_unsaved_changes:function(g){if(g.has_changes){var h=this;Galaxy.modal.show({title:"Close visualization",body:"There are unsaved changes to your visualization which will be lost if you do not save them.",buttons:{Cancel:function(){Galaxy.modal.hide()},"Leave without Saving":function(){$(window).off("beforeunload");window.location=galaxy_config.root+"visualization"},Save:function(){$.when(h.save_viz()).then(function(){window.location=galaxy_config.root+"visualization"})}}})}else{window.location=galaxy_config.root+"visualization"}}});var f=e.Backbone.View.extend({initialize:function(){ui=new d(galaxy_config.root);ui.createButtonMenu();ui.buttonMenu.$el.attr("style","float: right");$("#center .unified-panel-header-inner").append(ui.buttonMenu.$el);$("#right .unified-panel-title").append("Bookmarks");$("#right .unified-panel-icons").append("<a id='add-bookmark-button' class='icon-button menu-button plus-button' href='javascript:void(0);' title='Add bookmark'></a>");$("#right-border").click(function(){view.resize_window()});force_right_panel("hide");if(galaxy_config.app.id){this.view_existing()}else{this.view_new()}},view_existing:function(){var g=galaxy_config.app.viz_config;view=ui.create_visualization({container:$("#center .unified-panel-body"),name:g.title,vis_id:g.vis_id,dbkey:g.dbkey},g.viewport,g.tracks,g.bookmarks,true);this.init_editor()},view_new:function(){var g=this;$.ajax({url:galaxy_config.root+"api/genomes?chrom_info=True",data:{},error:function(){alert("Couldn't create new browser.")},success:function(h){Galaxy.modal.show({title:"New Visualization",body:g.template_view_new(h),buttons:{Cancel:function(){window.location=galaxy_config.root+"visualization/list"},Create:function(){g.create_browser($("#new-title").val(),$("#new-dbkey").val());Galaxy.modal.hide()}}});if(galaxy_config.app.default_dbkey){$("#new-dbkey").val(galaxy_config.app.default_dbkey)}$("#new-title").focus();$("select[name='dbkey']").select2();$("#overlay").css("overflow","auto")}})},template_view_new:function(g){var j='<form id="new-browser-form" action="javascript:void(0);" method="post" onsubmit="return false;"><div class="form-row"><label for="new-title">Browser name:</label><div class="form-row-input"><input type="text" name="title" id="new-title" value="Unnamed"></input></div><div style="clear: both;"></div></div><div class="form-row"><label for="new-dbkey">Reference genome build (dbkey): </label><div class="form-row-input"><select name="dbkey" id="new-dbkey">';for(var h=0;h<g.length;h++){j+='<option value="'+g[h][1]+'">'+g[h][0]+"</option>"}j+='</select></div><div style="clear: both;"></div></div><div class="form-row">Is the build not listed here? <a href="'+galaxy_config.root+'user/dbkeys?use_panels=True">Add a Custom Build</a></div></form>';return j},create_browser:function(h,g){$(document).trigger("convert_to_values");view=ui.create_visualization({container:$("#center .unified-panel-body"),name:h,dbkey:g},galaxy_config.app.gene_region);this.init_editor();view.editor=true},init_editor:function(){$("#center .unified-panel-title").text(view.config.get_value("name")+" ("+view.dbkey+")");if(galaxy_config.app.add_dataset){$.ajax({url:galaxy_config.root+"api/datasets/"+galaxy_config.app.add_dataset,data:{hda_ldda:"hda",data_type:"track_config"},dataType:"json",success:function(g){view.add_drawable(a.object_from_template(g,view,view))}})}$("#add-bookmark-button").click(function(){var h=view.chrom+":"+view.low+"-"+view.high,g="Bookmark description";return ui.add_bookmark(h,g,true)});ui.init_keyboard_nav(view);$(window).on("beforeunload",function(){if(view.has_changes){return"There are unsaved changes to your visualization that will be lost if you leave this page."}})}});return{TracksterUI:d,GalaxyApp:f}}); \ No newline at end of file +var ui=null;var view=null;var browser_router=null;require(["utils/utils","libs/jquery/jquery.event.drag","libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel","libs/jquery/jquery-ui","libs/jquery/select2","libs/farbtastic","libs/jquery/jquery.form","libs/jquery/jquery.rating"],function(b,a){b.cssLoadFile("static/style/jquery.rating.css");b.cssLoadFile("static/style/autocomplete_tagging.css");b.cssLoadFile("static/style/jquery-ui/smoothness/jquery-ui.css");b.cssLoadFile("static/style/library.css");b.cssLoadFile("static/style/trackster.css")});define(["libs/underscore","base","viz/trackster/tracks","viz/visualization","mvc/ui/icon-button"],function(b,f,a,d,c){var e=f.Base.extend({initialize:function(h){this.baseURL=h},save_viz:function(){Galaxy.modal.show({title:"Saving...",body:"progress"});var h=[];$(".bookmark").each(function(){h.push({position:$(this).children(".position").text(),annotation:$(this).children(".annotation").text()})});var j=(view.overview_drawable?view.overview_drawable.config.get_value("name"):null),k={view:view.to_dict(),viewport:{chrom:view.chrom,start:view.low,end:view.high,overview:j},bookmarks:h};return $.ajax({url:galaxy_config.root+"visualization/save",type:"POST",dataType:"json",data:{id:view.vis_id,title:view.config.get_value("name"),dbkey:view.dbkey,type:"trackster",vis_json:JSON.stringify(k)}}).success(function(l){Galaxy.modal.hide();view.vis_id=l.vis_id;view.has_changes=false;window.history.pushState({},"",l.url+window.location.hash)}).error(function(){Galaxy.modal.show({title:"Could Not Save",body:"Could not save visualization. Please try again later.",buttons:{Cancel:function(){Galaxy.modal.hide()}}})})},createButtonMenu:function(){var h=this,j=c.create_icon_buttons_menu([{icon_class:"plus-button",title:"Add tracks",on_click:function(){d.select_datasets(galaxy_config.root+"visualization/list_current_history_datasets",galaxy_config.root+"api/datasets",{"f-dbkey":view.dbkey},function(k){b.each(k,function(l){view.add_drawable(a.object_from_template(l,view,view))})})}},{icon_class:"block--plus",title:"Add group",on_click:function(){view.add_drawable(new a.DrawableGroup(view,view,{name:"New Group"}))}},{icon_class:"bookmarks",title:"Bookmarks",on_click:function(){force_right_panel(($("div#right").css("right")=="0px"?"hide":"show"))}},{icon_class:"globe",title:"Circster",on_click:function(){window.location=h.baseURL+"visualization/circster?id="+view.vis_id}},{icon_class:"disk--arrow",title:"Save",on_click:function(){h.save_viz()}},{icon_class:"cross-circle",title:"Close",on_click:function(){h.handle_unsaved_changes(view)}}],{tooltip_config:{placement:"bottom"}});this.buttonMenu=j;return j},add_bookmarks:function(){var h=this,j=this.baseURL;Galaxy.modal.show({title:"Select dataset for new bookmarks",body:"progress"});$.ajax({url:this.baseURL+"/visualization/list_histories",data:{"f-dbkey":view.dbkey},error:function(){alert("Grid failed")},success:function(k){Galaxy.modal.show({title:"Select dataset for new bookmarks",body:k,buttons:{Cancel:function(){Galaxy.modal.hide()},Insert:function(){$("input[name=id]:checked,input[name=ldda_ids]:checked").first().each(function(){var l,m=$(this).val();if($(this).attr("name")==="id"){l={hda_id:m}}else{l={ldda_id:m}}$.ajax({url:this.baseURL+"/visualization/bookmarks_from_dataset",data:l,dataType:"json"}).then(function(n){for(i=0;i<n.data.length;i++){var o=n.data[i];h.add_bookmark(o[0],o[1])}})});Galaxy.modal.hide()}}})}})},add_bookmark:function(m,k,h){var o=$("#right .unified-panel-body"),q=$("<div/>").addClass("bookmark").appendTo(o);var r=$("<div/>").addClass("position").appendTo(q),n=$("<a href=''/>").text(m).appendTo(r).click(function(){view.go_to(m);return false}),l=$("<div/>").text(k).appendTo(q);if(h){var p=$("<div/>").addClass("delete-icon-container").prependTo(q).click(function(){q.slideUp("fast");q.remove();view.has_changes=true;return false}),j=$("<a href=''/>").addClass("icon-button delete").appendTo(p);l.make_text_editable({num_rows:3,use_textarea:true,help_text:"Edit bookmark note"}).addClass("annotation")}view.has_changes=true;return q},create_visualization:function(n,h,m,o,l){var k=this,j=new a.TracksterView(b.extend(n,{header:false}));j.editor=true;$.when(j.load_chroms_deferred).then(function(z){if(h){var x=h.chrom,p=h.start,u=h.end,r=h.overview;if(x&&(p!==undefined)&&u){j.change_chrom(x,p,u)}else{j.change_chrom(z[0].chrom)}}else{j.change_chrom(z[0].chrom)}if(m){var s,q,t;for(var v=0;v<m.length;v++){j.add_drawable(a.object_from_template(m[v],j,j))}}var y;for(var v=0;v<j.drawables.length;v++){if(j.drawables[v].config.get_value("name")===r){j.set_overview(j.drawables[v]);break}}if(o){var w;for(var v=0;v<o.length;v++){w=o[v];k.add_bookmark(w.position,w.annotation,l)}}j.has_changes=false});this.set_up_router({view:j});return j},set_up_router:function(h){new d.TrackBrowserRouter(h);Backbone.history.start()},init_keyboard_nav:function(h){$(document).keyup(function(j){if($(j.srcElement).is(":input")){return}switch(j.which){case 37:h.move_fraction(0.25);break;case 38:var k=Math.round(h.viewport_container.height()/15);h.viewport_container.scrollTop(h.viewport_container.scrollTop()-20);break;case 39:h.move_fraction(-0.25);break;case 40:var k=Math.round(h.viewport_container.height()/15);h.viewport_container.scrollTop(h.viewport_container.scrollTop()+20);break}})},handle_unsaved_changes:function(h){if(h.has_changes){var j=this;Galaxy.modal.show({title:"Close visualization",body:"There are unsaved changes to your visualization which will be lost if you do not save them.",buttons:{Cancel:function(){Galaxy.modal.hide()},"Leave without Saving":function(){$(window).off("beforeunload");window.location=galaxy_config.root+"visualization"},Save:function(){$.when(j.save_viz()).then(function(){window.location=galaxy_config.root+"visualization"})}}})}else{window.location=galaxy_config.root+"visualization"}}});var g=f.Backbone.View.extend({initialize:function(){ui=new e(galaxy_config.root);ui.createButtonMenu();ui.buttonMenu.$el.attr("style","float: right");$("#center .unified-panel-header-inner").append(ui.buttonMenu.$el);$("#right .unified-panel-title").append("Bookmarks");$("#right .unified-panel-icons").append("<a id='add-bookmark-button' class='icon-button menu-button plus-button' href='javascript:void(0);' title='Add bookmark'></a>");$("#right-border").click(function(){view.resize_window()});force_right_panel("hide");if(galaxy_config.app.id){this.view_existing()}else{this.view_new()}},view_existing:function(){var h=galaxy_config.app.viz_config;view=ui.create_visualization({container:$("#center .unified-panel-body"),name:h.title,vis_id:h.vis_id,dbkey:h.dbkey},h.viewport,h.tracks,h.bookmarks,true);this.init_editor()},view_new:function(){var h=this;$.ajax({url:galaxy_config.root+"api/genomes?chrom_info=True",data:{},error:function(){alert("Couldn't create new browser.")},success:function(j){Galaxy.modal.show({title:"New Visualization",body:h.template_view_new(j),buttons:{Cancel:function(){window.location=galaxy_config.root+"visualization/list"},Create:function(){h.create_browser($("#new-title").val(),$("#new-dbkey").val());Galaxy.modal.hide()}}});if(galaxy_config.app.default_dbkey){$("#new-dbkey").val(galaxy_config.app.default_dbkey)}$("#new-title").focus();$("select[name='dbkey']").select2();$("#overlay").css("overflow","auto")}})},template_view_new:function(h){var k='<form id="new-browser-form" action="javascript:void(0);" method="post" onsubmit="return false;"><div class="form-row"><label for="new-title">Browser name:</label><div class="form-row-input"><input type="text" name="title" id="new-title" value="Unnamed"></input></div><div style="clear: both;"></div></div><div class="form-row"><label for="new-dbkey">Reference genome build (dbkey): </label><div class="form-row-input"><select name="dbkey" id="new-dbkey">';for(var j=0;j<h.length;j++){k+='<option value="'+h[j][1]+'">'+h[j][0]+"</option>"}k+='</select></div><div style="clear: both;"></div></div><div class="form-row">Is the build not listed here? <a href="'+galaxy_config.root+'user/dbkeys?use_panels=True">Add a Custom Build</a></div></form>';return k},create_browser:function(j,h){$(document).trigger("convert_to_values");view=ui.create_visualization({container:$("#center .unified-panel-body"),name:j,dbkey:h},galaxy_config.app.gene_region);this.init_editor();view.editor=true},init_editor:function(){$("#center .unified-panel-title").text(view.config.get_value("name")+" ("+view.dbkey+")");if(galaxy_config.app.add_dataset){$.ajax({url:galaxy_config.root+"api/datasets/"+galaxy_config.app.add_dataset,data:{hda_ldda:"hda",data_type:"track_config"},dataType:"json",success:function(h){view.add_drawable(a.object_from_template(h,view,view))}})}$("#add-bookmark-button").click(function(){var j=view.chrom+":"+view.low+"-"+view.high,h="Bookmark description";return ui.add_bookmark(j,h,true)});ui.init_keyboard_nav(view);$(window).on("beforeunload",function(){if(view.has_changes){return"There are unsaved changes to your visualization that will be lost if you leave this page."}})}});return{TracksterUI:e,GalaxyApp:g}}); \ No newline at end of file diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 static/scripts/viz/trackster.js --- a/static/scripts/viz/trackster.js +++ b/static/scripts/viz/trackster.js @@ -12,7 +12,6 @@ [ // load js libraries 'utils/utils', - 'mvc/ui/icon-button', 'libs/jquery/jquery.event.drag', 'libs/jquery/jquery.event.hover', 'libs/jquery/jquery.mousewheel', @@ -32,9 +31,8 @@ }); // trackster viewer -define( ["libs/underscore", "base", "viz/trackster/tracks", "viz/visualization"], - function(_, base, tracks, visualization) { - +define( ["libs/underscore", "base", "viz/trackster/tracks", "viz/visualization", "mvc/ui/icon-button" ], + function(_, base, tracks, visualization, mod_icon_btn) { /** * User interface controls for trackster */ diff -r 50e31bdc72cf9cfdf619342926ac894d1314a469 -r 336f89e2f013b0c547b9955f2d9036f91b2217d8 templates/tagging_common.mako --- a/templates/tagging_common.mako +++ b/templates/tagging_common.mako @@ -89,7 +89,7 @@ <%def name="render_tool_tagging_elements()"><% elt_id = int ( floor ( random()*maxint ) ) - tags = trans.app.tag_handler.get_tool_tags( trans ) + tags = trans.app.tag_handler.get_tool_tags() %> ${self.render_tagging_element_html(elt_id=elt_id, \ tags=tags, \ @@ -105,7 +105,7 @@ ## Build HTML. <% elt_id = int ( floor ( random()*maxint ) ) - community_tags = trans.app.tag_handler.get_community_tags( trans, item=tagged_item, limit=5 ) + community_tags = trans.app.tag_handler.get_community_tags( item=tagged_item, limit=5 ) %> ${self.render_tagging_element_html(elt_id=elt_id, \ tags=community_tags, \ 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.
participants (1)
-
commits-noreply@bitbucket.org