Commit e03395676898b089a995b2a6268ddd250989cf19

Authored by Mauricio Cattafi
1 parent 4171c77462
Exists in fix_acentos

se reemplaza acentos en los labels para armar la fc sin acentos

Showing 2 changed files with 3 additions and 1 deletions   Show diff stats
1 { 1 {
2 "name": "foca-botonera-facturador", 2 "name": "foca-botonera-facturador",
3 "version": "0.0.1", 3 "version": "0.0.1",
4 "description": "Componente de botonera en facturadores", 4 "description": "Componente de botonera en facturadores",
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 "compile": "gulp uglify", 8 "compile": "gulp uglify",
9 "gulp-pre-commit": "gulp pre-commit", 9 "gulp-pre-commit": "gulp pre-commit",
10 "postinstall": "npm run compile && gulp clean-post-install", 10 "postinstall": "npm run compile && gulp clean-post-install",
11 "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-clean gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify-es jasmine-core jquery jshint pre-commit pump && npm install angular-sanitize" 11 "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-clean gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify-es jasmine-core jquery jshint pre-commit pump && npm install angular-sanitize",
12 "frefresh": "gulp uglify && cp tmp/foca-botonera-facturador.js ../wrapper-facturador/node_modules/foca-botonera-facturador/dist/foca-botonera-facturador.min.js"
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": "git+ssh://git@debonline.dyndns.org:npm/foca-botonera-facturador.git" 19 "url": "git+ssh://git@debonline.dyndns.org:npm/foca-botonera-facturador.git"
19 }, 20 },
20 "author": "Foca Software", 21 "author": "Foca Software",
21 "license": "ISC", 22 "license": "ISC",
22 "peerDependencies": { 23 "peerDependencies": {
23 "angular": "^1.7.x", 24 "angular": "^1.7.x",
24 "bootstrap": "^4.1.x", 25 "bootstrap": "^4.1.x",
25 "jquery": "^3.3.x", 26 "jquery": "^3.3.x",
26 "font-awesome": "^4.7.x", 27 "font-awesome": "^4.7.x",
27 "gulp": "^3.9.x", 28 "gulp": "^3.9.x",
28 "gulp-concat": "2.6.x", 29 "gulp-concat": "2.6.x",
29 "gulp-jshint": "^2.1.x", 30 "gulp-jshint": "^2.1.x",
30 "gulp-rename": "^1.4.x", 31 "gulp-rename": "^1.4.x",
31 "gulp-replace": "^1.0.x", 32 "gulp-replace": "^1.0.x",
32 "gulp-uglify-es": "^1.0.x", 33 "gulp-uglify-es": "^1.0.x",
33 "jshint": "^2.9.x", 34 "jshint": "^2.9.x",
34 "pump": "^3.0.x" 35 "pump": "^3.0.x"
35 }, 36 },
36 "devDependencies": { 37 "devDependencies": {
37 "angular": "^1.7.6", 38 "angular": "^1.7.6",
38 "angular-route": "^1.7.5", 39 "angular-route": "^1.7.5",
39 "angular-sanitize": "^1.7.6", 40 "angular-sanitize": "^1.7.6",
40 "bootstrap": "^4.2.1", 41 "bootstrap": "^4.2.1",
41 "font-awesome": "^4.7.0", 42 "font-awesome": "^4.7.0",
42 "gulp": "^3.9.1", 43 "gulp": "^3.9.1",
43 "gulp-angular-templatecache": "^2.2.6", 44 "gulp-angular-templatecache": "^2.2.6",
44 "gulp-clean": "^0.4.0", 45 "gulp-clean": "^0.4.0",
45 "gulp-concat": "^2.6.1", 46 "gulp-concat": "^2.6.1",
46 "gulp-connect": "^5.7.0", 47 "gulp-connect": "^5.7.0",
47 "gulp-htmlmin": "^5.0.1", 48 "gulp-htmlmin": "^5.0.1",
48 "gulp-jshint": "^2.1.0", 49 "gulp-jshint": "^2.1.0",
49 "gulp-rename": "^1.4.0", 50 "gulp-rename": "^1.4.0",
50 "gulp-replace": "^1.0.0", 51 "gulp-replace": "^1.0.0",
51 "gulp-sass": "^4.0.2", 52 "gulp-sass": "^4.0.2",
52 "gulp-uglify-es": "^1.0.4", 53 "gulp-uglify-es": "^1.0.4",
53 "jasmine-core": "^3.3.0", 54 "jasmine-core": "^3.3.0",
54 "jquery": "^3.3.1", 55 "jquery": "^3.3.1",
55 "jshint": "^2.9.7", 56 "jshint": "^2.9.7",
56 "pre-commit": "^1.2.2", 57 "pre-commit": "^1.2.2",
57 "pump": "^3.0.0" 58 "pump": "^3.0.0"
58 } 59 }
59 } 60 }
60 61
src/js/controller.js
1 angular.module('focaBotoneraFacturador') 1 angular.module('focaBotoneraFacturador')
2 .controller('focaBotoneraFacturadorController', [ 2 .controller('focaBotoneraFacturadorController', [
3 '$scope', 3 '$scope',
4 '$window', 4 '$window',
5 'APP', 5 'APP',
6 function($scope, $window, APP) { 6 function($scope, $window, APP) {
7 this.$onInit = function() { 7 this.$onInit = function() {
8 ordenarBotones(); 8 ordenarBotones();
9 }; 9 };
10 10
11 this.$onChanges = function() { 11 this.$onChanges = function() {
12 ordenarBotones(); 12 ordenarBotones();
13 }; 13 };
14 14
15 function nombreFuncion(string) { 15 function nombreFuncion(string) {
16 var texto = 'seleccionar'; 16 var texto = 'seleccionar';
17 var arr = string.split(' '); 17 var arr = string.split(' ');
18 arr.forEach(function(palabra) { 18 arr.forEach(function(palabra) {
19 palabra = palabra.normalize('NFD').replace(/[\u0300-\u036f]/g,"");
19 palabra = palabra.charAt(0).toUpperCase() + palabra.slice(1); 20 palabra = palabra.charAt(0).toUpperCase() + palabra.slice(1);
20 texto += palabra; 21 texto += palabra;
21 }); 22 });
22 return texto; 23 return texto;
23 } 24 }
24 25
25 $scope.ejecutarFuncion = function(nombre) { 26 $scope.ejecutarFuncion = function(nombre) {
26 $scope.$parent[nombreFuncion(nombre)](); 27 $scope.$parent[nombreFuncion(nombre)]();
27 }; 28 };
28 29
29 $scope.ejecutarFuncionDelete = function(variable) { 30 $scope.ejecutarFuncionDelete = function(variable) {
30 $scope.$parent['clean' + variable](); 31 $scope.$parent['clean' + variable]();
31 }; 32 };
32 33
33 $scope.existeFuncionDelete = function(variable) { 34 $scope.existeFuncionDelete = function(variable) {
34 if ($scope.$parent['clean' + variable]) return true; 35 if ($scope.$parent['clean' + variable]) return true;
35 return false; 36 return false;
36 }; 37 };
37 38
38 function ordenarBotones() { 39 function ordenarBotones() {
39 $scope.botones = $scope.$ctrl.botones; 40 $scope.botones = $scope.$ctrl.botones;
40 //TODO: controlar que no se estiren los botones 41 //TODO: controlar que no se estiren los botones
41 if(APP) return; 42 if(APP) return;
42 var max = ($scope.$ctrl.max) ? $scope.$ctrl.max : 12; 43 var max = ($scope.$ctrl.max) ? $scope.$ctrl.max : 12;
43 if ($window.innerWidth > 576) { 44 if ($window.innerWidth > 576) {
44 while(($scope.botones.length % max) !== 0) { 45 while(($scope.botones.length % max) !== 0) {
45 $scope.botones.push(''); 46 $scope.botones.push('');
46 } 47 }
47 } else { 48 } else {
48 while(($scope.botones.length % 4) !== 0) { 49 while(($scope.botones.length % 4) !== 0) {
49 $scope.botones.push(''); 50 $scope.botones.push('');
50 } 51 }
51 } 52 }
52 } 53 }
53 }]); 54 }]);
54 55