diff --git a/.gitignore b/.gitignore index d15004e50..f25a6a863 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,8 @@ npm-debug.log node_modules components css +js build -dist .htmlhintrc diff --git a/apps/st2-actions/actions.config.js b/apps/st2-actions/actions.config.js index e5d8cf32c..d3e551257 100644 --- a/apps/st2-actions/actions.config.js +++ b/apps/st2-actions/actions.config.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2ActionsConfig($stateProvider) { $stateProvider .state('actions', { @@ -7,7 +9,7 @@ module.exports = function st2ActionsConfig($stateProvider) { url: '/actions', icon: 'st2-icon__actions', controller: 'st2ActionsCtrl', - templateUrl: 'apps/st2-actions/template.html', + templateUrl: template, title: 'Actions', position: 2 }) diff --git a/apps/st2-actions/index.js b/apps/st2-actions/index.js index a230fa6d1..f73216a01 100644 --- a/apps/st2-actions/index.js +++ b/apps/st2-actions/index.js @@ -1,12 +1,13 @@ 'use strict'; +var mod = module.exports = angular.module('main.apps.st2Actions', [ + +]); + var controller = require('./actions.controller.js'); var config = require('./actions.config.js'); -module.exports = angular - .module('main.apps.st2Actions', [ - - ]) +mod .config(config) .controller(controller.name, controller) ; diff --git a/apps/st2-history/history.config.js b/apps/st2-history/history.config.js index 29c7ebe40..7a98a0607 100644 --- a/apps/st2-history/history.config.js +++ b/apps/st2-history/history.config.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2HistoryConfig($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/history'); @@ -9,7 +11,7 @@ module.exports = function st2HistoryConfig($stateProvider, $urlRouterProvider) { url: '/history', icon: 'st2-icon__history', controller: 'st2HistoryCtrl', - templateUrl: 'apps/st2-history/template.html', + templateUrl: template, title: 'History', position: 1 }) diff --git a/apps/st2-history/index.js b/apps/st2-history/index.js index 66fc7a377..44cf86ac9 100644 --- a/apps/st2-history/index.js +++ b/apps/st2-history/index.js @@ -1,14 +1,15 @@ 'use strict'; +var mod = module.exports = angular.module('main.apps.st2History', [ + +]); + var controller = require('./history.controller.js'); var config = require('./history.config.js'); var fmtParam = require('./fmt-param.filter.js'); var isExpandable = require('./is-expandable.filter.js'); -module.exports = angular - .module('main.apps.st2History', [ - - ]) +mod .config(config) .controller(controller.name, controller) .filter(fmtParam.name, fmtParam) diff --git a/apps/st2-login/index.js b/apps/st2-login/index.js index 90b05d05a..5e5b0acf6 100644 --- a/apps/st2-login/index.js +++ b/apps/st2-login/index.js @@ -1,13 +1,14 @@ 'use strict'; +var mod = module.exports = angular.module('main.apps.st2Login', [ + +]); + var controller = require('./login.controller.js'); var config = require('./login.config.js'); var run = require('./login.run.js'); -module.exports = angular - .module('main.apps.st2Login', [ - - ]) +mod .config(config) .controller(controller.name, controller) .run(run) diff --git a/apps/st2-login/login.config.js b/apps/st2-login/login.config.js index 2b350600c..8a6019d36 100644 --- a/apps/st2-login/login.config.js +++ b/apps/st2-login/login.config.js @@ -1,11 +1,13 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2LoginConfig($stateProvider, $urlRouterProvider) { $stateProvider .state('login', { controller: 'st2LoginCtrl', - templateUrl: 'apps/st2-login/template.html' + templateUrl: template }) ; diff --git a/apps/st2-rules/index.js b/apps/st2-rules/index.js index bfd1ce8d1..936ea9bb6 100644 --- a/apps/st2-rules/index.js +++ b/apps/st2-rules/index.js @@ -1,13 +1,14 @@ 'use strict'; +var mod = module.exports = angular.module('main.apps.st2Rules', [ + +]); + var controller = require('./rules.controller.js'); var config = require('./rules.config.js'); var run = require('./rules.run.js'); -module.exports = angular - .module('main.apps.st2Rules', [ - - ]) +mod .config(config) .controller(controller.name, controller) .run(run) diff --git a/apps/st2-rules/rules.config.js b/apps/st2-rules/rules.config.js index 62020b3c4..8451de00b 100644 --- a/apps/st2-rules/rules.config.js +++ b/apps/st2-rules/rules.config.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2RulesConfig($stateProvider) { $stateProvider @@ -8,7 +10,7 @@ module.exports = function st2RulesConfig($stateProvider) { url: '/rules', icon: 'st2-icon__rules', controller: 'st2RulesCtrl', - templateUrl: 'apps/st2-rules/template.html', + templateUrl: template, title: 'Rules', position: 3 }) diff --git a/gulpfile.js b/gulpfile.js index 7eab57564..1e5edf93d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -87,6 +87,7 @@ function bundle() { b .transform(require('ngify'), { moduleTemplate: ';', + htmlTemplate: 'module.exports = __dirname + \'/\' + \'{htmlName}\'; angular.module(require(\'.\').name).run([\'$templateCache\', function($templateCache){$templateCache.put(module.exports,\'{html}\')}]); var ignore = { module: {} }; ignore.', jsTemplates: { provider: 'module.exports.$inject = [ {inject} ];', factory: 'module.exports.$inject = [ {inject} ];', @@ -123,7 +124,7 @@ function bundle() { .pipe(header('/* ' + buildHeader() + ' */')) .pipe(sourcemaps.init({ loadMaps: true })) .pipe(sourcemaps.write('./')) - .pipe(gulp.dest('dist/')) + .pipe(gulp.dest('js/')) .pipe(size({ showFiles: true })) diff --git a/index.html b/index.html index 8754aa4ef..db116ef4b 100644 --- a/index.html +++ b/index.html @@ -24,12 +24,8 @@ - - - - - + diff --git a/main.js b/main.js index 14987ee9b..e7e68d9ac 100644 --- a/main.js +++ b/main.js @@ -7,7 +7,6 @@ angular require('angular-ui-router'), require('angular-moment') && 'angularMoment', require('angular-sanitize'), - require('angular-busy') && 'cgBusy', require('angular-ui-notification'), // modules require('./modules/st2-action-reporter').name, @@ -21,6 +20,7 @@ angular require('./modules/st2-history-child').name, require('./modules/st2-label').name, require('./modules/st2-menu').name, + require('./modules/st2-panel').name, require('./modules/st2-proportional').name, require('./modules/st2-remote-form').name, require('./modules/st2-report').name, @@ -28,13 +28,14 @@ angular require('./modules/st2-select-on-click').name, require('./modules/st2-value-format').name, require('./modules/st2-view').name, - + // apps require('./apps/st2-actions').name, require('./apps/st2-history').name, require('./apps/st2-login').name, require('./apps/st2-rules').name + ]); - ]) +angular.module('main') .config(function ($urlRouterProvider) { // Remove tailing slash from url before looking for state @@ -53,13 +54,6 @@ angular }); -angular.module('main') - .value('cgBusyDefaults',{ - backdrop: false, - delay: 1000, - templateUrl: 'modules/st2-panel/loader.html' - }); - angular.module('main') .controller('MainCtrl', function ($rootScope, $state, st2FlexTableService) { diff --git a/modules/st2-action-reporter/action-reporter.directive.js b/modules/st2-action-reporter/action-reporter.directive.js index 5a9bd3c16..1a97aa78d 100644 --- a/modules/st2-action-reporter/action-reporter.directive.js +++ b/modules/st2-action-reporter/action-reporter.directive.js @@ -1,32 +1,13 @@ 'use strict'; +var reporters = require('./reporters'); + module.exports = function st2ActionReporter() { - var reporters = { - 'run-local': 'run-local', - 'local-shell-cmd': 'run-local', - 'run-remote': 'run-remote', - 'remote-shell-cmd': 'run-remote', - // 'action-chain': 'action-chain', - // 'workflow': 'action-chain', - // 'mistral-v1': 'action-chain', - // 'mistral-v2': 'action-chain', - 'run-local-script': 'run-local', - 'local-shell-script': 'run-local', - 'run-remote-script': 'run-remote', - 'remote-shell-script': 'run-remote', - 'run-python': 'run-python', - 'python-shell': 'run-python', - // 'http-runner': 'http' - 'cloudslang': 'run-local' - }; - var linker = function (scope) { // Partial router scope.getReporter = function (runner) { - var template = 'modules/st2-action-reporter/reporters/{{ name }}.html'; - - return template.split('{{ name }}').join(reporters[runner] || 'debug'); + return reporters[runner] || reporters['debug']; }; scope.getTraceback = function (result) { diff --git a/modules/st2-action-reporter/index.js b/modules/st2-action-reporter/index.js index 35f4e2f51..4911672b6 100644 --- a/modules/st2-action-reporter/index.js +++ b/modules/st2-action-reporter/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2ActionReporter', []); + var directive = require('./action-reporter.directive.js'); -module.exports = angular.module('main.modules.st2ActionReporter', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-action-reporter/reporters/index.js b/modules/st2-action-reporter/reporters/index.js new file mode 100644 index 000000000..5777d428d --- /dev/null +++ b/modules/st2-action-reporter/reporters/index.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = { + name: require('..').name +}; + +module.exports = { + 'debug': require('./debug.html'), + 'run-local': require('./run-local.html'), + 'local-shell-cmd': require('./run-local.html'), + 'run-remote': require('./run-remote.html'), + 'remote-shell-cmd': require('./run-remote.html'), + // 'action-chain': 'action-chain', + // 'workflow': 'action-chain', + // 'mistral-v1': 'action-chain', + // 'mistral-v2': 'action-chain', + 'run-local-script': require('./run-local.html'), + 'local-shell-script': require('./run-local.html'), + 'run-remote-script': require('./run-remote.html'), + 'remote-shell-script': require('./run-remote.html'), + 'run-python': require('./run-python.html'), + 'python-shell': require('./run-python.html'), + // 'http-runner': 'http' + 'cloudslang': require('./run-local.html') +}; diff --git a/modules/st2-api/index.js b/modules/st2-api/index.js index 54a5489bd..3553910a3 100644 --- a/modules/st2-api/index.js +++ b/modules/st2-api/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2api', []); + var service = require('./api.service.js'); -module.exports = angular.module('main.modules.st2api', []) +mod .service(service.name, service) ; diff --git a/modules/st2-auto-form/auto-form.directive.js b/modules/st2-auto-form/auto-form.directive.js index 9a7459a7b..75cf86c8d 100644 --- a/modules/st2-auto-form/auto-form.directive.js +++ b/modules/st2-auto-form/auto-form.directive.js @@ -3,6 +3,8 @@ var _ = require('lodash') ; +var template = require('./template.html'); + module.exports = function st2AutoForm($templateRequest, $compile) { // TODO: figure out what other fields do we need. @@ -25,7 +27,7 @@ module.exports = }[type]; }; - var pTemplate = $templateRequest('modules/st2-auto-form/template.html'); + var pTemplate = $templateRequest(template); return { restrict: 'C', diff --git a/modules/st2-auto-form/index.js b/modules/st2-auto-form/index.js index 9cb516fc2..2eaa5c78e 100644 --- a/modules/st2-auto-form/index.js +++ b/modules/st2-auto-form/index.js @@ -1,17 +1,18 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm', [ + require('./modules/st2-form-array').name, + require('./modules/st2-form-checkbox').name, + require('./modules/st2-form-combobox').name, + require('./modules/st2-form-input').name, + require('./modules/st2-form-object').name, + require('./modules/st2-form-select').name, + require('./modules/st2-form-text').name, + require('./modules/st2-form-text-field').name +]); + var directive = require('./auto-form.directive.js'); -module.exports = angular - .module('main.modules.st2AutoForm', [ - require('./modules/st2-form-array').name, - require('./modules/st2-form-checkbox').name, - require('./modules/st2-form-combobox').name, - require('./modules/st2-form-input').name, - require('./modules/st2-form-object').name, - require('./modules/st2-form-select').name, - require('./modules/st2-form-text').name, - require('./modules/st2-form-text-field').name - ]) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-auto-form/modules/st2-form-array/form-array.directive.js b/modules/st2-auto-form/modules/st2-form-array/form-array.directive.js index c53004f21..a12e25d02 100644 --- a/modules/st2-auto-form/modules/st2-form-array/form-array.directive.js +++ b/modules/st2-auto-form/modules/st2-form-array/form-array.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2FormArray() { return { @@ -11,7 +13,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-array/template.html', + templateUrl: template, link: function (scope, element, attrs, ctrl) { scope.name = ctrl.$name; } diff --git a/modules/st2-auto-form/modules/st2-form-array/index.js b/modules/st2-auto-form/modules/st2-form-array/index.js index fd4841e53..be64a77b1 100644 --- a/modules/st2-auto-form/modules/st2-form-array/index.js +++ b/modules/st2-auto-form/modules/st2-form-array/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormArray', []); + var directive = require('./form-array.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormArray', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-auto-form/modules/st2-form-checkbox/form-checkbox.directive.js b/modules/st2-auto-form/modules/st2-form-checkbox/form-checkbox.directive.js index bf1a2f0ed..ec53715af 100644 --- a/modules/st2-auto-form/modules/st2-form-checkbox/form-checkbox.directive.js +++ b/modules/st2-auto-form/modules/st2-form-checkbox/form-checkbox.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2FormCheckbox() { return { @@ -11,7 +13,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-checkbox/template.html', + templateUrl: template, link: function (scope, element, attrs, ctrl) { scope.name = ctrl.$name; } diff --git a/modules/st2-auto-form/modules/st2-form-checkbox/index.js b/modules/st2-auto-form/modules/st2-form-checkbox/index.js index ea7516979..5e45771c4 100644 --- a/modules/st2-auto-form/modules/st2-form-checkbox/index.js +++ b/modules/st2-auto-form/modules/st2-form-checkbox/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormCheckbox', []); + var directive = require('./form-checkbox.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormCheckbox', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-auto-form/modules/st2-form-combobox/form-combobox.directive.js b/modules/st2-auto-form/modules/st2-form-combobox/form-combobox.directive.js index 10671ad16..e57ea25ad 100644 --- a/modules/st2-auto-form/modules/st2-form-combobox/form-combobox.directive.js +++ b/modules/st2-auto-form/modules/st2-form-combobox/form-combobox.directive.js @@ -3,6 +3,8 @@ var _ = require('lodash') ; +var template = require('./template.html'); + module.exports = function st2FormCombobox($timeout) { return { @@ -14,7 +16,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-combobox/template.html', + templateUrl: template, link: function (scope, element, attrs, ctrl) { scope.name = ctrl.$name; diff --git a/modules/st2-auto-form/modules/st2-form-combobox/index.js b/modules/st2-auto-form/modules/st2-form-combobox/index.js index 7eb1f2f52..6e7aaabe5 100644 --- a/modules/st2-auto-form/modules/st2-form-combobox/index.js +++ b/modules/st2-auto-form/modules/st2-form-combobox/index.js @@ -1,9 +1,11 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormCombobox', []); + var directive = require('./form-combobox.directive.js'); var suggestions = require('./suggestions.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormCombobox', []) +mod .directive(directive.name, directive) .directive(suggestions.name, suggestions) ; diff --git a/modules/st2-auto-form/modules/st2-form-input/form-input.directive.js b/modules/st2-auto-form/modules/st2-form-input/form-input.directive.js index 33f858ed0..cae5c6cd3 100644 --- a/modules/st2-auto-form/modules/st2-form-input/form-input.directive.js +++ b/modules/st2-auto-form/modules/st2-form-input/form-input.directive.js @@ -3,6 +3,8 @@ var _ = require('lodash') ; +var template = require('./template.html'); + module.exports = function st2FormInput() { return { @@ -14,7 +16,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-input/template.html', + templateUrl: template, link: function (scope, element, attrs, ctrls) { var ctrl = ctrls[0]; var form = ctrls[1]; diff --git a/modules/st2-auto-form/modules/st2-form-input/index.js b/modules/st2-auto-form/modules/st2-form-input/index.js index 903349160..bd53bc499 100644 --- a/modules/st2-auto-form/modules/st2-form-input/index.js +++ b/modules/st2-auto-form/modules/st2-form-input/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormInput', []); + var directive = require('./form-input.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormInput', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-auto-form/modules/st2-form-object/form-object.directive.js b/modules/st2-auto-form/modules/st2-form-object/form-object.directive.js index 4e5c68afc..793744582 100644 --- a/modules/st2-auto-form/modules/st2-form-object/form-object.directive.js +++ b/modules/st2-auto-form/modules/st2-form-object/form-object.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2FormObject() { return { @@ -11,7 +13,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-object/template.html', + templateUrl: template, link: function (scope, element, attrs, ctrls) { var ctrl = ctrls[0]; var form = ctrls[1]; diff --git a/modules/st2-auto-form/modules/st2-form-object/index.js b/modules/st2-auto-form/modules/st2-form-object/index.js index 6fef0b5ea..2148a35c3 100644 --- a/modules/st2-auto-form/modules/st2-form-object/index.js +++ b/modules/st2-auto-form/modules/st2-form-object/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormObject', []); + var directive = require('./form-object.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormObject', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-auto-form/modules/st2-form-select/form-select.directive.js b/modules/st2-auto-form/modules/st2-form-select/form-select.directive.js index 8ff2002cd..e502a1118 100644 --- a/modules/st2-auto-form/modules/st2-form-select/form-select.directive.js +++ b/modules/st2-auto-form/modules/st2-form-select/form-select.directive.js @@ -3,6 +3,8 @@ var _ = require('lodash') ; +var template = require('./template.html'); + module.exports = function st2FormSelect() { return { @@ -14,7 +16,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-select/template.html', + templateUrl: template, link: function (scope, element, attrs, ctrl) { scope.name = ctrl.$name; diff --git a/modules/st2-auto-form/modules/st2-form-select/index.js b/modules/st2-auto-form/modules/st2-form-select/index.js index c73b30687..df18bf876 100644 --- a/modules/st2-auto-form/modules/st2-form-select/index.js +++ b/modules/st2-auto-form/modules/st2-form-select/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormSelect', []); + var directive = require('./form-select.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormSelect', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-auto-form/modules/st2-form-text-field/form-text-field.directive.js b/modules/st2-auto-form/modules/st2-form-text-field/form-text-field.directive.js index 3e2bbb3ff..b3d730ec6 100644 --- a/modules/st2-auto-form/modules/st2-form-text-field/form-text-field.directive.js +++ b/modules/st2-auto-form/modules/st2-form-text-field/form-text-field.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2FormTextField() { var minRows = 1 @@ -15,7 +17,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-text-field/template.html', + templateUrl: template, link: function (scope, $element, attrs, ctrl) { var field = $element[0].querySelector('.st2-auto-form__field'); var computed = window.getComputedStyle(field); diff --git a/modules/st2-auto-form/modules/st2-form-text-field/index.js b/modules/st2-auto-form/modules/st2-form-text-field/index.js index 2ffac13e0..fbaefcabe 100644 --- a/modules/st2-auto-form/modules/st2-form-text-field/index.js +++ b/modules/st2-auto-form/modules/st2-form-text-field/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormTextField', []); + var directive = require('./form-text-field.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormTextField', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-auto-form/modules/st2-form-text/form-text.directive.js b/modules/st2-auto-form/modules/st2-form-text/form-text.directive.js index 1c08081f9..d40881711 100644 --- a/modules/st2-auto-form/modules/st2-form-text/form-text.directive.js +++ b/modules/st2-auto-form/modules/st2-form-text/form-text.directive.js @@ -3,6 +3,8 @@ var _ = require('lodash') ; +var template = require('./template.html'); + module.exports = function st2FormText() { var showLabel = function() { @@ -26,7 +28,7 @@ module.exports = 'ngModel': '=', 'disabled': '=' }, - templateUrl: 'modules/st2-auto-form/modules/st2-form-text/template.html', + templateUrl: template, link: function (scope, element, attrs, ctrl) { scope.name = ctrl.$name; scope.showLabel = showLabel(scope.name); diff --git a/modules/st2-auto-form/modules/st2-form-text/index.js b/modules/st2-auto-form/modules/st2-form-text/index.js index d5f6d5a5b..3dd31449b 100644 --- a/modules/st2-auto-form/modules/st2-form-text/index.js +++ b/modules/st2-auto-form/modules/st2-form-text/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2AutoForm.st2FormText', []); + var directive = require('./form-text.directive.js'); -module.exports = angular.module('main.modules.st2AutoForm.st2FormText', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-criteria/criteria.directive.js b/modules/st2-criteria/criteria.directive.js index ace3adac9..a52d3ae28 100644 --- a/modules/st2-criteria/criteria.directive.js +++ b/modules/st2-criteria/criteria.directive.js @@ -3,6 +3,8 @@ var _ = require('lodash') ; +var template = require('./template.html'); + module.exports = function st2Criteria() { @@ -14,7 +16,7 @@ module.exports = disabled: '=', trigger: '=' }, - templateUrl: 'modules/st2-criteria/template.html', + templateUrl: template, link: function postLink(scope, element, attrs, ctrl) { scope.ngModel = scope.ngModel || {}; diff --git a/modules/st2-criteria/index.js b/modules/st2-criteria/index.js index f92f865b6..3bcd4ee84 100644 --- a/modules/st2-criteria/index.js +++ b/modules/st2-criteria/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Criteria', []); + var directive = require('./criteria.directive.js'); -module.exports = angular.module('main.modules.st2Criteria', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-filter/filter.directive.js b/modules/st2-filter/filter.directive.js index acbce4b78..65ce16a22 100644 --- a/modules/st2-filter/filter.directive.js +++ b/modules/st2-filter/filter.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2Filter($parse) { @@ -11,7 +13,7 @@ module.exports = items: '=', activeItemsSrc: '=activeItems' }, - templateUrl: 'modules/st2-filter/template.html', + templateUrl: template, link: function postLink(scope, element, attrs) { var onChange = $parse(attrs.onChange); var listElement = element[0].getElementsByClassName('st2-filter__list')[0]; diff --git a/modules/st2-filter/index.js b/modules/st2-filter/index.js index ca33a99df..abe855695 100644 --- a/modules/st2-filter/index.js +++ b/modules/st2-filter/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Filter', []); + var directive = require('./filter.directive.js'); -module.exports = angular.module('main.modules.st2Filter', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-flex-table/index.js b/modules/st2-flex-table/index.js index e2c35a338..486334508 100644 --- a/modules/st2-flex-table/index.js +++ b/modules/st2-flex-table/index.js @@ -1,9 +1,11 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2FlexTable', []); + var directive = require('./flex-table.directive.js'); var service = require('./flex-table.service.js'); -module.exports = angular.module('main.modules.st2FlexTable', []) +mod .directive(directive.name, directive) .service(service.name, service) ; diff --git a/modules/st2-flow/flow.directive.js b/modules/st2-flow/flow.directive.js index 29d3f75dc..c334de923 100644 --- a/modules/st2-flow/flow.directive.js +++ b/modules/st2-flow/flow.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function flowLink(st2api, st2Config) { @@ -30,7 +32,7 @@ module.exports = element.remove(); } }, - templateUrl: 'modules/st2-flow/template.html' + templateUrl: template }; }; diff --git a/modules/st2-flow/index.js b/modules/st2-flow/index.js index c26b48fa6..238c81290 100644 --- a/modules/st2-flow/index.js +++ b/modules/st2-flow/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Flow', []); + var directive = require('./flow.directive.js'); -module.exports = angular.module('main.modules.st2Flow', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-highlight/highlight.directive.js b/modules/st2-highlight/highlight.directive.js index fdb237b16..2da21b23a 100644 --- a/modules/st2-highlight/highlight.directive.js +++ b/modules/st2-highlight/highlight.directive.js @@ -10,6 +10,8 @@ require('prismjs/components/prism-powershell'); require('prismjs/components/prism-python'); require('prismjs/components/prism-json'); +var template = require('./template.html'); + module.exports = function st2Highlight($filter) { @@ -106,7 +108,7 @@ module.exports = lines: '@', language: '@' }, - templateUrl: 'modules/st2-highlight/template.html', + templateUrl: template, link: postLink }; diff --git a/modules/st2-highlight/index.js b/modules/st2-highlight/index.js index c73815ae1..f22dc9953 100644 --- a/modules/st2-highlight/index.js +++ b/modules/st2-highlight/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Highlight', []); + var directive = require('./highlight.directive.js'); -module.exports = angular.module('main.modules.st2Highlight', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-history-child/history-child.directive.js b/modules/st2-history-child/history-child.directive.js index e8e9022c0..3f339f89f 100644 --- a/modules/st2-history-child/history-child.directive.js +++ b/modules/st2-history-child/history-child.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2HistoryChild(st2api) { @@ -9,7 +11,7 @@ module.exports = 'workflow': '=', 'view': '=' }, - template: '
', + template: '
', link: function postLink(scope) { scope.getTaskName = function (record) { return { diff --git a/modules/st2-history-child/index.js b/modules/st2-history-child/index.js index cfad24b4b..682638abf 100644 --- a/modules/st2-history-child/index.js +++ b/modules/st2-history-child/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2HistoryChild', []); + var directive = require('./history-child.directive.js'); -module.exports = angular.module('main.modules.st2HistoryChild', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-label/index.js b/modules/st2-label/index.js index 7a457d5df..5c0ae58d5 100644 --- a/modules/st2-label/index.js +++ b/modules/st2-label/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Label', []); + var directive = require('./label.directive.js'); -module.exports = angular.module('main.modules.st2Label', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-label/label.directive.js b/modules/st2-label/label.directive.js index 29e2a5e1c..6d9ab9d49 100644 --- a/modules/st2-label/label.directive.js +++ b/modules/st2-label/label.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2Label() { @@ -36,7 +38,7 @@ module.exports = scope: { 'status': '=' }, - templateUrl: 'modules/st2-label/template.html', + templateUrl: template, link: function postLink(scope, element) { scope.$watch('status', function (current, previous) { scope.state = states[scope.status] || {}; diff --git a/modules/st2-menu/index.js b/modules/st2-menu/index.js index 2da74d426..de99be222 100644 --- a/modules/st2-menu/index.js +++ b/modules/st2-menu/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Menu', []); + var directive = require('./menu.directive.js'); -module.exports = angular.module('main.modules.st2Menu', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-menu/menu.directive.js b/modules/st2-menu/menu.directive.js index 1d7d56169..7f6e403b7 100644 --- a/modules/st2-menu/menu.directive.js +++ b/modules/st2-menu/menu.directive.js @@ -1,12 +1,14 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2Menu($window, st2api) { return { restrict: 'C', scope: true, - templateUrl: 'modules/st2-menu/template.html', + templateUrl: template, link: function postLink(scope) { scope.isMain = function (e) { return !!e.title; diff --git a/modules/st2-notification/index.js b/modules/st2-notification/index.js index 0c5483af4..e3de11ccc 100644 --- a/modules/st2-notification/index.js +++ b/modules/st2-notification/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Notification', []); + var config = require('./notification.config.js'); -module.exports = angular.module('main.modules.st2Notification', []) +mod .config(config) ; diff --git a/modules/st2-notification/notification.config.js b/modules/st2-notification/notification.config.js index cb5c160ed..ebae843ce 100644 --- a/modules/st2-notification/notification.config.js +++ b/modules/st2-notification/notification.config.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2NotificationConfig($provide, NotificationProvider) { NotificationProvider.setOptions({ @@ -10,7 +12,7 @@ module.exports = horizontalSpacing: 20, positionX: 'left', positionY: 'bottom', - templateUrl: 'modules/st2-notification/template.html' + templateUrl: template }); $provide.decorator('Notification', function ($delegate) { diff --git a/modules/st2-panel/index.js b/modules/st2-panel/index.js new file mode 100644 index 000000000..4f32a5b16 --- /dev/null +++ b/modules/st2-panel/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = module.exports = angular.module('main.modules.st2Panel', [ + require('angular-busy') && 'cgBusy' +]); + +var value = require('./panel.value.js'); + +mod + .value(value.name, value) + ; diff --git a/modules/st2-panel/panel.value.js b/modules/st2-panel/panel.value.js new file mode 100644 index 000000000..f5464f797 --- /dev/null +++ b/modules/st2-panel/panel.value.js @@ -0,0 +1,11 @@ +'use strict'; + +var template = require('./loader.html'); + +module.exports = { + backdrop: false, + delay: 1000, + templateUrl: template +}; + +module.exports.name = 'cgBusyDefaults'; diff --git a/modules/st2-proportional/index.js b/modules/st2-proportional/index.js index f5cd8ead8..9f8382c50 100644 --- a/modules/st2-proportional/index.js +++ b/modules/st2-proportional/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Proportional', []); + var directive = require('./proportional.directive.js'); -module.exports = angular.module('main.modules.st2Proportional', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-remote-form/index.js b/modules/st2-remote-form/index.js index 767606057..975258083 100644 --- a/modules/st2-remote-form/index.js +++ b/modules/st2-remote-form/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2RemoteForm', []); + var directive = require('./remote-form.directive.js'); -module.exports = angular.module('main.modules.st2RemoteForm', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-remote-form/remote-form.directive.js b/modules/st2-remote-form/remote-form.directive.js index b214a4d49..339d56472 100644 --- a/modules/st2-remote-form/remote-form.directive.js +++ b/modules/st2-remote-form/remote-form.directive.js @@ -1,5 +1,7 @@ 'use strict'; +var template = require('./template.html'); + module.exports = function st2RemoteForm() { @@ -13,7 +15,7 @@ module.exports = loader: '=', ngModel: '=' }, - templateUrl: 'modules/st2-remote-form/template.html', + templateUrl: template, link: function postLink(scope, element, attrs, ctrls) { scope.form = ctrls[1]; diff --git a/modules/st2-report/index.js b/modules/st2-report/index.js index 42b3a749b..dced168a5 100644 --- a/modules/st2-report/index.js +++ b/modules/st2-report/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2Report', []); + var directive = require('./report.directive.js'); -module.exports = angular.module('main.modules.st2Report', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-scroll-into-view/index.js b/modules/st2-scroll-into-view/index.js index 057a009d3..289d41106 100644 --- a/modules/st2-scroll-into-view/index.js +++ b/modules/st2-scroll-into-view/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2ScrollIntoView', []); + var directive = require('./scroll-into-view.directive.js'); -module.exports = angular.module('main.modules.st2ScrollIntoView', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-select-on-click/index.js b/modules/st2-select-on-click/index.js index dc544a872..4773b0cf3 100644 --- a/modules/st2-select-on-click/index.js +++ b/modules/st2-select-on-click/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.selectOnClick', []); + var directive = require('./select-on-click.directive.js'); -module.exports = angular.module('main.modules.selectOnClick', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-value-format/index.js b/modules/st2-value-format/index.js index 8892e14fc..f52058e91 100644 --- a/modules/st2-value-format/index.js +++ b/modules/st2-value-format/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2ValueFormat', []); + var directive = require('./value-format.directive.js'); -module.exports = angular.module('main.modules.st2ValueFormat', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-view/index.js b/modules/st2-view/index.js index fa60951b4..ede5bdc24 100644 --- a/modules/st2-view/index.js +++ b/modules/st2-view/index.js @@ -1,7 +1,9 @@ 'use strict'; +var mod = module.exports = angular.module('main.modules.st2View', []); + var directive = require('./view.directive.js'); -module.exports = angular.module('main.modules.st2View', []) +mod .directive(directive.name, directive) ; diff --git a/modules/st2-view/view.directive.js b/modules/st2-view/view.directive.js index 7a0157876..7ed984ce2 100644 --- a/modules/st2-view/view.directive.js +++ b/modules/st2-view/view.directive.js @@ -3,6 +3,8 @@ var _ = require('lodash') ; +var template = require('./template.html'); + module.exports = function st2View() { @@ -11,7 +13,7 @@ module.exports = scope: { viewSettings: '=' }, - templateUrl: 'modules/st2-view/template.html', + templateUrl: template, link: function postLink(scope, element) { scope.$watch('viewSettings', function (settings) { scope.viewList = _(settings).map(function (setting) {