galaxy-commits
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
May 2014
- 1 participants
- 242 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/aad9eb1a8486/
Changeset: aad9eb1a8486
User: carlfeberhard
Date: 2014-05-05 19:34:07
Summary: Fixes: correct docs in histories/set_as_current to PUT; use correct empty msg when removing the last hda view in a history; remove dependency on utils.js from ui-modal.js
Affected #: 6 files
diff -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 -r aad9eb1a8486211c2204452d466e5b811496f6e7 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -121,7 +121,7 @@
def set_as_current( self, trans, id, **kwd ):
"""
set_as_current( trans, id, **kwd )
- * POST /api/histories/{id}/set_as_current:
+ * PUT /api/histories/{id}/set_as_current:
set the history with ``id`` to the user's current history and return details
:type id: an encoded id string
diff -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 -r aad9eb1a8486211c2204452d466e5b811496f6e7 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -165,7 +165,6 @@
parent_resources=dict( member_name='page', collection_name='pages' ) )
# add as a non-ATOM API call to support the notion of a 'current/working' history unique to the history resource
- #webapp.mapper.connect( "set_as_current", "/api/histories/set_as_current/{id}",
webapp.mapper.connect( "set_as_current", "/api/histories/{id}/set_as_current",
controller="histories", action="set_as_current", conditions=dict( method=["PUT"] ) )
diff -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 -r aad9eb1a8486211c2204452d466e5b811496f6e7 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -330,9 +330,8 @@
hdaView.remove();
delete panel.hdaViews[ hdaView.model.id ];
if( _.isEmpty( panel.hdaViews ) ){
- panel.$emptyMessage().fadeIn( panel.fxSpeed, function(){
- panel.trigger( 'empty-history', panel );
- });
+ panel.trigger( 'empty-history', panel );
+ panel._renderEmptyMsg();
}
});
},
diff -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 -r aad9eb1a8486211c2204452d466e5b811496f6e7 static/scripts/mvc/ui/ui-modal.js
--- a/static/scripts/mvc/ui/ui-modal.js
+++ b/static/scripts/mvc/ui/ui-modal.js
@@ -1,5 +1,4 @@
-// dependencies
-define(['utils/utils'], function(Utils) {
+define([], function() {
var View = Backbone.View.extend({
@@ -28,6 +27,7 @@
// adds and displays a new frame/window
show: function(options) {
+ console.debug( this );
// create
this.initialize(options);
diff -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 -r aad9eb1a8486211c2204452d466e5b811496f6e7 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","utils/localization"],function(f,b,d,a,c,e){var g=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(h){h=h||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=h.purgeAllowed||false;this.selecting=h.selecting||false;this.annotationEditorShown=h.annotationEditorShown||false;this.tagsEditorShown=h.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,h)},_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(h){this.model.fetch()},this)},renderModel:function(){var h=$("<div/>");h.append(g.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(h).text(this.emptyMsg);if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(h);this._renderAnnotation(h)}h.find(".history-secondary-actions").prepend(this._renderSelectButton());h.find(".history-dataset-actions").toggle(this.selecting);h.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(h);this.renderHdas(h);return h},_renderTags:function(h){var i=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:h.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.toggleHDATagEditors(true,i.fxSpeed)},onhide:function(){i.toggleHDATagEditors(false,i.fxSpeed)},$activator:faIconButton({title:e("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".history-secondary-actions"))})},_renderAnnotation:function(h){var i=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:h.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.toggleHDAAnnotationEditors(true,i.fxSpeed)},onhide:function(){i.toggleHDAAnnotationEditors(false,i.fxSpeed)},$activator:faIconButton({title:e("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".history-secondary-actions"))})},_renderSelectButton:function(h){return faIconButton({title:e("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(h){h=h||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,h);if(!this.model){return}this._setUpDatasetActionsPopup(h);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var i=this;h.find(".history-name").attr("title",e("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(j){var k=i.model.get("name");if(j&&j!==k){i.$el.find(".history-name").text(j);i.model.save({name:j}).fail(function(){i.$el.find(".history-name").text(i.model.previous("name"))})}else{i.$el.find(".history-name").text(k)}}})},_setUpDatasetActionsPopup:function(h){var i=this,j=[{html:e("Hide datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype.hide;i.getSelectedHdaCollection().ajaxQueue(k)}},{html:e("Unhide datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype.unhide;i.getSelectedHdaCollection().ajaxQueue(k)}},{html:e("Delete datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype["delete"];i.getSelectedHdaCollection().ajaxQueue(k)}},{html:e("Undelete datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype.undelete;i.getSelectedHdaCollection().ajaxQueue(k)}}];if(i.purgeAllowed){j.push({html:e("Permanently delete datasets"),func:function(){if(confirm(e("This will permanently remove the data in your datasets. Are you sure?"))){var k=f.HistoryDatasetAssociation.prototype.purge;i.getSelectedHdaCollection().ajaxQueue(k)}}})}return new PopupMenu(h.find(".history-dataset-action-popup-btn"),j)},_handleHdaDeletionChange:function(h){if(h.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[h.id])}},_handleHdaVisibleChange:function(h){if(h.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[h.id])}},_createHdaView:function(i){var h=i.get("id"),j=new this.HDAViewClass({model:i,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[h],selectable:this.selecting,purgeAllowed:this.purgeAllowed,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(j);return j},_setUpHdaListeners:function(i){var h=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,i);i.on("selected",function(j){var k=j.model.get("id");h.selectedHdaIds=_.union(h.selectedHdaIds,[k])});i.on("de-selected",function(j){var k=j.model.get("id");h.selectedHdaIds=_.without(h.selectedHdaIds,k)})},toggleHDATagEditors:function(h){var i=arguments;_.each(this.hdaViews,function(j){if(j.tagsEditor){j.tagsEditor.toggle.apply(j.tagsEditor,i)}})},toggleHDAAnnotationEditors:function(h){var i=arguments;_.each(this.hdaViews,function(j){if(j.annotationEditor){j.annotationEditor.toggle.apply(j.annotationEditor,i)}})},removeHdaView:function(i){if(!i){return}var h=this;i.$el.fadeOut(h.fxSpeed,function(){i.off();i.remove();delete h.hdaViews[i.model.id];if(_.isEmpty(h.hdaViews)){h.$emptyMessage().fadeIn(h.fxSpeed,function(){h.trigger("empty-history",h)})}})},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(h){h=(h!==undefined)?(h):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(h);_.each(this.hdaViews,function(i){i.showSelector()});this.selectedHdaIds=[]},hideSelectors:function(h){h=(h!==undefined)?(h):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(h);_.each(this.hdaViews,function(i){i.hideSelector()});this.selectedHdaIds=[]},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(h){_.each(this.hdaViews,function(i){i.select(h)})},deselectAllDatasets:function(h){_.each(this.hdaViews,function(i){i.deselect(h)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(h){return h.selected})},getSelectedHdaCollection:function(){return new f.HDACollection(_.map(this.getSelectedHdaViews(),function(h){return h.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:g}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations","utils/localization"],function(f,b,d,a,c,e){var g=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(h){h=h||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=h.purgeAllowed||false;this.selecting=h.selecting||false;this.annotationEditorShown=h.annotationEditorShown||false;this.tagsEditorShown=h.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,h)},_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(h){this.model.fetch()},this)},renderModel:function(){var h=$("<div/>");h.append(g.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(h).text(this.emptyMsg);if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(h);this._renderAnnotation(h)}h.find(".history-secondary-actions").prepend(this._renderSelectButton());h.find(".history-dataset-actions").toggle(this.selecting);h.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(h);this.renderHdas(h);return h},_renderTags:function(h){var i=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:h.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.toggleHDATagEditors(true,i.fxSpeed)},onhide:function(){i.toggleHDATagEditors(false,i.fxSpeed)},$activator:faIconButton({title:e("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".history-secondary-actions"))})},_renderAnnotation:function(h){var i=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:h.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.toggleHDAAnnotationEditors(true,i.fxSpeed)},onhide:function(){i.toggleHDAAnnotationEditors(false,i.fxSpeed)},$activator:faIconButton({title:e("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".history-secondary-actions"))})},_renderSelectButton:function(h){return faIconButton({title:e("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(h){h=h||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,h);if(!this.model){return}this._setUpDatasetActionsPopup(h);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var i=this;h.find(".history-name").attr("title",e("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(j){var k=i.model.get("name");if(j&&j!==k){i.$el.find(".history-name").text(j);i.model.save({name:j}).fail(function(){i.$el.find(".history-name").text(i.model.previous("name"))})}else{i.$el.find(".history-name").text(k)}}})},_setUpDatasetActionsPopup:function(h){var i=this,j=[{html:e("Hide datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype.hide;i.getSelectedHdaCollection().ajaxQueue(k)}},{html:e("Unhide datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype.unhide;i.getSelectedHdaCollection().ajaxQueue(k)}},{html:e("Delete datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype["delete"];i.getSelectedHdaCollection().ajaxQueue(k)}},{html:e("Undelete datasets"),func:function(){var k=f.HistoryDatasetAssociation.prototype.undelete;i.getSelectedHdaCollection().ajaxQueue(k)}}];if(i.purgeAllowed){j.push({html:e("Permanently delete datasets"),func:function(){if(confirm(e("This will permanently remove the data in your datasets. Are you sure?"))){var k=f.HistoryDatasetAssociation.prototype.purge;i.getSelectedHdaCollection().ajaxQueue(k)}}})}return new PopupMenu(h.find(".history-dataset-action-popup-btn"),j)},_handleHdaDeletionChange:function(h){if(h.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[h.id])}},_handleHdaVisibleChange:function(h){if(h.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[h.id])}},_createHdaView:function(i){var h=i.get("id"),j=new this.HDAViewClass({model:i,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[h],selectable:this.selecting,purgeAllowed:this.purgeAllowed,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(j);return j},_setUpHdaListeners:function(i){var h=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,i);i.on("selected",function(j){var k=j.model.get("id");h.selectedHdaIds=_.union(h.selectedHdaIds,[k])});i.on("de-selected",function(j){var k=j.model.get("id");h.selectedHdaIds=_.without(h.selectedHdaIds,k)})},toggleHDATagEditors:function(h){var i=arguments;_.each(this.hdaViews,function(j){if(j.tagsEditor){j.tagsEditor.toggle.apply(j.tagsEditor,i)}})},toggleHDAAnnotationEditors:function(h){var i=arguments;_.each(this.hdaViews,function(j){if(j.annotationEditor){j.annotationEditor.toggle.apply(j.annotationEditor,i)}})},removeHdaView:function(i){if(!i){return}var h=this;i.$el.fadeOut(h.fxSpeed,function(){i.off();i.remove();delete h.hdaViews[i.model.id];if(_.isEmpty(h.hdaViews)){h.trigger("empty-history",h);h._renderEmptyMsg()}})},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(h){h=(h!==undefined)?(h):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(h);_.each(this.hdaViews,function(i){i.showSelector()});this.selectedHdaIds=[]},hideSelectors:function(h){h=(h!==undefined)?(h):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(h);_.each(this.hdaViews,function(i){i.hideSelector()});this.selectedHdaIds=[]},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(h){_.each(this.hdaViews,function(i){i.select(h)})},deselectAllDatasets:function(h){_.each(this.hdaViews,function(i){i.deselect(h)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(h){return h.selected})},getSelectedHdaCollection:function(){return new f.HDACollection(_.map(this.getSelectedHdaViews(),function(h){return h.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:g}});
\ No newline at end of file
diff -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 -r aad9eb1a8486211c2204452d466e5b811496f6e7 static/scripts/packed/mvc/ui/ui-modal.js
--- a/static/scripts/packed/mvc/ui/ui-modal.js
+++ b/static/scripts/packed/mvc/ui/ui-modal.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:true,height:null,width:null,closing_events:false},buttonList:{},initialize:function(c){if(c){this._create(c)}},show:function(c){this.initialize(c);if(this.options.height){this.$body.css("height",this.options.height);this.$body.css("overflow","hidden")}else{this.$body.css("max-height",$(window).height()/2)}if(this.options.width){this.$dialog.css("width",this.options.width)}if(this.visible){this.$el.show()}else{this.$el.fadeIn("fast")}this.visible=true},hide:function(){this.visible=false;this.$el.fadeOut("fast")},enableButton:function(c){var d=this.buttonList[c];this.$buttons.find("#"+d).prop("disabled",false)},disableButton:function(c){var d=this.buttonList[c];this.$buttons.find("#"+d).prop("disabled",true)},showButton:function(c){var d=this.buttonList[c];this.$buttons.find("#"+d).show()},hideButton:function(c){var d=this.buttonList[c];this.$buttons.find("#"+d).hide()},getButton:function(c){var d=this.buttonList[c];return this.$buttons.find("#"+d)},scrollTop:function(){return this.$body.scrollTop()},_create:function(e){var d=this;this.options=_.defaults(e,this.optionsDefault);if(this.options.body=="progress"){this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')}if(this.$el){this.$el.remove();$(document).off("keyup.ui-modal")}this.setElement(this._template(this.options.title));this.$dialog=(this.$el).find(".modal-dialog");this.$body=(this.$el).find(".modal-body");this.$footer=(this.$el).find(".modal-footer");this.$buttons=(this.$el).find(".buttons");this.$backdrop=(this.$el).find(".modal-backdrop");this.$body.html(this.options.body);if(!this.options.backdrop){this.$backdrop.removeClass("in")}if(this.options.buttons){this.buttonList={};var c=0;$.each(this.options.buttons,function(f,h){var g="button-"+c++;d.$buttons.append($('<button id="'+g+'"></button>').text(f).click(h)).append(" ");d.buttonList[f]=g})}else{this.$footer.hide()}$(this.elMain).append($(this.el));if(this.options.closing_events){$(document).on("keyup.ui-modal",function(f){if(f.keyCode==27){d.hide()}});this.$el.find(".modal-backdrop").on("click",function(){d.hide()})}},_template:function(c){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+c+'</h4></div><div class="modal-body" style="position: static;"></div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{View:b}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:true,height:null,width:null,closing_events:false},buttonList:{},initialize:function(b){if(b){this._create(b)}},show:function(b){console.debug(this);this.initialize(b);if(this.options.height){this.$body.css("height",this.options.height);this.$body.css("overflow","hidden")}else{this.$body.css("max-height",$(window).height()/2)}if(this.options.width){this.$dialog.css("width",this.options.width)}if(this.visible){this.$el.show()}else{this.$el.fadeIn("fast")}this.visible=true},hide:function(){this.visible=false;this.$el.fadeOut("fast")},enableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",true)},showButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).show()},hideButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).hide()},getButton:function(b){var c=this.buttonList[b];return this.$buttons.find("#"+c)},scrollTop:function(){return this.$body.scrollTop()},_create:function(d){var c=this;this.options=_.defaults(d,this.optionsDefault);if(this.options.body=="progress"){this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')}if(this.$el){this.$el.remove();$(document).off("keyup.ui-modal")}this.setElement(this._template(this.options.title));this.$dialog=(this.$el).find(".modal-dialog");this.$body=(this.$el).find(".modal-body");this.$footer=(this.$el).find(".modal-footer");this.$buttons=(this.$el).find(".buttons");this.$backdrop=(this.$el).find(".modal-backdrop");this.$body.html(this.options.body);if(!this.options.backdrop){this.$backdrop.removeClass("in")}if(this.options.buttons){this.buttonList={};var b=0;$.each(this.options.buttons,function(e,g){var f="button-"+b++;c.$buttons.append($('<button id="'+f+'"></button>').text(e).click(g)).append(" ");c.buttonList[e]=f})}else{this.$footer.hide()}$(this.elMain).append($(this.el));if(this.options.closing_events){$(document).on("keyup.ui-modal",function(f){if(f.keyCode==27){c.hide()}});this.$el.find(".modal-backdrop").on("click",function(){c.hide()})}},_template:function(b){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+b+'</h4></div><div class="modal-body" style="position: static;"></div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{View:a}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/24834f127f4c/
Changeset: 24834f127f4c
User: carlfeberhard
Date: 2014-05-05 19:36:51
Summary: aad9eb1a8486: remove debugging statement
Affected #: 2 files
diff -r aad9eb1a8486211c2204452d466e5b811496f6e7 -r 24834f127f4cced95f0a64dd5a7ccf72a3f18134 static/scripts/mvc/ui/ui-modal.js
--- a/static/scripts/mvc/ui/ui-modal.js
+++ b/static/scripts/mvc/ui/ui-modal.js
@@ -27,7 +27,6 @@
// adds and displays a new frame/window
show: function(options) {
- console.debug( this );
// create
this.initialize(options);
diff -r aad9eb1a8486211c2204452d466e5b811496f6e7 -r 24834f127f4cced95f0a64dd5a7ccf72a3f18134 static/scripts/packed/mvc/ui/ui-modal.js
--- a/static/scripts/packed/mvc/ui/ui-modal.js
+++ b/static/scripts/packed/mvc/ui/ui-modal.js
@@ -1,1 +1,1 @@
-define([],function(){var a=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:true,height:null,width:null,closing_events:false},buttonList:{},initialize:function(b){if(b){this._create(b)}},show:function(b){console.debug(this);this.initialize(b);if(this.options.height){this.$body.css("height",this.options.height);this.$body.css("overflow","hidden")}else{this.$body.css("max-height",$(window).height()/2)}if(this.options.width){this.$dialog.css("width",this.options.width)}if(this.visible){this.$el.show()}else{this.$el.fadeIn("fast")}this.visible=true},hide:function(){this.visible=false;this.$el.fadeOut("fast")},enableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",true)},showButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).show()},hideButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).hide()},getButton:function(b){var c=this.buttonList[b];return this.$buttons.find("#"+c)},scrollTop:function(){return this.$body.scrollTop()},_create:function(d){var c=this;this.options=_.defaults(d,this.optionsDefault);if(this.options.body=="progress"){this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')}if(this.$el){this.$el.remove();$(document).off("keyup.ui-modal")}this.setElement(this._template(this.options.title));this.$dialog=(this.$el).find(".modal-dialog");this.$body=(this.$el).find(".modal-body");this.$footer=(this.$el).find(".modal-footer");this.$buttons=(this.$el).find(".buttons");this.$backdrop=(this.$el).find(".modal-backdrop");this.$body.html(this.options.body);if(!this.options.backdrop){this.$backdrop.removeClass("in")}if(this.options.buttons){this.buttonList={};var b=0;$.each(this.options.buttons,function(e,g){var f="button-"+b++;c.$buttons.append($('<button id="'+f+'"></button>').text(e).click(g)).append(" ");c.buttonList[e]=f})}else{this.$footer.hide()}$(this.elMain).append($(this.el));if(this.options.closing_events){$(document).on("keyup.ui-modal",function(f){if(f.keyCode==27){c.hide()}});this.$el.find(".modal-backdrop").on("click",function(){c.hide()})}},_template:function(b){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+b+'</h4></div><div class="modal-body" style="position: static;"></div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{View:a}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:true,height:null,width:null,closing_events:false},buttonList:{},initialize:function(b){if(b){this._create(b)}},show:function(b){this.initialize(b);if(this.options.height){this.$body.css("height",this.options.height);this.$body.css("overflow","hidden")}else{this.$body.css("max-height",$(window).height()/2)}if(this.options.width){this.$dialog.css("width",this.options.width)}if(this.visible){this.$el.show()}else{this.$el.fadeIn("fast")}this.visible=true},hide:function(){this.visible=false;this.$el.fadeOut("fast")},enableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",true)},showButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).show()},hideButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).hide()},getButton:function(b){var c=this.buttonList[b];return this.$buttons.find("#"+c)},scrollTop:function(){return this.$body.scrollTop()},_create:function(d){var c=this;this.options=_.defaults(d,this.optionsDefault);if(this.options.body=="progress"){this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')}if(this.$el){this.$el.remove();$(document).off("keyup.ui-modal")}this.setElement(this._template(this.options.title));this.$dialog=(this.$el).find(".modal-dialog");this.$body=(this.$el).find(".modal-body");this.$footer=(this.$el).find(".modal-footer");this.$buttons=(this.$el).find(".buttons");this.$backdrop=(this.$el).find(".modal-backdrop");this.$body.html(this.options.body);if(!this.options.backdrop){this.$backdrop.removeClass("in")}if(this.options.buttons){this.buttonList={};var b=0;$.each(this.options.buttons,function(e,g){var f="button-"+b++;c.$buttons.append($('<button id="'+f+'"></button>').text(e).click(g)).append(" ");c.buttonList[e]=f})}else{this.$footer.hide()}$(this.elMain).append($(this.el));if(this.options.closing_events){$(document).on("keyup.ui-modal",function(f){if(f.keyCode==27){c.hide()}});this.$el.find(".modal-backdrop").on("click",function(){c.hide()})}},_template:function(b){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+b+'</h4></div><div class="modal-body" style="position: static;"></div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{View:a}});
\ 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.
1
0

commit/galaxy-central: martenson: data libraries: router improvements, detecting whether the loaded page is the first page of the app (user came from outside) or within and navigating accordingly
by commits-noreply@bitbucket.org 05 May '14
by commits-noreply@bitbucket.org 05 May '14
05 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b94b4da49bfd/
Changeset: b94b4da49bfd
User: martenson
Date: 2014-05-05 19:03:16
Summary: data libraries: router improvements, detecting whether the loaded page is the first page of the app (user came from outside) or within and navigating accordingly
Affected #: 6 files
diff -r fe6c48de949dd4e640d3632ab23cfe6ab5fa0494 -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 static/scripts/galaxy.library.js
--- a/static/scripts/galaxy.library.js
+++ b/static/scripts/galaxy.library.js
@@ -27,12 +27,29 @@
// ============================================================================
// ROUTER
var LibraryRouter = Backbone.Router.extend({
- routes: {
- "" : "libraries",
- "folders/:id" : "folder_content",
- "folders/:folder_id/datasets/:dataset_id" : "dataset_detail",
- "folders/:folder_id/download/:format" : "download"
+ initialize: function() {
+ this.routesHit = 0;
+ //keep count of number of routes handled by the application
+ Backbone.history.on('route', function() { this.routesHit++; }, this);
+ },
+
+ routes: {
+ "" : "libraries",
+ "folders/:id" : "folder_content",
+ "folders/:folder_id/datasets/:dataset_id" : "dataset_detail",
+ "folders/:folder_id/download/:format" : "download"
+ },
+
+ back: function() {
+ if(this.routesHit > 1) {
+ //more than one route hit -> user did not land to current page directly
+ window.history.back();
+ } else {
+ //otherwise go to the home page. Use replaceState if available so
+ //the navigation doesn't create an extra history entry
+ this.navigate('#', {trigger:true, replace:true});
}
+ }
});
// ============================================================================
@@ -70,7 +87,7 @@
});
this.library_router.on('route:folder_content', function(id) {
- // TODO place caching here, sessionstorage/localstorage?
+ // TODO maybe caching somewhere here, sessionstorage/localstorage?
if (Galaxy.libraries.folderToolbarView){
Galaxy.libraries.folderToolbarView.$el.unbind('click');
}
@@ -80,7 +97,6 @@
this.library_router.on('route:download', function(folder_id, format) {
if ($('#folder_list_body').find(':checked').length === 0) {
- //TODO make URL sharable
mod_toastr.info('You have to select some datasets to download');
Galaxy.libraries.library_router.navigate('folders/' + folder_id, {trigger: true, replace: true});
} else {
@@ -91,11 +107,11 @@
this.library_router.on('route:dataset_detail', function(folder_id, dataset_id){
if (Galaxy.libraries.folderToolbarView){
- Galaxy.libraries.folderToolbarView.$el.unbind('click');
+ Galaxy.libraries.folderListView = new mod_folderlist_view.FolderListView({id: folder_id, dataset_id: dataset_id});
+ } else {
+ Galaxy.libraries.folderToolbarView = new mod_foldertoolbar_view.FolderToolbarView({id: folder_id});
+ Galaxy.libraries.folderListView = new mod_folderlist_view.FolderListView({id: folder_id, dataset_id: dataset_id});
}
- Galaxy.libraries.folderToolbarView = new mod_foldertoolbar_view.FolderToolbarView({id: folder_id});
- Galaxy.libraries.folderListView = new mod_folderlist_view.FolderListView({id: folder_id, dataset_id: dataset_id});
- // Galaxy.libraries.folderListView.rowViews.get(dataset_id).showDatasetDetails();
});
Backbone.history.start({pushState: false});
diff -r fe6c48de949dd4e640d3632ab23cfe6ab5fa0494 -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 static/scripts/mvc/library/library-folderlist-view.js
--- a/static/scripts/mvc/library/library-folderlist-view.js
+++ b/static/scripts/mvc/library/library-folderlist-view.js
@@ -70,9 +70,9 @@
},
error: function(model, response){
if (typeof response.responseJSON !== "undefined"){
- mod_toastr.error(response.responseJSON.err_msg);
+ mod_toastr.error(response.responseJSON.err_msg + ' Click this to go back.', '', {onclick: function() {Galaxy.libraries.library_router.back();}});
} else {
- mod_toastr.error('An error ocurred :(');
+ mod_toastr.error('An error ocurred :(. Click this to go back.', '', {onclick: function() {Galaxy.libraries.library_router.back();}});
}
}
});
diff -r fe6c48de949dd4e640d3632ab23cfe6ab5fa0494 -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 static/scripts/mvc/library/library-folderrow-view.js
--- a/static/scripts/mvc/library/library-folderrow-view.js
+++ b/static/scripts/mvc/library/library-folderrow-view.js
@@ -49,11 +49,7 @@
},
//show modal with current dataset info
- // showDatasetDetails : function(event){
showDatasetDetails : function(){
- // prevent default
- // event.preventDefault();
-
var id = this.id;
//create new item
@@ -100,7 +96,7 @@
this.modal = Galaxy.modal;
this.modal.show({
closing_events : true,
- title : 'Dataset Details',
+ title : item.get('name'),
body : template,
buttons : {
'Import' : function() { self.importCurrentIntoHistory(); },
diff -r fe6c48de949dd4e640d3632ab23cfe6ab5fa0494 -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 static/scripts/packed/galaxy.library.js
--- a/static/scripts/packed/galaxy.library.js
+++ b/static/scripts/packed/galaxy.library.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/base-mvc","mvc/library/library-model","mvc/library/library-folderlist-view","mvc/library/library-librarylist-view","mvc/library/library-librarytoolbar-view","mvc/library/library-foldertoolbar-view"],function(e,c,g,k,h,a,f,d,i){var l=Backbone.Router.extend({routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/datasets/:dataset_id":"dataset_detail","folders/:folder_id/download/:format":"download"}});var j=k.SessionStorageModel.extend({defaults:{with_deleted:false,sort_order:"asc",sort_by:"name"}});var b=Backbone.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,folderToolbarView:null,folderListView:null,initialize:function(){Galaxy.libraries=this;this.preferences=new j({id:"global-lib-prefs"});this.library_router=new l();this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView=new d.LibraryToolbarView();Galaxy.libraries.libraryListView=new f.LibraryListView()});this.library_router.on("route:folder_content",function(m){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new i.FolderToolbarView({id:m});Galaxy.libraries.folderListView=new a.FolderListView({id:m})});this.library_router.on("route:download",function(m,n){if($("#folder_list_body").find(":checked").length===0){g.info("You have to select some datasets to download");Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:true,replace:true})}else{Galaxy.libraries.folderToolbarView.download(m,n);Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:false,replace:true})}});this.library_router.on("route:dataset_detail",function(n,m){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new i.FolderToolbarView({id:n});Galaxy.libraries.folderListView=new a.FolderListView({id:n,dataset_id:m})});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/base-mvc","mvc/library/library-model","mvc/library/library-folderlist-view","mvc/library/library-librarylist-view","mvc/library/library-librarytoolbar-view","mvc/library/library-foldertoolbar-view"],function(e,c,g,k,h,a,f,d,i){var l=Backbone.Router.extend({initialize:function(){this.routesHit=0;Backbone.history.on("route",function(){this.routesHit++},this)},routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/datasets/:dataset_id":"dataset_detail","folders/:folder_id/download/:format":"download"},back:function(){if(this.routesHit>1){window.history.back()}else{this.navigate("#",{trigger:true,replace:true})}}});var j=k.SessionStorageModel.extend({defaults:{with_deleted:false,sort_order:"asc",sort_by:"name"}});var b=Backbone.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,folderToolbarView:null,folderListView:null,initialize:function(){Galaxy.libraries=this;this.preferences=new j({id:"global-lib-prefs"});this.library_router=new l();this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView=new d.LibraryToolbarView();Galaxy.libraries.libraryListView=new f.LibraryListView()});this.library_router.on("route:folder_content",function(m){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new i.FolderToolbarView({id:m});Galaxy.libraries.folderListView=new a.FolderListView({id:m})});this.library_router.on("route:download",function(m,n){if($("#folder_list_body").find(":checked").length===0){g.info("You have to select some datasets to download");Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:true,replace:true})}else{Galaxy.libraries.folderToolbarView.download(m,n);Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:false,replace:true})}});this.library_router.on("route:dataset_detail",function(n,m){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderListView=new a.FolderListView({id:n,dataset_id:m})}else{Galaxy.libraries.folderToolbarView=new i.FolderToolbarView({id:n});Galaxy.libraries.folderListView=new a.FolderListView({id:n,dataset_id:m})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}});
\ No newline at end of file
diff -r fe6c48de949dd4e640d3632ab23cfe6ab5fa0494 -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 static/scripts/packed/mvc/library/library-folderlist-view.js
--- a/static/scripts/packed/mvc/library/library-folderlist-view.js
+++ b/static/scripts/packed/mvc/library/library-folderlist-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",defaults:{include_deleted:false},progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},rowViews:{},initialize:function(g){this.options=_.defaults(this.options||{},g);this.fetchFolder()},fetchFolder:function(g){var g=g||{};this.options.include_deleted=g.include_deleted;var h=this;this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.listenTo(this.collection,"remove",this.removeOne);this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";if(this.options.include_deleted){this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"}this.folderContainer.fetch({success:function(i){h.folder_container=i;h.render();h.addAll(i.get("folder").models);if(h.options.dataset_id){_.findWhere(h.rowViews,{id:h.options.dataset_id}).showDatasetDetails()}},error:function(j,i){if(typeof i.responseJSON!=="undefined"){f.error(i.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options,g);var h=this.templateFolder();var i=this.folderContainer.attributes.metadata.full_path;var j;if(i.length===1){j=0}else{j=i[i.length-2][0]}this.$el.html(h({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:j,order:this.sort}));$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},postRender:function(){var g=this.folderContainer.attributes.metadata;g.contains_file=typeof this.collection.findWhere({type:"file"})!=="undefined";Galaxy.libraries.folderToolbarView.configureElements(g);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});$("#center [data-toggle]").tooltip();this.checkEmptiness();this.postRender()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)});this.postRender()},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}h.set("folder_id",this.id);var g=new a.FolderRowView(h);this.rowViews[h.get("id")]=g;this.$el.find("#first_folder_item").after(g.el);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},removeOne:function(g){this.$el.find("#"+g.id).remove()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){this.$el.find(".empty-folder-message").show()}else{this.$el.find(".empty-folder-message").hide()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox","#folder_list_body").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th style="width:30%;"><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(' <th style="width:15%;"></th> ');g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");g.push('<div class="empty-folder-message" style="display:none;">This folder is either empty or you do not have proper access permissions to see the contents.</div>');return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",defaults:{include_deleted:false},progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},rowViews:{},initialize:function(g){this.options=_.defaults(this.options||{},g);this.fetchFolder()},fetchFolder:function(g){var g=g||{};this.options.include_deleted=g.include_deleted;var h=this;this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.listenTo(this.collection,"remove",this.removeOne);this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";if(this.options.include_deleted){this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"}this.folderContainer.fetch({success:function(i){h.folder_container=i;h.render();h.addAll(i.get("folder").models);if(h.options.dataset_id){_.findWhere(h.rowViews,{id:h.options.dataset_id}).showDatasetDetails()}},error:function(j,i){if(typeof i.responseJSON!=="undefined"){f.error(i.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}else{f.error("An error ocurred :(. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}}})},render:function(g){this.options=_.defaults(this.options,g);var h=this.templateFolder();var i=this.folderContainer.attributes.metadata.full_path;var j;if(i.length===1){j=0}else{j=i[i.length-2][0]}this.$el.html(h({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:j,order:this.sort}));$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},postRender:function(){var g=this.folderContainer.attributes.metadata;g.contains_file=typeof this.collection.findWhere({type:"file"})!=="undefined";Galaxy.libraries.folderToolbarView.configureElements(g);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});$("#center [data-toggle]").tooltip();this.checkEmptiness();this.postRender()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)});this.postRender()},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}h.set("folder_id",this.id);var g=new a.FolderRowView(h);this.rowViews[h.get("id")]=g;this.$el.find("#first_folder_item").after(g.el);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},removeOne:function(g){this.$el.find("#"+g.id).remove()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){this.$el.find(".empty-folder-message").show()}else{this.$el.find(".empty-folder-message").hide()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox","#folder_list_body").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th style="width:30%;"><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(' <th style="width:15%;"></th> ');g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");g.push('<div class="empty-folder-message" style="display:none;">This folder is either empty or you do not have proper access permissions to see the contents.</div>');return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
diff -r fe6c48de949dd4e640d3632ab23cfe6ab5fa0494 -r b94b4da49bfdf4f204d0ad2dce878a37e6e4f3d3 static/scripts/packed/mvc/library/library-folderrow-view.js
--- a/static/scripts/packed/mvc/library/library-folderrow-view.js
+++ b/static/scripts/packed/mvc/library/library-folderrow-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .undelete_dataset_btn":"undelete_dataset"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";if(f.get("deleted")){g=this.templateRowDeletedFile()}else{g=this.templateRowFile()}}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(){var i=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=i;var f=this;h.fetch({success:function(j){g.fetch({success:function(k){f.renderModalAfterFetch(j,k)},error:function(l,k){if(typeof k.responseJSON!=="undefined"){e.error(k.responseJSON.err_msg)}else{e.error("An error occured during fetching histories:(")}f.renderModalAfterFetch(j)}})},error:function(k,j){if(typeof j.responseJSON!=="undefined"){e.error(j.responseJSON.err_msg)}else{e.error("An error occured during loading dataset details :(")}}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(k,j){if(typeof j.responseJSON!=="undefined"){e.error("Dataset not imported. "+j.responseJSON.err_msg)}else{e.error("An error occured! Dataset not imported. Please try again.")}g.modal.enableButton("Import");g.modal.enableButton("Download")}})},undelete_dataset:function(g){$(".tooltip").hide();var f=$(g.target).closest("tr")[0].id;var h=Galaxy.libraries.folderListView.collection.get(f);h.url=h.urlRoot+h.id+"?undelete=true";h.destroy({success:function(j,i){Galaxy.libraries.folderListView.collection.remove(f);var k=new c.Item(i);Galaxy.libraries.folderListView.collection.add(k);e.success("Dataset undeleted")},error:function(j,i){if(typeof i.responseJSON!=="undefined"){e.error("Dataset was not undeleted. "+i.responseJSON.err_msg)}else{e.error("An error occured! Dataset was not undeleted. Please try again.")}}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#folders/<%- content_item.get("folder_id") %>/datasets/<%- content_item.id %>" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('<tr class="active deleted_dataset" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(' <td class="right-center"><button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_dataset_btn show_on_hover" type="button" style="display:none;"><span class="fa fa-unlock"> Undelete</span></button></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .undelete_dataset_btn":"undelete_dataset"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";if(f.get("deleted")){g=this.templateRowDeletedFile()}else{g=this.templateRowFile()}}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(){var i=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=i;var f=this;h.fetch({success:function(j){g.fetch({success:function(k){f.renderModalAfterFetch(j,k)},error:function(l,k){if(typeof k.responseJSON!=="undefined"){e.error(k.responseJSON.err_msg)}else{e.error("An error occured during fetching histories:(")}f.renderModalAfterFetch(j)}})},error:function(k,j){if(typeof j.responseJSON!=="undefined"){e.error(j.responseJSON.err_msg)}else{e.error("An error occured during loading dataset details :(")}}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:k.get("name"),body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(k,j){if(typeof j.responseJSON!=="undefined"){e.error("Dataset not imported. "+j.responseJSON.err_msg)}else{e.error("An error occured! Dataset not imported. Please try again.")}g.modal.enableButton("Import");g.modal.enableButton("Download")}})},undelete_dataset:function(g){$(".tooltip").hide();var f=$(g.target).closest("tr")[0].id;var h=Galaxy.libraries.folderListView.collection.get(f);h.url=h.urlRoot+h.id+"?undelete=true";h.destroy({success:function(j,i){Galaxy.libraries.folderListView.collection.remove(f);var k=new c.Item(i);Galaxy.libraries.folderListView.collection.add(k);e.success("Dataset undeleted")},error:function(j,i){if(typeof i.responseJSON!=="undefined"){e.error("Dataset was not undeleted. "+i.responseJSON.err_msg)}else{e.error("An error occured! Dataset was not undeleted. Please try again.")}}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#folders/<%- content_item.get("folder_id") %>/datasets/<%- content_item.id %>" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('<tr class="active deleted_dataset" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(' <td class="right-center"><button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_dataset_btn show_on_hover" type="button" style="display:none;"><span class="fa fa-unlock"> Undelete</span></button></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ 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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6f07000db257/
Changeset: 6f07000db257
User: jmchilton
Date: 2014-05-05 18:35:31
Summary: Remove duplicated code block - error in stable->central merge at some point I guess?
Affected #: 1 file
diff -r e7c77cb338c64f72310d844ee9e605e7b5438f94 -r 6f07000db257139dee35696da6dd840b240caef3 lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -237,12 +237,6 @@
dependency_shell_commands = "&&".join( dependency_shell_commands )
external_metadata_script = "%s&&%s" % ( dependency_shell_commands, external_metadata_script )
log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
- if resolve_requirements:
- dependency_shell_commands = self.app.datatypes_registry.set_external_metadata_tool.build_dependency_shell_commands()
- if dependency_shell_commands:
- if isinstance( dependency_shell_commands, list ):
- dependency_shell_commands = "&&".join( dependency_shell_commands )
- external_metadata_script = "%s&&%s" % ( dependency_shell_commands, external_metadata_script )
external_metadata_proc = subprocess.Popen( args=external_metadata_script,
shell=True,
env=os.environ,
https://bitbucket.org/galaxy/galaxy-central/commits/fe6c48de949d/
Changeset: fe6c48de949d
User: jmchilton
Date: 2014-05-05 18:35:31
Summary: Rework some error handling in local runner.
This way if something goes wrong in failing job - the original exception is reported.
Affected #: 1 file
diff -r 6f07000db257139dee35696da6dd840b240caef3 -r fe6c48de949dd4e640d3632ab23cfe6ab5fa0494 lib/galaxy/jobs/runners/local.py
--- a/lib/galaxy/jobs/runners/local.py
+++ b/lib/galaxy/jobs/runners/local.py
@@ -109,8 +109,8 @@
stderr_file.close()
log.debug('execution finished: %s' % command_line)
except Exception:
+ log.exception("failure running job %d" % job_wrapper.job_id)
job_wrapper.fail( "failure running job", exception=True )
- log.exception("failure running job %d" % job_wrapper.job_id)
return
self._handle_metadata_externally( job_wrapper, resolve_requirements=True )
# Finish the job!
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.
1
0

commit/galaxy-central: dannon: Use correctly cased PyYAML
by commits-noreply@bitbucket.org 05 May '14
by commits-noreply@bitbucket.org 05 May '14
05 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e7c77cb338c6/
Changeset: e7c77cb338c6
User: dannon
Date: 2014-05-05 16:43:18
Summary: Use correctly cased PyYAML
Affected #: 1 file
diff -r 848d2c4e41c27e67e07431b152b0b329676ab8c5 -r e7c77cb338c64f72310d844ee9e605e7b5438f94 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
--- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
+++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
@@ -15,7 +15,7 @@
from galaxy.web.base.controller import BaseUIController
from galaxy.util.json import to_json_string
-eggs.require('pyyaml')
+eggs.require('PyYAML')
eggs.require('boto')
eggs.require('bioblend')
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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c8e18e05f0ec/
Changeset: c8e18e05f0ec
User: jmchilton
Date: 2014-05-05 16:11:05
Summary: Truncate big job metric values.
Wasn't needed for sqlite based testing - but based on Nicola's experience must be for some other database backend.
https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5a4075430a6d…
Affected #: 2 files
diff -r 92519a9bfa32a42ce47a63fdb72c8e2d717ec52e -r c8e18e05f0ecee85cc6d3d7122b457fbc85915a4 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -107,6 +107,10 @@
else:
if isinstance( metric_value, str ):
metric_value = unicode( metric_value, 'utf-8' )
+ if len( metric_value ) > 1022:
+ # Truncate these values - not needed with sqlite
+ # but other backends must need it.
+ metric_value = metric_value[ :1022 ]
metric = self._text_metric( plugin, metric_name, metric_value )
self.text_metrics.append( metric )
diff -r 92519a9bfa32a42ce47a63fdb72c8e2d717ec52e -r c8e18e05f0ecee85cc6d3d7122b457fbc85915a4 test/unit/test_galaxy_mapping.py
--- a/test/unit/test_galaxy_mapping.py
+++ b/test/unit/test_galaxy_mapping.py
@@ -237,7 +237,12 @@
task = model.Task( job=job, working_directory="/tmp", prepare_files_cmd="split.sh" )
task.add_metric( "gx", "galaxy_slots", 5 )
task.add_metric( "system", "system_name", "localhost" )
+
+ big_value = ":".join( [ "%d" % i for i in range( 2000 ) ] )
+ task.add_metric( "env", "BIG_PATH", big_value )
self.persist( task )
+ # Ensure big values truncated
+ assert len( task.text_metrics[ 1 ].metric_value ) <= 1023
def test_tasks( self ):
model = self.model
https://bitbucket.org/galaxy/galaxy-central/commits/d9c6648ef265/
Changeset: d9c6648ef265
User: jmchilton
Date: 2014-05-05 16:11:05
Summary: Use Nicola's improved logic for env output parsing for env metrics plugin.
Very well laid out here https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5a4075430a6d… with examples. The one modification I made was to move the logic for truncated large property values into the model layer so it applies for all plugins.
Affected #: 1 file
diff -r c8e18e05f0ecee85cc6d3d7122b457fbc85915a4 -r d9c6648ef2658cc06708ecf908f8b5ce88a7996f lib/galaxy/jobs/metrics/instrumenters/env.py
--- a/lib/galaxy/jobs/metrics/instrumenters/env.py
+++ b/lib/galaxy/jobs/metrics/instrumenters/env.py
@@ -1,3 +1,5 @@
+import re
+
from ..instrumenters import InstrumentPlugin
from ...metrics import formatting
@@ -41,17 +43,19 @@
variables = self.variables
properties = {}
- for line in open( self.__env_file( job_directory ) ).readlines():
- if "=" not in line:
- # Previous line may have had a multiline property value, just
- # keep it simple here and only record the first part of
- # property. A more robust solution might be to record env -O
- # so properties are terminated by null characters instead of
- # newlines.
- continue
- var, value = line.split( "=", 1 )
+ env_string = ''.join( open( self.__env_file( job_directory ) ).readlines() )
+ while env_string:
+ # Check if the next lines contain a shell function.
+ # We use '\n\}\n' as regex termination because shell
+ # functions can be nested.
+ # We use the non-greedy '.+?' because of re.DOTALL .
+ m = re.match( '([^=]+)=(\(\) \{.+?\n\})\n', env_string, re.DOTALL )
+ if m is None:
+ m = re.match( '([^=]+)=(.*)\n', env_string )
+ (var, value) = m.groups()
if not variables or var in variables:
properties[ var ] = value
+ env_string = env_string[m.end():]
return properties
https://bitbucket.org/galaxy/galaxy-central/commits/848d2c4e41c2/
Changeset: 848d2c4e41c2
User: jmchilton
Date: 2014-05-05 16:11:05
Summary: Slightly more defensive job metrics env parsing.
The env string potentially may not match exactly if there are problems reading or recording env output. Log the problem and leave the parsing loop.
Affected #: 1 file
diff -r d9c6648ef2658cc06708ecf908f8b5ce88a7996f -r 848d2c4e41c27e67e07431b152b0b329676ab8c5 lib/galaxy/jobs/metrics/instrumenters/env.py
--- a/lib/galaxy/jobs/metrics/instrumenters/env.py
+++ b/lib/galaxy/jobs/metrics/instrumenters/env.py
@@ -52,6 +52,12 @@
m = re.match( '([^=]+)=(\(\) \{.+?\n\})\n', env_string, re.DOTALL )
if m is None:
m = re.match( '([^=]+)=(.*)\n', env_string )
+ if m is None:
+ # Some problem recording or reading back env output.
+ message_template = "Problem parsing env metric output for job %s - properties will be incomplete"
+ message = message_template % job_id
+ log.debug( message )
+ break
(var, value) = m.groups()
if not variables or var in variables:
properties[ var ] = value
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.
1
0

commit/galaxy-central: dannon: Adjust require order in cloudlaunch controller.
by commits-noreply@bitbucket.org 05 May '14
by commits-noreply@bitbucket.org 05 May '14
05 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/92519a9bfa32/
Changeset: 92519a9bfa32
User: dannon
Date: 2014-05-05 15:28:41
Summary: Adjust require order in cloudlaunch controller.
Affected #: 1 file
diff -r a45f6e57f3d5a4075430a6d460a6caded611b867 -r 92519a9bfa32a42ce47a63fdb72c8e2d717ec52e lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
--- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
+++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
@@ -15,9 +15,9 @@
from galaxy.web.base.controller import BaseUIController
from galaxy.util.json import to_json_string
+eggs.require('pyyaml')
eggs.require('boto')
eggs.require('bioblend')
-eggs.require('pyyaml')
from boto.exception import EC2ResponseError
@@ -73,7 +73,7 @@
result = cml.launch(cluster_name, ami, instance_type, password,
cfg.kernel_id, cfg.ramdisk_id, cfg.key_name,
cfg.security_groups, cfg.placement)
- #result is a dict with sg_names, kp_name, kp_material, rs, and instance_id
+ # result is a dict with sg_names, kp_name, kp_material, rs, and instance_id
if not result['rs']:
trans.response.status = 400
return "Instance failure, but no specific error was detected. Please check your AWS Console."
@@ -86,7 +86,7 @@
pass
time.sleep(1)
if result['kp_material']:
- #We have created a keypair. Save to tempfile for one time retrieval.
+ # We have created a keypair. Save to tempfile for one time retrieval.
(fd, fname) = tempfile.mkstemp(prefix=PKEY_PREFIX, dir=trans.app.config.new_file_path)
f = os.fdopen(fd, 'wt')
f.write(result['kp_material'])
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.
1
0

commit/galaxy-central: jmchilton: Fix env job metrics plugin for multi-line properties.
by commits-noreply@bitbucket.org 04 May '14
by commits-noreply@bitbucket.org 04 May '14
04 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5/
Changeset: a45f6e57f3d5
User: jmchilton
Date: 2014-05-05 01:17:36
Summary: Fix env job metrics plugin for multi-line properties.
Thanks to Nicola Soranzo for detailed bug report.
Affected #: 1 file
diff -r 116d7867f3f8efca5fdc2998bb3bb5df55724529 -r a45f6e57f3d5a4075430a6d460a6caded611b867 lib/galaxy/jobs/metrics/instrumenters/env.py
--- a/lib/galaxy/jobs/metrics/instrumenters/env.py
+++ b/lib/galaxy/jobs/metrics/instrumenters/env.py
@@ -42,6 +42,13 @@
properties = {}
for line in open( self.__env_file( job_directory ) ).readlines():
+ if "=" not in line:
+ # Previous line may have had a multiline property value, just
+ # keep it simple here and only record the first part of
+ # property. A more robust solution might be to record env -O
+ # so properties are terminated by null characters instead of
+ # newlines.
+ continue
var, value = line.split( "=", 1 )
if not variables or var in variables:
properties[ var ] = value
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.
1
0

commit/galaxy-central: guerler: Charts: Implement heatmap sort for sparse data
by commits-noreply@bitbucket.org 03 May '14
by commits-noreply@bitbucket.org 03 May '14
03 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/116d7867f3f8/
Changeset: 116d7867f3f8
User: guerler
Date: 2014-05-03 21:39:40
Summary: Charts: Implement heatmap sort for sparse data
Affected #: 1 file
diff -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf -r 116d7867f3f8efca5fdc2998bb3bb5df55724529 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
@@ -20,19 +20,24 @@
// cell size
cellSize: 0,
+ // font size
+ fontSize: 0,
+
// color buckets
nColors: 0,
-
+
+ // margins as cells
+ margin : {
+ top : 5,
+ right : 5,
+ bottom : 5,
+ left : 5
+ },
+
// default settings
optionsDefault: {
title : '',
pace : 1000,
- margin : {
- top : 50,
- right : 10,
- bottom : 50,
- left : 100
- }
},
// initialize
@@ -107,20 +112,19 @@
// generate sorted key list for rows
for (var i in this.rowLabel) {
var row_label = this.rowLabel[i];
- var row_rank = parseInt(i);
- this.rowRank[row_label] = row_rank;
+ var row = parseInt(i);
+ this.rowRank[row_label] = row;
}
// generate sorted key list for columns
for (var i in this.colLabel) {
var col_label = this.colLabel[i];
- var col_rank = parseInt(i);
- this.colRank[col_label] = col_rank;
+ var col = parseInt(i);
+ this.colRank[col_label] = col;
}
//
// parse indexing from rank dictionary to cells
- // identify data range
//
// min/max
@@ -133,8 +137,8 @@
var cell = this.data[i];
// add rank
- cell.col_rank = this.colRank[cell.col_label];
- cell.row_rank = this.rowRank[cell.row_label];
+ cell.col = this.colRank[cell.col_label];
+ cell.row = this.rowRank[cell.row_label];
// identify max/min values
if (this.min == undefined || this.min > cell.value) {
@@ -199,17 +203,20 @@
// link this
var self = this;
- // container
- var container_width = this.$el.width();
- var container_height = this.$el.height();
+ // container (full draw area)
+ this.widthContainer = this.$el.width();
+ this.heightContainer = this.$el.height();
- // get height
- this.width = this.$el.width() - this.options.margin.left - this.options.margin.right;
- this.height = this.$el.height() - this.options.margin.top - this.options.margin.bottom;
+ // get grid dimensions
+ this.width = this.widthContainer;
+ this.height = this.heightContainer;
// calculate cell size
- this.cellSize = Math.min(parseInt(this.height / this.rowNumber),
- parseInt(this.width / this.colNumber));
+ this.cellSize = Math.min(((this.height - 50) / (this.rowNumber + this.margin.top + this.margin.bottom)),
+ (this.width / (this.colNumber + this.margin.left + this.margin.right)));
+
+ // set font size
+ this.fontSize = Math.min(this.cellSize, 16);
// set width/height for plugin
this.width = this.cellSize * this.colNumber;
@@ -222,10 +229,9 @@
// add main group and translate
this.svg = d3.select(this.$el[0]).append('svg')
- .attr('width', width + margin.left + margin.right)
- .attr('height', height + margin.top + margin.bottom)
.append('g')
- .attr('transform', 'translate(' + (container_width - width) / 2 + ',' + (container_height - height) / 2 + ')')
+ .attr('transform', 'translate(' + (this.widthContainer - width) / 2 + ',' +
+ (this.heightContainer - height) / 2 + ')')
// reset sorting
this.rowSortOrder = false;
@@ -245,15 +251,17 @@
var self = this;
// gather data
- var height = this.height;
- var width = this.width;
- var title = this.options.title;
+ var height = this.height;
+ var width = this.width;
+ var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
+ var title = this.options.title;
// add title
this.svg.append('g')
.append('text')
.attr('x', width / 2)
- .attr('y', height - 10)
+ .attr('y', height + 3 * cellSize + fontSize + 3)
.attr('text-anchor', 'middle')
.text(title);
},
@@ -265,6 +273,7 @@
// gather data
var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
var height = this.height;
var legendCellWidth = this.width / this.nColors;
@@ -312,8 +321,8 @@
.attr('x', function(d, i) {
return legendCellWidth * i;
})
- .attr('y', height + cellSize)
- .style('font-size', cellSize + 'px');
+ .attr('y', height + cellSize - 3)
+ .style('font-size', fontSize + 'px');
},
// build column labels
@@ -323,6 +332,7 @@
// gather data
var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
var colIndex = this.colIndex;
var colLabel = this.colLabel;
@@ -339,7 +349,7 @@
.attr('y', function (d, i) {
return colIndex.indexOf(i) * cellSize;
})
- .style('font-size', cellSize + 'px')
+ .style('font-size', fontSize + 'px')
.style('text-anchor', 'left')
.attr('transform', 'translate(' + cellSize / 2 + ', -17) rotate (-90)')
.attr('class', function (d, i) {
@@ -347,15 +357,13 @@
})
.on('mouseover', function(d) {
d3.select(this).classed('text-hover',true);
- d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
.on('mouseout' , function(d) {
d3.select(this).classed('text-hover',false);
- d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
.on('click', function(d, i) {
self.colSortOrder=!self.colSortOrder;
- self._sortByLabel('c', i, self.colSortOrder);
+ self._sortByLabel('c', 'row', self.rowNumber, i, self.colSortOrder);
d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -367,6 +375,7 @@
// gather data
var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
var rowIndex = this.rowIndex;
var rowLabel = this.rowLabel;
@@ -383,7 +392,7 @@
.attr('y', function (d, i) {
return rowIndex.indexOf(i) * cellSize;
})
- .style('font-size', cellSize + 'px')
+ .style('font-size', fontSize + 'px')
.style('text-anchor', 'end')
.attr('transform', 'translate(-10,' + cellSize / 1.5 + ')')
.attr('class', function (d, i) {
@@ -391,15 +400,13 @@
} )
.on('mouseover', function(d) {
d3.select(this).classed('text-hover',true);
- d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
.on('mouseout' , function(d) {
d3.select(this).classed('text-hover',false);
- d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
.on('click', function(d, i) {
self.rowSortOrder=!self.rowSortOrder;
- self._sortByLabel('r', i, self.rowSortOrder);
+ self._sortByLabel('r', 'col', self.colNumber, i, self.rowSortOrder);
d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -420,18 +427,18 @@
var heatMap = this.svg.append('g').attr('class','g3')
.selectAll('.cellg')
.data(self.data, function(d) {
- return d.row_rank + ':' + d.col_rank;
+ return d.row + ':' + d.col;
})
.enter()
.append('rect')
.attr('x', function(d) {
- return colIndex.indexOf(d.col_rank) * cellSize;
+ return colIndex.indexOf(d.col) * cellSize;
})
.attr('y', function(d) {
- return rowIndex.indexOf(d.row_rank) * cellSize;
+ return rowIndex.indexOf(d.row) * cellSize;
})
.attr('class', function(d){
- return 'cell cell-border cr' + d.row_rank + ' cc' + d.col_rank;
+ return 'cell cell-border cr' + d.row + ' cc' + d.col;
})
.attr('width', cellSize)
.attr('height', cellSize)
@@ -441,15 +448,15 @@
.on('mouseover', function(d){
// highlight text
d3.select(this).classed('cell-hover',true);
- d3.selectAll('.rowLabel').classed('text-highlight',function(r,ri){ return ri==(d.row_rank);});
- d3.selectAll('.colLabel').classed('text-highlight',function(c,ci){ return ci==(d.col_rank);});
+ d3.selectAll('.rowLabel').classed('text-highlight',function(r,ri){ return ri==(d.row);});
+ d3.selectAll('.colLabel').classed('text-highlight',function(c,ci){ return ci==(d.col);});
// update the tooltip position and value
d3.select('#heatmap-tooltip')
.style('left', (d3.event.pageX+10) + 'px')
.style('top', (d3.event.pageY-10) + 'px')
.select('#value')
- .text('Label: ' + rowLabel[d.row_rank] + ' | ' + colLabel[d.col_rank] + ', Value: ' + d.value);
+ .text('Label: ' + rowLabel[d.row] + ' | ' + colLabel[d.col] + ', Value: ' + d.value);
// show the tooltip
d3.select('#heatmap-tooltip').classed('hidden', false);
})
@@ -462,18 +469,25 @@
},
// change ordering of cells
- _sortByLabel: function(rORc, i, sortOrder) {
+ _sortByLabel: function(rORc, rowORcol, n, index, sortOrder) {
// get cell size
var cellSize = this.cellSize;
// define transition / prepare element
var t = this.svg.transition().duration(this.options.pace);
+ // create cells
+ var cells=[];
+ for (var i = 0; i < n; i++) {
+ cells[i] = {
+ value: this.min - 1
+ }
+ cells[i][rowORcol] = i;
+ }
+
// collect cells
- var cells=[];
- t.selectAll('.c' + rORc + i)
- .filter(function(ce){
- cells.push(ce);
+ t.selectAll('.c' + rORc + index).filter(function(ce) {
+ cells[ce[rowORcol]].value = ce.value;
});
// sort cells
@@ -484,19 +498,19 @@
return a.value - b.value;
}
});
-
+
+ // get sorted key list
+ var sorted = [];
+ for (var i in cells) {
+ sorted.push(cells[i][rowORcol]);
+ }
+
// rows or columns
if(rORc == 'r') {
- // get sorted key list
- var sorted = [];
- for (var i in cells) {
- sorted.push(cells[i].col_rank);
- }
-
// sort cells
t.selectAll('.cell')
.attr('x', function(d) {
- return sorted.indexOf(d.col_rank) * cellSize;
+ return sorted.indexOf(d.col) * cellSize;
});
// sort labels
@@ -505,23 +519,17 @@
return sorted.indexOf(i) * cellSize;
});
} else {
- // get sorted key list
- sorted = [];
- for (var i in cells) {
- sorted.push(cells[i].row_rank);
- }
-
// sort cells
t.selectAll('.cell')
.attr('y', function(d) {
- return sorted.indexOf(d.row_rank) * cellSize;
- });
-
+ return sorted.indexOf(d.row) * cellSize;
+ });
+
// sort labels
t.selectAll('.rowLabel')
.attr('y', function (d, i) {
return sorted.indexOf(i) * cellSize;
- });
+ });
}
},
@@ -542,10 +550,10 @@
if(value=='hclust'){
t.selectAll('.cell')
.attr('x', function(d) {
- return colIndex.indexOf(d.col_rank) * cellSize;
+ return colIndex.indexOf(d.col) * cellSize;
})
.attr('y', function(d) {
- return rowIndex.indexOf(d.row_rank) * cellSize;
+ return rowIndex.indexOf(d.row) * cellSize;
});
t.selectAll('.rowLabel')
@@ -561,10 +569,10 @@
} else if (value=='byboth') {
t.selectAll('.cell')
.attr('x', function(d) {
- return d.col_rank * cellSize;
+ return d.col * cellSize;
})
.attr('y', function(d) {
- return d.row_rank * cellSize;
+ return d.row * cellSize;
});
t.selectAll('.rowLabel')
@@ -579,7 +587,7 @@
} else if (value=='byrow') {
t.selectAll('.cell')
.attr('y', function(d) {
- return d.row_rank * cellSize;
+ return d.row * cellSize;
});
t.selectAll('.rowLabel')
@@ -589,7 +597,7 @@
} else if (value=='bycol'){
t.selectAll('.cell')
.attr('x', function(d) {
- return d.col_rank * cellSize;
+ return d.col * cellSize;
});
t.selectAll('.colLabel')
.attr('y', function (d, i) {
@@ -666,11 +674,11 @@
.classed('cell-selection', true)
.classed('cell-selected', true);
- d3.select('.r'+(cell_d.row_rank))
+ d3.select('.r' + cell_d.row)
.classed('text-selection',true)
.classed('text-selected',true);
- d3.select('.c'+(cell_d.col_rank))
+ d3.select('.c' + cell_d.col)
.classed('text-selection',true)
.classed('text-selected',true);
}
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.
1
0

02 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fd8cf2329753/
Changeset: fd8cf2329753
User: guerler
Date: 2014-05-03 02:12:26
Summary: Charts: Add labels
Affected #: 2 files
diff -r 21121d6283a95942061819f5e788ab41cfc1c000 -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
@@ -25,6 +25,7 @@
// default settings
optionsDefault: {
+ title : '',
pace : 1000,
margin : {
top : 50,
@@ -231,12 +232,32 @@
this.colSortOrder = false;
// build
- this.rowLabels = this._buildRowLabels();
- this.colLabels = this._buildColLabels();
- this.heatMap = this._buildHeatMap();
- this.legend = this._buildLegend();
+ this._buildRowLabels();
+ this._buildColLabels();
+ this._buildHeatMap();
+ this._buildLegend();
+ this._buildTitle();
},
+ // build title
+ _buildTitle: function() {
+ // link this
+ var self = this;
+
+ // gather data
+ var height = this.height;
+ var width = this.width;
+ var title = this.options.title;
+
+ // add title
+ this.svg.append('g')
+ .append('text')
+ .attr('x', width / 2)
+ .attr('y', height - 10)
+ .attr('text-anchor', 'middle')
+ .text(title);
+ },
+
// build legend
_buildLegend: function() {
// link this
diff -r 21121d6283a95942061819f5e788ab41cfc1c000 -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
@@ -22,12 +22,14 @@
for (var group_index in request_dictionary.groups) {
// get group
var group = request_dictionary.groups[group_index];
-
+ var div = self.options.canvas[group_index];
+
// draw plot
var heatmap = new HeatmapPlugin({
- 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
- 'data' : group.values,
- 'div' : self.options.canvas[group_index]
+ 'title' : group.key,
+ 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
+ 'data' : group.values,
+ 'div' : div
});
}
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.
1
0

commit/galaxy-central: guerler: Charts: Add color combos, fixes for heatmaps
by commits-noreply@bitbucket.org 02 May '14
by commits-noreply@bitbucket.org 02 May '14
02 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/21121d6283a9/
Changeset: 21121d6283a9
User: guerler
Date: 2014-05-03 01:40:37
Summary: Charts: Add color combos, fixes for heatmaps
Affected #: 4 files
diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/config.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/config.js
@@ -17,6 +17,97 @@
value : {
title : 'Observations'
},
+ },
+
+ settings: {
+ color_set : {
+ title : 'Color scheme',
+ info : 'Select a color scheme for your heatmap',
+ type : 'select',
+ init : 'ocean',
+ data : [
+ {
+ label : 'Cold-to-Hot',
+ value : 'hot'
+ },
+ {
+ label : 'Cool',
+ value : 'cool'
+ },
+ {
+ label : 'Copper',
+ value : 'copper'
+ },
+ {
+ label : 'Gebco',
+ value : 'gebco'
+ },
+ {
+ label : 'Globe',
+ value : 'globe'
+ },
+ {
+ label : 'Gray scale',
+ value : 'gray'
+ },
+ {
+ label : 'Haxby',
+ value : 'haxby'
+ },
+ {
+ label : 'Jet',
+ value : 'jet'
+ },
+ {
+ label : 'No-Green',
+ value : 'no_green'
+ },
+ {
+ label : 'Ocean',
+ value : 'ocean'
+ },
+ {
+ label : 'Polar',
+ value : 'polar'
+ },
+ {
+ label : 'Rainbow',
+ value : 'rainbow'
+ },
+ {
+ label : 'Red-to-Green',
+ value : 'redgreen'
+ },
+ {
+ label : 'Red-to-green (saturated)',
+ value : 'red2green'
+ },
+ {
+ label : 'Relief',
+ value : 'relief'
+ },
+ {
+ label : 'Seismograph',
+ value : 'seis'
+ },
+ {
+ label : 'Sealand',
+ value : 'sealand'
+ },
+ {
+ label : 'Split',
+ value : 'split'
+ },
+ {
+ label : 'Topo',
+ value : 'topo'
+ },
+ {
+ label : 'Wysiwyg',
+ value : 'wysiwyg'
+ }
+ ]
+ }
}
};
diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js
@@ -0,0 +1,52 @@
+// dependencies
+define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin'], function(Utils, HeatmapPlugin) {
+
+// color palettes
+var colorSets = {
+ seis: ['#AA0000', '#D00000', '#F70000', '#FF1D00', '#FF4400', '#FF6A00', '#FF9000', '#FFB700', '#FFDD00', '#FFFF00', '#FFFF00', '#FFFF00', '#BDFF0C', '#73FF1A', '#3FFA36', '#16F45A', '#00D08B', '#0087CD', '#0048FA', '#0024E3'],
+
+ sealand: ['#8C66FF', '#6A66FF', '#6684FF', '#66A7FF', '#66CAFF', '#66ECFF', '#66FFF0', '#66FFCE', '#66FFAB', '#66FF88', '#66FF66', '#88FF66', '#ABFF66', '#CEFF66', '#FFEEA6', '#FFD3A6', '#FFB8A6', '#FFAAB0', '#FFB5CB', '#FFC0E1'],
+
+ redgreen: ['#005824', '#1A693B', '#347B53', '#4F8D6B', '#699F83', '#83B09B', '#9EC2B3', '#B8D4CB', '#D2E6E3', '#EDF8FB', '#FFFFFF', '#F1EEF6', '#E6D3E1','#DBB9CD', '#D19EB9', '#C684A4', '#BB6990', '#B14F7C', '#A63467', '#9B1A53', '#91003F'],
+
+ ocean: ['#000000', '#000209', '#000413', '#00061E', '#000728', '#000932', '#002650', '#00426E', '#005E8C', '#007AAA', '#0096C8', '#22A9C2', '#45BCBB', '#67CFB5', '#8AE2AE', '#ACF6A8', '#BCF8B9', '#CBF9CA', '#DBFBDC', '#EBFDED'],
+
+ cool: ['#00FFFF', '#0DF2FF', '#19E6FF', '#26D9FF', '#33CCFF', '#3FBFFF', '#4CB3FF', '#59A6FF', '#6699FF', '#738CFF', '#7F7FFF', '#8C73FF', '#9966FF', '#A659FF', '#B24DFF', '#BF3FFF', '#CC33FF', '#D926FF', '#E619FF', '#F20DFF'],
+
+ copper: ['#000000', '#100906', '#1F130D', '#301E13', '#40281A', '#50321F', '#603C26', '#70462D', '#805033', '#905A3A', '#A06440', '#B06E46', '#C0784D', '#D08253', '#E08C5A', '#F09660', '#FFA066', '#FFAA6D', '#FFB473', '#FFBE7A'],
+
+ gebco: ['#00F0FF', '#00F0FF', '#00F0FF', '#23FFFF', '#23FFFF', '#23FFFF', '#5AFFFF', '#5AFFFF', '#5AFFFF', '#8CFFE6', '#8CFFE6', '#8CFFE6', '#A5FFD7', '#A5FFD7', '#A5FFD7', '#C3FFD7', '#C3FFD7', '#C3FFD7', '#D2FFD7', '#E6FFF0'],
+
+ globe: ['#9900FF', '#9900FF', '#7722FF', '#5544FF', '#3366FF', '#1188FF', '#1BA4FF', '#51BAFF', '#86D0FF', '#BCE6FF', '#336600', '#F3CA89', '#D9A627', '#A49019', '#9F7B0D', '#996600', '#B27676', '#C2B0B0', '#E5E5E5', '#FFFFFF'],
+
+ gray: ['#000000', '#0D0D0D', '#191919', '#262626', '#333333', '#3F3F3F', '#4C4C4C', '#595959', '#666666', '#737373', '#7F7F7F', '#8C8C8C', '#999999', '#A6A6A6', '#B2B2B2', '#BFBFBF', '#CCCCCC', '#D9D9D9', '#E6E6E6', '#F2F2F2'],
+
+ haxby: ['#090079', '#280096', '#0009C8', '#0019D4', '#1A66F0', '#19AFFF', '#32BEFF', '#61E1F0', '#6AECE1', '#8AECAE', '#CDFFA2', '#DFF68D', '#F8D768', '#FFBD57', '#F4754B', '#FF5A5A', '#FF7C7C', '#F6B3AE', '#FFC4C4', '#FFECEC'],
+
+ hot: ['#000000', '#220000', '#440000', '#660000', '#880000', '#AA0000', '#CC0000', '#EE0000', '#FF1100', '#FF3300', '#FF5500', '#FF7700', '#FF9900', '#FFBB00', '#FFDD00', '#FFFF00', '#FFFF33', '#FFFF66', '#FFFF99', '#FFFFCC'],
+
+ jet: ['#00007F', '#0000B2', '#0000E5', '#0019FF', '#004DFF', '#007FFF', '#00B2FF', '#00E5FF', '#FFFFF2', '#FFFFD9', '#FFFFBF', '#FFFFA5', '#FFFF8C', '#FFE500', '#FFB300', '#FF7F00', '#FF4C00', '#FF1900', '#E50000', '#B20000'],
+
+ no_green: ['#1F60FF', '#1F60FF', '#1F9FFF', '#1FBFFF', '#00CFFF', '#2AFFFF', '#2AFFFF', '#55FFFF', '#7FFFFF', '#AAFFFF', '#FFFF54', '#FFFF54', '#FFF000', '#FFBF00', '#FFA800', '#FF8A00', '#FF8A00', '#FF7000', '#FF4D00', '#FF0000'],
+
+ polar: ['#0000FF', '#1919FF', '#3333FF', '#4C4CFF', '#6666FF', '#7F7FFF', '#9999FF', '#B2B2FF', '#CCCCFF', '#E6E6FF', '#FFFFFF', '#FFE5E5', '#FFCCCC', '#FFB2B2', '#FF9999', '#FF7F7F', '#FF6666', '#FF4C4C', '#FF3333', '#FF1A1A'],
+
+ rainbow: ['#FF00FF', '#BF00FF', '#7F00FF', '#3F00FF', '#0000FF', '#003FFF', '#007FFF', '#00BFFF', '#00FFFF', '#00FFBF', '#00FF7F', '#00FF3F', '#00FF00', '#3FFF00', '#7FFF00', '#BFFF00', '#FFFF00', '#FFBF00', '#FF7F00', '#FF3F00'],
+
+ red2green: ['#FF0000', '#FF1919', '#FF3333', '#FF4C4C', '#FF6666', '#FF7F7F', '#FF9999', '#FFB2B2', '#FFCCCC', '#FFE6E6', '#FFFFFF', '#E5FFE5', '#CCFFCC', '#B2FFB2', '#99FF99', '#7FFF7F', '#66FF66', '#4CFF4C', '#33FF33', '#1AFF1A'],
+
+ relief: ['#000000', '#000413', '#000728', '#002650', '#005E8C', '#0096C8', '#45BCBB', '#8AE2AE', '#BCF8B9', '#DBFBDC', '#467832', '#887438', '#B19D48', '#DBC758', '#FAE769', '#FAEB7E', '#FCED93', '#FCF1A7', '#FCF6C1', '#FDFAE0'],
+
+ split: ['#7F7FFF', '#6666E6', '#4D4DCC', '#3333B3', '#1A1A99', '#00007F', '#000066', '#00004D', '#000033', '#00001A', '#000000', '#1A0000', '#330000', '#4D0000', '#660000', '#7F0000', '#991A1A', '#B33333', '#CC4D4D', '#E66666'],
+
+ topo: ['#C977D9', '#A18AE6', '#8AA2E6', '#8BD1E7', '#8AF3CF', '#85F38E', '#BDF385', '#EDE485', '#F0B086', '#DE9F8B', '#74A3B3', '#99CC70', '#DCD68E', '#EDDFAD', '#F7E8CA', '#FFF9F3', '#FFF9F6', '#FFFBF9', '#FFFCFA', '#FFFEFD'],
+
+ wysiwyg: ['#3F003F', '#3F003F', '#3F00BF', '#003FFF', '#00A0FF', '#3FBFFF', '#3FBFFF', '#40E0FF', '#3FFFBF', '#3FFF3F', '#7FFF3F', '#BFFF3F', '#BFFF3F', '#FFE040', '#FFE040', '#FF6040', '#FF1F40', '#FF60C0', '#FFA0FF', '#FFA0FF']
+}
+
+// return
+return {
+ colorSets: colorSets
+}
+
+});
\ No newline at end of file
diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
@@ -1,5 +1,6 @@
// dependencies
-define(['utils/utils'], function(Utils) {
+define(['utils/utils'],
+function(Utils) {
// widget
return Backbone.View.extend(
@@ -30,8 +31,7 @@
right : 10,
bottom : 50,
left : 100
- },
- colors : ['#005824','#1A693B','#347B53','#4F8D6B','#699F83','#83B09B','#9EC2B3','#B8D4CB','#D2E6E3','#EDF8FB','#FFFFFF','#F1EEF6','#E6D3E1','#DBB9CD','#D19EB9','#C684A4','#BB6990','#B14F7C','#A63467','#9B1A53','#91003F']
+ }
},
// initialize
@@ -43,8 +43,8 @@
this.options = Utils.merge(options, this.optionsDefault)
// check requirements
- if (!this.options.data || !this.options.div) {
- console.debug('FAILED - HeatMapPlugin::initialize() - Parameters (container and/or data) missing.');
+ if (!this.options.data || !this.options.div || !this.options.colors) {
+ console.debug('FAILED - HeatMapPlugin::initialize() - Parameters (container and/or data and/or colors) missing.');
return;
}
@@ -221,10 +221,10 @@
// add main group and translate
this.svg = d3.select(this.$el[0]).append('svg')
- .attr("width", width + margin.left + margin.right)
- .attr("height", height + margin.top + margin.bottom)
- .append("g")
- .attr("transform", "translate(" + (container_width - width) / 2 + "," + (container_height - height) / 2 + ")")
+ .attr('width', width + margin.left + margin.right)
+ .attr('height', height + margin.top + margin.bottom)
+ .append('g')
+ .attr('transform', 'translate(' + (container_width - width) / 2 + ',' + (container_height - height) / 2 + ')')
// reset sorting
this.rowSortOrder = false;
@@ -264,35 +264,35 @@
dataRange[dataRangeMax] = this.max;
// create legend
- var legend = this.svg.selectAll(".legend")
+ var legend = this.svg.selectAll('.legend')
.data(dataRange)
- .enter().append("g")
- .attr("class", "legend");
+ .enter().append('g')
+ .attr('class', 'legend');
// add boxes
- legend.append("rect")
- .attr("x", function(d, i) {
+ legend.append('rect')
+ .attr('x', function(d, i) {
return legendCellWidth * i;
})
- .attr("y", height + cellSize)
- .attr("width", legendCellWidth)
- .attr("height", cellSize)
- .style("fill", function(d, i) {
+ .attr('y', height + cellSize)
+ .attr('width', legendCellWidth)
+ .attr('height', cellSize)
+ .style('fill', function(d, i) {
return self.options.colors[i];
});
// add text
- legend.append("text")
- .attr("class", "mono")
+ legend.append('text')
+ .attr('class', 'mono')
.text(function(d) {
return d;
})
- .attr("width", legendCellWidth)
- .attr("x", function(d, i) {
+ .attr('width', legendCellWidth)
+ .attr('x', function(d, i) {
return legendCellWidth * i;
})
- .attr("y", height + cellSize)
- .style("font-size", cellSize + "px");
+ .attr('y', height + cellSize)
+ .style('font-size', cellSize + 'px');
},
// build column labels
@@ -306,36 +306,36 @@
var colLabel = this.colLabel;
// column labels
- var colLabels = this.svg.append("g")
- .selectAll(".colLabelg")
+ var colLabels = this.svg.append('g')
+ .selectAll('.colLabelg')
.data(colLabel)
.enter()
- .append("text")
+ .append('text')
.text(function (d) {
return d;
})
- .attr("x", 0)
- .attr("y", function (d, i) {
+ .attr('x', 0)
+ .attr('y', function (d, i) {
return colIndex.indexOf(i) * cellSize;
})
- .style("font-size", cellSize + "px")
- .style("text-anchor", "left")
- .attr("transform", "translate(" + cellSize / 2 + ", -17) rotate (-90)")
- .attr("class", function (d, i) {
- return "colLabel mono c" + i;
+ .style('font-size', cellSize + 'px')
+ .style('text-anchor', 'left')
+ .attr('transform', 'translate(' + cellSize / 2 + ', -17) rotate (-90)')
+ .attr('class', function (d, i) {
+ return 'colLabel mono c' + i;
})
- .on("mouseover", function(d) {
- d3.select(this).classed("text-hover",true);
- d3.select(this).style("font-size", parseInt(cellSize * 1.3) + "px");
+ .on('mouseover', function(d) {
+ d3.select(this).classed('text-hover',true);
+ d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
- .on("mouseout" , function(d) {
- d3.select(this).classed("text-hover",false);
- d3.select(this).style("font-size", parseInt(cellSize) + "px");
+ .on('mouseout' , function(d) {
+ d3.select(this).classed('text-hover',false);
+ d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
- .on("click", function(d, i) {
+ .on('click', function(d, i) {
self.colSortOrder=!self.colSortOrder;
- self._sortByLabel("c", i, self.colSortOrder);
- d3.select("#order").property("selectedIndex", 4).node().focus();
+ self._sortByLabel('c', i, self.colSortOrder);
+ d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -350,36 +350,36 @@
var rowLabel = this.rowLabel;
// draw labels
- var rowLabels = this.svg.append("g")
- .selectAll(".rowLabelg")
+ var rowLabels = this.svg.append('g')
+ .selectAll('.rowLabelg')
.data(rowLabel)
.enter()
- .append("text")
+ .append('text')
.text(function (d) {
return d;
})
- .attr("x", 0)
- .attr("y", function (d, i) {
+ .attr('x', 0)
+ .attr('y', function (d, i) {
return rowIndex.indexOf(i) * cellSize;
})
- .style("font-size", cellSize + "px")
- .style("text-anchor", "end")
- .attr("transform", "translate(-10," + cellSize / 1.5 + ")")
- .attr("class", function (d, i) {
- return "rowLabel mono r" + i;
+ .style('font-size', cellSize + 'px')
+ .style('text-anchor', 'end')
+ .attr('transform', 'translate(-10,' + cellSize / 1.5 + ')')
+ .attr('class', function (d, i) {
+ return 'rowLabel mono r' + i;
} )
- .on("mouseover", function(d) {
- d3.select(this).classed("text-hover",true);
- d3.select(this).style("font-size", parseInt(cellSize * 1.3) + "px");
+ .on('mouseover', function(d) {
+ d3.select(this).classed('text-hover',true);
+ d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
- .on("mouseout" , function(d) {
- d3.select(this).classed("text-hover",false);
- d3.select(this).style("font-size", parseInt(cellSize) + "px");
+ .on('mouseout' , function(d) {
+ d3.select(this).classed('text-hover',false);
+ d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
- .on("click", function(d, i) {
+ .on('click', function(d, i) {
self.rowSortOrder=!self.rowSortOrder;
- self._sortByLabel("r", i, self.rowSortOrder);
- d3.select("#order").property("selectedIndex", 4).node().focus();
+ self._sortByLabel('r', i, self.rowSortOrder);
+ d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -396,47 +396,47 @@
var colLabel = this.colLabel;
// heat map
- var heatMap = this.svg.append("g").attr("class","g3")
- .selectAll(".cellg")
+ var heatMap = this.svg.append('g').attr('class','g3')
+ .selectAll('.cellg')
.data(self.data, function(d) {
- return d.row_rank + ":" + d.col_rank;
+ return d.row_rank + ':' + d.col_rank;
})
.enter()
- .append("rect")
- .attr("x", function(d) {
+ .append('rect')
+ .attr('x', function(d) {
return colIndex.indexOf(d.col_rank) * cellSize;
})
- .attr("y", function(d) {
+ .attr('y', function(d) {
return rowIndex.indexOf(d.row_rank) * cellSize;
})
- .attr("class", function(d){
- return "cell cell-border cr" + d.row_rank + " cc" + d.col_rank;
+ .attr('class', function(d){
+ return 'cell cell-border cr' + d.row_rank + ' cc' + d.col_rank;
})
- .attr("width", cellSize)
- .attr("height", cellSize)
- .style("fill", function(d) {
+ .attr('width', cellSize)
+ .attr('height', cellSize)
+ .style('fill', function(d) {
return self.colorScale(d.value);
})
- .on("mouseover", function(d){
+ .on('mouseover', function(d){
// highlight text
- d3.select(this).classed("cell-hover",true);
- d3.selectAll(".rowLabel").classed("text-highlight",function(r,ri){ return ri==(d.row_rank);});
- d3.selectAll(".colLabel").classed("text-highlight",function(c,ci){ return ci==(d.col_rank);});
+ d3.select(this).classed('cell-hover',true);
+ d3.selectAll('.rowLabel').classed('text-highlight',function(r,ri){ return ri==(d.row_rank);});
+ d3.selectAll('.colLabel').classed('text-highlight',function(c,ci){ return ci==(d.col_rank);});
// update the tooltip position and value
- d3.select("#heatmap-tooltip")
- .style("left", (d3.event.pageX+10) + "px")
- .style("top", (d3.event.pageY-10) + "px")
- .select("#value")
- .text("Label: " + rowLabel[d.row_rank] + " | " + colLabel[d.col_rank] + ", Value: " + d.value);
+ d3.select('#heatmap-tooltip')
+ .style('left', (d3.event.pageX+10) + 'px')
+ .style('top', (d3.event.pageY-10) + 'px')
+ .select('#value')
+ .text('Label: ' + rowLabel[d.row_rank] + ' | ' + colLabel[d.col_rank] + ', Value: ' + d.value);
// show the tooltip
- d3.select("#heatmap-tooltip").classed("hidden", false);
+ d3.select('#heatmap-tooltip').classed('hidden', false);
})
- .on("mouseout", function(){
- d3.select(this).classed("cell-hover",false);
- d3.selectAll(".rowLabel").classed("text-highlight",false);
- d3.selectAll(".colLabel").classed("text-highlight",false);
- d3.select("#heatmap-tooltip").classed("hidden", true);
+ .on('mouseout', function(){
+ d3.select(this).classed('cell-hover',false);
+ d3.selectAll('.rowLabel').classed('text-highlight',false);
+ d3.selectAll('.colLabel').classed('text-highlight',false);
+ d3.select('#heatmap-tooltip').classed('hidden', true);
});
},
@@ -450,7 +450,7 @@
// collect cells
var cells=[];
- t.selectAll(".c" + rORc + i)
+ t.selectAll('.c' + rORc + i)
.filter(function(ce){
cells.push(ce);
});
@@ -465,7 +465,7 @@
});
// rows or columns
- if(rORc == "r") {
+ if(rORc == 'r') {
// get sorted key list
var sorted = [];
for (var i in cells) {
@@ -473,14 +473,14 @@
}
// sort cells
- t.selectAll(".cell")
- .attr("x", function(d) {
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return sorted.indexOf(d.col_rank) * cellSize;
});
// sort labels
- t.selectAll(".colLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function (d, i) {
return sorted.indexOf(i) * cellSize;
});
} else {
@@ -491,14 +491,14 @@
}
// sort cells
- t.selectAll(".cell")
- .attr("y", function(d) {
+ t.selectAll('.cell')
+ .attr('y', function(d) {
return sorted.indexOf(d.row_rank) * cellSize;
});
// sort labels
- t.selectAll(".rowLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function (d, i) {
return sorted.indexOf(i) * cellSize;
});
}
@@ -518,60 +518,60 @@
// set duration / select element
var t = this.svg.transition().duration(this.options.pace);
- if(value=="hclust"){
- t.selectAll(".cell")
- .attr("x", function(d) {
+ if(value=='hclust'){
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return colIndex.indexOf(d.col_rank) * cellSize;
})
- .attr("y", function(d) {
+ .attr('y', function(d) {
return rowIndex.indexOf(d.row_rank) * cellSize;
});
- t.selectAll(".rowLabel")
- .attr("y", function(d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function(d, i) {
return rowIndex.indexOf(i) * cellSize;
});
- t.selectAll(".colLabel")
- .attr("y", function(d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function(d, i) {
return colIndex.indexOf(i) * cellSize;
});
- } else if (value=="byboth") {
- t.selectAll(".cell")
- .attr("x", function(d) {
+ } else if (value=='byboth') {
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return d.col_rank * cellSize;
})
- .attr("y", function(d) {
+ .attr('y', function(d) {
return d.row_rank * cellSize;
});
- t.selectAll(".rowLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
- t.selectAll(".colLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
- } else if (value=="byrow") {
- t.selectAll(".cell")
- .attr("y", function(d) {
+ } else if (value=='byrow') {
+ t.selectAll('.cell')
+ .attr('y', function(d) {
return d.row_rank * cellSize;
});
- t.selectAll(".rowLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
- } else if (value=="bycol"){
- t.selectAll(".cell")
- .attr("x", function(d) {
+ } else if (value=='bycol'){
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return d.col_rank * cellSize;
});
- t.selectAll(".colLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
}
@@ -582,35 +582,35 @@
//
// selection
//
- var sa=d3.select(".g3")
- .on("mousedown", function() {
+ var sa=d3.select('.g3')
+ .on('mousedown', function() {
if( !d3.event.altKey) {
- d3.selectAll(".cell-selected").classed("cell-selected", false);
- d3.selectAll(".rowLabel").classed("text-selected", false);
- d3.selectAll(".colLabel").classed("text-selected", false);
+ d3.selectAll('.cell-selected').classed('cell-selected', false);
+ d3.selectAll('.rowLabel').classed('text-selected', false);
+ d3.selectAll('.colLabel').classed('text-selected', false);
}
var p = d3.mouse(this);
- sa.append("rect")
+ sa.append('rect')
.attr({
rx : 0,
ry : 0,
- class : "selection",
+ class : 'selection',
x : p[0],
y : p[1],
width : 1,
height : 1
})
})
- .on("mousemove", function() {
- var s = sa.select("rect.selection");
+ .on('mousemove', function() {
+ var s = sa.select('rect.selection');
if(!s.empty()) {
var p = d3.mouse(this),
d = {
- x : parseInt(s.attr("x"), 10),
- y : parseInt(s.attr("y"), 10),
- width : parseInt(s.attr("width"), 10),
- height : parseInt(s.attr("height"), 10)
+ x : parseInt(s.attr('x'), 10),
+ y : parseInt(s.attr('y'), 10),
+ width : parseInt(s.attr('width'), 10),
+ height : parseInt(s.attr('height'), 10)
},
move = {
x : p[0] - d.x,
@@ -633,46 +633,46 @@
s.attr(d);
// deselect all temporary selected state objects
- d3.selectAll(".cell-selection.cell-selected").classed("cell-selected", false);
- d3.selectAll(".text-selection.text-selected").classed("text-selected",false);
- d3.selectAll(".cell").filter(function(cell_d, i) {
- if(!d3.select(this).classed("cell-selected") &&
+ d3.selectAll('.cell-selection.cell-selected').classed('cell-selected', false);
+ d3.selectAll('.text-selection.text-selected').classed('text-selected',false);
+ d3.selectAll('.cell').filter(function(cell_d, i) {
+ if(!d3.select(this).classed('cell-selected') &&
// inner circle inside selection frame
(this.x.baseVal.value)+cellSize >= d.x && (this.x.baseVal.value)<=d.x+d.width &&
(this.y.baseVal.value)+cellSize >= d.y && (this.y.baseVal.value)<=d.y+d.height)
{
d3.select(this)
- .classed("cell-selection", true)
- .classed("cell-selected", true);
+ .classed('cell-selection', true)
+ .classed('cell-selected', true);
- d3.select(".r"+(cell_d.row_rank))
- .classed("text-selection",true)
- .classed("text-selected",true);
+ d3.select('.r'+(cell_d.row_rank))
+ .classed('text-selection',true)
+ .classed('text-selected',true);
- d3.select(".c"+(cell_d.col_rank))
- .classed("text-selection",true)
- .classed("text-selected",true);
+ d3.select('.c'+(cell_d.col_rank))
+ .classed('text-selection',true)
+ .classed('text-selected',true);
}
});
}
})
- .on("mouseup", function() {
+ .on('mouseup', function() {
// remove selection frame
- sa.selectAll("rect.selection").remove();
+ sa.selectAll('rect.selection').remove();
// remove temporary selection marker class
- d3.selectAll(".cell-selection").classed("cell-selection", false);
- d3.selectAll(".text-selection").classed("text-selection",false);
+ d3.selectAll('.cell-selection').classed('cell-selection', false);
+ d3.selectAll('.text-selection').classed('text-selection', false);
})
- .on("mouseout", function() {
+ .on('mouseout', function() {
if(d3.event.relatedTarget.tagName=='html') {
// remove selection frame
- sa.selectAll("rect.selection").remove();
+ sa.selectAll('rect.selection').remove();
// remove temporary selection marker class
- d3.selectAll(".cell-selection").classed("cell-selection", false);
- d3.selectAll(".rowLabel").classed("text-selected",false);
- d3.selectAll(".colLabel").classed("text-selected",false);
+ d3.selectAll('.cell-selection').classed('cell-selection', false);
+ d3.selectAll('.rowLabel').classed('text-selected',false);
+ d3.selectAll('.colLabel').classed('text-selected',false);
}
});
},
diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
@@ -1,5 +1,6 @@
// dependencies
-define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin'], function(Utils, HeatmapPlugin) {
+define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin', 'plugin/charts/heatmap/heatmap-parameters'],
+function(Utils, HeatmapPlugin, HeatmapParameters) {
// widget
return Backbone.View.extend(
@@ -24,8 +25,9 @@
// draw plot
var heatmap = new HeatmapPlugin({
- 'data' : group.values,
- 'div' : self.options.canvas[group_index]
+ 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
+ 'data' : group.values,
+ 'div' : self.options.canvas[group_index]
});
}
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.
1
0