Commit 86bf67f6c5516fbda4b0767df190f8fa589b126e
1 parent
cf443cf383
Exists in
master
and in
1 other branch
Implementación angular-ladda
Showing
4 changed files
with
11 additions
and
3 deletions
Show diff stats
gulpfile.js
| 1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
| 2 | const clean = require('gulp-clean'); | 2 | const clean = require('gulp-clean'); |
| 3 | const concat = require('gulp-concat'); | 3 | const concat = require('gulp-concat'); |
| 4 | const htmlmin = require('gulp-htmlmin'); | 4 | const htmlmin = require('gulp-htmlmin'); |
| 5 | const rename = require('gulp-rename'); | 5 | const rename = require('gulp-rename'); |
| 6 | const uglify = require('gulp-uglify'); | 6 | const uglify = require('gulp-uglify'); |
| 7 | const gulp = require('gulp'); | 7 | const gulp = require('gulp'); |
| 8 | const pump = require('pump'); | 8 | const pump = require('pump'); |
| 9 | const jshint = require('gulp-jshint'); | 9 | const jshint = require('gulp-jshint'); |
| 10 | const replace = require('gulp-replace'); | 10 | const replace = require('gulp-replace'); |
| 11 | const connect = require('gulp-connect'); | 11 | const connect = require('gulp-connect'); |
| 12 | 12 | ||
| 13 | var paths = { | 13 | var paths = { |
| 14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
| 15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
| 16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
| 17 | dist: 'dist/' | 17 | dist: 'dist/' |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | gulp.task('templates', ['clean'], function() { | 20 | gulp.task('templates', ['clean'], function() { |
| 21 | return pump( | 21 | return pump( |
| 22 | [ | 22 | [ |
| 23 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
| 24 | htmlmin(), | 24 | htmlmin(), |
| 25 | templateCache('views.js', { | 25 | templateCache('views.js', { |
| 26 | module: 'focaCrearNotaPedido', | 26 | module: 'focaCrearNotaPedido', |
| 27 | root: '' | 27 | root: '' |
| 28 | }), | 28 | }), |
| 29 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
| 30 | ] | 30 | ] |
| 31 | ); | 31 | ); |
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
| 35 | return pump( | 35 | return pump( |
| 36 | [ | 36 | [ |
| 37 | gulp.src([ | 37 | gulp.src([ |
| 38 | paths.srcJS, | 38 | paths.srcJS, |
| 39 | 'tmp/views.js' | 39 | 'tmp/views.js' |
| 40 | ]), | 40 | ]), |
| 41 | concat('foca-crear-nota-pedido.js'), | 41 | concat('foca-crear-nota-pedido.js'), |
| 42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
| 43 | gulp.dest(paths.tmp), | 43 | gulp.dest(paths.tmp), |
| 44 | rename('foca-crear-nota-pedido.min.js'), | 44 | rename('foca-crear-nota-pedido.min.js'), |
| 45 | uglify(), | 45 | uglify(), |
| 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ | 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ |
| 47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ | 47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ |
| 48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio"', ''), | 48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ |
| 49 | '"angular-ladda"', ''), | ||
| 49 | gulp.dest(paths.dist) | 50 | gulp.dest(paths.dist) |
| 50 | ] | 51 | ] |
| 51 | ); | 52 | ); |
| 52 | }); | 53 | }); |
| 53 | 54 | ||
| 54 | gulp.task('clean', function(){ | 55 | gulp.task('clean', function(){ |
| 55 | return gulp.src(['tmp', 'dist'], {read: false}) | 56 | return gulp.src(['tmp', 'dist'], {read: false}) |
| 56 | .pipe(clean()); | 57 | .pipe(clean()); |
| 57 | }); | 58 | }); |
| 58 | 59 | ||
| 59 | gulp.task('pre-commit', function() { | 60 | gulp.task('pre-commit', function() { |
| 60 | return pump( | 61 | return pump( |
| 61 | [ | 62 | [ |
| 62 | gulp.src(paths.srcJS), | 63 | gulp.src(paths.srcJS), |
| 63 | jshint('.jshintrc'), | 64 | jshint('.jshintrc'), |
| 64 | jshint.reporter('default'), | 65 | jshint.reporter('default'), |
| 65 | jshint.reporter('fail') | 66 | jshint.reporter('fail') |
| 66 | ] | 67 | ] |
| 67 | ); | 68 | ); |
| 68 | 69 | ||
| 69 | gulp.start('uglify'); | 70 | gulp.start('uglify'); |
| 70 | }); | 71 | }); |
| 71 | 72 | ||
| 72 | gulp.task('webserver', function() { | 73 | gulp.task('webserver', function() { |
| 73 | pump [ | 74 | pump [ |
| 74 | connect.server({port: 3000}) | 75 | connect.server({port: 3000}) |
| 75 | ] | 76 | ] |
| 76 | }); | 77 | }); |
| 77 | 78 | ||
| 78 | gulp.task('clean-post-install', function() { | 79 | gulp.task('clean-post-install', function() { |
| 79 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 80 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
| 80 | 'index.html'], {read: false}) | 81 | 'index.html'], {read: false}) |
| 81 | .pipe(clean()); | 82 | .pipe(clean()); |
| 82 | }); | 83 | }); |
| 83 | 84 | ||
| 84 | gulp.task('default', ['webserver']); | 85 | gulp.task('default', ['webserver']); |
| 85 | 86 | ||
| 86 | gulp.task('watch', function() { | 87 | gulp.task('watch', function() { |
| 87 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 88 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
| 88 | }); | 89 | }); |
| 89 | 90 |
index.html
| 1 | <html ng-app="focaCrearNotaPedido"> | 1 | <html ng-app="focaCrearNotaPedido"> |
| 2 | <head> | 2 | <head> |
| 3 | <meta charset="UTF-8"/> | 3 | <meta charset="UTF-8"/> |
| 4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | 4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
| 5 | 5 | ||
| 6 | <!--CSS--> | 6 | <!--CSS--> |
| 7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> | 7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> |
| 8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> | 8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> |
| 9 | <link href="node_modules/ladda/dist/ladda-themeless.min.css" rel="stylesheet"> | ||
| 9 | 10 | ||
| 10 | <!--VENDOR JS--> | 11 | <!--VENDOR JS--> |
| 11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | 12 | <script src="node_modules/jquery/dist/jquery.min.js"></script> |
| 12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | 13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> |
| 13 | <script src="node_modules/angular/angular.min.js"></script> | 14 | <script src="node_modules/angular/angular.min.js"></script> |
| 14 | <script src="node_modules/angular-route/angular-route.min.js"></script> | 15 | <script src="node_modules/angular-route/angular-route.min.js"></script> |
| 15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | 16 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
| 17 | <script src="node_modules/ladda/dist/spin.min.js"></script> | ||
| 18 | <script src="node_modules/ladda/dist/ladda.min.js"></script> | ||
| 19 | <script src="node_modules/angular-ladda/dist/angular-ladda.min.js"></script> | ||
| 16 | 20 | ||
| 17 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | 21 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> |
| 18 | <script src="node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> | 22 | <script src="node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> |
| 19 | <script src="node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> | 23 | <script src="node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> |
| 20 | <script src="node_modules/foca-modal-proveedor/dist/foca-modal-proveedor.min.js"></script> | 24 | <script src="node_modules/foca-modal-proveedor/dist/foca-modal-proveedor.min.js"></script> |
| 21 | <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> | 25 | <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> |
| 22 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> | 26 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> |
| 23 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> | 27 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> |
| 24 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> | 28 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> |
| 25 | <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script> | 29 | <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script> |
| 26 | 30 | ||
| 27 | <script src="src/js/app.js"></script> | 31 | <script src="src/js/app.js"></script> |
| 28 | <script src="src/js/controller.js"></script> | 32 | <script src="src/js/controller.js"></script> |
| 29 | <script src="src/js/service.js"></script> | 33 | <script src="src/js/service.js"></script> |
| 30 | <script src="src/js/route.js"></script> | 34 | <script src="src/js/route.js"></script> |
| 31 | 35 | ||
| 32 | <script src="src/etc/develop.js"></script> | 36 | <script src="src/etc/develop.js"></script> |
| 33 | </head> | 37 | </head> |
| 34 | <body> | 38 | <body> |
| 35 | <div ng-view class="container-fluid"></div> | 39 | <div ng-view class="container-fluid"></div> |
| 36 | </body> | 40 | </body> |
| 37 | </html> | 41 | </html> |
| 38 | 42 |
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-crear-nota-pedido", | 2 | "name": "foca-crear-nota-pedido", |
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
| 4 | "description": "Listado y ABM nota de pedidos", | 4 | "description": "Listado y ABM nota de pedidos", |
| 5 | "main": "index.js", | 5 | "main": "index.js", |
| 6 | "scripts": { | 6 | "scripts": { |
| 7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
| 8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
| 9 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 10 | "postinstall": "npm run compile && gulp clean-post-install", | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete git+https://debo.suite.repo/modulos-npm/foca-modal.git git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git" | 11 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-ladda ladda@1.0.6 angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete git+https://debo.suite.repo/modulos-npm/foca-modal.git git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git" |
| 12 | }, | 12 | }, |
| 13 | "pre-commit": [ | 13 | "pre-commit": [ |
| 14 | "gulp-pre-commit" | 14 | "gulp-pre-commit" |
| 15 | ], | 15 | ], |
| 16 | "repository": { | 16 | "repository": { |
| 17 | "type": "git", | 17 | "type": "git", |
| 18 | "url": "https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git" | 18 | "url": "https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git" |
| 19 | }, | 19 | }, |
| 20 | "author": "Foca Software", | 20 | "author": "Foca Software", |
| 21 | "license": "ISC", | 21 | "license": "ISC", |
| 22 | "peerDependencies": { | 22 | "peerDependencies": { |
| 23 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", | 23 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", |
| 24 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | 24 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
| 25 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", | 25 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", |
| 26 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", | 26 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", |
| 27 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git" | 27 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git" |
| 28 | }, | 28 | }, |
| 29 | "devDependencies": { | 29 | "devDependencies": { |
| 30 | "angular": "^1.7.5", | 30 | "angular": "^1.7.5", |
| 31 | "angular-ladda": "^0.4.3", | ||
| 31 | "angular-route": "^1.7.5", | 32 | "angular-route": "^1.7.5", |
| 32 | "bootstrap": "^4.1.3", | 33 | "bootstrap": "^4.1.3", |
| 33 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", | 34 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", |
| 34 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | 35 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
| 35 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", | 36 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", |
| 36 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", | 37 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", |
| 37 | "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", | 38 | "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", |
| 38 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", | 39 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", |
| 39 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", | 40 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", |
| 40 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", | 41 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", |
| 41 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", | 42 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
| 42 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", |
| 43 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", |
| 44 | "gulp-angular-templatecache": "^2.2.2", | 45 | "gulp-angular-templatecache": "^2.2.2", |
| 45 | "gulp-clean": "^0.4.0", | 46 | "gulp-clean": "^0.4.0", |
| 46 | "gulp-concat": "^2.6.1", | 47 | "gulp-concat": "^2.6.1", |
| 47 | "gulp-connect": "^5.6.1", | 48 | "gulp-connect": "^5.6.1", |
| 48 | "gulp-htmlmin": "^5.0.1", | 49 | "gulp-htmlmin": "^5.0.1", |
| 49 | "gulp-jshint": "^2.1.0", | 50 | "gulp-jshint": "^2.1.0", |
| 50 | "gulp-rename": "^1.4.0", | 51 | "gulp-rename": "^1.4.0", |
| 51 | "gulp-replace": "^1.0.0", | 52 | "gulp-replace": "^1.0.0", |
| 52 | "gulp-sequence": "^1.0.0", | 53 | "gulp-sequence": "^1.0.0", |
| 53 | "gulp-uglify": "^3.0.1", | 54 | "gulp-uglify": "^3.0.1", |
| 54 | "gulp-uglify-es": "^1.0.4", | 55 | "gulp-uglify-es": "^1.0.4", |
| 55 | "jasmine-core": "^3.3.0", | 56 | "jasmine-core": "^3.3.0", |
| 56 | "jquery": "^3.3.1", | 57 | "jquery": "^3.3.1", |
| 57 | "jshint": "^2.9.6", | 58 | "jshint": "^2.9.6", |
| 59 | "ladda": "1.0.6", | ||
| 58 | "pre-commit": "^1.2.2", | 60 | "pre-commit": "^1.2.2", |
| 59 | "pump": "^3.0.0", | 61 | "pump": "^3.0.0", |
| 60 | "ui-bootstrap4": "^3.0.5" | 62 | "ui-bootstrap4": "^3.0.5" |
| 61 | } | 63 | } |
| 62 | } | 64 | } |
| 63 | 65 |
src/js/app.js
| 1 | angular.module('focaCrearNotaPedido', [ | 1 | angular.module('focaCrearNotaPedido', [ |
| 2 | 'ngRoute', | 2 | 'ngRoute', |
| 3 | 'ui.bootstrap', | 3 | 'ui.bootstrap', |
| 4 | 'focaModalVendedores', | 4 | 'focaModalVendedores', |
| 5 | 'focaBusquedaProductos', | 5 | 'focaBusquedaProductos', |
| 6 | 'focaModalProveedor', | 6 | 'focaModalProveedor', |
| 7 | 'focaBusquedaCliente', | 7 | 'focaBusquedaCliente', |
| 8 | 'focaModalPrecioCondicion', | 8 | 'focaModalPrecioCondicion', |
| 9 | 'focaModalFlete', | 9 | 'focaModalFlete', |
| 10 | 'focaDirectivas', | 10 | 'focaDirectivas', |
| 11 | 'focaModal', | 11 | 'focaModal', |
| 12 | 'focaModalDomicilio' | 12 | 'focaModalDomicilio', |
| 13 | 'angular-ladda' | ||
| 13 | ]); | 14 | ]); |
| 14 | 15 |