commit/galaxy-central: guerler: Update: Scratchbook
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8ea772733c97/ Changeset: 8ea772733c97 User: guerler Date: 2013-06-24 19:47:06 Summary: Update: Scratchbook Affected #: 3 files diff -r a27c1c3a628bc0167981865b82442fc790bd8406 -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba static/scripts/galaxy.frame.js --- a/static/scripts/galaxy.frame.js +++ b/static/scripts/galaxy.frame.js @@ -735,7 +735,6 @@ // untoggle $(".galaxy-frame-active .icon").removeClass("f-toggle"); - } else { // activate this.active = true; @@ -1034,7 +1033,7 @@ '<div class="number f-corner">0</div>' + '<div class="icon fa-icon-2x"></div>' + '</div>'+ - '<div title="Enable/Disable Scratchbook Viewer" class="galaxy-frame-active f-corner">' + + '<div class="galaxy-frame-active f-corner">' + '<div class="icon fa-icon-2x fa-icon-th"></div>' + '</div>'; }, diff -r a27c1c3a628bc0167981865b82442fc790bd8406 -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba static/scripts/mvc/dataset/hda-edit.js --- a/static/scripts/mvc/dataset/hda-edit.js +++ b/static/scripts/mvc/dataset/hda-edit.js @@ -239,8 +239,25 @@ * @returns {jQuery} rendered DOM */ _render_visualizationsButton : function(){ + var visualizations = this.model.get( 'visualizations' ); + if( ( !this.model.hasData() ) + || ( _.isEmpty( visualizations ) ) ){ + this.visualizationsButton = null; + return null; + } + + //TODO: this is a bridge to allow the framework to be switched off + // remove this fn and use the other when fully integrated + if( _.isObject( visualizations[0] ) ){ + return this._render_visualizationsFrameworkButton( visualizations ); + } + + if( !this.urls.visualization ){ + this.visualizationsButton = null; + return null; + } + var dbkey = this.model.get( 'dbkey' ), - visualizations = this.model.get( 'visualizations' ), visualization_url = this.urls.visualization, popup_menu_dict = {}, params = { @@ -250,17 +267,10 @@ // Add dbkey to params if it exists. if( dbkey ){ params.dbkey = dbkey; } - if( !( this.model.hasData() ) - || !( visualizations && visualizations.length ) - || !( visualization_url ) ){ - this.visualizationsButton = null; - return null; - } - // render the icon from template this.visualizationsButton = new IconButtonView({ model : new IconButton({ title : _l( 'Visualize' ), - href : visualization_url, + href : this.urls.visualization, icon_class : 'chart_curve' })}); var $icon = this.visualizationsButton.render().$el; @@ -278,15 +288,14 @@ case 'scatterplot': return create_scatterplot_action_fn( visualization_url, params ); default: - return function(){ - // add widget + return function(){// add widget parent.frame_manager.frame_new( { title : "Visualization", type : "url", content : visualization_url + '/' + visualization + '?' + $.param( params ) }); - }; + }; } } @@ -306,6 +315,40 @@ } return $icon; }, + + /** Render an icon-button or popupmenu of links based on the applicable visualizations + * @returns {jQuery} rendered DOM + */ + _render_visualizationsFrameworkButton : function( visualizations ){ + if( !( this.model.hasData() ) + || !( visualizations && !_.isEmpty( visualizations ) ) ){ + this.visualizationsButton = null; + return null; + } + + // render the icon from template + this.visualizationsButton = new IconButtonView({ model : new IconButton({ + title : _l( 'Visualize' ), + icon_class : 'chart_curve' + })}); + var $icon = this.visualizationsButton.render().$el; + $icon.addClass( 'visualize-icon' ); // needed? + + // No need for popup menu because there's a single visualization. + if( _.keys( visualizations ).length === 1 ) { + $icon.attr( 'title', _.keys( visualizations )[0] ); + $icon.attr( 'href', _.values( visualizations )[0] ); + + // >1: Populate menu dict with visualization fns, make the popupmenu + } else { + var popup_menu_options = []; + _.each( visualizations, function( linkData ) { + popup_menu_options.push( linkData ); + }); + var popup = new PopupMenu( $icon, popup_menu_options ); + } + return $icon; + }, // ......................................................................... secondary actions /** Render secondary actions: currently tagging and annotation (if user is allowed). @@ -567,7 +610,6 @@ //TODO: should be imported from scatterplot.js OR abstracted to 'load this in the galaxy_main frame' function create_scatterplot_action_fn( url, params ){ action = function() { - // add widget parent.frame_manager.frame_new( { @@ -657,4 +699,4 @@ //============================================================================== //return { // HDAView : HDAView, -//};}); +//};}); \ No newline at end of file diff -r a27c1c3a628bc0167981865b82442fc790bd8406 -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba templates/webapps/galaxy/base_panels.mako --- a/templates/webapps/galaxy/base_panels.mako +++ b/templates/webapps/galaxy/base_panels.mako @@ -150,7 +150,7 @@ [_('New Track Browser'), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/trackster'});"], [_('Saved Visualizations'), "javascript:frame_manager.frame_new({ type: 'url', content : '/visualization/list'});" ] ] - tab( "visualization", _("Visualization"), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/trackster'});", menu_options=menu_options ) + tab( "visualization", _("Visualization"), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/list'});", menu_options=menu_options ) %> ## Cloud menu. 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