Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Airistotal/galaxy into Repor…
Browse files Browse the repository at this point in the history
…ts_homepage

Conflicts:
	client/galaxy/style/less/base.less
	static/style/blue/base.css
  • Loading branch information
Airistotal committed Aug 6, 2015
2 parents 8395244 + 86757fb commit c7b9ee3
Show file tree
Hide file tree
Showing 60 changed files with 4,385 additions and 430 deletions.
3,054 changes: 3,054 additions & 0 deletions client/galaxy/scripts/libs/jquery.sparklines.js

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions client/galaxy/scripts/mvc/form/form-select-content.js
Expand Up @@ -2,9 +2,6 @@
define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'mvc/tools/tools-template'],
function(Utils, Ui, Tabs, ToolTemplate) {

// track current history elements
history = {};

// hda/hdca content selector ui element
var View = Backbone.View.extend({
// initialize
Expand All @@ -13,6 +10,10 @@ var View = Backbone.View.extend({
this.app = app;
this.options = options;

// track current history elements
this.history = {};


// link this
var self = this;

Expand Down Expand Up @@ -197,7 +198,7 @@ var View = Backbone.View.extend({
value: item.id
});
// backup to local history
history[item.id + '_' + item.src] = item;
self.history[item.id + '_' + item.src] = item;
}
// update field
field.update(select_options);
Expand Down Expand Up @@ -272,7 +273,7 @@ var View = Backbone.View.extend({

// append to dataset ids
for (var i in id_list) {
var details = history[id_list[i] + '_' + this.list[this.current].type];
var details = this.history[id_list[i] + '_' + this.list[this.current].type];
if (details) {
result.values.push(details);
} else {
Expand Down Expand Up @@ -315,7 +316,7 @@ var View = Backbone.View.extend({
/** Assists in identifying the batch mode */
_batch: function() {
if (this.current == 'collection') {
var hdca = history[this._select().value() + '_hdca'];
var hdca = this.history[this._select().value() + '_hdca'];
if (hdca && hdca.map_over_type) {
return true;
}
Expand Down
21 changes: 21 additions & 0 deletions client/galaxy/scripts/utils/query-string-parsing.js
@@ -0,0 +1,21 @@
define([], function(){
// ============================================================================
function get( key, queryString ){
queryString = queryString || window.location.search.substr( 1 );
var keyRegex = new RegExp( key + '=([^&#$]+)' ),
matches = queryString.match( keyRegex );
if( !matches || !matches.length ){
return undefined;
}
matches = matches.splice( 1 );
if( matches.length === 1 ){
return matches[0];
}
return matches;
}

// ============================================================================
return {
get : get
};
});
84 changes: 79 additions & 5 deletions client/galaxy/scripts/viz/trackster.js
Expand Up @@ -31,8 +31,8 @@ require(
});

// trackster viewer
define( ["libs/underscore", "base", "viz/trackster/tracks", "viz/visualization", "mvc/ui/icon-button" ],
function(_, base, tracks, visualization, mod_icon_btn) {
define( ["libs/underscore", "base", "viz/trackster/tracks", "viz/visualization", "mvc/ui/icon-button", "utils/query-string-parsing" ],
function(_, base, tracks, visualization, mod_icon_btn, query_string ) {
/**
* User interface controls for trackster
*/
Expand Down Expand Up @@ -401,11 +401,84 @@ var TracksterView = Backbone.View.extend(
// hide right panel
force_right_panel("hide");


// check if id is available
if (galaxy_config.app.id)
if (galaxy_config.app.id){
this.view_existing();
else
} else if( query_string.get( 'dataset_id' ) ){
this.choose_existing_or_new();
} else {
this.view_new();
}
},

choose_existing_or_new : function () {
var self = this;
var dbkey = query_string.get( 'dbkey' ),
listTracksParams = {},
dataset_params = {
dbkey : dbkey,
dataset_id : query_string.get( 'dataset_id' ),
hda_ldda : query_string.get( 'hda_ldda' )
};
if (dbkey){
listTracksParams[ 'f-dbkey' ] = dbkey;
}
$.ajax({
url: galaxy_config.root + 'visualization/list_tracks?' + $.param( listTracksParams ),
dataType: "html",
error: function() { alert( "Could not add this dataset to browser." ); },

success: function(table_html) {
console.debug( 'success' );
function view_in_saved(){
// Show new modal with saved visualizations.
Galaxy.modal.show({
title : "Add Data to Saved Visualization",
body : table_html,
buttons : {
"Cancel": function() {
// go back to the first choice
show_choice();
},
"Add to visualization": function() {
$(parent.document).find('input[name=id]:checked').each(function() {
var vis_id = $(this).val();
dataset_params.id = vis_id;
window.location = galaxy_config.root + "visualization/trackster?" + $.param(dataset_params);
});
}
}
});
}
function show_choice(){
Galaxy.modal.show({
title : "View Data in a New or Saved Visualization?",
// either have text in here or have to remove body and the header/footer margins
body : (
// TODO: yay. inline styles. thanks, galaxy
'<p><ul style="list-style: disc inside none">You can add this dataset as:' +
"<li>a new track to one of your existing, saved Trackster " +
"sessions if they share the genome build: <b>" + dbkey + "</b></li>" +
"<li>or create a new session with this dataset as the only track</li>" +
"</ul></p>"
),
buttons : {
"Cancel": function() {
window.location = galaxy_config.root + "visualization/list";
},
"View in saved visualization": function() {
view_in_saved();
},
"View in new visualization": function() {
self.view_new();
}
}
});
}
show_choice();
}
});
},

// view
Expand Down Expand Up @@ -459,7 +532,8 @@ var TracksterView = Backbone.View.extend(
});

// select default
if (galaxy_config.app.default_dbkey) {
var dbkeys_in_genomes = response.map( function( r ){ return r[1]; });
if (galaxy_config.app.default_dbkey && _.contains(dbkeys_in_genomes,galaxy_config.app.default_dbkey)) {
$("#new-dbkey").val( galaxy_config.app.default_dbkey );
}

Expand Down
106 changes: 3 additions & 103 deletions client/galaxy/style/less/base.less
Expand Up @@ -4,6 +4,9 @@
// Galaxy specific variables
@import "galaxy_variables.less";

// Galaxy Report Webapp
@import "reports";

@white: #fff;
@black: #000;

Expand Down Expand Up @@ -134,28 +137,6 @@ body {
#left-border {
left: 250px;
}
.reports-panel-container {
position: absolute;
top: @panel_header_height;
bottom: 10px;
overflow: scroll;
width: 100%;
padding: 10px;
}
#reports_home {
content: url("../images/reports_webapp/home-icon-hov.png");
position: relative;
top: -6px;
left: 6px;
width: 26px;
float: right;
}
#reports_home:hover {
content: url("../images/reports_webapp/home-icon-hov.png");
}
#reports_home:active {
content: url("../images/reports_webapp/home-icon-active.png");
}
#center {
left:250 + @border-default-color_padding;
right: 250 + @border-default-color_padding;
Expand Down Expand Up @@ -1716,84 +1697,3 @@ div.toolTitleNoSection
#for_bears {
display: none;
}

// ================================================================Reports Webapp Styles
.chart {
cursor: zoom-in;
position: relative;
z-index: 2;
}

.chart rect {
fill: steelblue;
shape-rendering: preserveAspectRatio;
}

.chart text {
fill: black;
font: 7px sans-serif;
text-anchor: end;
}

.tick text {
fill: black;
font-family: Arial, sans-serif;
font-size: 7px;
text-anchor: end;
}

.axis path, .axis line {
fill: none;
stroke: #000;
shape-rendering: preserveAspectRatio;
}

.x_path {
stroke: #000;
stroke-width: 1;
}

.chart .title {
fill: black;
font-size: 15px;
font-family: "Lucida Grande",verdana,arial,helvetica,sans-serif;
font-weight: 800;
line-height: 1.1;
}

.chart .ax_title {
fill: black;
}

.hr_container, .dy_container {
position: relative;
z-index: 2;
display: inline-block;
vertical-align: top;
}

.charts {
margin-top: 10px;
margin-left: 0;
margin-right: 0;
text-align: center;
position: relative;
display: block;
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap
}

.trim {
position:relative;
height:10px;
top: 50px;
background: #ebd9b2;
color: #000;
border-top: solid #d6b161 1px;
border-bottom: solid #d6b161 1px;
}

.tool_tip text {
fill: white;
}

0 comments on commit c7b9ee3

Please sign in to comment.