commit/galaxy-central: carlfeberhard: Fix to 3268c8606464: properly namespace display applications in template
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f714a3410ec5/ Changeset: f714a3410ec5 User: carlfeberhard Date: 2014-03-20 15:13:38 Summary: Fix to 3268c8606464: properly namespace display applications in template Affected #: 2 files diff -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 -r f714a3410ec5a22fa571156c376ae2e97baafd50 static/scripts/mvc/dataset/hda-base.js --- a/static/scripts/mvc/dataset/hda-base.js +++ b/static/scripts/mvc/dataset/hda-base.js @@ -768,12 +768,12 @@ //TODO: the following two should be compacted '<% _.each( hda.display_apps, function( app ){ %>', '<div class="display-application">', - '<span class="display-application-location"><%- app.label %></span>', + '<span class="display-application-location"><%- app.label %></span> ', '<span class="display-application-links">', '<% _.each( app.links, function( link ){ %>', - '<a target="<%= target %>" href="<%= href %>">', + '<a target="<%= link.target %>" href="<%= link.href %>">', '<% print( _l( link.text ) ); %>', - '</a>', + '</a> ', '<% }); %>', '</span>', '</div>', @@ -781,12 +781,12 @@ '<% _.each( hda.display_types, function( app ){ %>', '<div class="display-application">', - '<span class="display-application-location"><%- label %></span>', + '<span class="display-application-location"><%- app.label %></span> ', '<span class="display-application-links">', '<% _.each( app.links, function( link ){ %>', - '<a target="<%= target %>" href="<%= href %>">', + '<a target="<%= link.target %>" href="<%= link.href %>">', '<% print( _l( link.text ) ); %>', - '</a>', + '</a> ', '<% }); %>', '</span>', '</div>', diff -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 -r f714a3410ec5a22fa571156c376ae2e97baafd50 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="<%= target %>" href="<%= href %>">',"<% print( _l( link.text ) ); %>","</a>","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- label %></span>','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= target %>" href="<%= 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(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 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