diff --git a/gulpfile.js b/gulpfile.js index e6d7dab..c077104 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,10 +9,13 @@ const jshint = require('gulp-jshint'); const replace = require('gulp-replace'); const connect = require('gulp-connect'); const clean = require('gulp-clean'); +const header = require('gulp-header'); +const footer = require('gulp-footer'); var paths = { srcJS: 'src/js/*.js', srcViews: 'src/views/*.html', + specs: 'spec/*.js', tmp: 'tmp', dist: 'dist/' }; @@ -40,8 +43,8 @@ gulp.task('uglify', ['templates'], function() { 'tmp/views.js' ]), concat('foca-abm-vehiculo.js'), - replace("['ngRoute', 'focaModal', 'ui.bootstrap', 'focaBotoneraLateral']", '[]'), replace("src/views/", ''), + replace("'ngRoute'", ''), gulp.dest(paths.tmp), rename('foca-abm-vehiculo.min.js'), uglify(), @@ -50,6 +53,16 @@ gulp.task('uglify', ['templates'], function() { ); }); +gulp.task('uglify-spec', function() { + return pump([ + gulp.src(paths.specs), + concat('foca-abm-vehiculo.spec.js'), + header("describe('Módulo foca-abm-vehiculo', function() { \n"), + footer("});"), + gulp.dest(paths.dist) + ]); +}) + gulp.task('clean', function() { return gulp.src(['tmp', 'dist'], {read: false}) .pipe(clean()); @@ -58,7 +71,7 @@ gulp.task('clean', function() { gulp.task('pre-commit', function() { return pump( [ - gulp.src(paths.srcJS), + gulp.src([paths.srcJS, paths.specs]), jshint('.jshintrc'), jshint.reporter('default'), jshint.reporter('fail') diff --git a/src/js/app.js b/src/js/app.js index e227d68..a1b62a9 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1 +1 @@ -angular.module('focaAbmVehiculo', ['ngRoute', 'focaModal', 'ui.bootstrap', 'focaBotoneraLateral']); +angular.module('focaAbmVehiculo', ['ngRoute']); diff --git a/src/js/controller.js b/src/js/controller.js index 36da64e..00b550d 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -145,9 +145,9 @@ angular.module('focaAbmVehiculo') $scope.cisternas = res; $scope.$apply(); }); - } + } }); - + $scope.next = function(key) { if (key === 13) $scope.focused++; }; @@ -158,7 +158,7 @@ angular.module('focaAbmVehiculo') if(key) { $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/' + key); - }else { + } else { $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/0/'); } };