commit/galaxy-central: carlfeberhard: History panel: reduce size of select checkboxes, decrease animation
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/261d9bab3d12/ Changeset: 261d9bab3d12 User: carlfeberhard Date: 2014-03-20 18:38:10 Summary: History panel: reduce size of select checkboxes, decrease animation Affected #: 6 files diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/mvc/dataset/hda-base.js --- a/static/scripts/mvc/dataset/hda-base.js +++ b/static/scripts/mvc/dataset/hda-base.js @@ -495,70 +495,34 @@ /** display a (fa-icon) checkbox on the left of the hda that fires events when checked * Note: this also hides the primary actions */ - showSelector : function( speed ){ - speed = ( speed !== undefined )?( speed ):( this.fxSpeed ); - + showSelector : function(){ // make sure selected state is represented properly if( this.selected ){ this.select( null, true ); } - // create a jq fx queue to do this sequentially: fadeout the buttons, embiggen the selector - var hdaView = this, - SELECTOR_WIDTH = 32; + this.selectable = true; + this.trigger( 'selectable', true, this ); - if( speed ){ - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-primary-actions' ).fadeOut( speed, next ); - }); - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-selector' ).show().animate({ width: SELECTOR_WIDTH }, speed, next ); - $( this ).find( '.dataset-title-bar' ).animate({ 'margin-left': SELECTOR_WIDTH }, speed, next ); - hdaView.selectable = true; - hdaView.trigger( 'selectable', true, hdaView ); - }); - // no animation - } else { - this.$el.find( '.dataset-primary-actions' ).hide(); - this.$el.find( '.dataset-selector' ).show().css({ width : SELECTOR_WIDTH }); - this.$el.find( '.dataset-title-bar' ).show().css({ 'margin-left' : SELECTOR_WIDTH }); - hdaView.selectable = true; - hdaView.trigger( 'selectable', true, hdaView ); - } + this.$( '.dataset-primary-actions' ).hide(); + this.$( '.dataset-selector' ).show(); }, /** remove the selection checkbox */ - hideSelector : function( speed ){ - speed = ( speed !== undefined )?( speed ):( this.fxSpeed ); - + hideSelector : function(){ // reverse the process from showSelect this.selectable = false; this.trigger( 'selectable', false, this ); - if( speed ){ - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-title-bar' ).show().css({ 'margin-left' : '0' }); - $( this ).find( '.dataset-selector' ).animate({ width: '0px' }, speed, function(){ - $( this ).hide(); - next(); - }); - }); - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-primary-actions' ).fadeIn( speed, next ); - }); - - // no animation - } else { - $( this ).find( '.dataset-selector' ).css({ width : '0px' }).hide(); - $( this ).find( '.dataset-primary-actions' ).show(); - } + this.$( '.dataset-selector' ).hide(); + this.$( '.dataset-primary-actions' ).show(); }, - toggleSelector : function( speed ){ + toggleSelector : function(){ if( !this.$el.find( '.dataset-selector' ).is( ':visible' ) ){ - this.showSelector( speed ); + this.showSelector(); } else { - this.hideSelector( speed ); + this.hideSelector(); } }, @@ -694,7 +658,9 @@ '</div>', // multi-select checkbox - '<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>', + '<div class="dataset-selector">', + '<span class="fa fa-2x fa-square-o"></span>', + '</div>', // space for title bar buttons '<div class="dataset-primary-actions"></div>', diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/mvc/history/history-panel.js --- a/static/scripts/mvc/history/history-panel.js +++ b/static/scripts/mvc/history/history-panel.js @@ -336,7 +336,7 @@ // ------------------------------------------------------------------------ panel events /** event map */ events : _.extend( _.clone( readonlyPanel.ReadOnlyHistoryPanel.prototype.events ), { - 'click .history-select-btn' : function( e ){ this.toggleSelectors( this.fxSpeed ); }, + 'click .history-select-btn' : 'toggleSelectors', 'click .history-select-all-datasets-btn' : 'selectAllDatasets', 'click .history-deselect-all-datasets-btn' : 'deselectAllDatasets' }), @@ -351,30 +351,32 @@ //TODO: to toggle showOrHide pattern /** show selectors on all visible hdas and associated controls */ showSelectors : function( speed ){ + speed = ( speed !== undefined )?( speed ):( this.fxSpeed ); this.selecting = true; - this.$el.find( '.history-dataset-actions' ).slideDown( speed ); + this.$( '.history-dataset-actions' ).slideDown( speed ); _.each( this.hdaViews, function( view ){ - view.showSelector( speed ); + view.showSelector(); }); this.selectedHdaIds = []; }, /** hide selectors on all visible hdas and associated controls */ hideSelectors : function( speed ){ + speed = ( speed !== undefined )?( speed ):( this.fxSpeed ); this.selecting = false; - this.$el.find( '.history-dataset-actions' ).slideUp( speed ); + this.$( '.history-dataset-actions' ).slideUp( speed ); _.each( this.hdaViews, function( view ){ - view.hideSelector( speed ); + view.hideSelector(); }); this.selectedHdaIds = []; }, /** show or hide selectors on all visible hdas and associated controls */ - toggleSelectors : function( speed ){ + toggleSelectors : function(){ if( !this.selecting ){ - this.showSelectors( speed ); + this.showSelectors(); } else { - this.hideSelectors( speed ); + this.hideSelectors(); } }, diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/packed/mvc/dataset/hda-base.js --- a/static/scripts/packed/mvc/dataset/hda-base.js +++ b/static/scripts/packed/mvc/dataset/hda-base.js @@ -1,1 +1,1 @@ -define(["mvc/dataset/hda-model"],function(c){var b=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(e){if(e.logger){this.logger=this.model.logger=e.logger}this.log(this+".initialize:",e);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=e.linkTarget||"_blank";this.selectable=e.selectable||false;this.selected=e.selected||false;this.expanded=e.expanded||false;this.draggable=e.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(f,e){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(g){g=(g===undefined)?(true):(g);var e=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var f=this._buildNewRender();if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).addClass("state-"+e.model.get("state")).append(f.children());if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()});return this},_buildNewRender:function(){var e=$(b.templates.skeleton(this.model.toJSON()));e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(e);return e},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===c.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var f={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){f.disabled=true;f.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===c.HistoryDatasetAssociation.STATES.UPLOAD){f.disabled=true;f.title=_l("This dataset must finish uploading before it can be viewed")}else{f.title=_l("View data");f.href=this.urls.display;var e=this;f.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+e.model.get("name"),type:"url",content:e.urls.display})}}}}f.faIcon="fa-eye";return faIconButton(f)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var f=this.urls,g=this.model.get("meta_files");if(_.isEmpty(g)){return $(['<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var h="dataset-"+this.model.get("id")+"-popup",e=['<div popupmenu="'+h+'">','<a href="'+f.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(g,function(i){return['<a class="action-button" href="',f.meta_download+i.file_type,'">',_l("Download")," ",i.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+h+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(e)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var f=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),e=this["_render_body_"+this.model.get("state")];if(_.isFunction(e)){f=e.call(this)}this._setUpBehaviors(f);if(this.expanded){f.show()}return f},_render_stateBodyHelper:function(e,h){h=h||[];var f=this,g=$(b.templates.body(_.extend(this.model.toJSON(),{body:e})));g.find(".dataset-actions .left").append(_.map(h,function(i){return i.call(f)}));return g},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var e=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){e="<div>"+this.model.get("misc_blurb")+"</div>"+e}return this._render_stateBodyHelper(e,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var e=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),f=this._render_body_ok();f.prepend(e);return f},_render_body_ok:function(){var e=this,g=$(b.templates.body(this.model.toJSON())),f=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);g.find(".dataset-actions .left").append(_.map(f,function(h){return h.call(e)}));if(this.model.isDeletedOrPurged()){return g}return g},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(h,f){var e=32,g=13;if(h&&(h.type==="keydown")&&!(h.keyCode===e||h.keyCode===g)){return true}var i=this.$el.find(".dataset-body");f=(f===undefined)?(!i.is(":visible")):(f);if(f){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._render_body());e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.expanded=true;e.trigger("body-expanded",e.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(g){e.urls=e.model.urls();f()})}else{f()}},collapseBody:function(){var e=this;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.expanded=false;e.trigger("body-collapsed",e.model.get("id"))})},showSelector:function(g){g=(g!==undefined)?(g):(this.fxSpeed);if(this.selected){this.select(null,true)}var f=this,e=32;if(g){this.$el.queue("fx",function(h){$(this).find(".dataset-primary-actions").fadeOut(g,h)});this.$el.queue("fx",function(h){$(this).find(".dataset-selector").show().animate({width:e},g,h);$(this).find(".dataset-title-bar").animate({"margin-left":e},g,h);f.selectable=true;f.trigger("selectable",true,f)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:e});this.$el.find(".dataset-title-bar").show().css({"margin-left":e});f.selectable=true;f.trigger("selectable",true,f)}},hideSelector:function(e){e=(e!==undefined)?(e):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},e,function(){$(this).hide();f()})});this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeIn(e,f)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(e){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(e)}else{this.hideSelector(e)}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},remove:function(f){var e=this;this.$el.fadeOut(e.fxSpeed,function(){e.$el.remove();e.off();if(f){f()}})},toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+e+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var d=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");b.templates={skeleton:function(e){return _.template(a,e,{variable:"hda"})},body:function(e){return _.template(d,e,{variable:"hda"})}};return{HDABaseView:b}}); \ No newline at end of file +define(["mvc/dataset/hda-model"],function(c){var b=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(e){if(e.logger){this.logger=this.model.logger=e.logger}this.log(this+".initialize:",e);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=e.linkTarget||"_blank";this.selectable=e.selectable||false;this.selected=e.selected||false;this.expanded=e.expanded||false;this.draggable=e.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(f,e){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(g){g=(g===undefined)?(true):(g);var e=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var f=this._buildNewRender();if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).addClass("state-"+e.model.get("state")).append(f.children());if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()});return this},_buildNewRender:function(){var e=$(b.templates.skeleton(this.model.toJSON()));e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(e);return e},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===c.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var f={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){f.disabled=true;f.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===c.HistoryDatasetAssociation.STATES.UPLOAD){f.disabled=true;f.title=_l("This dataset must finish uploading before it can be viewed")}else{f.title=_l("View data");f.href=this.urls.display;var e=this;f.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+e.model.get("name"),type:"url",content:e.urls.display})}}}}f.faIcon="fa-eye";return faIconButton(f)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var f=this.urls,g=this.model.get("meta_files");if(_.isEmpty(g)){return $(['<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var h="dataset-"+this.model.get("id")+"-popup",e=['<div popupmenu="'+h+'">','<a href="'+f.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(g,function(i){return['<a class="action-button" href="',f.meta_download+i.file_type,'">',_l("Download")," ",i.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+h+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(e)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var f=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),e=this["_render_body_"+this.model.get("state")];if(_.isFunction(e)){f=e.call(this)}this._setUpBehaviors(f);if(this.expanded){f.show()}return f},_render_stateBodyHelper:function(e,h){h=h||[];var f=this,g=$(b.templates.body(_.extend(this.model.toJSON(),{body:e})));g.find(".dataset-actions .left").append(_.map(h,function(i){return i.call(f)}));return g},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var e=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){e="<div>"+this.model.get("misc_blurb")+"</div>"+e}return this._render_stateBodyHelper(e,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var e=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),f=this._render_body_ok();f.prepend(e);return f},_render_body_ok:function(){var e=this,g=$(b.templates.body(this.model.toJSON())),f=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);g.find(".dataset-actions .left").append(_.map(f,function(h){return h.call(e)}));if(this.model.isDeletedOrPurged()){return g}return g},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(h,f){var e=32,g=13;if(h&&(h.type==="keydown")&&!(h.keyCode===e||h.keyCode===g)){return true}var i=this.$el.find(".dataset-body");f=(f===undefined)?(!i.is(":visible")):(f);if(f){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._render_body());e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.expanded=true;e.trigger("body-expanded",e.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(g){e.urls=e.model.urls();f()})}else{f()}},collapseBody:function(){var e=this;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.expanded=false;e.trigger("body-collapsed",e.model.get("id"))})},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},remove:function(f){var e=this;this.$el.fadeOut(e.fxSpeed,function(){e.$el.remove();e.off();if(f){f()}})},toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+e+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var d=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");b.templates={skeleton:function(e){return _.template(a,e,{variable:"hda"})},body:function(e){return _.template(d,e,{variable:"hda"})}};return{HDABaseView:b}}); \ No newline at end of file diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/packed/mvc/history/history-panel.js --- a/static/scripts/packed/mvc/history/history-panel.js +++ b/static/scripts/packed/mvc/history/history-panel.js @@ -1,1 +1,1 @@ -define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations"],function(e,b,d,a,c){var f=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(g){g=g||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=g.selecting||false;this.annotationEditorShown=g.annotationEditorShown||false;this.tagsEditorShown=g.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,g)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this)},renderModel:function(){var g=$("<div/>");g.append(f.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(g).text(this.emptyMsg);if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(g);this._renderAnnotation(g)}g.find(".history-secondary-actions").prepend(this._renderSelectButton());g.find(".history-dataset-actions").toggle(this.selecting);g.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){var h=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDATagEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDATagEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){var h=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDAAnnotationEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDAAnnotationEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_renderSelectButton:function(g){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(g){g=g||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,g);if(!this.model){return}this._setUpDatasetActionsPopup(g);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var h=this;g.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(i){var j=h.model.get("name");if(i&&i!==j){h.$el.find(".history-name").text(i);h.model.save({name:i}).fail(function(){h.$el.find(".history-name").text(h.model.previous("name"))})}else{h.$el.find(".history-name").text(j)}}})},_setUpDatasetActionsPopup:function(g){var h=this;(new PopupMenu(g.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.hide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Unhide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.unhide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Delete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype["delete"];h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Undelete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.undelete;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var i=e.HistoryDatasetAssociation.prototype.purge;h.getSelectedHdaCollection().ajaxQueue(i)}}}]))},_handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},_handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},_createHdaView:function(h){var g=h.get("id"),i=new this.HDAViewClass({model:h,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[g],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(i);return i},_setUpHdaListeners:function(h){var g=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,h);h.on("selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.union(g.selectedHdaIds,[j])});h.on("de-selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.without(g.selectedHdaIds,j)})},toggleHDATagEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.annotationEditor){i.annotationEditor.toggle.apply(i.annotationEditor,h)}})},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$emptyMessage().fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":function(g){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(g){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(g);_.each(this.hdaViews,function(h){h.showSelector(g)});this.selectedHdaIds=[]},hideSelectors:function(g){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(g);_.each(this.hdaViews,function(h){h.hideSelector(g)});this.selectedHdaIds=[]},toggleSelectors:function(g){if(!this.selecting){this.showSelectors(g)}else{this.hideSelectors(g)}},selectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.select(g)})},deselectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.deselect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},getSelectedHdaCollection:function(){return new e.HDACollection(_.map(this.getSelectedHdaViews(),function(g){return g.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:f}}); \ No newline at end of file +define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations"],function(e,b,d,a,c){var f=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(g){g=g||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=g.selecting||false;this.annotationEditorShown=g.annotationEditorShown||false;this.tagsEditorShown=g.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,g)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this)},renderModel:function(){var g=$("<div/>");g.append(f.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(g).text(this.emptyMsg);if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(g);this._renderAnnotation(g)}g.find(".history-secondary-actions").prepend(this._renderSelectButton());g.find(".history-dataset-actions").toggle(this.selecting);g.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){var h=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDATagEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDATagEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){var h=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDAAnnotationEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDAAnnotationEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_renderSelectButton:function(g){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(g){g=g||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,g);if(!this.model){return}this._setUpDatasetActionsPopup(g);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var h=this;g.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(i){var j=h.model.get("name");if(i&&i!==j){h.$el.find(".history-name").text(i);h.model.save({name:i}).fail(function(){h.$el.find(".history-name").text(h.model.previous("name"))})}else{h.$el.find(".history-name").text(j)}}})},_setUpDatasetActionsPopup:function(g){var h=this;(new PopupMenu(g.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.hide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Unhide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.unhide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Delete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype["delete"];h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Undelete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.undelete;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var i=e.HistoryDatasetAssociation.prototype.purge;h.getSelectedHdaCollection().ajaxQueue(i)}}}]))},_handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},_handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},_createHdaView:function(h){var g=h.get("id"),i=new this.HDAViewClass({model:h,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[g],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(i);return i},_setUpHdaListeners:function(h){var g=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,h);h.on("selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.union(g.selectedHdaIds,[j])});h.on("de-selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.without(g.selectedHdaIds,j)})},toggleHDATagEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.annotationEditor){i.annotationEditor.toggle.apply(i.annotationEditor,h)}})},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$emptyMessage().fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":"toggleSelectors","click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(g);_.each(this.hdaViews,function(h){h.showSelector()});this.selectedHdaIds=[]},hideSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(g);_.each(this.hdaViews,function(h){h.hideSelector()});this.selectedHdaIds=[]},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.select(g)})},deselectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.deselect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},getSelectedHdaCollection:function(){return new e.HDACollection(_.map(this.getSelectedHdaViews(),function(g){return g.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:f}}); \ No newline at end of file diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1617,7 +1617,8 @@ .history-panel .dataset .dataset-padding{padding:6px 10px 6px 8px} .history-panel .dataset [class$=messagesmall]{margin:6px 10px 2px 8px;font-size:90%} .history-panel .dataset .help-text{font-weight:normal;color:#555} -.history-panel .dataset .dataset-selector{float:left;display:none;width:0px;margin:0 0 -6px 0;padding:5px 0 2px 8px;cursor:pointer;vertical-align:middle} +.history-panel .dataset .dataset-selector{float:left;display:none;width:32px;height:32px;margin:0 0 -6px 0;padding:8px 0 2px 7px;font-size:80%;color:#333;cursor:pointer;vertical-align:middle} +.history-panel .dataset .dataset-selector:hover{color:maroon} .history-panel .dataset .dataset-title-bar{cursor:pointer;outline:none;padding:6px 10px 6px 8px} .history-panel .dataset .dataset-title-bar .dataset-title{display:inline;font-weight:bold;text-decoration:underline;word-wrap:break-word;word-break:break-all;line-height:16px} .history-panel .dataset .dataset-primary-actions{display:inline-block;float:right;margin:6px 10px 0}.history-panel .dataset .dataset-primary-actions .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none} @@ -1654,7 +1655,7 @@ .history-panel .dataset .dataset-body .dataset-display-applications .display-application:last-child{margin-bottom:8px} .history-panel .dataset .dataset-body .dataset-peek{margin-bottom:8px}.history-panel .dataset .dataset-body .dataset-peek pre.peek{width:100%;margin:0px;border-radius:3px;background:white;color:black;font-size:10px;overflow:auto}.history-panel .dataset .dataset-body .dataset-peek pre.peek th{color:white;background:#5f6990} .history-panel .dataset .dataset-body .dataset-peek pre.peek table,.history-panel .dataset .dataset-body .dataset-peek pre.peek th,.history-panel .dataset .dataset-body .dataset-peek pre.peek tr,.history-panel .dataset .dataset-body .dataset-peek pre.peek td{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:10px} -.history-panel .dataset .state-icon{font-family:FontAwesome;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;vertical-align:middle;width:16px;height:16px;line-height:16px;text-align:center;font-size:16px} +.history-panel .dataset .state-icon{font-family:FontAwesome;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:4px;vertical-align:middle;width:16px;height:16px;line-height:16px;text-align:center;font-size:16px} .state-icon-error{background-color:white;border-radius:8px}.state-icon-error:before{font-size:20px;line-height:16px;color:red;content:"\f057"} .history-panel [class$="messagesmall"]{margin:0px} .history-panel .editable-text{border:solid transparent 1px} diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/style/src/less/history.less --- a/static/style/src/less/history.less +++ b/static/style/src/less/history.less @@ -165,14 +165,19 @@ float: left; // always initially hidden and zero width display: none; - width: 0px; + width: 32px; + height: 32px; //HACK: neg. on the bottom due to padding-bottom in title-bar - very tweakish - margin: 0px 0px -@spacing-bottom 0px; - padding: ( @spacing-top - 1 ) 0px 2px @spacing-left; + margin: 0px 0px -( @spacing-bottom ) 0px; + padding: ( @spacing-top + 2 ) 0px 2px ( @spacing-left - 1 ); + font-size: 80%; + color: @btn-default-color; cursor: pointer; - //text-align: center; vertical-align: middle; } + .dataset-selector:hover { + color: maroon; + } .dataset-title-bar { cursor: pointer; @@ -360,6 +365,7 @@ .dataset .state-icon { .fa-icon; display: inline-block; + margin-right: 4px; vertical-align: middle; width: 16px; height: 16px; 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