Merge "Improving readability for Horizon top module structure"

This commit is contained in:
Jenkins 2015-07-08 00:59:58 +00:00 committed by Gerrit Code Review
commit 84aae88057
4 changed files with 42 additions and 10 deletions

View File

@ -24,7 +24,7 @@
<script type="text/javascript"> <script type="text/javascript">
/* Load angular modules extensions list before we include angular/horizon.js */ /* Load angular modules extensions list before we include angular/horizon.js */
var angularModuleExtension = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }}; var horizonPlugInModules = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }};
</script> </script>
<!-- source files --> <!-- source files -->

View File

@ -12,18 +12,50 @@
* limitations under the License. * limitations under the License.
*/ */
/*global angularModuleExtension*/ /*global horizonPlugInModules*/
(function () { (function () {
'use strict'; 'use strict';
/**
* Library modules - modules defined in third-party libraries, including
* angular's extensions.
*/
var libraryModules = [
'ngCookies'
];
/**
* Horizon's built-in modules, including modules from `framework` components
* and modules from `openstack_dashboard` application core components.
*/
var horizonBuiltInModules = [
'horizon.auth',
'hz.dashboard',
'horizon.framework',
'horizon.openstack-service-api'
];
/**
* @ngdoc overview
* @name horizon.app
* @description
*
* # horizon.app
*
* Horizon's application level module depends on modules from three
* sources:
*
* 1) Library modules.
* 2) Horizon's built-in modules.
* 3) Horizon's plug-in modules.
*/
angular angular
.module('horizon.app', [ .module('horizon.app', []
'horizon.auth', .concat(libraryModules)
'horizon.openstack-service-api', .concat(horizonBuiltInModules)
'horizon.framework', .concat(horizonPlugInModules)
'hz.dashboard', )
'ngCookies'].concat(angularModuleExtension))
.constant('horizon.app.conf', { .constant('horizon.app.conf', {
// Placeholders; updated by Django. // Placeholders; updated by Django.

View File

@ -19,7 +19,7 @@
horizon.datepickerLocale = '{{ DATEPICKER_LOCALE }}'; horizon.datepickerLocale = '{{ DATEPICKER_LOCALE }}';
/* Load angular modules extensions list before we include angular/horizon.js */ /* Load angular modules extensions list before we include angular/horizon.js */
var angularModuleExtension = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }}; var horizonPlugInModules = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }};
</script> </script>
{% compress js %} {% compress js %}

View File

@ -4,7 +4,7 @@
* Taken from default i18n file provided by Django. * Taken from default i18n file provided by Django.
*/ */
var angularModuleExtension = []; var horizonPlugInModules = [];
(function (globals) { (function (globals) {