Commit a756c6a151bf145d9a774e6c81993d8efeed6511
Exists in
master
and in
2 other branches
Merge branch 'master' into 'master'
master (pmarco) See merge request modulos-npm/foca-login!3
Showing
6 changed files
Show diff stats
gulpfile.js
| 1 | -const templateCache = require('gulp-angular-templatecache'); | |
| 2 | -const concat = require('gulp-concat'); | |
| 3 | 1 | const clean = require('gulp-clean'); |
| 4 | -const htmlmin = require('gulp-htmlmin'); | |
| 5 | -const rename = require('gulp-rename'); | |
| 6 | -const uglify = require('gulp-uglify-es').default; | |
| 2 | +const concat = require('gulp-concat'); | |
| 3 | +const connect = require('gulp-connect'); | |
| 7 | 4 | const gulp = require('gulp'); |
| 8 | -const pump = require('pump'); | |
| 5 | +const htmlmin = require('gulp-htmlmin'); | |
| 9 | 6 | const jshint = require('gulp-jshint'); |
| 7 | +const pump = require('pump'); | |
| 8 | +const rename = require('gulp-rename'); | |
| 10 | 9 | const replace = require('gulp-replace'); |
| 10 | +const templateCache = require('gulp-angular-templatecache'); | |
| 11 | +const uglify = require('gulp-uglify-es').default; | |
| 11 | 12 | |
| 12 | 13 | var paths = { |
| 13 | 14 | srcJS: 'src/js/*.js', |
| ... | ... | @@ -16,7 +17,7 @@ var paths = { |
| 16 | 17 | dist: 'dist/' |
| 17 | 18 | }; |
| 18 | 19 | |
| 19 | -gulp.task('templates', function() { | |
| 20 | +gulp.task('templates', ['clean'], function() { | |
| 20 | 21 | return pump( |
| 21 | 22 | [ |
| 22 | 23 | gulp.src(paths.srcViews), |
| ... | ... | @@ -38,7 +39,7 @@ gulp.task('uglify', ['templates'], function() { |
| 38 | 39 | 'tmp/views.js' |
| 39 | 40 | ]), |
| 40 | 41 | concat('foca-login.js'), |
| 41 | - replace("['ngRoute', 'ngCookies']",'[]'), | |
| 42 | + replace("['ngRoute', 'ngCookies', 'focaDirectivas']",'[]'), | |
| 42 | 43 | replace('src/views/', ''), |
| 43 | 44 | gulp.dest(paths.tmp), |
| 44 | 45 | rename('foca-login.min.js'), |
index.html
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | <script src="node_modules/angular/angular.min.js"></script> |
| 14 | 14 | <script src="node_modules/angular-route/angular-route.min.js"></script> |
| 15 | 15 | <script src="node_modules/angular-cookies/angular-cookies.min.js"></script> |
| 16 | + <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | |
| 16 | 17 | |
| 17 | 18 | <script src="src/js/app.js"></script> |
| 18 | 19 | <script src="src/js/route.js"></script> |
package.json
| ... | ... | @@ -8,14 +8,14 @@ |
| 8 | 8 | "compile": "gulp compile", |
| 9 | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 10 | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | - "install-dev": "npm install -D gulp gulp-connect jasmine-core pre-commit angular angular-route angular-cookies bootstrap font-awesome gulp-angular-templatecache gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-replace jquery jshint pump" | |
| 11 | + "install-dev": "npm install -D gulp gulp-connect jasmine-core pre-commit angular angular-route angular-cookies bootstrap font-awesome gulp-angular-templatecache gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-replace jquery jshint pump && npm i -D git+https://debo.suite.repo/modulos-npm/foca-directivas" | |
| 12 | 12 | }, |
| 13 | 13 | "pre-commit": [ |
| 14 | 14 | "gulp-pre-commit" |
| 15 | 15 | ], |
| 16 | 16 | "repository": { |
| 17 | 17 | "type": "git", |
| 18 | - "url": "https://192.168.0.11/modulos-npm/foca-login.git" | |
| 18 | + "url": "https://debo.suite.repo/modulos-npm/foca-login.git" | |
| 19 | 19 | }, |
| 20 | 20 | "author": "Foca Software", |
| 21 | 21 | "license": "ISC", |
| ... | ... | @@ -31,16 +31,18 @@ |
| 31 | 31 | "gulp-replace": "^1.0.x", |
| 32 | 32 | "gulp-uglify-es": "^1.0.x", |
| 33 | 33 | "jshint": "^2.9.x", |
| 34 | - "pump": "^3.0.x" | |
| 34 | + "pump": "^3.0.x", | |
| 35 | + "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" | |
| 35 | 36 | }, |
| 36 | 37 | "devDependencies": { |
| 37 | 38 | "angular": "^1.7.5", |
| 38 | 39 | "angular-cookies": "^1.7.5", |
| 39 | 40 | "angular-route": "^1.7.5", |
| 40 | 41 | "bootstrap": "^4.1.3", |
| 42 | + "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", | |
| 41 | 43 | "font-awesome": "^4.7.0", |
| 42 | 44 | "gulp": "^3.9.1", |
| 43 | - "gulp-angular-templatecache": "^2.2.1", | |
| 45 | + "gulp-angular-templatecache": "^2.2.2", | |
| 44 | 46 | "gulp-clean": "^0.4.0", |
| 45 | 47 | "gulp-connect": "^5.6.1", |
| 46 | 48 | "gulp-htmlmin": "^5.0.1", |
src/js/app.js
| 1 | -angular.module('focaLogin', ['ngRoute', 'ngCookies']) | |
| 1 | +angular.module('focaLogin', ['ngRoute', 'ngCookies', 'focaDirectivas']) | |
| 2 | 2 | .run(['$rootScope', '$cookies', '$location', function($rootScope, $cookies, $location) { |
| 3 | 3 | $rootScope.$on('$locationChangeStart', function() { |
| 4 | 4 | var idUsuario = $cookies.get('idUsuario'); |
src/js/controller.js
| ... | ... | @@ -2,6 +2,7 @@ angular.module('focaLogin') |
| 2 | 2 | .controller('focaLoginController', [ |
| 3 | 3 | '$scope', 'focaLoginService', '$location', '$cookies', |
| 4 | 4 | function($scope, focaLoginService, $location, $cookies) { |
| 5 | + $scope.paso = 1; | |
| 5 | 6 | $scope.enviar = function() { |
| 6 | 7 | focaLoginService.login($scope.usuario).then(function(datos) { |
| 7 | 8 | $cookies.put('idUsuario', $scope.usuario.idUsuario); |
| ... | ... | @@ -9,6 +10,9 @@ angular.module('focaLogin') |
| 9 | 10 | $location.path('/'); |
| 10 | 11 | }); |
| 11 | 12 | }; |
| 13 | + $scope.irPaso = function(numeroPaso){ | |
| 14 | + $scope.paso = numeroPaso; | |
| 15 | + }; | |
| 12 | 16 | } |
| 13 | 17 | ]) |
| 14 | 18 | .controller('focaLogoutController', [ |
src/views/foca-login.html
| ... | ... | @@ -5,11 +5,21 @@ |
| 5 | 5 | </div> |
| 6 | 6 | <div class="login-campo"> |
| 7 | 7 | <label>Usuario</label> |
| 8 | - <input type="text" ng-model="usuario.idUsuario" /> | |
| 8 | + <input | |
| 9 | + type = "text" | |
| 10 | + ng-model = "usuario.idUsuario" | |
| 11 | + foca-focus = "paso == 1" | |
| 12 | + ng-keyup = "$event.keyCode == 13 && irPaso(2)" | |
| 13 | + /> | |
| 9 | 14 | </div> |
| 10 | 15 | <div class="login-campo"> |
| 11 | 16 | <label>Contraseña</label> |
| 12 | - <input type="password" ng-model="usuario.clave" ng-keyup="$event.keyCode == 13 && enviar()" /> | |
| 17 | + <input | |
| 18 | + type = "password" | |
| 19 | + ng-model = "usuario.clave" | |
| 20 | + foca-focus = "paso == 2" | |
| 21 | + ng-keyup = "$event.keyCode == 13 && enviar()" | |
| 22 | + /> | |
| 13 | 23 | </div> |
| 14 | 24 | </form> |
| 15 | 25 | </div> |