backend-plus 2.5.2-betha.24 → 2.5.2-betha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,162 +1,162 @@
1
- /* UTF-8:Sí
2
- compatibilidad.js
3
- */
4
- "use strict";
5
-
6
- var controles_de_compatibilidad={
7
- // Mejorados siguiendo los consejos de http://diveintohtml5.info/detect.html
8
- 'soporte JSON':{gravedad:'incompatible'
9
- ,controlar:function(){
10
- return '["esto"]'==JSON.stringify(['esto']);
11
- }},
12
- 'soporte para cookies':{gravedad:'incompatible'
13
- ,controlar:function(){
14
- return navigator.cookieEnabled;
15
- }},
16
- 'almacenamiento local (localStorage)':{gravedad:'incompatible'
17
- ,controlar:function(){
18
- try {
19
- return 'localStorage' in window && window['localStorage'] !== null;
20
- }catch(e){
21
- return false;
22
- }
23
- }},
24
- 'almacenamiento local por ventana (sessionStorage)':{gravedad:'incompatible'
25
- ,controlar:function(){
26
- sessionStorage.setItem('prueba_de_soporte_sessionStorage','soportado');
27
- return sessionStorage.getItem('prueba_de_soporte_sessionStorage')=='soportado';
28
- }},
29
- 'almacenamiento de atributos internos (setAttribute)':{gravedad:'incompatible'
30
- ,controlar:function(parametros){
31
- parametros.div.setAttribute('prueba_attribute','soportado');
32
- return parametros.div.getAttribute('prueba_attribute')=='soportado';
33
- }},
34
- 'posicionamiento inicial del cursor (autofocus HTML5)':{gravedad:'incomodidad'
35
- ,controlar:function(parametros){
36
- var input=document.createElement('input');
37
- return 'autofocus' in input;
38
- }},
39
- 'movimiento lateral de teclas de cursor dentro de grillas (window.getSelection)':{gravedad:'incomodidad'
40
- ,controlar:function(parametros){
41
- return window.getSelection;
42
- }},
43
- 'soporte para trabajo fuera de línea (offline)':{gravedad:'incompatiblidad'
44
- ,controlar:function(parametros){
45
- return 'serviceWorker' in navigator;
46
- }},
47
- 'soporte para tratar eventos internos':{gravedad:'incompatible'
48
- ,controlar:function(parametros){
49
- return !!window.addEventListener;
50
- }},
51
- 'soporte para WebSocket':{gravedad:'antiguo'
52
- ,controlar:function(parametros){
53
- return !!window.WebSocket;
54
- }},
55
- 'conectividad via fetch':{gravedad:'incompatible'
56
- ,controlar:function(params){
57
- return 'fetch' in window
58
- }},
59
- 'funciones => sin this':{gravedad:'incompatible'
60
- ,controlar:function(params){
61
- try{
62
- return eval("[1].map((x)=>x+1)")[0] == 2;
63
- }finally{}
64
- }}
65
- };
66
-
67
- function controlar_compatibilidad(ya, id, idBoton){
68
- "use strict";
69
- var boton=document.getElementById(idBoton || 'login');
70
- id = id || 'resultado_incompatibilidad';
71
- var div=document.getElementById(id);
72
- if(!div){
73
- div = document.createElement('div');
74
- div.id = id;
75
- document.body.appendChild(div);
76
- div.textContent='controlando la compatibilidad del navegador';
77
- }
78
- if(!ya){
79
- if (boton) boton.disabled=true;
80
- setTimeout(function(){
81
- controlar_compatibilidad(true)
82
- },100)
83
- return;
84
- }
85
- var hubo_errores=false;
86
- var hubo_errores_tipo={};
87
- div.innerHTML="";
88
- for(var control in controles_de_compatibilidad){
89
- var ok=false;
90
- var def_control=controles_de_compatibilidad[control];
91
- try{
92
- ok=def_control.controlar({div:div});
93
- }catch(err){
94
- }
95
- if(!ok){
96
- var mensaje=document.createElement('div');
97
- mensaje.textContent="Falla en "+control;
98
- if(def_control.gravedad=='incompatible'){
99
- mensaje.style.color='red';
100
- }
101
- div.appendChild(mensaje);
102
- hubo_errores=true;
103
- hubo_errores_tipo[def_control.gravedad]=true;
104
- }
105
- };
106
- if(!hubo_errores_tipo['incompatible']){
107
- if (boton) boton.disabled=false;
108
- }
109
- var attrsep = ": ";
110
- var attr = function(base, prop, expected){
111
- try {
112
- if (!(base in window)) {
113
- return attrsep + "sin "+base;
114
- } else if (!(prop in (window[base]))) {
115
- return attrsep + "sin "+base+"."+prop;
116
- } else {
117
- var mostrar = window[base][prop];
118
- if (expected !== undefined) {
119
- if (mostrar == expected) return "";
120
- }
121
- try {
122
- mostrar = JSON.stringify(mostrar)
123
- } catch (_) {
124
- mostrar = mostrar + ""
125
- }
126
- return attrsep + (base == "navigator" ? "" : base + ".") + prop + "=" + mostrar
127
- }
128
- } catch (err) {
129
- return attrsep + "sin capacidad de detectar " + base + "." + prop;
130
- } finally {
131
- attrsep = ", ";
132
- }
133
- }
134
- var bloque = function(elementoContenedor, text){
135
- var elemento = document.createElement('div');
136
- elementoContenedor.appendChild(elemento);
137
- elemento.textContent = text;
138
- }
139
- if(hubo_errores){
140
- console.log('aca')
141
- var alertDiv = document.createElement(hubo_errores_tipo['incompatible']?'h3':'div');
142
- bloque(alertDiv, "El sistema no fue probado en este modelo de navegador. Si experimenta problemas durante el uso cuando avise del problema incluya el nombre y versión del navegador. Se recomienda usar una versión actualizada del navegador Google Chrome o MS Edge");
143
- bloque(alertDiv, "Caracteristicas detectadas en el navegador"+
144
- attr('navigator','appName')+
145
- attr('navigator','appVersion')+
146
- attr('navigator','vendor')+
147
- attr('navigator','vendorSub')+
148
- attr('navigator','cookieEnabled', true)+
149
- attr('navigator','onLine', true)+
150
- "."
151
- );
152
- if(hubo_errores_tipo['incompatible']){
153
- var check = document.createElement('input');
154
- check.type='checkbox';
155
- check.onchange=function(){
156
- if (boton) boton.disabled=!check.checked
157
- }
158
- alertDiv.appendChild(check);
159
- }
160
- div.appendChild(alertDiv);
161
- }
1
+ /* UTF-8:Sí
2
+ compatibilidad.js
3
+ */
4
+ "use strict";
5
+
6
+ var controles_de_compatibilidad={
7
+ // Mejorados siguiendo los consejos de http://diveintohtml5.info/detect.html
8
+ 'soporte JSON':{gravedad:'incompatible'
9
+ ,controlar:function(){
10
+ return '["esto"]'==JSON.stringify(['esto']);
11
+ }},
12
+ 'soporte para cookies':{gravedad:'incompatible'
13
+ ,controlar:function(){
14
+ return navigator.cookieEnabled;
15
+ }},
16
+ 'almacenamiento local (localStorage)':{gravedad:'incompatible'
17
+ ,controlar:function(){
18
+ try {
19
+ return 'localStorage' in window && window['localStorage'] !== null;
20
+ }catch(e){
21
+ return false;
22
+ }
23
+ }},
24
+ 'almacenamiento local por ventana (sessionStorage)':{gravedad:'incompatible'
25
+ ,controlar:function(){
26
+ sessionStorage.setItem('prueba_de_soporte_sessionStorage','soportado');
27
+ return sessionStorage.getItem('prueba_de_soporte_sessionStorage')=='soportado';
28
+ }},
29
+ 'almacenamiento de atributos internos (setAttribute)':{gravedad:'incompatible'
30
+ ,controlar:function(parametros){
31
+ parametros.div.setAttribute('prueba_attribute','soportado');
32
+ return parametros.div.getAttribute('prueba_attribute')=='soportado';
33
+ }},
34
+ 'posicionamiento inicial del cursor (autofocus HTML5)':{gravedad:'incomodidad'
35
+ ,controlar:function(parametros){
36
+ var input=document.createElement('input');
37
+ return 'autofocus' in input;
38
+ }},
39
+ 'movimiento lateral de teclas de cursor dentro de grillas (window.getSelection)':{gravedad:'incomodidad'
40
+ ,controlar:function(parametros){
41
+ return window.getSelection;
42
+ }},
43
+ 'soporte para trabajo fuera de línea (offline)':{gravedad:'incompatiblidad'
44
+ ,controlar:function(parametros){
45
+ return 'serviceWorker' in navigator;
46
+ }},
47
+ 'soporte para tratar eventos internos':{gravedad:'incompatible'
48
+ ,controlar:function(parametros){
49
+ return !!window.addEventListener;
50
+ }},
51
+ 'soporte para WebSocket':{gravedad:'antiguo'
52
+ ,controlar:function(parametros){
53
+ return !!window.WebSocket;
54
+ }},
55
+ 'conectividad via fetch':{gravedad:'incompatible'
56
+ ,controlar:function(params){
57
+ return 'fetch' in window
58
+ }},
59
+ 'funciones => sin this':{gravedad:'incompatible'
60
+ ,controlar:function(params){
61
+ try{
62
+ return eval("[1].map((x)=>x+1)")[0] == 2;
63
+ }finally{}
64
+ }}
65
+ };
66
+
67
+ function controlar_compatibilidad(ya, id, idBoton){
68
+ "use strict";
69
+ var boton=document.getElementById(idBoton || 'login');
70
+ id = id || 'resultado_incompatibilidad';
71
+ var div=document.getElementById(id);
72
+ if(!div){
73
+ div = document.createElement('div');
74
+ div.id = id;
75
+ document.body.appendChild(div);
76
+ div.textContent='controlando la compatibilidad del navegador';
77
+ }
78
+ if(!ya){
79
+ if (boton) boton.disabled=true;
80
+ setTimeout(function(){
81
+ controlar_compatibilidad(true)
82
+ },100)
83
+ return;
84
+ }
85
+ var hubo_errores=false;
86
+ var hubo_errores_tipo={};
87
+ div.innerHTML="";
88
+ for(var control in controles_de_compatibilidad){
89
+ var ok=false;
90
+ var def_control=controles_de_compatibilidad[control];
91
+ try{
92
+ ok=def_control.controlar({div:div});
93
+ }catch(err){
94
+ }
95
+ if(!ok){
96
+ var mensaje=document.createElement('div');
97
+ mensaje.textContent="Falla en "+control;
98
+ if(def_control.gravedad=='incompatible'){
99
+ mensaje.style.color='red';
100
+ }
101
+ div.appendChild(mensaje);
102
+ hubo_errores=true;
103
+ hubo_errores_tipo[def_control.gravedad]=true;
104
+ }
105
+ };
106
+ if(!hubo_errores_tipo['incompatible']){
107
+ if (boton) boton.disabled=false;
108
+ }
109
+ var attrsep = ": ";
110
+ var attr = function(base, prop, expected){
111
+ try {
112
+ if (!(base in window)) {
113
+ return attrsep + "sin "+base;
114
+ } else if (!(prop in (window[base]))) {
115
+ return attrsep + "sin "+base+"."+prop;
116
+ } else {
117
+ var mostrar = window[base][prop];
118
+ if (expected !== undefined) {
119
+ if (mostrar == expected) return "";
120
+ }
121
+ try {
122
+ mostrar = JSON.stringify(mostrar)
123
+ } catch (_) {
124
+ mostrar = mostrar + ""
125
+ }
126
+ return attrsep + (base == "navigator" ? "" : base + ".") + prop + "=" + mostrar
127
+ }
128
+ } catch (err) {
129
+ return attrsep + "sin capacidad de detectar " + base + "." + prop;
130
+ } finally {
131
+ attrsep = ", ";
132
+ }
133
+ }
134
+ var bloque = function(elementoContenedor, text){
135
+ var elemento = document.createElement('div');
136
+ elementoContenedor.appendChild(elemento);
137
+ elemento.textContent = text;
138
+ }
139
+ if(hubo_errores){
140
+ console.log('aca')
141
+ var alertDiv = document.createElement(hubo_errores_tipo['incompatible']?'h3':'div');
142
+ bloque(alertDiv, "El sistema no fue probado en este modelo de navegador. Si experimenta problemas durante el uso cuando avise del problema incluya el nombre y versión del navegador. Se recomienda usar una versión actualizada del navegador Google Chrome o MS Edge");
143
+ bloque(alertDiv, "Caracteristicas detectadas en el navegador"+
144
+ attr('navigator','appName')+
145
+ attr('navigator','appVersion')+
146
+ attr('navigator','vendor')+
147
+ attr('navigator','vendorSub')+
148
+ attr('navigator','cookieEnabled', true)+
149
+ attr('navigator','onLine', true)+
150
+ "."
151
+ );
152
+ if(hubo_errores_tipo['incompatible']){
153
+ var check = document.createElement('input');
154
+ check.type='checkbox';
155
+ check.onchange=function(){
156
+ if (boton) boton.disabled=!check.checked
157
+ }
158
+ alertDiv.appendChild(check);
159
+ }
160
+ div.appendChild(alertDiv);
161
+ }
162
162
  }