aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/quality-profiles/router.js
blob: c672f5b3418eb7653d6da1f9a1c5a055f28166c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import Backbone from 'backbone';

export default Backbone.Router.extend({
  routes: {
    '': 'index',
    'index': 'index',
    'show?key=:key': 'show',
    'changelog*': 'changelog',
    'compare*': 'compare'
  },

  initialize: function (options) {
    this.app = options.app;
  },

  index: function () {
    this.app.controller.index();
  },

  show: function (key) {
    this.app.controller.show(key);
  },

  changelog: function () {
    var params = window.getQueryParams();
    this.app.controller.changelog(params.key, params.since, params.to);
  },

  compare: function () {
    var params = window.getQueryParams();
    if (params.key && params.withKey) {
      this.app.controller.compare(params.key, params.withKey);
    }
  }
});