summaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/common/handlebars-extensions.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-08-20 18:09:12 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-08-20 18:09:12 +0600
commitba80308af044487d736ecb66d6f7874d82d172f1 (patch)
tree06fcd3a08c0e1f7932cd9a3361c5a0c965ce2dd3 /server/sonar-web/src/main/js/common/handlebars-extensions.js
parent50ac2597d4c259096cb9af300215d1387b1cbcb6 (diff)
downloadsonarqube-ba80308af044487d736ecb66d6f7874d82d172f1.tar.gz
sonarqube-ba80308af044487d736ecb66d6f7874d82d172f1.zip
SONAR-4407 Refactor the libraries page in order to drop GWT
List the component's libraries
Diffstat (limited to 'server/sonar-web/src/main/js/common/handlebars-extensions.js')
-rw-r--r--server/sonar-web/src/main/js/common/handlebars-extensions.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/common/handlebars-extensions.js b/server/sonar-web/src/main/js/common/handlebars-extensions.js
index 36efca0ffd3..1d3d78bec50 100644
--- a/server/sonar-web/src/main/js/common/handlebars-extensions.js
+++ b/server/sonar-web/src/main/js/common/handlebars-extensions.js
@@ -21,8 +21,9 @@ define(['handlebars'], function (Handlebars) {
var defaultActions = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity'];
- Handlebars.registerHelper('log', function(variable) {
- console.log(variable);
+ Handlebars.registerHelper('log', function() {
+ var args = Array.prototype.slice.call(arguments, 0, -1);
+ console.log.apply(console, args);
});
Handlebars.registerHelper('capitalize', function(string) {
@@ -265,6 +266,21 @@ define(['handlebars'], function (Handlebars) {
}
});
+ var audaciousFn;
+ Handlebars.registerHelper('recursive', function(children, options) {
+ var out = '';
+
+ if (options.fn !== undefined) {
+ audaciousFn = options.fn;
+ }
+
+ children.forEach(function(child){
+ out = out + audaciousFn(child);
+ });
+
+ return out;
+ });
+
Handlebars.registerHelper('sources', function(source, scm, options) {
if (options == null) {
options = scm;