Commit 5a5cb94b5aed26f66c7e296e6803190335b60a76
Exists in
develop
Merge branch 'develop' into 'master'
Develop See merge request !43
Showing
10 changed files
Show diff stats
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-modal", | 2 | "name": "foca-modal", |
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
| 4 | "description": "Modales de foca", | 4 | "description": "Modales de foca", |
| 5 | "main": "index.js", | 5 | "main": "index.js", |
| 6 | "scripts": { | 6 | "scripts": { |
| 7 | "refresh": "gulp uglify && cp tmp/foca-modal.js ../wrapper-demo/node_modules/foca-modal/dist/foca-modal.min.js", | ||
| 7 | "test": "echo \"Error: no test specified\" && exit 1", | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
| 8 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 9 | "compile": "gulp uglify", | 10 | "compile": "gulp uglify", |
| 10 | "postinstall": "npm run compile && gulp clean-post-install", | 11 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | "install-dev": "npm install -D angular gulp gulp-angular-templatecache gulp-clean gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify jshint pump git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git" | 12 | "install-dev": "npm install -D angular gulp gulp-angular-templatecache gulp-clean gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify jshint pump git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git" |
| 12 | }, | 13 | }, |
| 13 | "pre-commit": [ | 14 | "pre-commit": [ |
| 14 | "gulp-pre-commit" | 15 | "gulp-pre-commit" |
| 15 | ], | 16 | ], |
| 16 | "repository": { | 17 | "repository": { |
| 17 | "type": "git", | 18 | "type": "git", |
| 18 | "url": "http://git.focasoftware.com/npm/foca-modal.git" | 19 | "url": "http://git.focasoftware.com/npm/foca-modal.git" |
| 19 | }, | 20 | }, |
| 20 | "author": "Foca Software", | 21 | "author": "Foca Software", |
| 21 | "license": "ISC", | 22 | "license": "ISC", |
| 22 | "peerDependencies": { | 23 | "peerDependencies": { |
| 23 | "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git" | 24 | "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git" |
| 24 | }, | 25 | }, |
| 25 | "devDependencies": { | 26 | "devDependencies": { |
| 26 | "angular": "^1.7.5", | 27 | "angular": "^1.7.5", |
| 27 | "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git", | 28 | "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git", |
| 28 | "gulp": "^3.9.1", | 29 | "gulp": "^3.9.1", |
| 29 | "gulp-angular-templatecache": "^2.2.5", | 30 | "gulp-angular-templatecache": "^2.2.5", |
| 30 | "gulp-clean": "^0.4.0", | 31 | "gulp-clean": "^0.4.0", |
| 31 | "gulp-connect": "^5.7.0", | 32 | "gulp-connect": "^5.7.0", |
| 32 | "gulp-htmlmin": "^5.0.1", | 33 | "gulp-htmlmin": "^5.0.1", |
| 33 | "gulp-jshint": "^2.1.0", | 34 | "gulp-jshint": "^2.1.0", |
| 34 | "gulp-rename": "^1.4.0", | 35 | "gulp-rename": "^1.4.0", |
| 35 | "gulp-replace": "^1.0.0", | 36 | "gulp-replace": "^1.0.0", |
| 36 | "gulp-uglify": "^3.0.1", | 37 | "gulp-uglify": "^3.0.1", |
| 37 | "jshint": "^2.9.7", | 38 | "jshint": "^2.9.7", |
| 38 | "pump": "^3.0.0" | 39 | "pump": "^3.0.0" |
| 39 | } | 40 | } |
| 40 | } | 41 | } |
| 41 | 42 |
src/js/controller.js
| 1 | angular.module('focaModal') | 1 | angular.module('focaModal') |
| 2 | .controller('focaModalConfirmController', [ | 2 | .controller('focaModalConfirmController', [ |
| 3 | '$uibModalInstance', '$scope', 'textoModal', | 3 | '$uibModalInstance', '$scope', 'textoModal', |
| 4 | function($uibModalInstance, $scope, textoModal) { | 4 | function($uibModalInstance, $scope, textoModal) { |
| 5 | $scope.textoModal = textoModal; | 5 | $scope.textoModal = textoModal; |
| 6 | $scope.cancelar = function() { | 6 | $scope.cancelar = function() { |
| 7 | $uibModalInstance.dismiss(false); | 7 | $uibModalInstance.dismiss(false); |
| 8 | }; | 8 | }; |
| 9 | $scope.aceptar = function() { | 9 | $scope.aceptar = function() { |
| 10 | $uibModalInstance.close(true); | 10 | $uibModalInstance.close(true); |
| 11 | }; | 11 | }; |
| 12 | } | 12 | } |
| 13 | ]) | 13 | ]) |
| 14 | .controller('focaModalInfoController', [ | ||
| 15 | '$uibModalInstance', '$scope', 'textoModal', | ||
| 16 | function($uibModalInstance, $scope, textoModal) { | ||
| 17 | $scope.textoModal = textoModal; | ||
| 18 | $scope.aceptar = function() { | ||
| 19 | $uibModalInstance.close(true); | ||
| 20 | }; | ||
| 21 | } | ||
| 22 | ]) | ||
| 14 | .controller('focaModalAlertController', [ | 23 | .controller('focaModalAlertController', [ |
| 15 | '$uibModalInstance', '$scope', 'textoModal', | 24 | '$uibModalInstance', '$scope', 'textoModal', |
| 16 | function($uibModalInstance, $scope, textoModal) { | 25 | function($uibModalInstance, $scope, textoModal) { |
| 17 | $scope.textoModal = textoModal; | 26 | $scope.textoModal = textoModal; |
| 18 | $scope.aceptar = function() { | 27 | $scope.aceptar = function() { |
| 19 | $uibModalInstance.close(true); | 28 | $uibModalInstance.close(true); |
| 20 | }; | 29 | }; |
| 21 | } | 30 | } |
| 22 | ]) | 31 | ]) |
| 23 | .controller('focaModalFechaController', [ | 32 | .controller('focaModalFechaController', [ |
| 24 | '$uibModalInstance', '$scope', 'parametros', | 33 | '$uibModalInstance', '$scope', 'parametros', |
| 25 | function($uibModalInstance, $scope, parametros) { | 34 | function($uibModalInstance, $scope, parametros) { |
| 26 | $scope.parametros = parametros; | 35 | $scope.parametros = parametros; |
| 27 | $scope.fecha = new Date(); | 36 | $scope.fecha = new Date(); |
| 28 | $scope.options = {}; | 37 | $scope.options = {}; |
| 29 | 38 | ||
| 30 | if (parametros.minDate) $scope.options.minDate = parametros.minDate; | 39 | if (parametros.minDate) $scope.options.minDate = parametros.minDate; |
| 31 | 40 | ||
| 32 | $scope.cancelar = function() { | 41 | $scope.cancelar = function() { |
| 33 | $uibModalInstance.dismiss(); | 42 | $uibModalInstance.dismiss(); |
| 34 | }; | 43 | }; |
| 35 | $scope.aceptar = function() { | 44 | $scope.aceptar = function() { |
| 36 | $uibModalInstance.close($scope.fecha); | 45 | $uibModalInstance.close($scope.fecha); |
| 37 | }; | 46 | }; |
| 38 | } | 47 | } |
| 39 | ]) | 48 | ]) |
| 40 | .controller('focaModalPromptController', [ | 49 | .controller('focaModalPromptController', [ |
| 41 | '$uibModalInstance', '$scope', 'options', 'focaModalService', | 50 | '$uibModalInstance', '$scope', 'options', 'focaModalService', |
| 42 | function($uibModalInstance, $scope, options, focaModalService) { | 51 | function($uibModalInstance, $scope, options, focaModalService) { |
| 43 | 52 | ||
| 44 | $scope.options = options; | 53 | $scope.options = options; |
| 54 | |||
| 55 | if (!$scope.options.tipo) { | ||
| 56 | $scope.options.tipo = 'text' | ||
| 57 | } | ||
| 45 | $scope.cancelar = function() { | 58 | $scope.cancelar = function() { |
| 46 | $uibModalInstance.dismiss(); | 59 | $uibModalInstance.dismiss(); |
| 47 | }; | 60 | }; |
| 48 | $scope.aceptar = function(key) { | 61 | $scope.aceptar = function(key) { |
| 49 | if (key === 13) { | 62 | if (key === 13) { |
| 50 | if (options.email && !validateEmails($scope.options.value)) { | 63 | if (options.email && !validateEmails($scope.options.value)) { |
| 51 | focaModalService.alert('Ingrese email/s válido/s'); | 64 | focaModalService.alert('Ingrese email/s válido/s'); |
| 52 | return; | 65 | return; |
| 53 | } | 66 | } |
| 54 | $uibModalInstance.close($scope.options.value); | 67 | $uibModalInstance.close($scope.options.value); |
| 55 | } | 68 | } |
| 56 | }; | 69 | }; |
| 57 | 70 | ||
| 58 | function validateEmails(emails) { | 71 | function validateEmails(emails) { |
| 59 | var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | 72 | var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
| 60 | var arr = emails.split(','); | 73 | var arr = emails.split(','); |
| 61 | var result = true; | 74 | var result = true; |
| 62 | 75 | ||
| 63 | arr.forEach(function(email) { | 76 | arr.forEach(function(email) { |
| 64 | var val = String(email).trim().toLowerCase(); | 77 | var val = String(email).trim().toLowerCase(); |
| 65 | 78 | ||
| 66 | if (!re.test(val)) result = false; | 79 | if (!re.test(val)) result = false; |
| 67 | }); | 80 | }); |
| 68 | 81 | ||
| 69 | return result; | 82 | return result; |
| 70 | } | 83 | } |
| 71 | } | 84 | } |
| 72 | ]); | 85 | ]); |
| 73 | 86 |
src/js/controllerMail.js
| 1 | angular.module('focaModal') | 1 | angular.module('focaModal') |
| 2 | .controller('focaModalMailController', [ | 2 | .controller('focaModalMailController', [ |
| 3 | '$scope', | 3 | '$scope', |
| 4 | '$uibModalInstance', | 4 | '$uibModalInstance', |
| 5 | 'FileSaver', | 5 | 'FileSaver', |
| 6 | 'Blob', | 6 | 'Blob', |
| 7 | 'focaModalService', | 7 | 'focaModalService', |
| 8 | 'options', | 8 | 'options', |
| 9 | function($scope, $uibModalInstance, FileSaver, Blob, | 9 | function ($scope, $uibModalInstance, FileSaver, Blob, |
| 10 | focaModalService, options) { | 10 | focaModalService, options) { |
| 11 | 11 | ||
| 12 | var regexMail = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | 12 | var regexMail = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
| 13 | $scope.descargado = false; | 13 | $scope.descargado = false; |
| 14 | $scope.correoEnviado = false; | 14 | $scope.correoEnviado = false; |
| 15 | $scope.correoNoEnviado = false; | 15 | $scope.correoNoEnviado = false; |
| 16 | $scope.esperando = false; | 16 | $scope.esperando = false; |
| 17 | $scope.titulo = options.titulo; | 17 | $scope.titulo = options.titulo; |
| 18 | $scope.mailCliente = options.envio.mailCliente; | 18 | $scope.checkboxVar = false; |
| 19 | 19 | ||
| 20 | $scope.aceptar = function() { | 20 | $scope.aceptar = function () { |
| 21 | $uibModalInstance.close(); | 21 | $uibModalInstance.close(); |
| 22 | }; | 22 | }; |
| 23 | $scope.salir = function() { | 23 | $scope.salir = function () { |
| 24 | $uibModalInstance.close($scope.descargado); | 24 | $uibModalInstance.close($scope.descargado); |
| 25 | }; | 25 | }; |
| 26 | $scope.imprimir = function () { | 26 | $scope.validarImpresion = function () { |
| 27 | var rutaComprobante; | ||
| 28 | rutaComprobante = $scope.checkboxVar === true ? options.descargaSinValorizar : options.descarga; | ||
| 29 | imprimir(rutaComprobante); | ||
| 30 | } | ||
| 31 | imprimir = function (rutaComprobante) { | ||
| 27 | $scope.descargado = true; | 32 | $scope.descargado = true; |
| 28 | $scope.esperando = true; | 33 | $scope.esperando = true; |
| 29 | focaModalService | 34 | focaModalService |
| 30 | .imprimirComprobante(options.descarga.url, options.options) | 35 | .imprimirComprobante(rutaComprobante.url, options.options) |
| 31 | .then(function(res) { | 36 | .then(function (res) { |
| 32 | var data = new Blob([res.data], {type: 'application/pdf'}); | 37 | var data = new Blob([res.data], { type: 'application/pdf' }); |
| 33 | 38 | ||
| 34 | FileSaver.saveAs( | 39 | FileSaver.saveAs( |
| 35 | data, | 40 | data, |
| 36 | options.descarga.nombre | 41 | rutaComprobante.nombre |
| 37 | ); | 42 | ); |
| 38 | $scope.esperando = false; | 43 | $scope.esperando = false; |
| 39 | }); | 44 | }); |
| 40 | }; | 45 | }; |
| 41 | $scope.enviarCorreo = function(key) { | 46 | $scope.enviarComprobante = function () { |
| 47 | var rutaEnvioComprobante; | ||
| 48 | rutaEnvioComprobante = $scope.checkboxVar === true ? options.envioSinValorizar : options.envio; | ||
| 49 | enviarCorreo(rutaEnvioComprobante, 13); | ||
| 50 | } | ||
| 51 | enviarCorreo = function (rutaEnvioComprobante, key) { | ||
| 42 | if (key === 13) { | 52 | if (key === 13) { |
| 43 | if (!validarMail()) { | 53 | if (!validarMail()) { |
| 44 | focaModalService.alert('Ingrese email/s válido/s'); | 54 | focaModalService.alert('Ingrese email/s válido/s'); |
| 45 | return; | 55 | return; |
| 46 | } | 56 | } |
| 47 | $scope.descargado = true; | 57 | $scope.descargado = true; |
| 48 | $scope.esperando = true; | 58 | $scope.esperando = true; |
| 49 | Object.assign(options.options, {receiver: $scope.mailCliente}); | 59 | rutaEnvioComprobante.mailCliente = $scope.mailCliente; |
| 60 | Object.assign(options.options, { receiver: $scope.mailCliente }); | ||
| 50 | 61 | ||
| 51 | focaModalService | 62 | focaModalService |
| 52 | .enviarCorreo(options.envio.url, options.options) | 63 | .enviarCorreo(rutaEnvioComprobante.url, options.options) |
| 53 | .then(function() { | 64 | .then(function () { |
| 54 | $scope.correoEnviado = true; | 65 | $scope.correoEnviado = true; |
| 55 | $scope.esperando = false; | 66 | $scope.esperando = false; |
| 56 | }, function() { | 67 | }, function () { |
| 57 | $scope.esperando = false; | 68 | $scope.esperando = false; |
| 58 | $scope.correoNoEnviado = true; | 69 | $scope.correoNoEnviado = true; |
| 59 | }); | 70 | }); |
| 60 | } | 71 | } |
| 61 | }; | 72 | }; |
| 62 | function validarMail() { | 73 | function validarMail() { |
| 63 | var emails = $scope.mailCliente.split(','); | 74 | var emails = $scope.mailCliente.split(','); |
| 64 | var result = true; | 75 | var result = true; |
| 65 | emails.forEach(function(email) { | 76 | emails.forEach(function (email) { |
| 66 | if (!regexMail.test(email.trim())) result = false; | 77 | if (!regexMail.test(email.trim())) result = false; |
| 67 | }); | 78 | }); |
| 68 | return result; | 79 | return result; |
| 69 | } | 80 | } |
| 70 | } | 81 | } |
| 71 | ]); | 82 | ]); |
| 72 | 83 |
src/js/controllerModal.js
| 1 | angular.module('focaModal') | 1 | angular.module('focaModal') |
| 2 | .controller('focaModalController', [ | 2 | .controller('focaModalController', [ |
| 3 | '$timeout', | 3 | '$timeout', |
| 4 | '$filter', | 4 | '$filter', |
| 5 | '$scope', | 5 | '$scope', |
| 6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
| 7 | 'focaModalService', | 7 | 'focaModalService', |
| 8 | 'parametrosModal', | 8 | 'parametrosModal', |
| 9 | function($timeout, $filter, $scope, $uibModalInstance, focaModalService, parametrosModal) { | 9 | function($timeout, $filter, $scope, $uibModalInstance, focaModalService, parametrosModal) { |
| 10 | 10 | ||
| 11 | $scope.parametrosModal = parametrosModal; | 11 | $scope.parametrosModal = parametrosModal; |
| 12 | $scope.filters = parametrosModal.searchText || ''; | 12 | $scope.filters = parametrosModal.searchText || ''; |
| 13 | $scope.entidades = []; | 13 | $scope.entidades = []; |
| 14 | $scope.primerBusqueda = false; | 14 | $scope.primerBusqueda = false; |
| 15 | $scope.searchLoading = false; | 15 | $scope.searchLoading = false; |
| 16 | // pagination | 16 | // pagination |
| 17 | $scope.numPerPage = 10; | 17 | $scope.numPerPage = 10; |
| 18 | $scope.currentPage = 1; | 18 | $scope.currentPage = 1; |
| 19 | $scope.filteredEntidades = []; | 19 | $scope.filteredEntidades = []; |
| 20 | $scope.currentPageEntidades = []; | 20 | $scope.currentPageEntidades = []; |
| 21 | $scope.selectedEntidad = -1; | 21 | $scope.selectedEntidad = -1; |
| 22 | 22 | ||
| 23 | $scope.busquedaPress = function(key) { | 23 | $scope.busquedaPress = function(key) { |
| 24 | if (key === 13) { | 24 | if (key === 13) { |
| 25 | $scope.searchLoading = true; | 25 | $scope.searchLoading = true; |
| 26 | if (parametrosModal.query) { | 26 | if (parametrosModal.query) { |
| 27 | focaModalService.getEntidad( | 27 | focaModalService.getEntidad( |
| 28 | $scope.filters, | 28 | $scope.filters, |
| 29 | parametrosModal.query, | 29 | parametrosModal.query, |
| 30 | parametrosModal.tipo, | 30 | parametrosModal.tipo, |
| 31 | parametrosModal.json | 31 | parametrosModal.json |
| 32 | ).then( | 32 | ).then( |
| 33 | function(res) { | 33 | function(res) { |
| 34 | $scope.searchLoading = false; | 34 | $scope.searchLoading = false; |
| 35 | $scope.primerBusqueda = true; | 35 | $scope.primerBusqueda = true; |
| 36 | $scope.entidades = res.data; | 36 | $scope.entidades = res.data; |
| 37 | filtros($scope.entidades); | 37 | filtros($scope.entidades); |
| 38 | $scope.search(true); | 38 | $scope.search(true); |
| 39 | } | 39 | } |
| 40 | ); | 40 | ); |
| 41 | } else { | 41 | } else { |
| 42 | $scope.searchLoading = false; | 42 | $scope.searchLoading = false; |
| 43 | $scope.primerBusqueda = true; | 43 | $scope.primerBusqueda = true; |
| 44 | $scope.entidades = parametrosModal.data; | 44 | $scope.entidades = parametrosModal.data; |
| 45 | filtros($scope.entidades); | 45 | filtros($scope.entidades); |
| 46 | $scope.search(true); | 46 | $scope.search(true); |
| 47 | } | 47 | } |
| 48 | } | 48 | } |
| 49 | }; | 49 | }; |
| 50 | function filtros(entidades) { | 50 | function filtros(entidades) { |
| 51 | for (var i = 0; i < $scope.parametrosModal.columnas.length; i++) { | 51 | for (var i = 0; i < $scope.parametrosModal.columnas.length; i++) { |
| 52 | var filtro = $scope.parametrosModal.columnas[i].filtro; | 52 | var filtro = $scope.parametrosModal.columnas[i].filtro; |
| 53 | if (filtro) { | 53 | if (filtro) { |
| 54 | if (filtro.nombre === 'comprobante') { | 54 | if (filtro.nombre === 'comprobante') { |
| 55 | for (var j = 0; j < entidades.length; j++) { | 55 | for (var j = 0; j < entidades.length; j++) { |
| 56 | var array = []; | 56 | var array = []; |
| 57 | $scope.parametrosModal.columnas[i].propiedad | 57 | $scope.parametrosModal.columnas[i].propiedad |
| 58 | .forEach(function(prop) { | 58 | .forEach(function(prop) { |
| 59 | array.push(entidades[j][prop]); | 59 | array.push(entidades[j][prop]); |
| 60 | }); | 60 | }); |
| 61 | entidades[j][$scope.parametrosModal.columnas[i].propiedad] = | 61 | entidades[j][$scope.parametrosModal.columnas[i].propiedad] = |
| 62 | $filter('comprobante')(array); | 62 | $filter('comprobante')(array); |
| 63 | } | 63 | } |
| 64 | } else { | 64 | } else { |
| 65 | for (var j = 0; j < entidades.length; j++) { | 65 | for (var j = 0; j < entidades.length; j++) { |
| 66 | entidades[j][$scope.parametrosModal.columnas[i].propiedad] = | 66 | entidades[j][$scope.parametrosModal.columnas[i].propiedad] = |
| 67 | $filter(filtro.nombre)(entidades[j][$scope | 67 | $filter(filtro.nombre)(entidades[j][$scope |
| 68 | .parametrosModal.columnas[i].propiedad], filtro.parametro); | 68 | .parametrosModal.columnas[i].propiedad], filtro.parametro); |
| 69 | } | 69 | } |
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | $scope.search = function(pressed) { | 74 | $scope.search = function(pressed) { |
| 75 | if ($scope.entidades.length > 0) { | 75 | if ($scope.entidades.length > 0) { |
| 76 | $scope.filteredEntidades = $filter('filter')( | 76 | $scope.filteredEntidades = $filter('filter')( |
| 77 | $scope.entidades, { $: $scope.filters } | 77 | $scope.entidades, { $: $scope.filters } |
| 78 | ); | 78 | ); |
| 79 | $scope.lastPage = Math.ceil( | 79 | $scope.lastPage = Math.ceil( |
| 80 | $scope.filteredEntidades.length / $scope.numPerPage | 80 | $scope.filteredEntidades.length / $scope.numPerPage |
| 81 | ); | 81 | ); |
| 82 | $scope.resetPage(); | 82 | $scope.resetPage(); |
| 83 | } else if (pressed) { | 83 | } else if (pressed) { |
| 84 | $timeout(function() { | 84 | $timeout(function() { |
| 85 | angular.element('#search')[0].focus(); | 85 | angular.element('#search')[0].focus(); |
| 86 | $scope.filters = ''; | 86 | $scope.filters = ''; |
| 87 | }); | 87 | }); |
| 88 | } | 88 | } |
| 89 | }; | 89 | }; |
| 90 | 90 | ||
| 91 | $scope.resetPage = function() { | 91 | $scope.resetPage = function() { |
| 92 | $scope.currentPage = 1; | 92 | $scope.currentPage = 1; |
| 93 | $scope.selectPage(1); | 93 | $scope.selectPage(1); |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | $scope.selectPage = function(page) { | 96 | $scope.selectPage = function(page) { |
| 97 | var start = (page - 1) * $scope.numPerPage; | 97 | var start = (page - 1) * $scope.numPerPage; |
| 98 | var end = start + $scope.numPerPage; | 98 | var end = start + $scope.numPerPage; |
| 99 | $scope.paginas = []; | 99 | $scope.paginas = []; |
| 100 | $scope.paginas = calcularPages(page); | 100 | $scope.paginas = calcularPages(page); |
| 101 | $scope.currentPageEntidades = $scope.filteredEntidades.slice(start, end); | 101 | $scope.currentPageEntidades = $scope.filteredEntidades.slice(start, end); |
| 102 | $scope.currentPage = page; | 102 | $scope.currentPage = page; |
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | $scope.select = function(vendedor) { | 105 | $scope.select = function(vendedor) { |
| 106 | $uibModalInstance.close(vendedor); | 106 | $uibModalInstance.close(vendedor); |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | $scope.cancel = function() { | 109 | $scope.cancel = function() { |
| 110 | $uibModalInstance.dismiss('cancel'); | 110 | $uibModalInstance.dismiss('cancel'); |
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | $scope.busquedaDown = function(key) { | 113 | $scope.busquedaDown = function(key) { |
| 114 | if (key === 40) { | 114 | if (key === 40) { |
| 115 | primera(key); | 115 | primera(key); |
| 116 | } | 116 | } |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | $scope.itemEntidad = function(key) { | 119 | $scope.itemEntidad = function(key) { |
| 120 | if (key === 38) { | 120 | if (key === 38) { |
| 121 | anterior(key); | 121 | anterior(key); |
| 122 | } | 122 | } |
| 123 | if (key === 40) { | 123 | if (key === 40) { |
| 124 | siguiente(key); | 124 | siguiente(key); |
| 125 | } | 125 | } |
| 126 | if (key === 37) { | 126 | if (key === 37) { |
| 127 | retrocederPagina(); | 127 | retrocederPagina(); |
| 128 | } | 128 | } |
| 129 | if (key === 39) { | 129 | if (key === 39) { |
| 130 | avanzarPagina(); | 130 | avanzarPagina(); |
| 131 | } | 131 | } |
| 132 | }; | 132 | }; |
| 133 | $scope.esFecha = function(fecha) { | 133 | $scope.esFecha = function(fecha) { |
| 134 | if (fecha.includes('fecha')) { | 134 | if (fecha.includes('fecha')) { |
| 135 | return true; | 135 | return true; |
| 136 | } | 136 | } |
| 137 | return false; | 137 | return false; |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | function calcularPages(paginaActual) { | 140 | function calcularPages(paginaActual) { |
| 141 | var paginas = []; | 141 | var paginas = []; |
| 142 | paginas.push(paginaActual); | 142 | paginas.push(paginaActual); |
| 143 | 143 | ||
| 144 | if (paginaActual - 1 > 1) { | 144 | if (paginaActual - 1 > 1) { |
| 145 | 145 | ||
| 146 | paginas.unshift(paginaActual - 1); | 146 | paginas.unshift(paginaActual - 1); |
| 147 | if (paginaActual - 2 > 1) { | 147 | if (paginaActual - 2 > 1) { |
| 148 | paginas.unshift(paginaActual - 2); | 148 | paginas.unshift(paginaActual - 2); |
| 149 | } | 149 | } |
| 150 | } | 150 | } |
| 151 | if (paginaActual + 1 < $scope.lastPage) { | 151 | if (paginaActual + 1 < $scope.lastPage) { |
| 152 | paginas.push(paginaActual + 1); | 152 | paginas.push(paginaActual + 1); |
| 153 | if (paginaActual + 2 < $scope.lastPage) { | 153 | if (paginaActual + 2 < $scope.lastPage) { |
| 154 | paginas.push(paginaActual + 2); | 154 | paginas.push(paginaActual + 2); |
| 155 | } | 155 | } |
| 156 | } | 156 | } |
| 157 | if (paginaActual !== 1) { | 157 | if (paginaActual !== 1) { |
| 158 | paginas.unshift(1); | 158 | paginas.unshift(1); |
| 159 | } | 159 | } |
| 160 | if (paginaActual !== $scope.lastPage) { | 160 | if (paginaActual !== $scope.lastPage) { |
| 161 | paginas.push($scope.lastPage); | 161 | paginas.push($scope.lastPage); |
| 162 | } | 162 | } |
| 163 | return paginas; | 163 | return paginas; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | function primera() { | 166 | function primera() { |
| 167 | $scope.selectedEntidad = 0; | 167 | $scope.selectedEntidad = 0; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | function anterior() { | 170 | function anterior() { |
| 171 | if ($scope.selectedEntidad === 0 && $scope.currentPage > 1) { | 171 | if ($scope.selectedEntidad === 0 && $scope.currentPage > 1) { |
| 172 | retrocederPagina(); | 172 | retrocederPagina(); |
| 173 | } else { | 173 | } else { |
| 174 | $scope.selectedEntidad--; | 174 | $scope.selectedEntidad--; |
| 175 | } | 175 | } |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | function siguiente() { | 178 | function siguiente() { |
| 179 | if($scope.selectedEntidad < $scope.currentPageEntidades.length - 1) { | 179 | if($scope.selectedEntidad < $scope.currentPageEntidades.length - 1) { |
| 180 | $scope.selectedEntidad++; | 180 | $scope.selectedEntidad++; |
| 181 | } else { | 181 | } else { |
| 182 | avanzarPagina(); | 182 | avanzarPagina(); |
| 183 | } | 183 | } |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | function retrocederPagina() { | 186 | function retrocederPagina() { |
| 187 | if ($scope.currentPage > 1) { | 187 | if ($scope.currentPage > 1) { |
| 188 | $scope.selectPage($scope.currentPage - 1); | 188 | $scope.selectPage($scope.currentPage - 1); |
| 189 | $scope.selectedEntidad = $scope.numPerPage - 1; | 189 | $scope.selectedEntidad = $scope.numPerPage - 1; |
| 190 | } | 190 | } |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | function avanzarPagina() { | 193 | function avanzarPagina() { |
| 194 | if ($scope.currentPage < $scope.lastPage) { | 194 | if ($scope.currentPage < $scope.lastPage) { |
| 195 | $scope.selectPage($scope.currentPage + 1); | 195 | $scope.selectPage($scope.currentPage + 1); |
| 196 | $scope.selectedEntidad = 0; | 196 | $scope.selectedEntidad = 0; |
| 197 | } | 197 | } |
| 198 | } | 198 | } |
| 199 | $scope.busquedaPress(13); | 199 | $scope.busquedaPress(13); |
| 200 | 200 | ||
| 201 | $scope.clearInput = function(){ | 201 | $scope.clearInput = function() { |
| 202 | $scope.filters = ''; | 202 | $scope.filters = ''; |
| 203 | }; | 203 | }; |
| 204 | }] | 204 | }] |
| 205 | ); | 205 | ); |
| 206 | 206 |
src/js/service.js
| 1 | angular.module('focaModal') | 1 | angular.module('focaModal') |
| 2 | .factory('focaModalService', [ | 2 | .factory('focaModalService', [ |
| 3 | '$uibModal', 'API_ENDPOINT', '$http', | 3 | '$uibModal', 'API_ENDPOINT', '$http', |
| 4 | function($uibModal, API_ENDPOINT, $http) { | 4 | function($uibModal, API_ENDPOINT, $http) { |
| 5 | return { | 5 | return { |
| 6 | confirm: function(textoModal) { | 6 | confirm: function(textoModal) { |
| 7 | return $uibModal.open({ | 7 | return $uibModal.open({ |
| 8 | templateUrl: 'modal-confirm.html', | 8 | templateUrl: 'modal-confirm.html', |
| 9 | controller: 'focaModalConfirmController', | 9 | controller: 'focaModalConfirmController', |
| 10 | animation: false, | 10 | animation: false, |
| 11 | backdrop: false, | 11 | backdrop: false, |
| 12 | resolve: { textoModal: function() { return textoModal; } } | 12 | resolve: { textoModal: function() { return textoModal; } } |
| 13 | }) | 13 | }) |
| 14 | .result.then( | 14 | .result.then( |
| 15 | function(resultado) { | 15 | function(resultado) { |
| 16 | return resultado; | 16 | return resultado; |
| 17 | } | 17 | } |
| 18 | ); | 18 | ); |
| 19 | }, | 19 | }, |
| 20 | info: function(textoModal) { | ||
| 21 | return $uibModal.open({ | ||
| 22 | templateUrl: 'modal-info.html', | ||
| 23 | controller: 'focaModalInfoController', | ||
| 24 | animation: false, | ||
| 25 | backdrop: false, | ||
| 26 | resolve: { textoModal: function() { return textoModal; } } | ||
| 27 | }) | ||
| 28 | .result.then( | ||
| 29 | function(resultado) { | ||
| 30 | return resultado; | ||
| 31 | } | ||
| 32 | ); | ||
| 33 | }, | ||
| 20 | alert: function(textoModal) { | 34 | alert: function(textoModal) { |
| 21 | return $uibModal.open({ | 35 | return $uibModal.open({ |
| 22 | templateUrl: 'modal-alert.html', | 36 | templateUrl: 'modal-alert.html', |
| 23 | controller: 'focaModalAlertController', | 37 | controller: 'focaModalAlertController', |
| 24 | animation: false, | 38 | animation: false, |
| 25 | backdrop: false, | 39 | backdrop: false, |
| 26 | resolve: { textoModal: function() { return textoModal; } } | 40 | resolve: { textoModal: function() { return textoModal; } } |
| 27 | }) | 41 | }) |
| 28 | .result.then( | 42 | .result.then( |
| 29 | function(resultado) { | 43 | function(resultado) { |
| 30 | return resultado; | 44 | return resultado; |
| 31 | } | 45 | } |
| 32 | ); | 46 | ); |
| 33 | }, | 47 | }, |
| 34 | modal: function(parametrosModal) { | 48 | modal: function(parametrosModal) { |
| 35 | parametrosModal.size = (typeof parametrosModal.size === 'undefined') ? | 49 | parametrosModal.size = (typeof parametrosModal.size === 'undefined') ? |
| 36 | 'lg' : parametrosModal.size; | 50 | 'lg' : parametrosModal.size; |
| 37 | 51 | ||
| 38 | return $uibModal.open({ | 52 | return $uibModal.open({ |
| 39 | templateUrl: 'foca-modal.html', | 53 | templateUrl: 'foca-modal.html', |
| 40 | controller: 'focaModalController', | 54 | controller: 'focaModalController', |
| 41 | size: parametrosModal.size, | 55 | size: parametrosModal.size, |
| 42 | resolve: { | 56 | resolve: { |
| 43 | parametrosModal: function() { return parametrosModal; } | 57 | parametrosModal: function() { return parametrosModal; } |
| 44 | } | 58 | } |
| 45 | }) | 59 | }) |
| 46 | .result.then( | 60 | .result.then( |
| 47 | function(resultado) { | 61 | function(resultado) { |
| 48 | return resultado; | 62 | return resultado; |
| 49 | } | 63 | } |
| 50 | ); | 64 | ); |
| 51 | }, | 65 | }, |
| 52 | getEntidad: function(filters, query, tipo, json) { | 66 | getEntidad: function(filters, query, tipo, json) { |
| 53 | if (tipo === 'POST') { | 67 | if (tipo === 'POST') { |
| 54 | return $http.post(API_ENDPOINT.URL + query, json); | 68 | return $http.post(API_ENDPOINT.URL + query, json); |
| 55 | } else { | 69 | } else { |
| 56 | return $http.get(API_ENDPOINT.URL + query, {nombre: filters}); | 70 | return $http.get(API_ENDPOINT.URL + query, {nombre: filters}); |
| 57 | } | 71 | } |
| 58 | }, | 72 | }, |
| 59 | modalFecha: function(parametros) { | 73 | modalFecha: function(parametros) { |
| 60 | return $uibModal.open({ | 74 | return $uibModal.open({ |
| 61 | templateUrl: 'foca-fecha.html', | 75 | templateUrl: 'foca-fecha.html', |
| 62 | controller: 'focaModalFechaController', | 76 | controller: 'focaModalFechaController', |
| 63 | size: 'md', | 77 | size: 'md', |
| 64 | resolve: { | 78 | resolve: { |
| 65 | parametros: function() { return parametros; } | 79 | parametros: function() { return parametros; } |
| 66 | } | 80 | } |
| 67 | }) | 81 | }) |
| 68 | .result.then( | 82 | .result.then( |
| 69 | function(resultado) { | 83 | function(resultado) { |
| 70 | return resultado; | 84 | return resultado; |
| 71 | } | 85 | } |
| 72 | ); | 86 | ); |
| 73 | }, | 87 | }, |
| 74 | prompt: function(options) { | 88 | prompt: function(options) { |
| 75 | return $uibModal.open({ | 89 | return $uibModal.open({ |
| 76 | templateUrl: 'modal-prompt.html', | 90 | templateUrl: 'modal-prompt.html', |
| 77 | controller: 'focaModalPromptController', | 91 | controller: 'focaModalPromptController', |
| 78 | size: 'md', | 92 | size: 'md', |
| 79 | resolve: { | 93 | resolve: { |
| 80 | options: function() {return options;}, | 94 | options: function() {return options;}, |
| 81 | } | 95 | } |
| 82 | }) | 96 | }) |
| 83 | .result.then( | 97 | .result.then( |
| 84 | function(resultado) { | 98 | function(resultado) { |
| 85 | return resultado; | 99 | return resultado; |
| 86 | } | 100 | } |
| 87 | ); | 101 | ); |
| 88 | }, | 102 | }, |
| 89 | mail: function(options) { | 103 | mail: function(options) { |
| 90 | return $uibModal.open({ | 104 | return $uibModal.open({ |
| 91 | templateUrl: 'modal-mail.html', | 105 | templateUrl: 'modal-mail.html', |
| 92 | controller: 'focaModalMailController', | 106 | controller: 'focaModalMailController', |
| 93 | size: 'md', | 107 | size: 'md', |
| 108 | backdrop: false, | ||
| 94 | resolve: { | 109 | resolve: { |
| 95 | options: function() {return options;}, | 110 | options: function() {return options;}, |
| 96 | } | 111 | } |
| 97 | }) | 112 | }) |
| 98 | .result.then( | 113 | .result.then( |
| 99 | function(resultado) { | 114 | function(resultado) { |
| 100 | return resultado; | 115 | return resultado; |
| 101 | } | 116 | } |
| 102 | ); | 117 | ); |
| 103 | }, | 118 | }, |
| 104 | imprimirComprobante: function(url, options) { | 119 | imprimirComprobante: function(url, options) { |
| 105 | return $http.post( | 120 | return $http.post( |
| 106 | API_ENDPOINT.URL + url, | 121 | API_ENDPOINT.URL + url, |
| 107 | options, | 122 | options, |
| 108 | {responseType: 'arraybuffer'} | 123 | {responseType: 'arraybuffer'} |
| 109 | ); | 124 | ); |
| 110 | }, | 125 | }, |
| 111 | enviarCorreo: function(url, options) { | 126 | enviarCorreo: function(url, options) { |
| 112 | return $http.post(API_ENDPOINT.URL + url, options); | 127 | return $http.post(API_ENDPOINT.URL + url, options); |
| 113 | } | 128 | } |
| 114 | }; | 129 | }; |
| 115 | } | 130 | } |
| 116 | ]); | 131 | ]); |
| 117 | 132 |
src/views/modal-alert.html
| 1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
| 2 | <h4>Atención</h4> | 2 | <h4>Atención</h4> |
| 3 | </div> | 3 | </div> |
| 4 | <div class="modal-body"> | 4 | <div class="modal-body"> |
| 5 | <p ng-bind="textoModal" class="alert"> | 5 | <p ng-bind="textoModal" class="line-break"> |
| 6 | 6 | ||
| 7 | </p> | 7 | </p> |
| 8 | </div> | 8 | </div> |
| 9 | <div class="modal-footer"> | 9 | <div class="modal-footer"> |
| 10 | <button class="btn btn-primary" ng-click="aceptar()" foca-focus="true">Aceptar</button> | 10 | <button class="btn btn-primary" ng-click="aceptar()" foca-focus="true">Aceptar</button> |
| 11 | </div> | 11 | </div> |
| 12 | 12 |
src/views/modal-confirm.html
| 1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
| 2 | <h4>Confirmar</h4> | 2 | <h4>Confirmar</h4> |
| 3 | </div> | 3 | </div> |
| 4 | <div class="modal-body"> | 4 | <div class="modal-body"> |
| 5 | <p ng-bind="textoModal" class="alert"> | 5 | <p ng-bind="textoModal" class="line-break"> |
| 6 | 6 | ||
| 7 | </p> | 7 | </p> |
| 8 | </div> | 8 | </div> |
| 9 | <div class="modal-footer"> | 9 | <div class="modal-footer"> |
| 10 | <button class="btn btn-danger" ng-click="aceptar()" foca-focus="true">Aceptar</button> | 10 | <button class="btn btn-danger" ng-click="aceptar()" foca-focus="true">Aceptar</button> |
| 11 | <button class="btn btn-default" ng-click="cancelar()">Cancelar</button> | 11 | <button class="btn btn-default" ng-click="cancelar()">Cancelar</button> |
| 12 | </div> | 12 | </div> |
| 13 | 13 |
src/views/modal-info.html
| File was created | 1 | <div class="focus-in"> | |
| 2 | <div class="modal-header"> | ||
| 3 | <h4>Información</h4> | ||
| 4 | </div> | ||
| 5 | <div class="modal-body"> | ||
| 6 | <p ng-bind="textoModal" class="line-break m-0 pb-2"></p> | ||
| 7 | <!-- La versión está tipeada, después habria que hacer que se haga una consulta y devuelva la versión --> | ||
| 8 | <p class="m-0 border-bottom border-top pt-2 pb-2">DEBO® Distribuidores: Versión 2.0</p> | ||
| 9 | <p class="mt-1">Ante un inconveniente con el sistema,</br> | ||
| 10 | comuniquese con nuestra <a href="http://focasoftware.com" target="__blank">mesa de ayuda</a></p> | ||
| 11 | <a href="http://focasoftware.com" target="__blank"> | ||
| 12 | <img src="img/logo-foca.png" class="w-25 rounded mx-auto d-block mt-4"> | ||
| 13 | </a> | ||
| 14 | </div> | ||
| 15 | <div class="modal-footer"> | ||
| 16 | <button class="btn btn-primary" ng-click="aceptar()" foca-focus="true">Aceptar</button> | ||
| 17 | </div> | ||
| 18 | </div> | ||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 |
src/views/modal-mail.html
| 1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
| 2 | <h5 ng-bind="titulo"></h5> | 2 | <h5 ng-bind="titulo"></h5> |
| 3 | </div> | 3 | </div> |
| 4 | <div class="modal-body"> | 4 | <div class="modal-body"> |
| 5 | <div > | 5 | <div > |
| 6 | <label | 6 | <label |
| 7 | class="col-12 bg-success text-white" | 7 | class="col-12 bg-success text-white" |
| 8 | ng-show="correoEnviado">Correo enviado con éxito</label> | 8 | ng-show="correoEnviado">Correo enviado con éxito</label> |
| 9 | <label | 9 | <label |
| 10 | class="col-12 bg-danger text-white" | 10 | class="col-12 bg-danger text-white" |
| 11 | ng-show="correoNoEnviado">Hubo un error al enviar el correo</label> | 11 | ng-show="correoNoEnviado">Hubo un error al enviar el correo</label> |
| 12 | <label>Enviar correo a</label> | 12 | <label>Enviar correo a</label> |
| 13 | <div class="d-flex"> | 13 | <div class="d-flex"> |
| 14 | <input | 14 | <input |
| 15 | type="email" | ||
| 15 | class="form-control col-9" | 16 | class="form-control col-9" |
| 16 | ng-model="mailCliente" | 17 | ng-model="mailCliente" |
| 17 | ng-keypress="enviarCorreo($event.keyCode)" | 18 | ng-keypress="enviarComprobante($event.keyCode)" |
| 18 | teclado-virtual/> | 19 | teclado-virtual/> |
| 19 | <button | 20 | <button |
| 20 | type="button" | 21 | type="button" |
| 21 | class="btn btn-enviar ml-auto" | 22 | class="btn btn-enviar ml-auto" |
| 22 | ng-click="enviarCorreo(13)" | 23 | ng-click="enviarComprobante(13)" |
| 23 | ladda="esperando" | 24 | ladda="esperando" |
| 24 | >Enviar</button> | 25 | >Enviar</button> |
| 25 | </div> | 26 | </div> |
| 26 | </div> | 27 | </div> |
| 27 | <hr> | 28 | <hr> |
| 28 | <div> | 29 | <div> |
| 29 | <label>Descargar comprobante en este dispositivo</label> | 30 | <label>Descargar comprobante</label> |
| 30 | <button | 31 | <div class="col my-1 d-flex justify-content-end"> |
| 31 | class="btn btn-enviar float-right" | 32 | <button |
| 32 | ng-click="imprimir()" | 33 | class="btn btn-enviar float-right" |
| 33 | ladda="esperando" | 34 | ng-click="validarImpresion()" |
| 34 | >Descargar</button> | 35 | ladda="esperando" |
| 36 | >Descargar</button> | ||
| 37 | </div> | ||
| 35 | </div> | 38 | </div> |
| 36 | </div> | 39 | </div> |
| 37 | <div class="modal-footer"> | 40 | <div class="modal-footer"> |
| 41 | <div class="custom-control custom-checkbox my-auto mr-5"> | ||
| 42 | <input | ||
| 43 | type="checkbox" | ||
| 44 | class="custom-control-input mr-5" | ||
| 45 | id="check" | ||
| 46 | ng-click="checkboxVar = !checkboxVar"> | ||
| 47 | <label class="custom-control-label disable-selection" for="check"> | ||
| 48 | Combrobante sin valorizar | ||
| 49 | </label> | ||
| 50 | </div> | ||
| 38 | <button | 51 | <button |
| 39 | type="button" | 52 | type="button" |
| 40 | class="btn btn-secondary" | 53 | class="btn btn-secondary" |
| 41 | ng-click="salir()" | 54 | ng-click="salir()" |
| 42 | ladda="esperando" | 55 | ladda="esperando" |
| 43 | >Salir</button> | 56 | >Salir</button> |
| 44 | <button | 57 | <button |
| 45 | type="button" | 58 | type="button" |
| 46 | class="btn btn-primary" | 59 | class="btn btn-primary" |
| 47 | ng-click="aceptar()" | 60 | ng-click="aceptar()" |
| 48 | ladda="esperando" | 61 | ladda="esperando" |
| 49 | ng-disabled="!descargado" | 62 | ng-disabled="!descargado" |
| 50 | >Aceptar</button> | 63 | >Aceptar</button> |
| 51 | </div> | 64 | </div> |
| 52 | 65 |
src/views/modal-prompt.html
| 1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
| 2 | <h4 ng-bind="options.titulo"></h4> | 2 | <h4 ng-bind="options.titulo"></h4> |
| 3 | </div> | 3 | </div> |
| 4 | <div class="modal-body"> | 4 | <div class="modal-body"> |
| 5 | <input | 5 | <input |
| 6 | type="text" | 6 | type="{{options.tipo}}" |
| 7 | class="form-control" | 7 | class="form-control" |
| 8 | ng-model="options.value" | 8 | ng-model="options.value" |
| 9 | ng-show="!options.textarea" | 9 | ng-show="!options.textarea" |
| 10 | maxlength="{{options.maxlength}}" | 10 | maxlength="{{options.maxlength}}" |
| 11 | ng-readonly="options.readonly" | 11 | ng-readonly="options.readonly" |
| 12 | ng-keypress="aceptar($event.keyCode)" | 12 | ng-keypress="aceptar($event.keyCode)" |
| 13 | teclado-virtual | 13 | teclado-virtual |
| 14 | > | 14 | > |
| 15 | 15 | ||
| 16 | <textarea | 16 | <textarea |
| 17 | rows="5" | 17 | rows="5" |
| 18 | class="form-control text-uppercase" | 18 | class="form-control text-uppercase" |
| 19 | ng-model="options.value" | 19 | ng-model="options.value" |
| 20 | ng-show="options.textarea" | 20 | ng-show="options.textarea" |
| 21 | maxlength="{{options.maxlength}}" | 21 | maxlength="{{options.maxlength}}" |
| 22 | ng-readonly="options.readonly" | 22 | ng-readonly="options.readonly" |
| 23 | ng-keypress="aceptar($event.keyCode)" | 23 | ng-keypress="aceptar($event.keyCode)" |
| 24 | teclado-virtual | 24 | teclado-virtual |
| 25 | ></textarea> | 25 | ></textarea> |
| 26 | </div> | 26 | </div> |
| 27 | <div class="modal-footer"> | 27 | <div class="modal-footer"> |
| 28 | <button class="btn btn-primary" ng-click="aceptar(13)" foca-focus="true">Aceptar</button> | 28 | <button class="btn btn-primary" ng-click="aceptar(13)" foca-focus="true">Aceptar</button> |
| 29 | <button class="btn btn-default" ng-click="cancelar()">Cancelar</button> | 29 | <button class="btn btn-default" ng-click="cancelar()">Cancelar</button> |
| 30 | </div> | 30 | </div> |
| 31 | 31 |