]> source.dussan.org Git - sonarqube.git/commitdiff
change the way to use requirejs
authorStas Vilchik <vilchiks@gmail.com>
Fri, 9 Jan 2015 10:53:40 +0000 (11:53 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 9 Jan 2015 11:10:34 +0000 (12:10 +0100)
20 files changed:
server/sonar-web/src/main/js/common/select-list.js
server/sonar-web/src/main/webapp/WEB-INF/app/views/analysis_reports/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/show.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/libraries/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/search.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/users/index.html.erb

index 7c1013c54c594013366983b1d9c0f9d803b45c11..c1bcab2cb92d2a5250c36dd265cfe09c62ef0fd4 100644 (file)
-requirejs.config({
-  baseUrl: baseUrl + '/js'
-});
-
-requirejs(function () {
-
-  (function ($) {
-
-    var showError = null;
-
-    /*
-     * SelectList Collection
-     */
-
-    var SelectListCollection = Backbone.Collection.extend({
-
-      parse: function (r) {
-        this.more = r.more;
-        return r.results;
-      },
-
-      fetch: function (options) {
-        var data = $.extend({
-              page: 1,
-              pageSize: 100
-            }, options.data || {}),
-            settings = $.extend({}, options, { data: data });
-
-        this.settings = {
-          url: settings.url,
-          data: data
-        };
-
-        Backbone.Collection.prototype.fetch.call(this, settings);
-      },
-
-      fetchNextPage: function (options) {
-        if (this.more) {
-          var nextPage = this.settings.data.page + 1,
-              settings = $.extend(this.settings, options);
-
-          settings.data.page = nextPage;
-          settings.remove = false;
-          this.fetch(settings);
-        } else {
-          options.error();
-        }
+define(function () {
+
+  var $ = jQuery,
+      showError = null;
+
+  /*
+   * SelectList Collection
+   */
+
+  var SelectListCollection = Backbone.Collection.extend({
+
+    parse: function (r) {
+      this.more = r.more;
+      return r.results;
+    },
+
+    fetch: function (options) {
+      var data = $.extend({
+            page: 1,
+            pageSize: 100
+          }, options.data || {}),
+          settings = $.extend({}, options, { data: data });
+
+      this.settings = {
+        url: settings.url,
+        data: data
+      };
+
+      Backbone.Collection.prototype.fetch.call(this, settings);
+    },
+
+    fetchNextPage: function (options) {
+      if (this.more) {
+        var nextPage = this.settings.data.page + 1,
+            settings = $.extend(this.settings, options);
+
+        settings.data.page = nextPage;
+        settings.remove = false;
+        this.fetch(settings);
+      } else {
+        options.error();
       }
+    }
 
-    });
+  });
 
 
-    /*
-     * SelectList Item View
-     */
+  /*
+   * SelectList Item View
+   */
 
-    var SelectListItemView = Backbone.View.extend({
-      tagName: 'li',
+  var SelectListItemView = Backbone.View.extend({
+    tagName: 'li',
 
-      template: function (d) {
-        return  '<input class="select-list-list-checkbox" type="checkbox">' +
-            '<div class="select-list-list-item">' + d + '</div>';
-      },
+    template: function (d) {
+      return '<input class="select-list-list-checkbox" type="checkbox">' +
+          '<div class="select-list-list-item">' + d + '</div>';
+    },
 
-      events: {
-        'change .select-list-list-checkbox': 'toggle'
-      },
+    events: {
+      'change .select-list-list-checkbox': 'toggle'
+    },
 
-      initialize: function (options) {
-        this.listenTo(this.model, 'change', this.render);
-        this.settings = options.settings;
-      },
+    initialize: function (options) {
+      this.listenTo(this.model, 'change', this.render);
+      this.settings = options.settings;
+    },
 
-      render: function () {
-        this.$el.html(this.template(this.settings.format(this.model.toJSON())));
-        this.$('input').prop('name', this.model.get('name'));
-        this.$el.toggleClass('selected', this.model.get('selected'));
-        this.$('.select-list-list-checkbox')
-            .prop('title',
-                this.model.get('selected') ?
-                    this.settings.tooltips.deselect :
-                    this.settings.tooltips.select)
-            .prop('checked', this.model.get('selected'));
+    render: function () {
+      this.$el.html(this.template(this.settings.format(this.model.toJSON())));
+      this.$('input').prop('name', this.model.get('name'));
+      this.$el.toggleClass('selected', this.model.get('selected'));
+      this.$('.select-list-list-checkbox')
+          .prop('title',
+          this.model.get('selected') ?
+              this.settings.tooltips.deselect :
+              this.settings.tooltips.select)
+          .prop('checked', this.model.get('selected'));
 
-        if (this.settings.readOnly) {
-          this.$('.select-list-list-checkbox').prop('disabled', true);
-        }
-      },
-
-      remove: function (postpone) {
-        if (postpone) {
-          var that = this;
-          that.$el.addClass(this.model.get('selected') ? 'added' : 'removed');
-          setTimeout(function () {
-            Backbone.View.prototype.remove.call(that, arguments);
-          }, 500);
-        } else {
-          Backbone.View.prototype.remove.call(this, arguments);
-        }
-      },
-
-      toggle: function () {
-        var selected = this.model.get('selected'),
-            that = this,
-            url = selected ? this.settings.deselectUrl : this.settings.selectUrl,
-            data = $.extend({}, this.settings.extra || {});
-
-        data[this.settings.selectParameter] = this.model.get(this.settings.selectParameterValue);
-
-        that.$el.addClass('progress');
-        $.ajax({
-          url: url,
-          type: 'POST',
-          data: data
-        })
-            .done(function () {
-              that.model.set('selected', !selected);
-            })
-            .fail(showError)
-            .always(function () {
-              that.$el.removeClass('progress');
-            });
+      if (this.settings.readOnly) {
+        this.$('.select-list-list-checkbox').prop('disabled', true);
       }
-    });
-
-
-    /*
-     * SelectList View
-     */
-
-    var SelectListView = Backbone.View.extend({
-      template: function (l) {
-        return '<div class="select-list-container">' +
-            '<div class="select-list-control">' +
-            '<div class="select-list-check-control">' +
-            '<a class="select-list-control-button" name="selected">' + l.selected + '</a>' +
-            '<a class="select-list-control-button" name="deselected">' + l.deselected + '</a>' +
-            '<a class="select-list-control-button" name="all">' + l.all + '</a>' +
-            '</div>' +
-            '<div class="select-list-search-control">' +
-            '<input type="text" placeholder="Search">' +
-            '<a class="select-list-search-control-clear">&times;</a>' +
-            '</div>' +
-            '</div>' +
-            '<div class="select-list-list-container">' +
-            '<ul class="select-list-list"></ul>' +
-            '</div>' +
-            '</div>';
-      },
-
-      events: {
-        'click .select-list-control-button[name=selected]': 'showSelected',
-        'click .select-list-control-button[name=deselected]': 'showDeselected',
-        'click .select-list-control-button[name=all]': 'showAll',
-
-        'click .select-list-search-control-clear': 'clearSearch'
-      },
-
-      initialize: function (options) {
-        this.listenTo(this.collection, 'add', this.renderListItem);
-        this.listenTo(this.collection, 'reset', this.renderList);
-        this.listenTo(this.collection, 'remove', this.removeModel);
-        this.listenTo(this.collection, 'change:selected', this.confirmFilter);
-        this.settings = options.settings;
+    },
 
+    remove: function (postpone) {
+      if (postpone) {
         var that = this;
-        this.showFetchSpinner = function () {
-          that.$listContainer.addClass('loading');
-        };
-        this.hideFetchSpinner = function () {
-          that.$listContainer.removeClass('loading');
-        };
-
-        var onScroll = function () {
-          that.showFetchSpinner();
-
-          that.collection.fetchNextPage({
-            success: function () {
-              that.hideFetchSpinner();
-            },
-            error: function () {
-              that.hideFetchSpinner();
-            }
+        that.$el.addClass(this.model.get('selected') ? 'added' : 'removed');
+        setTimeout(function () {
+          Backbone.View.prototype.remove.call(that, arguments);
+        }, 500);
+      } else {
+        Backbone.View.prototype.remove.call(this, arguments);
+      }
+    },
+
+    toggle: function () {
+      var selected = this.model.get('selected'),
+          that = this,
+          url = selected ? this.settings.deselectUrl : this.settings.selectUrl,
+          data = $.extend({}, this.settings.extra || {});
+
+      data[this.settings.selectParameter] = this.model.get(this.settings.selectParameterValue);
+
+      that.$el.addClass('progress');
+      $.ajax({
+        url: url,
+        type: 'POST',
+        data: data
+      })
+          .done(function () {
+            that.model.set('selected', !selected);
+          })
+          .fail(showError)
+          .always(function () {
+            that.$el.removeClass('progress');
           });
-        };
-        this.onScroll = _.throttle(onScroll, 1000);
-      },
-
-      render: function () {
-        var that = this,
-            keyup = function () {
-              that.search();
-            };
-
-        this.$el.html(this.template(this.settings.labels))
-            .width(this.settings.width);
-
-        this.$listContainer = this.$('.select-list-list-container');
-        if (!this.settings.readOnly) {
-          this.$listContainer
-              .height(this.settings.height)
-              .css('overflow', 'auto')
-              .on('scroll', function () {
-                that.scroll();
-              });
-        } else {
-          this.$listContainer.addClass('select-list-list-container-readonly');
-        }
+    }
+  });
+
+
+  /*
+   * SelectList View
+   */
+
+  var SelectListView = Backbone.View.extend({
+    template: function (l) {
+      return '<div class="select-list-container">' +
+          '<div class="select-list-control">' +
+          '<div class="select-list-check-control">' +
+          '<a class="select-list-control-button" name="selected">' + l.selected + '</a>' +
+          '<a class="select-list-control-button" name="deselected">' + l.deselected + '</a>' +
+          '<a class="select-list-control-button" name="all">' + l.all + '</a>' +
+          '</div>' +
+          '<div class="select-list-search-control">' +
+          '<input type="text" placeholder="Search">' +
+          '<a class="select-list-search-control-clear">&times;</a>' +
+          '</div>' +
+          '</div>' +
+          '<div class="select-list-list-container">' +
+          '<ul class="select-list-list"></ul>' +
+          '</div>' +
+          '</div>';
+    },
+
+    events: {
+      'click .select-list-control-button[name=selected]': 'showSelected',
+      'click .select-list-control-button[name=deselected]': 'showDeselected',
+      'click .select-list-control-button[name=all]': 'showAll',
+
+      'click .select-list-search-control-clear': 'clearSearch'
+    },
+
+    initialize: function (options) {
+      this.listenTo(this.collection, 'add', this.renderListItem);
+      this.listenTo(this.collection, 'reset', this.renderList);
+      this.listenTo(this.collection, 'remove', this.removeModel);
+      this.listenTo(this.collection, 'change:selected', this.confirmFilter);
+      this.settings = options.settings;
+
+      var that = this;
+      this.showFetchSpinner = function () {
+        that.$listContainer.addClass('loading');
+      };
+      this.hideFetchSpinner = function () {
+        that.$listContainer.removeClass('loading');
+      };
+
+      var onScroll = function () {
+        that.showFetchSpinner();
+
+        that.collection.fetchNextPage({
+          success: function () {
+            that.hideFetchSpinner();
+          },
+          error: function () {
+            that.hideFetchSpinner();
+          }
+        });
+      };
+      this.onScroll = _.throttle(onScroll, 1000);
+    },
+
+    render: function () {
+      var that = this,
+          keyup = function () {
+            that.search();
+          };
+
+      this.$el.html(this.template(this.settings.labels))
+          .width(this.settings.width);
+
+      this.$listContainer = this.$('.select-list-list-container');
+      if (!this.settings.readOnly) {
+        this.$listContainer
+            .height(this.settings.height)
+            .css('overflow', 'auto')
+            .on('scroll', function () {
+              that.scroll();
+            });
+      } else {
+        this.$listContainer.addClass('select-list-list-container-readonly');
+      }
 
-        this.$list = this.$('.select-list-list');
+      this.$list = this.$('.select-list-list');
 
-        var searchInput = this.$('.select-list-search-control input')
-            .on('keyup', _.debounce(keyup, 250));
+      var searchInput = this.$('.select-list-search-control input')
+          .on('keyup', _.debounce(keyup, 250));
 
-        if (this.settings.focusSearch) {
-          setTimeout(function () {
-            searchInput.focus();
-          }, 250);
-        }
+      if (this.settings.focusSearch) {
+        setTimeout(function () {
+          searchInput.focus();
+        }, 250);
+      }
 
-        this.listItemViews = [];
+      this.listItemViews = [];
 
-        showError = function () {
-          $('<div>')
-              .addClass('error').text(that.settings.errorMessage)
-              .insertBefore(that.$el);
-        };
+      showError = function () {
+        $('<div>')
+            .addClass('error').text(that.settings.errorMessage)
+            .insertBefore(that.$el);
+      };
 
+      if (this.settings.readOnly) {
+        this.$('.select-list-control').remove();
+      }
+    },
+
+    renderList: function () {
+      this.listItemViews.forEach(function (view) {
+        view.remove();
+      });
+      this.listItemViews = [];
+      if (this.collection.length > 0) {
+        this.collection.each(this.renderListItem, this);
+      } else {
         if (this.settings.readOnly) {
-          this.$('.select-list-control').remove();
+          this.renderEmpty();
         }
-      },
+      }
+      this.$listContainer.scrollTop(0);
+    },
 
-      renderList: function () {
-        this.listItemViews.forEach(function (view) {
-          view.remove();
+    renderListItem: function (item) {
+      var itemView = new SelectListItemView({
+        model: item,
+        settings: this.settings
+      });
+      this.listItemViews.push(itemView);
+      this.$list.append(itemView.el);
+      itemView.render();
+    },
+
+    renderEmpty: function () {
+      this.$list.append('<li class="empty-message">' + this.settings.labels.noResults + '</li>');
+    },
+
+    confirmFilter: function (model) {
+      if (this.currentFilter !== 'all') {
+        this.collection.remove(model);
+      }
+    },
+
+    removeModel: function (model, collection, options) {
+      this.listItemViews[options.index].remove(true);
+      this.listItemViews.splice(options.index, 1);
+    },
+
+    filterBySelection: function (filter) {
+      var that = this;
+      filter = this.currentFilter = filter || this.currentFilter;
+
+      if (filter != null) {
+        this.$('.select-list-check-control').toggleClass('disabled', false);
+        this.$('.select-list-search-control').toggleClass('disabled', true);
+        this.$('.select-list-search-control input').val('');
+
+        this.$('.select-list-control-button').removeClass('active')
+            .filter('[name=' + filter + ']').addClass('active');
+
+        this.showFetchSpinner();
+
+        this.collection.fetch({
+          url: this.settings.searchUrl,
+          reset: true,
+          data: { selected: filter },
+          success: function () {
+            that.hideFetchSpinner();
+          },
+          error: showError
         });
-        this.listItemViews = [];
-        if (this.collection.length > 0) {
-          this.collection.each(this.renderListItem, this);
-        } else {
-          if (this.settings.readOnly) {
-            this.renderEmpty();
-          }
-        }
-        this.$listContainer.scrollTop(0);
-      },
-
-      renderListItem: function (item) {
-        var itemView = new SelectListItemView({
-          model: item,
-          settings: this.settings
+      }
+    },
+
+    showSelected: function () {
+      this.filterBySelection('selected');
+    },
+
+    showDeselected: function () {
+      this.filterBySelection('deselected');
+    },
+
+    showAll: function () {
+      this.filterBySelection('all');
+    },
+
+    search: function () {
+      var query = this.$('.select-list-search-control input').val(),
+          hasQuery = query.length > 0,
+          that = this;
+
+      this.$('.select-list-check-control').toggleClass('disabled', hasQuery);
+      this.$('.select-list-search-control').toggleClass('disabled', !hasQuery);
+
+      if (hasQuery) {
+        this.showFetchSpinner();
+        this.currentFilter = 'all';
+
+        this.collection.fetch({
+          url: this.settings.searchUrl,
+          reset: true,
+          data: { query: query },
+          success: function () {
+            that.hideFetchSpinner();
+          },
+          error: showError
         });
-        this.listItemViews.push(itemView);
-        this.$list.append(itemView.el);
-        itemView.render();
-      },
-
-      renderEmpty: function () {
-        this.$list.append('<li class="empty-message">' + this.settings.labels.noResults + '</li>');
-      },
-
-      confirmFilter: function (model) {
-        if (this.currentFilter !== 'all') {
-          this.collection.remove(model);
-        }
-      },
-
-      removeModel: function (model, collection, options) {
-        this.listItemViews[options.index].remove(true);
-        this.listItemViews.splice(options.index, 1);
-      },
-
-      filterBySelection: function (filter) {
-        var that = this;
-        filter = this.currentFilter = filter || this.currentFilter;
-
-        if (filter != null) {
-          this.$('.select-list-check-control').toggleClass('disabled', false);
-          this.$('.select-list-search-control').toggleClass('disabled', true);
-          this.$('.select-list-search-control input').val('');
-
-          this.$('.select-list-control-button').removeClass('active')
-              .filter('[name=' + filter + ']').addClass('active');
-
-          this.showFetchSpinner();
-
-          this.collection.fetch({
-            url: this.settings.searchUrl,
-            reset: true,
-            data: { selected: filter },
-            success: function () {
-              that.hideFetchSpinner();
-            },
-            error: showError
-          });
-        }
-      },
-
-      showSelected: function () {
-        this.filterBySelection('selected');
-      },
-
-      showDeselected: function () {
-        this.filterBySelection('deselected');
-      },
-
-      showAll: function () {
-        this.filterBySelection('all');
-      },
-
-      search: function () {
-        var query = this.$('.select-list-search-control input').val(),
-            hasQuery = query.length > 0,
-            that = this;
-
-        this.$('.select-list-check-control').toggleClass('disabled', hasQuery);
-        this.$('.select-list-search-control').toggleClass('disabled', !hasQuery);
-
-        if (hasQuery) {
-          this.showFetchSpinner();
-          this.currentFilter = 'all';
-
-          this.collection.fetch({
-            url: this.settings.searchUrl,
-            reset: true,
-            data: { query: query },
-            success: function () {
-              that.hideFetchSpinner();
-            },
-            error: showError
-          });
-        } else {
-          this.filterBySelection();
-        }
-      },
+      } else {
+        this.filterBySelection();
+      }
+    },
 
-      searchByQuery: function (query) {
-        this.$('.select-list-search-control input').val(query);
-        this.search();
-      },
+    searchByQuery: function (query) {
+      this.$('.select-list-search-control input').val(query);
+      this.search();
+    },
 
-      clearSearch: function () {
-        this.filterBySelection();
-      },
+    clearSearch: function () {
+      this.filterBySelection();
+    },
 
-      scroll: function () {
-        var scrollBottom = this.$listContainer.scrollTop() >=
-                this.$list[0].scrollHeight - this.$listContainer.outerHeight();
+    scroll: function () {
+      var scrollBottom = this.$listContainer.scrollTop() >=
+          this.$list[0].scrollHeight - this.$listContainer.outerHeight();
 
-        if (scrollBottom && this.collection.more) {
-          this.onScroll();
-        }
+      if (scrollBottom && this.collection.more) {
+        this.onScroll();
       }
+    }
 
-    });
+  });
 
 
-    /*
-     * SelectList Entry Point
-     */
+  /*
+   * SelectList Entry Point
+   */
 
-    window.SelectList = function (options) {
-      this.settings = $.extend(window.SelectList.defaults, options);
+  window.SelectList = function (options) {
+    this.settings = $.extend(window.SelectList.defaults, options);
 
-      this.collection = new SelectListCollection();
+    this.collection = new SelectListCollection();
 
-      this.view = new SelectListView({
-        el: this.settings.el,
-        collection: this.collection,
-        settings: this.settings
-      });
-
-      this.view.render();
-      this.filter('selected');
-      return this;
-    };
+    this.view = new SelectListView({
+      el: this.settings.el,
+      collection: this.collection,
+      settings: this.settings
+    });
 
+    this.view.render();
+    this.filter('selected');
+    return this;
+  };
 
-    /*
-     * SelectList API Methods
-     */
 
-    window.SelectList.prototype.filter = function (filter) {
-      this.view.filterBySelection(filter);
-      return this;
-    };
+  /*
+   * SelectList API Methods
+   */
 
-    window.SelectList.prototype.search = function (query) {
-      this.view.searchByQuery(query);
-      return this;
-    };
+  window.SelectList.prototype.filter = function (filter) {
+    this.view.filterBySelection(filter);
+    return this;
+  };
 
+  window.SelectList.prototype.search = function (query) {
+    this.view.searchByQuery(query);
+    return this;
+  };
 
-    /*
-     * SelectList Defaults
-     */
 
-    window.SelectList.defaults = {
-      width: '50%',
-      height: 400,
+  /*
+   * SelectList Defaults
+   */
 
-      readOnly: false,
-      focusSearch: true,
+  window.SelectList.defaults = {
+    width: '50%',
+    height: 400,
 
-      format: function (item) {
-        return item.value;
-      },
+    readOnly: false,
+    focusSearch: true,
 
-      labels: {
-        selected: 'Selected',
-        deselected: 'Deselected',
-        all: 'All',
-        noResults: ''
-      },
+    format: function (item) {
+      return item.value;
+    },
 
-      tooltips: {
-        select: 'Click this to select item',
-        deselect: 'Click this to deselect item'
-      },
+    labels: {
+      selected: 'Selected',
+      deselected: 'Deselected',
+      all: 'All',
+      noResults: ''
+    },
 
-      errorMessage: 'Something gone wrong, try to reload the page and try again.'
-    };
+    tooltips: {
+      select: 'Click this to select item',
+      deselect: 'Click this to deselect item'
+    },
 
-  })(jQuery);
+    errorMessage: 'Something gone wrong, try to reload the page and try again.'
+  };
 
 });
index e514d33537d70387083c8c05908ad5c5889eff72..6943f95ee6022c530a5edbe48ac1d446ceb8ddd7 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/analysis-reports/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['analysis-reports/app']);</script>
 <% end %>
 
 
index da8a834d10253184349cd120396afdd91794ae30..2ba2ac6afc396dccf0179704c012ebebde36317d 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/api-documentation/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['api-documentation/app']);</script>
 <% end %>
 
 <div id="api-documentation-page-loader" class="navigator-page-loader">
index 3d13e30672a4713b43b092337339595713caa07e..a7d9e3027b1c6b76a7f42c3b2b67b429c676b191 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/coding-rules/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['coding-rules/app']);</script>
 <% end %>
 
 
index 629a4a120d090170d533f936f63d5a016e6932c9..97027663c638fa2413823c3d5cc140c1c701fd8a 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/coding-rules/show-app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['coding-rules/show-app']);</script>
 <% end %>
 
 
index b48c26019297b70a40a64e82341f3991b633d7f9..f9f2b8941a972919a0e2511bccdfdf4ef0890945 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/source-viewer/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['source-viewer/app']);</script>
 <% end %>
 
 <div id="source-viewer"></div>
index 05cc887a16621bee55a8c4c9862680790b37148c..605a8e1ed965330c09894ec1372070ff9242cc32 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/source-viewer/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['source-viewer/app']);</script>
 <% end %>
 
 <div class="page">
index b3cc6bdd83942479ddff0788ee04d313af71db09..5a2d78437398d09d64a4777795107e146eea837a 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/design/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['design/app']);</script>
   <script>
     window.resourceKey = '<%= @resource.key -%>';
   </script>
index 117ae080c94bd0f612ba953b4575311cb53ce419..b6f12ce75fad8a74f12c371a72f95ef8040c2dd1 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/drilldown/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['drilldown/app']);</script>
 <% end %>
 
 <%= render :partial => 'header' -%>
index 3d75fcbfdba0aaaf20d03edfd7b61319a898e783..81652c649595d52e98c6f5540bc3a47773424bb4 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['common/select-list']);</script>
 <% end %>
 
 <div>
index 0a1423d24f26bfc4758844dde37b7d632c499a70..5741c2c169a46057f793d388b6bf679b82128608 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/issues/app-new" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['issues/app-new']);</script>
 <% end %>
 
 <div class="issues search-navigator"></div>
index 1d51642aa7dfe832ede82cb483e3db7170ace54c..be7b6ade97e752c9ef16ac21731614d7f4c96589 100644 (file)
     moment.lang(window.pageLang);
     numeral.language(window.pageLang);
   </script>
+  <script src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>
+    requirejs.config({ baseUrl: baseUrl + '/js' });
+  </script>
   <%= yield :script -%>
 </head>
 <body>
index 6c1608bc39a858283696745fad4d4dc43bd61fb8..0f1ab2d49b0c05603c86b3a7aa2a77a5fe1cb1b6 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/libraries/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['libraries/app']);</script>
   <script>
     window.resourceKey = '<%= @resource.key -%>';
   </script>
index ea6def26e02f9d2a7b1f7ca17dfca85f8a8fd5f9..bf9ad6c0345b8eb15dad45cd38eaadc89a77168f 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/measures/app.js" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['measures/app']);</script>
 <% end %>
 
 
index fa44944563aa0fe5ac062772343dd911490ca97f..fd0c7f6343f33a8e823248d0505da33e3f951997 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['common/select-list']);</script>
 <% end %>
 
 <h1 class="admin-page-title"><%= message 'roles.page' -%></h1>
index 5aee7f3041651128a2c38e359a928f9205593d1c..0fa80b59de156367c4bc988b3dc81442d155709b 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['common/select-list']);</script>
 <% end %>
 
 <div>
index 470dab4c24eeef8cbb0991d05fd9277a5bfb33c9..4a1ee1605e2e5bd8a1cf6b78e4314742ff1b3911 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/quality-gate/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['quality-gate/app']);</script>
 <% end %>
 
 <div id="quality-gate-page-loader" class="navigator-page-loader">
index 82b820b1e214c7295ce1519d9623fb4e71d9912e..fb22230e8e6f31ecc00ed790034512e78a4e02a4 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['common/select-list']);</script>
 <% end %>
 
 <h1 class="admin-page-title"><%= h message 'global_permissions.page' -%></h1>
index 64e2f4483fd68314c28281cf35c47454df81a02c..8af1a9730e6350fa94232eed4a511c38cd8bd1af 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['common/select-list']);</script>
 <% end %>
 
 <h1 class="admin-page-title"><%= message 'roles.page' -%></h1>
index 11369d6ed8fa67513c33927062980d40cd59aca9..d4270d08c1a4942ab6ea77f4abbe219c57863910 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script>require(['common/select-list']);</script>
 <% end %>
 
 <div>