Browse Source

Artesanos page correclty ordered with functioning links to call and send emails. As well as dividing the specifications by commas and other context related structures.

lyxaira.glass 4 years ago
parent
commit
58484d7a3d
4 changed files with 63 additions and 123 deletions
  1. 3
    7
      platforms/browser/www/artesano.html
  2. 29
    55
      platforms/browser/www/index.html
  3. 3
    7
      www/artesano.html
  4. 28
    54
      www/index.html

+ 3
- 7
platforms/browser/www/artesano.html View File

42
             }
42
             }
43
         }
43
         }
44
 
44
 
45
-        var telefono = "Teléfono 1";
46
-        var clickTel = (((json[i]["Teléfono 1"].replace('(', "")).replace(')', "")).replace('-', "")).replace(' ', "");
47
-
48
-        var email = "E-mail";
49
-
45
+        console.log("entre a artesano.html...???");
50
 
46
 
51
         document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
47
         document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
52
 
48
 
54
 
50
 
55
         document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
51
         document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
56
 
52
 
57
-        document.write("<a class='button' href='tel://" + clickTel + "'>" + "<h2 align='center'>" + json[i][telefono] + "</h2>" + "</a>");
53
+        document.write("<a class='button' href='tel://" + json[i]["Teléfono 1"] + "'>" + "<h2 align='center'>" + json[i]["Teléfono 1"] + "</h2>" + "</a>");
58
 
54
 
59
-        document.write("<a href='mailto:" + json[i][email] + "'>" + "<h2 align='center'>" + json[i][email] + "</h2>" + "</a>");
55
+        document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");
60
 
56
 
61
 
57
 
62
 
58
 

+ 29
- 55
platforms/browser/www/index.html View File

220
                             if (Artesano["Telefono 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 & Artesano["E-mail"].toUpperCase().trim() != "NO TIENE") {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
                             if (Artesano.Especificacion.trim().length != 0) {
226
                             if (Artesano.Especificacion.trim().length != 0) {
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["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}' } })" 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"]}', redes: '${Artesano["E-Commerce1"]}', 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
 
411
 
411
 
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
413
 
413
 
414
-        <template id="artesano.html">
415
-            <ons-page id="artesano">
416
-                <ons-toolbar>
417
-                    <div class="left"><ons-back-button>Atras</ons-back-button></div>
418
-                    <div class="center"></div>
419
-                </ons-toolbar>
420
-                <body>
421
-                    <ons-card id="all"></ons-card>
422
-                </body>
423
-                <script>
424
-                    ons.getScriptPage().onInit = function () {
425
-                        this.querySelector('ons-toolbar div.center').textContent = this.data.title;
426
-
427
-                        var data = 'Tipo de Artesania: '+ this.data.esp +'<br>',
428
-                            mun = this.data.mun,
429
-                            tel = this.data.tel,
430
-                            email = this.data.email;
431
-
432
-
433
-                        if(mun.trim() != ""){
434
-                            data+='Municipio: '+ mun +'<br>';
435
-                        }
436
-                        
437
-                        if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
438
-                            data+='Correo Electr\u00f3nico: <a class=\'button\' href=\'mailto: '+ email +'\'><h2 align=\'center\'>'+email +'</h2></a><br>';
439
-                        }
440
-
441
-                        if(tel.trim() != "" ){
442
-                            data+='Tel\u00e9fono: <a class=\'button\' href=\'tel: '+ tel +'\'><h2 align=\'center\'>'+ tel +'</h2></a><br>';
443
-                        }
444
-
445
-                        document.getElementById("all").innerHTML = `${info}`;
446
-
447
-                    }
448
-                </script>
449
-
450
-            </ons-page>
451
-        </template>
452
-
453
-<!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
454
-
455
         <script>
414
         <script>
456
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
415
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
457
             function filter(){
416
             function filter(){
536
                 <script>
495
                 <script>
537
                     for (i = 0; i < Madera.length;i++){
496
                     for (i = 0; i < Madera.length;i++){
538
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
497
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
539
-                        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>
498
+                        onclick="myNavigator.pushPage('artesano.html', { data: {title: '${Madera[i].Nombre}', mun: '${Madera[i].Municipio}', tel: '${Madera[i]["Telefono1"]}', email: '${Madera[i]["E-mail1"]}', redes: '${Madera[i]["E-Commerce1"]}', esp: '${Madera[i].Especificaciones1}' } })" tappable>
540
                         <div>${Madera[i].Nombre}</div>
499
                         <div>${Madera[i].Nombre}</div>
541
                     </ons-list-item>`);
500
                     </ons-list-item>`);
542
                         // var artesano = ons.createElement(`
501
                         // var artesano = ons.createElement(`
566
                     ons.getScriptPage().onInit = function () {
525
                     ons.getScriptPage().onInit = function () {
567
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
526
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
568
 
527
 
569
-                        var info = ``,
528
+                        var data = '',
570
                             mun = this.data.mun,
529
                             mun = this.data.mun,
571
                             tel = this.data.tel,
530
                             tel = this.data.tel,
572
-                            email = this.data.email,
531
+                            em = this.data.email,
573
                             esp = this.data.esp;
532
                             esp = this.data.esp;
574
 
533
 
575
-                        if(mun.trim() != '') {
576
-                            info = info + `Municipio: ` + mun + `<br>`;
534
+                        email = em.slice(0, em.search("#"));
535
+                        if(esp.trim() != ""){
536
+                            if(esp.includes(";", 0)){
537
+                                esp=esp.replace(/;/g,", ");
538
+                                data+='Tipos de artesanias: '+esp+'<br>';
539
+                            }
540
+                            else {
541
+                                data+='Tipo de artesania: '+esp+'<br>';
542
+                            }
577
                         }
543
                         }
578
-                        if(tel.trim() != '') {
579
-                            info = info + `Tel\u00e9fono: <a href="tel:+1` + tel + `">` + tel + `</a><br>`;
544
+
545
+                        //console.log("Las redes son..."+this.data.redes);
546
+
547
+                        if(mun.trim() != ""){
548
+                            data+='Municipio: '+ mun +'<br>';
580
                         }
549
                         }
581
-                        if(email.trim() != '') {
582
-                            info = info + `Correo Electr\u00f3nico: ` + email + `<br>`;
550
+                        
551
+                        if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
552
+                            data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
583
                         }
553
                         }
584
-                        if(esp.trim() != '') {
585
-                            info = info + `Trabaja con: ` + esp + `<br>`;
554
+
555
+                        //Underlined <u></u>
556
+                        //Color blue <p style="color:blue"></p>
557
+
558
+                        if(tel.trim() != "" ){
559
+                            data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
586
                         }
560
                         }
587
 
561
 
588
-                        document.getElementById("all").innerHTML = `${info}`;
562
+                        document.getElementById("all").innerHTML = `${data}`;
589
 
563
 
590
                     }
564
                     }
591
                 </script>
565
                 </script>

+ 3
- 7
www/artesano.html View File

42
             }
42
             }
43
         }
43
         }
44
 
44
 
45
-        var telefono = "Teléfono 1";
46
-        var clickTel = (((json[i]["Teléfono 1"].replace('(', "")).replace(')', "")).replace('-', "")).replace(' ', "");
47
-
48
-        var email = "E-mail";
49
-
45
+        console.log("entre a artesano.html...???");
50
 
46
 
51
         document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
47
         document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
52
 
48
 
54
 
50
 
55
         document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
51
         document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
56
 
52
 
57
-        document.write("<a class='button' href='tel://" + clickTel + "'>" + "<h2 align='center'>" + json[i][telefono] + "</h2>" + "</a>");
53
+        document.write("<a class='button' href='tel://" + json[i]["Teléfono 1"] + "'>" + "<h2 align='center'>" + json[i]["Teléfono 1"] + "</h2>" + "</a>");
58
 
54
 
59
-        document.write("<a href='mailto:" + json[i][email] + "'>" + "<h2 align='center'>" + json[i][email] + "</h2>" + "</a>");
55
+        document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");
60
 
56
 
61
 
57
 
62
 
58
 

+ 28
- 54
www/index.html View File

220
                             if (Artesano["Telefono 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 & Artesano["E-mail"].toUpperCase().trim() != "NO TIENE") {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
                             if (Artesano.Especificacion.trim().length != 0) {
226
                             if (Artesano.Especificacion.trim().length != 0) {
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["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}' } })" 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"]}', redes: '${Artesano["E-Commerce1"]}', 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
 
411
 
411
 
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
413
 
413
 
414
-        <template id="artesano.html">
415
-            <ons-page id="artesano">
416
-                <ons-toolbar>
417
-                    <div class="left"><ons-back-button>Atras</ons-back-button></div>
418
-                    <div class="center"></div>
419
-                </ons-toolbar>
420
-                <body>
421
-                    <ons-card id="all"></ons-card>
422
-                </body>
423
-                <script>
424
-                    ons.getScriptPage().onInit = function () {
425
-                        this.querySelector('ons-toolbar div.center').textContent = this.data.title;
426
-
427
-                        var data = 'Tipo de Artesania: '+ this.data.esp +'<br>',
428
-                            mun = this.data.mun,
429
-                            tel = this.data.tel,
430
-                            email = this.data.email;
431
-                        console.log("AQUI ES");
432
-
433
-                        if(mun.trim() != ""){
434
-                            data+='Municipio: '+ mun +'<br>';
435
-                        }
436
-                        
437
-                        if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
438
-                            data+='Correo Electr\u00f3nico: <a class=\'button\' href=\'mailto: '+ email +'\'><h2 align=\'center\'><p style="color:blue"><u>'+email +'</u></p></h2></a><br>';
439
-                        }
440
-
441
-                        if(tel.trim() != "" ){
442
-                            data+='Tel\u00e9fono: <a class=\'button\' href=\'tel: '+ tel +'\'><h2 align=\'center\'><p style="color:blue"><u>'+ tel +'</u></p></h2></a><br>';
443
-                        }
444
-
445
-                        document.getElementById("all").innerHTML = `${info}`;
446
-
447
-                    }
448
-                </script>
449
-
450
-            </ons-page>
451
-        </template>
452
-
453
-<!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
454
-
455
         <script>
414
         <script>
456
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
415
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
457
             function filter(){
416
             function filter(){
566
                     ons.getScriptPage().onInit = function () {
525
                     ons.getScriptPage().onInit = function () {
567
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
526
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
568
 
527
 
569
-                        var info = ``,
528
+                        var data = '',
570
                             mun = this.data.mun,
529
                             mun = this.data.mun,
571
                             tel = this.data.tel,
530
                             tel = this.data.tel,
572
-                            email = this.data.email,
531
+                            em = this.data.email,
573
                             esp = this.data.esp;
532
                             esp = this.data.esp;
574
 
533
 
575
-                        if(mun.trim() != '') {
576
-                            info = info + `Municipio: ` + mun + `<br>`;
534
+                        email = em.slice(0, em.search("#"));
535
+                        if(esp.trim() != ""){
536
+                            if(esp.includes(";", 0)){
537
+                                esp=esp.replace(/;/g,", ");
538
+                                data+='Tipos de artesanias: '+esp+'<br>';
539
+                            }
540
+                            else {
541
+                                data+='Tipo de artesania: '+esp+'<br>';
542
+                            }
577
                         }
543
                         }
578
-                        if(tel.trim() != '') {
579
-                            info = info + `Tel\u00e9fono: <a href="tel:+1` + tel + `">` + tel + `</a><br>`;
544
+
545
+                        //console.log("Las redes son..."+this.data.redes);
546
+
547
+                        if(mun.trim() != ""){
548
+                            data+='Municipio: '+ mun +'<br>';
580
                         }
549
                         }
581
-                        if(email.trim() != '') {
582
-                            info = info + `Correo Electr\u00f3nico: ` + email + `<br>`;
550
+                        
551
+                        if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
552
+                            data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
583
                         }
553
                         }
584
-                        if(esp.trim() != '') {
585
-                            info = info + `Trabaja con: ` + esp + `<br>`;
554
+
555
+                        //Underlined <u></u>
556
+                        //Color blue <p style="color:blue"></p>
557
+
558
+                        if(tel.trim() != "" ){
559
+                            data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
586
                         }
560
                         }
587
 
561
 
588
-                        document.getElementById("all").innerHTML = `${info}`;
562
+                        document.getElementById("all").innerHTML = `${data}`;
589
 
563
 
590
                     }
564
                     }
591
                 </script>
565
                 </script>