mitchell852 closed pull request #2871: demonstrates how to add a library to TP
URL: https://github.com/apache/trafficcontrol/pull/2871
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/traffic_portal/app/src/app.js b/traffic_portal/app/src/app.js
index a81502eea..ee78475ff 100644
--- a/traffic_portal/app/src/app.js
+++ b/traffic_portal/app/src/app.js
@@ -38,6 +38,7 @@ var trafficPortal = angular.module('trafficPortal', [
'app.templates',
'angular-jwt',
'angular-loading-bar',
+ 'ui.ace',
// public modules
require('./modules/public').name,
diff --git a/traffic_portal/app/src/modules/public/login/login.tpl.html
b/traffic_portal/app/src/modules/public/login/login.tpl.html
index 880f7abcd..e66fb0837 100644
--- a/traffic_portal/app/src/modules/public/login/login.tpl.html
+++ b/traffic_portal/app/src/modules/public/login/login.tpl.html
@@ -47,6 +47,7 @@ <h2>Login</h2>
</div>
</div>
</form>
+ <div ui-ace></div>
</div>
</div>
</div>
diff --git a/traffic_portal/app/src/scripts/shared-libs.js
b/traffic_portal/app/src/scripts/shared-libs.js
index 06c68f23f..88c095148 100644
--- a/traffic_portal/app/src/scripts/shared-libs.js
+++ b/traffic_portal/app/src/scripts/shared-libs.js
@@ -56,3 +56,7 @@ require('jquery-flot-axislabels');
// misc
require('es5-shim');
require('json3');
+
+// ui ace
+require('ace');
+require('ui-ace');
diff --git a/traffic_portal/app/src/styles/main.scss
b/traffic_portal/app/src/styles/main.scss
index 28de213df..554da54f8 100755
--- a/traffic_portal/app/src/styles/main.scss
+++ b/traffic_portal/app/src/styles/main.scss
@@ -183,6 +183,8 @@ table {
}
+.ace_editor { height: 200px; }
+
diff --git a/traffic_portal/bower.json b/traffic_portal/bower.json
index ec232608d..6cb7d4aea 100755
--- a/traffic_portal/bower.json
+++ b/traffic_portal/bower.json
@@ -8,6 +8,7 @@
"angular-sanitize": "1.6.4",
"angular-bootstrap": "0.14.3",
"angular-loading-bar": "0.8.0",
+ "angular-ui-ace": "0.2.3",
"angular-ui-router": "0.4.2",
"angular-jwt": "0.0.9",
"bootstrap-sass-official": "3.3.6",
diff --git a/traffic_portal/grunt/browserify2.js
b/traffic_portal/grunt/browserify2.js
index 2528df48c..373aa929e 100644
--- a/traffic_portal/grunt/browserify2.js
+++ b/traffic_portal/grunt/browserify2.js
@@ -28,6 +28,7 @@ module.exports = {
cwd: '<%= globalConfig.app %>/bower_components/',
src:
[
+ 'ace-builds/src-min-noconflict/ace.js',
'angular/angular.min.js',
'angular-animate/angular-animate.min.js',
'angular-bootstrap/ui-bootstrap.min.js',
@@ -38,6 +39,7 @@ module.exports = {
'angular-route/angular-route.min.js',
'angular-sanitize/angular-sanitize.min.js',
'angular-ui-router/release/angular-ui-router.min.js',
+ 'angular-ui-ace/ui-ace.min.js',
'bootstrap-sass-official/assets/javascripts/bootstrap.min.js',
'es5-shim/es5-shim.min.js',
'jquery/jquery.min.js',
@@ -89,6 +91,7 @@ module.exports = {
cwd: '<%= globalConfig.app %>/bower_components/',
src:
[
+ 'ace-builds/src-min-noconflict/ace.js',
'angular/angular.js',
'angular-animate/angular-animate.js',
'angular-bootstrap/ui-bootstrap.js',
@@ -99,6 +102,7 @@ module.exports = {
'angular-route/angular-route.js',
'angular-sanitize/angular-sanitize.js',
'angular-ui-router/release/angular-ui-router.js',
+ 'angular-ui-ace/ui-ace.js',
'bootstrap-sass-official/assets/javascripts/bootstrap.js',
'es5-shim/es5-shim.js',
'jquery/jquery.js',
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services