]> source.dussan.org Git - sonarqube.git/commitdiff
Integrate require.js
authorStas Vilchik <vilchiks@gmail.com>
Fri, 14 Feb 2014 09:19:25 +0000 (15:19 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 14 Feb 2014 09:19:39 +0000 (15:19 +0600)
39 files changed:
sonar-server/karma.conf.js
sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issue_detail_inner.hbs.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb
sonar-server/src/main/webapp/javascripts/handlebars-extensions.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/issues-extra.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/issues.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/measures.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/base-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/checkbox-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/context-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/filter-bar.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/more-criteria-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/range-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/select-filters.js
sonar-server/src/main/webapp/javascripts/navigator/filters/string-filters.js
sonar-server/src/main/webapp/javascripts/navigator/handlebars-extensions.js [deleted file]
sonar-server/src/main/webapp/javascripts/navigator/issues-app-old.js [deleted file]
sonar-server/src/main/webapp/javascripts/navigator/issues-app.js [deleted file]
sonar-server/src/main/webapp/javascripts/navigator/issues.js [deleted file]
sonar-server/src/main/webapp/javascripts/navigator/measures-app.js [deleted file]
sonar-server/src/main/webapp/javascripts/select-list.js
sonar-server/src/main/webapp/javascripts/third-party/backbone-min.js [deleted file]
sonar-server/src/main/webapp/javascripts/third-party/backbone.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.min.js [deleted file]
sonar-server/src/main/webapp/javascripts/third-party/require.js [new file with mode: 0644]
sonar-server/src/main/webapp/javascripts/third-party/underscore-min.js [deleted file]
sonar-server/src/main/webapp/javascripts/third-party/underscore.js [new file with mode: 0644]
sonar-server/wro.xml

index 269a010f7caca4e1b4e89f7030660adcd3c5e50f..9619bdfee07b4c50d8987690a8a28c3f49f58367 100644 (file)
@@ -25,9 +25,9 @@ module.exports = function(config) {
     files: [
         // dependencies
         'third-party/jquery.min.js',
-        'third-party/underscore-min.js',
-        'third-party/backbone-min.js',
-        'third-party/backbone.marionette.min.js',
+        'third-party/underscore.js',
+        'third-party/backbone.js',
+        'third-party/backbone.marionette.js',
 
         // app
         'navigator/filters/base-filters.js',
index fde1b1f39e6f1e409528b4973fdee05172f04f3f..229d1dda198338ea9b1e6e6cef1f9993c30e4866 100644 (file)
@@ -1,3 +1,7 @@
+<% content_for :script do %>
+  <script data-main="<%= ApplicationController.root_context -%>/javascripts/select-list.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script>
+<% end %>
+
 <div>
     <% if profiles_administrator? %>
       <ul style="float: right" class="horizontal">
index da0af92c124fedf8014eee52d5c4161f668f3ec0..722fae1fa1cc1067e2c2e6c535a4fce49c75e07f 100644 (file)
@@ -1,3 +1,7 @@
+<% content_for :script do %>
+  <script data-main="<%= ApplicationController.root_context -%>/javascripts/issues.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script>
+<% end %>
+
 <div class="navigator">
   <div class="navigator-header"></div>
   <div class="navigator-notes">
@@ -29,6 +33,8 @@
 <%= render :partial => '/issues/templates/issue_detail_plan_form.hbs' -%>
 
 <script>
+  window.SS = {};
+
   _.templateSettings = {
     interpolate: /\{\{(.+?)\}\}/g,
     evaluate: /\{\[(.+?)\]\}/g,
       }
     }
   });
-
-  jQuery(function() {
-    window.SS.IssuesNavigatorApp.start();
-  });
 </script>
index c41b006953ff8c89503642c928b38bf18be88bc6..661c0e07d9fcdf74bd2cf9880798150bb58d76ec 100644 (file)
     </div>
   </div>
 </script>
-
-<script>
-  Handlebars.registerPartial('detailInnerTemplate', jQuery('#issue-detail-inner-template').html())
-</script>
index 9a8ffb17f8088eaf9d8b679c6dee75ee9193314e..e1dbf994ae2fe6f9039c90106d046e7ea81838b1 100644 (file)
     <%= javascript_include_tag 'third-party/jquery-ui.min' %>
     <%= javascript_include_tag 'third-party/jquery-ui.tabs' %>
     <%= javascript_include_tag 'third-party/d3.v3.min' %>
-    <%= javascript_include_tag 'third-party/underscore-min' %>
-    <%= javascript_include_tag 'third-party/backbone-min' %>
-    <%= javascript_include_tag 'third-party/backbone.marionette.min' %>
-    <%= javascript_include_tag 'third-party/handlebars' %>
+    <%= javascript_include_tag 'third-party/underscore' %>
     <%= javascript_include_tag 'third-party/jquery.ba-throttle-debounce.min.js' %>
     <%= javascript_include_tag 'third-party/select2.min' %>
 
     <%= javascript_include_tag 'widgets/pie-chart' %>
     <%= javascript_include_tag 'widgets/histogram' %>
 
-    <%= javascript_include_tag 'select-list' %>
     <%= javascript_include_tag 'top-search' %>
     <%= javascript_include_tag 'sortable' %>
 
-    <%= javascript_include_tag 'navigator/handlebars-extensions' %>
-
-    <%= javascript_include_tag 'navigator/filters/base-filters' %>
-    <%= javascript_include_tag 'navigator/filters/select-filters' %>
-    <%= javascript_include_tag 'navigator/filters/ajax-select-filters' %>
-    <%= javascript_include_tag 'navigator/filters/range-filters' %>
-    <%= javascript_include_tag 'navigator/filters/checkbox-filters' %>
-    <%= javascript_include_tag 'navigator/filters/string-filters' %>
-    <%= javascript_include_tag 'navigator/filters/metric-filters' %>
-    <%= javascript_include_tag 'navigator/filters/favorite-filters' %>
-    <%= javascript_include_tag 'navigator/filters/more-criteria-filters' %>
-    <%= javascript_include_tag 'navigator/filters/context-filters' %>
-
-    <%= javascript_include_tag 'navigator/issues' %>
-    <%= javascript_include_tag 'navigator/issues-app' %>
-    <%= javascript_include_tag 'navigator/issues-app-old' %>
-
-    <%= javascript_include_tag 'navigator/measures-app' %>
-
     <%= javascript_include_tag 'application' %>
     <%= javascript_include_tag 'dashboard' %>
     <%= javascript_include_tag 'duplication' %>
index 709e1caf4d38b217f18b99f1f101b46148a3a894..b66d449d89a32ce2128a95b91ddf6ee7a1e7c344 100644 (file)
@@ -1,3 +1,8 @@
+<% content_for :script do %>
+  <script data-main="<%= ApplicationController.root_context -%>/javascripts/measures.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script>
+<% end %>
+
+
 <div class="navigator navigator-simple">
 
   <div class="navigator-filters"></div>
 
 
 <script>
-  _.templateSettings = {
-    interpolate: /\{\{(.+?)\}\}/g,
-    evaluate: /\{\[(.+?)\]\}/g,
-    escape: /\{\{\{(.+?)\}\}\}/g
-  };
-
+  window.SS = typeof window.SS === 'object' ? window.SS : {};
 
   _.extend(window.SS, {
     qualifiers: <%= render :partial => 'measures/qualifiers' -%>,
 
     { key: 'nameSearch', value: '<%= h @filter.criteria['nameSearch'] -%>' }
   ];
-
-  window.SS.MeasuresNavigatorApp.start();
-  window.SS.MeasuresNavigatorApp.filterBarView.restoreFromQuery(queryParams);
 </script>
index 980b4ef6f9fedfc73e0c113ba971f4bce9a2107a..f3a0524a5faab490446eaee6fb8ce44f1c075489 100644 (file)
@@ -1,3 +1,7 @@
+<% content_for :script do %>
+  <script data-main="<%= ApplicationController.root_context -%>/javascripts/select-list.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script>
+<% end %>
+
 <h1 class="admin-page-title"><%= message 'roles.page' -%></h1>
 <p class="admin-page-description"><%= message('roles.page.description') -%></p>
 
index 13ac5b376330594fbc2510e28cc0c53ec6c7f5da..13dc30dbba9b293c373894e956a39a882496f334 100644 (file)
@@ -1,3 +1,7 @@
+<% content_for :script do %>
+  <script data-main="<%= ApplicationController.root_context -%>/javascripts/select-list.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script>
+<% end %>
+
 <h1 class="admin-page-title"><%= h message 'global_permissions.page' -%></h1>
 <p class="admin-page-description"><%= message('global_permissions.page.description') -%> </p>
 
index ad62cb09d20e105b2f1240039c5c8d26ad623963..bea1301a649c0c7db39f7601392607b86b042afa 100644 (file)
@@ -1,3 +1,7 @@
+<% content_for :script do %>
+  <script data-main="<%= ApplicationController.root_context -%>/javascripts/select-list.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script>
+<% end %>
+
 <h1 class="admin-page-title"><%= message 'roles.page' -%></h1>
 <p class="admin-page-description"><%= message('roles.page.description2') -%></p>
 
index acce0f46bb6dd668b43f3fdc4811003d8947dfa1..382c7909fdf1aa6e7e3007f0116b05284e5e9780 100644 (file)
@@ -1,3 +1,7 @@
+<% content_for :script do %>
+  <script data-main="<%= ApplicationController.root_context -%>/javascripts/select-list.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script>
+<% end %>
+
 <div>
     <% if profiles_administrator? %>
       <ul style="float: right" class="horizontal">
diff --git a/sonar-server/src/main/webapp/javascripts/handlebars-extensions.js b/sonar-server/src/main/webapp/javascripts/handlebars-extensions.js
new file mode 100644 (file)
index 0000000..cb1a024
--- /dev/null
@@ -0,0 +1,146 @@
+define(['handlebars'], function (Handlebars) {
+
+  var defaultActions = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity'];
+
+  Handlebars.registerHelper('capitalize', function(string) {
+    return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
+  });
+
+  Handlebars.registerHelper('severityIcon', function(severity) {
+    return new Handlebars.SafeString(
+        '<i class="icon-severity-' + severity.toLowerCase() + '"></i>'
+    );
+  });
+
+  Handlebars.registerHelper('statusIcon', function(status) {
+    return new Handlebars.SafeString(
+        '<i class="icon-status-' + status.toLowerCase() + '"></i>'
+    );
+  });
+
+  Handlebars.registerHelper('resolutionIcon', function(resolution) {
+    return new Handlebars.SafeString(
+        '<i class="icon-resolution-' + resolution.toLowerCase() + '"></i>'
+    );
+  });
+
+  Handlebars.registerHelper('eq', function(v1, v2, options) {
+    return v1 == v2 ? options.fn(this) : options.inverse(this);
+  });
+
+  Handlebars.registerHelper('notEq', function(v1, v2, options) {
+    return v1 != v2 ? options.fn(this) : options.inverse(this);
+  });
+
+  Handlebars.registerHelper('all', function() {
+    var args = Array.prototype.slice.call(arguments, 0, -1),
+        options = arguments[arguments.length - 1],
+        all = args.reduce(function(prev, current) {
+          return prev && current;
+        }, true);
+    return all ? options.fn(this) : options.inverse(this);
+  });
+
+  Handlebars.registerHelper('any', function() {
+    var args = Array.prototype.slice.call(arguments, 0, -1),
+        options = arguments[arguments.length - 1],
+        all = args.reduce(function(prev, current) {
+          return prev || current;
+        }, true);
+    return all ? options.fn(this) : options.inverse(this);
+  });
+
+  Handlebars.registerHelper('inArray', function(array, element, options) {
+    if (array.indexOf(element) !== -1) {
+      return options.fn(this);
+    } else {
+      return options.inverse(this);
+    }
+  });
+
+  Handlebars.registerHelper('ifNotEmpty', function() {
+    var args = Array.prototype.slice.call(arguments, 0, -1),
+        options = arguments[arguments.length - 1],
+        notEmpty = args.reduce(function(prev, current) {
+          return prev || (current && current.length > 0);
+        }, false);
+    return notEmpty ? options.fn(this) : '';
+  });
+
+  Handlebars.registerHelper('dashboardUrl', function(componentKey, componentQualifier) {
+    var url = '/dashboard/index/' + decodeURIComponent(componentKey);
+    if (componentQualifier === 'FIL' || componentQualifier === 'CLA') {
+      url += '?metric=sqale_index';
+    }
+    return url;
+  });
+
+  Handlebars.registerHelper('translate', function(key, prefix) {
+    var args = Array.prototype.slice.call(arguments, 0, -1),
+        tokens = args.reduce(function(prev, current) {
+          return prev.concat(current.split('.'));
+        }, []),
+        start = window.SS.phrases;
+
+    return tokens.reduce(function(prev, current) {
+      return current ? prev[current] : prev;
+    }, start);
+  });
+
+  Handlebars.registerHelper('pluginActions', function(actions, options) {
+    var pluginActions = _.difference(actions, defaultActions);
+    return pluginActions.reduce(function(prev, current) {
+      return prev + options.fn(current);
+    }, '');
+  });
+
+  Handlebars.registerHelper('ifHasExtraTransitions', function(transitions, options) {
+    if (transitions && transitions.length > 1) {
+      return options.fn(this);
+    } else {
+      return '';
+    }
+  });
+
+  Handlebars.registerHelper('ifHasExtraActions', function(actions, options) {
+    var actionsLeft = _.difference(actions, _.without(defaultActions, 'set_severity'));
+    if (actionsLeft.length > 0) {
+      return options.fn(this);
+    } else {
+      return '';
+    }
+  });
+
+  Handlebars.registerHelper('withFirst', function(list, options) {
+    if (list && list.length > 0) {
+      return options.fn(list[0]);
+    } else {
+      return '';
+    }
+  });
+
+  Handlebars.registerHelper('withoutFirst', function(list, options) {
+    if (list && list.length > 1) {
+      return list.slice(1).reduce(function(prev, current) {
+        return prev + options.fn(current);
+      }, '');
+    } else {
+      return '';
+    }
+  });
+
+  Handlebars.registerHelper('sources', function(source, scm, options) {
+    var sources = _.map(source, function(code, line) {
+      return {
+        lineNumber: line,
+        code: code,
+        scm: (scm && scm[line]) ? { author: scm[line][0], date: scm[line][1] } : undefined
+      }
+    });
+
+    return sources.reduce(function(prev, current, index) {
+      return prev + options.fn(_.extend({ first: index === 0 }, current));
+    }, '');
+  });
+
+});
diff --git a/sonar-server/src/main/webapp/javascripts/issues-extra.js b/sonar-server/src/main/webapp/javascripts/issues-extra.js
new file mode 100644 (file)
index 0000000..ffd9155
--- /dev/null
@@ -0,0 +1,1194 @@
+define(
+    [
+      'backbone', 'backbone.marionette',
+      'navigator/filters/filter-bar',
+      'navigator/filters/base-filters',
+      'navigator/filters/favorite-filters'
+    ],
+    function (Backbone, Marionette, FilterBarView, BaseFilters, FavoriteFiltersModule) {
+
+      var AppState = Backbone.Model.extend({
+
+        defaults: {
+          canManageFilter: false,
+          canBulkChange: false
+        },
+
+
+        url: function () {
+          return baseUrl + '/api/issue_filters/page';
+        }
+
+      });
+
+
+      var Issue = Backbone.Model.extend({
+
+        url: function () {
+          return baseUrl + '/api/issues/show?key=' + this.get('key');
+        },
+
+
+        parse: function (r) {
+          return r.issue ? r.issue : r;
+        }
+
+      });
+
+
+      var Issues = Backbone.Collection.extend({
+        model: Issue,
+
+
+        url: function () {
+          return baseUrl + '/api/issues/search';
+        },
+
+
+        parse: function (r) {
+
+          function find(source, key, keyField) {
+            var searchDict = {};
+            searchDict[keyField || 'key'] = key;
+            return _.findWhere(source, searchDict) || key;
+          }
+
+          this.paging = r.paging;
+          this.maxResultsReached = r.maxResultsReached;
+
+          return r.issues.map(function (issue) {
+            var component = find(r.components, issue.component),
+                project = find(r.projects, issue.project),
+                rule = find(r.rules, issue.rule);
+
+            if (component) {
+              _.extend(issue, {
+                componentLongName: component.longName,
+                componentQualifier: component.qualifier
+              });
+            }
+
+            if (project) {
+              _.extend(issue, {
+                projectLongName: project.longName
+              });
+            }
+
+            if (rule) {
+              _.extend(issue, {
+                ruleName: rule.name
+              });
+            }
+
+            return issue;
+          });
+
+        }
+      });
+
+
+      var FavoriteFilter = Backbone.Model.extend({
+
+        url: function () {
+          return baseUrl + '/api/issue_filters/show/' + this.get('id');
+        },
+
+
+        parse: function (r) {
+          return r.filter ? r.filter : r;
+        }
+      });
+
+
+      var FavoriteFilters = Backbone.Collection.extend({
+        model: FavoriteFilter,
+
+
+        url: function () {
+          return baseUrl + '/api/issue_filters/favorites';
+        },
+
+
+        parse: function (r) {
+          return r.favoriteFilters;
+        }
+      });
+
+
+      var Rule = Backbone.Model.extend({
+
+        url: function () {
+          return baseUrl + '/api/rules/show/?key=' + this.get('key');
+        },
+
+
+        parse: function (r) {
+          return r.rule ? r.rule : r;
+        }
+      });
+
+
+      var ActionPlans = Backbone.Collection.extend({
+
+        url: function () {
+          return baseUrl + '/api/action_plans/search';
+        },
+
+
+        parse: function (r) {
+          return r.actionPlans;
+        }
+
+      });
+
+
+      var IssueView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issue-template').html() || ''),
+        tagName: 'li',
+
+
+        ui: {
+          component: '.component'
+        },
+
+
+        events: {
+          'click': 'showDetails'
+        },
+
+
+        modelEvents: {
+          'change': 'render'
+        },
+
+
+        showDetails: function () {
+          this.$el.parent().children().removeClass('active');
+          this.$el.addClass('active');
+
+          var that = this,
+              app = this.options.app,
+              detailView = new IssueDetailView({
+                model: this.model
+              }),
+              showCallback = function () {
+                jQuery('.navigator-details').removeClass('navigator-fetching');
+                app.detailsRegion.show(detailView);
+              };
+
+          jQuery('.navigator-details').empty().addClass('navigator-fetching');
+          jQuery.when(detailView.model.fetch()).done(function () {
+            if (that.model.get('status') !== 'CLOSED') {
+              that.fetchSource(detailView, showCallback);
+            } else {
+              showCallback();
+            }
+
+          });
+        },
+
+
+        fetchSource: function (view, callback) {
+          var line = this.model.get('line') || 0,
+              from = line >= 10 ? line - 10 : 0,
+              to = line + 30;
+
+          return jQuery
+              .ajax({
+                type: 'GET',
+                url: baseUrl + '/api/sources/show',
+                data: {
+                  key: this.model.get('component'),
+                  from: from,
+                  to: to,
+                  format: 'json'
+                }
+              })
+              .done(function (r) {
+                if (_.isObject(r) && r.source) {
+                  view.source = r.source;
+                }
+                if (_.isObject(r) && r.scm) {
+                  view.scm = r.scm;
+                }
+              })
+              .always(callback);
+        },
+
+
+        serializeData: function () {
+          var projectFilter = this.options.app.filters.findWhere({ property: 'componentRoots' }),
+              singleProject = _.isArray(projectFilter.get('value')) && projectFilter.get('value').length === 1;
+
+          return _.extend({
+            singleProject: singleProject
+          }, this.model.toJSON());
+        }
+      });
+
+
+      var NoIssuesView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#no-issues-template').html() || '')
+      });
+
+
+      var IssuesView = Marionette.CollectionView.extend({
+        tagName: 'ol',
+        className: 'navigator-results-list',
+        itemView: IssueView,
+        emptyView: NoIssuesView,
+
+
+        itemViewOptions: function () {
+          return {
+            issuesView: this,
+            app: this.options.app
+          };
+        },
+
+
+        onRender: function () {
+          var $scrollEl = jQuery('.navigator-results'),
+              scrollEl = $scrollEl.get(0),
+              onScroll = function () {
+                if (scrollEl.offsetHeight + scrollEl.scrollTop >= scrollEl.scrollHeight) {
+                  window.SS.IssuesNavigatorApp.fetchNextPage();
+                }
+              },
+              throttledScroll = _.throttle(onScroll, 300);
+          $scrollEl.off('scroll').on('scroll', throttledScroll);
+        },
+
+
+        onAfterItemAdded: function () {
+          var showLimitNotes = this.collection.maxResultsReached != null && this.collection.maxResultsReached;
+          jQuery('.navigator').toggleClass('navigator-with-notes', showLimitNotes);
+          jQuery('.navigator-notes').toggle(showLimitNotes);
+        },
+
+
+        close: function () {
+          var scrollEl = jQuery('.navigator-results');
+          scrollEl.off('scroll');
+          Marionette.CollectionView.prototype.close.call(this);
+        }
+
+      });
+
+
+      var IssuesActionsView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issues-actions-template').html() || ''),
+
+
+        collectionEvents: {
+          'sync': 'render'
+        },
+
+
+        events: {
+          'click .navigator-actions-order': 'toggleOrderChoices',
+          'click .navigator-actions-order-choices': 'sort'
+        },
+
+
+        ui: {
+          orderChoices: '.navigator-actions-order-choices'
+        },
+
+
+        onRender: function () {
+          if (!this.collection.sorting.sortText) {
+            this.collection.sorting.sortText = this.$('[data-sort=' + this.collection.sorting.sort + ']:first').text();
+            this.render();
+            return;
+          }
+
+          this.$('.open-modal').modal();
+        },
+
+
+        toggleOrderChoices: function (e) {
+          e.stopPropagation();
+          this.ui.orderChoices.toggleClass('open');
+          if (this.ui.orderChoices.is('.open')) {
+            var that = this;
+            jQuery('body').on('click.issues_actions', function () {
+              that.ui.orderChoices.removeClass('open');
+            });
+          }
+        },
+
+
+        sort: function (e) {
+          e.stopPropagation();
+          this.ui.orderChoices.removeClass('open');
+          jQuery('body').off('click.issues_actions');
+          var el = jQuery(e.target),
+              sort = el.data('sort'),
+              asc = el.data('asc');
+
+          if (sort != null && asc != null) {
+            this.collection.sorting = {
+              sort: sort,
+              sortText: el.text(),
+              asc: asc
+            };
+            this.options.app.fetchFirstPage();
+          }
+        },
+
+
+        serializeData: function () {
+          var data = Marionette.ItemView.prototype.serializeData.apply(this, arguments);
+          return _.extend(data || {}, {
+            paging: this.collection.paging,
+            sorting: this.collection.sorting,
+            maxResultsReached: this.collection.maxResultsReached,
+            appState: window.SS.appState.toJSON(),
+            query: (Backbone.history.fragment || '').replace(/\|/g, '&')
+          });
+        }
+      });
+
+
+      var IssuesFilterBarView = FilterBarView.extend({
+
+        collectionEvents: {
+          'change:enabled': 'changeEnabled'
+        },
+
+
+        events: {
+          'click .navigator-filter-submit': 'search'
+        },
+
+
+        getQuery: function () {
+          var query = {};
+          this.collection.each(function (filter) {
+            _.extend(query, filter.view.formatValue());
+          });
+          return query;
+        },
+
+
+        onAfterItemAdded: function (itemView) {
+          if (itemView.model.get('type') === FavoriteFiltersModule.FavoriteFilterView ||
+              itemView.model.get('type') === IssuesFavoriteFilterView) {
+            jQuery('.navigator-header').addClass('navigator-header-favorite');
+          }
+        },
+
+
+        search: function () {
+          this.options.app.state.set({
+            query: this.options.app.getQuery(),
+            search: true
+          });
+          this.options.app.fetchFirstPage();
+        },
+
+
+        fetchNextPage: function () {
+          this.options.app.fetchNextPage();
+        }
+
+      });
+
+
+      var IssuesHeaderView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issues-header-template').html() || ''),
+
+
+        modelEvents: {
+          'change': 'render'
+        },
+
+
+        events: {
+          'click #issues-new-search': 'newSearch',
+          'click #issues-filter-save-as': 'saveAs',
+          'click #issues-filter-save': 'save',
+          'click #issues-filter-copy': 'copy',
+          'click #issues-filter-edit': 'edit'
+        },
+
+
+        initialize: function (options) {
+          Marionette.ItemView.prototype.initialize.apply(this, arguments);
+          this.listenTo(options.app.state, 'change', this.render);
+        },
+
+
+        newSearch: function () {
+          this.model.clear();
+          this.options.app.router.navigate('statuses=OPEN,REOPENED', { trigger: true, replace: true });
+        },
+
+
+        saveAs: function () {
+          var url = baseUrl + '/issues/save_as_form?' + (Backbone.history.fragment || '').replace(/\|/g, '&');
+          openModalWindow(url, {});
+        },
+
+
+        save: function () {
+          var that = this;
+          url = baseUrl + '/issues/save/' + this.model.id + '?' + (Backbone.history.fragment || '').replace(/\|/g, '&');
+          jQuery.ajax({
+            type: 'POST',
+            url: url
+          }).done(function () {
+                that.options.app.state.set('search', false);
+              });
+        },
+
+
+        copy: function () {
+          var url = baseUrl + '/issues/copy_form/' + this.model.id;
+          openModalWindow(url, {});
+        },
+
+
+        edit: function () {
+          var url = baseUrl + '/issues/edit_form/' + this.model.id;
+          openModalWindow(url, {});
+        },
+
+
+        serializeData: function () {
+          return _.extend({
+            canSave: this.model.id && this.options.app.state.get('search'),
+            appState: window.SS.appState.toJSON()
+          }, this.model.toJSON());
+        }
+
+      });
+
+
+      var IssueDetailCommentFormView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issue-detail-comment-form-template').html() || ''),
+
+
+        ui: {
+          textarea: '#issue-comment-text',
+          cancelButton: '#issue-comment-cancel',
+          submitButton: '#issue-comment-submit'
+        },
+
+
+        events: {
+          'keyup #issue-comment-text': 'toggleSubmit',
+          'click #issue-comment-cancel': 'cancel',
+          'click #issue-comment-submit': 'submit'
+        },
+
+
+        onDomRefresh: function () {
+          this.ui.textarea.focus();
+        },
+
+
+        toggleSubmit: function () {
+          this.ui.submitButton.prop('disabled', this.ui.textarea.val().length === 0);
+        },
+
+
+        cancel: function () {
+          this.options.detailView.updateAfterAction(false);
+        },
+
+
+        submit: function () {
+          var that = this,
+              text = this.ui.textarea.val(),
+              update = this.model && this.model.has('key'),
+              url = baseUrl + '/api/issues/' + (update ? 'edit_comment' : 'add_comment'),
+              data = { text: text };
+
+          if (update) {
+            data.key = this.model.get('key');
+          } else {
+            data.issue = this.options.issue.get('key');
+          }
+
+          this.options.detailView.showActionSpinner();
+
+          jQuery.ajax({
+            type: 'POST',
+            url: url,
+            data: data
+          })
+              .done(function () {
+                that.options.detailView.updateAfterAction(true);
+              })
+              .fail(function (r) {
+                alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                that.options.detailView.hideActionSpinner();
+              });
+        }
+      });
+
+
+      var IssueDetailSetSeverityFormView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issue-detail-set-severity-form-template').html() || ''),
+
+
+        ui: {
+          select: '#issue-set-severity-select'
+        },
+
+
+        events: {
+          'click #issue-set-severity-cancel': 'cancel',
+          'click #issue-set-severity-submit': 'submit'
+        },
+
+
+        onRender: function () {
+          this.ui.select.select2({
+            minimumResultsForSearch: 100
+          });
+        },
+
+
+        cancel: function () {
+          this.options.detailView.updateAfterAction(false);
+        },
+
+
+        submit: function () {
+          var that = this;
+
+          this.options.detailView.showActionSpinner();
+
+          jQuery.ajax({
+            type: 'POST',
+            url: baseUrl + '/api/issues/set_severity',
+            data: {
+              issue: this.options.issue.get('key'),
+              severity: this.ui.select.val()
+            }
+          })
+              .done(function () {
+                that.options.detailView.updateAfterAction(true);
+              })
+              .fail(function (r) {
+                alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                that.options.detailView.hideActionSpinner();
+              });
+        }
+      });
+
+
+      var IssueDetailAssignFormView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issue-detail-assign-form-template').html() || ''),
+
+
+        ui: {
+          select: '#issue-assignee-select'
+        },
+
+
+        events: {
+          'click #issue-assign-cancel': 'cancel',
+          'click #issue-assign-submit': 'submit'
+        },
+
+
+        onRender: function () {
+          var currentUser = window.SS.currentUser,
+              assignee = this.options.issue.get('assignee'),
+              additionalChoices = [];
+
+          if (!assignee || currentUser !== assignee) {
+            additionalChoices.push({
+              id: currentUser,
+              text: window.SS.phrases.assignedToMe
+            });
+          }
+
+          if (!!assignee) {
+            additionalChoices.push({
+              id: '',
+              text: window.SS.phrases.unassigned
+            });
+          }
+
+          var select2Options = {
+            allowClear: false,
+            width: '250px',
+            formatNoMatches: function () {
+              return window.SS.phrases.select2.noMatches;
+            },
+            formatSearching: function () {
+              return window.SS.phrases.select2.searching;
+            },
+            formatInputTooShort: function () {
+              return window.SS.phrases.select2.tooShort;
+            }
+          };
+
+          if (additionalChoices.length > 0) {
+            select2Options.minimumInputLength = 0;
+            select2Options.query = function (query) {
+              if (query.term.length == 0) {
+                query.callback({ results: additionalChoices });
+              } else if (query.term.length >= 2) {
+                jQuery.ajax({
+                  url: baseUrl + '/api/users/search?f=s2',
+                  data: { s: query.term },
+                  dataType: 'jsonp'
+                }).done(function (data) {
+                      query.callback(data);
+                    });
+              }
+            }
+          } else {
+            select2Options.minimumInputLength = 2;
+            select2Options.ajax = {
+              quietMillis: 300,
+              url: baseUrl + '/api/users/search?f=s2',
+              data: function (term, page) {
+                return {s: term, p: page}
+              },
+              results: function (data) {
+                return { more: data.more, results: data.results }
+              }
+            };
+          }
+
+          this.ui.select.select2(select2Options).select2('open');
+        },
+
+
+        cancel: function () {
+          this.options.detailView.updateAfterAction(false);
+        },
+
+
+        submit: function () {
+          var that = this;
+
+          this.options.detailView.showActionSpinner();
+
+          jQuery.ajax({
+            type: 'POST',
+            url: baseUrl + '/api/issues/assign',
+            data: {
+              issue: this.options.issue.get('key'),
+              assignee: this.ui.select.val()
+            }
+          })
+              .done(function () {
+                that.options.detailView.updateAfterAction(true);
+              })
+              .fail(function (r) {
+                alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                that.options.detailView.hideActionSpinner();
+              });
+        }
+      });
+
+
+      var IssueDetailPlanFormView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issue-detail-plan-form-template').html() || ''),
+
+
+        collectionEvents: {
+          'reset': 'render'
+        },
+
+
+        ui: {
+          select: '#issue-detail-plan-select'
+        },
+
+
+        events: {
+          'click #issue-plan-cancel': 'cancel',
+          'click #issue-plan-submit': 'submit'
+        },
+
+
+        onRender: function () {
+          this.ui.select.select2({
+            width: '250px',
+            minimumResultsForSearch: 100
+          });
+
+          this.$('.error a')
+              .prop('href', baseUrl + '/action_plans/index/' + this.options.issue.get('project'));
+        },
+
+
+        cancel: function () {
+          this.options.detailView.updateAfterAction(false);
+        },
+
+
+        submit: function () {
+          var that = this,
+              plan = this.ui.select.val();
+
+          this.options.detailView.showActionSpinner();
+
+          jQuery.ajax({
+            type: 'POST',
+            url: baseUrl + '/api/issues/plan',
+            data: {
+              issue: this.options.issue.get('key'),
+              plan: plan === '#unplan' ? '' : plan
+            }
+          })
+              .done(function () {
+                that.options.detailView.updateAfterAction(true);
+              })
+              .fail(function (r) {
+                alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                that.options.detailView.hideActionSpinner();
+              });
+        },
+
+
+        serializeData: function () {
+          return {
+            items: this.collection.toJSON(),
+            issue: this.options.issue.toJSON()
+          }
+        }
+      });
+
+
+      var IssueDetailRuleView = Marionette.ItemView.extend({
+        template: Handlebars.compile(jQuery('#issue-detail-rule-template').html() || ''),
+        className: 'rule-desc',
+        modelEvents: { 'change': 'render' },
+
+
+        serializeData: function () {
+          return _.extend({
+            characteristic: this.options.issue.get('characteristic'),
+            subCharacteristic: this.options.issue.get('subCharacteristic')
+          }, this.model.toJSON());
+        }
+      });
+
+
+      var IssueDetailView = Marionette.Layout.extend({
+        template: Handlebars.compile(jQuery('#issue-detail-template').html() || ''),
+
+
+        regions: {
+          formRegion: '.code-issue-form',
+          ruleRegion: '#tab-issue-rule'
+        },
+
+
+        events: {
+          'click .code-issue-toggle': 'toggleCollapsed',
+
+          'click [href=#tab-issue-rule]': 'fetchRule',
+
+          'click #issue-comment': 'comment',
+          'click .issue-comment-edit': 'editComment',
+          'click .issue-comment-delete': 'deleteComment',
+          'click .issue-transition': 'transition',
+          'click #issue-set-severity': 'setSeverity',
+          'click #issue-assign': 'assign',
+          'click #issue-assign-to-me': 'assignToMe',
+          'click #issue-plan': 'plan',
+          'click .issue-action': 'action'
+        },
+
+
+        modelEvents: {
+          'change': 'render'
+        },
+
+
+        onRender: function () {
+          this.$('.code-issue-details').tabs();
+          this.$('.code-issue-form').hide();
+          this.rule = new Rule({ key: this.model.get('rule') });
+          this.ruleRegion.show(new IssueDetailRuleView({
+            model: this.rule,
+            issue: this.model
+          }));
+          this.initReferenceLinks();
+        },
+
+
+        initReferenceLinks: function () {
+          var sourcesId = 'sources_' + this.model.get('key');
+          this.$('#' + sourcesId).on('click', 'span.sym', { id: sourcesId }, highlight_usages);
+        },
+
+
+        onDomRefresh: function () {
+          var sourceTitleHeight = this.$('.source_title').outerHeight();
+          jQuery('.navigator-details').css('padding-top', (sourceTitleHeight + 10) + 'px');
+        },
+
+
+        onClose: function () {
+          if (this.ruleRegion) {
+            this.ruleRegion.reset();
+          }
+        },
+
+
+        resetIssue: function (options) {
+          var key = this.model.get('key');
+          this.model.clear({ silent: true });
+          this.model.set({ key: key }, { silent: true });
+          return this.model.fetch(options);
+        },
+
+
+        toggleCollapsed: function () {
+          this.$('.code-issue').toggleClass('code-issue-collapsed');
+          this.fetchRule();
+        },
+
+
+        fetchRule: function () {
+          var that = this;
+          if (!this.rule.has('name')) {
+            this.$('#tab-issue-rule').addClass('navigator-fetching');
+            this.rule.fetch({
+              success: function () {
+                that.$('#tab-issue-rule').removeClass('navigator-fetching');
+              }
+            });
+          }
+        },
+
+
+        showActionView: function (view) {
+          this.$('.code-issue-actions').hide();
+          this.$('.code-issue-form').show();
+          this.formRegion.show(view);
+        },
+
+
+        showActionSpinner: function () {
+          this.$('.code-issue-actions').addClass('navigator-fetching');
+        },
+
+
+        hideActionSpinner: function () {
+          this.$('.code-issue-actions').removeClass('navigator-fetching');
+        },
+
+
+        updateAfterAction: function (fetch) {
+          var that = this;
+
+          that.formRegion.reset();
+          that.$('.code-issue-actions').show();
+          that.$('.code-issue-form').hide();
+          that.$('[data-comment-key]').show();
+
+          if (fetch) {
+            jQuery.when(this.resetIssue()).done(function () {
+              that.hideActionSpinner();
+            });
+          }
+        },
+
+
+        comment: function () {
+          var commentFormView = new IssueDetailCommentFormView({
+            issue: this.model,
+            detailView: this
+          });
+          this.showActionView(commentFormView);
+        },
+
+
+        editComment: function (e) {
+          var commentEl = jQuery(e.target).closest('[data-comment-key]'),
+              commentKey = commentEl.data('comment-key'),
+              comment = _.findWhere(this.model.get('comments'), { key: commentKey });
+
+          commentEl.hide();
+
+          var commentFormView = new IssueDetailCommentFormView({
+            model: new Backbone.Model(comment),
+            issue: this.model,
+            detailView: this
+          });
+          this.showActionView(commentFormView);
+        },
+
+
+        deleteComment: function (e) {
+          var that = this,
+              commentKey = jQuery(e.target).closest('[data-comment-key]').data('comment-key'),
+              confirmMsg = jQuery(e.target).data('confirm-msg');
+
+          if (confirm(confirmMsg)) {
+            this.showActionSpinner();
+
+            jQuery.ajax({
+              type: "POST",
+              url: baseUrl + "/issue/delete_comment?id=" + commentKey
+            })
+                .done(function () {
+                  that.updateAfterAction(true);
+                })
+                .fail(function (r) {
+                  alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                  that.hideActionSpinner();
+                });
+          }
+        },
+
+
+        transition: function (e) {
+          var that = this;
+
+          this.showActionSpinner();
+
+          jQuery.ajax({
+            type: 'POST',
+            url: baseUrl + '/api/issues/do_transition',
+            data: {
+              issue: this.model.get('key'),
+              transition: jQuery(e.target).data('transition')
+            }
+          })
+              .done(function () {
+                that.resetIssue();
+              })
+              .fail(function (r) {
+                alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                that.hideActionSpinner();
+              });
+        },
+
+
+        setSeverity: function () {
+          var setSeverityFormView = new IssueDetailSetSeverityFormView({
+            issue: this.model,
+            detailView: this
+          });
+          this.showActionView(setSeverityFormView);
+        },
+
+
+        assign: function () {
+          var assignFormView = new IssueDetailAssignFormView({
+            issue: this.model,
+            detailView: this
+          });
+          this.showActionView(assignFormView);
+        },
+
+
+        assignToMe: function () {
+          var that = this;
+
+          this.showActionSpinner();
+
+          jQuery.ajax({
+            type: 'POST',
+            url: baseUrl + '/api/issues/assign',
+            data: {
+              issue: this.model.get('key'),
+              assignee: window.SS.currentUser
+            }
+          })
+              .done(function () {
+                that.resetIssue();
+              })
+              .fail(function (r) {
+                alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                that.hideActionSpinner();
+              });
+        },
+
+
+        plan: function () {
+          var that = this,
+              actionPlans = new ActionPlans(),
+              planFormView = new IssueDetailPlanFormView({
+                collection: actionPlans,
+                issue: this.model,
+                detailView: this
+              });
+
+          this.showActionSpinner();
+
+          actionPlans.fetch({
+            reset: true,
+            data: { project: this.model.get('project') },
+            success: function () {
+              that.hideActionSpinner();
+              that.showActionView(planFormView);
+            }
+          });
+        },
+
+        action: function (e) {
+          var that = this,
+              actionKey = jQuery(e.target).data('action');
+
+          this.showActionSpinner();
+
+          jQuery.ajax({
+            type: 'POST',
+            url: baseUrl + '/api/issues/do_action',
+            data: {
+              issue: this.model.get('key'),
+              actionKey: actionKey
+            }
+          })
+              .done(function () {
+                that.resetIssue();
+              })
+              .fail(function (r) {
+                alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
+                that.hideActionSpinner();
+              });
+        },
+
+
+        serializeData: function () {
+          return _.extend({
+            source: this.source,
+            scm: this.scm
+          }, this.model.toJSON());
+        }
+
+      });
+
+
+      var IssuesDetailsFavoriteFilterView = FavoriteFiltersModule.DetailsFavoriteFilterView.extend({
+        template: Handlebars.compile(jQuery('#issues-details-favorite-filter-template').html() || ''),
+
+
+        applyFavorite: function (e) {
+          var id = $j(e.target).data('id'),
+              filter = new window.SS.FavoriteFilter({ id: id }),
+              app = this.options.filterView.options.app;
+
+          filter.fetch({
+            success: function () {
+              app.state.set('search', false);
+              app.favoriteFilter.clear({ silent: true });
+              app.favoriteFilter.set(filter.toJSON());
+            }
+          });
+
+          this.options.filterView.hideDetails();
+        },
+
+
+        serializeData: function () {
+          return _.extend({}, this.model.toJSON(), {
+            items: this.model.get('choices')
+          });
+        }
+      });
+
+
+      var IssuesFavoriteFilterView = FavoriteFiltersModule.FavoriteFilterView.extend({
+
+        initialize: function () {
+          BaseFilters.BaseFilterView.prototype.initialize.call(this, {
+            detailsView: IssuesDetailsFavoriteFilterView
+          });
+
+          this.listenTo(window.SS.appState, 'change:favorites', this.updateFavorites);
+        },
+
+
+        updateFavorites: function () {
+          this.model.set('choices', window.SS.appState.get('favorites'));
+          this.render();
+        }
+      });
+
+
+      var IssuesRouter = Backbone.Router.extend({
+
+        routes: {
+          '': 'emptyQuery',
+          ':query': 'index'
+        },
+
+
+        initialize: function (options) {
+          this.app = options.app;
+        },
+
+
+        parseQuery: function (query, separator) {
+          return (query || '').split(separator || '|').map(function (t) {
+            var tokens = t.split('=');
+            return {
+              key: tokens[0],
+              value: decodeURIComponent(tokens[1])
+            }
+          });
+        },
+
+
+        emptyQuery: function () {
+          this.navigate('statuses=OPEN,REOPENED', { trigger: true, replace: true });
+        },
+
+
+        index: function (query) {
+          var params = this.parseQuery(query);
+
+          var idObj = _.findWhere(params, { key: 'id' });
+          if (idObj) {
+            var that = this,
+                f = this.app.favoriteFilter;
+            this.app.canSave = false;
+            f.set('id', idObj.value);
+            f.fetch({
+              success: function () {
+                params = _.extend({}, that.parseQuery(f.get('query')), params);
+                that.loadResults(params);
+              }
+            });
+          } else {
+            this.loadResults(params);
+          }
+        },
+
+
+        loadResults: function (params) {
+          this.app.filterBarView.restoreFromQuery(params);
+          this.app.restoreSorting(params);
+          this.app.fetchFirstPage();
+        }
+
+      });
+
+
+      /*
+       * Export public classes
+       */
+
+      return {
+        AppState: AppState,
+        Issue: Issue,
+        Issues: Issues,
+        FavoriteFilter: FavoriteFilter,
+        FavoriteFilters: FavoriteFilters,
+        IssueView: IssueView,
+        IssuesView: IssuesView,
+        IssuesActionsView: IssuesActionsView,
+        IssuesFilterBarView: IssuesFilterBarView,
+        IssuesHeaderView: IssuesHeaderView,
+        IssuesFavoriteFilterView: IssuesFavoriteFilterView,
+        IssueDetailView: IssueDetailView,
+        IssuesRouter: IssuesRouter
+      };
+
+    });
diff --git a/sonar-server/src/main/webapp/javascripts/issues.js b/sonar-server/src/main/webapp/javascripts/issues.js
new file mode 100644 (file)
index 0000000..1a06a92
--- /dev/null
@@ -0,0 +1,375 @@
+requirejs.config({
+
+  paths: {
+    'backbone': 'third-party/backbone',
+    'backbone.marionette': 'third-party/backbone.marionette',
+    'handlebars': 'third-party/handlebars'
+  },
+
+  shim: {
+    'backbone.marionette': {
+      deps: ['backbone'],
+      exports: 'Marionette'
+    },
+    'backbone': {
+      exports: 'Backbone'
+    },
+    'handlebars': {
+      exports: 'Handlebars'
+    }
+  }
+
+});
+
+requirejs(
+    [
+      'backbone', 'backbone.marionette', 'handlebars',
+      'issues-extra',
+      'navigator/filters/filter-bar',
+      'navigator/filters/base-filters',
+      'navigator/filters/checkbox-filters',
+      'navigator/filters/select-filters',
+      'navigator/filters/ajax-select-filters',
+      'navigator/filters/favorite-filters',
+      'navigator/filters/range-filters',
+      'navigator/filters/context-filters',
+
+      'handlebars-extensions'
+    ],
+    function (Backbone, Marionette, Handlebars, Extra, FilterBar, BaseFilters, CheckboxFilterView, SelectFilters, AjaxSelectFilters, FavoriteFilters, RangeFilters, ContextFilterView) {
+      Handlebars.registerPartial('detailInnerTemplate', jQuery('#issue-detail-inner-template').html());
+
+
+      var NavigatorApp = new Marionette.Application();
+
+
+      NavigatorApp.addRegions({
+        headerRegion: '.navigator-header',
+        filtersRegion: '.navigator-filters',
+        resultsRegion: '.navigator-results',
+        actionsRegion: '.navigator-actions',
+        detailsRegion: '.navigator-details'
+      });
+
+
+      NavigatorApp.addInitializer(function () {
+        jQuery('html').addClass('issues-page');
+
+        this.appState = new Extra.AppState();
+        window.SS.appState = this.appState;
+
+        this.state = new Backbone.Model({
+          query: ''
+        });
+
+        this.issues = new Extra.Issues();
+        this.issues.sorting = {
+          sort: 'UPDATE_DATE',
+          asc: false
+        };
+        this.issuesPage = 1;
+
+        this.filters = new BaseFilters.Filters();
+
+        this.favoriteFilter = new Extra.FavoriteFilter();
+        this.issuesHeaderView = new Extra.IssuesHeaderView({
+          app: this,
+          model: this.favoriteFilter
+        });
+        this.headerRegion.show(this.issuesHeaderView);
+
+        this.issuesView = new Extra.IssuesView({
+          app: this,
+          collection: this.issues
+        });
+        this.resultsRegion.show(this.issuesView);
+
+        this.issuesActionsView = new Extra.IssuesActionsView({
+          app: this,
+          collection: this.issues
+        });
+        this.actionsRegion.show(this.issuesActionsView);
+      });
+
+
+      NavigatorApp.addInitializer(function () {
+        this.filters.add([
+          new BaseFilters.Filter({
+            name: window.SS.phrases.project,
+            property: 'componentRoots',
+            type: AjaxSelectFilters.ProjectFilterView,
+            enabled: true,
+            optional: false
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.severity,
+            property: 'severities',
+            type: SelectFilters.SelectFilterView,
+            enabled: true,
+            optional: false,
+            choices: {
+              'BLOCKER': window.SS.phrases.severities.BLOCKER,
+              'CRITICAL': window.SS.phrases.severities.CRITICAL,
+              'MAJOR': window.SS.phrases.severities.MAJOR,
+              'MINOR': window.SS.phrases.severities.MINOR,
+              'INFO': window.SS.phrases.severities.INFO
+            },
+            choiceIcons: {
+              'BLOCKER': 'severity-blocker',
+              'CRITICAL': 'severity-critical',
+              'MAJOR': 'severity-major',
+              'MINOR': 'severity-minor',
+              'INFO': 'severity-info'
+            }
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.status,
+            property: 'statuses',
+            type: SelectFilters.SelectFilterView,
+            enabled: true,
+            optional: false,
+            choices: {
+              'OPEN': window.SS.phrases.statuses.OPEN,
+              'CONFIRMED': window.SS.phrases.statuses.CONFIRMED,
+              'REOPENED': window.SS.phrases.statuses.REOPENED,
+              'RESOLVED': window.SS.phrases.statuses.RESOLVED,
+              'CLOSED': window.SS.phrases.statuses.CLOSED
+            },
+            choiceIcons: {
+              'OPEN': 'status-open',
+              'CONFIRMED': 'status-confirmed',
+              'REOPENED': 'status-reopened',
+              'RESOLVED': 'status-resolved',
+              'CLOSED': 'status-closed'
+            }
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.assignee,
+            property: 'assignees',
+            type: AjaxSelectFilters.AssigneeFilterView,
+            enabled: true,
+            optional: false
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.resolution,
+            property: 'resolutions',
+            type: SelectFilters.SelectFilterView,
+            enabled: false,
+            optional: true,
+            choices: {
+              'FALSE-POSITIVE': window.SS.phrases.resolutions['FALSE-POSITIVE'],
+              'FIXED': window.SS.phrases.resolutions.FIXED,
+              'REMOVED': window.SS.phrases.resolutions.REMOVED
+            }
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.reporter,
+            property: 'reporters',
+            type: AjaxSelectFilters.ReporterFilterView,
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.created,
+            propertyFrom: 'createdAfter',
+            propertyTo: 'createdBefore',
+            type: RangeFilters.DateRangeFilterView,
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            property: 'resolved',
+            type: ContextFilterView,
+            enabled: true,
+            optional: false
+          }),
+
+          new BaseFilters.Filter({
+            property: 'actionPlans',
+            type: ContextFilterView,
+            enabled: true,
+            optional: false
+          }),
+
+          new BaseFilters.Filter({
+            property: 'createdAt',
+            type: ContextFilterView,
+            enabled: true,
+            optional: false
+          })
+        ]);
+
+
+        this.filterBarView = new Extra.IssuesFilterBarView({
+          app: this,
+          collection: this.filters,
+          extra: {
+            sort: '',
+            asc: false
+          }
+        });
+
+        this.filtersRegion.show(this.filterBarView);
+      });
+
+
+      NavigatorApp.addInitializer(function () {
+        var app = this;
+
+        jQuery.when(this.appState.fetch()).done(function () {
+
+          if (app.appState.get('favorites')) {
+            app.filters.unshift(
+                new BaseFilters.Filter({
+                  type: Extra.IssuesFavoriteFilterView,
+                  enabled: true,
+                  optional: false,
+                  choices: app.appState.get('favorites'),
+                  manageUrl: '/issues/manage'
+                })
+            );
+          }
+
+          app.router = new Extra.IssuesRouter({
+            app: app
+          });
+          Backbone.history.start();
+
+          app.favoriteFilter.on('change:query', function (model, query) {
+            app.router.navigate(query, { trigger: true, replace: true });
+          });
+        });
+      });
+
+
+      NavigatorApp.addInitializer(function () {
+        var app = this;
+
+        window.onBulkIssues = function () {
+          app.fetchFirstPage();
+          jQuery('.ui-dialog, .ui-widget-overlay').remove();
+        };
+
+        window.onSaveAs = window.onCopy = window.onEdit = function (id) {
+          jQuery('#modal').dialog('close');
+          app.appState.fetch();
+
+          var filter = new Extra.FavoriteFilter({ id: id });
+          filter.fetch({
+            success: function () {
+              app.state.set('search', false);
+              app.favoriteFilter.set(filter.toJSON());
+              app.fetchFirstPage();
+            }
+          });
+        };
+      });
+
+
+      NavigatorApp.getQuery = function (withoutId) {
+        var query = this.filterBarView.getQuery();
+        if (!withoutId && this.favoriteFilter.id) {
+          query['id'] = this.favoriteFilter.id;
+        }
+        return query;
+      };
+
+
+      NavigatorApp.storeQuery = function (query, sorting) {
+        if (sorting) {
+          _.extend(query, {
+            sort: sorting.sort,
+            asc: '' + sorting.asc
+          });
+        }
+
+        var queryString = _.map(query,function (v, k) {
+          return [k, encodeURIComponent(v)].join('=');
+        }).join('|');
+        this.router.navigate(queryString, { replace: true });
+      };
+
+
+      NavigatorApp.restoreSorting = function (query) {
+        var sort = _.findWhere(query, { key: 'sort' }),
+            asc = _.findWhere(query, { key: 'asc' });
+
+        if (sort && asc) {
+          this.issues.sorting = {
+            sort: sort.value,
+            sortText: jQuery('[data-sort=' + sort.value + ']:first').text(),
+            asc: asc.value === 'true'
+          }
+        }
+      };
+
+
+      NavigatorApp.fetchIssues = function (firstPage) {
+        var query = this.getQuery(),
+            fetchQuery = _.extend({
+              pageIndex: this.issuesPage
+            }, query);
+
+        if (this.issues.sorting) {
+          _.extend(fetchQuery, {
+            sort: this.issues.sorting.sort,
+            asc: this.issues.sorting.asc
+          });
+        }
+
+        _.extend(fetchQuery, {
+          hideRules: true
+        });
+
+        if (this.favoriteFilter.id) {
+          query['id'] = this.favoriteFilter.id;
+          fetchQuery['id'] = this.favoriteFilter.id;
+        }
+
+        this.storeQuery(query, this.issues.sorting);
+
+        var that = this;
+        this.issuesView.$el.addClass('navigator-fetching');
+        if (firstPage) {
+          this.issues.fetch({
+            data: fetchQuery,
+            success: function () {
+              that.issuesView.$el.removeClass('navigator-fetching');
+            }
+          });
+          this.detailsRegion.reset();
+        } else {
+          this.issues.fetch({
+            data: fetchQuery,
+            remove: false,
+            success: function () {
+              that.issuesView.$el.removeClass('navigator-fetching');
+            }
+          });
+        }
+      };
+
+
+      NavigatorApp.fetchFirstPage = function () {
+        this.issuesPage = 1;
+        this.fetchIssues(true);
+      };
+
+
+      NavigatorApp.fetchNextPage = function () {
+        if (this.issuesPage < this.issues.paging.pages) {
+          this.issuesPage++;
+          this.fetchIssues(false);
+        }
+      };
+
+      NavigatorApp.start();
+
+    });
diff --git a/sonar-server/src/main/webapp/javascripts/measures.js b/sonar-server/src/main/webapp/javascripts/measures.js
new file mode 100644 (file)
index 0000000..4f6e727
--- /dev/null
@@ -0,0 +1,210 @@
+requirejs.config({
+
+  paths: {
+    'backbone': 'third-party/backbone',
+    'backbone.marionette': 'third-party/backbone.marionette',
+    'handlebars': 'third-party/handlebars'
+  },
+
+  shim: {
+    'backbone.marionette': {
+      deps: ['backbone'],
+      exports: 'Marionette'
+    },
+    'backbone': {
+      exports: 'Backbone'
+    }
+  }
+
+});
+
+requirejs(
+    [
+      'backbone', 'backbone.marionette',
+      'navigator/filters/filter-bar',
+      'navigator/filters/base-filters',
+      'navigator/filters/checkbox-filters',
+      'navigator/filters/select-filters',
+      'navigator/filters/ajax-select-filters',
+      'navigator/filters/favorite-filters',
+      'navigator/filters/range-filters',
+      'navigator/filters/string-filters',
+      'navigator/filters/metric-filters'
+    ],
+    function (Backbone, Marionette, FilterBar, BaseFilters, CheckboxFilterView, SelectFilters, AjaxSelectFilters,
+              FavoriteFilters, RangeFilters, StringFilterView, MetricFilterView) {
+
+      _.templateSettings = {
+        interpolate: /\{\{(.+?)\}\}/g,
+        evaluate: /\{\[(.+?)\]\}/g,
+        escape: /\{\{\{(.+?)\}\}\}/g
+      };
+
+      var NavigatorApp = new Marionette.Application();
+
+
+      NavigatorApp.addRegions({
+        filtersRegion: '.navigator-filters'
+      });
+
+
+      NavigatorApp.addInitializer(function () {
+        this.filters = new BaseFilters.Filters();
+
+        if (_.isObject(window.SS.favorites)) {
+          this.filters.add([
+            new BaseFilters.Filter({
+              type: FavoriteFilters.FavoriteFilterView,
+              enabled: true,
+              optional: false,
+              choices: window.SS.favorites,
+              favoriteUrl: '/measures/filter',
+              manageUrl: '/measures/manage'
+            })]);
+        }
+
+        this.filters.add([
+          new BaseFilters.Filter({
+            name: window.SS.phrases.components,
+            property: 'qualifiers[]',
+            type: SelectFilters.SelectFilterView,
+            enabled: true,
+            optional: false,
+            choices: window.SS.qualifiers,
+            defaultValue: window.SS.phrases.any
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.alert,
+            property: 'alertLevels[]',
+            type: SelectFilters.SelectFilterView,
+            enabled: false,
+            optional: true,
+            choices: {
+              'error': window.SS.phrases.error,
+              'warn': window.SS.phrases.warning,
+              'ok': window.SS.phrases.ok
+            }
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.componentsOf,
+            property: 'base',
+            type: AjaxSelectFilters.ComponentFilterView,
+            multiple: false,
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.favoritesOnly,
+            property: 'onFavourites',
+            type: CheckboxFilterView,
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.date,
+            propertyFrom: 'fromDate',
+            propertyTo: 'toDate',
+            type: RangeFilters.DateRangeFilterView,
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.keyContains,
+            property: 'keySearch',
+            type: StringFilterView,
+            enabled: false,
+            optional: true
+          })
+        ]);
+
+        if (_.isObject(window.SS.languages) && _.size(window.SS.languages) > 1) {
+          this.filters.add([
+            new BaseFilters.Filter({
+              name: window.SS.phrases.language,
+              property: 'languages[]',
+              type: SelectFilters.SelectFilterView,
+              enabled: false,
+              optional: true,
+              choices: window.SS.languages
+            })
+          ]);
+        }
+
+        this.filters.add([
+          new BaseFilters.Filter({
+            name: window.SS.phrases.lastAnalysis,
+            propertyFrom: 'ageMinDays',
+            propertyTo: 'ageMaxDays',
+            type: RangeFilters.RangeFilterView,
+            placeholder: window.SS.phrases.days,
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.metric,
+            property: 'c3',
+            type: MetricFilterView,
+            metrics: window.SS.metrics,
+            periods: window.SS.metricPeriods,
+            operations: { 'eq': '=', 'lt': '<', 'lte': '≤', 'gt': '>', 'gte': '≥' },
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.metric,
+            property: 'c2',
+            type: MetricFilterView,
+            metrics: window.SS.metrics,
+            periods: window.SS.metricPeriods,
+            operations: { 'eq': '=', 'lt': '<', 'lte': '≤', 'gt': '>', 'gte': '≥' },
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.metric,
+            property: 'c1',
+            type: MetricFilterView,
+            metrics: window.SS.metrics,
+            periods: window.SS.metricPeriods,
+            operations: { 'eq': '=', 'lt': '<', 'lte': '≤', 'gt': '>', 'gte': '≥' },
+            enabled: false,
+            optional: true
+          }),
+
+          new BaseFilters.Filter({
+            name: window.SS.phrases.nameContains,
+            property: 'nameSearch',
+            type: StringFilterView,
+            enabled: false,
+            optional: true
+          })
+        ]);
+
+
+        this.filterBarView = new FilterBar({
+          collection: this.filters,
+          extra: {
+            sort: '',
+            asc: false
+          }
+        });
+
+
+        this.filtersRegion.show(this.filterBarView);
+      });
+
+
+      NavigatorApp.start();
+      if (window.queryParams) {
+        NavigatorApp.filterBarView.restoreFromQuery(window.queryParams);
+      }
+
+    });
index 110722154c5d828ae5785d725761b56b98d86ae2..9cd45f9491dadc9410da1d14a8f704912fac4539 100644 (file)
@@ -1,8 +1,4 @@
-/* global _:false, $j:false, Backbone:false, baseUrl:false */
-
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
+define(['backbone', 'navigator/filters/base-filters', 'navigator/filters/select-filters'], function (Backbone, BaseFilters, SelectFilters) {
 
   var PAGE_SIZE = 100;
 
@@ -55,16 +51,6 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var ProjectSuggestions = Suggestions.extend({
-
-    url: function() {
-      return baseUrl + '/api/resources/search?f=s2&q=TRK&display_key=true';
-    }
-
-  });
-
-
-
   var ComponentSuggestions = Suggestions.extend({
 
     url: function() {
@@ -93,15 +79,10 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var AjaxSelectDetailsFilterView = window.SS.DetailsSelectFilterView.extend({
+  var AjaxSelectDetailsFilterView = SelectFilters.DetailsSelectFilterView.extend({
     template: '#ajaxSelectFilterTemplate',
 
 
-    initialize: function() {
-      window.SS.DetailsSelectFilterView.prototype.initialize.apply(this, arguments);
-    },
-
-
     onRender: function() {
       this.resetChoices();
 
@@ -176,7 +157,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
     onShow: function() {
-      window.SS.DetailsSelectFilterView.prototype.onShow.apply(this, arguments);
+      SelectFilters.DetailsSelectFilterView.prototype.onShow.apply(this, arguments);
       this.$('.navigator-filter-search input').focus();
     }
 
@@ -184,7 +165,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var AjaxSelectFilterView = window.SS.SelectFilterView.extend({
+  var AjaxSelectFilterView = SelectFilters.SelectFilterView.extend({
 
     isDefaultValue: function() {
       return this.selection.length === 0;
@@ -276,7 +257,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
   var ComponentFilterView = AjaxSelectFilterView.extend({
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: AjaxSelectDetailsFilterView
       });
 
@@ -308,7 +289,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
   var ProjectFilterView = AjaxSelectFilterView.extend({
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: AjaxSelectDetailsFilterView
       });
 
@@ -363,7 +344,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
   var AssigneeFilterView = AjaxSelectFilterView.extend({
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: AssigneeDetailsFilterView
       });
 
@@ -465,7 +446,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
   var ReporterFilterView = AjaxSelectFilterView.extend({
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: AjaxSelectDetailsFilterView
       });
 
@@ -498,11 +479,11 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
    * Export public classes
    */
 
-  _.extend(window.SS, {
+  return {
     ProjectFilterView: ProjectFilterView,
     ComponentFilterView: ComponentFilterView,
     AssigneeFilterView: AssigneeFilterView,
     ReporterFilterView: ReporterFilterView
-  });
+  };
 
-})();
+});
index bdb6a80887e0f0e2cfcfeabcac1f8db8ea540bef..d3b764e23da041ebd9110d717caf980bfffbe151 100644 (file)
@@ -1,8 +1,4 @@
-/* global _:false, $j:false, Backbone:false */
-
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
+define(['backbone', 'backbone.marionette'], function (Backbone, Marionette) {
 
   var Filter = Backbone.Model.extend({
 
@@ -21,7 +17,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var DetailsFilterView = Backbone.Marionette.ItemView.extend({
+  var DetailsFilterView = Marionette.ItemView.extend({
     template: '#detailsFilterTemplate',
     className: 'navigator-filter-details',
 
@@ -39,7 +35,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var BaseFilterView = Backbone.Marionette.ItemView.extend({
+  var BaseFilterView = Marionette.ItemView.extend({
     template: '#baseFilterTemplate',
     className: 'navigator-filter',
 
@@ -62,7 +58,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
     initialize: function(options) {
-      Backbone.Marionette.ItemView.prototype.initialize.apply(this, arguments);
+      Marionette.ItemView.prototype.initialize.apply(this, arguments);
 
       var detailsView = options.detailsView || DetailsFilterView;
       this.detailsView = new detailsView({
@@ -96,7 +92,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
     renderBase: function() {
-      Backbone.Marionette.ItemView.prototype.render.apply(this, arguments);
+      Marionette.ItemView.prototype.render.apply(this, arguments);
       this.renderInput();
     },
 
@@ -213,111 +209,15 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var FilterBarView = Backbone.Marionette.CompositeView.extend({
-    template: '#filterBarTemplate',
-    itemViewContainer: '.navigator-filters-list',
-
-
-    collectionEvents: {
-      'change:enabled': 'changeEnabled'
-    },
-
-
-    getItemView: function(item) {
-      return item.get('type') || BaseFilterView;
-    },
-
-
-    itemViewOptions: function() {
-      return {
-        filterBarView: this,
-        app: this.options.app
-      };
-    },
-
-
-    initialize: function() {
-      Backbone.Marionette.CompositeView.prototype.initialize.apply(this, arguments);
-
-      var that = this;
-      $j('body').on('click', function() {
-        that.hideDetails();
-      });
-
-      var disabledFilters = this.collection.where({ enabled: false });
-      this.moreCriteriaFilter = new window.SS.Filter({
-        type: window.SS.MoreCriteriaFilterView,
-        enabled: true,
-        optional: false,
-        filters: disabledFilters
-      });
-      this.collection.add(this.moreCriteriaFilter);
-    },
-
-
-    onAfterItemAdded: function(itemView) {
-      if (itemView.model.get('type') === window.SS.FavoriteFilterView ||
-          itemView.model.get('type') === window.SS.IssuesFavoriteFilterView) {
-        this.$el.addClass('navigator-filter-list-favorite');
-      }
-    },
-
-
-    restoreFromQuery: function(q) {
-      this.collection.each(function(item) {
-        item.set('enabled', !item.get('optional'));
-        item.view.clear();
-        item.view.restoreFromQuery(q);
-      });
-    },
-
-
-    hideDetails: function() {
-      if (_.isObject(this.showedView)) {
-        this.showedView.hideDetails();
-      }
-    },
-
-
-    enableFilter: function(id) {
-      var filter = this.collection.get(id),
-          filterView = filter.view;
-
-      filterView.$el.detach().insertBefore(this.$('.navigator-filter-more-criteria'));
-      filter.set('enabled', true);
-      filterView.showDetails();
-    },
-
-
-    changeEnabled: function() {
-      var disabledFilters = this.collection
-          .where({ enabled: false })
-          .reject(function(filter) {
-            return filter.get('type') === window.SS.MoreCriteriaFilterView;
-          });
-
-      if (disabledFilters.length === 0) {
-        this.moreCriteriaFilter.set({ enabled: false }, { silent: true });
-      } else {
-        this.moreCriteriaFilter.set({ enabled: true }, { silent: true });
-      }
-      this.moreCriteriaFilter.set('filters', disabledFilters);
-    }
-
-  });
-
-
-
   /*
    * Export public classes
    */
 
-  _.extend(window.SS, {
+  return {
     Filter: Filter,
     Filters: Filters,
     BaseFilterView: BaseFilterView,
-    DetailsFilterView: DetailsFilterView,
-    FilterBarView: FilterBarView
-  });
+    DetailsFilterView: DetailsFilterView
+  };
 
-})();
+});
index af04fe5662acecf0d48c3997138a85e19dc762e3..8e9e011272da0eee107a7c2146c83109c81489cd 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false */
+define(['backbone', 'backbone.marionette', 'navigator/filters/base-filters'], function (Backbone, Marionette, BaseFilters) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var CheckboxFilterView = window.SS.BaseFilterView.extend({
+  return BaseFilters.BaseFilterView.extend({
     template: '#checkboxFilterTemplate',
     className: 'navigator-filter navigator-filter-inline',
 
@@ -51,14 +47,4 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
   });
 
-
-
-  /*
-   * Export public classes
-   */
-
-  _.extend(window.SS, {
-    CheckboxFilterView: CheckboxFilterView
-  });
-
-})();
+});
index c74571bdf41cafd375bbadc2897553936f6fefe8..ec71ff3f7740138be864532805495b4a4b3ce444 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false, Backbone:false */
+define(['backbone'], function (Backbone) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var ContextFilterView = Backbone.View.extend({
+  return Backbone.View.extend({
 
     initialize: function() {
       this.model.view = this;
@@ -67,14 +63,4 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
     }
   });
 
-
-
-  /*
-   * Export public classes
-   */
-
-  _.extend(window.SS, {
-    ContextFilterView: ContextFilterView
-  });
-
-})();
+});
index 04bfde2afb2c03084c13339d3ae469c0c8292966..26ecad588ac0b96c0b2809d64250b58f57b903a0 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false, baseUrl:false */
+define(['backbone', 'backbone.marionette', 'navigator/filters/base-filters', 'navigator/filters/select-filters'], function (Backbone, Marionette, BaseFilters, SelectFilters) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var DetailsFavoriteFilterView = window.SS.DetailsFilterView.extend({
+  var DetailsFavoriteFilterView = BaseFilters.DetailsFilterView.extend({
     template: '#detailsFavoriteFilterTemplate',
 
 
@@ -43,13 +39,13 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var FavoriteFilterView = window.SS.SelectFilterView.extend({
+  var FavoriteFilterView = SelectFilters.SelectFilterView.extend({
     template: '#favoriteFilterTemplate',
     className: 'navigator-filter navigator-filter-favorite',
 
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: DetailsFavoriteFilterView
       });
     },
@@ -75,9 +71,9 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
    * Export public classes
    */
 
-  _.extend(window.SS, {
+  return {
     DetailsFavoriteFilterView: DetailsFavoriteFilterView,
     FavoriteFilterView: FavoriteFilterView
-  });
+  };
 
-})();
+});
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/filter-bar.js b/sonar-server/src/main/webapp/javascripts/navigator/filters/filter-bar.js
new file mode 100644 (file)
index 0000000..5f77a4c
--- /dev/null
@@ -0,0 +1,102 @@
+define(
+    [
+      'backbone.marionette',
+      'navigator/filters/base-filters',
+      'navigator/filters/more-criteria-filters',
+      'navigator/filters/favorite-filters'
+    ],
+    function (Marionette, BaseFilters) {
+
+      return Marionette.CompositeView.extend({
+        template: '#filterBarTemplate',
+        itemViewContainer: '.navigator-filters-list',
+
+
+        collectionEvents: {
+          'change:enabled': 'changeEnabled'
+        },
+
+
+        getItemView: function (item) {
+          return item.get('type') || BaseFilters.BaseFilterView;
+        },
+
+
+        itemViewOptions: function () {
+          return {
+            filterBarView: this,
+            app: this.options.app
+          };
+        },
+
+
+        initialize: function () {
+          Marionette.CompositeView.prototype.initialize.apply(this, arguments);
+
+          var that = this;
+          $j('body').on('click', function () {
+            that.hideDetails();
+          });
+
+          var disabledFilters = this.collection.where({ enabled: false });
+          this.moreCriteriaFilter = new BaseFilters.Filter({
+            type: require('navigator/filters/more-criteria-filters').MoreCriteriaFilterView,
+            enabled: true,
+            optional: false,
+            filters: disabledFilters
+          });
+          this.collection.add(this.moreCriteriaFilter);
+        },
+
+
+        onAfterItemAdded: function (itemView) {
+          if (itemView.model.get('type') === require('navigator/filters/favorite-filters').FavoriteFilterView) {
+            this.$el.addClass('navigator-filter-list-favorite');
+          }
+        },
+
+
+        restoreFromQuery: function (q) {
+          this.collection.each(function (item) {
+            item.set('enabled', !item.get('optional'));
+            item.view.clear();
+            item.view.restoreFromQuery(q);
+          });
+        },
+
+
+        hideDetails: function () {
+          if (_.isObject(this.showedView)) {
+            this.showedView.hideDetails();
+          }
+        },
+
+
+        enableFilter: function (id) {
+          var filter = this.collection.get(id),
+              filterView = filter.view;
+
+          filterView.$el.detach().insertBefore(this.$('.navigator-filter-more-criteria'));
+          filter.set('enabled', true);
+          filterView.showDetails();
+        },
+
+
+        changeEnabled: function () {
+          var disabledFilters = this.collection
+              .where({ enabled: false })
+              .reject(function (filter) {
+                return filter.get('type') === require('navigator/filters/more-criteria-filters').MoreCriteriaFilterView;
+              });
+
+          if (disabledFilters.length === 0) {
+            this.moreCriteriaFilter.set({ enabled: false }, { silent: true });
+          } else {
+            this.moreCriteriaFilter.set({ enabled: true }, { silent: true });
+          }
+          this.moreCriteriaFilter.set('filters', disabledFilters);
+        }
+
+      });
+
+    });
index f5ad6859d7ef9b75a1cfb1a92c87c937e8d6c9d0..9941b8e4461ea904d949b95c37447dabf459bf7d 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false */
+define(['navigator/filters/base-filters'], function (BaseFilters) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var DetailsMetricFilterView = window.SS.DetailsFilterView.extend({
+  var DetailsMetricFilterView = BaseFilters.DetailsFilterView.extend({
     template: '#metricFilterTemplate',
 
 
@@ -58,10 +54,10 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var MetricFilterView = window.SS.BaseFilterView.extend({
+  return BaseFilters.BaseFilterView.extend({
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: DetailsMetricFilterView
       });
 
@@ -149,14 +145,4 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
   });
 
-
-
-  /*
-   * Export public classes
-   */
-
-  _.extend(window.SS, {
-    MetricFilterView: MetricFilterView
-  });
-
-})();
+});
index 81ce4fc69ab39bb555428e3754c6379610973b84..3dacc1c5a4cc269157d43bed31b732aa5b0cfaf6 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false */
+define(['navigator/filters/base-filters', 'navigator/filters/select-filters'], function (BaseFilters, SelectFilters) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var DetailsMoreCriteriaFilterView = window.SS.DetailsFilterView.extend({
+  var DetailsMoreCriteriaFilterView = BaseFilters.DetailsFilterView.extend({
     template: '#detailsMoreCriteriaFilterTemplate',
 
 
@@ -23,13 +19,13 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var MoreCriteriaFilterView = window.SS.SelectFilterView.extend({
+  var MoreCriteriaFilterView = SelectFilters.SelectFilterView.extend({
     template: '#moreCriteriaFilterTemplate',
     className: 'navigator-filter navigator-filter-more-criteria',
 
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: DetailsMoreCriteriaFilterView
       });
     },
@@ -55,8 +51,9 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
    * Export public classes
    */
 
-  _.extend(window.SS, {
+  return {
+    DetailsMoreCriteriaFilterView: DetailsMoreCriteriaFilterView,
     MoreCriteriaFilterView: MoreCriteriaFilterView
-  });
+  };
 
-})();
+});
index eb12495b4924f844f00e36d31aa1e9aebaf565d0..3443caf0c66f4b1903e8394b1357e5596591391f 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false */
+define(['navigator/filters/base-filters'], function (BaseFilters) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var DetailsRangeFilterView = window.SS.DetailsFilterView.extend({
+  var DetailsRangeFilterView = BaseFilters.DetailsFilterView.extend({
     template: '#rangeFilterTemplate',
 
 
@@ -50,10 +46,10 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var RangeFilterView = window.SS.BaseFilterView.extend({
+  var RangeFilterView = BaseFilters.BaseFilterView.extend({
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: DetailsRangeFilterView
       });
     },
@@ -191,9 +187,9 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
    * Export public classes
    */
 
-  _.extend(window.SS, {
+  return {
     RangeFilterView: RangeFilterView,
     DateRangeFilterView: DateRangeFilterView
-  });
+  };
 
-})();
+});
index 0c93d19aff493b6d49a5c0b9c89b4de21b073f39..7517356cc4efa79c29ea2a5a8e70325a6341c0fb 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false, Backbone:false, baseUrl:false */
+define(['navigator/filters/base-filters'], function (BaseFilters) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var DetailsSelectFilterView = window.SS.DetailsFilterView.extend({
+  var DetailsSelectFilterView = BaseFilters.DetailsFilterView.extend({
     template: '#selectFilterTemplate',
     itemTemplate: '#selectFilterItemTemplate',
 
@@ -18,7 +14,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
     render: function() {
-      window.SS.DetailsFilterView.prototype.render.apply(this, arguments);
+      BaseFilters.DetailsFilterView.prototype.render.apply(this, arguments);
       this.updateLists();
     },
 
@@ -179,12 +175,12 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var SelectFilterView = window.SS.BaseFilterView.extend({
+  var SelectFilterView = BaseFilters.BaseFilterView.extend({
     className: 'navigator-filter',
 
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: DetailsSelectFilterView
       });
 
@@ -254,7 +250,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
     disable: function() {
       this.choices.add(this.selection.models);
       this.selection.reset([]);
-      window.SS.BaseFilterView.prototype.disable.apply(this, arguments);
+      BaseFilters.BaseFilterView.prototype.disable.apply(this, arguments);
     },
 
 
@@ -325,9 +321,9 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
    * Export public classes
    */
 
-  _.extend(window.SS, {
+  return {
     DetailsSelectFilterView: DetailsSelectFilterView,
     SelectFilterView: SelectFilterView
-  });
+  };
 
-})();
+});
index cae0ec9f7fae94d03ea838179e317a15cfa7dc5f..56c73605e261f9c205a838284ce8342547ffbe12 100644 (file)
@@ -1,10 +1,6 @@
-/* global _:false, $j:false */
+define(['navigator/filters/base-filters'], function (BaseFilters) {
 
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var DetailsStringFilterView = window.SS.DetailsFilterView.extend({
+  var DetailsStringFilterView = BaseFilters.DetailsFilterView.extend({
     template: '#stringFilterTemplate',
 
 
@@ -19,7 +15,7 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
     onShow: function() {
-      window.SS.DetailsFilterView.prototype.onShow.apply(this, arguments);
+      BaseFilters.DetailsFilterView.prototype.onShow.apply(this, arguments);
       this.$(':input').focus();
     },
 
@@ -34,10 +30,10 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
 
 
-  var StringFilterView = window.SS.BaseFilterView.extend({
+  return BaseFilters.BaseFilterView.extend({
 
     initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
+      BaseFilters.BaseFilterView.prototype.initialize.call(this, {
         detailsView: DetailsStringFilterView
       });
     },
@@ -78,14 +74,4 @@ window.SS = typeof window.SS === 'object' ? window.SS : {};
 
   });
 
-
-
-  /*
-   * Export public classes
-   */
-
-  _.extend(window.SS, {
-    StringFilterView: StringFilterView
-  });
-
-})();
+});
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/handlebars-extensions.js b/sonar-server/src/main/webapp/javascripts/navigator/handlebars-extensions.js
deleted file mode 100644 (file)
index 0323469..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-(function() {
-
-  var defaultActions = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity'];
-
-  Handlebars.registerHelper('capitalize', function(string) {
-    return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
-  });
-
-  Handlebars.registerHelper('severityIcon', function(severity) {
-    return new Handlebars.SafeString(
-        '<i class="icon-severity-' + severity.toLowerCase() + '"></i>'
-    );
-  });
-
-  Handlebars.registerHelper('statusIcon', function(status) {
-    return new Handlebars.SafeString(
-        '<i class="icon-status-' + status.toLowerCase() + '"></i>'
-    );
-  });
-
-  Handlebars.registerHelper('resolutionIcon', function(resolution) {
-    return new Handlebars.SafeString(
-        '<i class="icon-resolution-' + resolution.toLowerCase() + '"></i>'
-    );
-  });
-
-  Handlebars.registerHelper('eq', function(v1, v2, options) {
-    return v1 == v2 ? options.fn(this) : options.inverse(this);
-  });
-
-  Handlebars.registerHelper('notEq', function(v1, v2, options) {
-    return v1 != v2 ? options.fn(this) : options.inverse(this);
-  });
-
-  Handlebars.registerHelper('all', function() {
-    var args = Array.prototype.slice.call(arguments, 0, -1),
-        options = arguments[arguments.length - 1],
-        all = args.reduce(function(prev, current) {
-          return prev && current;
-        }, true);
-    return all ? options.fn(this) : options.inverse(this);
-  });
-
-  Handlebars.registerHelper('any', function() {
-    var args = Array.prototype.slice.call(arguments, 0, -1),
-        options = arguments[arguments.length - 1],
-        all = args.reduce(function(prev, current) {
-          return prev || current;
-        }, true);
-    return all ? options.fn(this) : options.inverse(this);
-  });
-
-  Handlebars.registerHelper('inArray', function(array, element, options) {
-    if (array.indexOf(element) !== -1) {
-      return options.fn(this);
-    } else {
-      return options.inverse(this);
-    }
-  });
-
-  Handlebars.registerHelper('ifNotEmpty', function() {
-    var args = Array.prototype.slice.call(arguments, 0, -1),
-        options = arguments[arguments.length - 1],
-        notEmpty = args.reduce(function(prev, current) {
-          return prev || (current && current.length > 0);
-        }, false);
-    return notEmpty ? options.fn(this) : '';
-  });
-
-  Handlebars.registerHelper('dashboardUrl', function(componentKey, componentQualifier) {
-    var url = '/dashboard/index/' + decodeURIComponent(componentKey);
-    if (componentQualifier === 'FIL' || componentQualifier === 'CLA') {
-      url += '?metric=sqale_index';
-    }
-    return url;
-  });
-
-  Handlebars.registerHelper('translate', function(key, prefix) {
-    var args = Array.prototype.slice.call(arguments, 0, -1),
-        tokens = args.reduce(function(prev, current) {
-          return prev.concat(current.split('.'));
-        }, []),
-        start = window.SS.phrases;
-
-    return tokens.reduce(function(prev, current) {
-      return current ? prev[current] : prev;
-    }, start);
-  });
-
-  Handlebars.registerHelper('pluginActions', function(actions, options) {
-    var pluginActions = _.difference(actions, defaultActions);
-    return pluginActions.reduce(function(prev, current) {
-      return prev + options.fn(current);
-    }, '');
-  });
-
-  Handlebars.registerHelper('ifHasExtraTransitions', function(transitions, options) {
-    if (transitions && transitions.length > 1) {
-      return options.fn(this);
-    } else {
-      return '';
-    }
-  });
-
-  Handlebars.registerHelper('ifHasExtraActions', function(actions, options) {
-    var actionsLeft = _.difference(actions, _.without(defaultActions, 'set_severity'));
-    if (actionsLeft.length > 0) {
-      return options.fn(this);
-    } else {
-      return '';
-    }
-  });
-
-  Handlebars.registerHelper('withFirst', function(list, options) {
-    if (list && list.length > 0) {
-      return options.fn(list[0]);
-    } else {
-      return '';
-    }
-  });
-
-  Handlebars.registerHelper('withoutFirst', function(list, options) {
-    if (list && list.length > 1) {
-      return list.slice(1).reduce(function(prev, current) {
-        return prev + options.fn(current);
-      }, '');
-    } else {
-      return '';
-    }
-  });
-
-  Handlebars.registerHelper('sources', function(source, scm, options) {
-    var sources = _.map(source, function(code, line) {
-      return {
-        lineNumber: line,
-        code: code,
-        scm: (scm && scm[line]) ? { author: scm[line][0], date: scm[line][1] } : undefined
-      }
-    });
-
-    return sources.reduce(function(prev, current, index) {
-      return prev + options.fn(_.extend({ first: index === 0 }, current));
-    }, '');
-  });
-
-})();
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/issues-app-old.js b/sonar-server/src/main/webapp/javascripts/navigator/issues-app-old.js
deleted file mode 100644 (file)
index 3cd84e3..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* global _:false, Backbone:false */
-
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var NavigatorApp = new Backbone.Marionette.Application();
-  window.SS.IssuesNavigatorAppOld = NavigatorApp;
-
-
-
-  NavigatorApp.addRegions({
-    filtersRegion: '.navigator-filters'
-  });
-
-
-  NavigatorApp.addInitializer(function() {
-    this.filters = new window.SS.Filters();
-
-    if (_.isObject(window.SS.favorites)) {
-      this.filters.add([
-        new window.SS.Filter({
-          type: window.SS.FavoriteFilterView,
-          enabled: true,
-          optional: false,
-          choices: window.SS.favorites,
-          favoriteUrl: '/issues/filter',
-          manageUrl: '/issues/manage'
-        })]);
-    }
-
-    this.filters.add([
-      new window.SS.Filter({
-        name: window.SS.phrases.project,
-        property: 'componentRoots',
-        type: window.SS.ProjectFilterView,
-        enabled: true,
-        optional: false
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.severity,
-        property: 'severities[]',
-        type: window.SS.SelectFilterView,
-        enabled: true,
-        optional: false,
-        choices: {
-          'BLOCKER': window.SS.phrases.severities.blocker,
-          'CRITICAL': window.SS.phrases.severities.critical,
-          'MAJOR': window.SS.phrases.severities.major,
-          'MINOR': window.SS.phrases.severities.minor,
-          'INFO': window.SS.phrases.severities.info
-        },
-        choiceIcons: {
-          'BLOCKER': '/images/priority/BLOCKER.png',
-          'CRITICAL': '/images/priority/CRITICAL.png',
-          'MAJOR': '/images/priority/MAJOR.png',
-          'MINOR': '/images/priority/MINOR.png',
-          'INFO': '/images/priority/INFO.png'
-        }
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.status,
-        property: 'statuses[]',
-        type: window.SS.SelectFilterView,
-        enabled: true,
-        optional: false,
-        choices: {
-          'OPEN': window.SS.phrases.statuses.open,
-          'CONFIRMED': window.SS.phrases.statuses.confirmed,
-          'REOPENED': window.SS.phrases.statuses.reopened,
-          'RESOLVED': window.SS.phrases.statuses.resolved,
-          'CLOSED': window.SS.phrases.statuses.closed
-        }
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.assignee,
-        property: 'assignees',
-        type: window.SS.AssigneeFilterView,
-        enabled: true,
-        optional: false
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.resolution,
-        property: 'resolutions[]',
-        type: window.SS.SelectFilterView,
-        enabled: false,
-        optional: true,
-        choices: {
-          'FALSE-POSITIVE': window.SS.phrases.resolutions.falsePositive,
-          'FIXED': window.SS.phrases.resolutions.fixed,
-          'REMOVED': window.SS.phrases.resolutions.removed
-        }
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.reporter,
-        property: 'reporters',
-        type: window.SS.ReporterFilterView,
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.created,
-        propertyFrom: 'createdAfter',
-        propertyTo: 'createdBefore',
-        type: window.SS.DateRangeFilterView,
-        enabled: false,
-        optional: true
-      })
-    ]);
-
-
-    this.filterBarView = new window.SS.FilterBarView({
-      collection: this.filters,
-      extra: {
-        sort: '',
-        asc: false
-      }
-    });
-
-
-    this.filtersRegion.show(this.filterBarView);
-  });
-
-})();
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/issues-app.js b/sonar-server/src/main/webapp/javascripts/navigator/issues-app.js
deleted file mode 100644 (file)
index 97f6cca..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/* global _:false, Backbone:false */
-
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-jQuery(function() {
-
-  var NavigatorApp = new Backbone.Marionette.Application();
-  window.SS.IssuesNavigatorApp = NavigatorApp;
-
-
-  NavigatorApp.addRegions({
-    headerRegion: '.navigator-header',
-    filtersRegion: '.navigator-filters',
-    resultsRegion: '.navigator-results',
-    actionsRegion: '.navigator-actions',
-    detailsRegion: '.navigator-details'
-  });
-
-
-  NavigatorApp.addInitializer(function() {
-    jQuery('html').addClass('issues-page');
-
-    this.appState = new window.SS.AppState();
-    window.SS.appState = this.appState;
-
-    this.state = new Backbone.Model({
-      query: ''
-    });
-
-    this.issues = new window.SS.Issues();
-    this.issues.sorting = {
-      sort: 'UPDATE_DATE',
-      asc: false
-    };
-    this.issuesPage = 1;
-
-    this.filters = new window.SS.Filters();
-
-    this.favoriteFilter = new window.SS.FavoriteFilter();
-    this.issuesHeaderView = new window.SS.IssuesHeaderView({
-      app: this,
-      model: this.favoriteFilter
-    });
-    this.headerRegion.show(this.issuesHeaderView);
-
-    this.issuesView = new window.SS.IssuesView({
-      app: this,
-      collection: this.issues
-    });
-    this.resultsRegion.show(this.issuesView);
-
-    this.issuesActionsView = new window.SS.IssuesActionsView({
-      app: this,
-      collection: this.issues
-    });
-    this.actionsRegion.show(this.issuesActionsView);
-  });
-
-
-  NavigatorApp.addInitializer(function() {
-    this.filters.add([
-      new window.SS.Filter({
-        name: window.SS.phrases.project,
-        property: 'componentRoots',
-        type: window.SS.ProjectFilterView,
-        enabled: true,
-        optional: false
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.severity,
-        property: 'severities',
-        type: window.SS.SelectFilterView,
-        enabled: true,
-        optional: false,
-        choices: {
-          'BLOCKER': window.SS.phrases.severities.BLOCKER,
-          'CRITICAL': window.SS.phrases.severities.CRITICAL,
-          'MAJOR': window.SS.phrases.severities.MAJOR,
-          'MINOR': window.SS.phrases.severities.MINOR,
-          'INFO': window.SS.phrases.severities.INFO
-        },
-        choiceIcons: {
-          'BLOCKER': 'severity-blocker',
-          'CRITICAL': 'severity-critical',
-          'MAJOR': 'severity-major',
-          'MINOR': 'severity-minor',
-          'INFO': 'severity-info'
-        }
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.status,
-        property: 'statuses',
-        type: window.SS.SelectFilterView,
-        enabled: true,
-        optional: false,
-        choices: {
-          'OPEN': window.SS.phrases.statuses.OPEN,
-          'CONFIRMED': window.SS.phrases.statuses.CONFIRMED,
-          'REOPENED': window.SS.phrases.statuses.REOPENED,
-          'RESOLVED': window.SS.phrases.statuses.RESOLVED,
-          'CLOSED': window.SS.phrases.statuses.CLOSED
-        },
-        choiceIcons: {
-          'OPEN': 'status-open',
-          'CONFIRMED': 'status-confirmed',
-          'REOPENED': 'status-reopened',
-          'RESOLVED': 'status-resolved',
-          'CLOSED': 'status-closed'
-        }
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.assignee,
-        property: 'assignees',
-        type: window.SS.AssigneeFilterView,
-        enabled: true,
-        optional: false
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.resolution,
-        property: 'resolutions',
-        type: window.SS.SelectFilterView,
-        enabled: false,
-        optional: true,
-        choices: {
-          'FALSE-POSITIVE': window.SS.phrases.resolutions['FALSE-POSITIVE'],
-          'FIXED': window.SS.phrases.resolutions.FIXED,
-          'REMOVED': window.SS.phrases.resolutions.REMOVED
-        }
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.reporter,
-        property: 'reporters',
-        type: window.SS.ReporterFilterView,
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.created,
-        propertyFrom: 'createdAfter',
-        propertyTo: 'createdBefore',
-        type: window.SS.DateRangeFilterView,
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        property: 'resolved',
-        type: window.SS.ContextFilterView,
-        enabled: true,
-        optional: false
-      }),
-
-      new window.SS.Filter({
-        property: 'actionPlans',
-        type: window.SS.ContextFilterView,
-        enabled: true,
-        optional: false
-      }),
-
-      new window.SS.Filter({
-        property: 'createdAt',
-        type: window.SS.ContextFilterView,
-        enabled: true,
-        optional: false
-      })
-    ]);
-
-
-    this.filterBarView = new window.SS.IssuesFilterBarView({
-      app: this,
-      collection: this.filters,
-      extra: {
-        sort: '',
-        asc: false
-      }
-    });
-
-    this.filtersRegion.show(this.filterBarView);
-  });
-
-
-  NavigatorApp.addInitializer(function() {
-    var app = this;
-
-    jQuery.when(this.appState.fetch()).done(function() {
-
-      if (app.appState.get('favorites')) {
-        app.filters.unshift(
-          new window.SS.Filter({
-            type: window.SS.IssuesFavoriteFilterView,
-            enabled: true,
-            optional: false,
-            choices: app.appState.get('favorites'),
-            manageUrl: '/issues/manage'
-          })
-        );
-      }
-
-      app.router = new window.SS.IssuesRouter({
-        app: app
-      });
-      Backbone.history.start();
-
-      app.favoriteFilter.on('change:query', function(model, query) {
-        app.router.navigate(query, { trigger: true, replace: true });
-      });
-    });
-  });
-
-
-  NavigatorApp.addInitializer(function() {
-    var app = this;
-
-    window.onBulkIssues = function() {
-      app.fetchFirstPage();
-      jQuery('.ui-dialog, .ui-widget-overlay').remove();
-    };
-
-    window.onSaveAs = window.onCopy = window.onEdit = function(id) {
-      jQuery('#modal').dialog('close');
-      app.appState.fetch();
-
-      var filter = new window.SS.FavoriteFilter({ id: id });
-      filter.fetch({
-        success: function() {
-          app.state.set('search', false);
-          app.favoriteFilter.set(filter.toJSON());
-          app.fetchFirstPage();
-        }
-      });
-    };
-  });
-
-
-  NavigatorApp.getQuery = function(withoutId) {
-    var query = this.filterBarView.getQuery();
-    if (!withoutId && this.favoriteFilter.id) {
-      query['id'] = this.favoriteFilter.id;
-    }
-    return query;
-  };
-
-
-  NavigatorApp.storeQuery = function(query, sorting) {
-    if (sorting) {
-      _.extend(query, {
-        sort: sorting.sort,
-        asc: '' + sorting.asc
-      });
-    }
-
-    var queryString = _.map(query, function(v, k) {
-      return [k, encodeURIComponent(v)].join('=');
-    }).join('|');
-    this.router.navigate(queryString, { replace: true });
-  };
-
-
-  NavigatorApp.restoreSorting = function(query) {
-    var sort = _.findWhere(query, { key: 'sort' }),
-        asc = _.findWhere(query, { key: 'asc' });
-
-    if (sort && asc) {
-      this.issues.sorting = {
-        sort: sort.value,
-        sortText: jQuery('[data-sort=' + sort.value + ']:first').text(),
-        asc: asc.value === 'true'
-      }
-    }
-  };
-
-
-  NavigatorApp.fetchIssues = function(firstPage) {
-    var query = this.getQuery(),
-        fetchQuery =_.extend({
-          pageIndex: this.issuesPage
-        }, query);
-
-    if (this.issues.sorting) {
-      _.extend(fetchQuery, {
-        sort: this.issues.sorting.sort,
-        asc: this.issues.sorting.asc
-      });
-    }
-
-    _.extend(fetchQuery, {
-      hideRules: true
-    });
-
-    if (this.favoriteFilter.id) {
-      query['id'] = this.favoriteFilter.id;
-      fetchQuery['id'] = this.favoriteFilter.id;
-    }
-
-    this.storeQuery(query, this.issues.sorting);
-
-    var that = this;
-    this.issuesView.$el.addClass('navigator-fetching');
-    if (firstPage) {
-      this.issues.fetch({
-        data: fetchQuery,
-        success: function() {
-          that.issuesView.$el.removeClass('navigator-fetching');
-        }
-      });
-      this.detailsRegion.reset();
-    } else {
-      this.issues.fetch({
-        data: fetchQuery,
-        remove: false,
-        success: function() {
-          that.issuesView.$el.removeClass('navigator-fetching');
-        }
-      });
-    }
-  };
-
-
-  NavigatorApp.fetchFirstPage = function() {
-    this.issuesPage = 1;
-    this.fetchIssues(true);
-  };
-
-
-  NavigatorApp.fetchNextPage = function() {
-    if (this.issuesPage < this.issues.paging.pages) {
-      this.issuesPage++;
-      this.fetchIssues(false);
-    }
-  };
-
-});
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/issues.js b/sonar-server/src/main/webapp/javascripts/navigator/issues.js
deleted file mode 100644 (file)
index d4111c6..0000000
+++ /dev/null
@@ -1,1206 +0,0 @@
-/* global _:false, Backbone:false, baseUrl:false */
-
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-jQuery(function() {
-
-  var AppState = Backbone.Model.extend({
-
-    defaults: {
-      canManageFilter: false,
-      canBulkChange: false
-    },
-
-
-    url: function() {
-      return baseUrl + '/api/issue_filters/page';
-    }
-
-  });
-
-
-
-  var Issue = Backbone.Model.extend({
-
-    url: function() {
-      return baseUrl + '/api/issues/show?key=' + this.get('key');
-    },
-
-
-    parse: function(r) {
-      return r.issue ? r.issue : r;
-    }
-
-  });
-
-
-
-  var Issues = Backbone.Collection.extend({
-    model: Issue,
-
-
-    url: function() {
-      return baseUrl + '/api/issues/search';
-    },
-
-
-    parse: function(r) {
-
-      function find(source, key, keyField) {
-        var searchDict = {};
-        searchDict[keyField || 'key'] = key;
-        return _.findWhere(source, searchDict) || key;
-      }
-
-      this.paging = r.paging;
-      this.maxResultsReached = r.maxResultsReached;
-
-      return r.issues.map(function(issue) {
-        var component = find(r.components, issue.component),
-            project = find(r.projects, issue.project),
-            rule = find(r.rules, issue.rule);
-
-        if (component) {
-          _.extend(issue, {
-            componentLongName: component.longName,
-            componentQualifier: component.qualifier
-          });
-        }
-
-        if (project) {
-          _.extend(issue, {
-            projectLongName: project.longName
-          });
-        }
-
-        if (rule) {
-          _.extend(issue, {
-            ruleName: rule.name
-          });
-        }
-
-        return issue;
-      });
-
-    }
-  });
-
-
-
-  var FavoriteFilter = Backbone.Model.extend({
-
-    url: function() {
-      return baseUrl + '/api/issue_filters/show/' + this.get('id');
-    },
-
-
-    parse: function(r) {
-      return r.filter ? r.filter : r;
-    }
-  });
-
-
-
-  var FavoriteFilters = Backbone.Collection.extend({
-    model: FavoriteFilter,
-
-
-    url: function() {
-      return baseUrl + '/api/issue_filters/favorites';
-    },
-
-
-    parse: function(r) {
-      return r.favoriteFilters;
-    }
-  });
-
-
-  var Rule = Backbone.Model.extend({
-
-    url: function() {
-      return baseUrl + '/api/rules/show/?key=' + this.get('key');
-    },
-
-
-    parse: function(r) {
-      return r.rule ? r.rule : r;
-    }
-  });
-
-
-
-  var ActionPlans = Backbone.Collection.extend({
-
-    url: function() {
-      return baseUrl + '/api/action_plans/search';
-    },
-
-
-    parse: function(r) {
-      return r.actionPlans;
-    }
-
-  });
-
-
-
-  var IssueView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issue-template').html() || ''),
-    tagName: 'li',
-
-
-    ui: {
-      component: '.component'
-    },
-
-
-    events: {
-      'click': 'showDetails'
-    },
-
-
-    modelEvents: {
-      'change': 'render'
-    },
-
-
-    showDetails: function() {
-      this.$el.parent().children().removeClass('active');
-      this.$el.addClass('active');
-
-      var that = this,
-          app = this.options.app,
-          detailView = new window.SS.IssueDetailView({
-            model: this.model
-          }),
-          showCallback = function() {
-            jQuery('.navigator-details').removeClass('navigator-fetching');
-            app.detailsRegion.show(detailView);
-          };
-
-      jQuery('.navigator-details').empty().addClass('navigator-fetching');
-      jQuery.when(detailView.model.fetch()).done(function() {
-        if (that.model.get('status') !== 'CLOSED') {
-          that.fetchSource(detailView, showCallback);
-        } else {
-          showCallback();
-        }
-
-      });
-    },
-
-
-    fetchSource: function (view, callback) {
-      var line = this.model.get('line') || 0,
-          from = line >= 10 ? line - 10 : 0,
-          to = line + 30;
-
-      return jQuery
-          .ajax({
-            type: 'GET',
-            url: baseUrl + '/api/sources/show',
-            data: {
-              key: this.model.get('component'),
-              from: from,
-              to: to,
-              format: 'json'
-            }
-          })
-          .done(function (r) {
-            if (_.isObject(r) && r.source) {
-              view.source = r.source;
-            }
-            if (_.isObject(r) && r.scm) {
-              view.scm = r.scm;
-            }
-          })
-          .always(callback);
-    },
-
-
-    serializeData: function() {
-      var projectFilter = this.options.app.filters.findWhere({ property: 'componentRoots' }),
-          singleProject = _.isArray(projectFilter.get('value')) && projectFilter.get('value').length === 1;
-
-      return _.extend({
-        singleProject: singleProject
-      }, this.model.toJSON());
-    }
-  });
-
-
-
-  var NoIssuesView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#no-issues-template').html() || '')
-  });
-
-
-
-  var IssuesView = Backbone.Marionette.CollectionView.extend({
-    tagName: 'ol',
-    className: 'navigator-results-list',
-    itemView: IssueView,
-    emptyView: NoIssuesView,
-
-
-    itemViewOptions: function() {
-      return {
-        issuesView: this,
-        app: this.options.app
-      };
-    },
-
-
-    onRender: function() {
-      var $scrollEl = jQuery('.navigator-results'),
-          scrollEl = $scrollEl.get(0),
-          onScroll = function() {
-            if (scrollEl.offsetHeight + scrollEl.scrollTop >= scrollEl.scrollHeight) {
-              window.SS.IssuesNavigatorApp.fetchNextPage();
-            }
-          },
-          throttledScroll = _.throttle(onScroll, 300);
-      $scrollEl.off('scroll').on('scroll', throttledScroll);
-    },
-
-
-    onAfterItemAdded: function() {
-      var showLimitNotes = this.collection.maxResultsReached != null && this.collection.maxResultsReached;
-      jQuery('.navigator').toggleClass('navigator-with-notes', showLimitNotes);
-      jQuery('.navigator-notes').toggle(showLimitNotes);
-    },
-
-
-    close: function() {
-      var scrollEl = jQuery('.navigator-results');
-      scrollEl.off('scroll');
-      Backbone.Marionette.CollectionView.prototype.close.call(this);
-    }
-
-  });
-
-
-
-  var IssuesActionsView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issues-actions-template').html() || ''),
-
-
-    collectionEvents: {
-      'sync': 'render'
-    },
-
-
-    events: {
-      'click .navigator-actions-order': 'toggleOrderChoices',
-      'click .navigator-actions-order-choices': 'sort'
-    },
-
-
-    ui: {
-      orderChoices: '.navigator-actions-order-choices'
-    },
-
-
-    onRender: function() {
-      if (!this.collection.sorting.sortText) {
-        this.collection.sorting.sortText = this.$('[data-sort=' + this.collection.sorting.sort + ']:first').text();
-        this.render();
-        return;
-      }
-
-      this.$('.open-modal').modal();
-    },
-
-
-    toggleOrderChoices: function(e) {
-      e.stopPropagation();
-      this.ui.orderChoices.toggleClass('open');
-      if (this.ui.orderChoices.is('.open')) {
-        var that = this;
-        jQuery('body').on('click.issues_actions', function() {
-          that.ui.orderChoices.removeClass('open');
-        });
-      }
-    },
-
-
-    sort: function(e) {
-      e.stopPropagation();
-      this.ui.orderChoices.removeClass('open');
-      jQuery('body').off('click.issues_actions');
-      var el = jQuery(e.target),
-          sort = el.data('sort'),
-          asc = el.data('asc');
-
-      if (sort != null && asc != null) {
-        this.collection.sorting = {
-          sort: sort,
-          sortText: el.text(),
-          asc: asc
-        };
-        this.options.app.fetchFirstPage();
-      }
-    },
-
-
-    serializeData: function() {
-      var data = Backbone.Marionette.ItemView.prototype.serializeData.apply(this, arguments);
-      return _.extend(data || {}, {
-        paging: this.collection.paging,
-        sorting: this.collection.sorting,
-        maxResultsReached: this.collection.maxResultsReached,
-        appState: window.SS.appState.toJSON(),
-        query: (Backbone.history.fragment || '').replace(/\|/g, '&')
-      });
-    }
-  });
-
-
-
-  var IssuesFilterBarView = window.SS.FilterBarView.extend({
-
-    collectionEvents: {
-      'change:enabled': 'changeEnabled'
-    },
-
-
-    events: {
-      'click .navigator-filter-submit': 'search'
-    },
-
-
-    getQuery: function() {
-      var query = {};
-      this.collection.each(function(filter) {
-        _.extend(query, filter.view.formatValue());
-      });
-      return query;
-    },
-
-
-    onAfterItemAdded: function(itemView) {
-      if (itemView.model.get('type') === window.SS.FavoriteFilterView ||
-          itemView.model.get('type') === window.SS.IssuesFavoriteFilterView) {
-        jQuery('.navigator-header').addClass('navigator-header-favorite');
-      }
-    },
-
-
-    search: function() {
-      this.options.app.state.set({
-        query: this.options.app.getQuery(),
-        search: true
-      });
-      this.options.app.fetchFirstPage();
-    },
-
-
-    fetchNextPage: function() {
-      this.options.app.fetchNextPage();
-    }
-
-  });
-
-
-
-  var IssuesHeaderView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issues-header-template').html() || ''),
-
-
-    modelEvents: {
-      'change': 'render'
-    },
-
-
-    events: {
-      'click #issues-new-search': 'newSearch',
-      'click #issues-filter-save-as': 'saveAs',
-      'click #issues-filter-save': 'save',
-      'click #issues-filter-copy': 'copy',
-      'click #issues-filter-edit': 'edit'
-    },
-
-
-    initialize: function(options) {
-      Backbone.Marionette.ItemView.prototype.initialize.apply(this, arguments);
-      this.listenTo(options.app.state, 'change', this.render);
-    },
-
-
-    newSearch: function() {
-      this.model.clear();
-      this.options.app.router.navigate('statuses=OPEN,REOPENED', { trigger: true, replace: true });
-    },
-
-
-    saveAs: function() {
-      var url = baseUrl + '/issues/save_as_form?' + (Backbone.history.fragment || '').replace(/\|/g, '&');
-      openModalWindow(url, {});
-    },
-
-
-    save: function() {
-      var that = this;
-          url = baseUrl + '/issues/save/' + this.model.id + '?' + (Backbone.history.fragment || '').replace(/\|/g, '&');
-      jQuery.ajax({
-        type: 'POST',
-        url: url
-      }).done(function() {
-            that.options.app.state.set('search', false);
-          });
-    },
-
-
-    copy: function() {
-      var url = baseUrl + '/issues/copy_form/' + this.model.id;
-      openModalWindow(url, {});
-    },
-
-
-    edit: function() {
-      var url = baseUrl + '/issues/edit_form/' + this.model.id;
-      openModalWindow(url, {});
-    },
-
-
-    serializeData: function() {
-      return _.extend({
-        canSave: this.model.id && this.options.app.state.get('search'),
-        appState: window.SS.appState.toJSON()
-      }, this.model.toJSON());
-    }
-
-  });
-
-
-
-  var IssueDetailCommentFormView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issue-detail-comment-form-template').html() || ''),
-
-
-    ui: {
-      textarea: '#issue-comment-text',
-      cancelButton: '#issue-comment-cancel',
-      submitButton: '#issue-comment-submit'
-    },
-
-
-    events: {
-      'keyup #issue-comment-text': 'toggleSubmit',
-      'click #issue-comment-cancel': 'cancel',
-      'click #issue-comment-submit': 'submit'
-    },
-
-
-    onDomRefresh: function() {
-      this.ui.textarea.focus();
-    },
-
-
-    toggleSubmit: function() {
-      this.ui.submitButton.prop('disabled', this.ui.textarea.val().length === 0);
-    },
-
-
-    cancel: function() {
-      this.options.detailView.updateAfterAction(false);
-    },
-
-
-    submit: function() {
-      var that = this,
-          text = this.ui.textarea.val(),
-          update = this.model && this.model.has('key'),
-          url = baseUrl + '/api/issues/' + (update ? 'edit_comment' : 'add_comment'),
-          data = { text: text };
-
-      if (update) {
-        data.key = this.model.get('key');
-      } else {
-        data.issue = this.options.issue.get('key');
-      }
-
-      this.options.detailView.showActionSpinner();
-
-      jQuery.ajax({
-        type: 'POST',
-        url: url,
-        data: data
-      })
-          .done(function() {
-            that.options.detailView.updateAfterAction(true);
-          })
-          .fail(function(r) {
-            alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-            that.options.detailView.hideActionSpinner();
-          });
-    }
-  });
-
-
-
-  var IssueDetailSetSeverityFormView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issue-detail-set-severity-form-template').html() || ''),
-
-
-    ui: {
-      select: '#issue-set-severity-select'
-    },
-
-
-    events: {
-      'click #issue-set-severity-cancel': 'cancel',
-      'click #issue-set-severity-submit': 'submit'
-    },
-
-
-    onRender: function() {
-      this.ui.select.select2({
-        minimumResultsForSearch: 100
-      });
-    },
-
-
-    cancel: function() {
-      this.options.detailView.updateAfterAction(false);
-    },
-
-
-    submit: function() {
-      var that = this;
-
-      this.options.detailView.showActionSpinner();
-
-      jQuery.ajax({
-        type: 'POST',
-        url: baseUrl + '/api/issues/set_severity',
-        data: {
-          issue: this.options.issue.get('key'),
-          severity: this.ui.select.val()
-        }
-      })
-          .done(function() {
-            that.options.detailView.updateAfterAction(true);
-          })
-          .fail(function(r) {
-            alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-            that.options.detailView.hideActionSpinner();
-          });
-    }
-  });
-
-
-
-  var IssueDetailAssignFormView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issue-detail-assign-form-template').html() || ''),
-
-
-    ui: {
-      select: '#issue-assignee-select'
-    },
-
-
-    events: {
-      'click #issue-assign-cancel': 'cancel',
-      'click #issue-assign-submit': 'submit'
-    },
-
-
-    onRender: function() {
-      var currentUser = window.SS.currentUser,
-          assignee = this.options.issue.get('assignee'),
-          additionalChoices = [];
-
-      if (!assignee || currentUser !== assignee) {
-        additionalChoices.push({
-          id: currentUser,
-          text: window.SS.phrases.assignedToMe
-        });
-      }
-
-      if (!!assignee) {
-        additionalChoices.push({
-          id: '',
-          text: window.SS.phrases.unassigned
-        });
-      }
-
-      var select2Options = {
-        allowClear: false,
-        width: '250px',
-        formatNoMatches: function() { return window.SS.phrases.select2.noMatches; },
-        formatSearching: function() { return window.SS.phrases.select2.searching; },
-        formatInputTooShort: function() { return window.SS.phrases.select2.tooShort; }
-      };
-
-      if (additionalChoices.length > 0) {
-        select2Options.minimumInputLength = 0;
-        select2Options.query = function(query) {
-          if (query.term.length == 0) {
-            query.callback({ results: additionalChoices });
-          } else if (query.term.length >= 2) {
-            jQuery.ajax({
-              url: baseUrl + '/api/users/search?f=s2',
-              data: { s: query.term },
-              dataType: 'jsonp'
-            }).done(function(data) {
-                  query.callback(data);
-                });
-          }
-        }
-      } else {
-        select2Options.minimumInputLength = 2;
-        select2Options.ajax = {
-          quietMillis: 300,
-          url: baseUrl + '/api/users/search?f=s2',
-          data: function (term, page) {
-            return {s: term, p: page}
-          },
-          results: function (data) {
-            return { more: data.more, results: data.results }
-          }
-        };
-      }
-
-      this.ui.select.select2(select2Options).select2('open');
-    },
-
-
-    cancel: function() {
-      this.options.detailView.updateAfterAction(false);
-    },
-
-
-    submit: function() {
-      var that = this;
-
-      this.options.detailView.showActionSpinner();
-
-      jQuery.ajax({
-        type: 'POST',
-        url: baseUrl + '/api/issues/assign',
-        data: {
-          issue: this.options.issue.get('key'),
-          assignee: this.ui.select.val()
-        }
-      })
-          .done(function() {
-            that.options.detailView.updateAfterAction(true);
-          })
-          .fail(function(r) {
-            alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-            that.options.detailView.hideActionSpinner();
-          });
-    }
-  });
-
-
-
-  var IssueDetailPlanFormView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issue-detail-plan-form-template').html() || ''),
-
-
-    collectionEvents: {
-      'reset': 'render'
-    },
-
-
-    ui: {
-      select: '#issue-detail-plan-select'
-    },
-
-
-    events: {
-      'click #issue-plan-cancel': 'cancel',
-      'click #issue-plan-submit': 'submit'
-    },
-
-
-    onRender: function() {
-      this.ui.select.select2({
-        width: '250px',
-        minimumResultsForSearch: 100
-      });
-
-      this.$('.error a')
-          .prop('href', baseUrl + '/action_plans/index/' + this.options.issue.get('project'));
-    },
-
-
-    cancel: function() {
-      this.options.detailView.updateAfterAction(false);
-    },
-
-
-    submit: function() {
-      var that = this,
-          plan = this.ui.select.val();
-
-      this.options.detailView.showActionSpinner();
-
-      jQuery.ajax({
-        type: 'POST',
-        url: baseUrl + '/api/issues/plan',
-        data: {
-          issue: this.options.issue.get('key'),
-          plan: plan === '#unplan' ? '' : plan
-        }
-      })
-          .done(function() {
-            that.options.detailView.updateAfterAction(true);
-          })
-          .fail(function(r) {
-            alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-            that.options.detailView.hideActionSpinner();
-          });
-    },
-
-
-    serializeData: function() {
-      return {
-        items: this.collection.toJSON(),
-        issue: this.options.issue.toJSON()
-      }
-    }
-  });
-
-
-
-  var IssueDetailRuleView = Backbone.Marionette.ItemView.extend({
-    template: Handlebars.compile(jQuery('#issue-detail-rule-template').html() || ''),
-    className: 'rule-desc',
-    modelEvents: { 'change': 'render' },
-
-
-    serializeData: function() {
-      return _.extend({
-        characteristic: this.options.issue.get('characteristic'),
-        subCharacteristic: this.options.issue.get('subCharacteristic')
-      }, this.model.toJSON());
-    }
-  });
-
-
-
-  var IssueDetailView = Backbone.Marionette.Layout.extend({
-    template: Handlebars.compile(jQuery('#issue-detail-template').html() || ''),
-
-
-    regions: {
-      formRegion: '.code-issue-form',
-      ruleRegion: '#tab-issue-rule'
-    },
-
-
-    events: {
-      'click .code-issue-toggle': 'toggleCollapsed',
-
-      'click [href=#tab-issue-rule]': 'fetchRule',
-
-      'click #issue-comment': 'comment',
-      'click .issue-comment-edit': 'editComment',
-      'click .issue-comment-delete': 'deleteComment',
-      'click .issue-transition': 'transition',
-      'click #issue-set-severity': 'setSeverity',
-      'click #issue-assign': 'assign',
-      'click #issue-assign-to-me': 'assignToMe',
-      'click #issue-plan': 'plan',
-      'click .issue-action': 'action'
-    },
-
-
-    modelEvents: {
-      'change': 'render'
-    },
-
-
-    onRender: function() {
-      this.$('.code-issue-details').tabs();
-      this.$('.code-issue-form').hide();
-      this.rule = new Rule({ key: this.model.get('rule') });
-      this.ruleRegion.show(new IssueDetailRuleView({
-        model: this.rule,
-        issue: this.model
-      }));
-      this.initReferenceLinks();
-    },
-
-
-    initReferenceLinks: function() {
-      var sourcesId = 'sources_' + this.model.get('key');
-      this.$('#' + sourcesId).on('click', 'span.sym', { id: sourcesId }, highlight_usages);
-    },
-
-
-    onDomRefresh: function() {
-      var sourceTitleHeight = this.$('.source_title').outerHeight();
-      jQuery('.navigator-details').css('padding-top', (sourceTitleHeight + 10) + 'px');
-    },
-
-
-    onClose: function() {
-      if (this.ruleRegion) {
-        this.ruleRegion.reset();
-      }
-    },
-
-
-    resetIssue: function(options) {
-      var key = this.model.get('key');
-      this.model.clear({ silent: true });
-      this.model.set({ key: key }, { silent: true });
-      return this.model.fetch(options);
-    },
-
-
-    toggleCollapsed: function() {
-      this.$('.code-issue').toggleClass('code-issue-collapsed');
-      this.fetchRule();
-    },
-
-
-    fetchRule: function() {
-      var that = this;
-      if (!this.rule.has('name')) {
-        this.$('#tab-issue-rule').addClass('navigator-fetching');
-        this.rule.fetch({
-          success: function() {
-            that.$('#tab-issue-rule').removeClass('navigator-fetching');
-          }
-        });
-      }
-    },
-
-
-    showActionView: function(view) {
-      this.$('.code-issue-actions').hide();
-      this.$('.code-issue-form').show();
-      this.formRegion.show(view);
-    },
-
-
-    showActionSpinner: function() {
-      this.$('.code-issue-actions').addClass('navigator-fetching');
-    },
-
-
-    hideActionSpinner: function() {
-      this.$('.code-issue-actions').removeClass('navigator-fetching');
-    },
-
-
-    updateAfterAction: function(fetch) {
-      var that = this;
-
-      that.formRegion.reset();
-      that.$('.code-issue-actions').show();
-      that.$('.code-issue-form').hide();
-      that.$('[data-comment-key]').show();
-
-      if (fetch) {
-        jQuery.when(this.resetIssue()).done(function() {
-          that.hideActionSpinner();
-        });
-      }
-    },
-
-
-    comment: function() {
-      var commentFormView = new IssueDetailCommentFormView({
-        issue: this.model,
-        detailView: this
-      });
-      this.showActionView(commentFormView);
-    },
-
-
-    editComment: function(e) {
-      var commentEl = jQuery(e.target).closest('[data-comment-key]'),
-          commentKey = commentEl.data('comment-key'),
-          comment = _.findWhere(this.model.get('comments'), { key: commentKey });
-
-      commentEl.hide();
-
-      var commentFormView = new IssueDetailCommentFormView({
-        model: new Backbone.Model(comment),
-        issue: this.model,
-        detailView: this
-      });
-      this.showActionView(commentFormView);
-    },
-
-
-    deleteComment: function(e) {
-      var that = this,
-          commentKey = jQuery(e.target).closest('[data-comment-key]').data('comment-key'),
-          confirmMsg = jQuery(e.target).data('confirm-msg');
-
-      if (confirm(confirmMsg)) {
-        this.showActionSpinner();
-
-        jQuery.ajax({
-          type: "POST",
-          url: baseUrl + "/issue/delete_comment?id=" + commentKey
-        })
-            .done(function() {
-              that.updateAfterAction(true);
-            })
-            .fail(function(r) {
-              alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-              that.hideActionSpinner();
-            });
-      }
-    },
-
-
-    transition: function(e) {
-      var that = this;
-
-      this.showActionSpinner();
-
-      jQuery.ajax({
-        type: 'POST',
-        url: baseUrl + '/api/issues/do_transition',
-        data: {
-          issue: this.model.get('key'),
-          transition: jQuery(e.target).data('transition')
-        }
-      })
-          .done(function() {
-            that.resetIssue();
-          })
-          .fail(function(r) {
-            alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-            that.hideActionSpinner();
-          });
-    },
-
-
-    setSeverity: function() {
-      var setSeverityFormView = new IssueDetailSetSeverityFormView({
-        issue: this.model,
-        detailView: this
-      });
-      this.showActionView(setSeverityFormView);
-    },
-
-
-    assign: function() {
-      var assignFormView = new IssueDetailAssignFormView({
-        issue: this.model,
-        detailView: this
-      });
-      this.showActionView(assignFormView);
-    },
-
-
-    assignToMe: function() {
-      var that = this;
-
-      this.showActionSpinner();
-
-      jQuery.ajax({
-        type: 'POST',
-        url: baseUrl + '/api/issues/assign',
-        data: {
-          issue: this.model.get('key'),
-          assignee: window.SS.currentUser
-        }
-      })
-          .done(function() {
-            that.resetIssue();
-          })
-          .fail(function(r) {
-            alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-            that.hideActionSpinner();
-          });
-    },
-
-
-    plan: function() {
-      var that = this,
-          actionPlans = new ActionPlans(),
-          planFormView = new IssueDetailPlanFormView({
-            collection: actionPlans,
-            issue: this.model,
-            detailView: this
-          });
-
-      this.showActionSpinner();
-
-      actionPlans.fetch({
-        reset: true,
-        data: { project: this.model.get('project') },
-        success: function() {
-          that.hideActionSpinner();
-          that.showActionView(planFormView);
-        }
-      });
-    },
-
-    action: function(e) {
-      var that = this,
-          actionKey = jQuery(e.target).data('action');
-
-      this.showActionSpinner();
-
-      jQuery.ajax({
-        type: 'POST',
-        url: baseUrl + '/api/issues/do_action',
-        data: {
-          issue: this.model.get('key'),
-          actionKey: actionKey
-        }
-      })
-          .done(function() {
-            that.resetIssue();
-          })
-          .fail(function(r) {
-            alert(r.responseJSON.errors ? _.pluck(r.responseJSON.errors, 'msg').join(' ') : r);
-            that.hideActionSpinner();
-          });
-    },
-
-
-    serializeData: function() {
-      return _.extend({
-        source: this.source,
-        scm: this.scm
-      }, this.model.toJSON());
-    }
-
-  });
-
-
-
-  var IssuesDetailsFavoriteFilterView = window.SS.DetailsFavoriteFilterView.extend({
-    template: Handlebars.compile(jQuery('#issues-details-favorite-filter-template').html() || ''),
-
-
-    applyFavorite: function(e) {
-      var id = $j(e.target).data('id'),
-          filter = new window.SS.FavoriteFilter({ id: id }),
-          app = this.options.filterView.options.app;
-
-      filter.fetch({
-        success: function() {
-          app.state.set('search', false);
-          app.favoriteFilter.clear({ silent: true });
-          app.favoriteFilter.set(filter.toJSON());
-        }
-      });
-
-      this.options.filterView.hideDetails();
-    },
-
-
-    serializeData: function() {
-      return _.extend({}, this.model.toJSON(), {
-        items: this.model.get('choices')
-      });
-    }
-  });
-
-
-
-  var IssuesFavoriteFilterView = window.SS.FavoriteFilterView.extend({
-
-    initialize: function() {
-      window.SS.BaseFilterView.prototype.initialize.call(this, {
-        detailsView: IssuesDetailsFavoriteFilterView
-      });
-
-      this.listenTo(window.SS.appState, 'change:favorites', this.updateFavorites);
-    },
-
-
-    updateFavorites: function() {
-      this.model.set('choices', window.SS.appState.get('favorites'));
-      this.render();
-    }
-  });
-
-
-
-  var IssuesRouter = Backbone.Router.extend({
-
-    routes: {
-      '': 'emptyQuery',
-      ':query': 'index'
-    },
-
-
-    initialize: function(options) {
-      this.app = options.app;
-    },
-
-
-    parseQuery: function(query, separator) {
-      return (query || '').split(separator || '|').map(function(t) {
-        var tokens = t.split('=');
-        return {
-          key: tokens[0],
-          value: decodeURIComponent(tokens[1])
-        }
-      });
-    },
-
-
-    emptyQuery: function() {
-      this.navigate('statuses=OPEN,REOPENED', { trigger: true, replace: true });
-    },
-
-
-    index: function(query) {
-      var params = this.parseQuery(query);
-
-      var idObj = _.findWhere(params, { key: 'id' });
-      if (idObj) {
-        var that = this,
-            f = this.app.favoriteFilter;
-        this.app.canSave = false;
-        f.set('id', idObj.value);
-        f.fetch({
-          success: function() {
-            params = _.extend({}, that.parseQuery(f.get('query')), params);
-            that.loadResults(params);
-          }
-        });
-      } else {
-        this.loadResults(params);
-      }
-    },
-
-
-    loadResults: function(params) {
-      this.app.filterBarView.restoreFromQuery(params);
-      this.app.restoreSorting(params);
-      this.app.fetchFirstPage();
-    }
-
-  });
-
-
-
-  /*
-   * Export public classes
-   */
-
-  _.extend(window.SS, {
-    AppState: AppState,
-    Issue: Issue,
-    Issues: Issues,
-    FavoriteFilter: FavoriteFilter,
-    FavoriteFilters: FavoriteFilters,
-    IssueView: IssueView,
-    IssuesView: IssuesView,
-    IssuesActionsView: IssuesActionsView,
-    IssuesFilterBarView: IssuesFilterBarView,
-    IssuesHeaderView: IssuesHeaderView,
-    IssuesFavoriteFilterView: IssuesFavoriteFilterView,
-    IssueDetailView: IssueDetailView,
-    IssuesRouter: IssuesRouter
-  });
-
-});
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/measures-app.js b/sonar-server/src/main/webapp/javascripts/navigator/measures-app.js
deleted file mode 100644 (file)
index 7291980..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/* global _:false, Backbone:false */
-
-window.SS = typeof window.SS === 'object' ? window.SS : {};
-
-(function() {
-
-  var NavigatorApp = new Backbone.Marionette.Application();
-  window.SS.MeasuresNavigatorApp = NavigatorApp;
-
-
-
-  NavigatorApp.addRegions({
-    filtersRegion: '.navigator-filters'
-  });
-
-
-  NavigatorApp.addInitializer(function() {
-    this.filters = new window.SS.Filters();
-
-    if (_.isObject(window.SS.favorites)) {
-      this.filters.add([
-        new window.SS.Filter({
-          type: window.SS.FavoriteFilterView,
-          enabled: true,
-          optional: false,
-          choices: window.SS.favorites,
-          favoriteUrl: '/measures/filter',
-          manageUrl: '/measures/manage'
-        })]);
-    }
-
-    this.filters.add([
-      new window.SS.Filter({
-        name: window.SS.phrases.components,
-        property: 'qualifiers[]',
-        type: window.SS.SelectFilterView,
-        enabled: true,
-        optional: false,
-        choices: window.SS.qualifiers,
-        defaultValue: window.SS.phrases.any
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.alert,
-        property: 'alertLevels[]',
-        type: window.SS.SelectFilterView,
-        enabled: false,
-        optional: true,
-        choices: {
-          'error': window.SS.phrases.error,
-          'warn': window.SS.phrases.warning,
-          'ok': window.SS.phrases.ok
-        }
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.componentsOf,
-        property: 'base',
-        type: window.SS.ComponentFilterView,
-        multiple: false,
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.favoritesOnly,
-        property: 'onFavourites',
-        type: window.SS.CheckboxFilterView,
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.date,
-        propertyFrom: 'fromDate',
-        propertyTo: 'toDate',
-        type: window.SS.DateRangeFilterView,
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.keyContains,
-        property: 'keySearch',
-        type: window.SS.StringFilterView,
-        enabled: false,
-        optional: true
-      })
-    ]);
-
-    if (_.isObject(window.SS.languages) && _.size(window.SS.languages) > 1) {
-      this.filters.add([
-        new window.SS.Filter({
-          name: window.SS.phrases.language,
-          property: 'languages[]',
-          type: window.SS.SelectFilterView,
-          enabled: false,
-          optional: true,
-          choices: window.SS.languages
-        })
-      ]);
-    }
-
-    this.filters.add([
-      new window.SS.Filter({
-        name: window.SS.phrases.lastAnalysis,
-        propertyFrom: 'ageMinDays',
-        propertyTo: 'ageMaxDays',
-        type: window.SS.RangeFilterView,
-        placeholder: window.SS.phrases.days,
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.metric,
-        property: 'c3',
-        type: window.SS.MetricFilterView,
-        metrics: window.SS.metrics,
-        periods: window.SS.metricPeriods,
-        operations: { 'eq': '=', 'lt': '<', 'lte': '≤', 'gt': '>', 'gte': '≥' },
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.metric,
-        property: 'c2',
-        type: window.SS.MetricFilterView,
-        metrics: window.SS.metrics,
-        periods: window.SS.metricPeriods,
-        operations: { 'eq': '=', 'lt': '<', 'lte': '≤', 'gt': '>', 'gte': '≥' },
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.metric,
-        property: 'c1',
-        type: window.SS.MetricFilterView,
-        metrics: window.SS.metrics,
-        periods: window.SS.metricPeriods,
-        operations: { 'eq': '=', 'lt': '<', 'lte': '≤', 'gt': '>', 'gte': '≥' },
-        enabled: false,
-        optional: true
-      }),
-
-      new window.SS.Filter({
-        name: window.SS.phrases.nameContains,
-        property: 'nameSearch',
-        type: window.SS.StringFilterView,
-        enabled: false,
-        optional: true
-      })
-    ]);
-
-
-    this.filterBarView = new window.SS.FilterBarView({
-      collection: this.filters,
-      extra: {
-        sort: '',
-        asc: false
-      }
-    });
-
-
-    this.filtersRegion.show(this.filterBarView);
-  });
-
-})();
index 05ae748a4382b3f0a94d7d3f259412a251e96d46..0a3bfef0507eedb22ac424697e58e0a11b770a70 100644 (file)
-/* global Backbone:false, jQuery:false */
-/* jshint eqnull:true */
+requirejs.config({
 
-(function ($) {
+  paths: {
+    'backbone': 'third-party/backbone'
+  },
 
-  var showError = null;
-
-  /*
-   * SelectList Collection
-   */
-
-  var SelectListCollection = Backbone.Collection.extend({
-
-    parse: function(r) {
-      this.more = r.more;
-      return r.results;
-    },
+  shim: {
+    'backbone': {
+      exports: 'Backbone'
+    }
+  }
 
-    fetch: function(options) {
-      var data = $.extend({
-            page: 1,
-            pageSize: 100
-          }, options.data || {}),
-          settings = $.extend({}, options, { data: data });
+});
 
-      this.settings = {
-        url: settings.url,
-        data: data
-      };
+requirejs(['backbone'], function (Backbone) {
 
-      Backbone.Collection.prototype.fetch.call(this, settings);
-    },
+  (function ($) {
 
-    fetchNextPage: function(options) {
-      if (this.more) {
-        var nextPage = this.settings.data.page + 1,
-            settings = $.extend(this.settings, options);
+    var showError = null;
 
-        settings.data.page = nextPage;
+    /*
+     * SelectList Collection
+     */
 
-        this.fetch(settings);
-      }
-    }
+    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
+        };
 
-  /*
-   * SelectList Item View
-   */
+        Backbone.Collection.prototype.fetch.call(this, settings);
+      },
 
-  var SelectListItemView = Backbone.View.extend({
-    tagName: 'li',
+      fetchNextPage: function (options) {
+        if (this.more) {
+          var nextPage = this.settings.data.page + 1,
+              settings = $.extend(this.settings, options);
 
-    template: function(d) {
-      return  '<input class="select-list-list-checkbox" type="checkbox">' +
-          '<div class="select-list-list-item">' + d + '</div>';
-    },
+          settings.data.page = nextPage;
 
-    events: {
-      'change .select-list-list-checkbox': 'toggle'
-    },
+          this.fetch(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'));
-    },
 
-    remove: function(postpone) {
-      if (postpone) {
-        var that = this;
+    /*
+     * SelectList Item View
+     */
+
+    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>';
+      },
+
+      events: {
+        'change .select-list-list-checkbox': 'toggle'
+      },
+
+      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'));
+      },
+
+      remove: function (postpone) {
+        if (postpone) {
+          var that = this;
           that.$el.addClass(this.model.get('selected') ? 'added' : 'removed');
-          setTimeout(function() {
+          setTimeout(function () {
             Backbone.View.prototype.remove.call(that, arguments);
           }, 500);
-      } else {
-        Backbone.View.prototype.remove.call(this, arguments);
-      }
-    },
+        } 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 || {});
+      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);
+        data[this.settings.selectParameter] = this.model.get(this.settings.selectParameterValue);
 
-      that.$el.addClass('progress');
-      $.ajax({
+        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');
-          });
-    }
-  });
-
+        })
+            .done(function () {
+              that.model.set('selected', !selected);
+            })
+            .fail(showError)
+            .always(function () {
+              that.$el.removeClass('progress');
+            });
+      }
+    });
 
 
-  /*
-   * SelectList View
-   */
+    /*
+     * SelectList View
+     */
 
-  var SelectListView = Backbone.View.extend({
-    template: function(l) {
-      return '<div class="select-list-container">' +
-          '<div class="select-list-control">' +
+    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>' +
+            '<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>' +
+            '<input type="text" placeholder="Search">' +
+            '<a class="select-list-search-control-clear">&times;</a>' +
             '</div>' +
-          '</div>' +
-          '<div class="select-list-list-container">' +
+            '</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;
-    },
-
-    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')
-          .height(this.settings.height)
-          .css('overflow', 'auto')
-          .on('scroll', function() { that.scroll(); });
-
-      this.$list = this.$('.select-list-list');
-
-      var searchInput = this.$('.select-list-search-control input')
-          .on('keyup', $.debounce(250, keyup));
-
-      setTimeout(function() {
-        searchInput.focus();
-      }, 250);
-
-      this.listItemViews = [];
-
-      showError = function() {
-        $('<div>')
-            .addClass('error').text(that.settings.errorMessage)
-            .insertBefore(that.$el);
-      };
-    },
-
-    renderList: function() {
-      this.listItemViews.forEach(function(view) { view.remove(); });
-      this.listItemViews = [];
-      this.collection.each(this.renderListItem, this);
-      this.$listContainer.scrollTop(0);
-    },
-
-    renderListItem: function(item) {
-      var itemView = new SelectListItemView({
-        model: item,
-        settings: this.settings
-      });
-      this.listItemViews.push(itemView);
-      this.$list.append(itemView.el);
-      itemView.render();
-    },
-
-    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
+            '</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;
+      },
+
+      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')
+            .height(this.settings.height)
+            .css('overflow', 'auto')
+            .on('scroll', function () {
+              that.scroll();
+            });
+
+        this.$list = this.$('.select-list-list');
+
+        var searchInput = this.$('.select-list-search-control input')
+            .on('keyup', $.debounce(250, keyup));
+
+        setTimeout(function () {
+          searchInput.focus();
+        }, 250);
+
+        this.listItemViews = [];
+
+        showError = function () {
+          $('<div>')
+              .addClass('error').text(that.settings.errorMessage)
+              .insertBefore(that.$el);
+        };
+      },
+
+      renderList: function () {
+        this.listItemViews.forEach(function (view) {
+          view.remove();
         });
-      }
-    },
-
-    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 = [];
+        this.collection.each(this.renderListItem, this);
+        this.$listContainer.scrollTop(0);
+      },
+
+      renderListItem: function (item) {
+        var itemView = new SelectListItemView({
+          model: item,
+          settings: this.settings
         });
-      } else {
-        this.filterBySelection();
-      }
-    },
+        this.listItemViews.push(itemView);
+        this.$list.append(itemView.el);
+        itemView.render();
+      },
+
+      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();
+        }
+      },
 
-    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();
+      },
 
-    showFetchSpinner: function() {
-      this.$listContainer.addClass('loading');
-    },
+      showFetchSpinner: function () {
+        this.$listContainer.addClass('loading');
+      },
 
-    hideFetchSpinner: function() {
-      this.$listContainer.removeClass('loading');
-    },
+      hideFetchSpinner: function () {
+        this.$listContainer.removeClass('loading');
+      },
 
-    scroll: function() {
-      var scrollBottom = this.$listContainer.scrollTop() >=
-          this.$list[0].scrollHeight - this.$listContainer.outerHeight(),
-          that = this;
+      scroll: function () {
+        var scrollBottom = this.$listContainer.scrollTop() >=
+                this.$list[0].scrollHeight - this.$listContainer.outerHeight(),
+            that = this;
 
-      if (scrollBottom && this.collection.more) {
-        $.throttle(250, function() {
+        if (scrollBottom && this.collection.more) {
+          $.throttle(250, function () {
             that.showFetchSpinner();
 
             that.collection.fetchNextPage({
-              success: function() { that.hideFetchSpinner(); }
+              success: function () {
+                that.hideFetchSpinner();
+              }
             });
-        })();
+          })();
+        }
       }
-    }
-
-  });
-
 
+    });
 
-  /*
-   * SelectList Entry Point
-   */
 
-  window.SelectList = function(options) {
-    this.settings = $.extend(window.SelectList.defaults, options);
+    /*
+     * SelectList Entry Point
+     */
 
-    this.collection = new SelectListCollection();
+    window.SelectList = function (options) {
+      this.settings = $.extend(window.SelectList.defaults, options);
 
-    this.view = new SelectListView({
-      el: this.settings.el,
-      collection: this.collection,
-      settings: this.settings
-    });
+      this.collection = new SelectListCollection();
 
-    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
-   */
+    /*
+     * SelectList API Methods
+     */
 
-  window.SelectList.prototype.filter = function(filter) {
-    this.view.filterBySelection(filter);
-    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;
-  };
+    window.SelectList.prototype.search = function (query) {
+      this.view.searchByQuery(query);
+      return this;
+    };
 
 
+    /*
+     * SelectList Defaults
+     */
 
-  /*
-   * SelectList Defaults
-   */
+    window.SelectList.defaults = {
+      width: '50%',
+      height: 400,
 
-  window.SelectList.defaults = {
-    width: '50%',
-    height: 400,
+      format: function (item) {
+        return item.value;
+      },
 
-    format: function (item) { return item.value; },
+      labels: {
+        selected: 'Selected',
+        deselected: 'Deselected',
+        all: 'All'
+      },
 
-    labels: {
-      selected: 'Selected',
-      deselected: 'Deselected',
-      all: 'All'
-    },
+      tooltips: {
+        select: 'Click this to select item',
+        deselect: 'Click this to deselect item'
+      },
 
-    tooltips: {
-      select: 'Click this to select item',
-      deselect: 'Click this to deselect item'
-    },
+      errorMessage: 'Something gone wrong, try to reload the page and try again.'
+    };
 
-    errorMessage: 'Something gone wrong, try to reload the page and try again.'
-  };
+  })(jQuery);
 
-})(jQuery);
+});
diff --git a/sonar-server/src/main/webapp/javascripts/third-party/backbone-min.js b/sonar-server/src/main/webapp/javascripts/third-party/backbone-min.js
deleted file mode 100644 (file)
index c1ceabc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.1.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o<u;o++){t=a[o];if(n=this._events[t]){this._events[t]=r=[];if(e||i){for(c=0,f=n.length;c<f;c++){s=n[c];if(e&&e!==s.callback&&e!==s.callback._callback||i&&i!==s.context){r.push(s)}}}if(!r.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!l(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)c(i,e);if(r)c(r,arguments);return this},stopListening:function(t,e,i){var r=this._listeningTo;if(!r)return this;var s=!e&&!i;if(!i&&typeof e==="object")i=this;if(t)(r={})[t._listenId]=t;for(var n in r){t=r[n];t.off(e,i,this);if(s||h.isEmpty(t._events))delete this._listeningTo[n]}return this}};var u=/\s+/;var l=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(u.test(i)){var n=i.split(u);for(var a=0,h=n.length;a<h;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var c=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],h=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,h);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e)}};var f={listenTo:"on",listenToOnce:"once"};h.each(f,function(t,e){o[e]=function(e,i,r){var s=this._listeningTo||(this._listeningTo={});var n=e._listenId||(e._listenId=h.uniqueId("l"));s[n]=e;if(!r&&typeof i==="object")r=this;e[t](i,r,this);return this}});o.bind=o.on;o.unbind=o.off;h.extend(a,o);var d=a.Model=function(t,e){var i=t||{};e||(e={});this.cid=h.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)i=this.parse(i,e)||{};i=h.defaults({},i,h.result(this,"defaults"));this.set(i,e);this.changed={};this.initialize.apply(this,arguments)};h.extend(d.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return h.clone(this.attributes)},sync:function(){return a.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return h.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,i){var r,s,n,a,o,u,l,c;if(t==null)return this;if(typeof t==="object"){s=t;i=e}else{(s={})[t]=e}i||(i={});if(!this._validate(s,i))return false;n=i.unset;o=i.silent;a=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=h.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in s)this.id=s[this.idAttribute];for(r in s){e=s[r];if(!h.isEqual(c[r],e))a.push(r);if(!h.isEqual(l[r],e)){this.changed[r]=e}else{delete this.changed[r]}n?delete c[r]:c[r]=e}if(!o){if(a.length)this._pending=true;for(var f=0,d=a.length;f<d;f++){this.trigger("change:"+a[f],this,c[a[f]],i)}}if(u)return this;if(!o){while(this._pending){this._pending=false;this.trigger("change",this,i)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,h.extend({},e,{unset:true}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,h.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!h.isEmpty(this.changed);return h.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?h.clone(this.changed):false;var e,i=false;var r=this._changing?this._previousAttributes:this.attributes;for(var s in t){if(h.isEqual(r[s],e=t[s]))continue;(i||(i={}))[s]=e}return i},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return h.clone(this._previousAttributes)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var i=t.success;t.success=function(r){if(!e.set(e.parse(r,t),t))return false;if(i)i(e,r,t);e.trigger("sync",e,r,t)};M(this,t);return this.sync("read",this,t)},save:function(t,e,i){var r,s,n,a=this.attributes;if(t==null||typeof t==="object"){r=t;i=e}else{(r={})[t]=e}i=h.extend({validate:true},i);if(r&&!i.wait){if(!this.set(r,i))return false}else{if(!this._validate(r,i))return false}if(r&&i.wait){this.attributes=h.extend({},a,r)}if(i.parse===void 0)i.parse=true;var o=this;var u=i.success;i.success=function(t){o.attributes=a;var e=o.parse(t,i);if(i.wait)e=h.extend(r||{},e);if(h.isObject(e)&&!o.set(e,i)){return false}if(u)u(o,t,i);o.trigger("sync",o,t,i)};M(this,i);s=this.isNew()?"create":i.patch?"patch":"update";if(s==="patch")i.attrs=r;n=this.sync(s,this,i);if(r&&i.wait)this.attributes=a;return n},destroy:function(t){t=t?h.clone(t):{};var e=this;var i=t.success;var r=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(s){if(t.wait||e.isNew())r();if(i)i(e,s,t);if(!e.isNew())e.trigger("sync",e,s,t)};if(this.isNew()){t.success();return false}M(this,t);var s=this.sync("delete",this,t);if(!t.wait)r();return s},url:function(){var t=h.result(this,"urlRoot")||h.result(this.collection,"url")||U();if(this.isNew())return t;return t+(t.charAt(t.length-1)==="/"?"":"/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},isValid:function(t){return this._validate({},h.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=h.extend({},this.attributes,t);var i=this.validationError=this.validate(t,e)||null;if(!i)return true;this.trigger("invalid",this,i,h.extend(e,{validationError:i}));return false}});var p=["keys","values","pairs","invert","pick","omit"];h.each(p,function(t){d.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.attributes);return h[t].apply(h,e)}});var v=a.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,h.extend({silent:true},e))};var g={add:true,remove:true,merge:true};var m={add:true,remove:false};h.extend(v.prototype,o,{model:d,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return a.sync.apply(this,arguments)},add:function(t,e){return this.set(t,h.extend({merge:false},e,m))},remove:function(t,e){var i=!h.isArray(t);t=i?[t]:h.clone(t);e||(e={});var r,s,n,a;for(r=0,s=t.length;r<s;r++){a=t[r]=this.get(t[r]);if(!a)continue;delete this._byId[a.id];delete this._byId[a.cid];n=this.indexOf(a);this.models.splice(n,1);this.length--;if(!e.silent){e.index=n;a.trigger("remove",a,this,e)}this._removeReference(a)}return i?t[0]:t},set:function(t,e){e=h.defaults({},e,g);if(e.parse)t=this.parse(t,e);var i=!h.isArray(t);t=i?t?[t]:[]:h.clone(t);var r,s,n,a,o,u,l;var c=e.at;var f=this.model;var p=this.comparator&&c==null&&e.sort!==false;var v=h.isString(this.comparator)?this.comparator:null;var m=[],y=[],_={};var w=e.add,b=e.merge,x=e.remove;var E=!p&&w&&x?[]:false;for(r=0,s=t.length;r<s;r++){o=t[r];if(o instanceof d){n=a=o}else{n=o[f.prototype.idAttribute]}if(u=this.get(n)){if(x)_[u.cid]=true;if(b){o=o===a?a.attributes:o;if(e.parse)o=u.parse(o,e);u.set(o,e);if(p&&!l&&u.hasChanged(v))l=true}t[r]=u}else if(w){a=t[r]=this._prepareModel(o,e);if(!a)continue;m.push(a);a.on("all",this._onModelEvent,this);this._byId[a.cid]=a;if(a.id!=null)this._byId[a.id]=a}if(E)E.push(u||a)}if(x){for(r=0,s=this.length;r<s;++r){if(!_[(a=this.models[r]).cid])y.push(a)}if(y.length)this.remove(y,e)}if(m.length||E&&E.length){if(p)l=true;this.length+=m.length;if(c!=null){for(r=0,s=m.length;r<s;r++){this.models.splice(c+r,0,m[r])}}else{if(E)this.models.length=0;var T=E||m;for(r=0,s=T.length;r<s;r++){this.models.push(T[r])}}}if(l)this.sort({silent:true});if(!e.silent){for(r=0,s=m.length;r<s;r++){(a=m[r]).trigger("add",a,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}return i?t[0]:t},reset:function(t,e){e||(e={});for(var i=0,r=this.models.length;i<r;i++){this._removeReference(this.models[i])}e.previousModels=this.models;this._reset();t=this.add(t,h.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,h.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,h.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return s.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t.id]||this._byId[t.cid]||this._byId[t]},at:function(t){return this.models[t]},where:function(t,e){if(h.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(h.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(h.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return h.invoke(this.models,"get",t)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var i=this;t.success=function(r){var s=t.reset?"reset":"set";i[s](r,t);if(e)e(i,r,t);i.trigger("sync",i,r,t)};M(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?h.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var i=this;var r=e.success;e.success=function(t,e,s){if(s.wait)i.add(t,s);if(r)r(t,e,s)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof d){if(!t.collection)t.collection=this;return t}e=e?h.clone(e):{};e.collection=this;var i=new this.model(t,e);if(!i.validationError)return i;this.trigger("invalid",this,i.validationError,e);return false},_removeReference:function(t){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var y=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain"];h.each(y,function(t){v.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.models);return h[t].apply(h,e)}});var _=["groupBy","countBy","sortBy"];h.each(_,function(t){v.prototype[t]=function(e,i){var r=h.isFunction(e)?e:function(t){return t.get(e)};return h[t](this.models,r,i)}});var w=a.View=function(t){this.cid=h.uniqueId("view");t||(t={});h.extend(this,h.pick(t,x));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var b=/^(\S+)\s*(.*)$/;var x=["model","collection","el","id","attributes","className","tagName","events"];h.extend(w.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,e){if(this.$el)this.undelegateEvents();this.$el=t instanceof a.$?t:a.$(t);this.el=this.$el[0];if(e!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=h.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var i=t[e];if(!h.isFunction(i))i=this[t[e]];if(!i)continue;var r=e.match(b);var s=r[1],n=r[2];i=h.bind(i,this);s+=".delegateEvents"+this.cid;if(n===""){this.$el.on(s,i)}else{this.$el.on(s,n,i)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=h.extend({},h.result(this,"attributes"));if(this.id)t.id=h.result(this,"id");if(this.className)t["class"]=h.result(this,"className");var e=a.$("<"+h.result(this,"tagName")+">").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=T[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)return n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&E){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var E=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var k=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var $=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(k.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history.trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace(S,"(?:$1)?").replace($,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/[?#].*$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=P.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(O,"/");if(r&&this._wantsHashChange){this.iframe=a.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;this.navigate(e)}if(this._hasPushState){a.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!r){a.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=e;var s=this.location;var n=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!n){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._hasPushState&&n&&s.hash){this.fragment=this.getHash().replace(N,"");this.history.replaceState({},document.title,this.root+this.fragment+s.search)}}if(!this.options.silent)return this.loadUrl()},stop:function(){a.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);I.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return h.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!I.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});a.history=new I;var R=function(t,e){var i=this;var r;if(t&&h.has(t,"constructor")){r=t.constructor}else{r=function(){return i.apply(this,arguments)}}h.extend(r,i,e);var s=function(){this.constructor=r};s.prototype=i.prototype;r.prototype=new s;if(t)h.extend(r.prototype,t);r.__super__=i.prototype;return r};d.extend=v.extend=k.extend=w.extend=I.extend=R;var U=function(){throw new Error('A "url" property or function must be specified')};var M=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}}}).call(this);
diff --git a/sonar-server/src/main/webapp/javascripts/third-party/backbone.js b/sonar-server/src/main/webapp/javascripts/third-party/backbone.js
new file mode 100644 (file)
index 0000000..c1ceabc
--- /dev/null
@@ -0,0 +1 @@
+(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.1.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o<u;o++){t=a[o];if(n=this._events[t]){this._events[t]=r=[];if(e||i){for(c=0,f=n.length;c<f;c++){s=n[c];if(e&&e!==s.callback&&e!==s.callback._callback||i&&i!==s.context){r.push(s)}}}if(!r.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!l(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)c(i,e);if(r)c(r,arguments);return this},stopListening:function(t,e,i){var r=this._listeningTo;if(!r)return this;var s=!e&&!i;if(!i&&typeof e==="object")i=this;if(t)(r={})[t._listenId]=t;for(var n in r){t=r[n];t.off(e,i,this);if(s||h.isEmpty(t._events))delete this._listeningTo[n]}return this}};var u=/\s+/;var l=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(u.test(i)){var n=i.split(u);for(var a=0,h=n.length;a<h;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var c=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],h=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,h);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e)}};var f={listenTo:"on",listenToOnce:"once"};h.each(f,function(t,e){o[e]=function(e,i,r){var s=this._listeningTo||(this._listeningTo={});var n=e._listenId||(e._listenId=h.uniqueId("l"));s[n]=e;if(!r&&typeof i==="object")r=this;e[t](i,r,this);return this}});o.bind=o.on;o.unbind=o.off;h.extend(a,o);var d=a.Model=function(t,e){var i=t||{};e||(e={});this.cid=h.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)i=this.parse(i,e)||{};i=h.defaults({},i,h.result(this,"defaults"));this.set(i,e);this.changed={};this.initialize.apply(this,arguments)};h.extend(d.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return h.clone(this.attributes)},sync:function(){return a.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return h.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,i){var r,s,n,a,o,u,l,c;if(t==null)return this;if(typeof t==="object"){s=t;i=e}else{(s={})[t]=e}i||(i={});if(!this._validate(s,i))return false;n=i.unset;o=i.silent;a=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=h.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in s)this.id=s[this.idAttribute];for(r in s){e=s[r];if(!h.isEqual(c[r],e))a.push(r);if(!h.isEqual(l[r],e)){this.changed[r]=e}else{delete this.changed[r]}n?delete c[r]:c[r]=e}if(!o){if(a.length)this._pending=true;for(var f=0,d=a.length;f<d;f++){this.trigger("change:"+a[f],this,c[a[f]],i)}}if(u)return this;if(!o){while(this._pending){this._pending=false;this.trigger("change",this,i)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,h.extend({},e,{unset:true}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,h.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!h.isEmpty(this.changed);return h.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?h.clone(this.changed):false;var e,i=false;var r=this._changing?this._previousAttributes:this.attributes;for(var s in t){if(h.isEqual(r[s],e=t[s]))continue;(i||(i={}))[s]=e}return i},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return h.clone(this._previousAttributes)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var i=t.success;t.success=function(r){if(!e.set(e.parse(r,t),t))return false;if(i)i(e,r,t);e.trigger("sync",e,r,t)};M(this,t);return this.sync("read",this,t)},save:function(t,e,i){var r,s,n,a=this.attributes;if(t==null||typeof t==="object"){r=t;i=e}else{(r={})[t]=e}i=h.extend({validate:true},i);if(r&&!i.wait){if(!this.set(r,i))return false}else{if(!this._validate(r,i))return false}if(r&&i.wait){this.attributes=h.extend({},a,r)}if(i.parse===void 0)i.parse=true;var o=this;var u=i.success;i.success=function(t){o.attributes=a;var e=o.parse(t,i);if(i.wait)e=h.extend(r||{},e);if(h.isObject(e)&&!o.set(e,i)){return false}if(u)u(o,t,i);o.trigger("sync",o,t,i)};M(this,i);s=this.isNew()?"create":i.patch?"patch":"update";if(s==="patch")i.attrs=r;n=this.sync(s,this,i);if(r&&i.wait)this.attributes=a;return n},destroy:function(t){t=t?h.clone(t):{};var e=this;var i=t.success;var r=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(s){if(t.wait||e.isNew())r();if(i)i(e,s,t);if(!e.isNew())e.trigger("sync",e,s,t)};if(this.isNew()){t.success();return false}M(this,t);var s=this.sync("delete",this,t);if(!t.wait)r();return s},url:function(){var t=h.result(this,"urlRoot")||h.result(this.collection,"url")||U();if(this.isNew())return t;return t+(t.charAt(t.length-1)==="/"?"":"/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},isValid:function(t){return this._validate({},h.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=h.extend({},this.attributes,t);var i=this.validationError=this.validate(t,e)||null;if(!i)return true;this.trigger("invalid",this,i,h.extend(e,{validationError:i}));return false}});var p=["keys","values","pairs","invert","pick","omit"];h.each(p,function(t){d.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.attributes);return h[t].apply(h,e)}});var v=a.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,h.extend({silent:true},e))};var g={add:true,remove:true,merge:true};var m={add:true,remove:false};h.extend(v.prototype,o,{model:d,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return a.sync.apply(this,arguments)},add:function(t,e){return this.set(t,h.extend({merge:false},e,m))},remove:function(t,e){var i=!h.isArray(t);t=i?[t]:h.clone(t);e||(e={});var r,s,n,a;for(r=0,s=t.length;r<s;r++){a=t[r]=this.get(t[r]);if(!a)continue;delete this._byId[a.id];delete this._byId[a.cid];n=this.indexOf(a);this.models.splice(n,1);this.length--;if(!e.silent){e.index=n;a.trigger("remove",a,this,e)}this._removeReference(a)}return i?t[0]:t},set:function(t,e){e=h.defaults({},e,g);if(e.parse)t=this.parse(t,e);var i=!h.isArray(t);t=i?t?[t]:[]:h.clone(t);var r,s,n,a,o,u,l;var c=e.at;var f=this.model;var p=this.comparator&&c==null&&e.sort!==false;var v=h.isString(this.comparator)?this.comparator:null;var m=[],y=[],_={};var w=e.add,b=e.merge,x=e.remove;var E=!p&&w&&x?[]:false;for(r=0,s=t.length;r<s;r++){o=t[r];if(o instanceof d){n=a=o}else{n=o[f.prototype.idAttribute]}if(u=this.get(n)){if(x)_[u.cid]=true;if(b){o=o===a?a.attributes:o;if(e.parse)o=u.parse(o,e);u.set(o,e);if(p&&!l&&u.hasChanged(v))l=true}t[r]=u}else if(w){a=t[r]=this._prepareModel(o,e);if(!a)continue;m.push(a);a.on("all",this._onModelEvent,this);this._byId[a.cid]=a;if(a.id!=null)this._byId[a.id]=a}if(E)E.push(u||a)}if(x){for(r=0,s=this.length;r<s;++r){if(!_[(a=this.models[r]).cid])y.push(a)}if(y.length)this.remove(y,e)}if(m.length||E&&E.length){if(p)l=true;this.length+=m.length;if(c!=null){for(r=0,s=m.length;r<s;r++){this.models.splice(c+r,0,m[r])}}else{if(E)this.models.length=0;var T=E||m;for(r=0,s=T.length;r<s;r++){this.models.push(T[r])}}}if(l)this.sort({silent:true});if(!e.silent){for(r=0,s=m.length;r<s;r++){(a=m[r]).trigger("add",a,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}return i?t[0]:t},reset:function(t,e){e||(e={});for(var i=0,r=this.models.length;i<r;i++){this._removeReference(this.models[i])}e.previousModels=this.models;this._reset();t=this.add(t,h.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,h.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,h.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return s.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t.id]||this._byId[t.cid]||this._byId[t]},at:function(t){return this.models[t]},where:function(t,e){if(h.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(h.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(h.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return h.invoke(this.models,"get",t)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var i=this;t.success=function(r){var s=t.reset?"reset":"set";i[s](r,t);if(e)e(i,r,t);i.trigger("sync",i,r,t)};M(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?h.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var i=this;var r=e.success;e.success=function(t,e,s){if(s.wait)i.add(t,s);if(r)r(t,e,s)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof d){if(!t.collection)t.collection=this;return t}e=e?h.clone(e):{};e.collection=this;var i=new this.model(t,e);if(!i.validationError)return i;this.trigger("invalid",this,i.validationError,e);return false},_removeReference:function(t){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var y=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain"];h.each(y,function(t){v.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.models);return h[t].apply(h,e)}});var _=["groupBy","countBy","sortBy"];h.each(_,function(t){v.prototype[t]=function(e,i){var r=h.isFunction(e)?e:function(t){return t.get(e)};return h[t](this.models,r,i)}});var w=a.View=function(t){this.cid=h.uniqueId("view");t||(t={});h.extend(this,h.pick(t,x));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var b=/^(\S+)\s*(.*)$/;var x=["model","collection","el","id","attributes","className","tagName","events"];h.extend(w.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,e){if(this.$el)this.undelegateEvents();this.$el=t instanceof a.$?t:a.$(t);this.el=this.$el[0];if(e!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=h.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var i=t[e];if(!h.isFunction(i))i=this[t[e]];if(!i)continue;var r=e.match(b);var s=r[1],n=r[2];i=h.bind(i,this);s+=".delegateEvents"+this.cid;if(n===""){this.$el.on(s,i)}else{this.$el.on(s,n,i)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=h.extend({},h.result(this,"attributes"));if(this.id)t.id=h.result(this,"id");if(this.className)t["class"]=h.result(this,"className");var e=a.$("<"+h.result(this,"tagName")+">").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=T[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)return n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&E){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var E=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var k=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var $=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(k.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history.trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace(S,"(?:$1)?").replace($,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/[?#].*$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=P.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(O,"/");if(r&&this._wantsHashChange){this.iframe=a.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;this.navigate(e)}if(this._hasPushState){a.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!r){a.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=e;var s=this.location;var n=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!n){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._hasPushState&&n&&s.hash){this.fragment=this.getHash().replace(N,"");this.history.replaceState({},document.title,this.root+this.fragment+s.search)}}if(!this.options.silent)return this.loadUrl()},stop:function(){a.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);I.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return h.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!I.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});a.history=new I;var R=function(t,e){var i=this;var r;if(t&&h.has(t,"constructor")){r=t.constructor}else{r=function(){return i.apply(this,arguments)}}h.extend(r,i,e);var s=function(){this.constructor=r};s.prototype=i.prototype;r.prototype=new s;if(t)h.extend(r.prototype,t);r.__super__=i.prototype;return r};d.extend=v.extend=k.extend=w.extend=I.extend=R;var U=function(){throw new Error('A "url" property or function must be specified')};var M=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}}}).call(this);
diff --git a/sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.js b/sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.js
new file mode 100644 (file)
index 0000000..58ac9a8
--- /dev/null
@@ -0,0 +1,21 @@
+// MarionetteJS (Backbone.Marionette)
+// ----------------------------------
+// v1.2.1
+//
+// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
+// Distributed under MIT license
+//
+// http://marionettejs.com
+
+
+
+/*!
+ * Includes BabySitter
+ * https://github.com/marionettejs/backbone.babysitter/
+ *
+ * Includes Wreqr
+ * https://github.com/marionettejs/backbone.wreqr/
+ */
+
+Backbone.ChildViewContainer=function(a,b){var c=function(a){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),b.each(a,this.add,this)};b.extend(c.prototype,{add:function(a,b){var c=a.cid;this._views[c]=a,a.model&&(this._indexByModel[a.model.cid]=c),b&&(this._indexByCustom[b]=c),this._updateLength()},findByModel:function(a){return this.findByModelCid(a.cid)},findByModelCid:function(a){var b=this._indexByModel[a];return this.findByCid(b)},findByCustom:function(a){var b=this._indexByCustom[a];return this.findByCid(b)},findByIndex:function(a){return b.values(this._views)[a]},findByCid:function(a){return this._views[a]},remove:function(a){var c=a.cid;a.model&&delete this._indexByModel[a.model.cid],b.any(this._indexByCustom,function(a,b){return a===c?(delete this._indexByCustom[b],!0):void 0},this),delete this._views[c],this._updateLength()},call:function(a){this.apply(a,b.tail(arguments))},apply:function(a,c){b.each(this._views,function(d){b.isFunction(d[a])&&d[a].apply(d,c||[])})},_updateLength:function(){this.length=b.size(this._views)}});var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return b.each(d,function(a){c.prototype[a]=function(){var c=b.values(this._views),d=[c].concat(b.toArray(arguments));return b[a].apply(b,d)}}),c}(Backbone,_),Backbone.Wreqr=function(a,b,c){"use strict";var d={};return d.Handlers=function(a,b){var c=function(a){this.options=a,this._wreqrHandlers={},b.isFunction(this.initialize)&&this.initialize(a)};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events,{setHandlers:function(a){b.each(a,function(a,c){var d=null;b.isObject(a)&&!b.isFunction(a)&&(d=a.context,a=a.callback),this.setHandler(c,a,d)},this)},setHandler:function(a,b,c){var d={callback:b,context:c};this._wreqrHandlers[a]=d,this.trigger("handler:add",a,b,c)},hasHandler:function(a){return!!this._wreqrHandlers[a]},getHandler:function(a){var b=this._wreqrHandlers[a];if(!b)throw new Error("Handler not found for '"+a+"'");return function(){var a=Array.prototype.slice.apply(arguments);return b.callback.apply(b.context,a)}},removeHandler:function(a){delete this._wreqrHandlers[a]},removeAllHandlers:function(){this._wreqrHandlers={}}}),c}(a,c),d.CommandStorage=function(){var b=function(a){this.options=a,this._commands={},c.isFunction(this.initialize)&&this.initialize(a)};return c.extend(b.prototype,a.Events,{getCommands:function(a){var b=this._commands[a];return b||(b={command:a,instances:[]},this._commands[a]=b),b},addCommand:function(a,b){var c=this.getCommands(a);c.instances.push(b)},clearCommands:function(a){var b=this.getCommands(a);b.instances=[]}}),b}(),d.Commands=function(a){return a.Handlers.extend({storageType:a.CommandStorage,constructor:function(b){this.options=b||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var c=Array.prototype.slice.call(arguments);a.Handlers.prototype.constructor.apply(this,c)},execute:function(a,b){a=arguments[0],b=Array.prototype.slice.call(arguments,1),this.hasHandler(a)?this.getHandler(a).apply(this,b):this.storage.addCommand(a,b)},_executeCommands:function(a,b,d){var e=this.storage.getCommands(a);c.each(e.instances,function(a){b.apply(d,a)}),this.storage.clearCommands(a)},_initializeStorage:function(a){var b,d=a.storageType||this.storageType;b=c.isFunction(d)?new d:d,this.storage=b}})}(d),d.RequestResponse=function(a){return a.Handlers.extend({request:function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);return this.getHandler(a).apply(this,b)}})}(d),d.EventAggregator=function(a,b){var c=function(){};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events),c}(a,c),d}(Backbone,Backbone.Marionette,_);var Marionette=function(a,b,c){"use strict";function d(a){return g.call(a)}function e(a,b){var c=new Error(a);throw c.name=b||"Error",c}var f={};b.Marionette=f,f.$=b.$;var g=Array.prototype.slice;return f.extend=b.Model.extend,f.getOption=function(a,b){if(a&&b){var c;return c=a.options&&b in a.options&&void 0!==a.options[b]?a.options[b]:a[b]}},f.triggerMethod=function(){function a(a,b,c){return c.toUpperCase()}var b=/(^|:)(\w)/gi,d=function(d){var e="on"+d.replace(b,a),f=this[e];return c.isFunction(this.trigger)&&this.trigger.apply(this,arguments),c.isFunction(f)?f.apply(this,c.tail(arguments)):void 0};return d}(),f.MonitorDOMRefresh=function(){function a(a){a._isShown=!0,d(a)}function b(a){a._isRendered=!0,d(a)}function d(a){a._isShown&&a._isRendered&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}return function(c){c.listenTo(c,"show",function(){a(c)}),c.listenTo(c,"render",function(){b(c)})}}(),function(a){function b(a,b,d,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||e("Method '"+c+"' was configured as an event handler, but does not exist."),a.listenTo(b,d,f,a)})}function d(a,b,c,d){a.listenTo(b,c,d,a)}function f(a,b,d,e){var f=e.split(/\s+/);c.each(f,function(c){var e=a[c];a.stopListening(b,d,e,a)})}function g(a,b,c,d){a.stopListening(b,c,d,a)}function h(a,b,d,e,f){b&&d&&(c.isFunction(d)&&(d=d.call(a)),c.each(d,function(d,g){c.isFunction(d)?e(a,b,g,d):f(a,b,g,d)}))}a.bindEntityEvents=function(a,c,e){h(a,c,e,d,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)}}(f),f.Callbacks=function(){this._deferred=f.$.Deferred(),this._callbacks=[]},c.extend(f.Callbacks.prototype,{add:function(a,b){this._callbacks.push({cb:a,ctx:b}),this._deferred.done(function(c,d){b&&(c=b),a.call(c,d)})},run:function(a,b){this._deferred.resolve(b,a)},reset:function(){var a=this._callbacks;this._deferred=f.$.Deferred(),this._callbacks=[],c.each(a,function(a){this.add(a.cb,a.ctx)},this)}}),f.Controller=function(a){this.triggerMethod=f.triggerMethod,this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},f.Controller.extend=f.extend,c.extend(f.Controller.prototype,b.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),f.Region=function(a){if(this.options=a||{},this.el=f.getOption(this,"el"),!this.el){var b=new Error("An 'el' must be specified for a region.");throw b.name="NoElError",b}if(this.initialize){var c=Array.prototype.slice.apply(arguments);this.initialize.apply(this,c)}},c.extend(f.Region,{buildRegion:function(a,b){var d="string"==typeof a,e="string"==typeof a.selector,f="undefined"==typeof a.regionType,g="function"==typeof a;if(!g&&!d&&!e)throw new Error("Region must be specified as a Region type, a selector string or an object with selector property");var h,i;d&&(h=a),a.selector&&(h=a.selector),g&&(i=a),!g&&f&&(i=b),a.regionType&&(i=a.regionType);var j=new i({el:h});return a.parentEl&&(j.getEl=function(b){var d=a.parentEl;return c.isFunction(d)&&(d=d()),d.find(b)}),j}}),c.extend(f.Region.prototype,b.Events,{show:function(a){this.ensureEl();var b=a.isClosed||c.isUndefined(a.$el),d=a!==this.currentView;d&&this.close(),a.render(),(d||b)&&this.open(a),this.currentView=a,f.triggerMethod.call(this,"show",a),f.triggerMethod.call(a,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(a){return f.$(a)},open:function(a){this.$el.empty().append(a.el)},close:function(){var a=this.currentView;a&&!a.isClosed&&(a.close?a.close():a.remove&&a.remove(),f.triggerMethod.call(this,"close"),delete this.currentView)},attachView:function(a){this.currentView=a},reset:function(){this.close(),delete this.$el}}),f.Region.extend=f.extend,f.RegionManager=function(a){var b=a.Controller.extend({constructor:function(b){this._regions={},a.Controller.prototype.constructor.call(this,b)},addRegions:function(a,b){var d={};return c.each(a,function(a,e){"string"==typeof a&&(a={selector:a}),a.selector&&(a=c.defaults({},a,b));var f=this.addRegion(e,a);d[e]=f},this),d},addRegion:function(b,d){var e,f=c.isObject(d),g=c.isString(d),h=!!d.selector;return e=g||f&&h?a.Region.buildRegion(d,a.Region):c.isFunction(d)?a.Region.buildRegion(d,a.Region):d,this._store(b,e),this.triggerMethod("region:add",b,e),e},get:function(a){return this._regions[a]},removeRegion:function(a){var b=this._regions[a];this._remove(a,b)},removeRegions:function(){c.each(this._regions,function(a,b){this._remove(b,a)},this)},closeRegions:function(){c.each(this._regions,function(a){a.close()},this)},close:function(){this.removeRegions();var b=Array.prototype.slice.call(arguments);a.Controller.prototype.close.apply(this,b)},_store:function(a,b){this._regions[a]=b,this._setLength()},_remove:function(a,b){b.close(),delete this._regions[a],this._setLength(),this.triggerMethod("region:remove",a,b)},_setLength:function(){this.length=c.size(this._regions)}}),d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return c.each(d,function(a){b.prototype[a]=function(){var b=c.values(this._regions),d=[b].concat(c.toArray(arguments));return c[a].apply(c,d)}}),b}(f),f.TemplateCache=function(a){this.templateId=a},c.extend(f.TemplateCache,{templateCaches:{},get:function(a){var b=this.templateCaches[a];return b||(b=new f.TemplateCache(a),this.templateCaches[a]=b),b.load()},clear:function(){var a,b=d(arguments),c=b.length;if(c>0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(f.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var b=f.$(a).html();return b&&0!==b.length||e("Could not find template: '"+a+"'","NoTemplateError"),b},compileTemplate:function(a){return c.template(a)}}),f.Renderer={render:function(a,b){if(!a){var c=new Error("Cannot render the template since it's false, null or undefined.");throw c.name="TemplateNotFoundError",c}var d;return d="function"==typeof a?a:f.TemplateCache.get(a),d(b)}},f.View=b.View.extend({constructor:function(a){c.bindAll(this,"render");var d=Array.prototype.slice.apply(arguments);b.View.prototype.constructor.apply(this,d),this.options=a||{},f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:f.triggerMethod,getTemplate:function(){return f.getOption(this,"template")},mixinTemplateHelpers:function(a){a=a||{};var b=f.getOption(this,"templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},configureTriggers:function(){if(this.triggers){var a={},b=c.result(this,"triggers");return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),f.bindEntityEvents(this,this.model,f.getOption(this,"modelEvents")),f.bindEntityEvents(this,this.collection,f.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this));var d={},e=this.configureTriggers();c.extend(d,a,e),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=Array.prototype.slice.call(arguments);b.View.prototype.undelegateEvents.apply(this,a),f.unbindEntityEvents(this,this.model,f.getOption(this,"modelEvents")),f.unbindEntityEvents(this,this.collection,f.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var a=this.triggerMethod("before:close");a!==!1&&(this.isClosed=!0,this.triggerMethod("close"),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),f.ItemView=f.View.extend({constructor:function(){f.View.prototype.constructor.apply(this,d(arguments))},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this.isClosed=!1,this.triggerMethod("before:render",this),this.triggerMethod("item:before:render",this);var a=this.serializeData();a=this.mixinTemplateHelpers(a);var b=this.getTemplate(),c=f.Renderer.render(b,a);return this.$el.html(c),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),f.View.prototype.close.apply(this,d(arguments)),this.triggerMethod("item:closed"))}}),f.CollectionView=f.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),f.View.prototype.constructor.apply(this,d(arguments)),this._initialEvents()},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this.render,this))},addChildView:function(a){this.closeEmptyView();var b=this.getItemView(a),c=this.collection.indexOf(a);this.addItemView(a,b,c)},onShowCalled:function(){this.children.each(function(a){f.triggerMethod.call(a,"show")})},triggerBeforeRender:function(){this.triggerMethod("before:render",this),this.triggerMethod("collection:before:render",this)},triggerRendered:function(){this.triggerMethod("render",this),this.triggerMethod("collection:rendered",this)},render:function(){return this.isClosed=!1,this.triggerBeforeRender(),this._renderChildren(),this.triggerRendered(),this},_renderChildren:function(){this.closeEmptyView(),this.closeChildren(),this.collection&&this.collection.length>0?this.showCollection():this.showEmptyView()},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getItemView(b),this.addItemView(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this._showingEmptyView=!0;var c=new b.Model;this.addItemView(c,a,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getEmptyView:function(){return f.getOption(this,"emptyView")},getItemView:function(){var a=f.getOption(this,"itemView");return a||e("An `itemView` must be specified","NoItemViewError"),a},addItemView:function(a,b,d){var e=f.getOption(this,"itemViewOptions");c.isFunction(e)&&(e=e.call(this,a,d));var g=this.buildItemView(a,b,e);this.addChildViewEventForwarding(g),this.triggerMethod("before:item:added",g),this.children.add(g),this.renderItemView(g,d),this._isShown&&f.triggerMethod.call(g,"show"),this.triggerMethod("after:item:added",g)},addChildViewEventForwarding:function(a){var b=f.getOption(this,"itemViewEventPrefix");this.listenTo(a,"all",function(){var c=d(arguments);c[0]=b+":"+c[0],c.splice(1,0,a),f.triggerMethod.apply(this,c)},this)},renderItemView:function(a,b){a.render(),this.appendHtml(this,a,b)},buildItemView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeItemView:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},removeChildView:function(a){a&&(this.stopListening(a),a.close?a.close():a.remove&&a.remove(),this.children.remove(a)),this.triggerMethod("item:removed",a)},checkEmpty:function(){this.collection&&0!==this.collection.length||this.showEmptyView()},appendHtml:function(a,b){a.$el.append(b.el)},_initChildViewStorage:function(){this.children=new b.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),f.View.prototype.close.apply(this,d(arguments)))},closeChildren:function(){this.children.each(function(a){this.removeChildView(a)},this),this.checkEmpty()}}),f.CompositeView=f.CollectionView.extend({constructor:function(){f.CollectionView.prototype.constructor.apply(this,d(arguments))},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this._renderChildren,this))},getItemView:function(){var a=f.getOption(this,"itemView")||this.constructor;return a||e("An `itemView` must be specified","NoItemViewError"),a},serializeData:function(){var a={};return this.model&&(a=this.model.toJSON()),a},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var a=this.renderModel();return this.$el.html(a),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(f.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var a={};a=this.serializeData(),a=this.mixinTemplateHelpers(a);var b=this.getTemplate();return f.Renderer.render(b,a)},appendHtml:function(a,b){var c=this.getItemViewContainer(a);c.append(b.el)},getItemViewContainer:function(a){if("$itemViewContainer"in a)return a.$itemViewContainer;var b,d=f.getOption(a,"itemViewContainer");if(d){var g=c.isFunction(d)?d():d;b=a.$(g),b.length<=0&&e("The specified `itemViewContainer` was not found: "+a.itemViewContainer,"ItemViewContainerMissingError")}else b=a.$el;return a.$itemViewContainer=b,b},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),f.Layout=f.ItemView.extend({regionType:f.Region,constructor:function(a){a=a||{},this._firstRender=!0,this._initializeRegions(a),f.ItemView.prototype.constructor.call(this,a)},render:function(){this.isClosed&&this._initializeRegions(),this._firstRender?this._firstRender=!1:this.isClosed||this._reInitializeRegions();var a=Array.prototype.slice.apply(arguments),b=f.ItemView.prototype.render.apply(this,a);return b},close:function(){if(!this.isClosed){this.regionManager.close();var a=Array.prototype.slice.apply(arguments);f.ItemView.prototype.close.apply(this,a)}},addRegion:function(a,b){var c={};return c[a]=b,this._buildRegions(c)[a]},addRegions:function(a){return this.regions=c.extend({},this.regions,a),this._buildRegions(a)},removeRegion:function(a){return delete this.regions[a],this.regionManager.removeRegion(a)},_buildRegions:function(a){var b=this,c={regionType:f.getOption(this,"regionType"),parentEl:function(){return b.$el}};return this.regionManager.addRegions(a,c)},_initializeRegions:function(a){var b;this._initRegionManager(),b=c.isFunction(this.regions)?this.regions(a):this.regions||{},this.addRegions(b)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(a){a.reset()})},_initRegionManager:function(){this.regionManager=new f.RegionManager,this.listenTo(this.regionManager,"region:add",function(a,b){this[a]=b,this.trigger("region:add",a,b)}),this.listenTo(this.regionManager,"region:remove",function(a,b){delete this[a],this.trigger("region:remove",a,b)})}}),f.AppRouter=b.Router.extend({constructor:function(a){b.Router.prototype.constructor.apply(this,d(arguments)),this.options=a||{};var c=f.getOption(this,"appRoutes"),e=this._getController();this.processAppRoutes(e,c)},appRoute:function(a,b){var c=this._getController();this._addAppRoute(c,a,b)},processAppRoutes:function(a,b){if(b){var d=c.keys(b).reverse();c.each(d,function(c){this._addAppRoute(a,c,b[c])},this)}},_getController:function(){return f.getOption(this,"controller")},_addAppRoute:function(a,b,d){var e=a[d];if(!e)throw new Error("Method '"+d+"' was not found on the controller");this.route(b,d,c.bind(e,a))}}),f.Application=function(a){this._initRegionManager(),this._initCallbacks=new f.Callbacks,this.vent=new b.Wreqr.EventAggregator,this.commands=new b.Wreqr.Commands,this.reqres=new b.Wreqr.RequestResponse,this.submodules={},c.extend(this,a),this.triggerMethod=f.triggerMethod},c.extend(f.Application.prototype,b.Events,{execute:function(){var a=Array.prototype.slice.apply(arguments);this.commands.execute.apply(this.commands,a)},request:function(){var a=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,a)},addInitializer:function(a){this._initCallbacks.add(a)},start:function(a){this.triggerMethod("initialize:before",a),this._initCallbacks.run(a,this),this.triggerMethod("initialize:after",a),this.triggerMethod("start",a)},addRegions:function(a){return this._regionManager.addRegions(a)},closeRegions:function(){this._regionManager.closeRegions()},removeRegion:function(a){this._regionManager.removeRegion(a)},getRegion:function(a){return this._regionManager.get(a)},module:function(){var a=d(arguments);return a.unshift(this),f.Module.create.apply(f.Module,a)},_initRegionManager:function(){this._regionManager=new f.RegionManager,this.listenTo(this._regionManager,"region:add",function(a,b){this[a]=b}),this.listenTo(this._regionManager,"region:remove",function(a){delete this[a]})}}),f.Application.extend=f.extend,f.Module=function(a,b){this.moduleName=a,this.submodules={},this._setupInitializersAndFinalizers(),this.app=b,this.startWithParent=!0,this.triggerMethod=f.triggerMethod},c.extend(f.Module.prototype,b.Events,{addInitializer:function(a){this._initializerCallbacks.add(a)},addFinalizer:function(a){this._finalizerCallbacks.add(a)},start:function(a){this._isInitialized||(c.each(this.submodules,function(b){b.startWithParent&&b.start(a)}),this.triggerMethod("before:start",a),this._initializerCallbacks.run(a,this),this._isInitialized=!0,this.triggerMethod("start",a))},stop:function(){this._isInitialized&&(this._isInitialized=!1,f.triggerMethod.call(this,"before:stop"),c.each(this.submodules,function(a){a.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),f.triggerMethod.call(this,"stop"))},addDefinition:function(a,b){this._runModuleDefinition(a,b)},_runModuleDefinition:function(a,d){if(a){var e=c.flatten([this,this.app,b,f,f.$,c,d]);a.apply(this,e)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new f.Callbacks,this._finalizerCallbacks=new f.Callbacks}}),c.extend(f.Module,{create:function(a,b,e){var f=a,g=d(arguments);g.splice(0,3),b=b.split(".");var h=b.length,i=[];return i[h-1]=e,c.each(b,function(b,c){var d=f;f=this._getModule(d,b,a),this._addModuleDefinition(d,f,i[c],g)},this),f},_getModule:function(a,b,c){var d=a[b];return d||(d=new f.Module(b,c),a[b]=d,a.submodules[b]=d),d},_addModuleDefinition:function(a,b,d,e){var f,g;c.isFunction(d)?(f=d,g=!0):c.isObject(d)?(f=d.define,g=d.startWithParent):g=!0,f&&b.addDefinition(f,e),b.startWithParent=b.startWithParent&&g,b.startWithParent&&!b.startWithParentIsConfigured&&(b.startWithParentIsConfigured=!0,a.addInitializer(function(a){b.startWithParent&&b.start(a)}))}}),f}(this,Backbone,_);
+//# sourceMappingURL=backbone.marionette.map
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.min.js b/sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.min.js
deleted file mode 100644 (file)
index 58ac9a8..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// MarionetteJS (Backbone.Marionette)
-// ----------------------------------
-// v1.2.1
-//
-// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
-// Distributed under MIT license
-//
-// http://marionettejs.com
-
-
-
-/*!
- * Includes BabySitter
- * https://github.com/marionettejs/backbone.babysitter/
- *
- * Includes Wreqr
- * https://github.com/marionettejs/backbone.wreqr/
- */
-
-Backbone.ChildViewContainer=function(a,b){var c=function(a){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),b.each(a,this.add,this)};b.extend(c.prototype,{add:function(a,b){var c=a.cid;this._views[c]=a,a.model&&(this._indexByModel[a.model.cid]=c),b&&(this._indexByCustom[b]=c),this._updateLength()},findByModel:function(a){return this.findByModelCid(a.cid)},findByModelCid:function(a){var b=this._indexByModel[a];return this.findByCid(b)},findByCustom:function(a){var b=this._indexByCustom[a];return this.findByCid(b)},findByIndex:function(a){return b.values(this._views)[a]},findByCid:function(a){return this._views[a]},remove:function(a){var c=a.cid;a.model&&delete this._indexByModel[a.model.cid],b.any(this._indexByCustom,function(a,b){return a===c?(delete this._indexByCustom[b],!0):void 0},this),delete this._views[c],this._updateLength()},call:function(a){this.apply(a,b.tail(arguments))},apply:function(a,c){b.each(this._views,function(d){b.isFunction(d[a])&&d[a].apply(d,c||[])})},_updateLength:function(){this.length=b.size(this._views)}});var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return b.each(d,function(a){c.prototype[a]=function(){var c=b.values(this._views),d=[c].concat(b.toArray(arguments));return b[a].apply(b,d)}}),c}(Backbone,_),Backbone.Wreqr=function(a,b,c){"use strict";var d={};return d.Handlers=function(a,b){var c=function(a){this.options=a,this._wreqrHandlers={},b.isFunction(this.initialize)&&this.initialize(a)};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events,{setHandlers:function(a){b.each(a,function(a,c){var d=null;b.isObject(a)&&!b.isFunction(a)&&(d=a.context,a=a.callback),this.setHandler(c,a,d)},this)},setHandler:function(a,b,c){var d={callback:b,context:c};this._wreqrHandlers[a]=d,this.trigger("handler:add",a,b,c)},hasHandler:function(a){return!!this._wreqrHandlers[a]},getHandler:function(a){var b=this._wreqrHandlers[a];if(!b)throw new Error("Handler not found for '"+a+"'");return function(){var a=Array.prototype.slice.apply(arguments);return b.callback.apply(b.context,a)}},removeHandler:function(a){delete this._wreqrHandlers[a]},removeAllHandlers:function(){this._wreqrHandlers={}}}),c}(a,c),d.CommandStorage=function(){var b=function(a){this.options=a,this._commands={},c.isFunction(this.initialize)&&this.initialize(a)};return c.extend(b.prototype,a.Events,{getCommands:function(a){var b=this._commands[a];return b||(b={command:a,instances:[]},this._commands[a]=b),b},addCommand:function(a,b){var c=this.getCommands(a);c.instances.push(b)},clearCommands:function(a){var b=this.getCommands(a);b.instances=[]}}),b}(),d.Commands=function(a){return a.Handlers.extend({storageType:a.CommandStorage,constructor:function(b){this.options=b||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var c=Array.prototype.slice.call(arguments);a.Handlers.prototype.constructor.apply(this,c)},execute:function(a,b){a=arguments[0],b=Array.prototype.slice.call(arguments,1),this.hasHandler(a)?this.getHandler(a).apply(this,b):this.storage.addCommand(a,b)},_executeCommands:function(a,b,d){var e=this.storage.getCommands(a);c.each(e.instances,function(a){b.apply(d,a)}),this.storage.clearCommands(a)},_initializeStorage:function(a){var b,d=a.storageType||this.storageType;b=c.isFunction(d)?new d:d,this.storage=b}})}(d),d.RequestResponse=function(a){return a.Handlers.extend({request:function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);return this.getHandler(a).apply(this,b)}})}(d),d.EventAggregator=function(a,b){var c=function(){};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events),c}(a,c),d}(Backbone,Backbone.Marionette,_);var Marionette=function(a,b,c){"use strict";function d(a){return g.call(a)}function e(a,b){var c=new Error(a);throw c.name=b||"Error",c}var f={};b.Marionette=f,f.$=b.$;var g=Array.prototype.slice;return f.extend=b.Model.extend,f.getOption=function(a,b){if(a&&b){var c;return c=a.options&&b in a.options&&void 0!==a.options[b]?a.options[b]:a[b]}},f.triggerMethod=function(){function a(a,b,c){return c.toUpperCase()}var b=/(^|:)(\w)/gi,d=function(d){var e="on"+d.replace(b,a),f=this[e];return c.isFunction(this.trigger)&&this.trigger.apply(this,arguments),c.isFunction(f)?f.apply(this,c.tail(arguments)):void 0};return d}(),f.MonitorDOMRefresh=function(){function a(a){a._isShown=!0,d(a)}function b(a){a._isRendered=!0,d(a)}function d(a){a._isShown&&a._isRendered&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}return function(c){c.listenTo(c,"show",function(){a(c)}),c.listenTo(c,"render",function(){b(c)})}}(),function(a){function b(a,b,d,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||e("Method '"+c+"' was configured as an event handler, but does not exist."),a.listenTo(b,d,f,a)})}function d(a,b,c,d){a.listenTo(b,c,d,a)}function f(a,b,d,e){var f=e.split(/\s+/);c.each(f,function(c){var e=a[c];a.stopListening(b,d,e,a)})}function g(a,b,c,d){a.stopListening(b,c,d,a)}function h(a,b,d,e,f){b&&d&&(c.isFunction(d)&&(d=d.call(a)),c.each(d,function(d,g){c.isFunction(d)?e(a,b,g,d):f(a,b,g,d)}))}a.bindEntityEvents=function(a,c,e){h(a,c,e,d,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)}}(f),f.Callbacks=function(){this._deferred=f.$.Deferred(),this._callbacks=[]},c.extend(f.Callbacks.prototype,{add:function(a,b){this._callbacks.push({cb:a,ctx:b}),this._deferred.done(function(c,d){b&&(c=b),a.call(c,d)})},run:function(a,b){this._deferred.resolve(b,a)},reset:function(){var a=this._callbacks;this._deferred=f.$.Deferred(),this._callbacks=[],c.each(a,function(a){this.add(a.cb,a.ctx)},this)}}),f.Controller=function(a){this.triggerMethod=f.triggerMethod,this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},f.Controller.extend=f.extend,c.extend(f.Controller.prototype,b.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),f.Region=function(a){if(this.options=a||{},this.el=f.getOption(this,"el"),!this.el){var b=new Error("An 'el' must be specified for a region.");throw b.name="NoElError",b}if(this.initialize){var c=Array.prototype.slice.apply(arguments);this.initialize.apply(this,c)}},c.extend(f.Region,{buildRegion:function(a,b){var d="string"==typeof a,e="string"==typeof a.selector,f="undefined"==typeof a.regionType,g="function"==typeof a;if(!g&&!d&&!e)throw new Error("Region must be specified as a Region type, a selector string or an object with selector property");var h,i;d&&(h=a),a.selector&&(h=a.selector),g&&(i=a),!g&&f&&(i=b),a.regionType&&(i=a.regionType);var j=new i({el:h});return a.parentEl&&(j.getEl=function(b){var d=a.parentEl;return c.isFunction(d)&&(d=d()),d.find(b)}),j}}),c.extend(f.Region.prototype,b.Events,{show:function(a){this.ensureEl();var b=a.isClosed||c.isUndefined(a.$el),d=a!==this.currentView;d&&this.close(),a.render(),(d||b)&&this.open(a),this.currentView=a,f.triggerMethod.call(this,"show",a),f.triggerMethod.call(a,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(a){return f.$(a)},open:function(a){this.$el.empty().append(a.el)},close:function(){var a=this.currentView;a&&!a.isClosed&&(a.close?a.close():a.remove&&a.remove(),f.triggerMethod.call(this,"close"),delete this.currentView)},attachView:function(a){this.currentView=a},reset:function(){this.close(),delete this.$el}}),f.Region.extend=f.extend,f.RegionManager=function(a){var b=a.Controller.extend({constructor:function(b){this._regions={},a.Controller.prototype.constructor.call(this,b)},addRegions:function(a,b){var d={};return c.each(a,function(a,e){"string"==typeof a&&(a={selector:a}),a.selector&&(a=c.defaults({},a,b));var f=this.addRegion(e,a);d[e]=f},this),d},addRegion:function(b,d){var e,f=c.isObject(d),g=c.isString(d),h=!!d.selector;return e=g||f&&h?a.Region.buildRegion(d,a.Region):c.isFunction(d)?a.Region.buildRegion(d,a.Region):d,this._store(b,e),this.triggerMethod("region:add",b,e),e},get:function(a){return this._regions[a]},removeRegion:function(a){var b=this._regions[a];this._remove(a,b)},removeRegions:function(){c.each(this._regions,function(a,b){this._remove(b,a)},this)},closeRegions:function(){c.each(this._regions,function(a){a.close()},this)},close:function(){this.removeRegions();var b=Array.prototype.slice.call(arguments);a.Controller.prototype.close.apply(this,b)},_store:function(a,b){this._regions[a]=b,this._setLength()},_remove:function(a,b){b.close(),delete this._regions[a],this._setLength(),this.triggerMethod("region:remove",a,b)},_setLength:function(){this.length=c.size(this._regions)}}),d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return c.each(d,function(a){b.prototype[a]=function(){var b=c.values(this._regions),d=[b].concat(c.toArray(arguments));return c[a].apply(c,d)}}),b}(f),f.TemplateCache=function(a){this.templateId=a},c.extend(f.TemplateCache,{templateCaches:{},get:function(a){var b=this.templateCaches[a];return b||(b=new f.TemplateCache(a),this.templateCaches[a]=b),b.load()},clear:function(){var a,b=d(arguments),c=b.length;if(c>0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(f.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var b=f.$(a).html();return b&&0!==b.length||e("Could not find template: '"+a+"'","NoTemplateError"),b},compileTemplate:function(a){return c.template(a)}}),f.Renderer={render:function(a,b){if(!a){var c=new Error("Cannot render the template since it's false, null or undefined.");throw c.name="TemplateNotFoundError",c}var d;return d="function"==typeof a?a:f.TemplateCache.get(a),d(b)}},f.View=b.View.extend({constructor:function(a){c.bindAll(this,"render");var d=Array.prototype.slice.apply(arguments);b.View.prototype.constructor.apply(this,d),this.options=a||{},f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:f.triggerMethod,getTemplate:function(){return f.getOption(this,"template")},mixinTemplateHelpers:function(a){a=a||{};var b=f.getOption(this,"templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},configureTriggers:function(){if(this.triggers){var a={},b=c.result(this,"triggers");return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),f.bindEntityEvents(this,this.model,f.getOption(this,"modelEvents")),f.bindEntityEvents(this,this.collection,f.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this));var d={},e=this.configureTriggers();c.extend(d,a,e),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=Array.prototype.slice.call(arguments);b.View.prototype.undelegateEvents.apply(this,a),f.unbindEntityEvents(this,this.model,f.getOption(this,"modelEvents")),f.unbindEntityEvents(this,this.collection,f.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var a=this.triggerMethod("before:close");a!==!1&&(this.isClosed=!0,this.triggerMethod("close"),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),f.ItemView=f.View.extend({constructor:function(){f.View.prototype.constructor.apply(this,d(arguments))},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this.isClosed=!1,this.triggerMethod("before:render",this),this.triggerMethod("item:before:render",this);var a=this.serializeData();a=this.mixinTemplateHelpers(a);var b=this.getTemplate(),c=f.Renderer.render(b,a);return this.$el.html(c),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),f.View.prototype.close.apply(this,d(arguments)),this.triggerMethod("item:closed"))}}),f.CollectionView=f.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),f.View.prototype.constructor.apply(this,d(arguments)),this._initialEvents()},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this.render,this))},addChildView:function(a){this.closeEmptyView();var b=this.getItemView(a),c=this.collection.indexOf(a);this.addItemView(a,b,c)},onShowCalled:function(){this.children.each(function(a){f.triggerMethod.call(a,"show")})},triggerBeforeRender:function(){this.triggerMethod("before:render",this),this.triggerMethod("collection:before:render",this)},triggerRendered:function(){this.triggerMethod("render",this),this.triggerMethod("collection:rendered",this)},render:function(){return this.isClosed=!1,this.triggerBeforeRender(),this._renderChildren(),this.triggerRendered(),this},_renderChildren:function(){this.closeEmptyView(),this.closeChildren(),this.collection&&this.collection.length>0?this.showCollection():this.showEmptyView()},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getItemView(b),this.addItemView(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this._showingEmptyView=!0;var c=new b.Model;this.addItemView(c,a,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getEmptyView:function(){return f.getOption(this,"emptyView")},getItemView:function(){var a=f.getOption(this,"itemView");return a||e("An `itemView` must be specified","NoItemViewError"),a},addItemView:function(a,b,d){var e=f.getOption(this,"itemViewOptions");c.isFunction(e)&&(e=e.call(this,a,d));var g=this.buildItemView(a,b,e);this.addChildViewEventForwarding(g),this.triggerMethod("before:item:added",g),this.children.add(g),this.renderItemView(g,d),this._isShown&&f.triggerMethod.call(g,"show"),this.triggerMethod("after:item:added",g)},addChildViewEventForwarding:function(a){var b=f.getOption(this,"itemViewEventPrefix");this.listenTo(a,"all",function(){var c=d(arguments);c[0]=b+":"+c[0],c.splice(1,0,a),f.triggerMethod.apply(this,c)},this)},renderItemView:function(a,b){a.render(),this.appendHtml(this,a,b)},buildItemView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeItemView:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},removeChildView:function(a){a&&(this.stopListening(a),a.close?a.close():a.remove&&a.remove(),this.children.remove(a)),this.triggerMethod("item:removed",a)},checkEmpty:function(){this.collection&&0!==this.collection.length||this.showEmptyView()},appendHtml:function(a,b){a.$el.append(b.el)},_initChildViewStorage:function(){this.children=new b.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),f.View.prototype.close.apply(this,d(arguments)))},closeChildren:function(){this.children.each(function(a){this.removeChildView(a)},this),this.checkEmpty()}}),f.CompositeView=f.CollectionView.extend({constructor:function(){f.CollectionView.prototype.constructor.apply(this,d(arguments))},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this._renderChildren,this))},getItemView:function(){var a=f.getOption(this,"itemView")||this.constructor;return a||e("An `itemView` must be specified","NoItemViewError"),a},serializeData:function(){var a={};return this.model&&(a=this.model.toJSON()),a},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var a=this.renderModel();return this.$el.html(a),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(f.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var a={};a=this.serializeData(),a=this.mixinTemplateHelpers(a);var b=this.getTemplate();return f.Renderer.render(b,a)},appendHtml:function(a,b){var c=this.getItemViewContainer(a);c.append(b.el)},getItemViewContainer:function(a){if("$itemViewContainer"in a)return a.$itemViewContainer;var b,d=f.getOption(a,"itemViewContainer");if(d){var g=c.isFunction(d)?d():d;b=a.$(g),b.length<=0&&e("The specified `itemViewContainer` was not found: "+a.itemViewContainer,"ItemViewContainerMissingError")}else b=a.$el;return a.$itemViewContainer=b,b},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),f.Layout=f.ItemView.extend({regionType:f.Region,constructor:function(a){a=a||{},this._firstRender=!0,this._initializeRegions(a),f.ItemView.prototype.constructor.call(this,a)},render:function(){this.isClosed&&this._initializeRegions(),this._firstRender?this._firstRender=!1:this.isClosed||this._reInitializeRegions();var a=Array.prototype.slice.apply(arguments),b=f.ItemView.prototype.render.apply(this,a);return b},close:function(){if(!this.isClosed){this.regionManager.close();var a=Array.prototype.slice.apply(arguments);f.ItemView.prototype.close.apply(this,a)}},addRegion:function(a,b){var c={};return c[a]=b,this._buildRegions(c)[a]},addRegions:function(a){return this.regions=c.extend({},this.regions,a),this._buildRegions(a)},removeRegion:function(a){return delete this.regions[a],this.regionManager.removeRegion(a)},_buildRegions:function(a){var b=this,c={regionType:f.getOption(this,"regionType"),parentEl:function(){return b.$el}};return this.regionManager.addRegions(a,c)},_initializeRegions:function(a){var b;this._initRegionManager(),b=c.isFunction(this.regions)?this.regions(a):this.regions||{},this.addRegions(b)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(a){a.reset()})},_initRegionManager:function(){this.regionManager=new f.RegionManager,this.listenTo(this.regionManager,"region:add",function(a,b){this[a]=b,this.trigger("region:add",a,b)}),this.listenTo(this.regionManager,"region:remove",function(a,b){delete this[a],this.trigger("region:remove",a,b)})}}),f.AppRouter=b.Router.extend({constructor:function(a){b.Router.prototype.constructor.apply(this,d(arguments)),this.options=a||{};var c=f.getOption(this,"appRoutes"),e=this._getController();this.processAppRoutes(e,c)},appRoute:function(a,b){var c=this._getController();this._addAppRoute(c,a,b)},processAppRoutes:function(a,b){if(b){var d=c.keys(b).reverse();c.each(d,function(c){this._addAppRoute(a,c,b[c])},this)}},_getController:function(){return f.getOption(this,"controller")},_addAppRoute:function(a,b,d){var e=a[d];if(!e)throw new Error("Method '"+d+"' was not found on the controller");this.route(b,d,c.bind(e,a))}}),f.Application=function(a){this._initRegionManager(),this._initCallbacks=new f.Callbacks,this.vent=new b.Wreqr.EventAggregator,this.commands=new b.Wreqr.Commands,this.reqres=new b.Wreqr.RequestResponse,this.submodules={},c.extend(this,a),this.triggerMethod=f.triggerMethod},c.extend(f.Application.prototype,b.Events,{execute:function(){var a=Array.prototype.slice.apply(arguments);this.commands.execute.apply(this.commands,a)},request:function(){var a=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,a)},addInitializer:function(a){this._initCallbacks.add(a)},start:function(a){this.triggerMethod("initialize:before",a),this._initCallbacks.run(a,this),this.triggerMethod("initialize:after",a),this.triggerMethod("start",a)},addRegions:function(a){return this._regionManager.addRegions(a)},closeRegions:function(){this._regionManager.closeRegions()},removeRegion:function(a){this._regionManager.removeRegion(a)},getRegion:function(a){return this._regionManager.get(a)},module:function(){var a=d(arguments);return a.unshift(this),f.Module.create.apply(f.Module,a)},_initRegionManager:function(){this._regionManager=new f.RegionManager,this.listenTo(this._regionManager,"region:add",function(a,b){this[a]=b}),this.listenTo(this._regionManager,"region:remove",function(a){delete this[a]})}}),f.Application.extend=f.extend,f.Module=function(a,b){this.moduleName=a,this.submodules={},this._setupInitializersAndFinalizers(),this.app=b,this.startWithParent=!0,this.triggerMethod=f.triggerMethod},c.extend(f.Module.prototype,b.Events,{addInitializer:function(a){this._initializerCallbacks.add(a)},addFinalizer:function(a){this._finalizerCallbacks.add(a)},start:function(a){this._isInitialized||(c.each(this.submodules,function(b){b.startWithParent&&b.start(a)}),this.triggerMethod("before:start",a),this._initializerCallbacks.run(a,this),this._isInitialized=!0,this.triggerMethod("start",a))},stop:function(){this._isInitialized&&(this._isInitialized=!1,f.triggerMethod.call(this,"before:stop"),c.each(this.submodules,function(a){a.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),f.triggerMethod.call(this,"stop"))},addDefinition:function(a,b){this._runModuleDefinition(a,b)},_runModuleDefinition:function(a,d){if(a){var e=c.flatten([this,this.app,b,f,f.$,c,d]);a.apply(this,e)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new f.Callbacks,this._finalizerCallbacks=new f.Callbacks}}),c.extend(f.Module,{create:function(a,b,e){var f=a,g=d(arguments);g.splice(0,3),b=b.split(".");var h=b.length,i=[];return i[h-1]=e,c.each(b,function(b,c){var d=f;f=this._getModule(d,b,a),this._addModuleDefinition(d,f,i[c],g)},this),f},_getModule:function(a,b,c){var d=a[b];return d||(d=new f.Module(b,c),a[b]=d,a.submodules[b]=d),d},_addModuleDefinition:function(a,b,d,e){var f,g;c.isFunction(d)?(f=d,g=!0):c.isObject(d)?(f=d.define,g=d.startWithParent):g=!0,f&&b.addDefinition(f,e),b.startWithParent=b.startWithParent&&g,b.startWithParent&&!b.startWithParentIsConfigured&&(b.startWithParentIsConfigured=!0,a.addInitializer(function(a){b.startWithParent&&b.start(a)}))}}),f}(this,Backbone,_);
-//# sourceMappingURL=backbone.marionette.map
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/javascripts/third-party/require.js b/sonar-server/src/main/webapp/javascripts/third-party/require.js
new file mode 100644 (file)
index 0000000..84d1d67
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ RequireJS 2.1.10 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+var requirejs,require,define;
+(function(ca){function G(b){return"[object Function]"===N.call(b)}function H(b){return"[object Array]"===N.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function U(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function s(b,c){return ga.call(b,c)}function j(b,c){return s(b,c)&&b[c]}function B(b,c){for(var d in b)if(s(b,d)&&c(b[d],d))break}function V(b,c,d,g){c&&B(c,function(c,h){if(d||!s(b,h))g&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
+RegExp)?(b[h]||(b[h]={}),V(b[h],c,d,g)):b[h]=c});return b}function t(b,c){return function(){return c.apply(b,arguments)}}function da(b){throw b;}function ea(b){if(!b)return b;var c=ca;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=g;d&&(c.originalError=d);return c}function ha(b){function c(a,e,b){var f,n,c,d,g,h,i,I=e&&e.split("/");n=I;var m=l.map,k=m&&m["*"];if(a&&"."===a.charAt(0))if(e){n=
+I.slice(0,I.length-1);a=a.split("/");e=a.length-1;l.nodeIdCompat&&R.test(a[e])&&(a[e]=a[e].replace(R,""));n=a=n.concat(a);d=n.length;for(e=0;e<d;e++)if(c=n[e],"."===c)n.splice(e,1),e-=1;else if(".."===c)if(1===e&&(".."===n[2]||".."===n[0]))break;else 0<e&&(n.splice(e-1,2),e-=2);a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if(b&&m&&(I||k)){n=a.split("/");e=n.length;a:for(;0<e;e-=1){d=n.slice(0,e).join("/");if(I)for(c=I.length;0<c;c-=1)if(b=j(m,I.slice(0,c).join("/")))if(b=j(b,d)){f=b;
+g=e;break a}!h&&(k&&j(k,d))&&(h=j(k,d),i=e)}!f&&h&&(f=h,g=i);f&&(n.splice(0,g,f),a=n.join("/"))}return(f=j(l.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(e){if(e.getAttribute("data-requiremodule")===a&&e.getAttribute("data-requirecontext")===i.contextName)return e.parentNode.removeChild(e),!0})}function g(a){var e=j(l.paths,a);if(e&&H(e)&&1<e.length)return e.shift(),i.require.undef(a),i.require([a]),!0}function u(a){var e,b=a?a.indexOf("!"):-1;-1<b&&(e=a.substring(0,
+b),a=a.substring(b+1,a.length));return[e,a]}function m(a,e,b,f){var n,d,g=null,h=e?e.name:null,l=a,m=!0,k="";a||(m=!1,a="_@r"+(N+=1));a=u(a);g=a[0];a=a[1];g&&(g=c(g,h,f),d=j(p,g));a&&(g?k=d&&d.normalize?d.normalize(a,function(a){return c(a,h,f)}):c(a,h,f):(k=c(a,h,f),a=u(k),g=a[0],k=a[1],b=!0,n=i.nameToUrl(k)));b=g&&!d&&!b?"_unnormalized"+(Q+=1):"";return{prefix:g,name:k,parentMap:e,unnormalized:!!b,url:n,originalName:l,isDefine:m,id:(g?g+"!"+k:k)+b}}function q(a){var e=a.id,b=j(k,e);b||(b=k[e]=new i.Module(a));
+return b}function r(a,e,b){var f=a.id,n=j(k,f);if(s(p,f)&&(!n||n.defineEmitComplete))"defined"===e&&b(p[f]);else if(n=q(a),n.error&&"error"===e)b(n.error);else n.on(e,b)}function w(a,e){var b=a.requireModules,f=!1;if(e)e(a);else if(v(b,function(e){if(e=j(k,e))e.error=a,e.events.error&&(f=!0,e.emit("error",a))}),!f)h.onError(a)}function x(){S.length&&(ia.apply(A,[A.length,0].concat(S)),S=[])}function y(a){delete k[a];delete W[a]}function F(a,e,b){var f=a.map.id;a.error?a.emit("error",a.error):(e[f]=
+!0,v(a.depMaps,function(f,c){var d=f.id,g=j(k,d);g&&(!a.depMatched[c]&&!b[d])&&(j(e,d)?(a.defineDep(c,p[d]),a.check()):F(g,e,b))}),b[f]=!0)}function D(){var a,e,b=(a=1E3*l.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],c=[],h=!1,k=!0;if(!X){X=!0;B(W,function(a){var i=a.map,m=i.id;if(a.enabled&&(i.isDefine||c.push(a),!a.error))if(!a.inited&&b)g(m)?h=e=!0:(f.push(m),d(m));else if(!a.inited&&(a.fetched&&i.isDefine)&&(h=!0,!i.prefix))return k=!1});if(b&&f.length)return a=C("timeout","Load timeout for modules: "+
+f,null,f),a.contextName=i.contextName,w(a);k&&v(c,function(a){F(a,{},{})});if((!b||e)&&h)if((z||fa)&&!Y)Y=setTimeout(function(){Y=0;D()},50);X=!1}}function E(a){s(p,a[0])||q(m(a[0],null,!0)).init(a[1],a[2])}function L(a){var a=a.currentTarget||a.srcElement,e=i.onScriptLoad;a.detachEvent&&!Z?a.detachEvent("onreadystatechange",e):a.removeEventListener("load",e,!1);e=i.onScriptError;(!a.detachEvent||Z)&&a.removeEventListener("error",e,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function M(){var a;
+for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var X,$,i,K,Y,l={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},k={},W={},aa={},A=[],p={},T={},ba={},N=1,Q=1;K={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?a.exports:a.exports=p[a.map.id]={}},module:function(a){return a.module?a.module:
+a.module={id:a.map.id,uri:a.map.url,config:function(){return j(l.config,a.map.id)||{}},exports:K.exports(a)}}};$=function(a){this.events=j(aa,a.id)||{};this.map=a;this.shim=j(l.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};$.prototype={init:function(a,e,b,f){f=f||{};if(!this.inited){this.factory=e;if(b)this.on("error",b);else this.events.error&&(b=t(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=b;this.inited=
+!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,e){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=e)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],t(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
+this.map.url;T[a]||(T[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,e,b=this.map.id;e=this.depExports;var f=this.exports,c=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(c)){if(this.events.error&&this.map.isDefine||h.onError!==da)try{f=i.execCb(b,c,e,f)}catch(d){a=d}else f=i.execCb(b,c,e,f);this.map.isDefine&&void 0===f&&((e=this.module)?f=e.exports:this.usingExports&&
+(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=c;this.exports=f;if(this.map.isDefine&&!this.ignore&&(p[b]=f,h.onResourceLoad))h.onResourceLoad(i,this.map,this.depMaps);y(b);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
+this.map,b=a.id,d=m(a.prefix);this.depMaps.push(d);r(d,"defined",t(this,function(f){var d,g;g=j(ba,this.map.id);var J=this.map.name,u=this.map.parentMap?this.map.parentMap.name:null,p=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(J=f.normalize(J,function(a){return c(a,u,!0)})||""),f=m(a.prefix+"!"+J,this.map.parentMap),r(f,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),g=j(k,f.id)){this.depMaps.push(f);
+if(this.events.error)g.on("error",t(this,function(a){this.emit("error",a)}));g.enable()}}else g?(this.map.url=i.nameToUrl(g),this.load()):(d=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),d.error=t(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),d.fromText=t(this,function(f,c){var g=a.name,J=m(g),k=O;c&&(f=c);k&&(O=!1);q(J);s(l.config,b)&&(l.config[g]=l.config[b]);try{h.exec(f)}catch(j){return w(C("fromtexteval",
+"fromText eval for "+b+" failed: "+j,j,[b]))}k&&(O=!0);this.depMaps.push(J);i.completeLoad(g);p([g],d)}),f.load(a.name,p,d,l))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){W[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,t(this,function(a,b){var c,f;if("string"===typeof a){a=m(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=j(K,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;r(a,"defined",t(this,function(a){this.defineDep(b,
+a);this.check()}));this.errback&&r(a,"error",t(this,this.errback))}c=a.id;f=k[c];!s(K,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,t(this,function(a){var b=j(k,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:l,contextName:b,registry:k,defined:p,urlFetched:T,defQueue:A,Module:$,makeModuleMap:m,
+nextTick:h.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=l.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(l[b]||(l[b]={}),V(l[b],a,!0,!0)):l[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(ba[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),l.shim=b);a.packages&&v(a.packages,function(a){var b,
+a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(l.paths[b]=a.location);l.pkgs[b]=a.name+"/"+(a.main||"main").replace(ja,"").replace(R,"")});B(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=m(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ca,arguments));return b||a.exports&&ea(a.exports)}},makeRequire:function(a,e){function g(f,c,d){var j,l;e.enableBuildCallback&&(c&&G(c))&&(c.__requireJsBuild=
+!0);if("string"===typeof f){if(G(c))return w(C("requireargs","Invalid require call"),d);if(a&&s(K,f))return K[f](k[a.id]);if(h.get)return h.get(i,f,a,g);j=m(f,a,!1,!0);j=j.id;return!s(p,j)?w(C("notloaded",'Module name "'+j+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[j]}M();i.nextTick(function(){M();l=q(m(null,a));l.skipMap=e.skipMap;l.init(f,c,d,{enabled:!0});D()});return g}e=e||{};V(g,{isBrowser:z,toUrl:function(b){var e,d=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==
+d&&(!("."===g||".."===g)||1<d))e=b.substring(d,b.length),b=b.substring(0,d);return i.nameToUrl(c(b,a&&a.id,!0),e,!0)},defined:function(b){return s(p,m(b,a,!1,!0).id)},specified:function(b){b=m(b,a,!1,!0).id;return s(p,b)||s(k,b)}});a||(g.undef=function(b){x();var c=m(b,a,!0),e=j(k,b);d(b);delete p[b];delete T[c.url];delete aa[b];U(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&(aa[b]=e.events),y(b))});return g},enable:function(a){j(k,a.id)&&q(a).enable()},completeLoad:function(a){var b,
+c,f=j(l.shim,a)||{},d=f.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=j(k,a);if(!b&&!s(p,a)&&c&&!c.inited){if(l.enforceDefine&&(!d||!ea(d)))return g(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,f.deps||[],f.exportsFn])}D()},nameToUrl:function(a,b,c){var f,d,g;(f=j(l.pkgs,a))&&(a=f);if(f=j(ba,a))return i.nameToUrl(f,b,c);if(h.jsExtRegExp.test(a))f=a+(b||"");else{f=l.paths;a=a.split("/");for(d=a.length;0<d;d-=1)if(g=a.slice(0,
+d).join("/"),g=j(f,g)){H(g)&&(g=g[0]);a.splice(0,d,g);break}f=a.join("/");f+=b||(/^data\:|\?/.test(f)||c?"":".js");f=("/"===f.charAt(0)||f.match(/^[\w\+\.\-]+:/)?"":l.baseUrl)+f}return l.urlArgs?f+((-1===f.indexOf("?")?"?":"&")+l.urlArgs):f},load:function(a,b){h.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ka.test((a.currentTarget||a.srcElement).readyState))P=null,a=L(a),i.completeLoad(a.id)},onScriptError:function(a){var b=L(a);if(!g(b.id))return w(C("scripterror",
+"Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var h,x,y,D,L,E,P,M,q,Q,la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,R=/\.js$/,ja=/^\.\//;x=Object.prototype;var N=x.toString,ga=x.hasOwnProperty,ia=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),fa=!z&&"undefined"!==typeof importScripts,ka=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,
+Z="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},r={},S=[],O=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;r=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(r=require,require=void 0);h=requirejs=function(b,c,d,g){var u,m="_";!H(b)&&"string"!==typeof b&&(u=b,H(c)?(b=c,c=d,d=g):b=[]);u&&u.context&&(m=u.context);(g=j(F,m))||(g=F[m]=h.s.newContext(m));u&&g.configure(u);return g.require(b,c,d)};h.config=function(b){return h(b)};
+h.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=h);h.version="2.1.10";h.jsExtRegExp=/^\/|:|\?|\.js$/;h.isBrowser=z;x=h.s={contexts:F,newContext:ha};h({});v(["toUrl","undef","defined","specified"],function(b){h[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;h.onError=da;h.createNode=function(b){var c=
+b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};h.load=function(b,c,d){var g=b&&b.config||{};if(z)return g=h.createNode(g,c,d),g.setAttribute("data-requirecontext",b.contextName),g.setAttribute("data-requiremodule",c),g.attachEvent&&!(g.attachEvent.toString&&0>g.attachEvent.toString().indexOf("[native code"))&&!Z?(O=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):
+(g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1)),g.src=d,M=g,D?y.insertBefore(g,D):y.appendChild(g),M=null,g;if(fa)try{importScripts(d),b.completeLoad(c)}catch(j){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,j,[c]))}};z&&!r.skipDataMain&&U(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(L=b.getAttribute("data-main"))return q=L,r.baseUrl||(E=q.split("/"),q=E.pop(),Q=E.length?E.join("/")+"/":"./",r.baseUrl=
+Q),q=q.replace(R,""),h.jsExtRegExp.test(q)&&(q=L),r.deps=r.deps?r.deps.concat(q):[q],!0});define=function(b,c,d){var g,h;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(la,"").replace(ma,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(O){if(!(g=M))P&&"interactive"===P.readyState||U(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),g=P;g&&(b||
+(b=g.getAttribute("data-requiremodule")),h=F[g.getAttribute("data-requirecontext")])}(h?h.defQueue:S).push([b,c,d])};define.amd={jQuery:!0};h.exec=function(b){return eval(b)};h(r)}})(this);
diff --git a/sonar-server/src/main/webapp/javascripts/third-party/underscore-min.js b/sonar-server/src/main/webapp/javascripts/third-party/underscore-min.js
deleted file mode 100644 (file)
index f8728b3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-//     Underscore.js 1.5.2
-//     http://underscorejs.org
-//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-//     Underscore may be freely distributed under the MIT license.
-(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.2";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a<e.computed&&(e={value:n,computed:a})}),e.value},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return arguments.length<2||r?n[j.random(n.length-1)]:j.shuffle(n).slice(0,Math.max(0,t))};var k=function(n){return j.isFunction(n)?n:function(t){return t[n]}};j.sortBy=function(n,t,r){var e=k(t);return j.pluck(j.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.indexOf(t,n)>=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","  ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
diff --git a/sonar-server/src/main/webapp/javascripts/third-party/underscore.js b/sonar-server/src/main/webapp/javascripts/third-party/underscore.js
new file mode 100644 (file)
index 0000000..f8728b3
--- /dev/null
@@ -0,0 +1,5 @@
+//     Underscore.js 1.5.2
+//     http://underscorejs.org
+//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Underscore may be freely distributed under the MIT license.
+(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.2";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a<e.computed&&(e={value:n,computed:a})}),e.value},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return arguments.length<2||r?n[j.random(n.length-1)]:j.shuffle(n).slice(0,Math.max(0,t))};var k=function(n){return j.isFunction(n)?n:function(t){return t[n]}};j.sortBy=function(n,t,r){var e=k(t);return j.pluck(j.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.indexOf(t,n)>=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","  ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
index ee181e082ca7ca654d7704f2a19106de52b47b45..3395f9a23f010604baad8de481ca09d2947d037d 100644 (file)
     <js>/javascripts/third-party/jquery-ui.min.js</js>
     <js>/javascripts/third-party/jquery-ui.tabs.js</js>
     <js>/javascripts/third-party/d3.v3.min.js</js>
-    <js>/javascripts/third-party/underscore-min.js</js>
-    <js>/javascripts/third-party/backbone-min.js</js>
-    <js>/javascripts/third-party/backbone.marionette.min.js</js>
-    <js>/javascripts/third-party/handlebars.js</js>
+    <js>/javascripts/third-party/underscore.js</js>
     <js>/javascripts/third-party/jquery.ba-throttle-debounce.min.js</js>
     <js>/javascripts/third-party/select2.min.js</js>
 
     <js>/javascripts/widgets/pie-chart.js</js>
     <js>/javascripts/widgets/histogram.js</js>
     
-    <js>/javascripts/select-list.js</js>
     <js>/javascripts/top-search.js</js>
     <js>/javascripts/sortable.js</js>
 
-    <js>/javascripts/navigator/handlebars-extensions.js</js>
-
-    <js>/javascripts/navigator/filters/base-filters.js</js>
-    <js>/javascripts/navigator/filters/select-filters.js</js>
-    <js>/javascripts/navigator/filters/ajax-select-filters.js</js>
-    <js>/javascripts/navigator/filters/range-filters.js</js>
-    <js>/javascripts/navigator/filters/checkbox-filters.js</js>
-    <js>/javascripts/navigator/filters/string-filters.js</js>
-    <js>/javascripts/navigator/filters/metric-filters.js</js>
-    <js>/javascripts/navigator/filters/favorite-filters.js</js>
-    <js>/javascripts/navigator/filters/more-criteria-filters.js</js>
-    <js>/javascripts/navigator/filters/context-filters.js</js>
-
-    <js>/javascripts/navigator/issues.js</js>
-    <js>/javascripts/navigator/issues-app.js</js>
-    <js>/javascripts/navigator/issues-app-old.js</js>
-    <js>/javascripts/navigator/measures-app.js</js>
-
     <js>/javascripts/application.js</js>
     <js>/javascripts/dashboard.js</js>
     <js>/javascripts/duplication.js</js>