Commit 64ecebdaf27b5cb62ec8903078f7ddfc83a80e9d
1 parent
f919730f2c
Exists in
master
correccion inyecciones
Showing
4 changed files
with
2 additions
and
64 deletions
Show diff stats
gulpfile.js
1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
2 | const concat = require('gulp-concat'); | 2 | const concat = require('gulp-concat'); |
3 | const htmlmin = require('gulp-htmlmin'); | 3 | const htmlmin = require('gulp-htmlmin'); |
4 | const rename = require('gulp-rename'); | 4 | const rename = require('gulp-rename'); |
5 | const uglify = require('gulp-uglify'); | 5 | const uglify = require('gulp-uglify'); |
6 | const gulp = require('gulp'); | 6 | const gulp = require('gulp'); |
7 | const pump = require('pump'); | 7 | const pump = require('pump'); |
8 | const jshint = require('gulp-jshint'); | 8 | const jshint = require('gulp-jshint'); |
9 | const replace = require('gulp-replace'); | 9 | const replace = require('gulp-replace'); |
10 | const connect = require('gulp-connect'); | 10 | const connect = require('gulp-connect'); |
11 | const clean = require('gulp-clean'); | 11 | const clean = require('gulp-clean'); |
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', function() { | 20 | gulp.task('templates', 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: 'focaModalDetalles', | 26 | module: 'focaModalDetalles', |
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-modal-detalles.js'), | 41 | concat('foca-modal-detalles.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | replace("['ui.bootstrap', 'focaDirectivas']", '[]'), | ||
44 | gulp.dest(paths.tmp), | 43 | gulp.dest(paths.tmp), |
45 | rename('foca-modal-detalles.min.js'), | 44 | rename('foca-modal-detalles.min.js'), |
46 | uglify(), | 45 | uglify(), |
47 | gulp.dest(paths.dist) | 46 | gulp.dest(paths.dist) |
48 | ] | 47 | ] |
49 | ); | 48 | ); |
50 | }); | 49 | }); |
51 | 50 | ||
52 | gulp.task('pre-commit', function() { | 51 | gulp.task('pre-commit', function() { |
53 | return pump( | 52 | return pump( |
54 | [ | 53 | [ |
55 | gulp.src(paths.srcJS), | 54 | gulp.src(paths.srcJS), |
56 | jshint('.jshintrc'), | 55 | jshint('.jshintrc'), |
57 | jshint.reporter('default'), | 56 | jshint.reporter('default'), |
58 | jshint.reporter('fail') | 57 | jshint.reporter('fail') |
59 | ] | 58 | ] |
60 | ); | 59 | ); |
61 | }); | 60 | }); |
62 | 61 | ||
63 | gulp.task('webserver', function() { | 62 | gulp.task('webserver', function() { |
64 | pump [ | 63 | pump [ |
65 | connect.server({port: 3000}) | 64 | connect.server({port: 3000}) |
66 | ] | 65 | ] |
67 | }); | 66 | }); |
68 | 67 | ||
69 | gulp.task('clean-post-install', function(){ | 68 | gulp.task('clean-post-install', function(){ |
70 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 69 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
71 | 'index.html'], {read: false}) | 70 | 'index.html'], {read: false}) |
72 | .pipe(clean()); | 71 | .pipe(clean()); |
73 | }); | 72 | }); |
74 | 73 | ||
75 | gulp.task('default', ['webserver']); | 74 | gulp.task('default', ['webserver']); |
76 | 75 | ||
77 | gulp.task('watch', function() { | 76 | gulp.task('watch', function() { |
78 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 77 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
79 | }); | 78 | }); |
80 | 79 |
index.html
1 | <html ng-app="focaModalCheque"> | File was deleted | |
2 | <head> | ||
3 | <meta charset="UTF-8"/> | ||
4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
5 | |||
6 | <!--CSS--> | ||
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"/> | ||
9 | |||
10 | <!--VENDOR JS--> | ||
11 | <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/angular/angular.min.js"></script> | ||
14 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | ||
15 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | ||
16 | |||
17 | <!-- BUILD --> | ||
18 | <script src="src/js/app.js"></script> | ||
19 | <script src="src/js/controller.js"></script> | ||
20 | <script src="src/js/service.js"></script> | ||
21 | |||
22 | <!-- /BUILD --> | ||
23 | |||
24 | <!-- CONFIG PARA DEVELOP --> | ||
25 | <script src="src/etc/develop.js"></script> | ||
26 | <script type="text/javascript"> | ||
27 | angular.module('focaModalCheque') | ||
28 | .controller('controller', [ | ||
29 | '$scope', | ||
30 | '$uibModal', | ||
31 | '$timeout', | ||
32 | function($scope, $uibModal, $timeout) { | ||
33 | openModal(); | ||
34 | |||
35 | function openModal() { | ||
36 | var modalInstance = $uibModal.open( | ||
37 | { | ||
38 | ariaLabelledBy: 'Busqueda de Precio Condicion', | ||
39 | templateUrl: 'src/views/modal-cheque.html', | ||
40 | controller: 'focaModalFleteController', | ||
41 | size: 'lg' | ||
42 | } | ||
43 | ); | ||
44 | |||
45 | modalInstance.result.then( | ||
46 | function (selectedItem) { | ||
47 | console.info(selectedItem); | ||
48 | $timeout(openModal, 500); | ||
49 | }, function () { | ||
50 | console.info('modal-component dismissed at: ' + new Date()); | ||
51 | $timeout(openModal, 500); | ||
52 | } | ||
53 | ); | ||
54 | } | ||
55 | } | ||
56 | ]); | ||
57 | </script> | ||
58 | </head> | ||
59 | <body ng-controller="controller"> | ||
60 | </body> | ||
61 | </html> | ||
62 | 1 | <html ng-app="focaModalCheque"> |
src/etc/develop.js.ejemplo
1 | angular.module('focaModalCheque') | 1 | angular.module('focaModalDetalles') |
2 | .constant("API_ENDPOINT", { | 2 | .constant("API_ENDPOINT", { |
3 | 'URL': '//127.0.0.1:9000' | 3 | 'URL': '//127.0.0.1:9000' |
4 | }); | 4 | }); |
5 | 5 |
src/js/app.js
1 | angular.module('focaModalDetalles', ['ui.bootstrap', 'focaDirectivas', 'focaModal']); | 1 | angular.module('focaModalDetalles', []); |
2 | 2 |