Browse Source

Fix renglones

christian 4 years ago
parent
commit
0a9a918be0

www/img/Barro.jpg → platforms/browser/www/img/BARRO.jpg View File


www/img/Cristal.jpg → platforms/browser/www/img/CRISTAL.jpg View File


www/img/Cuero.jpg → platforms/browser/www/img/CUERO.jpg View File


www/img/Fibras.jpg → platforms/browser/www/img/FIBRAS.jpg View File


www/img/Higüera.jpg → platforms/browser/www/img/HIGÜERA.jpg View File


www/img/Instrumento musical.jpg → platforms/browser/www/img/INSTRUMENTO TÍPICO.jpg View File


www/img/Juguetes tradicional.jpg → platforms/browser/www/img/JUGUETES TRADICIONAL.jpg View File


www/img/Labores en aguja.jpg → platforms/browser/www/img/LABORES EN AGUJA.jpg View File


www/img/Madera.jpg → platforms/browser/www/img/MADERA.jpg View File


www/img/Metal.jpg → platforms/browser/www/img/METAL.jpg View File


www/img/Tabacos.jpg → platforms/browser/www/img/TABACOS.jpg View File


www/img/Textiles.jpg → platforms/browser/www/img/TEXTILES.jpg View File


+ 8
- 8
platforms/browser/www/index.html View File

53
 
53
 
54
       <script type="text/javascript" src="js/saveLocal.js"></script>
54
       <script type="text/javascript" src="js/saveLocal.js"></script>
55
 
55
 
56
-
56
+      <script> console.log(window.localStorage.getItem("MADERA")); </script>
57
 
57
 
58
 
58
 
59
         <ons-navigator swipeable animation="slide" id="myNavigator">
59
         <ons-navigator swipeable animation="slide" id="myNavigator">
121
                         //var File = this.data.title.toUpperCase() + '.json' ;
121
                         //var File = this.data.title.toUpperCase() + '.json' ;
122
                         var Esp = this.data.esp.split(', ');
122
                         var Esp = this.data.esp.split(', ');
123
                         var artesanos_json = this.data.json;
123
                         var artesanos_json = this.data.json;
124
-                        console.log(artesanos_json);
124
+
125
 
125
 
126
                         //Convertir en mayuscula primera letra del string.
126
                         //Convertir en mayuscula primera letra del string.
127
                         for(var i=0; i<Esp.length; i++) {
127
                         for(var i=0; i<Esp.length; i++) {
198
               <ons-list-item expandable tappable>
198
               <ons-list-item expandable tappable>
199
                 <div class="center" >${Artesano.Nombre}</div>
199
                 <div class="center" >${Artesano.Nombre}</div>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
201
-                                                 Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
201
+                                                 Tel\u00e9fono: ${Artesano["Telefono 1"]}<br>
202
                                                  Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
202
                                                  Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
203
                                                  </div>
203
                                                  </div>
204
               </ons-list-item>`
204
               </ons-list-item>`
217
                             if (Artesano.Municipio.trim().length != 0) {
217
                             if (Artesano.Municipio.trim().length != 0) {
218
                                 cont ++;
218
                                 cont ++;
219
                             }
219
                             }
220
-                            if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
220
+                            if (Artesano["Telefono 1"].trim().length != 0) {
221
                                 cont ++;
221
                                 cont ++;
222
                             }
222
                             }
223
                             if (Artesano["E-mail"].trim().length != 0) {
223
                             if (Artesano["E-mail"].trim().length != 0) {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
-                            if (Artesano.Especificaciones.trim().length != 0) {
226
+                            if (Artesano.Especificacion.trim().length != 0) {
227
                                 cont ++;
227
                                 cont ++;
228
                             }
228
                             }
229
 
229
 
230
 
230
 
231
                             //info a pasar
231
                             //info a pasar
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
233
-                            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["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}' } })" tappable>
234
                         <div class="title">${Artesano.Nombre}</div>
234
                         <div class="title">${Artesano.Nombre}</div>
235
                     </ons-list-item>`);
235
                     </ons-list-item>`);
236
 
236
 
324
                              var searchVal = "my Name";
324
                              var searchVal = "my Name";
325
                              for (var i=0 ; i < artesanos_json.length ; i++)
325
                              for (var i=0 ; i < artesanos_json.length ; i++)
326
                              {
326
                              {
327
-                                 if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
327
+                                 if (artesanos_json[i].Especificacion.includes(Esp[num])) {
328
                                      results.push(artesanos_json[i]);
328
                                      results.push(artesanos_json[i]);
329
                                  }
329
                                  }
330
                              }
330
                              }
337
 
337
 
338
                                  //if(Esp[num] in artesanos_json.) {}
338
                                  //if(Esp[num] in artesanos_json.) {}
339
                                  Artesanos+=`${results[i].Nombre}|`
339
                                  Artesanos+=`${results[i].Nombre}|`
340
-                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Tel\u00e9fono 1"]}|${results[i]["E-mail"]}|${results[i].Especificaciones}&&`
340
+                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Telefono 1"]}|${results[i]["E-mail"]}|${results[i].Especificacion}&&`
341
                                  //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
341
                                  //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
342
                              }
342
                              }
343
 
343
 

+ 2
- 1
platforms/browser/www/js/saveLocal.js View File

28
   if (checkDate() == false) {
28
   if (checkDate() == false) {
29
 
29
 
30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
31
+    window.localStorage.setItem("TODOS", loadFile("https://136.145.181.12/artesanias.json"))
31
 
32
 
32
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
33
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
33
-    console.log(renglones);
34
+
34
     for (var i = 0; i < renglones.length; i++) {
35
     for (var i = 0; i < renglones.length; i++) {
35
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
36
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
36
     }
37
     }

platforms/browser/www/img/Barro.jpg → www/img/BARRO.jpg View File


platforms/browser/www/img/Cristal.jpg → www/img/CRISTAL.jpg View File


platforms/browser/www/img/Cuero.jpg → www/img/CUERO.jpg View File


platforms/browser/www/img/Fibras.jpg → www/img/FIBRAS.jpg View File


platforms/browser/www/img/Higüera.jpg → www/img/HIGÜERA.jpg View File


platforms/browser/www/img/Instrumento musical.jpg → www/img/INSTRUMENTO TÍPICO.jpg View File


platforms/browser/www/img/Juguetes tradicional.jpg → www/img/JUGUETES TRADICIONAL.jpg View File


platforms/browser/www/img/Labores en aguja.jpg → www/img/LABORES EN AGUJA.jpg View File


platforms/browser/www/img/Madera.jpg → www/img/MADERA.jpg View File


platforms/browser/www/img/Metal.jpg → www/img/METAL.jpg View File


platforms/browser/www/img/Tabacos.jpg → www/img/TABACOS.jpg View File


platforms/browser/www/img/Textiles.jpg → www/img/TEXTILES.jpg View File


+ 8
- 8
www/index.html View File

53
 
53
 
54
       <script type="text/javascript" src="js/saveLocal.js"></script>
54
       <script type="text/javascript" src="js/saveLocal.js"></script>
55
 
55
 
56
-
56
+      <script> console.log(window.localStorage.getItem("MADERA")); </script>
57
 
57
 
58
 
58
 
59
         <ons-navigator swipeable animation="slide" id="myNavigator">
59
         <ons-navigator swipeable animation="slide" id="myNavigator">
121
                         //var File = this.data.title.toUpperCase() + '.json' ;
121
                         //var File = this.data.title.toUpperCase() + '.json' ;
122
                         var Esp = this.data.esp.split(', ');
122
                         var Esp = this.data.esp.split(', ');
123
                         var artesanos_json = this.data.json;
123
                         var artesanos_json = this.data.json;
124
-                        console.log(artesanos_json);
124
+
125
 
125
 
126
                         //Convertir en mayuscula primera letra del string.
126
                         //Convertir en mayuscula primera letra del string.
127
                         for(var i=0; i<Esp.length; i++) {
127
                         for(var i=0; i<Esp.length; i++) {
198
               <ons-list-item expandable tappable>
198
               <ons-list-item expandable tappable>
199
                 <div class="center" >${Artesano.Nombre}</div>
199
                 <div class="center" >${Artesano.Nombre}</div>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
201
-                                                 Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
201
+                                                 Tel\u00e9fono: ${Artesano["Telefono 1"]}<br>
202
                                                  Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
202
                                                  Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
203
                                                  </div>
203
                                                  </div>
204
               </ons-list-item>`
204
               </ons-list-item>`
217
                             if (Artesano.Municipio.trim().length != 0) {
217
                             if (Artesano.Municipio.trim().length != 0) {
218
                                 cont ++;
218
                                 cont ++;
219
                             }
219
                             }
220
-                            if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
220
+                            if (Artesano["Telefono 1"].trim().length != 0) {
221
                                 cont ++;
221
                                 cont ++;
222
                             }
222
                             }
223
                             if (Artesano["E-mail"].trim().length != 0) {
223
                             if (Artesano["E-mail"].trim().length != 0) {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
-                            if (Artesano.Especificaciones.trim().length != 0) {
226
+                            if (Artesano.Especificacion.trim().length != 0) {
227
                                 cont ++;
227
                                 cont ++;
228
                             }
228
                             }
229
 
229
 
230
 
230
 
231
                             //info a pasar
231
                             //info a pasar
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
233
-                            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["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}' } })" tappable>
234
                         <div class="title">${Artesano.Nombre}</div>
234
                         <div class="title">${Artesano.Nombre}</div>
235
                     </ons-list-item>`);
235
                     </ons-list-item>`);
236
 
236
 
324
                              var searchVal = "my Name";
324
                              var searchVal = "my Name";
325
                              for (var i=0 ; i < artesanos_json.length ; i++)
325
                              for (var i=0 ; i < artesanos_json.length ; i++)
326
                              {
326
                              {
327
-                                 if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
327
+                                 if (artesanos_json[i].Especificacion.includes(Esp[num])) {
328
                                      results.push(artesanos_json[i]);
328
                                      results.push(artesanos_json[i]);
329
                                  }
329
                                  }
330
                              }
330
                              }
337
 
337
 
338
                                  //if(Esp[num] in artesanos_json.) {}
338
                                  //if(Esp[num] in artesanos_json.) {}
339
                                  Artesanos+=`${results[i].Nombre}|`
339
                                  Artesanos+=`${results[i].Nombre}|`
340
-                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Tel\u00e9fono 1"]}|${results[i]["E-mail"]}|${results[i].Especificaciones}&&`
340
+                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Telefono 1"]}|${results[i]["E-mail"]}|${results[i].Especificacion}&&`
341
                                  //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
341
                                  //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
342
                              }
342
                              }
343
 
343
 

+ 2
- 1
www/js/saveLocal.js View File

28
   if (checkDate() == false) {
28
   if (checkDate() == false) {
29
 
29
 
30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
31
+    window.localStorage.setItem("TODOS", loadFile("https://136.145.181.12/artesanias.json"))
31
 
32
 
32
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
33
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
33
-    console.log(renglones);
34
+
34
     for (var i = 0; i < renglones.length; i++) {
35
     for (var i = 0; i < renglones.length; i++) {
35
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
36
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
36
     }
37
     }