Commit ff288de190f954515df51dddd5674158d486c841
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request modulos-npm/foca-modal-vendedores!4
Showing
3 changed files
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 | 12 | ||
| 12 | var paths = { | 13 | var paths = { |
| 13 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
| 14 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
| 15 | tmp: 'tmp', | 16 | tmp: 'tmp', |
| 16 | dist: 'dist/' | 17 | dist: 'dist/' |
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | gulp.task('templates', function() { | 20 | gulp.task('templates', function() { |
| 20 | return pump( | 21 | return pump( |
| 21 | [ | 22 | [ |
| 22 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
| 23 | replace('views/', ''), | 24 | replace('views/', ''), |
| 24 | htmlmin(), | 25 | htmlmin(), |
| 25 | templateCache('views.js', { | 26 | templateCache('views.js', { |
| 26 | module: 'focaModalVendedores', | 27 | module: 'focaModalVendedores', |
| 27 | root: '' | 28 | root: '' |
| 28 | }), | 29 | }), |
| 29 | gulp.dest(paths.tmp) | 30 | gulp.dest(paths.tmp) |
| 30 | ] | 31 | ] |
| 31 | ); | 32 | ); |
| 32 | }); | 33 | }); |
| 33 | 34 | ||
| 34 | gulp.task('uglify', ['templates'], function() { | 35 | gulp.task('uglify', ['templates'], function() { |
| 35 | return pump( | 36 | return pump( |
| 36 | [ | 37 | [ |
| 37 | gulp.src([ | 38 | gulp.src([ |
| 38 | paths.srcJS, | 39 | paths.srcJS, |
| 39 | 'tmp/views.js' | 40 | 'tmp/views.js' |
| 40 | ]), | 41 | ]), |
| 41 | concat('foca-modal-vendedores.js'), | 42 | concat('foca-modal-vendedores.js'), |
| 43 | replace('src/views/', ''), | ||
| 44 | replace("'ngRoute'", ''), | ||
| 42 | gulp.dest(paths.tmp), | 45 | gulp.dest(paths.tmp), |
| 43 | rename('foca-modal-vendedores.min.js'), | 46 | rename('foca-modal-vendedores.min.js'), |
| 44 | uglify(), | 47 | uglify(), |
| 45 | gulp.dest(paths.dist) | 48 | gulp.dest(paths.dist) |
| 46 | ] | 49 | ] |
| 47 | ); | 50 | ); |
| 48 | }); | 51 | }); |
| 49 | 52 | ||
| 50 | gulp.task('pre-commit', function() { | 53 | gulp.task('pre-commit', function() { |
| 51 | return pump( | 54 | return pump( |
| 52 | [ | 55 | [ |
| 53 | gulp.src(paths.srcJS), | 56 | gulp.src(paths.srcJS), |
| 54 | jshint('.jshintrc'), | 57 | jshint('.jshintrc'), |
| 55 | jshint.reporter('default'), | 58 | jshint.reporter('default'), |
| 56 | jshint.reporter('fail') | 59 | jshint.reporter('fail') |
| 57 | ] | 60 | ] |
| 58 | ); | 61 | ); |
| 59 | 62 | ||
| 60 | gulp.start('uglify'); | 63 | gulp.start('uglify'); |
| 61 | }); | 64 | }); |
| 62 | 65 | ||
| 63 | gulp.task('webserver', function() { | 66 | gulp.task('webserver', function() { |
| 64 | pump [ | 67 | pump [ |
| 65 | connect.server({port: 3000}) | 68 | connect.server({port: 3000}) |
| 66 | ] | 69 | ] |
| 67 | }); | 70 | }); |
| 68 | 71 | ||
| 69 | gulp.task('default', ['webserver']); | ||
| 72 | gulp.task('clean-post-install', function(){ | ||
| 73 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | ||
| 74 | 'index.html'], {read: false}) | ||
| 75 | .pipe(clean()); | ||
| 76 | }); | ||
| 77 | |||
| 78 | gulp.task('default', ['webserver']); |
index.html
| 1 | <html ng-app="focaModalVendedores"> | 1 | <html ng-app="focaModalVendedores"> |
| 2 | 2 | ||
| 3 | <head> | 3 | <head> |
| 4 | <meta charset="UTF-8" /> | 4 | <meta charset="UTF-8" /> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | 5 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
| 6 | 6 | ||
| 7 | <!--CSS--> | 7 | <!--CSS--> |
| 8 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" /> | 8 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" /> |
| 9 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> | 9 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> |
| 10 | 10 | ||
| 11 | <!--VENDOR JS--> | 11 | <!--VENDOR JS--> |
| 12 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | 12 | <script src="node_modules/jquery/dist/jquery.min.js"></script> |
| 13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | 13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> |
| 14 | <script src="node_modules/angular/angular.min.js"></script> | 14 | <script src="node_modules/angular/angular.min.js"></script> |
| 15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | 15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
| 16 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | 16 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> |
| 17 | 17 | ||
| 18 | <!-- BUILD --> | 18 | <!-- BUILD --> |
| 19 | <script src="src/js/app.js"></script> | 19 | <script src="src/js/app.js"></script> |
| 20 | <script src="src/js/controller.js"></script> | 20 | <script src="src/js/controller.js"></script> |
| 21 | <script src="src/js/service.js"></script> | 21 | <script src="src/js/service.js"></script> |
| 22 | 22 | ||
| 23 | <!-- /BUILD --> | 23 | <!-- /BUILD --> |
| 24 | 24 | ||
| 25 | <!-- CONFIG PARA DEVELOP --> | 25 | <!-- CONFIG PARA DEVELOP --> |
| 26 | <script type="text/javascript"> | 26 | <script type="text/javascript"> |
| 27 | angular.module('focaModalVendedores') | 27 | angular.module('focaModalVendedores') |
| 28 | .controller('controller', ['$uibModal', '$timeout', function($uibModal, $timeout) { | 28 | .controller('controller', ['$uibModal', '$timeout', function($uibModal, $timeout) { |
| 29 | openModal(); | 29 | openModal(); |
| 30 | 30 | ||
| 31 | function openModal() { | 31 | function openModal() { |
| 32 | var modalInstance = $uibModal.open( | 32 | var modalInstance = $uibModal.open( |
| 33 | { | 33 | { |
| 34 | ariaLabelledBy: 'Busqueda de Vendedores', | 34 | ariaLabelledBy: 'Busqueda de Vendedores', |
| 35 | templateUrl: 'src/views/modal-vendedores.html', | 35 | templateUrl: 'src/views/modal-vendedores.html', |
| 36 | controller: 'modalVendedoresCtrl', | 36 | controller: 'modalVendedoresCtrl', |
| 37 | size: 'lg' | 37 | size: 'lg' |
| 38 | } | 38 | } |
| 39 | ); | 39 | ); |
| 40 | 40 | ||
| 41 | modalInstance.result.then( | 41 | modalInstance.result.then( |
| 42 | function (selectedItem) { | 42 | function (selectedItem) { |
| 43 | console.info(selectedItem); | 43 | console.info(selectedItem); |
| 44 | $timeout(openModal, 500); | 44 | $timeout(openModal, 500); |
| 45 | }, function () { | 45 | }, function () { |
| 46 | console.info('modal-component dismissed at: ' + new Date()); | 46 | console.info('modal-component dismissed at: ' + new Date()); |
| 47 | $timeout(openModal, 500); | 47 | $timeout(openModal, 500); |
| 48 | } | 48 | } |
| 49 | ); | 49 | ); |
| 50 | } | 50 | } |
| 51 | |||
| 52 | |||
| 53 | }]); | 51 | }]); |
| 54 | </script> | 52 | </script> |
| 55 | 53 | ||
| 56 | <script src="src/etc/develop.js"></script> | 54 | <script src="src/etc/develop.js"></script> |
| 57 | </head> | 55 | </head> |
| 58 | 56 | ||
| 59 | <body ng-controller="controller"> | 57 | <body ng-controller="controller"> |
| 60 | <style> | 58 | <style> |
| 61 | .p-5 { | 59 | .p-5 { |
| 62 | padding: 5px !important; | 60 | padding: 5px !important; |
| 63 | } | 61 | } |
| 64 | </style> | 62 | </style> |
| 65 | </body> | 63 | </body> |
| 66 | 64 | ||
| 67 | </html> | 65 | </html> |
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-modal-vendedores", | 2 | "name": "foca-modal-vendedores", |
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
| 4 | "description": "Modal para seleccionar vendedores", | 4 | "description": "Modal para seleccionar vendedores", |
| 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 | "gulp-pre-commit": "gulp pre-commit", | 8 | "gulp-pre-commit": "gulp pre-commit", |
| 9 | "compile": "gulp uglify", | 9 | "compile": "gulp uglify", |
| 10 | "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+https://192.168.0.11/modulos-npm/foca-directivas" | 11 | "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-clean gulp-replace gulp-uglify jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+https://192.168.0.11/modulos-npm/foca-directivas" |
| 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://192.168.0.11/modulos-npm/foca-modal-vendedores" | 18 | "url": "https://192.168.0.11/modulos-npm/foca-modal-vendedores" |
| 19 | }, | 19 | }, |
| 20 | "author": "Foca Software", | 20 | "author": "Foca Software", |
| 21 | "license": "ISC", | 21 | "license": "ISC", |
| 22 | "peerDependencies": { | 22 | "peerDependencies": { |
| 23 | "angular": "^1.7.4", | 23 | "angular": "^1.7.4", |
| 24 | "bootstrap": "^4.1.3", | 24 | "bootstrap": "^4.1.3", |
| 25 | "font-awesome": "^4.7.0", | 25 | "font-awesome": "^4.7.0", |
| 26 | "ui-bootstrap4": "^3.0.4", | 26 | "ui-bootstrap4": "^3.0.4", |
| 27 | "gulp": "^3.9.1", | 27 | "gulp": "^3.9.1", |
| 28 | "gulp-angular-templatecache": "^2.2.1", | 28 | "gulp-angular-templatecache": "^2.2.1", |
| 29 | "gulp-concat": "^2.6.1", | 29 | "gulp-concat": "^2.6.1", |
| 30 | "gulp-connect": "^5.6.1", | 30 | "gulp-connect": "^5.6.1", |
| 31 | "gulp-htmlmin": "^5.0.1", | 31 | "gulp-htmlmin": "^5.0.1", |
| 32 | "gulp-rename": "^1.4.0", | 32 | "gulp-rename": "^1.4.0", |
| 33 | "gulp-replace": "^1.0.0", | 33 | "gulp-replace": "^1.0.0", |
| 34 | "gulp-uglify": "^3.0.1", | 34 | "gulp-uglify": "^3.0.1", |
| 35 | "jquery": "^3.3.1", | 35 | "jquery": "^3.3.1", |
| 36 | "pump": "^3.0.0", | 36 | "pump": "^3.0.0", |
| 37 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas" | 37 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas" |
| 38 | }, | 38 | }, |
| 39 | "devDependencies": { | 39 | "devDependencies": { |
| 40 | "angular": "^1.7.5", | 40 | "angular": "^1.7.5", |
| 41 | "bootstrap": "^4.1.3", | 41 | "bootstrap": "^4.1.3", |
| 42 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas", | 42 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas", |
| 43 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", |
| 44 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", |
| 45 | "gulp-angular-templatecache": "^2.2.1", | 45 | "gulp-angular-templatecache": "^2.2.1", |
| 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-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", |
| 53 | "jasmine-core": "^3.2.1", | 54 | "jasmine-core": "^3.2.1", |
| 54 | "jquery": "^3.3.1", | 55 | "jquery": "^3.3.1", |
| 55 | "jshint": "^2.9.6", | 56 | "jshint": "^2.9.6", |
| 56 | "pre-commit": "^1.2.2", | 57 | "pre-commit": "^1.2.2", |
| 57 | "pump": "^3.0.0", | 58 | "pump": "^3.0.0", |
| 58 | "ui-bootstrap4": "^3.0.5" | 59 | "ui-bootstrap4": "^3.0.5" |
| 59 | } | 60 | } |
| 60 | } | 61 | } |
| 61 | 62 |