From: Stas Vilchik Date: Sun, 2 Mar 2014 15:14:34 +0000 (+0100) Subject: SONAR-5057 Remove Prototype.JS from SonarQube X-Git-Tag: 4.3~630 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d0475d78b833c6b2799cc26524ba59f067034780;p=sonarqube.git SONAR-5057 Remove Prototype.JS from SonarQube Use native forEach instead of prototype's each --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb index c7e410e5648..30c43cc9aa0 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb @@ -87,7 +87,7 @@ function filtersWidgetsByContent(text) { var userInput = text.toLowerCase(); - widgetContents.each(function (widget) { + widgetContents.forEach(function (widget) { var element = $j('#'+widget.id); if (element != null) { if (widget.c.indexOf(userInput) != -1) { diff --git a/sonar-server/src/main/webapp/javascripts/application.js b/sonar-server/src/main/webapp/javascripts/application.js index 318b8216d73..65fa62fce16 100644 --- a/sonar-server/src/main/webapp/javascripts/application.js +++ b/sonar-server/src/main/webapp/javascripts/application.js @@ -217,7 +217,7 @@ Treemap.prototype.currentContext = function () { Treemap.prototype.load = function () { var context = this.currentContext(); var output = ''; - this.breadcrumb.each(function (ctx) { + this.breadcrumb.forEach(function (ctx) { output += ctx.label + ' / '; }); $j('#tm-bc-' + this.id).html(output); diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js b/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js index 26257f9bb3c..02bb8e25539 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js +++ b/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js @@ -132,7 +132,7 @@ define(['backbone', 'navigator/filters/base-filters', 'navigator/filters/choice- ps: PAGE_SIZE }, success: function() { - selected.each(function(item) { + selected.forEach(function(item) { that.options.filterView.choices.unshift(item); }); _.each(that.model.get('choices'), function(v, k) {