Commit 89f471c92c4c1cd26ee061316307d3e2e0277bf1
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request !7
Showing
3 changed files
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "wrapper-demo", | 2 | "name": "wrapper-demo", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "", | 4 | "description": "", |
5 | "main": "main.js", | 5 | "main": "main.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "initdev": "npm install gulp --global && npm install && npm install -g jshint", | 7 | "initdev": "npm install gulp --global && npm install && npm install -g jshint", |
8 | "gulp-pre-commit": "gulp pre-commit", | 8 | "gulp-pre-commit": "gulp pre-commit", |
9 | "compile": "gulp uglify && gulp sass", | 9 | "compile": "gulp uglify && gulp sass", |
10 | "actualizar": "git pull origin master", | 10 | "actualizar": "git pull origin master", |
11 | "install-dev": "gulp pre-install && npm install && gulp post-install" | 11 | "install-dev": "gulp pre-install && npm install && gulp post-install" |
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": "git@debonline.dyndns.org:npm/wrapper-demo.git" | 18 | "url": "git@debonline.dyndns.org:npm/wrapper-demo.git" |
19 | }, | 19 | }, |
20 | "author": "Foca Software", | 20 | "author": "Foca Software", |
21 | "license": "ISC", | 21 | "license": "ISC", |
22 | "dependencies": { | 22 | "dependencies": { |
23 | "angular": "^1.7.7", | 23 | "angular": "^1.7.8", |
24 | "angular-chart.js": "1.1.1", | 24 | "angular-chart.js": "1.1.1", |
25 | "angular-cookies": "^1.7.7", | 25 | "angular-cookies": "^1.7.8", |
26 | "angular-i18n": "^1.7.7", | 26 | "angular-i18n": "^1.7.8", |
27 | "angular-ladda": "^0.4.3", | 27 | "angular-ladda": "^0.4.3", |
28 | "angular-route": "^1.7.7", | 28 | "angular-route": "^1.7.8", |
29 | "angular-sanitize": "^1.7.7", | 29 | "angular-sanitize": "^1.7.8", |
30 | "angular-ui-swiper": "^2.3.8", | 30 | "angular-ui-swiper": "^2.3.8", |
31 | "bootstrap": "^4.3.1", | 31 | "bootstrap": "^4.3.1", |
32 | "chart.js": "2.7.3", | 32 | "chart.js": "2.7.3", |
33 | "foca-abm-chofer": "git+http://git.focasoftware.com/npm/foca-abm-chofer.git", | 33 | "foca-abm-chofer": "git+http://git.focasoftware.com/npm/foca-abm-chofer.git", |
34 | "foca-abm-plazo-pago": "git+http://git.focasoftware.com/npm/foca-abm-plazo-pago.git", | 34 | "foca-abm-plazo-pago": "git+http://git.focasoftware.com/npm/foca-abm-plazo-pago.git", |
35 | "foca-abm-precios-condiciones": "git+http://git.focasoftware.com/npm/foca-abm-precios-condiciones.git", | 35 | "foca-abm-precios-condiciones": "git+http://git.focasoftware.com/npm/foca-abm-precios-condiciones.git", |
36 | "foca-abm-sectores": "git+http://git.focasoftware.com/npm/foca-abm-sectores.git", | 36 | "foca-abm-sectores": "git+http://git.focasoftware.com/npm/foca-abm-sectores.git", |
37 | "foca-abm-vehiculo": "git+http://git.focasoftware.com/npm/foca-abm-vehiculo.git", | 37 | "foca-abm-vehiculo": "git+http://git.focasoftware.com/npm/foca-abm-vehiculo.git", |
38 | "foca-abm-vendedor-cobrador": "git+http://git.focasoftware.com/npm/foca-abm-vendedor-cobrador.git", | 38 | "foca-abm-vendedor-cobrador": "git+http://git.focasoftware.com/npm/foca-abm-vendedor-cobrador.git", |
39 | "foca-activar-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-activar-hoja-ruta.git", | 39 | "foca-activar-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-activar-hoja-ruta.git", |
40 | "foca-admin-seguimiento": "git+http://git.focasoftware.com/npm/foca-admin-seguimiento.git", | 40 | "foca-admin-seguimiento": "git+http://git.focasoftware.com/npm/foca-admin-seguimiento.git", |
41 | "foca-botonera-facturador": "git+http://git.focasoftware.com/npm/foca-botonera-facturador.git", | 41 | "foca-botonera-facturador": "git+http://git.focasoftware.com/npm/foca-botonera-facturador.git", |
42 | "foca-botonera-lateral": "git+http://git.focasoftware.com/npm/foca-botonera-lateral.git", | 42 | "foca-botonera-lateral": "git+http://git.focasoftware.com/npm/foca-botonera-lateral.git", |
43 | "foca-botonera-principal": "git+http://git.focasoftware.com/npm/foca-botonera-principal.git", | 43 | "foca-botonera-principal": "git+http://git.focasoftware.com/npm/foca-botonera-principal.git", |
44 | "foca-busqueda-cliente": "git+http://git.focasoftware.com/npm/foca-busqueda-cliente.git", | 44 | "foca-busqueda-cliente": "git+http://git.focasoftware.com/npm/foca-busqueda-cliente.git", |
45 | "foca-cabecera-facturador": "git+http://git.focasoftware.com/npm/foca-cabecera-facturador.git", | 45 | "foca-cabecera-facturador": "git+http://git.focasoftware.com/npm/foca-cabecera-facturador.git", |
46 | "foca-configuracion": "git+http://git.focasoftware.com/npm/foca-configuracion.git", | 46 | "foca-configuracion": "git+http://git.focasoftware.com/npm/foca-configuracion.git", |
47 | "foca-crear-cobranza": "git+http://git.focasoftware.com/npm/foca-crear-cobranza.git", | 47 | "foca-crear-cobranza": "git+http://git.focasoftware.com/npm/foca-crear-cobranza.git", |
48 | "foca-crear-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-crear-hoja-ruta.git", | 48 | "foca-crear-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-crear-hoja-ruta.git", |
49 | "foca-crear-login": "git+http://git.focasoftware.com/npm/foca-crear-login.git", | 49 | "foca-crear-login": "git+http://git.focasoftware.com/npm/foca-crear-login.git", |
50 | "foca-crear-nota-pedido": "git+http://git.focasoftware.com/npm/foca-crear-nota-pedido.git", | 50 | "foca-crear-nota-pedido": "git+http://git.focasoftware.com/npm/foca-crear-nota-pedido.git", |
51 | "foca-crear-remito": "git+http://git.focasoftware.com/npm/foca-crear-remito.git", | 51 | "foca-crear-remito": "git+http://git.focasoftware.com/npm/foca-crear-remito.git", |
52 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", | 52 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", |
53 | "foca-estado-cisternas": "git+http://git.focasoftware.com/npm/foca-estado-cisternas.git", | 53 | "foca-estado-cisternas": "git+http://git.focasoftware.com/npm/foca-estado-cisternas.git", |
54 | "foca-filtros": "git+http://git.focasoftware.com/npm/foca-filtros.git", | 54 | "foca-filtros": "git+http://git.focasoftware.com/npm/foca-filtros.git", |
55 | "foca-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-hoja-ruta.git", | 55 | "foca-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-hoja-ruta.git", |
56 | "foca-login": "git+http://git.focasoftware.com/npm/foca-login.git", | 56 | "foca-login": "git+http://git.focasoftware.com/npm/foca-login.git", |
57 | "foca-logistica-pedido-ruta": "git+http://git.focasoftware.com/npm/foca-logistica-pedido-ruta.git", | 57 | "foca-logistica-pedido-ruta": "git+http://git.focasoftware.com/npm/foca-logistica-pedido-ruta.git", |
58 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git", | 58 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git", |
59 | "foca-modal-banco": "git+http://git.focasoftware.com/npm/foca-modal-banco.git", | ||
60 | "foca-modal-busqueda-productos": "git+http://git.focasoftware.com/npm/foca-modal-busqueda-productos.git", | 59 | "foca-modal-busqueda-productos": "git+http://git.focasoftware.com/npm/foca-modal-busqueda-productos.git", |
61 | "foca-modal-cheque": "git+http://git.focasoftware.com/npm/foca-modal-cheque.git", | 60 | "foca-modal-cheque": "git+http://git.focasoftware.com/npm/foca-modal-cheque.git", |
62 | "foca-modal-chofer": "git+http://git.focasoftware.com/npm/foca-modal-chofer.git", | ||
63 | "foca-modal-cobrador": "git+http://git.focasoftware.com/npm/foca-modal-cobrador.git", | ||
64 | "foca-modal-cobranza": "git+http://git.focasoftware.com/npm/foca-modal-cobranza.git", | 61 | "foca-modal-cobranza": "git+http://git.focasoftware.com/npm/foca-modal-cobranza.git", |
65 | "foca-modal-cotizacion": "git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git", | 62 | "foca-modal-cotizacion": "git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git", |
66 | "foca-modal-detalle-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-modal-detalle-hoja-ruta.git", | 63 | "foca-modal-detalle-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-modal-detalle-hoja-ruta.git", |
67 | "foca-modal-detalles": "git+http://git.focasoftware.com/npm/foca-modal-detalles.git", | 64 | "foca-modal-detalles": "git+http://git.focasoftware.com/npm/foca-modal-detalles.git", |
68 | "foca-modal-domicilio": "git+http://git.focasoftware.com/npm/foca-modal-domicilio.git", | 65 | "foca-modal-domicilio": "git+http://git.focasoftware.com/npm/foca-modal-domicilio.git", |
69 | "foca-modal-efectivo": "git+http://git.focasoftware.com/npm/foca-modal-efectivo.git", | 66 | "foca-modal-efectivo": "git+http://git.focasoftware.com/npm/foca-modal-efectivo.git", |
70 | "foca-modal-factura": "git+http://git.focasoftware.com/npm/foca-modal-factura.git", | 67 | "foca-modal-factura": "git+http://git.focasoftware.com/npm/foca-modal-factura.git", |
71 | "foca-modal-factura-detalle": "git+http://git.focasoftware.com/npm/foca-modal-factura-detalle.git", | 68 | "foca-modal-factura-detalle": "git+http://git.focasoftware.com/npm/foca-modal-factura-detalle.git", |
72 | "foca-modal-flete": "git+http://git.focasoftware.com/npm/foca-modal-flete.git", | 69 | "foca-modal-flete": "git+http://git.focasoftware.com/npm/foca-modal-flete.git", |
73 | "foca-modal-lista-precio": "git+http://git.focasoftware.com/npm/foca-modal-lista-precio.git", | 70 | "foca-modal-lista-precio": "git+http://git.focasoftware.com/npm/foca-modal-lista-precio.git", |
74 | "foca-modal-localidad": "git+http://git.focasoftware.com/npm/foca-modal-localidad.git", | ||
75 | "foca-modal-login": "git+http://git.focasoftware.com/npm/foca-modal-login.git", | 71 | "foca-modal-login": "git+http://git.focasoftware.com/npm/foca-modal-login.git", |
76 | "foca-modal-moneda": "git+http://git.focasoftware.com/npm/foca-modal-moneda.git", | ||
77 | "foca-modal-nota-pedido": "git+http://git.focasoftware.com/npm/foca-modal-nota-pedido.git", | 72 | "foca-modal-nota-pedido": "git+http://git.focasoftware.com/npm/foca-modal-nota-pedido.git", |
78 | "foca-modal-precio-condiciones": "git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git", | 73 | "foca-modal-precio-condiciones": "git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git", |
79 | "foca-modal-proveedor": "git+http://git.focasoftware.com/npm/foca-modal-proveedor.git", | ||
80 | "foca-modal-provincia": "git+http://git.focasoftware.com/npm/foca-modal-provincia.git", | ||
81 | "foca-modal-punto-descarga": "git+http://git.focasoftware.com/npm/foca-modal-punto-descarga.git", | 74 | "foca-modal-punto-descarga": "git+http://git.focasoftware.com/npm/foca-modal-punto-descarga.git", |
82 | "foca-modal-remito": "git+http://git.focasoftware.com/npm/foca-modal-remito.git", | 75 | "foca-modal-remito": "git+http://git.focasoftware.com/npm/foca-modal-remito.git", |
83 | "foca-modal-tarifa-flete": "git+http://git.focasoftware.com/npm/foca-modal-tarifa-flete.git", | 76 | "foca-modal-tarifa-flete": "git+http://git.focasoftware.com/npm/foca-modal-tarifa-flete.git", |
84 | "foca-modal-transportista": "git+http://git.focasoftware.com/npm/foca-modal-transportista.git", | ||
85 | "foca-modal-unidad-medida": "git+http://git.focasoftware.com/npm/foca-modal-unidad-medida.git", | 77 | "foca-modal-unidad-medida": "git+http://git.focasoftware.com/npm/foca-modal-unidad-medida.git", |
86 | "foca-modal-vehiculo": "git+http://git.focasoftware.com/npm/foca-modal-vehiculo.git", | ||
87 | "foca-modal-vendedores": "git+http://git.focasoftware.com/npm/foca-modal-vendedores.git", | ||
88 | "foca-nombre-empresa": "git+http://git.focasoftware.com/npm/foca-nombre-empresa.git", | 78 | "foca-nombre-empresa": "git+http://git.focasoftware.com/npm/foca-nombre-empresa.git", |
89 | "foca-seguimiento": "git+http://git.focasoftware.com/npm/foca-seguimiento.git", | 79 | "foca-seguimiento": "git+http://git.focasoftware.com/npm/foca-seguimiento.git", |
90 | "foca-sqlite": "git+http://git.focasoftware.com/npm/foca-sqlite.git", | 80 | "foca-sqlite": "git+http://git.focasoftware.com/npm/foca-sqlite.git", |
91 | "foca-teclado": "git+http://git.focasoftware.com/npm/foca-teclado.git", | 81 | "foca-teclado": "git+http://git.focasoftware.com/npm/foca-teclado.git", |
92 | "font-awesome": "^4.7.0", | 82 | "font-awesome": "^4.7.0", |
93 | "gulp-angular-templatecache": "^2.2.1", | 83 | "gulp-angular-templatecache": "^2.2.1", |
94 | "gulp-htmlmin": "^5.0.1", | 84 | "gulp-htmlmin": "^5.0.1", |
95 | "gulp-uglify": "^3.0.1", | 85 | "gulp-sequence": "^1.0.0", |
96 | "gulp-uglify-es": "^1.0.4", | 86 | "gulp-uglify-es": "^1.0.4", |
97 | "jquery": "^3.3.1", | 87 | "jquery": "^3.3.1", |
98 | "ladda": "1.0.6", | 88 | "ladda": "1.0.6", |
99 | "leaflet": "1.3.4", | 89 | "leaflet": "1.3.4", |
100 | "moment": "2.23.0", | 90 | "moment": "2.23.0", |
101 | "ngstorage": "^0.3.11", | 91 | "ngstorage": "^0.3.11", |
102 | "node-sass": "^4.10.0", | 92 | "node-sass": "^4.10.0", |
103 | "uglify": "^0.1.5", | 93 | "uglify": "^0.1.5", |
104 | "ui-bootstrap4": "^3.0.6" | 94 | "ui-bootstrap4": "^3.0.6" |
105 | }, | 95 | }, |
106 | "devDependencies": { | 96 | "devDependencies": { |
107 | "gulp": "3.9.1", | 97 | "gulp": "3.9.1", |
108 | "gulp-clean": "^0.4.0", | 98 | "gulp-clean": "^0.4.0", |
109 | "gulp-concat": "^2.6.1", | 99 | "gulp-concat": "^2.6.1", |
110 | "gulp-connect": "^5.6.1", | 100 | "gulp-connect": "^5.6.1", |
111 | "gulp-jshint": "^2.1.0", | 101 | "gulp-jshint": "^2.1.0", |
112 | "gulp-rename": "^1.4.0", | 102 | "gulp-rename": "^1.4.0", |
113 | "gulp-replace": "^1.0.0", | 103 | "gulp-replace": "^1.0.0", |
114 | "gulp-sass": "^4.0.1", | 104 | "gulp-sass": "^4.0.1", |
115 | "gulp-uglify": "^1.0.4", | 105 | "gulp-uglify": "^3.0.2", |
116 | "gulp-watch": "^5.0.1", | 106 | "gulp-watch": "^5.0.1", |
117 | "jasmine-core": "^3.2.1", | 107 | "jasmine-core": "^3.2.1", |
118 | "jshint": "^2.10.1", | 108 | "jshint": "^2.10.1", |
119 | "pre-commit": "^1.2.2", | 109 | "pre-commit": "^1.2.2", |
120 | "pump": "^3.0.0" | 110 | "pump": "^3.0.0" |
121 | } | 111 | } |
122 | } | 112 | } |
123 | 113 |
src/js/controller.js
1 | angular.module('appWrapperDemo') | 1 | angular.module('appWrapperDemo') |
2 | .controller('appWrapperDemoController', [ | 2 | .controller('appWrapperDemoController', [ |
3 | '$scope', | 3 | '$scope', |
4 | '$rootScope', | 4 | '$rootScope', |
5 | '$timeout', | 5 | '$timeout', |
6 | 'focaSqliteService', | 6 | 'focaSqliteService', |
7 | 'API_ENDPOINT', | ||
8 | 'focaModalService', | 7 | 'focaModalService', |
9 | function($scope, $rootScope, $timeout, focaSqliteService, API_ENDPOINT, focaModalService) { | 8 | 'API_ENDPOINT', |
9 | '$localStorage', | ||
10 | function($scope, $rootScope, $timeout, focaSqliteService, focaModalService, API_ENDPOINT, $localStorage) { | ||
10 | document.addEventListener('deviceready', function() { | 11 | document.addEventListener('deviceready', function() { |
11 | focaSqliteService.openDataBase(); | 12 | focaSqliteService.openDataBase(); |
12 | }); | 13 | }); |
13 | 14 | ||
14 | if (!API_ENDPOINT.URL) { | 15 | if (!API_ENDPOINT.URL) { |
15 | API_ENDPOINT.getUrl().then(success, error); | 16 | API_ENDPOINT.getUrl().then(success, err); |
16 | } | 17 | } |
17 | 18 | ||
18 | function success(res) { | 19 | function success(res) { |
20 | |||
19 | API_ENDPOINT.setUrl(res.data); | 21 | API_ENDPOINT.setUrl(res.data); |
20 | } | 22 | } |
21 | function error() { | 23 | function err() { |
22 | focaModalService.alert('La terminal no esta configurada correctamente'); | ||
23 | } | ||
24 | 24 | ||
25 | $timeout(function() { | ||
26 | focaModalService.alert('Terminal no configurada: \n' + $localStorage.terminalKey); | ||
27 | }, 1000); | ||
28 | } | ||
25 | $scope.usarTeclado = false; | 29 | $scope.usarTeclado = false; |
26 | $rootScope.$broadcast('usarTeclado', false); | 30 | $rootScope.$broadcast('usarTeclado', false); |
27 | $scope.mostrarTeclado = false; | 31 | $scope.mostrarTeclado = false; |
28 | //Envía broadcast para avisar que el teclado está en funcionamiento o no | 32 | //Envía broadcast para avisar que el teclado está en funcionamiento o no |
29 | //para su uso cambiar ng-click del boton por esta función | 33 | //para su uso cambiar ng-click del boton por esta función |
30 | $scope.cambioUsoTeclado = function() { | 34 | $scope.cambioUsoTeclado = function() { |
31 | if($scope.usarTeclado) { | 35 | if($scope.usarTeclado) { |
32 | $scope.usarTeclado = false; | 36 | $scope.usarTeclado = false; |
33 | $rootScope.$broadcast('usarTeclado', false); | 37 | $rootScope.$broadcast('usarTeclado', false); |
34 | return; | 38 | return; |
35 | } | 39 | } |
36 | $scope.usarTeclado = true; | 40 | $scope.usarTeclado = true; |
37 | $rootScope.$broadcast('usarTeclado', true); | 41 | $rootScope.$broadcast('usarTeclado', true); |
38 | }; | 42 | }; |
39 | 43 | ||
40 | $rootScope.$on('focus', function() { | 44 | $rootScope.$on('focus', function() { |
41 | if(!$scope.usarTeclado) { | 45 | if(!$scope.usarTeclado) { |
42 | return; | 46 | return; |
43 | } | 47 | } |
44 | $scope.mostrarTeclado = true; | 48 | $scope.mostrarTeclado = true; |
45 | $timeout.cancel($scope.timeout); | 49 | $timeout.cancel($scope.timeout); |
46 | if(!$scope.$$phase) { | 50 | if(!$scope.$$phase) { |
47 | $scope.$apply(); | 51 | $scope.$apply(); |
48 | } | 52 | } |
49 | }); | 53 | }); |
50 | $rootScope.$on('blur', function() { | 54 | $rootScope.$on('blur', function() { |
51 | $scope.timeout = $timeout(function() { | 55 | $scope.timeout = $timeout(function() { |
52 | $scope.mostrarTeclado = false; | 56 | $scope.mostrarTeclado = false; |
53 | if(!$scope.$$phase) { | 57 | if(!$scope.$$phase) { |
54 | $scope.$apply(); | 58 | $scope.$apply(); |
55 | } | 59 | } |
56 | }, 150); | 60 | }, 150); |
57 | }); | 61 | }); |
src/js/service.js
1 | angular.module('appWrapperDemo') | 1 | angular.module('appWrapperDemo') |
2 | .factory('API_ENDPOINT', [ | 2 | .factory('API_ENDPOINT', [ |
3 | '$http', | 3 | '$http', |
4 | '$localStorage', | 4 | '$localStorage', |
5 | 'ENDPOINT_BASE', | 5 | 'ENDPOINT_BASE', |
6 | function($http, $localStorage, ENDPOINT_BASE) { | 6 | function($http, $localStorage, ENDPOINT_BASE) { |
7 | 7 | return { | |
8 | var direccion = ENDPOINT_BASE; | 8 | URL: $localStorage.urlEndPoint, |
9 | 9 | ENDPOINT_BASE: ENDPOINT_BASE, | |
10 | return { | 10 | setUrl: function(url) { |
11 | URL: $localStorage.urlEndPoint, | 11 | this.URL = url; |
12 | setUrl: function(url) { | 12 | $localStorage.urlEndPoint = url; |
13 | this.URL = url; | 13 | }, |
14 | $localStorage.urlEndPoint = url; | 14 | getUrl: function() { |
15 | }, | 15 | return $http.get(this.ENDPOINT_BASE + '/terminal/consultar'); |
16 | getUrl: function() { | 16 | } |
17 | return $http.get(direccion + '/terminal/consultar'); | 17 | }; |
18 | } | 18 | }]); |
19 | }; | ||
20 | }]); | ||
21 | 19 |