Commit 97ee93f75a85c32d3e14df1b85974dd711038e53
0 parents
Exists in
master
and in
1 other branch
First commit.
Showing
10 changed files
with
245 additions
and
0 deletions
Show diff stats
.gitignore
File was created | 1 | /node_modules | |
2 | /dist | ||
3 | /tmp | ||
4 | package-lock\.json | ||
5 | /src/etc/develop.js | ||
6 |
.jshintrc
File was created | 1 | { | |
2 | /* | ||
3 | * ENVIRONMENTS | ||
4 | * ================= | ||
5 | */ | ||
6 | |||
7 | // Define globals exposed by modern browsers. | ||
8 | "browser": true, | ||
9 | |||
10 | // Define globals exposed by jQuery. | ||
11 | "jquery": true, | ||
12 | |||
13 | // Define globals exposed by Node.js. | ||
14 | "node": true, | ||
15 | |||
16 | // Allow ES6. | ||
17 | "esversion": 6, | ||
18 | |||
19 | /* | ||
20 | * ENFORCING OPTIONS | ||
21 | * ================= | ||
22 | */ | ||
23 | |||
24 | // Force all variable names to use either camelCase style or UPPER_CASE | ||
25 | // with underscores. | ||
26 | "camelcase": true, | ||
27 | |||
28 | // Prohibit use of == and != in favor of === and !==. | ||
29 | "eqeqeq": true, | ||
30 | |||
31 | // Enforce tab width of 2 spaces. | ||
32 | "indent": 4, | ||
33 | |||
34 | // Prohibit use of a variable before it is defined. | ||
35 | "latedef": true, | ||
36 | |||
37 | // Enforce line length to 100 characters | ||
38 | "maxlen": 100, | ||
39 | |||
40 | // Require capitalized names for constructor functions. | ||
41 | "newcap": true, | ||
42 | |||
43 | // Enforce use of single quotation marks for strings. | ||
44 | "quotmark": "single", | ||
45 | |||
46 | // Enforce placing 'use strict' at the top function scope | ||
47 | "strict": false, | ||
48 | |||
49 | // Prohibit use of explicitly undeclared variables. | ||
50 | "undef": true, | ||
51 | |||
52 | // Warn when variables are defined but never used. | ||
53 | "unused": true, | ||
54 | |||
55 | // Para que funcione en angular | ||
56 | "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"], | ||
57 | /* | ||
58 | * RELAXING OPTIONS | ||
59 | * ================= | ||
60 | */ | ||
61 | |||
62 | // Suppress warnings about == null comparisons. | ||
63 | "eqnull": true | ||
64 | } | ||
65 |
README.md
File was created | 1 | foca-modal-login | |
2 |
gulpfile.js
File was created | 1 | const templateCache = require('gulp-angular-templatecache'); | |
2 | const concat = require('gulp-concat'); | ||
3 | const htmlmin = require('gulp-htmlmin'); | ||
4 | const rename = require('gulp-rename'); | ||
5 | const uglify = require('gulp-uglify-es').default; | ||
6 | const gulp = require('gulp'); | ||
7 | const pump = require('pump'); | ||
8 | const jshint = require('gulp-jshint'); | ||
9 | const replace = require('gulp-replace'); | ||
10 | const connect = require('gulp-connect'); | ||
11 | const clean = require('gulp-clean'); | ||
12 | |||
13 | var paths = { | ||
14 | srcJS: 'src/js/*.js', | ||
15 | srcViews: 'src/views/*.html', | ||
16 | tmp: 'tmp', | ||
17 | dist: 'dist/' | ||
18 | }; | ||
19 | |||
20 | gulp.task('clean', function(){ | ||
21 | return gulp.src(['tmp', 'dist'], {read: false}) | ||
22 | .pipe(clean()); | ||
23 | }); | ||
24 | |||
25 | gulp.task('templates', ['clean'], function() { | ||
26 | return pump( | ||
27 | [ | ||
28 | gulp.src(paths.srcViews), | ||
29 | htmlmin(), | ||
30 | templateCache('views.js', { | ||
31 | module: 'focaModalLogin', | ||
32 | root: '' | ||
33 | }), | ||
34 | gulp.dest(paths.tmp) | ||
35 | ] | ||
36 | ); | ||
37 | }); | ||
38 | |||
39 | gulp.task('uglify', ['templates'], function() { | ||
40 | return pump( | ||
41 | [ | ||
42 | gulp.src([ | ||
43 | paths.srcJS, | ||
44 | 'tmp/views.js' | ||
45 | ]), | ||
46 | concat('foca-orden-carga.js'), | ||
47 | replace("['ui.bootstrap', 'focaDirectivas', 'angular-ladda']", '[]'), | ||
48 | replace('src/views/', ''), | ||
49 | gulp.dest(paths.tmp), | ||
50 | rename('foca-orden-carga.min.js'), | ||
51 | uglify(), | ||
52 | gulp.dest(paths.dist) | ||
53 | ] | ||
54 | ); | ||
55 | }); | ||
56 | |||
57 | gulp.task('pre-commit', function() { | ||
58 | return pump( | ||
59 | [ | ||
60 | gulp.src(paths.srcJS), | ||
61 | jshint('.jshintrc'), | ||
62 | jshint.reporter('default'), | ||
63 | jshint.reporter('fail') | ||
64 | ] | ||
65 | ); | ||
66 | }); | ||
67 | |||
68 | |||
69 | gulp.task('webserver', function() { | ||
70 | pump [ | ||
71 | connect.server({port: 3000}) | ||
72 | ] | ||
73 | }); | ||
74 | |||
75 | gulp.task('clean-post-install', function() { | ||
76 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | ||
77 | 'index.html'], {read: false}) | ||
78 | .pipe(clean()); | ||
79 | }); | ||
80 | |||
81 | gulp.task('default', ['webserver']); | ||
82 | |||
83 | gulp.task('watch', function(){ | ||
84 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | ||
85 | }); | ||
86 |
package.json
File was created | 1 | { | |
2 | "name": "foca-orden-carga", | ||
3 | "version": "0.0.1", | ||
4 | "description": "", | ||
5 | "main": "index.js", | ||
6 | "scripts": { | ||
7 | "refresh": "gulp uglify && cp tmp/foca-orden-carga.js ../wrapper-demo/node_modules/foca-orden-carga/dist/foca-orden-carga.min.js", | ||
8 | "test": "echo \"Error: no test specified\" && exit 1", | ||
9 | "compile": "gulp uglify", | ||
10 | "gulp-pre-commit": "gulp pre-commit", | ||
11 | "postinstall": "npm run compile && gulp clean-post-install", | ||
12 | "install-dev": "npm install angular bootstrap font-awesome jquery gulp gulp-connect jasmine-core pre-commit gulp-angular-templatecache gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify-es jshint pump" | ||
13 | }, | ||
14 | "author": "", | ||
15 | "license": "ISC", | ||
16 | "peerDependencies": { | ||
17 | "angular": "^1.7.x", | ||
18 | "bootstrap": "^4.1.x", | ||
19 | "jquery": "^3.3.x", | ||
20 | "font-awesome": "^4.7.x", | ||
21 | "gulp": "^3.9.x", | ||
22 | "gulp-concat": "2.6.x", | ||
23 | "gulp-jshint": "^2.1.x", | ||
24 | "gulp-rename": "^1.4.x", | ||
25 | "gulp-replace": "^1.0.x", | ||
26 | "gulp-uglify-es": "^1.0.x", | ||
27 | "jshint": "^2.9.x", | ||
28 | "pump": "^3.0.x" | ||
29 | }, | ||
30 | "devDependencies": { | ||
31 | "angular": "^1.7.4", | ||
32 | "angular-ladda": "^0.4.3", | ||
33 | "angular-ui-bootstrap": "^2.5.6", | ||
34 | "bootstrap": "^4.1.3", | ||
35 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", | ||
36 | "font-awesome": "^4.7.0", | ||
37 | "gulp": "^3.9.1", | ||
38 | "gulp-angular-templatecache": "^2.2.1", | ||
39 | "gulp-clean": "^0.4.0", | ||
40 | "gulp-concat": "^2.6.1", | ||
41 | "gulp-connect": "^5.6.1", | ||
42 | "gulp-htmlmin": "^5.0.1", | ||
43 | "gulp-jshint": "^2.1.0", | ||
44 | "gulp-rename": "^1.4.0", | ||
45 | "gulp-replace": "^1.0.0", | ||
46 | "gulp-uglify": "^3.0.1", | ||
47 | "gulp-uglify-es": "^1.0.4", | ||
48 | "jasmine-core": "^3.2.1", | ||
49 | "jquery": "^3.3.1", | ||
50 | "jshint": "^2.9.6", | ||
51 | "ladda": "1.0.6", | ||
52 | "pre-commit": "^1.2.2", | ||
53 | "pump": "^3.0.0", | ||
54 | "ui-bootstrap4": "^3.0.5" | ||
55 | } | ||
56 | } | ||
57 |
src/etc/develop.js.ejemplo
File was created | 1 | angular.module('focaBusquedaCliente') | |
2 | .constant("API_ENDPOINT", { | ||
3 | 'URL': '//127.0.0.1:9000' | ||
4 | }); | ||
5 |
src/js/app.js
File was created | 1 | angular.module('focaOrdenCarga', [ | |
2 | 'ui.bootstrap', | ||
3 | 'focaDirectivas', | ||
4 | 'angular-ladda' | ||
5 | ]); | ||
6 |
src/js/controller.js
File was created | 1 | angular.module('focaOrdenCarga') | |
2 | .controller('focaOrdenCargaController', [ | ||
3 | '$scope', | ||
4 | function ($scope) { | ||
5 | |||
6 | //#region VARIABLES | ||
7 | |||
8 | //#endregion | ||
9 | |||
10 | //#region METODOS | ||
11 | init(); | ||
12 | |||
13 | function init() { | ||
14 | } | ||
15 | //#endregion | ||
16 | } | ||
17 | ]); | ||
18 |
src/js/service.js
File was created | 1 | angular.module('focaOrdenCarga') | |
2 | .factory('focaOrdenCargaService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | ||
3 | return { | ||
4 | postLogin: function(login) { | ||
5 | return $http.post(API_ENDPOINT.URL + '/login/crear', login); | ||
6 | } | ||
7 | }; | ||
8 | }]); | ||
9 |
src/views/modal-login.html