Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.01] Fix redundant backbone and visualizations #1558

Merged
merged 1 commit into from
Jan 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var Visualization = Backbone.Model.extend(

/** override urlRoot to handle prefix */
urlRoot : function(){
var apiUrl = '/api/visualizations';
var apiUrl = 'api/visualizations';
return Galaxy.root + apiUrl;
},

Expand Down
2 changes: 1 addition & 1 deletion config/plugins/visualizations/charts/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function(grunt) {
},
shim : {
"libs/underscore": { exports: "_" },
"libs/backbone/backbone": { exports: "Backbone" }
"libs/backbone": { exports: "Backbone" }
},
name : "plugin/app",
out : "static/build-app.js",
Expand Down
2 changes: 1 addition & 1 deletion config/plugins/visualizations/charts/static/build-app.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions config/plugins/visualizations/charts/templates/charts.mako
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'libs/jquery/select2',
'libs/bootstrap',
'libs/underscore',
'libs/backbone/backbone',
'libs/backbone',
'libs/d3',
'libs/require')}

Expand All @@ -39,7 +39,7 @@

## load merged/minified code
${h.javascript_link( app_root + "build-app.js" )}

## install default css
${h.stylesheet_link( app_root + "app.css" )}
</head>
Expand Down Expand Up @@ -79,7 +79,7 @@
},
shim: {
"libs/underscore": { exports: "_" },
"libs/backbone/backbone": { exports: "Backbone" },
"libs/backbone": { exports: "Backbone" },
"d3": { exports: "d3"}

}
Expand All @@ -89,18 +89,18 @@
};
// application
var app = null;
$(function() {
$(function() {
// request application script
require(['plugin/app'], function(App) {
// load options
var options = {
id : ${h.dumps( visualization_id )} || undefined,
config : ${h.dumps( config )}
}

// create application
app = new App(options);

// add to body
$('body').append(app.$el);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ ${h.css( 'base', 'jquery-ui/smoothness/jquery-ui')}
${h.stylesheet_link( root + 'plugins/visualizations/scatterplot/static/scatterplot.css' )}

## ----------------------------------------------------------------------------
<script type="text/javascript">
// TODO: blah
window.Galaxy = { root: '${ root }' };
</script>
${h.js( 'libs/jquery/jquery',
'libs/jquery/jquery.migrate',
'libs/jquery/jquery-ui',
'libs/bootstrap',
'libs/underscore',
'libs/backbone/backbone',
'libs/backbone',
'libs/d3',
'libs/handlebars.runtime',
'ui/peek-column-selector',
Expand All @@ -41,7 +45,7 @@ ${h.javascript_link( root + 'plugins/visualizations/scatterplot/static/scatterpl
function getModel(){
return new ScatterplotModel({
id : ${h.dumps( visualization_id )} || undefined,
title : "${title}",
title : "${title or default_title}",
config : ${h.dumps( config, indent=2 )}
});
}
Expand Down Expand Up @@ -88,7 +92,7 @@ function getHDAJSON(){
hdaJSON = getHDAJSON(),
editor = new ScatterplotConfigEditor({
el : $( '.scatterplot-editor' ).attr( 'id', 'scatterplot-editor-hda-' + hdaJSON.id ),
model : getModel(),
model : model,
dataset : hdaJSON
}).render();
window.editor = editor;
Expand Down
1 change: 0 additions & 1 deletion static/maps/libs/backbone/backbone.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion static/maps/mvc/visualization/visualization-model.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions static/scripts/libs/backbone/backbone.js

This file was deleted.

2 changes: 1 addition & 1 deletion static/scripts/mvc/visualization/visualization-model.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.