diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-01-08 17:59:29 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-01-09 10:48:40 +0100 |
commit | 63f75c7ebacf8b9f8e508f2e3e6ce660078897d4 (patch) | |
tree | fd47a0aa834c4a9c2ea7b0c297ec221be871d788 /server/sonar-web/src/main/js/common | |
parent | c77e3c79702ca21833a2c62224e3aedadd79081f (diff) | |
download | sonarqube-63f75c7ebacf8b9f8e508f2e3e6ce660078897d4.tar.gz sonarqube-63f75c7ebacf8b9f8e508f2e3e6ce660078897d4.zip |
move some js libs to a standard distribution
Diffstat (limited to 'server/sonar-web/src/main/js/common')
-rw-r--r-- | server/sonar-web/src/main/js/common/handlebars-extensions.js | 34 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/common/modals.js | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/common/select-list.js | 15 |
3 files changed, 13 insertions, 38 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 c2754a52dbe..ddbf0671877 100644 --- a/server/sonar-web/src/main/js/common/handlebars-extensions.js +++ b/server/sonar-web/src/main/js/common/handlebars-extensions.js @@ -1,26 +1,4 @@ -/* jshint eqeqeq:false */ - -requirejs.config({ - paths: { - 'handlebars': 'third-party/handlebars' - }, - - shim: { - 'handlebars': { - exports: 'Handlebars' - } - } -}); - -define(['handlebars'], function (Handlebars) { - - /* - * Shortcut for templates retrieving - */ - window.getTemplate = function(templateSelector) { - return Handlebars.compile(jQuery(templateSelector).html() || ''); - }; - +(function () { var defaultActions = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity', 'set_tags']; Handlebars.registerHelper('log', function() { @@ -453,4 +431,12 @@ define(['handlebars'], function (Handlebars) { return component.projectName + (component.subProjectName ? (' / ' + component.subProjectName) : ''); }); -}); + Handlebars.registerHelper('repeat', function (number, options) { + var ret = ''; + for (var i = 0; i < number; i++) { + ret += options.fn(this); + } + return ret; + }); + +})(); diff --git a/server/sonar-web/src/main/js/common/modals.js b/server/sonar-web/src/main/js/common/modals.js index 9ca6cd56b1f..6886465c001 100644 --- a/server/sonar-web/src/main/js/common/modals.js +++ b/server/sonar-web/src/main/js/common/modals.js @@ -1,4 +1,4 @@ -define(['backbone.marionette'], function (Marionette) { +define(function () { var $ = jQuery, EVENT_SCOPE = 'modal'; diff --git a/server/sonar-web/src/main/js/common/select-list.js b/server/sonar-web/src/main/js/common/select-list.js index 30ca5e50a6f..7c1013c54c5 100644 --- a/server/sonar-web/src/main/js/common/select-list.js +++ b/server/sonar-web/src/main/js/common/select-list.js @@ -1,19 +1,8 @@ requirejs.config({ - baseUrl: baseUrl + '/js', - - paths: { - 'backbone': 'third-party/backbone' - }, - - shim: { - 'backbone': { - exports: 'Backbone' - } - } - + baseUrl: baseUrl + '/js' }); -requirejs(['backbone'], function (Backbone) { +requirejs(function () { (function ($) { |