galaxy-commits
Threads by month
- ----- 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
June 2014
- 1 participants
- 233 discussions
commit/galaxy-central: guerler: Charts: Add custom heatmap, unify chart configuration
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/79ddd419dd50/
Changeset: 79ddd419dd50
User: guerler
Date: 2014-06-14 01:04:41
Summary: Charts: Add custom heatmap, unify chart configuration
Affected #: 29 files
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/app.css
--- a/config/plugins/visualizations/charts/static/app.css
+++ b/config/plugins/visualizations/charts/static/app.css
@@ -48,7 +48,7 @@
margin-left: 5px;
top: -1px;
font-size: 1.0em;
- display: inline-block;
+ display: inline;
}
.charts-viewport .icon {
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/forms/default.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/forms/default.js
@@ -0,0 +1,266 @@
+define([], function() {
+
+return {
+ title : '',
+ category : '',
+ library : '',
+ tag : '',
+ keywords : '',
+ query_limit : 0,
+ settings : {
+ separator_x : {
+ title : 'X axis',
+ type : 'separator'
+ },
+ x_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'X-axis',
+ placeholder : 'Axis label'
+ },
+ x_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ operations : {
+ hide : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ operations : {
+ hide : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ operations : {
+ hide : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ }
+ ]
+ },
+ x_axis_precision : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_y : {
+ title : 'Y axis',
+ type : 'separator'
+ },
+ y_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'Y-axis',
+ placeholder : 'Axis label'
+ },
+ y_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ operations : {
+ hide : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ operations : {
+ hide : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ operations : {
+ hide : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ }
+ ]
+ },
+ y_axis_precision : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_legend : {
+ title : 'Others',
+ type : 'separator'
+ },
+ show_legend : {
+ title : 'Show legend',
+ info : 'Would you like to add a legend?',
+ type : 'radiobutton',
+ init : 'true',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ },
+ use_panels : {
+ title : 'Use multi-panels',
+ info : 'Would you like to separate your data into individual panels?',
+ type : 'radiobutton',
+ init : 'false',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/jqplot/common/config.js
--- a/config/plugins/visualizations/charts/static/charts/jqplot/common/config.js
+++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/config.js
@@ -1,108 +1,21 @@
-define([], function() {
+define(['plugin/charts/forms/default'], function(config_default) {
-return {
+return $.extend(true, {}, config_default, {
title : '',
category : '',
- library : 'JqPlot',
+ library : 'jqPlot',
tag : 'div',
- keywords : 'default medium',
+ zoomable : true,
+ keywords : 'medium',
query_limit : 10000,
settings : {
- separator_label : {
- title : 'X axis',
+ separator_grid : {
+ title : 'Grids',
type : 'separator'
},
- x_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'X-axis',
- placeholder : 'Axis label'
- },
- x_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['x_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['x_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['x_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['x_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['x_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['x_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['x_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['x_axis_tick']
- }
- ]
- },
- x_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
x_axis_grid : {
title : 'Axis grid',
- info : 'Would you like to show grid lines for this axis?',
+ info : 'Would you like to show grid lines for the X axis?',
type : 'radiobutton',
init : 'false',
data : [
@@ -116,101 +29,9 @@
}
]
},
- separator_tick : {
- title : 'Y axis',
- type : 'separator'
- },
- y_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'Y-axis',
- placeholder : 'Axis label'
- },
- y_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['y_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['y_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['y_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['y_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['y_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['y_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['y_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['y_axis_tick']
- }
- ]
- },
- y_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
y_axis_grid : {
title : 'Axis grid',
- info : 'Would you like to show grid lines for this axis?',
+ info : 'Would you like to show grid lines for the Y axis?',
type : 'radiobutton',
init : 'true',
data : [
@@ -223,44 +44,8 @@
value : 'false'
}
]
- },
- separator_legend : {
- title : 'Others',
- type : 'separator'
- },
- show_legend : {
- title : 'Show legend',
- info : 'Would you like to add a legend?',
- type : 'radiobutton',
- init : 'true',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
- },
- use_panels : {
- title : 'Use multi-panels',
- info : 'Would you like to separate your data into individual panels?',
- type : 'radiobutton',
- init : 'false',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
}
}
-};
+});
});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js
@@ -54,7 +54,7 @@
this._makeAxes(groups, plot_config, chart.settings);
// make custom series call
- if (makeSeries) {
+ if (makeSeriesLabels) {
plot_config.series = makeSeriesLabels(groups, plot_config);
} else {
plot_config.series = this._makeSeriesLabels(groups);
@@ -92,7 +92,6 @@
var plot = drawGraph();
// catch window resize event
- var self = this;
$(window).on('resize', function () {
drawGraph();
});
@@ -126,41 +125,21 @@
categories = Tools.makeCategories(groups);
}
- // make axis
+ // make axes
function makeAxis (id) {
- var axis = plot_config.axes[id + 'axis'].tickOptions;
- var type = settings.get(id + '_axis_type');
- var tick = settings.get(id + '_axis_tick');
- var is_category = categories.array[id];
-
- // hide axis
- if (type == 'hide') {
- axis.formatter = function(format, value) { return '' };
- return;
- }
-
- // format values/labels
- if (type == 'auto') {
- if (is_category) {
- axis.formatter = function(format, value) {
- return categories.array[id][value] || '';
- };
- }
- } else {
- var formatter = d3.format(tick + type);
- if (is_category) {
- axis.formatter = function(format, value) {
- return formatter(categories.array[id][value]);
- };
- } else {
- axis.formatter = function(format, value) {
- return formatter(value);
+ Tools.makeAxis({
+ categories : categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ plot_config.axes[id + 'axis'].tickOptions.formatter = function(format, value) {
+ return formatter(value);
+ };
}
}
- }
+ });
};
-
- // make axes
makeAxis('x');
makeAxis('y');
},
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/config.js
@@ -3,7 +3,6 @@
return $.extend(true, {}, nvd3_config, {
title : 'Horizontal',
category : 'Bar diagrams',
- keywords : 'default small',
settings : {
x_axis_type : {
init : 'hide'
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/config.js
@@ -3,7 +3,6 @@
return $.extend(true, {}, nvd3_config, {
title : 'Stacked horizontal',
category : 'Bar diagrams',
- keywords : 'default small',
settings : {
x_axis_type : {
init : 'hide'
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/config.js
@@ -3,7 +3,6 @@
return $.extend(true, {}, nvd3_config, {
title : 'Stacked',
category : 'Bar diagrams',
- keywords : 'default small',
columns : {
x : {
title : 'Values for x-axis',
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/common/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/common/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/common/config.js
@@ -1,234 +1,11 @@
-define(['plugin/plugins/nvd3/nv.d3'], function() {
-
-return {
+define(['plugin/charts/forms/default', 'plugin/plugins/nvd3/nv.d3'], function(config_default) {
+return $.extend(true, {}, config_default, {
title : '',
category : '',
library : 'NVD3',
tag : 'svg',
keywords : 'small',
- query_limit : 500,
- settings : {
- separator_label : {
- title : 'X axis',
- type : 'separator'
- },
- x_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'X-axis',
- placeholder : 'Axis label'
- },
- x_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['x_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['x_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['x_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['x_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['x_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['x_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['x_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['x_axis_tick']
- }
- ]
- },
- x_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
- separator_tick : {
- title : 'Y axis',
- type : 'separator'
- },
- y_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'Y-axis',
- placeholder : 'Axis label'
- },
- y_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['y_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['y_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['y_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['y_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['y_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['y_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['y_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['y_axis_tick']
- }
- ]
- },
- y_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
- separator_legend : {
- title : 'Others',
- type : 'separator'
- },
- show_legend : {
- title : 'Show legend',
- info : 'Would you like to add a legend?',
- type : 'radiobutton',
- init : 'true',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
- },
- use_panels : {
- title : 'Use multi-panels',
- info : 'Would you like to separate your data into individual panels?',
- type : 'radiobutton',
- init : 'false',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
- }
- }
-};
+ query_limit : 500
+});
});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
@@ -173,39 +173,21 @@
// result
var categories = Tools.makeCategories(groups);
- // make axis
+ // make axes
function makeAxis (id) {
- var axis = d3chart[id + 'Axis'];
- var type = settings.get(id + '_axis_type');
- var tick = settings.get(id + '_axis_tick');
- var is_category = categories.array[id];
-
- // hide axis
- if (type == 'hide') {
- axis.tickFormat(function() { return '' });
- return;
- }
-
- // format values/labels
- if (type == 'auto') {
- if (is_category) {
- axis.tickFormat(function(value) {
- return categories.array[id][value]
- });
+ Tools.makeAxis({
+ categories : categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ d3chart[id + 'Axis'].tickFormat(function(value) {
+ return formatter(value);
+ });
+ }
}
- } else {
- var formatter = d3.format(tick + type);
- if (is_category) {
- axis.tickFormat(function(value) {
- return formatter(categories.array[id][value]);
- });
- } else {
- axis.tickFormat(formatter);
- }
- }
+ });
};
-
- // make axes
makeAxis('x');
makeAxis('y');
},
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/histogram/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/histogram/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/histogram/config.js
@@ -21,7 +21,7 @@
y_axis_type : {
init : 'f'
},
- y_axis_tick : {
+ y_axis_precision : {
init : '.2'
}
}
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/config.js
@@ -21,7 +21,7 @@
y_axis_type : {
init : 'f'
},
- y_axis_tick : {
+ y_axis_precision : {
init : '.2'
}
}
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/line_focus/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/config.js
@@ -3,7 +3,7 @@
return $.extend(true, {}, nvd3_config, {
title : 'Line with focus',
category : 'Others',
- keywords : 'default small',
+ zoomable : true,
columns : {
x : {
title : 'Values for x-axis',
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/pie/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/pie/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/pie/config.js
@@ -5,8 +5,7 @@
category : 'Area charts',
library : 'NVD3',
tag : 'svg',
- keywords : 'default small',
- use_panels : true,
+ keywords : 'small',
columns : {
label : {
title : 'Labels',
@@ -20,21 +19,9 @@
},
settings : {
- show_legend : {
- title : 'Show legend',
- info : 'Would you like to add a legend?',
- type : 'select',
- init : 'false',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
+ main_separator : {
+ type : 'separator',
+ title : 'Pie chart settings'
},
donut_ratio : {
@@ -61,6 +48,23 @@
}
]
},
+
+ show_legend : {
+ title : 'Show legend',
+ info : 'Would you like to add a legend?',
+ type : 'radiobutton',
+ init : 'false',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ },
label_separator : {
type : 'separator',
@@ -99,7 +103,7 @@
label_outside : {
title : 'Show outside',
info : 'Would you like to show labels outside the donut?',
- type : 'select',
+ type : 'radiobutton',
init : 'false',
data : [
{
@@ -111,6 +115,11 @@
value : 'false'
}
]
+ },
+
+ use_panels : {
+ init : 'true',
+ hide : true
}
}
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
@@ -0,0 +1,31 @@
+define(['plugin/charts/forms/default'], function(config_default) {
+
+return $.extend(true, {}, config_default, {
+ title : 'Heat map',
+ //execute : 'heatmap',
+ category : 'Others',
+ query_limit : 5,
+ library : 'Custom',
+ tag : 'div',
+ keywords : 'small',
+ columns : {
+ x : {
+ title : 'Column labels',
+ is_label : true,
+ is_numeric : true,
+ is_unique : true
+ },
+ y : {
+ title : 'Row labels',
+ is_label : true,
+ is_numeric : true,
+ is_unique : true
+ },
+ z : {
+ title : 'Observation',
+ is_numeric : true
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/others/heatmap/logo.png
Binary file config/plugins/visualizations/charts/static/charts/others/heatmap/logo.png has changed
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
@@ -0,0 +1,272 @@
+// dependencies
+define(['plugin/charts/tools'], function(Tools) {
+
+// widget
+return Backbone.View.extend({
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary) {
+ var self = this;
+ var plot = Tools.panelHelper({
+ app : this.app,
+ canvas_list : this.options.canvas_list,
+ process_id : process_id,
+ chart : chart,
+ request_dictionary : request_dictionary,
+ render : function(canvas_id, groups) {
+ return self.render(canvas_id, groups)
+ }
+ });
+ },
+
+ // render
+ render : function(canvas_id, groups) {
+ // collect parameters
+ this.canvas_id = canvas_id;
+ this.data = groups[0].values;
+ this.color_set = ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58'];
+
+ // result
+ var categories = Tools.makeUniqueCategories(groups);
+
+ // get limits
+ this.xMax = d3.max(this.data, function(d) { return d.x; });
+ this.yMax = d3.max(this.data, function(d) { return d.y; });
+ this.zMax = d3.max(this.data, function(d) { return d.z; });
+
+ //
+ // domains/scales
+ //
+ this.xScale = d3.scale.linear().domain([0, this.xMax]);
+ this.yScale = d3.scale.linear().domain([0, this.yMax]);
+ this.zScale = d3.scale.ordinal().domain([0, this.zMax]);
+
+ // refresh on window resize
+ var self = this;
+ $(window).on('resize', function () {
+ self.redraw();
+ });
+
+ // draw
+ this.redraw();
+
+ // add zoom
+ this._addZoom();
+
+ // return
+ return true;
+ },
+
+ // redraw
+ redraw: function() {
+ // get parameters
+ var chart = this.options.chart;
+ var type = this.options.type;
+ var data = this.data;
+ var color_set = this.color_set;
+ var self = this;
+
+ // get/reset container
+ var container = $('#' + this.canvas_id);
+ container.empty();
+
+ // set margin and heights
+ var margin = {top: 20, right: 90, bottom: 90, left: 100},
+ width = parseInt(container.width()) - margin.left - margin.right,
+ height = parseInt(container.height()) - margin.top - margin.bottom;
+
+ //
+ // create svg
+ //
+ var svg = d3.select('#' + this.canvas_id)
+ .append('svg')
+ .attr('width', width + margin.left + margin.right)
+ .attr('height', height + margin.top + margin.bottom)
+ .append('g')
+ .attr('class', 'heatmap')
+ .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
+
+ //
+ // set range
+ //
+ this.xScale.range([0, width]);
+ this.yScale.range([height, 0]);
+ this.zScale.range(color_set);
+
+ // get domain
+ var xDomain = this.xScale.domain();
+ var yDomain = this.yScale.domain();
+
+ //
+ // draw boxes
+ //
+ // get box properties
+ var rowCount = this.yScale.domain()[1] - this.yScale.domain()[0],
+ colCount = this.xScale.domain()[1] - this.xScale.domain()[0],
+ boxWidth = Math.max(1, Math.min(Math.floor(width / colCount), 20)),
+ boxHeight = Math.max(1, Math.min(Math.floor(height / rowCount), 20));
+
+ // box location
+ function _locator(d) {
+ return 'translate(' + self.xScale(d.x) + ',' + self.yScale(d.y) + ')';
+ };
+
+ // box color
+ function _color (d) {
+ return self.zScale(d.z);
+ };
+
+ // clip path
+ var clip = svg.append('clipPath')
+ .attr('id', 'clip')
+ .append('rect')
+ .attr('x', 0)
+ .attr('y', boxHeight)
+ .attr('width', width)
+ .attr('height', height);
+
+ // create chart area
+ var chartBody = svg.append('g')
+ .attr('clip-path', 'url(#clip)');
+
+ // add boxes to chart area
+ var boxes = chartBody.selectAll('g.box-group').data(data, function(d, i) {
+ return d.x + '\0' + d.y;
+ });
+ var gEnter = boxes.enter().append('g')
+ .attr('class', 'box-group');
+ gEnter.append('rect')
+ .attr('class','heat-box')
+ .attr('fill', 'red');
+ boxes.selectAll('rect')
+ .attr('rx', 2)
+ .attr('ry', 2)
+ .attr('fill', _color)
+ .attr('width', boxWidth)
+ .attr('height', boxHeight)
+ .attr('transform', _locator);
+ boxes.exit().remove();
+
+ // draw x axis
+ this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
+ this.xAxis.tickValues(d3.range(xDomain[0], xDomain[1], 1));
+ this.gxAxis = svg.append('g')
+ .attr('class', 'x axis')
+ .style('stroke-width', 0)
+ .attr('transform', 'translate(0,' + (height + margin.top + boxHeight) + ')')
+ .call(this.xAxis);
+
+ // draw y axis
+ this.yAxis = d3.svg.axis().scale(this.yScale).orient('left');
+ this.yAxis.tickValues(d3.range(yDomain[0], yDomain[1], 1));
+ this.gyAxis = svg.append('g')
+ .attr('class', 'y axis')
+ .style('stroke-width', 0)
+ .call(this.yAxis);
+
+ // fix text
+ var xFontSize = Math.min(boxWidth, 12);
+ this.gxAxis.selectAll('text')
+ .style({'font-family': 'Courier New', 'font-size': xFontSize + 'px'})
+ .attr('transform', 'rotate(-90)')
+ .attr('y', (boxWidth-xFontSize)/2);
+
+ // fix text
+ var yFontSize = Math.min(boxHeight, 12);
+ this.gyAxis.selectAll('text')
+ .style({'font-family': 'Courier New', 'font-size': yFontSize + 'px'})
+ .attr('y', -boxHeight/2 + boxHeight);
+ },
+
+ // add zoom handler
+ _addZoom: function() {
+ // link this
+ var self = this;
+
+ // min/max boundaries
+ var x_boundary = this.xScale.domain().slice();
+ var y_boundary = this.yScale.domain().slice();
+
+ // create d3 zoom handler
+ var d3zoom = d3.behavior.zoom();
+
+ // fix domain
+ function fixDomain(domain, boundary) {
+ domain[0] = parseInt(domain[0]);
+ domain[1] = parseInt(domain[1]);
+ domain[0] = Math.max(domain[0], boundary[0]);
+ domain[1] = Math.max(0, Math.min(domain[1], boundary[1]));
+ return domain;
+ };
+
+ // zoom event handler
+ function zoomed() {
+ var yDomain = fixDomain(self.yScale.domain(), y_boundary);
+ if (Math.abs(yDomain[1]-yDomain[0]) > 30) {
+ self.yScale.domain(yDomain);
+ self.gyAxis.call(self.yAxis);
+ }
+ var xDomain = fixDomain(self.xScale.domain(), x_boundary);
+ if (Math.abs(xDomain[1]-xDomain[0]) > 30) {
+ self.xScale.domain(xDomain);
+ self.gxAxis.call(self.xAxis);
+ }
+ self.redraw();
+ };
+
+ // zoom event handler
+ function unzoomed() {
+ self.xScale.domain(x_boundary);
+ self.yScale.domain(y_boundary);
+ self.redraw();
+ d3zoom.scale(1);
+ d3zoom.translate([0,0]);
+ };
+
+ // initialize wrapper
+ d3zoom.x(this.xScale)
+ .y(this.yScale)
+ .scaleExtent([1, 10])
+ .on('zoom', zoomed);
+
+ // clip edges
+ //svg.clipEdge(true);
+
+ // add handler
+ var svg = d3.select('#' + this.canvas_id);
+ svg.call(d3zoom).on('dblclick.zoom', unzoomed);
+ },
+
+ // create axes formatting
+ _makeAxes: function(d3chart, settings) {
+ // make axes
+ function makeAxis (id) {
+ Tools.makeAxis({
+ categories : categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ d3chart[id + 'Axis']().tickFormat(function(value) {
+ return formatter(value);
+ });
+ }
+ }
+ });
+ };
+ //makeAxis('x');
+ //makeAxis('y');
+ },
+
+ // handle error
+ _handleError: function(chart, err) {
+ chart.state('failed', err);
+ }
+});
+
+});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/tools.js
--- a/config/plugins/visualizations/charts/static/charts/tools.js
+++ b/config/plugins/visualizations/charts/static/charts/tools.js
@@ -246,14 +246,63 @@
counter : counter
}
};
+
+// make axis
+function makeAxis (options) {
+ var type = options.type;
+ var precision = options.precision;
+ var categories = options.categories;
+ var formatter = options.formatter;
+ // hide axis
+ if (type == 'hide') {
+ formatter(function() { return '' });
+ return;
+ }
+
+ // format values/labels
+ if (type == 'auto') {
+ if (categories) {
+ formatter(function(value) {
+ return categories[value] || '';
+ });
+ }
+ } else {
+ var d3format = d3.format(precision + type);
+ if (categories) {
+ formatter(function(value) {
+ var label = categories[value];
+ if (label) {
+ if (isNaN(label)) {
+ return label;
+ } else {
+ try {
+ return d3format(label);
+ } catch (err) {
+ return label;
+ }
+ }
+ } else {
+ return '';
+ }
+ });
+ } else {
+ formatter(function(value) {
+ return d3format(value);
+ });
+ }
+ }
+};
+
// return
return {
- panelHelper : panelHelper,
- makeCategories : makeCategories,
- makeSeries : makeSeries,
- getDomains : getDomains,
- mapCategories : mapCategories
+ panelHelper : panelHelper,
+ makeCategories : makeCategories,
+ makeUniqueCategories : makeUniqueCategories,
+ makeSeries : makeSeries,
+ getDomains : getDomains,
+ mapCategories : mapCategories,
+ makeAxis : makeAxis
}
});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/types.js
--- a/config/plugins/visualizations/charts/static/charts/types.js
+++ b/config/plugins/visualizations/charts/static/charts/types.js
@@ -15,7 +15,8 @@
'plugin/charts/jqplot/bar/config',
'plugin/charts/jqplot/line/config',
'plugin/charts/jqplot/scatter/config',
- 'plugin/charts/jqplot/boxplot/config'
+ 'plugin/charts/jqplot/boxplot/config',
+ 'plugin/charts/others/heatmap/config'
], function(nvd3_bar,
nvd3_bar_stacked,
nvd3_bar_horizontal,
@@ -32,7 +33,8 @@
jqplot_bar,
jqplot_line,
jqplot_scatter,
- jqplot_boxplot
+ jqplot_boxplot,
+ others_heatmap
) {
// widget
@@ -56,7 +58,8 @@
'nvd3_histogram_discrete' : nvd3_histogram_discrete,
'jqplot_line' : jqplot_line,
'jqplot_scatter' : jqplot_scatter,
- 'jqplot_boxplot' : jqplot_boxplot
+ 'jqplot_boxplot' : jqplot_boxplot,
+ 'others_heatmap' : others_heatmap
}
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/library/ui-table-form.js
--- a/config/plugins/visualizations/charts/static/library/ui-table-form.js
+++ b/config/plugins/visualizations/charts/static/library/ui-table-form.js
@@ -97,13 +97,14 @@
// find selected dictionary
var dict = _.findWhere(settings_def.data, {value: value});
- if (dict) {
- for (var i in dict.show) {
- var target = dict.show[i];
+ if (dict && dict.operations) {
+ var operations = dict.operations;
+ for (var i in operations.show) {
+ var target = operations.show[i];
self.table.get(target).show();
}
- for (var i in dict.hide) {
- var target = dict.hide[i];
+ for (var i in operations.hide) {
+ var target = operations.hide[i];
self.table.get(target).hide();
}
}
@@ -122,13 +123,14 @@
// find selected dictionary
var dict = _.findWhere(settings_def.data, {value: value});
- if (dict) {
- for (var i in dict.show) {
- var target = dict.show[i];
+ if (dict && dict.operations) {
+ var operations = dict.operations;
+ for (var i in operations.show) {
+ var target = operations.show[i];
self.table.get(target).show();
}
- for (var i in dict.hide) {
- var target = dict.hide[i];
+ for (var i in operations.hide) {
+ var target = operations.hide[i];
self.table.get(target).hide();
}
}
@@ -226,6 +228,11 @@
// add to table
this.table.append(id);
+
+ // show/hide
+ if (settings_def.hide) {
+ this.table.get(id).hide();
+ }
}
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/views/editor.js
--- a/config/plugins/visualizations/charts/static/views/editor.js
+++ b/config/plugins/visualizations/charts/static/views/editor.js
@@ -207,7 +207,7 @@
this.chart.groups.each(function(group) {
var title = group.get('key', '');
if (title == '') {
- title = 'Chart data';
+ title = 'Data label';
}
self.tabs.title(group.id, ++counter + ': ' + title);
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/views/types.js
--- a/config/plugins/visualizations/charts/static/views/types.js
+++ b/config/plugins/visualizations/charts/static/views/types.js
@@ -138,10 +138,19 @@
// add chart types
for (var id in this.categories[category]) {
+ // get type
var type = this.categories[category][id];
+
+ // make title
+ var title = type.title + ' (' + type.library + ')';
+ if (type.zoomable) {
+ title = '<span class="fa fa-search-plus"/>' + title;
+ }
+
+ // append type to screen
$el.append(Utils.wrap(this._template_item({
id : id,
- title : type.title + ' (' + type.library + ')',
+ title : title,
url : config.app_root + 'charts/' + this.app.chartPath(id) + '/logo.png'
})));
}
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/templates/charts.mako
--- a/config/plugins/visualizations/charts/templates/charts.mako
+++ b/config/plugins/visualizations/charts/templates/charts.mako
@@ -29,6 +29,9 @@
${h.javascript_link( app_root + "plugins/jqplot/jquery.jqplot.js" )}
${h.javascript_link( app_root + "plugins/jqplot/jquery.jqplot.plugins.js" )}
+ ## dc
+ ${h.javascript_link( app_root + "plugins/dc/crossfilter.js" )}
+
## load merged/minified code
${h.javascript_link( app_root + "build-app.js" )}
@@ -61,12 +64,13 @@
require.config({
baseUrl: config.root + "static/scripts/",
paths: {
- "plugin" : "${app_root}"
+ "plugin" : "${app_root}",
+ "d3" : "libs/d3"
},
shim: {
"libs/underscore": { exports: "_" },
"libs/backbone/backbone": { exports: "Backbone" },
- "d3": { exports: "d3"},
+ "d3": { exports: "d3"}
}
});
This diff is so big that we needed to truncate the remainder.
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: davebgx: Fetch eggs after initializing sample files, per John Chilton's comment.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4bcc1949021b/
Changeset: 4bcc1949021b
User: davebgx
Date: 2014-06-13 23:32:51
Summary: Fetch eggs after initializing sample files, per John Chilton's comment.
Affected #: 1 file
diff -r fb4ac45f7827a92fa637899fb5da43a350bc857b -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 scripts/common_startup.sh
--- a/scripts/common_startup.sh
+++ b/scripts/common_startup.sh
@@ -8,19 +8,6 @@
[ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0
[ "$arg" = "--skip-samples" ] && COPY_SAMPLE_FILES=0
done
-if [ $FETCH_EGGS -eq 1 ]; then
- python ./scripts/check_eggs.py -q
- if [ $? -ne 0 ]; then
- echo "Some eggs are out of date, attempting to fetch..."
- python ./scripts/fetch_eggs.py
- if [ $? -eq 0 ]; then
- echo "Fetch successful."
- else
- echo "Fetch failed."
- exit 1
- fi
- fi
-fi
SAMPLES="
tool_shed_wsgi.ini.sample
@@ -60,4 +47,17 @@
fi
done
fi
-
+
+if [ $FETCH_EGGS -eq 1 ]; then
+ python ./scripts/check_eggs.py -q
+ if [ $? -ne 0 ]; then
+ echo "Some eggs are out of date, attempting to fetch..."
+ python ./scripts/fetch_eggs.py
+ if [ $? -eq 0 ]; then
+ echo "Fetch successful."
+ else
+ echo "Fetch failed."
+ exit 1
+ fi
+ fi
+fi
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/c74d749979cd/
Changeset: c74d749979cd
User: jmchilton
Date: 2014-06-13 22:45:41
Summary: Rollback UI commit - not quite ready after more testing.
Affected #: 6 files
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/collection/dataset-collection-base.js
--- a/static/scripts/mvc/collection/dataset-collection-base.js
+++ b/static/scripts/mvc/collection/dataset-collection-base.js
@@ -144,7 +144,7 @@
contentView.$el.children( '.dataset-body' ).replaceWith( contentView._render_body() );
contentView.$el.children( '.dataset-body' ).slideDown( contentView.fxSpeed, function(){
contentView.expanded = true;
- contentView.trigger( 'body-expanded', contentView.model );
+ contentView.trigger( 'body-expanded', contentView.model.get( 'id' ) );
});
}
// TODO: Fetch more details like HDA view...
@@ -158,7 +158,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.id );
+ hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
});
},
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -319,7 +319,7 @@
title : "Data Viewer: " + self.model.get('name'),
type : "other",
content : function(parent_elt) {
- var new_dataset = new dataset.TabularDataset({id: self.model.get('id')});
+ var new_dataset = new dataset.TabularDataset({id: self.model.id});
$.when(new_dataset.fetch()).then(function() {
dataset.createTabularDatasetChunkedView({
model: new_dataset,
@@ -568,7 +568,7 @@
hdaView.$el.children( '.dataset-body' ).replaceWith( hdaView._render_body() );
hdaView.$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
hdaView.expanded = true;
- hdaView.trigger( 'body-expanded', hdaView.model );
+ hdaView.trigger( 'body-expanded', hdaView.model.get( 'id' ) );
});
//hdaView.render( false ).$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
@@ -595,7 +595,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.id );
+ hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
});
},
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -12,22 +12,9 @@
* @constructs
*/
var HistoryContent = Backbone.Model.extend( baseMVC.LoggableMixin ).extend( {
- idAttribute : 'type_id',
/** fetch location of this HDA's history in the api */
urlRoot: galaxy_config.root + 'api/histories/',
-
- constructor : function( attrs, options ){
- attrs.type_id = HistoryContent.typeIdStr( attrs.type, attrs.id );
- Backbone.Model.apply( this, arguments );
- },
-
- initialize : function( attrs, options ){
- // assumes type won't change
- this.on( 'change:id', this._createTypeId );
- //TODO: not sure this covers all the bases...
- },
-
/** full url spec. for this HDA */
url : function(){
return this.urlRoot + this.get( 'history_id' ) + '/contents/' + this.get('history_content_type') + 's/' + this.get( 'id' );
@@ -151,19 +138,10 @@
term = term.replace( /"/g, '' );
return model.matches( term );
});
- },
-
- _createTypeId : function(){
- return ( this.attributes.type_id = [ this.attributes.type, this.attributes.id ].join( '-' ) );
- },
+ }
} );
-/** create a type + id string for use in mixed collections */
-HistoryContent.typeIdStr = function _typeId( type, id ){
- return [ type, id ].join( '-' );
-};
-
//==============================================================================
/** @class (HDA) model for a Galaxy dataset
* related to a history.
@@ -250,10 +228,6 @@
initialize : function( data ){
this.log( this + '.initialize', this.attributes );
this.log( '\tparent history_id: ' + this.get( 'history_id' ) );
-
- this._createTypeId();
- // assumes type won't change
- this.on( 'change:id', this._createTypeId );
//!! this state is not in trans.app.model.Dataset.states - set it here -
if( !this.get( 'accessible' ) ){
@@ -508,7 +482,7 @@
* @returns array of encoded ids
*/
ids : function(){
- return this.map( function( hda ){ return hda.get('id'); });
+ return this.map( function( hda ){ return hda.id; });
},
/** Get hdas that are not ready
@@ -669,7 +643,7 @@
this.chain().each( function( hda ) {
// TODO: Handle duplicate names.
var name = hda.attributes.name;
- var id = hda.get('id');
+ var id = hda.id;
var content_type = hda.attributes.history_content_type;
if( content_type == "dataset" ) {
if( full_collection_type != "list" ) {
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -236,7 +236,7 @@
// for symmetry, not actually used by backend of consumed
// by frontend.
data[ "dataset_collection_details" ] = hdcaDetailIds.join( ',' );
- }
+ }
return jQuery.ajax( galaxy_config.root + 'api/histories/' + historyData.id + '/contents', { data: data });
}
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -273,7 +273,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.id,
+ var hdaId = hda.get( 'id' ),
historyContentType = hda.get( 'history_content_type' ),
hdaView = null;
@@ -328,7 +328,7 @@
// only
} else {
- var id = hdaView.model.id;
+ var id = hdaView.model.get( 'id' );
historyView.lastSelectedViewId = id;
//console.debug( 'lastSelectedViewId:', historyView.lastSelectedViewId );
selectedIds = [ id ];
@@ -340,7 +340,7 @@
});
hdaView.on( 'de-selected', function( hdaView, event ){
//console.debug( 'de-selected', event );
- var id = hdaView.model.id;
+ var id = hdaView.model.get( 'id' );
historyView.selectedHdaIds = _.without( historyView.selectedHdaIds, id );
//console.debug( 'de-selected', historyView.selectedHdaIds );
});
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/history/readonly-history-panel.js
--- a/static/scripts/mvc/history/readonly-history-panel.js
+++ b/static/scripts/mvc/history/readonly-history-panel.js
@@ -18,9 +18,9 @@
//TODO: add scroll position?
},
/** add an hda id to the hash of expanded hdas */
- addExpandedHda : function( model ){
+ addExpandedHda : function( id ){
var key = 'expandedHdas';
- this.save( key, _.extend( this.get( key ), _.object([ model.id ], [ model.get( 'id' ) ]) ) );
+ this.save( key, _.extend( this.get( key ), _.object([ id ], [ true ]) ) );
},
/** remove an hda id from the hash of expanded hdas */
removeExpandedHda : function( id ){
@@ -264,7 +264,7 @@
var hdaDetailIds = function( historyData ){
// will be called to get hda ids that need details from the api
//TODO: non-visible HDAs are getting details loaded... either stop loading them at all or filter ids thru isVisible
- return _.values( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
+ return _.keys( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
};
return this.loadHistory( historyId, attributes, historyFn, hdaFn, hdaDetailIds );
},
@@ -591,7 +591,7 @@
if( visibleHdas.length ){
visibleHdas.each( function( hda ){
// render it (NOTE: reverse order, newest on top (prepend))
- var hdaId = hda.id,
+ var hdaId = hda.get( 'id' ),
hdaView = panel._createContentView( hda );
newHdaViews[ hdaId ] = hdaView;
// persist selection
@@ -610,7 +610,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.id,
+ var hdaId = hda.get( 'id' ),
historyContentType = hda.get( "history_content_type" ),
hdaView = null;
if( historyContentType === "dataset" ){
@@ -646,8 +646,8 @@
panel.errorHandler( model, xhr, options, msg );
});
// maintain a list of hdas whose bodies are expanded
- hdaView.on( 'body-expanded', function( model ){
- panel.storage.addExpandedHda( model );
+ hdaView.on( 'body-expanded', function( id ){
+ panel.storage.addExpandedHda( id );
});
hdaView.on( 'body-collapsed', function( id ){
panel.storage.removeExpandedHda( id );
https://bitbucket.org/galaxy/galaxy-central/commits/fb4ac45f7827/
Changeset: fb4ac45f7827
User: jmchilton
Date: 2014-06-13 22:50:38
Summary: Merge.
Affected #: 6 files
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -34,6 +34,9 @@
def __getitem__( self, key ):
return self.data_tables.__getitem__( key )
+ def __setitem__( self, key, value ):
+ return self.data_tables.__setitem__( key, value )
+
def __contains__( self, key ):
return self.data_tables.__contains__( key )
@@ -43,6 +46,9 @@
except KeyError:
return default
+ def set( self, name, value ):
+ self[ name ] = value
+
def get_tables( self ):
return self.data_tables
@@ -335,7 +341,7 @@
return rval
def get_version_fields( self ):
- return ( self._loaded_content_version, self.data )
+ return ( self._loaded_content_version, self.get_fields() )
def parse_column_spec( self, config_element ):
"""
@@ -422,7 +428,7 @@
return default
rval = default
# Look for table entry.
- for fields in self.data:
+ for fields in self.get_fields():
if fields[ query_col ] == query_val:
rval = fields[ return_col ]
break
@@ -444,7 +450,7 @@
is_error = False
if self.largest_index < len( fields ):
fields = self._replace_field_separators( fields )
- if fields not in self.data or allow_duplicates:
+ if fields not in self.get_fields() or allow_duplicates:
self.data.append( fields )
else:
log.debug( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name )
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b run.sh
--- a/run.sh
+++ b/run.sh
@@ -5,31 +5,12 @@
python ./scripts/check_python.py
[ $? -ne 0 ] && exit 1
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then
python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR"
fi
-# explicitly attempt to fetch eggs before running
-FETCH_EGGS=1
-for arg in "$@"; do
- [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0; break
-done
-if [ $FETCH_EGGS -eq 1 ]; then
- python ./scripts/check_eggs.py -q
- if [ $? -ne 0 ]; then
- echo "Some eggs are out of date, attempting to fetch..."
- python ./scripts/fetch_eggs.py
- if [ $? -eq 0 ]; then
- echo "Fetch successful."
- else
- echo "Fetch failed."
- exit 1
- fi
- fi
-fi
-
if [ -n "$GALAXY_RUN_ALL" ]; then
servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' universe_wsgi.ini | xargs echo`
daemon=`echo "$@" | grep -q daemon`
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b run_reports.sh
--- a/run_reports.sh
+++ b/run_reports.sh
@@ -11,6 +11,8 @@
cd `dirname $0`
+./scripts/common_startup.sh --skip-samples
+
GALAXY_REPORTS_CONFIG=${GALAXY_REPORTS_CONFIG:-reports_wsgi.ini}
GALAXY_REPORTS_PID=${GALAXY_REPORTS_PID:-reports_webapp.pid}
GALAXY_REPORTS_LOG=${GALAXY_REPORTS_LOG:-reports_webapp.log}
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b run_tool_shed.sh
--- a/run_tool_shed.sh
+++ b/run_tool_shed.sh
@@ -2,7 +2,7 @@
cd `dirname $0`
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
args=$@
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b scripts/common_startup.sh
--- /dev/null
+++ b/scripts/common_startup.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# explicitly attempt to fetch eggs before running
+FETCH_EGGS=1
+COPY_SAMPLE_FILES=1
+for arg in "$@"; do
+ [ "$arg" = "--skip-eggs" ] && FETCH_EGGS=0
+ [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0
+ [ "$arg" = "--skip-samples" ] && COPY_SAMPLE_FILES=0
+done
+if [ $FETCH_EGGS -eq 1 ]; then
+ python ./scripts/check_eggs.py -q
+ if [ $? -ne 0 ]; then
+ echo "Some eggs are out of date, attempting to fetch..."
+ python ./scripts/fetch_eggs.py
+ if [ $? -eq 0 ]; then
+ echo "Fetch successful."
+ else
+ echo "Fetch failed."
+ exit 1
+ fi
+ fi
+fi
+
+SAMPLES="
+ tool_shed_wsgi.ini.sample
+ datatypes_conf.xml.sample
+ external_service_types_conf.xml.sample
+ migrated_tools_conf.xml.sample
+ reports_wsgi.ini.sample
+ shed_tool_conf.xml.sample
+ tool_conf.xml.sample
+ shed_tool_data_table_conf.xml.sample
+ tool_data_table_conf.xml.sample
+ tool_sheds_conf.xml.sample
+ data_manager_conf.xml.sample
+ shed_data_manager_conf.xml.sample
+ openid_conf.xml.sample
+ job_metrics_conf.xml.sample
+ universe_wsgi.ini.sample
+ lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
+ tool-data/shared/ncbi/builds.txt.sample
+ tool-data/shared/ensembl/builds.txt.sample
+ tool-data/shared/ucsc/builds.txt.sample
+ tool-data/shared/ucsc/publicbuilds.txt.sample
+ tool-data/shared/ucsc/ucsc_build_sites.txt.sample
+ tool-data/shared/igv/igv_build_sites.txt.sample
+ tool-data/shared/rviewer/rviewer_build_sites.txt.sample
+ tool-data/*.sample
+ static/welcome.html.sample
+"
+
+if [ $COPY_SAMPLE_FILES -eq 1 ]; then
+ # Create any missing config/location files
+ for sample in $SAMPLES; do
+ file=${sample%.sample}
+ if [ ! -f "$file" -a -f "$sample" ]; then
+ echo "Initializing $file from `basename $sample`"
+ cp $sample $file
+ fi
+ done
+fi
+
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b scripts/copy_sample_files.sh
--- a/scripts/copy_sample_files.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-SAMPLES="
- tool_shed_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- data_manager_conf.xml.sample
- shed_data_manager_conf.xml.sample
- openid_conf.xml.sample
- job_metrics_conf.xml.sample
- universe_wsgi.ini.sample
- lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/ucsc/ucsc_build_sites.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
-
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=${sample%.sample}
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
-
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/5dd5952050c8/
Changeset: 5dd5952050c8
User: davebgx
Date: 2014-06-13 22:39:59
Summary: Abstract common startup tasks into scripts/common_startup.sh, which used to be copy_sample_files.sh.
Affected #: 5 files
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 run.sh
--- a/run.sh
+++ b/run.sh
@@ -5,31 +5,12 @@
python ./scripts/check_python.py
[ $? -ne 0 ] && exit 1
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then
python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR"
fi
-# explicitly attempt to fetch eggs before running
-FETCH_EGGS=1
-for arg in "$@"; do
- [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0; break
-done
-if [ $FETCH_EGGS -eq 1 ]; then
- python ./scripts/check_eggs.py -q
- if [ $? -ne 0 ]; then
- echo "Some eggs are out of date, attempting to fetch..."
- python ./scripts/fetch_eggs.py
- if [ $? -eq 0 ]; then
- echo "Fetch successful."
- else
- echo "Fetch failed."
- exit 1
- fi
- fi
-fi
-
if [ -n "$GALAXY_RUN_ALL" ]; then
servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' universe_wsgi.ini | xargs echo`
daemon=`echo "$@" | grep -q daemon`
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 run_reports.sh
--- a/run_reports.sh
+++ b/run_reports.sh
@@ -11,6 +11,8 @@
cd `dirname $0`
+./scripts/common_startup.sh --skip-samples
+
GALAXY_REPORTS_CONFIG=${GALAXY_REPORTS_CONFIG:-reports_wsgi.ini}
GALAXY_REPORTS_PID=${GALAXY_REPORTS_PID:-reports_webapp.pid}
GALAXY_REPORTS_LOG=${GALAXY_REPORTS_LOG:-reports_webapp.log}
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 run_tool_shed.sh
--- a/run_tool_shed.sh
+++ b/run_tool_shed.sh
@@ -2,7 +2,7 @@
cd `dirname $0`
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
args=$@
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 scripts/common_startup.sh
--- /dev/null
+++ b/scripts/common_startup.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# explicitly attempt to fetch eggs before running
+FETCH_EGGS=1
+COPY_SAMPLE_FILES=1
+for arg in "$@"; do
+ [ "$arg" = "--skip-eggs" ] && FETCH_EGGS=0
+ [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0
+ [ "$arg" = "--skip-samples" ] && COPY_SAMPLE_FILES=0
+done
+if [ $FETCH_EGGS -eq 1 ]; then
+ python ./scripts/check_eggs.py -q
+ if [ $? -ne 0 ]; then
+ echo "Some eggs are out of date, attempting to fetch..."
+ python ./scripts/fetch_eggs.py
+ if [ $? -eq 0 ]; then
+ echo "Fetch successful."
+ else
+ echo "Fetch failed."
+ exit 1
+ fi
+ fi
+fi
+
+SAMPLES="
+ tool_shed_wsgi.ini.sample
+ datatypes_conf.xml.sample
+ external_service_types_conf.xml.sample
+ migrated_tools_conf.xml.sample
+ reports_wsgi.ini.sample
+ shed_tool_conf.xml.sample
+ tool_conf.xml.sample
+ shed_tool_data_table_conf.xml.sample
+ tool_data_table_conf.xml.sample
+ tool_sheds_conf.xml.sample
+ data_manager_conf.xml.sample
+ shed_data_manager_conf.xml.sample
+ openid_conf.xml.sample
+ job_metrics_conf.xml.sample
+ universe_wsgi.ini.sample
+ lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
+ tool-data/shared/ncbi/builds.txt.sample
+ tool-data/shared/ensembl/builds.txt.sample
+ tool-data/shared/ucsc/builds.txt.sample
+ tool-data/shared/ucsc/publicbuilds.txt.sample
+ tool-data/shared/ucsc/ucsc_build_sites.txt.sample
+ tool-data/shared/igv/igv_build_sites.txt.sample
+ tool-data/shared/rviewer/rviewer_build_sites.txt.sample
+ tool-data/*.sample
+ static/welcome.html.sample
+"
+
+if [ $COPY_SAMPLE_FILES -eq 1 ]; then
+ # Create any missing config/location files
+ for sample in $SAMPLES; do
+ file=${sample%.sample}
+ if [ ! -f "$file" -a -f "$sample" ]; then
+ echo "Initializing $file from `basename $sample`"
+ cp $sample $file
+ fi
+ done
+fi
+
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 scripts/copy_sample_files.sh
--- a/scripts/copy_sample_files.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-SAMPLES="
- tool_shed_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- data_manager_conf.xml.sample
- shed_data_manager_conf.xml.sample
- openid_conf.xml.sample
- job_metrics_conf.xml.sample
- universe_wsgi.ini.sample
- lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/ucsc/ucsc_build_sites.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
-
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=${sample%.sample}
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
-
https://bitbucket.org/galaxy/galaxy-central/commits/867208553d9d/
Changeset: 867208553d9d
User: davebgx
Date: 2014-06-13 22:41:00
Summary: Merge with incoming.
Affected #: 1 file
diff -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 -r 867208553d9dba216acd6669543714e3aa1ebed2 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -34,6 +34,9 @@
def __getitem__( self, key ):
return self.data_tables.__getitem__( key )
+ def __setitem__( self, key, value ):
+ return self.data_tables.__setitem__( key, value )
+
def __contains__( self, key ):
return self.data_tables.__contains__( key )
@@ -43,6 +46,9 @@
except KeyError:
return default
+ def set( self, name, value ):
+ self[ name ] = value
+
def get_tables( self ):
return self.data_tables
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: dan: Add set methods to ToolDataTableManager.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c8e9e10e1a5a/
Changeset: c8e9e10e1a5a
User: dan
Date: 2014-06-13 22:31:25
Summary: Add set methods to ToolDataTableManager.
Affected #: 1 file
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r c8e9e10e1a5a2c69e94224629e8b086112e15bff lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -34,6 +34,9 @@
def __getitem__( self, key ):
return self.data_tables.__getitem__( key )
+ def __setitem__( self, key, value ):
+ return self.data_tables.__setitem__( key, value )
+
def __contains__( self, key ):
return self.data_tables.__contains__( key )
@@ -43,6 +46,9 @@
except KeyError:
return default
+ def set( self, name, value ):
+ self[ name ] = value
+
def get_tables( self ):
return self.data_tables
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: dan: In TabularToolDataTable use .get_fields() instead of .data directly.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6e39473e4c51/
Changeset: 6e39473e4c51
User: dan
Date: 2014-06-13 22:09:53
Summary: In TabularToolDataTable use .get_fields() instead of .data directly.
Affected #: 1 file
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -335,7 +335,7 @@
return rval
def get_version_fields( self ):
- return ( self._loaded_content_version, self.data )
+ return ( self._loaded_content_version, self.get_fields() )
def parse_column_spec( self, config_element ):
"""
@@ -422,7 +422,7 @@
return default
rval = default
# Look for table entry.
- for fields in self.data:
+ for fields in self.get_fields():
if fields[ query_col ] == query_val:
rval = fields[ return_col ]
break
@@ -444,7 +444,7 @@
is_error = False
if self.largest_index < len( fields ):
fields = self._replace_field_separators( fields )
- if fields not in self.data or allow_duplicates:
+ if fields not in self.get_fields() or allow_duplicates:
self.data.append( fields )
else:
log.debug( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name )
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/73b0cb2e6795/
Changeset: 73b0cb2e6795
User: jmchilton
Date: 2014-06-13 21:25:36
Summary: Modifications to history_contents API and client consumption...
... to reflect the fact that history can now contain two kinds of objects with potentially overlapping ids.
Affected #: 2 files
diff -r ea6698177726a9e94931dcd818db52f5c0e2aec3 -r 73b0cb2e679542f197eb12715e05a770c5501e0d lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -102,8 +102,10 @@
contents_kwds[ 'deleted' ] = kwd.get( 'deleted', None )
contents_kwds[ 'visible' ] = kwd.get( 'visible', None )
# details param allows a mixed set of summary and detailed hdas
- #TODO: this is getting convoluted due to backwards compat
- details = kwd.get( 'details', None ) or []
+ # Ever more convoluted due to backwards compat..., details
+ # should be considered deprecated in favor of more specific
+ # dataset_details (and to be implemented dataset_collection_details).
+ details = kwd.get( 'details', None ) or kwd.get( 'dataset_details', None ) or []
if details and details != 'all':
details = util.listify( details )
diff -r ea6698177726a9e94931dcd818db52f5c0e2aec3 -r 73b0cb2e679542f197eb12715e05a770c5501e0d static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -200,6 +200,7 @@
History.getHistoryData = function getHistoryData( historyId, options ){
options = options || {};
var hdaDetailIds = options.hdaDetailIds || [];
+ var hdcaDetailIds = options.hdcaDetailIds || [];
//console.debug( 'getHistoryData:', historyId, options );
var df = jQuery.Deferred(),
@@ -224,7 +225,18 @@
if( _.isFunction( hdaDetailIds ) ){
hdaDetailIds = hdaDetailIds( historyData );
}
- var data = ( hdaDetailIds.length )?( { details : hdaDetailIds.join( ',' ) } ):( {} );
+ if( _.isFunction( hdcaDetailIds ) ){
+ hdcaDetailIds = hdcaDetailIds( historyData );
+ }
+ var data = {};
+ if( hdaDetailIds.length ) {
+ data[ "dataset_details" ] = hdaDetailIds.join( ',' );
+ }
+ if( hdcaDetailIds.length ) {
+ // for symmetry, not actually used by backend of consumed
+ // by frontend.
+ data[ "dataset_collection_details" ] = hdcaDetailIds.join( ',' );
+ }
return jQuery.ajax( galaxy_config.root + 'api/histories/' + historyData.id + '/contents', { data: data });
}
https://bitbucket.org/galaxy/galaxy-central/commits/74826a57c456/
Changeset: 74826a57c456
User: jmchilton
Date: 2014-06-13 21:25:36
Summary: Progress on UI problems when collections and datasets in same history have same id.
Approach outlined by Carl, introduces separation between Backbone model id and underlying Galaxy id. Backbone id now includes type in the id. Lots of switching around which id is used where - probably introduces some bugs if I failed to update which id is to be used or switched to wrong one.
Affected #: 6 files
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/collection/dataset-collection-base.js
--- a/static/scripts/mvc/collection/dataset-collection-base.js
+++ b/static/scripts/mvc/collection/dataset-collection-base.js
@@ -144,7 +144,7 @@
contentView.$el.children( '.dataset-body' ).replaceWith( contentView._render_body() );
contentView.$el.children( '.dataset-body' ).slideDown( contentView.fxSpeed, function(){
contentView.expanded = true;
- contentView.trigger( 'body-expanded', contentView.model.get( 'id' ) );
+ contentView.trigger( 'body-expanded', contentView.model );
});
}
// TODO: Fetch more details like HDA view...
@@ -158,7 +158,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
+ hdaView.trigger( 'body-collapsed', hdaView.model.id );
});
},
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -319,7 +319,7 @@
title : "Data Viewer: " + self.model.get('name'),
type : "other",
content : function(parent_elt) {
- var new_dataset = new dataset.TabularDataset({id: self.model.id});
+ var new_dataset = new dataset.TabularDataset({id: self.model.get('id')});
$.when(new_dataset.fetch()).then(function() {
dataset.createTabularDatasetChunkedView({
model: new_dataset,
@@ -568,7 +568,7 @@
hdaView.$el.children( '.dataset-body' ).replaceWith( hdaView._render_body() );
hdaView.$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
hdaView.expanded = true;
- hdaView.trigger( 'body-expanded', hdaView.model.get( 'id' ) );
+ hdaView.trigger( 'body-expanded', hdaView.model );
});
//hdaView.render( false ).$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
@@ -595,7 +595,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
+ hdaView.trigger( 'body-collapsed', hdaView.model.id );
});
},
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -12,9 +12,22 @@
* @constructs
*/
var HistoryContent = Backbone.Model.extend( baseMVC.LoggableMixin ).extend( {
+ idAttribute : 'type_id',
/** fetch location of this HDA's history in the api */
urlRoot: galaxy_config.root + 'api/histories/',
+
+ constructor : function( attrs, options ){
+ attrs.type_id = HistoryContent.typeIdStr( attrs.type, attrs.id );
+ Backbone.Model.apply( this, arguments );
+ },
+
+ initialize : function( attrs, options ){
+ // assumes type won't change
+ this.on( 'change:id', this._createTypeId );
+ //TODO: not sure this covers all the bases...
+ },
+
/** full url spec. for this HDA */
url : function(){
return this.urlRoot + this.get( 'history_id' ) + '/contents/' + this.get('history_content_type') + 's/' + this.get( 'id' );
@@ -138,10 +151,19 @@
term = term.replace( /"/g, '' );
return model.matches( term );
});
- }
+ },
+
+ _createTypeId : function(){
+ return ( this.attributes.type_id = [ this.attributes.type, this.attributes.id ].join( '-' ) );
+ },
} );
+/** create a type + id string for use in mixed collections */
+HistoryContent.typeIdStr = function _typeId( type, id ){
+ return [ type, id ].join( '-' );
+};
+
//==============================================================================
/** @class (HDA) model for a Galaxy dataset
* related to a history.
@@ -228,6 +250,10 @@
initialize : function( data ){
this.log( this + '.initialize', this.attributes );
this.log( '\tparent history_id: ' + this.get( 'history_id' ) );
+
+ this._createTypeId();
+ // assumes type won't change
+ this.on( 'change:id', this._createTypeId );
//!! this state is not in trans.app.model.Dataset.states - set it here -
if( !this.get( 'accessible' ) ){
@@ -482,7 +508,7 @@
* @returns array of encoded ids
*/
ids : function(){
- return this.map( function( hda ){ return hda.id; });
+ return this.map( function( hda ){ return hda.get('id'); });
},
/** Get hdas that are not ready
@@ -643,7 +669,7 @@
this.chain().each( function( hda ) {
// TODO: Handle duplicate names.
var name = hda.attributes.name;
- var id = hda.id;
+ var id = hda.get('id');
var content_type = hda.attributes.history_content_type;
if( content_type == "dataset" ) {
if( full_collection_type != "list" ) {
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -236,7 +236,7 @@
// for symmetry, not actually used by backend of consumed
// by frontend.
data[ "dataset_collection_details" ] = hdcaDetailIds.join( ',' );
- }
+ }
return jQuery.ajax( galaxy_config.root + 'api/histories/' + historyData.id + '/contents', { data: data });
}
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -273,7 +273,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.get( 'id' ),
+ var hdaId = hda.id,
historyContentType = hda.get( 'history_content_type' ),
hdaView = null;
@@ -328,7 +328,7 @@
// only
} else {
- var id = hdaView.model.get( 'id' );
+ var id = hdaView.model.id;
historyView.lastSelectedViewId = id;
//console.debug( 'lastSelectedViewId:', historyView.lastSelectedViewId );
selectedIds = [ id ];
@@ -340,7 +340,7 @@
});
hdaView.on( 'de-selected', function( hdaView, event ){
//console.debug( 'de-selected', event );
- var id = hdaView.model.get( 'id' );
+ var id = hdaView.model.id;
historyView.selectedHdaIds = _.without( historyView.selectedHdaIds, id );
//console.debug( 'de-selected', historyView.selectedHdaIds );
});
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/history/readonly-history-panel.js
--- a/static/scripts/mvc/history/readonly-history-panel.js
+++ b/static/scripts/mvc/history/readonly-history-panel.js
@@ -18,9 +18,9 @@
//TODO: add scroll position?
},
/** add an hda id to the hash of expanded hdas */
- addExpandedHda : function( id ){
+ addExpandedHda : function( model ){
var key = 'expandedHdas';
- this.save( key, _.extend( this.get( key ), _.object([ id ], [ true ]) ) );
+ this.save( key, _.extend( this.get( key ), _.object([ model.id ], [ model.get( 'id' ) ]) ) );
},
/** remove an hda id from the hash of expanded hdas */
removeExpandedHda : function( id ){
@@ -264,7 +264,7 @@
var hdaDetailIds = function( historyData ){
// will be called to get hda ids that need details from the api
//TODO: non-visible HDAs are getting details loaded... either stop loading them at all or filter ids thru isVisible
- return _.keys( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
+ return _.values( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
};
return this.loadHistory( historyId, attributes, historyFn, hdaFn, hdaDetailIds );
},
@@ -591,7 +591,7 @@
if( visibleHdas.length ){
visibleHdas.each( function( hda ){
// render it (NOTE: reverse order, newest on top (prepend))
- var hdaId = hda.get( 'id' ),
+ var hdaId = hda.id,
hdaView = panel._createContentView( hda );
newHdaViews[ hdaId ] = hdaView;
// persist selection
@@ -610,7 +610,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.get( 'id' ),
+ var hdaId = hda.id,
historyContentType = hda.get( "history_content_type" ),
hdaView = null;
if( historyContentType === "dataset" ){
@@ -646,8 +646,8 @@
panel.errorHandler( model, xhr, options, msg );
});
// maintain a list of hdas whose bodies are expanded
- hdaView.on( 'body-expanded', function( id ){
- panel.storage.addExpandedHda( id );
+ hdaView.on( 'body-expanded', function( model ){
+ panel.storage.addExpandedHda( model );
});
hdaView.on( 'body-collapsed', function( id ){
panel.storage.removeExpandedHda( id );
https://bitbucket.org/galaxy/galaxy-central/commits/e5eae98697a2/
Changeset: e5eae98697a2
User: jmchilton
Date: 2014-06-13 21:41:51
Summary: Pack scripts.
Affected #: 6 files
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/collection/dataset-collection-base.js
--- a/static/scripts/packed/mvc/collection/dataset-collection-base.js
+++ b/static/scripts/packed/mvc/collection/dataset-collection-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(b,a){var c=a.HistoryContentBaseView.extend({className:"dataset hda history-panel-hda",id:function(){return"hdca-"+this.model.get("id")},initialize:function(d){if(d.logger){this.logger=this.model.logger=d.logger}this.log(this+".initialize:",d);this.selectable=d.selectable||false;this.selected=d.selected||false;this.expanded=d.expanded||false},render:function(e){var d=this._buildNewRender();this._queueNewRender(d,e);return this},templateSkeleton:function(){return['<div class="dataset hda">','<div class="dataset-warnings">',"<% if ( deleted ) { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</div>","<% } %>","<% if ( ! visible ) { %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%= hid %></span> ','<span class="dataset-name"><%= name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("")},templateBody:function(){return['<div class="dataset-body">','<div class="dataset-summary">',"A dataset collection.","</div>"].join("")},_buildNewRender:function(){var d=$(_.template(this.templateSkeleton(),this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);return d},_render_titleButtons:function(){return[]},_render_body:function(){var e=$('<div>Error: unknown state "'+this.model.get("state")+'".</div>'),d=this["_render_body_"+this.model.get("state")];if(_.isFunction(d)){e=d.call(this)}this._setUpBehaviors(e);if(this.expanded){e.show()}return e},_setUpBehaviors:function(d){d=d||this.$el;make_popup_menus(d);d.find("[title]").tooltip({placement:"bottom"})},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var d=this;function e(){d.$el.children(".dataset-body").replaceWith(d._render_body());d.$el.children(".dataset-body").slideDown(d.fxSpeed,function(){d.expanded=true;d.trigger("body-expanded",d.model.get("id"))})}e()},collapseBody:function(){var d=this;this.$el.children(".dataset-body").slideUp(d.fxSpeed,function(){d.expanded=false;d.trigger("body-collapsed",d.model.get("id"))})},_render_body_ok:function(){var d=$(_.template(this.templateBody(),this.model.toJSON()));if(this.model.get("deleted")){return d}return d}});return{DatasetCollectionBaseView:c}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(b,a){var c=a.HistoryContentBaseView.extend({className:"dataset hda history-panel-hda",id:function(){return"hdca-"+this.model.get("id")},initialize:function(d){if(d.logger){this.logger=this.model.logger=d.logger}this.log(this+".initialize:",d);this.selectable=d.selectable||false;this.selected=d.selected||false;this.expanded=d.expanded||false},render:function(e){var d=this._buildNewRender();this._queueNewRender(d,e);return this},templateSkeleton:function(){return['<div class="dataset hda">','<div class="dataset-warnings">',"<% if ( deleted ) { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</div>","<% } %>","<% if ( ! visible ) { %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%= hid %></span> ','<span class="dataset-name"><%= name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("")},templateBody:function(){return['<div class="dataset-body">','<div class="dataset-summary">',"A dataset collection.","</div>"].join("")},_buildNewRender:function(){var d=$(_.template(this.templateSkeleton(),this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);return d},_render_titleButtons:function(){return[]},_render_body:function(){var e=$('<div>Error: unknown state "'+this.model.get("state")+'".</div>'),d=this["_render_body_"+this.model.get("state")];if(_.isFunction(d)){e=d.call(this)}this._setUpBehaviors(e);if(this.expanded){e.show()}return e},_setUpBehaviors:function(d){d=d||this.$el;make_popup_menus(d);d.find("[title]").tooltip({placement:"bottom"})},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var d=this;function e(){d.$el.children(".dataset-body").replaceWith(d._render_body());d.$el.children(".dataset-body").slideDown(d.fxSpeed,function(){d.expanded=true;d.trigger("body-expanded",d.model)})}e()},collapseBody:function(){var d=this;this.$el.children(".dataset-body").slideUp(d.fxSpeed,function(){d.expanded=false;d.trigger("body-collapsed",d.model.id)})},_render_body_ok:function(){var d=$(_.template(this.templateBody(),this.model.toJSON()));if(this.model.get("deleted")){return d}return d}});return{DatasetCollectionBaseView:c}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/base-mvc","mvc/data","utils/localization"],function(e,b,g,d){var h=Backbone.View.extend(b.LoggableMixin).extend({tagName:"div",fxSpeed:"fast",_queueNewRender:function(j,k){k=(k===undefined)?(true):(k);var i=this;if(k){$(i).queue(function(l){this.$el.fadeOut(i.fxSpeed,l)})}$(i).queue(function(l){this.$el.empty().attr("class",i.className).addClass("state-"+i.model.get("state")).append(j.children());if(this.selectable){this.showSelector(0)}l()});if(k){$(i).queue(function(l){this.$el.fadeIn(i.fxSpeed,l)})}$(i).queue(function(l){this.trigger("rendered",i);if(this.model.inReadyState()){this.trigger("rendered:ready",i)}if(this.draggable){this.draggableOn()}l()})},toggleBodyVisibility:function(l,j){var i=32,k=13;if(l&&(l.type==="keydown")&&!(l.keyCode===i||l.keyCode===k)){return true}var m=this.$el.find(".dataset-body");j=(j===undefined)?(!m.is(":visible")):(j);if(j){this.expandBody()}else{this.collapseBody()}return false},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(i){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this,i);this.selected=true}return false},deselect:function(i){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this,i);this.selected=false}return false},toggleSelect:function(i){if(this.selected){this.deselect(i)}else{this.select(i)}}});var c=h.extend({className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log(this+".initialize:",i);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=i.linkTarget||"_blank";this.selectable=i.selectable||false;this.selected=i.selected||false;this.expanded=i.expanded||false;this.draggable=i.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(j,i){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(j){this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var i=this._buildNewRender();this._queueNewRender(i,j);return this},_buildNewRender:function(){var i=$(c.templates.skeleton(this.model.toJSON()));i.find(".dataset-primary-actions").append(this._render_titleButtons());i.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(i);return i},_setUpBehaviors:function(i){i=i||this.$el;make_popup_menus(i);i.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===e.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===e.HistoryDatasetAssociation.STATES.DISCARDED)||(!this.model.get("accessible"))){return null}var j={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){j.disabled=true;j.title=d("Cannot display datasets removed from disk")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.UPLOAD){j.disabled=true;j.title=d("This dataset must finish uploading before it can be viewed")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.NEW){j.disabled=true;j.title=d("This dataset is not yet viewable")}else{j.title=d("View data");j.href=this.urls.display;var i=this;j.onclick=function(k){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+i.model.get("name"),type:"other",content:function(l){var m=new g.TabularDataset({id:i.model.id});$.when(m.fetch()).then(function(){g.createTabularDatasetChunkedView({model:m,parent_elt:l,embedded:true,height:"100%"})})}});k.preventDefault()}}}}}j.faIcon="fa-eye";return faIconButton(j)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var j=this.urls,k=this.model.get("meta_files");if(_.isEmpty(k)){return $(['<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var l="dataset-"+this.model.get("id")+"-popup",i=['<div popupmenu="'+l+'">','<a href="'+j.download+'">',d("Download dataset"),"</a>","<a>"+d("Additional files")+"</a>",_.map(k,function(m){return['<a class="action-button" href="',j.meta_download+m.file_type,'">',d("Download")," ",m.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+l+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(i)},_render_showParamsButton:function(){return faIconButton({title:d("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var j=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),i=this["_render_body_"+this.model.get("state")];if(_.isFunction(i)){j=i.call(this)}this._setUpBehaviors(j);if(this.expanded){j.show()}return j},_render_stateBodyHelper:function(i,l){l=l||[];var j=this,k=$(c.templates.body(_.extend(this.model.toJSON(),{body:i})));k.find(".dataset-actions .left").append(_.map(l,function(m){return m.call(j)}));return k},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+d("This is a new dataset and not all of its data are available yet")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+d("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+d("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+d("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+d("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+d("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+d("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+d('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var i=['<span class="help-text">',d("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){i="<div>"+this.model.get("misc_blurb")+"</div>"+i}return this._render_stateBodyHelper(i,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+d("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var i=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(d("An error occurred setting the metadata for this dataset"))),j=this._render_body_ok();j.prepend(i);return j},_render_body_ok:function(){var i=this,k=$(c.templates.body(this.model.toJSON())),j=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);k.find(".dataset-actions .left").append(_.map(j,function(l){return l.call(i)}));if(this.model.isDeletedOrPurged()){return k}return k},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var i=this;function j(){i.$el.children(".dataset-body").replaceWith(i._render_body());i.$el.children(".dataset-body").slideDown(i.fxSpeed,function(){i.expanded=true;i.trigger("body-expanded",i.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(k){i.urls=i.model.urls();j()})}else{j()}},collapseBody:function(){var i=this;this.$el.children(".dataset-body").slideUp(i.fxSpeed,function(){i.expanded=false;i.trigger("body-collapsed",i.model.get("id"))})},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var i=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);i.addEventListener("dragstart",this.dragStartHandler,false);i.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var i=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);i.removeEventListener("dragstart",this.dragStartHandler,false);i.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(i){this.trigger("dragstart",this);i.dataTransfer.effectAllowed="move";i.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(i){this.trigger("dragend",this);return false},remove:function(j){var i=this;this.$el.fadeOut(i.fxSpeed,function(){i.$el.remove();i.off();if(j){j()}})},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+i+")"}});var a=_.template(['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',d("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',d("This dataset has been deleted and removed from disk")+".","</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',d("This dataset has been deleted")+".","</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',d("This dataset has been hidden")+".","</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join(""));var f=_.template(['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',d("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',d("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join(""));c.templates={skeleton:function(i){return a({_l:d,hda:i})},body:function(i){return f({_l:d,hda:i})}};return{HistoryContentBaseView:h,HDABaseView:c}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/base-mvc","mvc/data","utils/localization"],function(e,b,g,d){var h=Backbone.View.extend(b.LoggableMixin).extend({tagName:"div",fxSpeed:"fast",_queueNewRender:function(j,k){k=(k===undefined)?(true):(k);var i=this;if(k){$(i).queue(function(l){this.$el.fadeOut(i.fxSpeed,l)})}$(i).queue(function(l){this.$el.empty().attr("class",i.className).addClass("state-"+i.model.get("state")).append(j.children());if(this.selectable){this.showSelector(0)}l()});if(k){$(i).queue(function(l){this.$el.fadeIn(i.fxSpeed,l)})}$(i).queue(function(l){this.trigger("rendered",i);if(this.model.inReadyState()){this.trigger("rendered:ready",i)}if(this.draggable){this.draggableOn()}l()})},toggleBodyVisibility:function(l,j){var i=32,k=13;if(l&&(l.type==="keydown")&&!(l.keyCode===i||l.keyCode===k)){return true}var m=this.$el.find(".dataset-body");j=(j===undefined)?(!m.is(":visible")):(j);if(j){this.expandBody()}else{this.collapseBody()}return false},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(i){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this,i);this.selected=true}return false},deselect:function(i){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this,i);this.selected=false}return false},toggleSelect:function(i){if(this.selected){this.deselect(i)}else{this.select(i)}}});var c=h.extend({className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log(this+".initialize:",i);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=i.linkTarget||"_blank";this.selectable=i.selectable||false;this.selected=i.selected||false;this.expanded=i.expanded||false;this.draggable=i.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(j,i){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(j){this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var i=this._buildNewRender();this._queueNewRender(i,j);return this},_buildNewRender:function(){var i=$(c.templates.skeleton(this.model.toJSON()));i.find(".dataset-primary-actions").append(this._render_titleButtons());i.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(i);return i},_setUpBehaviors:function(i){i=i||this.$el;make_popup_menus(i);i.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===e.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===e.HistoryDatasetAssociation.STATES.DISCARDED)||(!this.model.get("accessible"))){return null}var j={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){j.disabled=true;j.title=d("Cannot display datasets removed from disk")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.UPLOAD){j.disabled=true;j.title=d("This dataset must finish uploading before it can be viewed")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.NEW){j.disabled=true;j.title=d("This dataset is not yet viewable")}else{j.title=d("View data");j.href=this.urls.display;var i=this;j.onclick=function(k){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+i.model.get("name"),type:"other",content:function(l){var m=new g.TabularDataset({id:i.model.get("id")});$.when(m.fetch()).then(function(){g.createTabularDatasetChunkedView({model:m,parent_elt:l,embedded:true,height:"100%"})})}});k.preventDefault()}}}}}j.faIcon="fa-eye";return faIconButton(j)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var j=this.urls,k=this.model.get("meta_files");if(_.isEmpty(k)){return $(['<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var l="dataset-"+this.model.get("id")+"-popup",i=['<div popupmenu="'+l+'">','<a href="'+j.download+'">',d("Download dataset"),"</a>","<a>"+d("Additional files")+"</a>",_.map(k,function(m){return['<a class="action-button" href="',j.meta_download+m.file_type,'">',d("Download")," ",m.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+l+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(i)},_render_showParamsButton:function(){return faIconButton({title:d("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var j=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),i=this["_render_body_"+this.model.get("state")];if(_.isFunction(i)){j=i.call(this)}this._setUpBehaviors(j);if(this.expanded){j.show()}return j},_render_stateBodyHelper:function(i,l){l=l||[];var j=this,k=$(c.templates.body(_.extend(this.model.toJSON(),{body:i})));k.find(".dataset-actions .left").append(_.map(l,function(m){return m.call(j)}));return k},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+d("This is a new dataset and not all of its data are available yet")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+d("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+d("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+d("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+d("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+d("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+d("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+d('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var i=['<span class="help-text">',d("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){i="<div>"+this.model.get("misc_blurb")+"</div>"+i}return this._render_stateBodyHelper(i,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+d("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var i=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(d("An error occurred setting the metadata for this dataset"))),j=this._render_body_ok();j.prepend(i);return j},_render_body_ok:function(){var i=this,k=$(c.templates.body(this.model.toJSON())),j=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);k.find(".dataset-actions .left").append(_.map(j,function(l){return l.call(i)}));if(this.model.isDeletedOrPurged()){return k}return k},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var i=this;function j(){i.$el.children(".dataset-body").replaceWith(i._render_body());i.$el.children(".dataset-body").slideDown(i.fxSpeed,function(){i.expanded=true;i.trigger("body-expanded",i.model)})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(k){i.urls=i.model.urls();j()})}else{j()}},collapseBody:function(){var i=this;this.$el.children(".dataset-body").slideUp(i.fxSpeed,function(){i.expanded=false;i.trigger("body-collapsed",i.model.id)})},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var i=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);i.addEventListener("dragstart",this.dragStartHandler,false);i.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var i=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);i.removeEventListener("dragstart",this.dragStartHandler,false);i.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(i){this.trigger("dragstart",this);i.dataTransfer.effectAllowed="move";i.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(i){this.trigger("dragend",this);return false},remove:function(j){var i=this;this.$el.fadeOut(i.fxSpeed,function(){i.$el.remove();i.off();if(j){j()}})},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+i+")"}});var a=_.template(['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',d("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',d("This dataset has been deleted and removed from disk")+".","</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',d("This dataset has been deleted")+".","</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',d("This dataset has been hidden")+".","</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join(""));var f=_.template(['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',d("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',d("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join(""));c.templates={skeleton:function(i){return a({_l:d,hda:i})},body:function(i){return f({_l:d,hda:i})}};return{HistoryContentBaseView:h,HDABaseView:c}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"forward",src:"hda",id:o[0]});q.push({name:"reverse",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({idAttribute:"type_id",urlRoot:galaxy_config.root+"api/histories/",constructor:function(o,n){o.type_id=a.typeIdStr(o.type,o.id);Backbone.Model.apply(this,arguments)},initialize:function(o,n){this.on("change:id",this._createTypeId)},url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(n){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},n)},undelete:function j(n){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},n)},hide:function d(n){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},n)},unhide:function i(n){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},n)},isVisible:function(o,p){var n=true;if((!o)&&(this.get("deleted")||this.get("purged"))){n=false}if((!p)&&(!this.get("visible"))){n=false}return n},searchAttribute:function(p,n){var o=this.get(p);if(!n||(o===undefined||o===null)){return false}if(_.isArray(o)){return this._searchArrayAttribute(o,n)}return(o.toString().toLowerCase().indexOf(n.toLowerCase())!==-1)},_searchArrayAttribute:function(o,n){n=n.toLowerCase();return _.any(o,function(p){return(p.toString().toLowerCase().indexOf(n.toLowerCase())!==-1)})},search:function(n){var o=this;return _.filter(this.searchAttributes,function(p){return o.searchAttribute(p,n)})},matches:function(o){var q="=",n=o.split(q);if(n.length>=2){var p=n[0];p=this.searchAliases[p]||p;return this.searchAttribute(p,n[1])}return !!this.search(o).length},matchesAll:function(o){var n=this;o=o.match(/(".*"|\w*=".*"|\S*)/g).filter(function(p){return !!p});return _.all(o,function(p){p=p.replace(/"/g,"");return n.matches(p)})},_createTypeId:function(){return(this.attributes.type_id=[this.attributes.type,this.attributes.id].join("-"))},});a.typeIdStr=function h(n,o){return[n,o].join("-")};var m=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var o=this.get("id");if(!o){return{}}var n={purge:galaxy_config.root+"datasets/"+o+"/purge_async",display:galaxy_config.root+"datasets/"+o+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+o+"/edit",download:galaxy_config.root+"datasets/"+o+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+o,rerun:galaxy_config.root+"tool_runner/rerun?id="+o,show_params:galaxy_config.root+"datasets/"+o+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+o,set:galaxy_config.root+"dataset/annotate_async?id="+o},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+o+"&metadata_name="};return n},initialize:function(n){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));this._createTypeId();this.on("change:id",this._createTypeId);if(!this.get("accessible")){this.set("state",m.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(o,n){this.log(this+" has changed state:",o,n);if(this.inReadyState()){this.trigger("state:ready",o,n,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var n=_.contains(m.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||n)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(n){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},n)},undelete:function j(n){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},n)},hide:function d(n){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},n)},unhide:function i(n){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},n)},purge:function g(n){if(this.get("purged")){return jQuery.when()}n=n||{};n.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var o=this,p=jQuery.ajax(n);p.done(function(s,q,r){o.set({deleted:true,purged:true})});p.fail(function(u,q,t){var r=c("Unable to purge dataset");var s=("Removal of datasets by users is not allowed in this Galaxy instance");if(u.responseJSON&&u.responseJSON.error){r=u.responseJSON.error}else{if(u.responseText.indexOf(s)!==-1){r=s}}u.responseText=r;o.trigger("error",o,u,n,c(r),{error:r})});return p},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var n=this.get("id")||"";if(this.get("name")){n=this.get("hid")+' :"'+this.get("name")+'",'+n}return"HDA("+n+")"}});m.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};m.READY_STATES=[m.STATES.OK,m.STATES.EMPTY,m.STATES.PAUSED,m.STATES.FAILED_METADATA,m.STATES.NOT_VIEWABLE,m.STATES.DISCARDED,m.STATES.ERROR];m.NOT_READY_STATES=[m.STATES.UPLOAD,m.STATES.QUEUED,m.STATES.RUNNING,m.STATES.SETTING_METADATA,m.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(o,n){if(o.history_content_type=="dataset"){return new m(o,n)}else{if(o.history_content_type=="dataset_collection"){return new k(o,n)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(o,n){n=n||{};this.historyId=n.historyId},ids:function(){return this.map(function(n){return n.get("id")})},notReady:function(){return this.filter(function(n){return !n.inReadyState()})},running:function(){var n=[];this.each(function(o){if(!o.inReadyState()){n.push(o.get("id"))}});return n},getByHid:function(n){return _.first(this.filter(function(o){return o.get("hid")===n}))},getVisible:function(n,q,p){p=p||[];var o=new b(this.filter(function(r){return r.isVisible(n,q)}));_.each(p,function(r){if(!_.isFunction(r)){return}o=new b(o.filter(r))});return o},haveDetails:function(){return this.all(function(n){return n.hasDetails()})},fetchAllDetails:function(o){o=o||{};var n={details:"all"};o.data=(o.data)?(_.extend(o.data,n)):(n);return this.fetch(o)},ajaxQueue:function(q,p){var o=jQuery.Deferred(),n=this.length,s=[];if(!n){o.resolve([]);return o}var r=this.chain().reverse().map(function(u,t){return function(){var v=q.call(u,p);v.done(function(w){o.notify({curr:t,total:n,response:w,model:u})});v.always(function(w){s.push(w);if(r.length){r.shift()()}else{o.resolve(s)}})}}).value();r.shift()();return o},matches:function(n){return this.filter(function(o){return o.matches(n)})},set:function(p,n){var o=this;p=_.map(p,function(r){var s=o.get(r.id);if(!s){return r}var q=s.toJSON();_.extend(q,r);return q});Backbone.Collection.prototype.set.call(this,p,n)},promoteToHistoryDatasetCollection:function l(s,q,o){o=o||{};o.url=this.url();o.type="POST";var u=q;var r=[],n=null;if(q=="list"){this.chain().each(function(x){var v=x.attributes.name;var y=x.get("id");var w=x.attributes.history_content_type;if(w=="dataset"){if(u!="list"){console.log("Invalid collection type")}r.push({name:v,src:"hda",id:y})}else{if(u=="list"){u="list:"+x.attributes.collection_type}else{if(u!="list:"+x.attributes.collection_type){console.log("Invalid collection type")}}r.push({name:v,src:"hdca",id:y})}});n="New Dataset List"}else{if(q=="paired"){var p=this.ids();if(p.length!=2){}r.push({name:"forward",src:"hda",id:p[0]});r.push({name:"reverse",src:"hda",id:p[1]});n="New Dataset Pair"}}o.data={type:"dataset_collection",name:n,collection_type:u,element_identifiers:JSON.stringify(r),};var t=jQuery.ajax(o);t.done(function(x,v,w){s.refresh()});t.fail(function(x,v,w){if(x.responseJSON&&x.responseJSON.error){error=x.responseJSON.error}else{error=x.responseJSON}x.responseText=error});return t},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var k=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:m,HDACollection:b}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/history/history-model.js
--- a/static/scripts/packed/mvc/history/history-model.js
+++ b/static/scripts/packed/mvc/history/history-model.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(c,a,b){var e=Backbone.Model.extend(a.LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",initialize:function(h,i,g){g=g||{};this.logger=g.logger||null;this.log(this+".initialize:",h,i,g);this.hdas=new c.HDACollection(i||[],{historyId:this.get("id")});if(i&&_.isArray(i)){this.hdas.reset(i)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(h,k,g,j,i){this.errorHandler(h,k,g,j,i)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(h,g){if(this.hdas){this.hdas.historyId=g}},this)},errorHandler:function(h,k,g,j,i){this.clearUpdateTimeout()},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(g,h){return g+h},0)},checkForUpdates:function(g){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(g)){g.call(this)}}return this},setUpdateTimeout:function(g){g=g||e.UPDATE_DELAY;var h=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){h.refresh()},g);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(h,g){h=h||[];g=g||{};var i=this;g.data=g.data||{};if(h.length){g.data.details=h.join(",")}var j=this.hdas.fetch(g);j.done(function(k){i.checkForUpdates(function(){this.fetch()})});return j},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});e.UPDATE_DELAY=4000;e.getHistoryData=function f(h,r){r=r||{};var l=r.hdaDetailIds||[];var n=jQuery.Deferred(),m=null;function i(s){return jQuery.ajax(galaxy_config.root+"api/histories/"+h)}function g(s){if(!s||!s.state_ids){return 0}return _.reduce(s.state_ids,function(t,v,u){return t+v.length},0)}function q(t){if(!g(t)){return[]}if(_.isFunction(l)){l=l(t)}var s=(l.length)?({details:l.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+t.id+"/contents",{data:s})}var p=r.historyFn||i,o=r.hdaFn||q;var k=p(h);k.done(function(s){m=s;n.notify({status:"history data retrieved",historyJSON:m})});k.fail(function(u,s,t){n.reject(u,"loading the history")});var j=k.then(o);j.then(function(s){n.notify({status:"dataset data retrieved",historyJSON:m,hdaJSON:s});n.resolve(m,s)});j.fail(function(u,s,t){n.reject(u,"loading the datasets",{history:m})});return n};var d=Backbone.Collection.extend(a.LoggableMixin).extend({model:e,urlRoot:galaxy_config.root+"api/histories"});return{History:e,HistoryCollection:d}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(c,a,b){var e=Backbone.Model.extend(a.LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",initialize:function(h,i,g){g=g||{};this.logger=g.logger||null;this.log(this+".initialize:",h,i,g);this.hdas=new c.HDACollection(i||[],{historyId:this.get("id")});if(i&&_.isArray(i)){this.hdas.reset(i)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(h,k,g,j,i){this.errorHandler(h,k,g,j,i)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(h,g){if(this.hdas){this.hdas.historyId=g}},this)},errorHandler:function(h,k,g,j,i){this.clearUpdateTimeout()},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(g,h){return g+h},0)},checkForUpdates:function(g){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(g)){g.call(this)}}return this},setUpdateTimeout:function(g){g=g||e.UPDATE_DELAY;var h=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){h.refresh()},g);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(h,g){h=h||[];g=g||{};var i=this;g.data=g.data||{};if(h.length){g.data.details=h.join(",")}var j=this.hdas.fetch(g);j.done(function(k){i.checkForUpdates(function(){this.fetch()})});return j},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});e.UPDATE_DELAY=4000;e.getHistoryData=function f(h,s){s=s||{};var m=s.hdaDetailIds||[];var j=s.hdcaDetailIds||[];var o=jQuery.Deferred(),n=null;function i(t){return jQuery.ajax(galaxy_config.root+"api/histories/"+h)}function g(t){if(!t||!t.state_ids){return 0}return _.reduce(t.state_ids,function(u,w,v){return u+w.length},0)}function r(u){if(!g(u)){return[]}if(_.isFunction(m)){m=m(u)}if(_.isFunction(j)){j=j(u)}var t={};if(m.length){t.dataset_details=m.join(",")}if(j.length){t.dataset_collection_details=j.join(",")}return jQuery.ajax(galaxy_config.root+"api/histories/"+u.id+"/contents",{data:t})}var q=s.historyFn||i,p=s.hdaFn||r;var l=q(h);l.done(function(t){n=t;o.notify({status:"history data retrieved",historyJSON:n})});l.fail(function(v,t,u){o.reject(v,"loading the history")});var k=l.then(p);k.then(function(t){o.notify({status:"dataset data retrieved",historyJSON:n,hdaJSON:t});o.resolve(n,t)});k.fail(function(v,t,u){o.reject(v,"loading the datasets",{history:n})});return o};var d=Backbone.Collection.extend(a.LoggableMixin).extend({model:e,urlRoot:galaxy_config.root+"api/histories"});return{History:e,HistoryCollection:d}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 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/collection/dataset-collection-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations","utils/localization"],function(f,b,h,d,a,c,e){var g=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(i){i=i||{};this.selectedHdaIds=[];this.lastSelectedViewId=null;this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=i.purgeAllowed||false;this.selecting=i.selecting||false;this.annotationEditorShown=i.annotationEditorShown||false;this.tagsEditorShown=i.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,i)},_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(i){this.model.fetch()},this)},renderModel:function(){var i=$("<div/>");i.append(g.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(i).text(this.emptyMsg);if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(i);this._renderAnnotation(i)}i.find(".history-secondary-actions").prepend(this._renderSelectButton());i.find(".history-dataset-actions").toggle(this.selecting);i.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(i);this.renderHdas(i);return i},_renderTags:function(i){var j=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:i.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDATagEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDATagEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(i.find(".history-secondary-actions"))})},_renderAnnotation:function(i){var j=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:i.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDAAnnotationEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDAAnnotationEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(i.find(".history-secondary-actions"))})},_renderSelectButton:function(i){return faIconButton({title:e("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(i){i=i||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,i);if(!this.model){return}this._setUpDatasetActionsPopup(i);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var j=this;i.find(".history-name").attr("title",e("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(k){var l=j.model.get("name");if(k&&k!==l){j.$el.find(".history-name").text(k);j.model.save({name:k}).fail(function(){j.$el.find(".history-name").text(j.model.previous("name"))})}else{j.$el.find(".history-name").text(l)}}})},_setUpDatasetActionsPopup:function(i){var j=this,k=[{html:e("Hide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.hide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Unhide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.unhide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Delete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype["delete"];j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Undelete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.undelete;j.getSelectedHdaCollection().ajaxQueue(l)}}];if(j.purgeAllowed){k.push({html:e("Permanently delete datasets"),func:function(){if(confirm(e("This will permanently remove the data in your datasets. Are you sure?"))){var l=f.HistoryDatasetAssociation.prototype.purge;j.getSelectedHdaCollection().ajaxQueue(l)}}})}k.push({html:e("Build Dataset List (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"list")}});k.push({html:e("Build Dataset Pair (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"paired")}});return new PopupMenu(i.find(".history-dataset-action-popup-btn"),k)},_handleHdaDeletionChange:function(i){if(i.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[i.id])}},_handleHdaVisibleChange:function(i){if(i.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[i.id])}},_createContentView:function(j){var i=j.get("id"),l=j.get("history_content_type"),k=null;if(l==="dataset"){k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],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)})}else{if(l==="dataset_collection"){k=new h.DatasetCollectionEditView({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}}this._setUpHdaListeners(k);return k},_setUpHdaListeners:function(j){var i=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,j);j.on("selected",function(m,l){if(!l){return}var k=[];if((l.shiftKey)&&(i.lastSelectedViewId&&_.has(i.hdaViews,i.lastSelectedViewId))){var o=i.hdaViews[i.lastSelectedViewId];k=i.selectDatasetRange(m,o).map(function(p){return p.model.id})}else{var n=m.model.get("id");i.lastSelectedViewId=n;k=[n]}i.selectedHdaIds=_.union(i.selectedHdaIds,k)});j.on("de-selected",function(l,k){var m=l.model.get("id");i.selectedHdaIds=_.without(i.selectedHdaIds,m)})},toggleHDATagEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.tagsEditor){k.tagsEditor.toggle.apply(k.tagsEditor,j)}})},toggleHDAAnnotationEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.annotationEditor){k.annotationEditor.toggle.apply(k.annotationEditor,j)}})},removeHdaView:function(j){if(!j){return}var i=this;j.$el.fadeOut(i.fxSpeed,function(){j.off();j.remove();delete i.hdaViews[j.model.id];if(_.isEmpty(i.hdaViews)){i.trigger("empty-history",i);i._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(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(i);_.each(this.hdaViews,function(j){j.showSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},hideSelectors:function(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(i);_.each(this.hdaViews,function(j){j.hideSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(i){_.each(this.hdaViews,function(j){j.select(i)})},deselectAllDatasets:function(i){this.lastSelectedViewId=null;_.each(this.hdaViews,function(j){j.deselect(i)})},selectDatasetRange:function(k,j){var i=this.hdaViewRange(k,j);_.each(i,function(l){l.select()});return i},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(i){return i.selected})},getSelectedHdaCollection:function(){return new f.HDACollection(_.map(this.getSelectedHdaViews(),function(i){return i.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/collection/dataset-collection-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations","utils/localization"],function(f,b,h,d,a,c,e){var g=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(i){i=i||{};this.selectedHdaIds=[];this.lastSelectedViewId=null;this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=i.purgeAllowed||false;this.selecting=i.selecting||false;this.annotationEditorShown=i.annotationEditorShown||false;this.tagsEditorShown=i.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,i)},_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(i){this.model.fetch()},this)},renderModel:function(){var i=$("<div/>");i.append(g.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(i).text(this.emptyMsg);if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(i);this._renderAnnotation(i)}i.find(".history-secondary-actions").prepend(this._renderSelectButton());i.find(".history-dataset-actions").toggle(this.selecting);i.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(i);this.renderHdas(i);return i},_renderTags:function(i){var j=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:i.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDATagEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDATagEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(i.find(".history-secondary-actions"))})},_renderAnnotation:function(i){var j=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:i.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDAAnnotationEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDAAnnotationEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(i.find(".history-secondary-actions"))})},_renderSelectButton:function(i){return faIconButton({title:e("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(i){i=i||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,i);if(!this.model){return}this._setUpDatasetActionsPopup(i);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var j=this;i.find(".history-name").attr("title",e("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(k){var l=j.model.get("name");if(k&&k!==l){j.$el.find(".history-name").text(k);j.model.save({name:k}).fail(function(){j.$el.find(".history-name").text(j.model.previous("name"))})}else{j.$el.find(".history-name").text(l)}}})},_setUpDatasetActionsPopup:function(i){var j=this,k=[{html:e("Hide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.hide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Unhide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.unhide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Delete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype["delete"];j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Undelete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.undelete;j.getSelectedHdaCollection().ajaxQueue(l)}}];if(j.purgeAllowed){k.push({html:e("Permanently delete datasets"),func:function(){if(confirm(e("This will permanently remove the data in your datasets. Are you sure?"))){var l=f.HistoryDatasetAssociation.prototype.purge;j.getSelectedHdaCollection().ajaxQueue(l)}}})}k.push({html:e("Build Dataset List (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"list")}});k.push({html:e("Build Dataset Pair (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"paired")}});return new PopupMenu(i.find(".history-dataset-action-popup-btn"),k)},_handleHdaDeletionChange:function(i){if(i.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[i.id])}},_handleHdaVisibleChange:function(i){if(i.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[i.id])}},_createContentView:function(j){var i=j.id,l=j.get("history_content_type"),k=null;if(l==="dataset"){k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],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)})}else{if(l==="dataset_collection"){k=new h.DatasetCollectionEditView({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}}this._setUpHdaListeners(k);return k},_setUpHdaListeners:function(j){var i=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,j);j.on("selected",function(m,l){if(!l){return}var k=[];if((l.shiftKey)&&(i.lastSelectedViewId&&_.has(i.hdaViews,i.lastSelectedViewId))){var o=i.hdaViews[i.lastSelectedViewId];k=i.selectDatasetRange(m,o).map(function(p){return p.model.id})}else{var n=m.model.id;i.lastSelectedViewId=n;k=[n]}i.selectedHdaIds=_.union(i.selectedHdaIds,k)});j.on("de-selected",function(l,k){var m=l.model.id;i.selectedHdaIds=_.without(i.selectedHdaIds,m)})},toggleHDATagEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.tagsEditor){k.tagsEditor.toggle.apply(k.tagsEditor,j)}})},toggleHDAAnnotationEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.annotationEditor){k.annotationEditor.toggle.apply(k.annotationEditor,j)}})},removeHdaView:function(j){if(!j){return}var i=this;j.$el.fadeOut(i.fxSpeed,function(){j.off();j.remove();delete i.hdaViews[j.model.id];if(_.isEmpty(i.hdaViews)){i.trigger("empty-history",i);i._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(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(i);_.each(this.hdaViews,function(j){j.showSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},hideSelectors:function(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(i);_.each(this.hdaViews,function(j){j.hideSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(i){_.each(this.hdaViews,function(j){j.select(i)})},deselectAllDatasets:function(i){this.lastSelectedViewId=null;_.each(this.hdaViews,function(j){j.deselect(i)})},selectDatasetRange:function(k,j){var i=this.hdaViewRange(k,j);_.each(i,function(l){l.select()});return i},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(i){return i.selected})},getSelectedHdaCollection:function(){return new f.HDACollection(_.map(this.getSelectedHdaViews(),function(i){return i.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 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/history/readonly-history-panel.js
--- a/static/scripts/packed/mvc/history/readonly-history-panel.js
+++ b/static/scripts/packed/mvc/history/readonly-history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/collection/dataset-collection-base","mvc/dataset/hda-base","mvc/user/user-model","mvc/base-mvc","utils/localization"],function(g,k,b,a,f,d){var i=f.SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(n){var m="expandedHdas";this.save(m,_.extend(this.get(m),_.object([n],[true])))},removeExpandedHda:function(n){var m="expandedHdas";this.save(m,_.omit(this.get(m),n))},toString:function(){return"HistoryPrefs("+this.id+")"}});i.storageKeyPrefix="history:";i.historyStorageKey=function e(m){if(!m){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+m)}return(i.storageKeyPrefix+m)};i.get=function c(m){return new i({id:i.historyStorageKey(m)})};i.clearAll=function h(n){for(var m in sessionStorage){if(m.indexOf(i.storageKeyPrefix)===0){sessionStorage.removeItem(m)}}};var j=Backbone.View.extend(f.LoggableMixin).extend({HDAViewClass:b.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",emptyMsg:d("This history is empty"),noneFoundMsg:d("No matching datasets found"),initialize:function(m){m=m||{};if(m.logger){this.logger=m.logger}this.log(this+".initialize:",m);this.linkTarget=m.linkTarget||"_blank";this.fxSpeed=_.has(m,"fxSpeed")?(m.fxSpeed):(this.fxSpeed);this.filters=[];this.searchFor="";this.findContainerFn=m.findContainerFn;this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this._setUpListeners();var n=_.pick(m,"initiallyExpanded","show_deleted","show_hidden");this.setModel(this.model,n,false);if(m.onready){m.onready.call(this)}},_setUpListeners:function(){this.on("error",function(n,q,m,p,o){this.errorHandler(n,q,m,p,o)});this.on("loading-history",function(){this._showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this._hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(m){this.log(this+"",arguments)},this)}return this},errorHandler:function(o,r,n,q,p){console.error(o,r,n,q,p);if(r&&r.status===0&&r.readyState===0){}else{if(r&&r.status===502){}else{var m=this._parseErrorMessage(o,r,n,q,p);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",m.message,m.details)})}else{this.displayMessage("error",m.message,m.details)}}}},_parseErrorMessage:function(p,t,o,s,r){var n=Galaxy.currUser,m={message:this._bePolite(s),details:{user:(n instanceof a.User)?(n.toJSON()):(n+""),source:(p instanceof Backbone.Model)?(p.toJSON()):(p+""),xhr:t,options:(t)?(_.omit(o,"xhr")):(o)}};_.extend(m.details,r||{});if(t&&_.isFunction(t.getAllResponseHeaders)){var q=t.getAllResponseHeaders();q=_.compact(q.split("\n"));q=_.map(q,function(u){return u.split(": ")});m.details.xhr.responseHeaders=_.object(q)}return m},_bePolite:function(m){m=m||d("An error occurred while getting updates from the server");return m+". "+d("Please contact a Galaxy administrator if the problem persists")+"."},loadHistoryWithHDADetails:function(o,n,m,q){var p=function(r){return _.keys(i.get(r.id).get("expandedHdas"))};return this.loadHistory(o,n,m,q,p)},loadHistory:function(p,o,n,s,q){var m=this;o=o||{};m.trigger("loading-history",m);var r=g.History.getHistoryData(p,{historyFn:n,hdaFn:s,hdaDetailIds:o.initiallyExpanded||q});return m._loadHistoryFromXHR(r,o).fail(function(v,t,u){m.trigger("error",m,v,o,d("An error was encountered while "+t),{historyId:p,history:u||{}})}).always(function(){m.trigger("loading-done",m)})},_loadHistoryFromXHR:function(o,n){var m=this;o.then(function(p,q){m.JSONToModel(p,q,n)});o.fail(function(q,p){m.render()});return o},JSONToModel:function(p,m,n){this.log("JSONToModel:",p,m,n);n=n||{};var o=new g.History(p,m,n);this.setModel(o);return this},setModel:function(n,m,o){m=m||{};o=(o!==undefined)?(o):(true);this.log("setModel:",n,m,o);this.freeModel();this.selectedHdaIds=[];if(n){this.model=n;if(this.logger){this.model.logger=this.logger}this._setUpWebStorage(m.initiallyExpanded,m.show_deleted,m.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this)}if(o){this.render()}return this},freeModel:function(){if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.freeHdaViews();return this},freeHdaViews:function(){this.hdaViews={};return this},_setUpWebStorage:function(n,m,o){this.storage=new i({id:i.historyStorageKey(this.model.get("id"))});if(_.isObject(n)){this.storage.set("exandedHdas",n)}if(_.isBoolean(m)){this.storage.set("show_deleted",m)}if(_.isBoolean(o)){this.storage.set("show_hidden",o)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());return this},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addContentView,this);this.model.on("error error:hdas",function(n,p,m,o){this.errorHandler(n,p,m,o)},this);return this},render:function(o,p){this.log("render:",o,p);o=(o===undefined)?(this.fxSpeed):(o);var m=this,n;if(this.model){n=this.renderModel()}else{n=this.renderWithoutModel()}$(m).queue("fx",[function(q){if(o&&m.$el.is(":visible")){m.$el.fadeOut(o,q)}else{q()}},function(q){m.$el.empty();if(n){m.$el.append(n.children())}q()},function(q){if(o&&!m.$el.is(":visible")){m.$el.fadeIn(o,q)}else{q()}},function(q){if(p){p.call(this)}m.trigger("rendered",this);q()}]);return this},renderWithoutModel:function(){var m=$("<div/>"),n=$("<div/>").addClass("message-container").css({margin:"4px"});return m.append(n)},renderModel:function(){var m=$("<div/>");m.append(j.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(m).text(this.emptyMsg);m.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(m);this.renderHdas(m);return m},_renderEmptyMsg:function(o){var n=this,m=n.$emptyMessage(o);if(!_.isEmpty(n.hdaViews)){m.hide()}else{if(n.searchFor){m.text(n.noneFoundMsg).show()}else{m.text(n.emptyMsg).show()}}return this},_renderSearchButton:function(m){return faIconButton({title:d("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(m){m=m||this.$el;m.find("[title]").tooltip({placement:"bottom"});this._setUpSearchInput(m.find(".history-search-controls .history-search-input"));return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(m){return(m||this.$el).find(".datasets-list")},$messages:function(m){return(m||this.$el).find(".message-container")},$emptyMessage:function(m){return(m||this.$el).find(".empty-history-message")},renderHdas:function(n){n=n||this.$el;var m=this,p={},o=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);this.$datasetsList(n).empty();if(o.length){o.each(function(r){var q=r.get("id"),s=m._createContentView(r);p[q]=s;if(_.contains(m.selectedHdaIds,q)){s.selected=true}m.attachContentView(s.render(),n)})}this.hdaViews=p;this._renderEmptyMsg(n);return this.hdaViews},_createContentView:function(n){var m=n.get("id"),p=n.get("history_content_type"),o=null;if(p==="dataset"){o=new this.HDAViewClass({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}else{o=new k.DatasetCollectionBaseView({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}this._setUpHdaListeners(o);return o},_setUpHdaListeners:function(n){var m=this;n.on("error",function(p,r,o,q){m.errorHandler(p,r,o,q)});n.on("body-expanded",function(o){m.storage.addExpandedHda(o)});n.on("body-collapsed",function(o){m.storage.removeExpandedHda(o)});return this},attachContentView:function(o,n){n=n||this.$el;var m=this.$datasetsList(n);m.prepend(o.$el);return this},addContentView:function(p){this.log("add."+this,p);var n=this;if(!p.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return n}$({}).queue([function o(r){var q=n.$emptyMessage();if(q.is(":visible")){q.fadeOut(n.fxSpeed,r)}else{r()}},function m(q){var r=n._createContentView(p);n.hdaViews[p.id]=r;r.render().$el.hide();n.scrollToTop();n.attachContentView(r);r.$el.slideDown(n.fxSpeed)}]);return n},refreshContents:function(n,m){if(this.model){return this.model.refresh(n,m)}return $.when()},hdaViewRange:function(p,o){if(p===o){return[p]}var m=this,n=false,q=[];this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters).each(function(r){if(n){q.push(m.hdaViews[r.id]);if(r===p.model||r===o.model){n=false}}else{if(r===p.model||r===o.model){n=true;q.push(m.hdaViews[r.id])}}});return q},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(m){m.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{});return this},toggleShowDeleted:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_deleted"));this.storage.set("show_deleted",m);this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_hidden"));this.storage.set("show_hidden",m);this.renderHdas();return this.storage.get("show_hidden")},_setUpSearchInput:function(n){var o=this,p=".history-search-input";function m(q){if(o.model.hdas.haveDetails()){o.searchHdas(q);return}o.$el.find(p).searchInput("toggle-loading");o.model.hdas.fetchAllDetails({silent:true}).always(function(){o.$el.find(p).searchInput("toggle-loading")}).done(function(){o.searchHdas(q)})}n.searchInput({initialVal:o.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:m,onsearch:_.bind(this.searchHdas,this),onclear:_.bind(this.clearHdaSearch,this)});return n},toggleSearchControls:function(o,m){var n=this.$el.find(".history-search-controls"),p=(jQuery.type(o)==="number")?(o):(this.fxSpeed);m=(m!==undefined)?(m):(!n.is(":visible"));if(m){n.slideDown(p,function(){$(this).find("input").focus()})}else{n.slideUp(p)}return m},searchHdas:function(m){var n=this;this.searchFor=m;this.filters=[function(o){return o.matchesAll(n.searchFor)}];this.trigger("search:searching",m,this);this.renderHdas();return this},clearHdaSearch:function(m){this.searchFor="";this.filters=[];this.trigger("search:clear",this);this.renderHdas();return this},_showLoadingIndicator:function(n,m,o){m=(m!==undefined)?(m):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,o)}else{this.$el.fadeOut(m);this.indicator.show(n,m,o)}},_hideLoadingIndicator:function(m,n){m=(m!==undefined)?(m):(this.fxSpeed);if(this.indicator){this.indicator.hide(m,n)}},displayMessage:function(r,s,q){var o=this;this.scrollToTop();var p=this.$messages(),m=$("<div/>").addClass(r+"message").html(s);if(!_.isEmpty(q)){var n=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(o._messageToModalOptions(r,s,q));return false});m.append(" ",n)}return p.html(m)},_messageToModalOptions:function(q,s,p){var m=this,r=$("<div/>"),o={title:"Details"};function n(t){t=_.omit(t,_.functions(t));return["<table>",_.map(t,function(v,u){v=(_.isObject(v))?(n(v)):(v);return'<tr><td style="vertical-align: top; color: grey">'+u+'</td><td style="padding-left: 8px">'+v+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(p)){o.body=r.append(n(p))}else{o.body=r.html(p)}o.buttons={Ok:function(){Galaxy.modal.hide();m.clearMessages()}};return o},clearMessages:function(){this.$messages().empty();return this},scrollPosition:function(){return this.$container().scrollTop()},scrollTo:function(m){this.$container().scrollTop(m);return this},scrollToTop:function(){this.$container().scrollTop(0);return this},scrollToId:function(n){if((!n)||(!this.hdaViews[n])){return this}var m=this.hdaViews[n];this.scrollTo(m.el.offsetTop);return this},scrollToHid:function(m){var n=this.model.hdas.getByHid(m);if(!n){return this}return this.scrollToId(n.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var l=['<div class="history-controls">','<div class="history-search-controls">','<div class="history-search-input"></div>',"</div>",'<div class="history-title">',"<% if( history.name ){ %>",'<div class="history-name"><%= history.name %></div>',"<% } %>","</div>",'<div class="history-subtitle clear">',"<% if( history.nice_size ){ %>",'<div class="history-size"><%= history.nice_size %></div>',"<% } %>",'<div class="history-secondary-actions"></div>',"</div>","<% if( history.deleted ){ %>",'<div class="warningmessagesmall"><strong>',d("You are currently viewing a deleted history!"),"</strong></div>","<% } %>",'<div class="message-container">',"<% if( history.message ){ %>",'<div class="<%= history.status %>message"><%= history.message %></div>',"<% } %>","</div>",'<div class="quota-message errormessage">',d("You are over your disk quota"),". ",d("Tool execution is on hold until your disk usage drops below your allocated quota"),".","</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="history-dataset-actions">','<div class="btn-group">','<button class="history-select-all-datasets-btn btn btn-default"','data-mode="select">',d("All"),"</button>",'<button class="history-deselect-all-datasets-btn btn btn-default"','data-mode="select">',d("None"),"</button>","</div>",'<button class="history-dataset-action-popup-btn btn btn-default">',d("For all selected"),"...</button>","</div>","</div>",'<div class="datasets-list"></div>','<div class="empty-history-message infomessagesmall">',d("This history is empty"),"</div>"].join("");j.templates={historyPanel:function(m){return _.template(l,m,{variable:"history"})}};return{ReadOnlyHistoryPanel:j}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/collection/dataset-collection-base","mvc/dataset/hda-base","mvc/user/user-model","mvc/base-mvc","utils/localization"],function(g,k,b,a,f,d){var i=f.SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(m){var n="expandedHdas";this.save(n,_.extend(this.get(n),_.object([m.id],[m.get("id")])))},removeExpandedHda:function(n){var m="expandedHdas";this.save(m,_.omit(this.get(m),n))},toString:function(){return"HistoryPrefs("+this.id+")"}});i.storageKeyPrefix="history:";i.historyStorageKey=function e(m){if(!m){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+m)}return(i.storageKeyPrefix+m)};i.get=function c(m){return new i({id:i.historyStorageKey(m)})};i.clearAll=function h(n){for(var m in sessionStorage){if(m.indexOf(i.storageKeyPrefix)===0){sessionStorage.removeItem(m)}}};var j=Backbone.View.extend(f.LoggableMixin).extend({HDAViewClass:b.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",emptyMsg:d("This history is empty"),noneFoundMsg:d("No matching datasets found"),initialize:function(m){m=m||{};if(m.logger){this.logger=m.logger}this.log(this+".initialize:",m);this.linkTarget=m.linkTarget||"_blank";this.fxSpeed=_.has(m,"fxSpeed")?(m.fxSpeed):(this.fxSpeed);this.filters=[];this.searchFor="";this.findContainerFn=m.findContainerFn;this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this._setUpListeners();var n=_.pick(m,"initiallyExpanded","show_deleted","show_hidden");this.setModel(this.model,n,false);if(m.onready){m.onready.call(this)}},_setUpListeners:function(){this.on("error",function(n,q,m,p,o){this.errorHandler(n,q,m,p,o)});this.on("loading-history",function(){this._showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this._hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(m){this.log(this+"",arguments)},this)}return this},errorHandler:function(o,r,n,q,p){console.error(o,r,n,q,p);if(r&&r.status===0&&r.readyState===0){}else{if(r&&r.status===502){}else{var m=this._parseErrorMessage(o,r,n,q,p);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",m.message,m.details)})}else{this.displayMessage("error",m.message,m.details)}}}},_parseErrorMessage:function(p,t,o,s,r){var n=Galaxy.currUser,m={message:this._bePolite(s),details:{user:(n instanceof a.User)?(n.toJSON()):(n+""),source:(p instanceof Backbone.Model)?(p.toJSON()):(p+""),xhr:t,options:(t)?(_.omit(o,"xhr")):(o)}};_.extend(m.details,r||{});if(t&&_.isFunction(t.getAllResponseHeaders)){var q=t.getAllResponseHeaders();q=_.compact(q.split("\n"));q=_.map(q,function(u){return u.split(": ")});m.details.xhr.responseHeaders=_.object(q)}return m},_bePolite:function(m){m=m||d("An error occurred while getting updates from the server");return m+". "+d("Please contact a Galaxy administrator if the problem persists")+"."},loadHistoryWithHDADetails:function(o,n,m,q){var p=function(r){return _.values(i.get(r.id).get("expandedHdas"))};return this.loadHistory(o,n,m,q,p)},loadHistory:function(p,o,n,s,q){var m=this;o=o||{};m.trigger("loading-history",m);var r=g.History.getHistoryData(p,{historyFn:n,hdaFn:s,hdaDetailIds:o.initiallyExpanded||q});return m._loadHistoryFromXHR(r,o).fail(function(v,t,u){m.trigger("error",m,v,o,d("An error was encountered while "+t),{historyId:p,history:u||{}})}).always(function(){m.trigger("loading-done",m)})},_loadHistoryFromXHR:function(o,n){var m=this;o.then(function(p,q){m.JSONToModel(p,q,n)});o.fail(function(q,p){m.render()});return o},JSONToModel:function(p,m,n){this.log("JSONToModel:",p,m,n);n=n||{};var o=new g.History(p,m,n);this.setModel(o);return this},setModel:function(n,m,o){m=m||{};o=(o!==undefined)?(o):(true);this.log("setModel:",n,m,o);this.freeModel();this.selectedHdaIds=[];if(n){this.model=n;if(this.logger){this.model.logger=this.logger}this._setUpWebStorage(m.initiallyExpanded,m.show_deleted,m.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this)}if(o){this.render()}return this},freeModel:function(){if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.freeHdaViews();return this},freeHdaViews:function(){this.hdaViews={};return this},_setUpWebStorage:function(n,m,o){this.storage=new i({id:i.historyStorageKey(this.model.get("id"))});if(_.isObject(n)){this.storage.set("exandedHdas",n)}if(_.isBoolean(m)){this.storage.set("show_deleted",m)}if(_.isBoolean(o)){this.storage.set("show_hidden",o)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());return this},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addContentView,this);this.model.on("error error:hdas",function(n,p,m,o){this.errorHandler(n,p,m,o)},this);return this},render:function(o,p){this.log("render:",o,p);o=(o===undefined)?(this.fxSpeed):(o);var m=this,n;if(this.model){n=this.renderModel()}else{n=this.renderWithoutModel()}$(m).queue("fx",[function(q){if(o&&m.$el.is(":visible")){m.$el.fadeOut(o,q)}else{q()}},function(q){m.$el.empty();if(n){m.$el.append(n.children())}q()},function(q){if(o&&!m.$el.is(":visible")){m.$el.fadeIn(o,q)}else{q()}},function(q){if(p){p.call(this)}m.trigger("rendered",this);q()}]);return this},renderWithoutModel:function(){var m=$("<div/>"),n=$("<div/>").addClass("message-container").css({margin:"4px"});return m.append(n)},renderModel:function(){var m=$("<div/>");m.append(j.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(m).text(this.emptyMsg);m.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(m);this.renderHdas(m);return m},_renderEmptyMsg:function(o){var n=this,m=n.$emptyMessage(o);if(!_.isEmpty(n.hdaViews)){m.hide()}else{if(n.searchFor){m.text(n.noneFoundMsg).show()}else{m.text(n.emptyMsg).show()}}return this},_renderSearchButton:function(m){return faIconButton({title:d("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(m){m=m||this.$el;m.find("[title]").tooltip({placement:"bottom"});this._setUpSearchInput(m.find(".history-search-controls .history-search-input"));return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(m){return(m||this.$el).find(".datasets-list")},$messages:function(m){return(m||this.$el).find(".message-container")},$emptyMessage:function(m){return(m||this.$el).find(".empty-history-message")},renderHdas:function(n){n=n||this.$el;var m=this,p={},o=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);this.$datasetsList(n).empty();if(o.length){o.each(function(r){var q=r.id,s=m._createContentView(r);p[q]=s;if(_.contains(m.selectedHdaIds,q)){s.selected=true}m.attachContentView(s.render(),n)})}this.hdaViews=p;this._renderEmptyMsg(n);return this.hdaViews},_createContentView:function(n){var m=n.id,p=n.get("history_content_type"),o=null;if(p==="dataset"){o=new this.HDAViewClass({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}else{o=new k.DatasetCollectionBaseView({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}this._setUpHdaListeners(o);return o},_setUpHdaListeners:function(n){var m=this;n.on("error",function(p,r,o,q){m.errorHandler(p,r,o,q)});n.on("body-expanded",function(o){m.storage.addExpandedHda(o)});n.on("body-collapsed",function(o){m.storage.removeExpandedHda(o)});return this},attachContentView:function(o,n){n=n||this.$el;var m=this.$datasetsList(n);m.prepend(o.$el);return this},addContentView:function(p){this.log("add."+this,p);var n=this;if(!p.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return n}$({}).queue([function o(r){var q=n.$emptyMessage();if(q.is(":visible")){q.fadeOut(n.fxSpeed,r)}else{r()}},function m(q){var r=n._createContentView(p);n.hdaViews[p.id]=r;r.render().$el.hide();n.scrollToTop();n.attachContentView(r);r.$el.slideDown(n.fxSpeed)}]);return n},refreshContents:function(n,m){if(this.model){return this.model.refresh(n,m)}return $.when()},hdaViewRange:function(p,o){if(p===o){return[p]}var m=this,n=false,q=[];this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters).each(function(r){if(n){q.push(m.hdaViews[r.id]);if(r===p.model||r===o.model){n=false}}else{if(r===p.model||r===o.model){n=true;q.push(m.hdaViews[r.id])}}});return q},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(m){m.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{});return this},toggleShowDeleted:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_deleted"));this.storage.set("show_deleted",m);this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_hidden"));this.storage.set("show_hidden",m);this.renderHdas();return this.storage.get("show_hidden")},_setUpSearchInput:function(n){var o=this,p=".history-search-input";function m(q){if(o.model.hdas.haveDetails()){o.searchHdas(q);return}o.$el.find(p).searchInput("toggle-loading");o.model.hdas.fetchAllDetails({silent:true}).always(function(){o.$el.find(p).searchInput("toggle-loading")}).done(function(){o.searchHdas(q)})}n.searchInput({initialVal:o.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:m,onsearch:_.bind(this.searchHdas,this),onclear:_.bind(this.clearHdaSearch,this)});return n},toggleSearchControls:function(o,m){var n=this.$el.find(".history-search-controls"),p=(jQuery.type(o)==="number")?(o):(this.fxSpeed);m=(m!==undefined)?(m):(!n.is(":visible"));if(m){n.slideDown(p,function(){$(this).find("input").focus()})}else{n.slideUp(p)}return m},searchHdas:function(m){var n=this;this.searchFor=m;this.filters=[function(o){return o.matchesAll(n.searchFor)}];this.trigger("search:searching",m,this);this.renderHdas();return this},clearHdaSearch:function(m){this.searchFor="";this.filters=[];this.trigger("search:clear",this);this.renderHdas();return this},_showLoadingIndicator:function(n,m,o){m=(m!==undefined)?(m):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,o)}else{this.$el.fadeOut(m);this.indicator.show(n,m,o)}},_hideLoadingIndicator:function(m,n){m=(m!==undefined)?(m):(this.fxSpeed);if(this.indicator){this.indicator.hide(m,n)}},displayMessage:function(r,s,q){var o=this;this.scrollToTop();var p=this.$messages(),m=$("<div/>").addClass(r+"message").html(s);if(!_.isEmpty(q)){var n=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(o._messageToModalOptions(r,s,q));return false});m.append(" ",n)}return p.html(m)},_messageToModalOptions:function(q,s,p){var m=this,r=$("<div/>"),o={title:"Details"};function n(t){t=_.omit(t,_.functions(t));return["<table>",_.map(t,function(v,u){v=(_.isObject(v))?(n(v)):(v);return'<tr><td style="vertical-align: top; color: grey">'+u+'</td><td style="padding-left: 8px">'+v+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(p)){o.body=r.append(n(p))}else{o.body=r.html(p)}o.buttons={Ok:function(){Galaxy.modal.hide();m.clearMessages()}};return o},clearMessages:function(){this.$messages().empty();return this},scrollPosition:function(){return this.$container().scrollTop()},scrollTo:function(m){this.$container().scrollTop(m);return this},scrollToTop:function(){this.$container().scrollTop(0);return this},scrollToId:function(n){if((!n)||(!this.hdaViews[n])){return this}var m=this.hdaViews[n];this.scrollTo(m.el.offsetTop);return this},scrollToHid:function(m){var n=this.model.hdas.getByHid(m);if(!n){return this}return this.scrollToId(n.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var l=['<div class="history-controls">','<div class="history-search-controls">','<div class="history-search-input"></div>',"</div>",'<div class="history-title">',"<% if( history.name ){ %>",'<div class="history-name"><%= history.name %></div>',"<% } %>","</div>",'<div class="history-subtitle clear">',"<% if( history.nice_size ){ %>",'<div class="history-size"><%= history.nice_size %></div>',"<% } %>",'<div class="history-secondary-actions"></div>',"</div>","<% if( history.deleted ){ %>",'<div class="warningmessagesmall"><strong>',d("You are currently viewing a deleted history!"),"</strong></div>","<% } %>",'<div class="message-container">',"<% if( history.message ){ %>",'<div class="<%= history.status %>message"><%= history.message %></div>',"<% } %>","</div>",'<div class="quota-message errormessage">',d("You are over your disk quota"),". ",d("Tool execution is on hold until your disk usage drops below your allocated quota"),".","</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="history-dataset-actions">','<div class="btn-group">','<button class="history-select-all-datasets-btn btn btn-default"','data-mode="select">',d("All"),"</button>",'<button class="history-deselect-all-datasets-btn btn btn-default"','data-mode="select">',d("None"),"</button>","</div>",'<button class="history-dataset-action-popup-btn btn btn-default">',d("For all selected"),"...</button>","</div>","</div>",'<div class="datasets-list"></div>','<div class="empty-history-message infomessagesmall">',d("This history is empty"),"</div>"].join("");j.templates={historyPanel:function(m){return _.template(l,m,{variable:"history"})}};return{ReadOnlyHistoryPanel:j}});
\ 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: dan: Handle update_state for Conditional tool parameters when a currently valid current_case value has not been provided.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ea6698177726/
Changeset: ea6698177726
User: dan
Date: 2014-06-13 19:30:23
Summary: Handle update_state for Conditional tool parameters when a currently valid current_case value has not been provided.
Affected #: 2 files
diff -r 8a608db6cf83b653a433f43b501f4047f63d248b -r ea6698177726a9e94931dcd818db52f5c0e2aec3 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2392,7 +2392,18 @@
# Get value of test param and determine current case
value, test_param_error = \
check_param( trans, input.test_param, test_incoming, context, source=source )
- current_case = input.get_current_case( value, trans )
+ try:
+ current_case = input.get_current_case( value, trans )
+ except ValueError, e:
+ #load default initial value
+ if not test_param_error:
+ test_param_error = str( e )
+ if trans is not None:
+ history = trans.get_history()
+ else:
+ history = None
+ value = input.test_param.get_initial_value( trans, context, history=history )
+ current_case = input.get_current_case( value, trans )
if current_case != old_current_case:
# Current case has changed, throw away old state
group_state = state[input.name] = {}
diff -r 8a608db6cf83b653a433f43b501f4047f63d248b -r ea6698177726a9e94931dcd818db52f5c0e2aec3 lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -472,7 +472,7 @@
for index, case in enumerate( self.cases ):
if str_value == case.value:
return index
- raise Exception( "No case matched value:", self.name, str_value )
+ raise ValueError( "No case matched value:", self.name, str_value )
def value_to_basic( self, value, app ):
rval = dict()
current_case = rval['__current_case__'] = value['__current_case__']
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: Small clarification in previous doc addition.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8a608db6cf83/
Changeset: 8a608db6cf83
User: jmchilton
Date: 2014-06-13 16:14:38
Summary: Small clarification in previous doc addition.
Affected #: 1 file
diff -r c9c07643e04ece14e27c07c4aa73b3578202c47b -r 8a608db6cf83b653a433f43b501f4047f63d248b lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -240,7 +240,8 @@
'content' = [the encoded id from the HDCA]
create new history dataset collection (for type 'dataset_collection')
- 'source' = 'new_collection'
+ 'source' = 'new_collection' (default 'source' if type is
+ 'dataset_collection' - no need to specify this)
'collection_type' = For example, "list", "paired", "list:paired".
'name' = Name of new dataset collection.
'element_identifiers' = Recursive list structure defining collection.
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: Add some quick docs for creating dataset collections through API.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c9c07643e04e/
Changeset: c9c07643e04e
User: jmchilton
Date: 2014-06-13 16:08:56
Summary: Add some quick docs for creating dataset collections through API.
For full worked examples see bioblend and API tests.
Affected #: 1 file
diff -r 05500f5c6710816865536335a42eb9e00caf6f03 -r c9c07643e04ece14e27c07c4aa73b3578202c47b lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -217,27 +217,54 @@
def create( self, trans, history_id, payload, **kwd ):
"""
create( self, trans, history_id, payload, **kwd )
- * POST /api/histories/{history_id}/contents
+ * POST /api/histories/{history_id}/contents/{type}
create a new HDA by copying an accessible LibraryDataset
:type history_id: str
:param history_id: encoded id string of the new HDA's History
+ :type type: str
+ :param type: Type of history content - 'dataset' (default) or
+ 'dataset_collection'.
:type payload: dict
:param payload: dictionary structure containing::
- copy from library:
+ copy from library (for type 'dataset'):
'source' = 'library'
'content' = [the encoded id from the library dataset]
- copy from HDA:
+ copy from history dataset (for type 'dataset'):
'source' = 'hda'
'content' = [the encoded id from the HDA]
+ copy from history dataset collection (for type 'dataset_collection')
+ 'source' = 'hdca'
+ 'content' = [the encoded id from the HDCA]
+
+ create new history dataset collection (for type 'dataset_collection')
+ 'source' = 'new_collection'
+ 'collection_type' = For example, "list", "paired", "list:paired".
+ 'name' = Name of new dataset collection.
+ 'element_identifiers' = Recursive list structure defining collection.
+ Each element must have 'src' which can be
+ 'hda', 'ldda', 'hdca', or 'new_collection',
+ as well as a 'name' which is the name of
+ element (e.g. "forward" or "reverse" for
+ paired datasets, or arbitrary sample names
+ for instance for lists). For all src's except
+ 'new_collection' - a encoded 'id' attribute
+ must be included wiht element as well.
+ 'new_collection' sources must defined a
+ 'collection_type' and their own list of
+ (potentially) nested 'element_identifiers'.
+
..note:
Currently, a user can only copy an HDA from a history that the user owns.
:rtype: dict
:returns: dictionary containing detailed information for the new HDA
"""
+ # TODO: Flush out create new collection documentation above, need some
+ # examples. See also bioblend and API tests for specific examples.
+
# get the history, if anon user and requesting current history - allow it
if( ( trans.user == None )
and ( history_id == trans.security.encode_id( trans.history.id ) ) ):
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