diff --git a/horizon/static/horizon/js/angular/horizon.conf.js b/horizon/static/horizon/js/angular/horizon.conf.js new file mode 100644 index 0000000000..1fa60361f0 --- /dev/null +++ b/horizon/static/horizon/js/angular/horizon.conf.js @@ -0,0 +1,45 @@ +/*global angular*/ +(function () { + 'use strict'; + angular.module('hz.conf', []) + .constant('hzConfig', { + // Placeholders; updated by Django. + debug: null, // + static_url: null, + ajax: { + queue_limit: null + }, + + // Config options which may be overridden. + spinner_options: { + inline: { + lines: 10, + length: 5, + width: 2, + radius: 3, + color: '#000', + speed: 0.8, + trail: 50, + zIndex: 100 + }, + modal: { + lines: 10, + length: 15, + width: 4, + radius: 10, + color: '#000', + speed: 0.8, + trail: 50 + }, + line_chart: { + lines: 10, + length: 15, + width: 4, + radius: 11, + color: '#000', + speed: 0.8, + trail: 50 + } + } + }); +}()); diff --git a/horizon/static/horizon/js/angular/horizon.js b/horizon/static/horizon/js/angular/horizon.js index e130d64c58..e81feebae5 100644 --- a/horizon/static/horizon/js/angular/horizon.js +++ b/horizon/static/horizon/js/angular/horizon.js @@ -1,6 +1,5 @@ -var horizonApp = angular.module('horizonApp', []) - .config(function($interpolateProvider) { +var horizonApp = angular.module('hz', ['hz.conf']) + .config(['$interpolateProvider', function ($interpolateProvider) { $interpolateProvider.startSymbol('{$'); $interpolateProvider.endSymbol('$}'); - }) - .constant('horizon', horizon); + }]); diff --git a/horizon/static/horizon/js/horizon.conf.js b/horizon/static/horizon/js/horizon.conf.js deleted file mode 100644 index 5069339969..0000000000 --- a/horizon/static/horizon/js/horizon.conf.js +++ /dev/null @@ -1,40 +0,0 @@ -horizon.conf = { - // Placeholders; updated by Django. - debug: null, // - static_url: null, - ajax: { - queue_limit: null - }, - - // Config options which may be overridden. - spinner_options: { - inline: { - lines: 10, - length: 5, - width: 2, - radius: 3, - color: '#000', - speed: 0.8, - trail: 50, - zIndex: 100 - }, - modal: { - lines: 10, - length: 15, - width: 4, - radius: 10, - color: '#000', - speed: 0.8, - trail: 50 - }, - line_chart: { - lines: 10, - length: 15, - width: 4, - radius: 11, - color: '#000', - speed: 0.8, - trail: 50 - } - } -}; diff --git a/horizon/static/horizon/js/horizon.utils.js b/horizon/static/horizon/js/horizon.utils.js index 0619e88fa0..58f31e576e 100644 --- a/horizon/static/horizon/js/horizon.utils.js +++ b/horizon/static/horizon/js/horizon.utils.js @@ -43,7 +43,7 @@ horizon.utils = { }, loadAngular: function (element) { - angular.injector(['ng', 'horizonApp']). + angular.injector(['ng', 'hz']). invoke(['$rootScope', '$compile', function ($rootScope, $compile) { try { $compile(element)($rootScope); diff --git a/horizon/templates/base.html b/horizon/templates/base.html index 7fe399ba00..873b85bcad 100644 --- a/horizon/templates/base.html +++ b/horizon/templates/base.html @@ -13,7 +13,7 @@ {% include "horizon/client_side/_script_loader.html" %} {% include "horizon/_custom_head_js.html" %} - + {% block content %}
{% block sidebar %} diff --git a/horizon/templates/horizon/_conf.html b/horizon/templates/horizon/_conf.html index d577f1f742..d6f23439eb 100644 --- a/horizon/templates/horizon/_conf.html +++ b/horizon/templates/horizon/_conf.html @@ -1,21 +1,35 @@ {% load compress %} {% compress js %} + + + + + - + {% endcompress %} diff --git a/horizon/templates/horizon/_scripts.html b/horizon/templates/horizon/_scripts.html index 9d7d1aa2a1..9e49a17266 100644 --- a/horizon/templates/horizon/_scripts.html +++ b/horizon/templates/horizon/_scripts.html @@ -6,12 +6,9 @@ {% comment %} Compress jQuery, Angular, Plugins, Bootstrap, Hogan.js and Horizon-specific JS. {% endcomment %} {% compress js %} - - - - +