Integrated topology View in XOS
diff --git a/views/ngXosViews/mcordTopology/gulp/build.js b/views/ngXosViews/mcordTopology/gulp/build.js
index fb2cccb..f892310 100644
--- a/views/ngXosViews/mcordTopology/gulp/build.js
+++ b/views/ngXosViews/mcordTopology/gulp/build.js
@@ -13,7 +13,7 @@
var uglify = require('gulp-uglify');
var templateCache = require('gulp-angular-templatecache');
var runSequence = require('run-sequence');
-var concat = require('gulp-concat');
+var concat = require('gulp-concat-util');
var del = require('del');
var wiredep = require('wiredep');
var angularFilesort = require('gulp-angular-filesort');
@@ -22,8 +22,12 @@
var inject = require('gulp-inject');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
+var postcss = require('gulp-postcss');
+var autoprefixer = require('autoprefixer');
+var mqpacker = require('css-mqpacker');
+var csswring = require('csswring');
-var TEMPLATE_FOOTER = `}]);
+var TEMPLATE_FOOTER = `
angular.module('xos.mcordTopology').run(function($location){$location.path('/')});
angular.bootstrap(angular.element('#xosMcordTopology'), ['xos.mcordTopology']);`;
@@ -37,6 +41,27 @@
);
});
+ // minify css
+ gulp.task('css', function () {
+ var processors = [
+ autoprefixer({browsers: ['last 1 version']}),
+ mqpacker,
+ csswring
+ ];
+ gulp.src([
+ `${options.css}**/*.css`,
+ `!${options.css}dev.css`
+ ])
+ .pipe(postcss(processors))
+ .pipe(gulp.dest(options.tmp + '/css/'));
+ });
+
+ gulp.task('copyCss', ['css'], function(){
+ return gulp.src([`${options.tmp}/css/*.css`])
+ .pipe(concat('xosMcordTopology.css'))
+ .pipe(gulp.dest(options.static + 'css/'))
+ });
+
// compile and minify scripts
gulp.task('scripts', function() {
return gulp.src([
@@ -45,7 +70,9 @@
.pipe(ngAnnotate())
.pipe(angularFilesort())
.pipe(concat('xosMcordTopology.js'))
- .pipe(uglify())
+ .pipe(concat.header('//Autogenerated, do not edit!!!\n'))
+ .pipe(concat.footer(TEMPLATE_FOOTER))
+ // .pipe(uglify())
.pipe(gulp.dest(options.static + 'js/'));
});
@@ -72,7 +99,8 @@
inject(
gulp.src([
options.static + 'js/vendor/xosMcordTopologyVendor.js',
- options.static + 'js/xosMcordTopology.js'
+ options.static + 'js/xosMcordTopology.js',
+ options.static + 'css/xosMcordTopology.css'
]),
{ignorePath: '/../../../xos/core/xoslib'}
)
@@ -113,7 +141,7 @@
'scripts',
'wiredep',
'copyHtml',
- 'cleanTmp'
+ 'copyCss'
);
});
};
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/gulpfile.js b/views/ngXosViews/mcordTopology/gulpfile.js
index b2cdab8..a3523ee 100644
--- a/views/ngXosViews/mcordTopology/gulpfile.js
+++ b/views/ngXosViews/mcordTopology/gulpfile.js
@@ -5,6 +5,7 @@
var options = {
src: 'src/',
+ css: 'src/css/',
scripts: 'src/js/',
tmp: 'src/.tmp',
dist: 'dist/',
diff --git a/views/ngXosViews/mcordTopology/package.json b/views/ngXosViews/mcordTopology/package.json
index b2606c2..9826895 100644
--- a/views/ngXosViews/mcordTopology/package.json
+++ b/views/ngXosViews/mcordTopology/package.json
@@ -21,7 +21,10 @@
"license": "MIT",
"dependencies": {},
"devDependencies": {
+ "autoprefixer": "^6.3.3",
"browser-sync": "^2.9.11",
+ "css-mqpacker": "^4.0.0",
+ "csswring": "^4.2.1",
"del": "^2.0.2",
"easy-mocker": "^1.2.0",
"eslint": "^1.8.0",
@@ -31,10 +34,12 @@
"gulp-angular-templatecache": "^1.8.0",
"gulp-babel": "^5.3.0",
"gulp-concat": "^2.6.0",
+ "gulp-concat-util": "^0.5.5",
"gulp-eslint": "^1.0.0",
"gulp-inject": "^3.0.0",
"gulp-minify-html": "^1.0.4",
"gulp-ng-annotate": "^1.1.0",
+ "gulp-postcss": "^6.0.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-uglify": "^1.4.2",
diff --git a/views/ngXosViews/mcordTopology/src/css/mcord.css b/views/ngXosViews/mcordTopology/src/css/mcord.css
index 68cca28..d2d21e7 100644
--- a/views/ngXosViews/mcordTopology/src/css/mcord.css
+++ b/views/ngXosViews/mcordTopology/src/css/mcord.css
@@ -1,3 +1,7 @@
+#xosMcordTopology {
+ height: 700px;
+}
+
[ui-view],
m-cord-topology{
width: 100%;