Browse Source

hice algunos comments

carlos.diaz44 4 years ago
parent
commit
781502b725
3 changed files with 150 additions and 86 deletions
  1. 4
    20
      .idea/workspace.xml
  2. 56
    29
      platforms/android/app/src/main/assets/www/index.html
  3. 90
    37
      www/index.html

+ 4
- 20
.idea/workspace.xml View File

3
   <component name="ChangeListManager">
3
   <component name="ChangeListManager">
4
     <list default="true" id="eb079ee0-6a1e-46bc-8208-93306bafc623" name="Default Changelist" comment="">
4
     <list default="true" id="eb079ee0-6a1e-46bc-8208-93306bafc623" name="Default Changelist" comment="">
5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/artesano.html" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/artesano.html" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Barro.jpg" beforeDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Cristal.jpg" beforeDir="false" />
9
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Cuero.jpg" beforeDir="false" />
10
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Fibras.jpg" beforeDir="false" />
11
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Higüera.jpg" beforeDir="false" />
12
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Instrumento musical.jpg" beforeDir="false" />
13
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Juguetes tradicional.jpg" beforeDir="false" />
14
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Labores en aguja.jpg" beforeDir="false" />
15
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Madera.jpg" beforeDir="false" />
16
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Metal.jpg" beforeDir="false" />
17
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Tabacos.jpg" beforeDir="false" />
18
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/img/Textiles.jpg" beforeDir="false" />
19
       <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/index.html" afterDir="false" />
6
       <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/index.html" afterDir="false" />
20
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/js/load.js" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/js/load.js" afterDir="false" />
21
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/js/renglones.js" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/js/renglones.js" afterDir="false" />
22
-      <change beforePath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/js/saveLocal.js" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/android/app/src/main/assets/www/js/saveLocal.js" afterDir="false" />
23
       <change beforePath="$PROJECT_DIR$/www/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/www/index.html" afterDir="false" />
7
       <change beforePath="$PROJECT_DIR$/www/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/www/index.html" afterDir="false" />
24
     </list>
8
     </list>
25
     <option name="SHOW_DIALOG" value="false" />
9
     <option name="SHOW_DIALOG" value="false" />
96
     <servers />
80
     <servers />
97
   </component>
81
   </component>
98
   <component name="WindowStateProjectService">
82
   <component name="WindowStateProjectService">
99
-    <state x="1060" y="100" width="721" height="853" key="com.android.tools.idea.avdmanager.AvdListDialog" timestamp="1601055392605">
83
+    <state x="1060" y="100" width="721" height="853" key="com.android.tools.idea.avdmanager.AvdListDialog" timestamp="1601912501124">
100
       <screen x="0" y="0" width="1920" height="1053" />
84
       <screen x="0" y="0" width="1920" height="1053" />
101
     </state>
85
     </state>
102
-    <state x="1060" y="100" width="721" height="853" key="com.android.tools.idea.avdmanager.AvdListDialog/0.0.1920.1053@0.0.1920.1053" timestamp="1601055392605" />
103
-    <state x="1103" y="354" key="com.intellij.ide.util.TipDialog" timestamp="1601055351725">
86
+    <state x="1060" y="100" width="721" height="853" key="com.android.tools.idea.avdmanager.AvdListDialog/0.0.1920.1053@0.0.1920.1053" timestamp="1601912501124" />
87
+    <state x="1103" y="354" key="com.intellij.ide.util.TipDialog" timestamp="1601912489271">
104
       <screen x="0" y="0" width="1920" height="1053" />
88
       <screen x="0" y="0" width="1920" height="1053" />
105
     </state>
89
     </state>
106
-    <state x="1103" y="354" key="com.intellij.ide.util.TipDialog/0.0.1920.1053@0.0.1920.1053" timestamp="1601055351725" />
90
+    <state x="1103" y="354" key="com.intellij.ide.util.TipDialog/0.0.1920.1053@0.0.1920.1053" timestamp="1601912489271" />
107
     <state x="632" y="275" key="run.anything.popup" timestamp="1601055384225">
91
     <state x="632" y="275" key="run.anything.popup" timestamp="1601055384225">
108
       <screen x="0" y="0" width="1920" height="1053" />
92
       <screen x="0" y="0" width="1920" height="1053" />
109
     </state>
93
     </state>

+ 56
- 29
platforms/android/app/src/main/assets/www/index.html View File

6
     regarding copyright ownership.  The ASF licenses this file
6
     regarding copyright ownership.  The ASF licenses this file
7
     to you under the Apache License, Version 2.0 (the
7
     to you under the Apache License, Version 2.0 (the
8
     "License"); you may not use this file except in compliance
8
     "License"); you may not use this file except in compliance
9
-    with the License.  You may obtain a copy of the License at
9
+n't h    with the License.  You may obtain a copy of the License at
10
 
10
 
11
     http://www.apache.org/licenses/LICENSE-2.0
11
     http://www.apache.org/licenses/LICENSE-2.0
12
 
12
 
55
 
55
 
56
 
56
 
57
 
57
 
58
-
58
+            <!--the toolbar is where it will have the main name of the app and the ICP logo (top center)-->
59
            <ons-page>
59
            <ons-page>
60
             <ons-toolbar>
60
             <ons-toolbar>
61
                 <div class="center">Artesanias PR</div>
61
                 <div class="center">Artesanias PR</div>
62
                 <div class="right"><img class="list-item__thumbnail" src="img/ICP.png"></div>
62
                 <div class="right"><img class="list-item__thumbnail" src="img/ICP.png"></div>
63
             </ons-toolbar>
63
             </ons-toolbar>
64
+            <!--The tabbar is the place where the user can get acces to the different sections of the app-->
65
+            <!--Each tab will hace a page name (which we use to reference and define them later one), then we have a laber, this is what will be used as a name for that page in the tabbar-->
64
             <ons-tabbar swipeable position="bottom" modifier="autogrow">
66
             <ons-tabbar swipeable position="bottom" modifier="autogrow">
65
                 <ons-tab page="home.html" label="Hogar" active></ons-tab>
67
                 <ons-tab page="home.html" label="Hogar" active></ons-tab>
66
                 <ons-tab page="renglones.html" label="Artesanías"></ons-tab>
68
                 <ons-tab page="renglones.html" label="Artesanías"></ons-tab>
83
                     <!--<div class="title" id="Title"></div>-->
85
                     <!--<div class="title" id="Title"></div>-->
84
                     <div id="image"></div><br>
86
                     <div id="image"></div><br>
85
                     <div class="content" id="Content"></div>
87
                     <div class="content" id="Content"></div>
86
-
88
+                    <!--This javascript will randomly choose an image and information of a certain type of artesania used by a certain artists-->
89
+                    <!--For now all this information is stored inside a .csv file-->
87
                     <script type="text/javascript" src="js/azar.js"> </script>
90
                     <script type="text/javascript" src="js/azar.js"> </script>
88
 
91
 
89
                 </ons-card>
92
                 </ons-card>
94
         </template>
97
         </template>
95
 
98
 
96
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
99
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
97
-
100
+        <!--Here it's in the artesanos tab-->
98
         <template id="artesanos.html">
101
         <template id="artesanos.html">
99
             <ons-page id="artesanos">
102
             <ons-page id="artesanos">
100
-
103
+                <!-- This button lets the user go back to the previous page-->
101
                 <ons-toolbar>
104
                 <ons-toolbar>
102
                     <div class="left"><ons-back-button>Atrás</ons-back-button></div>
105
                     <div class="left"><ons-back-button>Atrás</ons-back-button></div>
103
                     <div class="center"></div>
106
                     <div class="center"></div>
107
                     <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
110
                     <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
108
                 </ons-pull-hook>
111
                 </ons-pull-hook>
109
 
112
 
113
+                
110
                 <ons-list id="artesanos-list" src="">
114
                 <ons-list id="artesanos-list" src="">
111
                     <ons-list-header>Artesanos</ons-list-header>
115
                     <ons-list-header>Artesanos</ons-list-header>
112
                 </ons-list>
116
                 </ons-list>
113
 
117
 
114
                 <script>
118
                 <script>
115
-
119
+                    
116
                     ons.getScriptPage().onInit = function () {
120
                     ons.getScriptPage().onInit = function () {
117
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
121
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
118
 
122
 
411
 
415
 
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
416
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
413
 <!----------------------------------------------------------------------------------->
417
 <!----------------------------------------------------------------------------------->
418
+        <!-->
419
+            The searchfunctions.js file is just a file that has all the definitions of the functions used later on in the switch
420
+        <!-->
414
         <script src = "js/searchfunctions.js"></script>
421
         <script src = "js/searchfunctions.js"></script>
415
         <script>
422
         <script>
416
-            //JSON file that has all the artesanos
423
+            //all_artesanos is the JSON file that has all the artesanos
417
             var all_artesanos = JSON.parse(window.localStorage.getItem("TODOS"));
424
             var all_artesanos = JSON.parse(window.localStorage.getItem("TODOS"));
425
+
418
             function filter(){
426
             function filter(){
427
+                //finds the values of the search bar which are sent from the block of code after this script
428
+                //input is the one you use to filter by any parameter
429
+                //inputarte is the one you use to filter by the type of art the artists make
430
+                //inputmuni is the one you use to filter by municipio
431
+                //informacion is the variable that has all the information that will be sent to this tab, what we're going to use here is just to declare which artists are seen (informacion[i].style.display = "list-item") and which are not seen (informacion[i].style.display = "none")
419
                 var input = document.getElementById('searchbar').value;
432
                 var input = document.getElementById('searchbar').value;
420
                 var inputarte = document.getElementById('searchartesania').value;
433
                 var inputarte = document.getElementById('searchartesania').value;
421
                 var inputmuni = document.getElementById('searchbarmunicipio').value;
434
                 var inputmuni = document.getElementById('searchbarmunicipio').value;
422
-                var x = document.getElementsByClassName('artists');
423
-                //making sure they're all in the same format
424
-                input = input.trim().toLowerCase();
425
-                inputarte = inputarte.trim().toLowerCase();
426
-                inputmuni = inputmuni.trim().toLowerCase();
427
-                input = acento_replace(input);
428
-                inputarte = acento_replace(inputarte);
429
-                inputmuni = acento_replace(inputmuni);
430
-                //default case is where evey one of them has nothing or less than 3 characters (displays every artist)
435
+                var informacion = document.getElementsByClassName('artists');
436
+                //just making sure everything is at the same format by taking out special characters, trimming it and putting it in lowercase (same thing will be done to the arguments it's being compared to later on)
437
+                //acento_replace(): it's a function I made that takes out any special characters of a word and changes them back to the plain ones (quitar acentos o cosas asi)
438
+                input = acento_replace(input.trim().toLowerCase());
439
+                inputarte = acento_replace(inputarte.trim().toLowerCase());
440
+                inputmuni = acento_replace(inputmuni.trim().toLowerCase());
441
+                //default case is where evey one of them has nothing or less than 3 characters (displays every artist until it passes that length)
431
                 if (input.length <= 3 && inputarte.length <= 3 && inputmuni.length <= 3){
442
                 if (input.length <= 3 && inputarte.length <= 3 && inputmuni.length <= 3){
432
                     for (var i = 0; all_artesanos.length; i++){
443
                     for (var i = 0; all_artesanos.length; i++){
433
-                        x[i].style.display = "list-item";
444
+                        informacion[i].style.display = "list-item";
434
                     }
445
                     }
435
                 }
446
                 }
436
                 else{
447
                 else{
438
                     cases = getcasenum(input,inputarte,inputmuni);
449
                     cases = getcasenum(input,inputarte,inputmuni);
439
                     //take every one of them out first (dont display any)
450
                     //take every one of them out first (dont display any)
440
                     for (var i = 0; i < all_artesanos.length; i++){
451
                     for (var i = 0; i < all_artesanos.length; i++){
441
-                        x[i].style.display = "none";
452
+                        informacion[i].style.display = "none";
442
                     }
453
                     }
443
                     switch(cases){
454
                     switch(cases){
444
                         //cases == 1 when only inputmuni has been writen on
455
                         //cases == 1 when only inputmuni has been writen on
477
         <template id="search.html">
488
         <template id="search.html">
478
           <ons-navigator swipeable animation="slide" id="SNavigator">
489
           <ons-navigator swipeable animation="slide" id="SNavigator">
479
             <ons-page id="Buscar">
490
             <ons-page id="Buscar">
491
+                <!--
492
+                    This is the search bars, each time you type a character into any of the search bars, they will run the filter() function with what they all have as arguments (even if the other search bars have nothing in them)
493
+                    The first search bar is to find by any information related to the artist
494
+                    The second searchbar is to find by the type of artwork they work on
495
+                    The third searchbar is to find by the municipio where the artists works or lives?
496
+                -->
480
                 <p style="text-align: center; margin-top: 10px;">
497
                 <p style="text-align: center; margin-top: 10px;">
481
                     <ons-search-input placeholder="Busqueda en cualquiera" id = "searchbar"
498
                     <ons-search-input placeholder="Busqueda en cualquiera" id = "searchbar"
482
                         onkeyup = "filter()"></ons-search-input>
499
                         onkeyup = "filter()"></ons-search-input>
490
                 </ons-list>
507
                 </ons-list>
491
 
508
 
492
                 <script>
509
                 <script>
510
+                    //This is basically declaring what we refer to as informacion in the filter() function
511
+                    //It iterates though each artists in the all_artesanos json file from before, it displays their name in the "Buscar" page, and it gets prepared so that when its clicked it redirects to the "artesano.html" page with the other aditional information that we have other than the name. 
493
                     for (i = 0; i < all_artesanos.length;i++){
512
                     for (i = 0; i < all_artesanos.length;i++){
494
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
513
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
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>
514
                         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>
496
                         <div>${all_artesanos[i].Nombre}</div>
515
                         <div>${all_artesanos[i].Nombre}</div>
497
                     </ons-list-item>`);
516
                     </ons-list-item>`);
498
-                        // var artesano = ons.createElement(`
499
-                        //   <ons-list-item class = "artists">
500
-                        //     <div class="center" >${all_artesanos[i].Nombre}</div>
501
-                        //   </ons-list-item>`
502
-                        // );
503
                         document.getElementById('results').appendChild(artesano);
517
                         document.getElementById('results').appendChild(artesano);
504
                     }
518
                     }
505
                 </script>
519
                 </script>
508
         </template>
522
         </template>
509
 
523
 
510
         <!-- ---------------------------------------------------------------------------------------------------------------------------------------- -->
524
         <!-- ---------------------------------------------------------------------------------------------------------------------------------------- -->
511
-
525
+        <!--This page is used so that we can display the information of a specific artists, and whenever the artists is missing information then we just dont include that in the page-->
512
         <template id= "artesano.html">
526
         <template id= "artesano.html">
513
             <ons-page id = "artesano">
527
             <ons-page id = "artesano">
514
                 <ons-toolbar>
528
                 <ons-toolbar>
529
+                    <!-- Pretty self explanatory, its a button that goes back to the previous page -->
515
                     <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
530
                     <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
516
                     <div class = "center"></div>
531
                     <div class = "center"></div>
517
                 </ons-toolbar>
532
                 </ons-toolbar>
518
                 <body>
533
                 <body>
534
+                    <!-- This is where we'll put all the information of that artsts -->
519
                     <ons-card id="all"></ons-card>
535
                     <ons-card id="all"></ons-card>
520
                 </body>
536
                 </body>
521
                 <script>
537
                 <script>
538
+                    //when it opens this page this function starts to run, it first recieves the information that was sent to "artesano.html"
522
                     ons.getScriptPage().onInit = function () {
539
                     ons.getScriptPage().onInit = function () {
523
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
540
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
524
 
541
 
529
                             esp = this.data.esp,
546
                             esp = this.data.esp,
530
                             redes = this.data.redes;
547
                             redes = this.data.redes;
531
 
548
 
549
+                        //here the email is the string made from the start to where the '#' is.
532
                         email = em.slice(0, em.search("#"));
550
                         email = em.slice(0, em.search("#"));
551
+
552
+                        //Here it's dividing all the especificaciones and writing them into the page (data) and then goes to the next line
553
+                        //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
554
+                        //but if theres only one then you just write it into the page
533
                         if(esp.trim() != ""){
555
                         if(esp.trim() != ""){
534
                             if(esp.includes(";", 0)){
556
                             if(esp.includes(";", 0)){
535
                                 esp=esp.replace(/;/g,", ");
557
                                 esp=esp.replace(/;/g,", ");
542
 
564
 
543
                         //console.log("Las redes son..."+this.data.redes);
565
                         //console.log("Las redes son..."+this.data.redes);
544
 
566
 
567
+                        //Here it's writing their municipio into the page
545
                         if(mun.trim() != ""){
568
                         if(mun.trim() != ""){
546
                             data+='Municipio: '+ mun +'<br>';
569
                             data+='Municipio: '+ mun +'<br>';
547
                         }
570
                         }
548
 
571
 
572
+                        //Here it's writing their email, in blue color and its used as a link to send one when it's clicked, then it goes to the next line
573
+                        //Whenever the variable is empty or if it has "NO TIENE" then it doesnt write anything
549
                         if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
574
                         if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
550
                             data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
575
                             data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
551
                         }
576
                         }
552
 
577
 
553
-                        //Underlined <u></u>
554
-                        //Color blue <p style="color:blue"></p>
555
-
578
+                        //Here it's writing their phone number into the page,its in blue and whenever its clicked the app will redirect the user to call them, then it goes to the next line
556
                         if(tel.trim() != "" ){
579
                         if(tel.trim() != "" ){
557
                             data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
580
                             data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
558
                         }
581
                         }
559
 
582
 
560
                         console.log("Redes: "+redes);
583
                         console.log("Redes: "+redes);
561
 
584
 
585
+                        //Here it has to decide what to do depending on the links they give to their social media pages
586
+                        //if the link is to a facebook, instagram or myspace account then it will show the picture of the social media site, and when you click the picture then the app redirects you to their social media.
587
+                        //The alt attribute is required for images, it's in case theres no internet connection, then it will display that tet instead, I think screen readers can also read that text
588
+                        //If the link is to another website (but isn't a mailto link) then it will display a default picture we chose to display a default web browser, like the other ones clikcing on it will take you to the link.
589
+                        //If it's none of them then it will not display anything.
562
                         if(redes.includes("facebook")){
590
                         if(redes.includes("facebook")){
563
-
564
                             console.log(redes.substring(1,redes.length-2));
591
                             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>';
592
                             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
                         }
593
                         }
584
                             console.log("no tiene nada");
611
                             console.log("no tiene nada");
585
                         }
612
                         }
586
 
613
 
587
-
614
+                        //This is the part that allows eveything (data) to be displayed
588
                         document.getElementById("all").innerHTML = `${data}`;
615
                         document.getElementById("all").innerHTML = `${data}`;
589
 
616
 
590
                     }
617
                     }

+ 90
- 37
www/index.html View File

6
     regarding copyright ownership.  The ASF licenses this file
6
     regarding copyright ownership.  The ASF licenses this file
7
     to you under the Apache License, Version 2.0 (the
7
     to you under the Apache License, Version 2.0 (the
8
     "License"); you may not use this file except in compliance
8
     "License"); you may not use this file except in compliance
9
-    with the License.  You may obtain a copy of the License at
9
+n't h    with the License.  You may obtain a copy of the License at
10
 
10
 
11
     http://www.apache.org/licenses/LICENSE-2.0
11
     http://www.apache.org/licenses/LICENSE-2.0
12
 
12
 
55
 
55
 
56
 
56
 
57
 
57
 
58
-
58
+            <!--the toolbar is where it will have the main name of the app and the ICP logo (top center)-->
59
            <ons-page>
59
            <ons-page>
60
             <ons-toolbar>
60
             <ons-toolbar>
61
                 <div class="center">Artesanias PR</div>
61
                 <div class="center">Artesanias PR</div>
62
                 <div class="right"><img class="list-item__thumbnail" src="img/ICP.png"></div>
62
                 <div class="right"><img class="list-item__thumbnail" src="img/ICP.png"></div>
63
             </ons-toolbar>
63
             </ons-toolbar>
64
+            <!--The tabbar is the place where the user can get acces to the different sections of the app-->
65
+            <!--Each tab will hace a page name (which we use to reference and define them later one), then we have a laber, this is what will be used as a name for that page in the tabbar-->
64
             <ons-tabbar swipeable position="bottom" modifier="autogrow">
66
             <ons-tabbar swipeable position="bottom" modifier="autogrow">
65
                 <ons-tab page="home.html" label="Hogar" active></ons-tab>
67
                 <ons-tab page="home.html" label="Hogar" active></ons-tab>
66
                 <ons-tab page="renglones.html" label="Artesanías"></ons-tab>
68
                 <ons-tab page="renglones.html" label="Artesanías"></ons-tab>
83
                     <!--<div class="title" id="Title"></div>-->
85
                     <!--<div class="title" id="Title"></div>-->
84
                     <div id="image"></div><br>
86
                     <div id="image"></div><br>
85
                     <div class="content" id="Content"></div>
87
                     <div class="content" id="Content"></div>
86
-
88
+                    <!--This javascript will randomly choose an image and information of a certain type of artesania used by a certain artists-->
89
+                    <!--For now all this information is stored inside a .csv file-->
87
                     <script type="text/javascript" src="js/azar.js"> </script>
90
                     <script type="text/javascript" src="js/azar.js"> </script>
88
 
91
 
89
                 </ons-card>
92
                 </ons-card>
94
         </template>
97
         </template>
95
 
98
 
96
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
99
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
97
-
100
+        <!-- This is the page that's accesed when someone clicks on a renglon (tipo de material usado) and then artesanos, it will show a list of all the
101
+            artists that work with that type of material
102
+        -->
98
         <template id="artesanos.html">
103
         <template id="artesanos.html">
99
             <ons-page id="artesanos">
104
             <ons-page id="artesanos">
100
-
105
+                <!-- This button lets the user go back to the previous page of the artesanias tab-->
101
                 <ons-toolbar>
106
                 <ons-toolbar>
102
                     <div class="left"><ons-back-button>Atrás</ons-back-button></div>
107
                     <div class="left"><ons-back-button>Atrás</ons-back-button></div>
103
                     <div class="center"></div>
108
                     <div class="center"></div>
104
                 </ons-toolbar>
109
                 </ons-toolbar>
105
 
110
 
111
+                <!--Not sure what this does....-->
112
+                <!-- when you pull down and are already at the top of the artesanos list then you see that fa-arrow-down on the top-->
106
                 <ons-pull-hook id="pull-hook" threshold-height="120px">
113
                 <ons-pull-hook id="pull-hook" threshold-height="120px">
107
                     <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
114
                     <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
108
                 </ons-pull-hook>
115
                 </ons-pull-hook>
109
 
116
 
117
+                <!--This is where it will make the list, so the function that puts the artists here should reference this -->
110
                 <ons-list id="artesanos-list" src="">
118
                 <ons-list id="artesanos-list" src="">
111
                     <ons-list-header>Artesanos</ons-list-header>
119
                     <ons-list-header>Artesanos</ons-list-header>
112
                 </ons-list>
120
                 </ons-list>
113
 
121
 
114
                 <script>
122
                 <script>
115
-
123
+                    
116
                     ons.getScriptPage().onInit = function () {
124
                     ons.getScriptPage().onInit = function () {
125
+                        //not sure what this does, because I dont really know what this.data.title have inside 
126
+                        //But I think what it has is the renglon that the user chose in the previous tab, and then using it as the title on this page
117
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
127
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
118
 
128
 
119
-
120
-                        //var File = this.data.title.toUpperCase() + '.json' ;
129
+                        //var File = this.data.title.toUpperCase() + '.json' 
130
+                        //seperates all types of especificaciones
121
                         var Esp = this.data.esp.split(', ');
131
                         var Esp = this.data.esp.split(', ');
132
+                        //Puts the json file of all the artesanos into this variable
122
                         var artesanos_json = this.data.json;
133
                         var artesanos_json = this.data.json;
123
 
134
 
124
-
135
+                        //Turns the first character into an upper case
125
                         //Convertir en mayuscula primera letra del string.
136
                         //Convertir en mayuscula primera letra del string.
126
                         for(var i=0; i<Esp.length; i++) {
137
                         for(var i=0; i<Esp.length; i++) {
127
                             Esp[i] = Esp[i].charAt(0).toUpperCase() + Esp[i].slice(1);
138
                             Esp[i] = Esp[i].charAt(0).toUpperCase() + Esp[i].slice(1);
128
                         };
139
                         };
129
 
140
 
141
+                        //This is what happens when you putt the list of names down when its already at the top
142
+                        //First the arrow faces down, at some point it spins and points to the top, right before the user's finger stops touching the screen
143
+                        //or if their finger goes back down.
130
                         var pullHook = document.getElementById('pull-hook');
144
                         var pullHook = document.getElementById('pull-hook');
131
                         var icon = document.getElementById('pull-hook-icon');
145
                         var icon = document.getElementById('pull-hook-icon');
132
                         pullHook.addEventListener('changestate', function (event) {
146
                         pullHook.addEventListener('changestate', function (event) {
149
                             }
163
                             }
150
                         });
164
                         });
151
 
165
 
166
+                        //This function recieves a number that is tied to a specific Especificacion (type of artesania that artist make like: boligrafos,figuras...) in the variable Esp declared beforehand
167
+                        //Then it finds and copies all the information of the artists that work on that type of artesania
168
+                        //It ends up returning the especificacion in 'name' and retuns all the names and municipios of the artists that it found in 'artesan'                                                
152
                         var getArtesania = function (num) {
169
                         var getArtesania = function (num) {
153
-
170
+                            //First it empty in case we dont find anyone, this is the variable where the information of the artist's name and municipio qill be sent
154
                             var Artesanos = ``;
171
                             var Artesanos = ``;
155
 
172
 
156
                             console.log('Filtrado de ',Esp[num])
173
                             console.log('Filtrado de ',Esp[num])
157
 
174
 
175
+                            //results: This variable will have all the information about the artists who work with that especificacion, it will look for this in the artesanos_json that has the whole json file of artesanos.
176
+                            //I dont think its using 'searchVal' for anything....
158
                             var results = [];
177
                             var results = [];
159
                             var searchVal = "my Name";
178
                             var searchVal = "my Name";
160
                             for (var i=0 ; i < artesanos_json.length ; i++)
179
                             for (var i=0 ; i < artesanos_json.length ; i++)
167
           /*var arr1=artesanos_json.filter(function(item){
186
           /*var arr1=artesanos_json.filter(function(item){
168
               return item.Nombre=="Ana";
187
               return item.Nombre=="Ana";
169
           });*/
188
           });*/
170
-
189
+                            //Arfter going through the whole json file
190
+                            //It adds the names and municipios of the ones found and later stored in 'results' to the 'Artesanos' variable
171
                             for(var i=0; i<results.length; i++) {
191
                             for(var i=0; i<results.length; i++) {
172
 
192
 
173
                                 //if(Esp[num] in artesanos_json.) {}
193
                                 //if(Esp[num] in artesanos_json.) {}
175
                                 //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
195
                                 //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
176
                             }
196
                             }
177
 
197
 
178
-
198
+                            //Then this function returns the name of the Especificacion that was searched in 'name'
199
+                            //And it also returns all the names and municipios of the artesanos that work with that especificacion
179
                             return {
200
                             return {
180
                                 name: Esp[num],
201
                                 name: Esp[num],
181
                                 artesan: Artesanos
202
                                 artesan: Artesanos
182
                             };
203
                             };
183
                         };
204
                         };
184
 
205
 
206
+                        //This function will iterate through all the especificaciones that you listed at the start of the artesanos page
207
+                        //It will iterate throuhg each one and it will recieve the names, and municipios of the arteanos that were found to work witht that especificacion.
185
                         var getData = function () {
208
                         var getData = function () {
186
                             const data = [];
209
                             const data = [];
187
                             for (var i = 0; i < Esp.length; i++) {
210
                             for (var i = 0; i < Esp.length; i++) {
190
                             return data;
213
                             return data;
191
                         };
214
                         };
192
 
215
 
193
-
216
+                        //not sure what this does because the element is also created later on, with even more information so idk if this one is just wrong
217
+                        //This will create a new tab with the information of the arteanos?
194
                         var createArtesano = function (Artesano) {
218
                         var createArtesano = function (Artesano) {
195
 
219
 
196
                             return ons.createElement(`
220
                             return ons.createElement(`
207
                         //var Artesanias = getData();
231
                         //var Artesanias = getData();
208
                         //artesanos_json
232
                         //artesanos_json
209
 
233
 
234
+                        //
210
                         for (Artesano of artesanos_json) {
235
                         for (Artesano of artesanos_json) {
211
 
236
 
212
                             var cont = 0;
237
                             var cont = 0;
213
                             var lista = document.getElementById('artesanos-list');
238
                             var lista = document.getElementById('artesanos-list');
214
 
239
 
215
                             //Recopilar datos no vacios.
240
                             //Recopilar datos no vacios.
241
+                            //Counts all the tyoes of data that the artists don't have
242
+                            //Later on, if you discover that they didn't have 'municipios', telephone numbers, emails and especificaciones then you wont display it.
216
                             if (Artesano.Municipio.trim().length != 0) {
243
                             if (Artesano.Municipio.trim().length != 0) {
217
                                 cont ++;
244
                                 cont ++;
218
                             }
245
                             }
229
 
256
 
230
                             //info a pasar
257
                             //info a pasar
231
                             //'title':'${Artesano.Nombre}','esp': '${info}'
258
                             //'title':'${Artesano.Nombre}','esp': '${info}'
259
+                            //Tries to pass all the info of each artesano into a new page, the page that display this information is 'artesano.html', not to be confused with 'artesanias.html' or 'artesanos.html'(current page)
260
+                            //And puts this into the 'item' variable
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>
261
                             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
                         <div class="title">${Artesano.Nombre}</div>
262
                         <div class="title">${Artesano.Nombre}</div>
234
                     </ons-list-item>`);
263
                     </ons-list-item>`);
235
 
264
 
236
-
265
+                            //If it didn't find 'municipios', telephone numbers, emails and 'especificaciones' of that artists then it wont include it on the 'artesanos-list' (variable: 'lista')
266
+                            //If it found that it has at least one of them then it will include it into the list.
237
                             if(cont == 0){
267
                             if(cont == 0){
238
                                 console.log(Artesano.Nombre+' no tiene ningun tipo de informacion.');
268
                                 console.log(Artesano.Nombre+' no tiene ningun tipo de informacion.');
239
                                 //return ons.createElement(``);
269
                                 //return ons.createElement(``);
411
 
441
 
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
442
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
413
 <!----------------------------------------------------------------------------------->
443
 <!----------------------------------------------------------------------------------->
444
+        <!-->
445
+            The searchfunctions.js file is just a file that has all the definitions of the functions used later on in the switch
446
+        <!-->
414
         <script src = "js/searchfunctions.js"></script>
447
         <script src = "js/searchfunctions.js"></script>
415
         <script>
448
         <script>
416
-            //JSON file that has all the artesanos
449
+            //all_artesanos is the JSON file that has all the artesanos
417
             var all_artesanos = JSON.parse(window.localStorage.getItem("TODOS"));
450
             var all_artesanos = JSON.parse(window.localStorage.getItem("TODOS"));
451
+
418
             function filter(){
452
             function filter(){
453
+                //finds the values of the search bar which are sent from the block of code after this script
454
+                //input is the one you use to filter by any parameter
455
+                //inputarte is the one you use to filter by the type of art the artists make
456
+                //inputmuni is the one you use to filter by municipio
457
+                //informacion is the variable that has all the information that will be sent to this tab, what we're going to use here is just to declare which artists are seen (informacion[i].style.display = "list-item") and which are not seen (informacion[i].style.display = "none")
419
                 var input = document.getElementById('searchbar').value;
458
                 var input = document.getElementById('searchbar').value;
420
                 var inputarte = document.getElementById('searchartesania').value;
459
                 var inputarte = document.getElementById('searchartesania').value;
421
                 var inputmuni = document.getElementById('searchbarmunicipio').value;
460
                 var inputmuni = document.getElementById('searchbarmunicipio').value;
422
-                var x = document.getElementsByClassName('artists');
423
-                //making sure they're all in the same format
424
-                input = input.trim().toLowerCase();
425
-                inputarte = inputarte.trim().toLowerCase();
426
-                inputmuni = inputmuni.trim().toLowerCase();
427
-                input = acento_replace(input);
428
-                inputarte = acento_replace(inputarte);
429
-                inputmuni = acento_replace(inputmuni);
430
-                //default case is where evey one of them has nothing or less than 3 characters (displays every artist)
461
+                var informacion = document.getElementsByClassName('artists');
462
+                //just making sure everything is at the same format by taking out special characters, trimming it and putting it in lowercase (same thing will be done to the arguments it's being compared to later on)
463
+                //acento_replace(): it's a function I made that takes out any special characters of a word and changes them back to the plain ones (quitar acentos o cosas asi)
464
+                input = acento_replace(input.trim().toLowerCase());
465
+                inputarte = acento_replace(inputarte.trim().toLowerCase());
466
+                inputmuni = acento_replace(inputmuni.trim().toLowerCase());
467
+                //default case is where evey one of them has nothing or less than 3 characters (displays every artist until it passes that length)
431
                 if (input.length <= 3 && inputarte.length <= 3 && inputmuni.length <= 3){
468
                 if (input.length <= 3 && inputarte.length <= 3 && inputmuni.length <= 3){
432
                     for (var i = 0; all_artesanos.length; i++){
469
                     for (var i = 0; all_artesanos.length; i++){
433
-                        x[i].style.display = "list-item";
470
+                        informacion[i].style.display = "list-item";
434
                     }
471
                     }
435
                 }
472
                 }
436
                 else{
473
                 else{
438
                     cases = getcasenum(input,inputarte,inputmuni);
475
                     cases = getcasenum(input,inputarte,inputmuni);
439
                     //take every one of them out first (dont display any)
476
                     //take every one of them out first (dont display any)
440
                     for (var i = 0; i < all_artesanos.length; i++){
477
                     for (var i = 0; i < all_artesanos.length; i++){
441
-                        x[i].style.display = "none";
478
+                        informacion[i].style.display = "none";
442
                     }
479
                     }
443
                     switch(cases){
480
                     switch(cases){
444
                         //cases == 1 when only inputmuni has been writen on
481
                         //cases == 1 when only inputmuni has been writen on
477
         <template id="search.html">
514
         <template id="search.html">
478
           <ons-navigator swipeable animation="slide" id="SNavigator">
515
           <ons-navigator swipeable animation="slide" id="SNavigator">
479
             <ons-page id="Buscar">
516
             <ons-page id="Buscar">
517
+                <!--
518
+                    This is the search bars, each time you type a character into any of the search bars, they will run the filter() function with what they all have as arguments (even if the other search bars have nothing in them)
519
+                    The first search bar is to find by any information related to the artist
520
+                    The second searchbar is to find by the type of artwork they work on
521
+                    The third searchbar is to find by the municipio where the artists works or lives?
522
+                -->
480
                 <p style="text-align: center; margin-top: 10px;">
523
                 <p style="text-align: center; margin-top: 10px;">
481
                     <ons-search-input placeholder="Busqueda en cualquiera" id = "searchbar"
524
                     <ons-search-input placeholder="Busqueda en cualquiera" id = "searchbar"
482
                         onkeyup = "filter()"></ons-search-input>
525
                         onkeyup = "filter()"></ons-search-input>
490
                 </ons-list>
533
                 </ons-list>
491
 
534
 
492
                 <script>
535
                 <script>
536
+                    //This is basically declaring what we refer to as informacion in the filter() function
537
+                    //It iterates though each artists in the all_artesanos json file from before, it displays their name in the "Buscar" page, and it gets prepared so that when its clicked it redirects to the "artesano.html" page with the other aditional information that we have other than the name. 
493
                     for (i = 0; i < all_artesanos.length;i++){
538
                     for (i = 0; i < all_artesanos.length;i++){
494
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
539
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
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>
540
                         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>
496
                         <div>${all_artesanos[i].Nombre}</div>
541
                         <div>${all_artesanos[i].Nombre}</div>
497
                     </ons-list-item>`);
542
                     </ons-list-item>`);
498
-                        // var artesano = ons.createElement(`
499
-                        //   <ons-list-item class = "artists">
500
-                        //     <div class="center" >${all_artesanos[i].Nombre}</div>
501
-                        //   </ons-list-item>`
502
-                        // );
503
                         document.getElementById('results').appendChild(artesano);
543
                         document.getElementById('results').appendChild(artesano);
504
                     }
544
                     }
505
                 </script>
545
                 </script>
508
         </template>
548
         </template>
509
 
549
 
510
         <!-- ---------------------------------------------------------------------------------------------------------------------------------------- -->
550
         <!-- ---------------------------------------------------------------------------------------------------------------------------------------- -->
511
-
551
+        <!--This page is used so that we can display the information of a specific artists, and whenever the artists is missing information then we just dont include that in the page-->
512
         <template id= "artesano.html">
552
         <template id= "artesano.html">
513
             <ons-page id = "artesano">
553
             <ons-page id = "artesano">
514
                 <ons-toolbar>
554
                 <ons-toolbar>
555
+                    <!-- Pretty self explanatory, its a button that goes back to the previous page -->
515
                     <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
556
                     <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
516
                     <div class = "center"></div>
557
                     <div class = "center"></div>
517
                 </ons-toolbar>
558
                 </ons-toolbar>
518
                 <body>
559
                 <body>
560
+                    <!-- This is where we'll put all the information of that artsts -->
519
                     <ons-card id="all"></ons-card>
561
                     <ons-card id="all"></ons-card>
520
                 </body>
562
                 </body>
521
                 <script>
563
                 <script>
564
+                    //when it opens this page this function starts to run, it first recieves the information that was sent to "artesano.html"
522
                     ons.getScriptPage().onInit = function () {
565
                     ons.getScriptPage().onInit = function () {
523
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
566
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
524
 
567
 
529
                             esp = this.data.esp,
572
                             esp = this.data.esp,
530
                             redes = this.data.redes;
573
                             redes = this.data.redes;
531
 
574
 
575
+                        //here the email is the string made from the start to where the '#' is.
532
                         email = em.slice(0, em.search("#"));
576
                         email = em.slice(0, em.search("#"));
577
+
578
+                        //Here it's dividing all the especificaciones and writing them into the page (data) and then goes to the next line
579
+                        //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
580
+                        //but if theres only one then you just write it into the page
533
                         if(esp.trim() != ""){
581
                         if(esp.trim() != ""){
534
                             if(esp.includes(";", 0)){
582
                             if(esp.includes(";", 0)){
535
                                 esp=esp.replace(/;/g,", ");
583
                                 esp=esp.replace(/;/g,", ");
542
 
590
 
543
                         //console.log("Las redes son..."+this.data.redes);
591
                         //console.log("Las redes son..."+this.data.redes);
544
 
592
 
593
+                        //Here it's writing their municipio into the page
545
                         if(mun.trim() != ""){
594
                         if(mun.trim() != ""){
546
                             data+='Municipio: '+ mun +'<br>';
595
                             data+='Municipio: '+ mun +'<br>';
547
                         }
596
                         }
548
 
597
 
598
+                        //Here it's writing their email, in blue color and its used as a link to send one when it's clicked, then it goes to the next line
599
+                        //Whenever the variable is empty or if it has "NO TIENE" then it doesnt write anything
549
                         if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
600
                         if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
550
                             data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
601
                             data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
551
                         }
602
                         }
552
 
603
 
553
-                        //Underlined <u></u>
554
-                        //Color blue <p style="color:blue"></p>
555
-
604
+                        //Here it's writing their phone number into the page,its in blue and whenever its clicked the app will redirect the user to call them, then it goes to the next line
556
                         if(tel.trim() != "" ){
605
                         if(tel.trim() != "" ){
557
                             data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
606
                             data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
558
                         }
607
                         }
559
 
608
 
560
                         console.log("Redes: "+redes);
609
                         console.log("Redes: "+redes);
561
 
610
 
611
+                        //Here it has to decide what to do depending on the links they give to their social media pages
612
+                        //if the link is to a facebook, instagram or myspace account then it will show the picture of the social media site, and when you click the picture then the app redirects you to their social media.
613
+                        //The alt attribute is required for images, it's in case theres no internet connection, then it will display that tet instead, I think screen readers can also read that text
614
+                        //If the link is to another website (but isn't a mailto link) then it will display a default picture we chose to display a default web browser, like the other ones clikcing on it will take you to the link.
615
+                        //If it's none of them then it will not display anything.
562
                         if(redes.includes("facebook")){
616
                         if(redes.includes("facebook")){
563
-
564
                             console.log(redes.substring(1,redes.length-2));
617
                             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>';
618
                             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
                         }
619
                         }
584
                             console.log("no tiene nada");
637
                             console.log("no tiene nada");
585
                         }
638
                         }
586
 
639
 
587
-
640
+                        //This is the part that allows eveything (data) to be displayed
588
                         document.getElementById("all").innerHTML = `${data}`;
641
                         document.getElementById("all").innerHTML = `${data}`;
589
 
642
 
590
                     }
643
                     }