diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/computation')
10 files changed, 25 insertions, 14 deletions
diff --git a/server/sonar-web/src/main/js/apps/computation/app.js b/server/sonar-web/src/main/js/apps/computation/app.js index 43e64d86b5d..73ac19753ac 100644 --- a/server/sonar-web/src/main/js/apps/computation/app.js +++ b/server/sonar-web/src/main/js/apps/computation/app.js @@ -1,4 +1,6 @@ define([ + 'backbone', + 'backbone.marionette', './router', './layout', './reports', @@ -6,7 +8,7 @@ define([ './search-view', './list-view', './list-footer-view' -], function (Router, Layout, Reports, HeaderView, SearchView, ListView, ListFooterView) { +], function (Backbone, Marionette, Router, Layout, Reports, HeaderView, SearchView, ListView, ListFooterView) { var App = new Marionette.Application(), init = function (options) { @@ -47,9 +49,7 @@ define([ }; App.on('start', function (options) { - window.requestMessages().done(function () { - init.call(App, options); - }); + init.call(App, options); }); return App; diff --git a/server/sonar-web/src/main/js/apps/computation/header-view.js b/server/sonar-web/src/main/js/apps/computation/header-view.js index 8e010c0eded..6a36a006cbb 100644 --- a/server/sonar-web/src/main/js/apps/computation/header-view.js +++ b/server/sonar-web/src/main/js/apps/computation/header-view.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.ItemView.extend({ template: Templates['computation-header'] diff --git a/server/sonar-web/src/main/js/apps/computation/layout.js b/server/sonar-web/src/main/js/apps/computation/layout.js index 2e7edcd22bf..b8de14574a0 100644 --- a/server/sonar-web/src/main/js/apps/computation/layout.js +++ b/server/sonar-web/src/main/js/apps/computation/layout.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.LayoutView.extend({ template: Templates['computation-layout'], diff --git a/server/sonar-web/src/main/js/apps/computation/list-footer-view.js b/server/sonar-web/src/main/js/apps/computation/list-footer-view.js index 5034f25a3e8..c6f98d9238f 100644 --- a/server/sonar-web/src/main/js/apps/computation/list-footer-view.js +++ b/server/sonar-web/src/main/js/apps/computation/list-footer-view.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.ItemView.extend({ template: Templates['computation-list-footer'], diff --git a/server/sonar-web/src/main/js/apps/computation/list-item-view.js b/server/sonar-web/src/main/js/apps/computation/list-item-view.js index afcf2f15d3f..44e5e32dcaf 100644 --- a/server/sonar-web/src/main/js/apps/computation/list-item-view.js +++ b/server/sonar-web/src/main/js/apps/computation/list-item-view.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.ItemView.extend({ tagName: 'li', diff --git a/server/sonar-web/src/main/js/apps/computation/list-view.js b/server/sonar-web/src/main/js/apps/computation/list-view.js index 24878864d30..b56e64f951d 100644 --- a/server/sonar-web/src/main/js/apps/computation/list-view.js +++ b/server/sonar-web/src/main/js/apps/computation/list-view.js @@ -1,7 +1,8 @@ define([ + 'backbone.marionette', './list-item-view', './templates' -], function (ListItemView) { +], function (Marionette, ListItemView) { return Marionette.CollectionView.extend({ tagName: 'ul', diff --git a/server/sonar-web/src/main/js/apps/computation/report.js b/server/sonar-web/src/main/js/apps/computation/report.js index 2eac3f23e84..a1895bd4d3c 100644 --- a/server/sonar-web/src/main/js/apps/computation/report.js +++ b/server/sonar-web/src/main/js/apps/computation/report.js @@ -1,4 +1,6 @@ -define(function () { +define([ + 'backbone' +], function (Backbone) { return Backbone.Model.extend({ idAttribute: 'key', diff --git a/server/sonar-web/src/main/js/apps/computation/reports.js b/server/sonar-web/src/main/js/apps/computation/reports.js index 9c8144333bb..04b6eae2eaa 100644 --- a/server/sonar-web/src/main/js/apps/computation/reports.js +++ b/server/sonar-web/src/main/js/apps/computation/reports.js @@ -1,6 +1,7 @@ define([ + 'backbone', './report' -], function (Report) { +], function (Backbone, Report) { return Backbone.Collection.extend({ model: Report, @@ -15,7 +16,7 @@ define([ fetch: function (options) { var opts = _.defaults(options || {}, { q: this.q }, { q: 'history' }); - opts.url = baseUrl + '/api/computation/' + opts.q; + opts.url = window.baseUrl + '/api/computation/' + opts.q; this.q = opts.q; return Backbone.Collection.prototype.fetch.call(this, opts); }, diff --git a/server/sonar-web/src/main/js/apps/computation/router.js b/server/sonar-web/src/main/js/apps/computation/router.js index 6d874801cd3..611a685ea19 100644 --- a/server/sonar-web/src/main/js/apps/computation/router.js +++ b/server/sonar-web/src/main/js/apps/computation/router.js @@ -1,4 +1,6 @@ -define(function () { +define([ + 'backbone' +], function (Backbone) { return Backbone.Router.extend({ routes: { diff --git a/server/sonar-web/src/main/js/apps/computation/search-view.js b/server/sonar-web/src/main/js/apps/computation/search-view.js index 75ab65c4dad..68a0cb7dd34 100644 --- a/server/sonar-web/src/main/js/apps/computation/search-view.js +++ b/server/sonar-web/src/main/js/apps/computation/search-view.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.ItemView.extend({ template: Templates['computation-search'], |