Browse Source

Added social networks to artesano.

lyxaira.glass 4 years ago
parent
commit
fc0d6da325

+ 1
- 1
platforms/browser/www/artesano.html View File

@@ -54,7 +54,7 @@
54 54
 
55 55
         document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");
56 56
 
57
-
57
+        console.log("SE CORRE");
58 58
 
59 59
     });
60 60
 

BIN
platforms/browser/www/img/MySpace.png View File


BIN
platforms/browser/www/img/internet.jpg View File


+ 36
- 6
platforms/browser/www/index.html View File

@@ -229,7 +229,7 @@
229 229
 
230 230
                             //info a pasar
231 231
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
-                            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"]}', redes: '${Artesano["E-Commerce1"]}', esp: '${Artesano.Especificacion}' } })" tappable>
232
+                            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}', redes: '${Artesano["E-Commerce 1"]}' } })" tappable>
233 233
                         <div class="title">${Artesano.Nombre}</div>
234 234
                     </ons-list-item>`);
235 235
 
@@ -366,9 +366,10 @@
366 366
                                      mun = lot[0],
367 367
                                      tel = lot[1],
368 368
                                      email = lot[2],
369
-                                     esp = lot[3];
369
+                                     esp = lot[3],
370
+                                     redes = lot[4];
370 371
 
371
-                                 listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}'}} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
372
+                                 listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', redes: '${redes}'}} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
372 373
                              }
373 374
 
374 375
 
@@ -491,7 +492,7 @@
491 492
                 <script>
492 493
                     for (i = 0; i < all_artesanos.length;i++){
493 494
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
494
-                        onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', redes: '${all_artesanos[i]["E-Commerce"]}', esp: '${all_artesanos[i].Especificacion}' } })" tappable>
495
+                        onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', esp: '${all_artesanos[i].Especificacion}', redes: '${all_artesanos[i]["E-Commerce 1"]}' } })" tappable>
495 496
                         <div>${all_artesanos[i].Nombre}</div>
496 497
                     </ons-list-item>`);
497 498
                         // var artesano = ons.createElement(`
@@ -525,7 +526,8 @@
525 526
                             mun = this.data.mun,
526 527
                             tel = this.data.tel,
527 528
                             em = this.data.email,
528
-                            esp = this.data.esp;
529
+                            esp = this.data.esp,
530
+                            redes = this.data.redes;
529 531
 
530 532
                         email = em.slice(0, em.search("#"));
531 533
                         if(esp.trim() != ""){
@@ -555,6 +557,34 @@
555 557
                             data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
556 558
                         }
557 559
 
560
+                        console.log("Redes: "+redes);
561
+
562
+                        if(redes.includes("facebook")){
563
+
564
+                            console.log(redes.substring(1,redes.length-2));
565
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;"><br>';
566
+                        }
567
+                        else if(redes.includes("instagram")){
568
+                            console.log(redes.substring(1,redes.length-2));
569
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;"><br>';
570
+                        }
571
+                        else if(redes.includes("myspace")){
572
+                            console.log(redes.substring(1,redes.length-2));
573
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;"><br>';
574
+                        }
575
+                        else if((redes.includes(".org") || redes.includes(".com")) && !redes.includes("mailto")){
576
+                            redes = redes.substr(redes.indexOf("#")+1,redes.length);
577
+                            redes = redes.substr(0, redes.length-1);
578
+                            console.log(redes);
579
+                            data+='<br><a href="'+ redes + '"><img src="img/internet.jpg" style="width:35px;height:35px;border:0;"><br>';
580
+                        }
581
+                        else if(redes.includes("#") || redes.includes("mailto")){
582
+                            console.log("tiene un disparate");
583
+                        } else {
584
+                            console.log("no tiene nada");
585
+                        }
586
+
587
+
558 588
                         document.getElementById("all").innerHTML = `${data}`;
559 589
 
560 590
                     }
@@ -680,4 +710,4 @@
680 710
         <script type="text/javascript" src="cordova.js"></script>
681 711
         <script type="text/javascript" src="js/index.js"></script>
682 712
     </body>
683
-</html>
713
+</html>

+ 1
- 1
www/artesano.html View File

@@ -54,7 +54,7 @@
54 54
 
55 55
         document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");
56 56
 
57
-
57
+        console.log("SE CORRE");
58 58
 
59 59
     });
60 60
 

BIN
www/img/MySpace.png View File


BIN
www/img/internet.jpg View File


+ 35
- 5
www/index.html View File

@@ -229,7 +229,7 @@
229 229
 
230 230
                             //info a pasar
231 231
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
-                            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"]}', redes: '${Artesano["E-Commerce1"]}', esp: '${Artesano.Especificacion}' } })" tappable>
232
+                            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}', redes: '${Artesano["E-Commerce 1"]}' } })" tappable>
233 233
                         <div class="title">${Artesano.Nombre}</div>
234 234
                     </ons-list-item>`);
235 235
 
@@ -366,9 +366,10 @@
366 366
                                      mun = lot[0],
367 367
                                      tel = lot[1],
368 368
                                      email = lot[2],
369
-                                     esp = lot[3];
369
+                                     esp = lot[3],
370
+                                     redes = lot[4];
370 371
 
371
-                                 listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}'}} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
372
+                                 listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', redes: '${redes}'}} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
372 373
                              }
373 374
 
374 375
 
@@ -491,7 +492,7 @@
491 492
                 <script>
492 493
                     for (i = 0; i < all_artesanos.length;i++){
493 494
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
494
-                        onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', redes: '${all_artesanos[i]["E-Commerce"]}', esp: '${all_artesanos[i].Especificacion}' } })" tappable>
495
+                        onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', esp: '${all_artesanos[i].Especificacion}', redes: '${all_artesanos[i]["E-Commerce 1"]}' } })" tappable>
495 496
                         <div>${all_artesanos[i].Nombre}</div>
496 497
                     </ons-list-item>`);
497 498
                         // var artesano = ons.createElement(`
@@ -525,7 +526,8 @@
525 526
                             mun = this.data.mun,
526 527
                             tel = this.data.tel,
527 528
                             em = this.data.email,
528
-                            esp = this.data.esp;
529
+                            esp = this.data.esp,
530
+                            redes = this.data.redes;
529 531
 
530 532
                         email = em.slice(0, em.search("#"));
531 533
                         if(esp.trim() != ""){
@@ -555,6 +557,34 @@
555 557
                             data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
556 558
                         }
557 559
 
560
+                        console.log("Redes: "+redes);
561
+
562
+                        if(redes.includes("facebook")){
563
+
564
+                            console.log(redes.substring(1,redes.length-2));
565
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;"><br>';
566
+                        }
567
+                        else if(redes.includes("instagram")){
568
+                            console.log(redes.substring(1,redes.length-2));
569
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;"><br>';
570
+                        }
571
+                        else if(redes.includes("myspace")){
572
+                            console.log(redes.substring(1,redes.length-2));
573
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;"><br>';
574
+                        }
575
+                        else if((redes.includes(".org") || redes.includes(".com")) && !redes.includes("mailto")){
576
+                            redes = redes.substr(redes.indexOf("#")+1,redes.length);
577
+                            redes = redes.substr(0, redes.length-1);
578
+                            console.log(redes);
579
+                            data+='<br><a href="'+ redes + '"><img src="img/internet.jpg" style="width:35px;height:35px;border:0;"><br>';
580
+                        }
581
+                        else if(redes.includes("#") || redes.includes("mailto")){
582
+                            console.log("tiene un disparate");
583
+                        } else {
584
+                            console.log("no tiene nada");
585
+                        }
586
+
587
+
558 588
                         document.getElementById("all").innerHTML = `${data}`;
559 589
 
560 590
                     }