From 515f44c2c86730912ca8d31441562d094c8ac711 Mon Sep 17 00:00:00 2001 From: Shaoquan Chen Date: Fri, 8 Jan 2016 13:15:50 -0800 Subject: [PATCH 1/4] Installing JavaScript libraries --- src/index.module.js | 6 +++++- tools/bower.json | 17 +++++++++++++++-- tools/gulpfile.js | 6 ++++++ tools/karma.conf.js | 9 ++++++++- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/index.module.js b/src/index.module.js index 1f765529a5..4b260b3dfb 100644 --- a/src/index.module.js +++ b/src/index.module.js @@ -2,10 +2,14 @@ 'use strict'; var angularModules = [ + 'ngSanitize' ]; var otherModules = [ - 'helion.framework' + 'gettext', + 'helion.framework', + 'ui.bootstrap', + 'ui.router' ]; angular diff --git a/tools/bower.json b/tools/bower.json index 5df65ed82e..42b8a716ae 100644 --- a/tools/bower.json +++ b/tools/bower.json @@ -14,8 +14,21 @@ "tests" ], "dependencies": { - "angular": "1.3.4", + "angular": "~1.3.7", + "angular-bootstrap": "~1.0.0", + "angular-gettext": "~2.2.0", + "angular-sanitize": "~1.3.7", + "angular-ui-router": "~0.2.15", + "bootstrap-sass-official": "3.3.5", "helion-ui-framework": "../../helion-ui-framework/", - "helion-ui-theme": "../../helion-ui-theme/" + "helion-ui-theme": "../../helion-ui-theme/", + "lodash": "~3.10.1" + }, + "devDependencies": { + "angular-mocks": "~1.3.7" + }, + "resolutions": { + "angular": "~1.3.7", + "angular-mocks": "~1.3.7" } } diff --git a/tools/gulpfile.js b/tools/gulpfile.js index c652a35eb0..c7214a8dea 100644 --- a/tools/gulpfile.js +++ b/tools/gulpfile.js @@ -21,6 +21,12 @@ var jsSourceFiles = [ var jsLibs = [ paths.dist + 'lib/angular/angular.js', + paths.dist + 'lib/angular-gettext/dist/angular-gettext.js', + paths.dist + 'lib/angular-sanitize/angular-sanitize.js', + paths.dist + 'lib/angular-bootstrap/ui-bootstrap.js', + paths.dist + 'lib/angular-bootstrap/ui-bootstrap-tpls.js', + paths.dist + 'lib/angular-ui-router/release/angular-ui-router.js', + paths.dist + 'lib/lodash/lodash.js', paths.dist + 'lib/helion-ui-framework/**/*.module.js', paths.dist + 'lib/helion-ui-framework/**/*.js' ]; diff --git a/tools/karma.conf.js b/tools/karma.conf.js index 45d89730d4..fe7d70a7ea 100644 --- a/tools/karma.conf.js +++ b/tools/karma.conf.js @@ -18,7 +18,14 @@ module.exports = function (config) { files: [ 'config.js', - 'lib/angular/angular.min.js', + 'lib/angular/angular.js', + 'lib/angular-gettext/dist/angular-gettext.js', + 'lib/angular-sanitize/angular-sanitize.js', + 'lib/angular-bootstrap/ui-bootstrap.js', + 'lib/angular-bootstrap/ui-bootstrap-tpls.js', + 'lib/angular-ui-router/release/angular-ui-router.js', + 'lib/lodash/lodash.js', + 'lib/helion-ui-framework/**/*.module.js', 'lib/helion-ui-framework/**/!(*.mock|*.spec).js', 'lib/helion-ui-framework/**/!(*.mock).html', From fb163599ec448730ee6faa2adb0ac08d6815b65f Mon Sep 17 00:00:00 2001 From: Shaoquan Chen Date: Fri, 8 Jan 2016 14:16:01 -0800 Subject: [PATCH 2/4] Install font-awesome and enabling theming --- src/index.scss | 13 +++++++++++-- tools/bower.json | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/index.scss b/src/index.scss index 8508974e27..d917a179ab 100644 --- a/src/index.scss +++ b/src/index.scss @@ -1,4 +1,13 @@ -//@import "lib/helion-ui-theme/mixins"; -//@import "lib/helion-ui-theme/variables"; +// theme +@import "lib/helion-ui-theme/default/variables"; +@import "lib/helion-ui-theme/mixins"; +@import "lib/helion-ui-theme/variables"; + +// libs +$fa-font-path: "lib/font-awesome/fonts"; +@import "lib/font-awesome/scss/font-awesome"; +@import "lib/bootstrap-sass-official/assets/stylesheets/bootstrap"; @import "lib/helion-ui-framework/framework"; + +// app @import "app/app"; diff --git a/tools/bower.json b/tools/bower.json index 42b8a716ae..090b7e8ed3 100644 --- a/tools/bower.json +++ b/tools/bower.json @@ -20,6 +20,7 @@ "angular-sanitize": "~1.3.7", "angular-ui-router": "~0.2.15", "bootstrap-sass-official": "3.3.5", + "font-awesome": "~4.5.0", "helion-ui-framework": "../../helion-ui-framework/", "helion-ui-theme": "../../helion-ui-theme/", "lodash": "~3.10.1" From 57ddc5919c797c2182164b0bf158d26fae54a1ba Mon Sep 17 00:00:00 2001 From: Shaoquan Chen Date: Fri, 8 Jan 2016 15:48:29 -0800 Subject: [PATCH 3/4] Defining base path for ui-framework --- src/config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 7bc90ac247..fc65c0e523 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,12 @@ 'use strict'; expose({ - gettext: gettext + gettext: gettext, + + env: { + HELION_UI_FRAMEWORK_BASE_PATH: 'lib/helion-ui-framework/' + } + }); function gettext(text) { From 4bed4ad813c945d1fc963b42b196587837f61553 Mon Sep 17 00:00:00 2001 From: Shaoquan Chen Date: Fri, 8 Jan 2016 16:09:54 -0800 Subject: [PATCH 4/4] Enabling ng-strict-di and disabling debug data on DOM It is suggested that for better performance, angular-based code should: - use strict dependency injection - disable debug data on DOM For more information, please check: https://docs.angularjs.org/guide/production --- src/index.html | 4 ++-- src/index.module.js | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index b9701273a0..2cb40b1f6b 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,5 @@ - + @@ -9,6 +9,6 @@ - + diff --git a/src/index.module.js b/src/index.module.js index 4b260b3dfb..3ea241358f 100644 --- a/src/index.module.js +++ b/src/index.module.js @@ -17,7 +17,29 @@ 'app' ] .concat(angularModules) - .concat(otherModules) + .concat(otherModules), + config ); + config.$inject = [ + '$compileProvider' + ]; + + function config($compileProvider) { + + /** + * Disabling Debug Data + * + * To manually enable debug data, open up a debug console in the browser + * then call this method directly in this console: + * + * ``` + * angular.reloadWithDebugInfo(); + * ``` + * + * https://docs.angularjs.org/guide/production + */ + $compileProvider.debugInfoEnabled(false); + } + })();