|
@@ -53,6 +53,9 @@
|
53
|
53
|
|
54
|
54
|
<script type="text/javascript" src="js/saveLocal.js"></script>
|
55
|
55
|
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
56
|
59
|
<ons-navigator swipeable animation="slide" id="myNavigator">
|
57
|
60
|
<ons-page>
|
58
|
61
|
<ons-toolbar>
|
|
@@ -114,8 +117,10 @@
|
114
|
117
|
ons.getScriptPage().onInit = function () {
|
115
|
118
|
this.querySelector('ons-toolbar div.center').textContent = this.data.title;
|
116
|
119
|
|
|
120
|
+ console.log("test");
|
|
121
|
+
|
117
|
122
|
//var File = this.data.title.toUpperCase() + '.json' ;
|
118
|
|
- var Esp = this.data.esp.split(', ');
|
|
123
|
+ var Esp = this.data.esp.split(';');
|
119
|
124
|
var artesanos_json = this.data.json;
|
120
|
125
|
|
121
|
126
|
//Convertir en mayuscula primera letra del string.
|
|
@@ -155,7 +160,7 @@
|
155
|
160
|
var searchVal = "my Name";
|
156
|
161
|
for (var i=0 ; i < artesanos_json.length ; i++)
|
157
|
162
|
{
|
158
|
|
- if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
|
|
163
|
+ if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
|
159
|
164
|
results.push(artesanos_json[i]);
|
160
|
165
|
}
|
161
|
166
|
}
|
|
@@ -193,8 +198,8 @@
|
193
|
198
|
<ons-list-item expandable tappable>
|
194
|
199
|
<div class="center" >${Artesano.Nombre}</div>
|
195
|
200
|
<div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
|
196
|
|
- Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
|
197
|
|
- Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
|
|
201
|
+ Tel\u00e9fono: ${Artesano["Telefono1"]}<br>
|
|
202
|
+ Correo Electr\u00f3nico: ${Artesano["E-mail1"]}<br>
|
198
|
203
|
</div>
|
199
|
204
|
</ons-list-item>`
|
200
|
205
|
);
|
|
@@ -212,20 +217,20 @@
|
212
|
217
|
if (Artesano.Municipio.trim().length != 0) {
|
213
|
218
|
cont ++;
|
214
|
219
|
}
|
215
|
|
- if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
|
|
220
|
+ if (Artesano["Telefono1"].trim().length != 0) {
|
216
|
221
|
cont ++;
|
217
|
222
|
}
|
218
|
|
- if (Artesano["E-mail"].trim().length != 0) {
|
|
223
|
+ if (Artesano["E-mail1"].trim().length != 0) {
|
219
|
224
|
cont ++;
|
220
|
225
|
}
|
221
|
|
- if (Artesano.Especificaciones.trim().length != 0) {
|
|
226
|
+ if (Artesano.Especificaciones1.trim().length != 0) {
|
222
|
227
|
cont ++;
|
223
|
228
|
}
|
224
|
229
|
|
225
|
230
|
|
226
|
231
|
//info a pasar
|
227
|
232
|
//'title':'${Artesano.Nombre}','esp': '${info}'
|
228
|
|
- var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Tel\u00e9fono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificaciones}' } })" tappable>
|
|
233
|
+ var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono1"]}', email: '${Artesano["E-mail1"]}', esp: '${Artesano.Especificaciones1}' } })" tappable>
|
229
|
234
|
<div class="title">${Artesano.Nombre}</div>
|
230
|
235
|
</ons-list-item>`);
|
231
|
236
|
|
|
@@ -319,7 +324,7 @@
|
319
|
324
|
var searchVal = "my Name";
|
320
|
325
|
for (var i=0 ; i < artesanos_json.length ; i++)
|
321
|
326
|
{
|
322
|
|
- if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
|
|
327
|
+ if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
|
323
|
328
|
results.push(artesanos_json[i]);
|
324
|
329
|
}
|
325
|
330
|
}
|
|
@@ -332,7 +337,7 @@
|
332
|
337
|
|
333
|
338
|
//if(Esp[num] in artesanos_json.) {}
|
334
|
339
|
Artesanos+=`${results[i].Nombre}|`
|
335
|
|
- ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Tel\u00e9fono1"]}|${results[i]["E-mail"]}|${results[i].Especificaciones}&&`
|
|
340
|
+ ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Tel\u00e9fono 1"]}|${results[i]["E-mail"]}|${results[i].Especificaciones}&&`
|
336
|
341
|
//`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
|
337
|
342
|
}
|
338
|
343
|
|
|
@@ -449,9 +454,7 @@
|
449
|
454
|
<!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
|
450
|
455
|
|
451
|
456
|
<script>
|
452
|
|
-
|
453
|
|
- var todos = window.localStorage.getItem("TODOS");
|
454
|
|
-
|
|
457
|
+ var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
|
455
|
458
|
function filter(){
|
456
|
459
|
|
457
|
460
|
|
|
@@ -468,17 +471,17 @@
|
468
|
471
|
var x = document.getElementsByClassName('artists');
|
469
|
472
|
input = input.trim().toLowerCase();
|
470
|
473
|
if (input.length == 0){
|
471
|
|
- for (i = 0; todos.length; i++){
|
|
474
|
+ for (i = 0; Madera.length; i++){
|
472
|
475
|
x[i].style.display = "list-item";
|
473
|
476
|
}
|
474
|
477
|
}
|
475
|
478
|
else{
|
476
|
479
|
var foundesp = 0;
|
477
|
|
- for (i = 0; i < todos.length; i++){
|
|
480
|
+ for (i = 0; i < Madera.length; i++){
|
478
|
481
|
console.log("damn")
|
479
|
482
|
//try checking the especificacion first
|
480
|
|
- var especificaciones = todos[i].Especificaciones1;
|
481
|
|
- especificaciones = especificaciones.split(',');
|
|
483
|
+ var especificaciones = Madera[i].Especificaciones1;
|
|
484
|
+ especificaciones = especificaciones.split(';');
|
482
|
485
|
for (var j = 0; j < especificaciones.length; j++){
|
483
|
486
|
var especificacion = especificaciones[j];
|
484
|
487
|
especificacion = especificacion.trim().toLowerCase();
|
|
@@ -499,9 +502,9 @@
|
499
|
502
|
input[i] = input[i].charAt(0).toUpperCase() + input[i].slice(1);
|
500
|
503
|
}
|
501
|
504
|
console.log(input);
|
502
|
|
- for(var i = 0; i < todos.length; i++){
|
|
505
|
+ for(var i = 0; i < Madera.length; i++){
|
503
|
506
|
count = 0;
|
504
|
|
- artist = todos[i].Nombre.trim().split(' ');
|
|
507
|
+ artist = Madera[i].Nombre.trim().split(' ');
|
505
|
508
|
for (k = 0; k < input.length; k++){
|
506
|
509
|
for (var l = 0; l < artist.length; l++){
|
507
|
510
|
if(artist[l] == input[k]){
|
|
@@ -532,10 +535,10 @@
|
532
|
535
|
</ons-list>
|
533
|
536
|
|
534
|
537
|
<script>
|
535
|
|
- for (i = 0; i < todos.length;i++){
|
|
538
|
+ for (i = 0; i < Madera.length;i++){
|
536
|
539
|
var artesano = ons.createElement(`<ons-list-item class = "artists"
|
537
|
|
- onclick="myNavigator.pushPage('artesano.html', { data: {title: '${todos[i].Nombre}', mun: '${todos[i].Municipio}', tel: '${todos[i]["Tel\u00e9fono 1"]}', email: '${todos[i]["E-mail"]}', esp: '${todos[i].Especificaciones}' } })" tappable>
|
538
|
|
- <div>${todos[i].Nombre}</div>
|
|
540
|
+ onclick="myNavigator.pushPage('artesano.html', { data: {title: '${Madera[i].Nombre}', mun: '${Madera[i].Municipio}', tel: '${Madera[i]["Telefono1"]}', email: '${Madera[i]["E-mail1"]}', esp: '${Madera[i].Especificaciones1}' } })" tappable>
|
|
541
|
+ <div>${Madera[i].Nombre}</div>
|
539
|
542
|
</ons-list-item>`);
|
540
|
543
|
// var artesano = ons.createElement(`
|
541
|
544
|
// <ons-list-item class = "artists">
|