Преглед изворни кода

changed tabbar and upper case renglones

christian пре 4 година
родитељ
комит
1cb2ceb05d

+ 65
- 68
platforms/browser/www/index.html Прегледај датотеку

@@ -53,10 +53,9 @@
53 53
 
54 54
       <script type="text/javascript" src="js/saveLocal.js"></script>
55 55
 
56
-      <script> console.log(window.localStorage.getItem("MADERA")); </script>
57 56
 
58 57
 
59
-        <ons-navigator swipeable animation="slide" id="myNavigator">
58
+
60 59
            <ons-page>
61 60
             <ons-toolbar>
62 61
                 <div class="center">Directorio Artesanal</div>
@@ -410,97 +409,94 @@
410 409
         </template>
411 410
 
412 411
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
413
-
412
+<!----------------------------------------------------------------------------------->
413
+        <script src = "js/searchfunctions.js"></script>
414 414
         <script>
415
-            var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
415
+            //JSON file that has all the artesanos
416
+            var all_artesanos = JSON.parse(window.localStorage.getItem("TODOS"));
416 417
             function filter(){
417
-
418
-
419
-                // var request = new XMLHttpRequest()
420
-                // request.open('GET','json/MADERA.json',true)
421
-                // request.onload = function(){
422
-                //   var Madera = JSON.parse(this.response)
423
-                // }
424
-                // request.send()
425
-                // var input = document.getElementById('searchbar').value
426
-                // var firstwood = Madera[0].Nombre
427
-                // ons.notification.alert('Searched for: ' + firstwood)
428
-                var input = document.getElementById('searchbar').value
418
+                var input = document.getElementById('searchbar').value;
419
+                var inputarte = document.getElementById('searchartesania').value;
420
+                var inputmuni = document.getElementById('searchbarmunicipio').value;
429 421
                 var x = document.getElementsByClassName('artists');
422
+                //making sure they're all in the same format
430 423
                 input = input.trim().toLowerCase();
431
-                if (input.length == 0){
432
-                    for (i = 0; Madera.length; i++){
424
+                inputarte = inputarte.trim().toLowerCase();
425
+                inputmuni = inputmuni.trim().toLowerCase();
426
+                input = acento_replace(input);
427
+                inputarte = acento_replace(inputarte);
428
+                inputmuni = acento_replace(inputmuni);
429
+                //default case is where evey one of them has nothing or less than 3 characters (displays every artist)
430
+                if (input.length <= 3 && inputarte.length <= 3 && inputmuni.length <= 3){
431
+                    for (var i = 0; all_artesanos.length; i++){
433 432
                         x[i].style.display = "list-item";
434 433
                     }
435 434
                 }
436 435
                 else{
437
-                    var foundesp = 0;
438
-                    for (i = 0; i < Madera.length; i++){
439
-                        console.log("damn")
440
-                        //try checking the especificacion first
441
-                        var especificaciones = Madera[i].Especificaciones1;
442
-                        especificaciones = especificaciones.split(';');
443
-                        for (var j = 0; j < especificaciones.length; j++){
444
-                            var especificacion = especificaciones[j];
445
-                            especificacion = especificacion.trim().toLowerCase();
446
-                            if (input == especificacion){
447
-                                x[i].style.display = "list-item";
448
-                                foundesp = 1;
449
-                                break;
450
-                            }
451
-                            else{
452
-                                x[i].style.display = "none";
453
-                            }
454
-                        }
436
+                    var cases = 0;
437
+                    cases = getcasenum(input,inputarte,inputmuni);
438
+                    //take every one of them out first (dont display any)
439
+                    for (var i = 0; i < all_artesanos.length; i++){
440
+                        x[i].style.display = "none";
455 441
                     }
456
-                    if (foundesp != 1){
457
-                        input = input.trim().toLowerCase().split(' ')
458
-                        //changing the input into something that can be searched
459
-                        for (var i = 0; i < input.length; i++){
460
-                            input[i] = input[i].charAt(0).toUpperCase() + input[i].slice(1);
461
-                        }
462
-                        console.log(input);
463
-                        for(var i = 0; i < Madera.length; i++){
464
-                            count = 0;
465
-                            artist = Madera[i].Nombre.trim().split(' ');
466
-                            for (k = 0; k < input.length; k++){
467
-                                for (var l = 0; l < artist.length; l++){
468
-                                    if(artist[l] == input[k]){
469
-                                        x[i].style.display = "list-item";
470
-                                        break;
471
-                                    }
472
-                                    else{
473
-                                        x[i].style.display = "none";
474
-                                    }
475
-                                }
476
-                            }
477
-                        }
442
+                    switch(cases){
443
+                        //cases == 1 when only inputmuni has been writen on
444
+                        case 1:
445
+                            filter_municipios(inputmuni);
446
+                            break;
447
+                        //cases == 2 when only inputarte has been written on
448
+                        case 2:
449
+                            filter_artesanias(inputarte);
450
+                            break;
451
+                        //cases == 3 when inputarte and inputmuni has been written on
452
+                        case 3:
453
+                            search_art_mun(inputarte,inputmuni);
454
+                            break;
455
+                        //cases == 4 when input has been writen on
456
+                        case 4:
457
+                            filter_any(input);
458
+                            break;
459
+                        //cases == 5 when input and inputmuni has been written on
460
+                        case 5:
461
+                            search_any_mun(input,inputmuni);
462
+                            break;
463
+                        //cases == 6 when input and inputart has been written on
464
+                        case 6:
465
+                            search_any_art(input,inputarte);
466
+                            break;
467
+                        //cases == 7 when input, inputart and inputmuni has been writen on
468
+                        case 7:
469
+                            search_any_art_mun(input,inputarte,inputmuni);
470
+                            break;
478 471
                     }
479 472
                 }
480 473
             }
481 474
         </script>
482 475
 
483 476
         <template id="search.html">
477
+          <ons-navigator swipeable animation="slide" id="SNavigator">
484 478
             <ons-page id="Buscar">
485
-
486 479
                 <p style="text-align: center; margin-top: 10px;">
487
-                    <ons-search-input placeholder="Search" id = "searchbar"
488
-                                      onchange = "filter()"
489
-                                      ></ons-search-input>
480
+                    <ons-search-input placeholder="Search anything" id = "searchbar"
481
+                        onkeyup = "filter()"></ons-search-input>
482
+                    <ons-search-input placeholder="Tipo de artesania" id = "searchartesania"
483
+                        onkeyup = "filter()"></ons-search-input>
484
+                    <ons-search-input placeholder = "Municipio" id = "searchbarmunicipio"
485
+                        onkeyup = "filter()"></ons-search-input>
490 486
                 </p>
491 487
 
492 488
                 <ons-list id="results" src="">
493 489
                 </ons-list>
494 490
 
495 491
                 <script>
496
-                    for (i = 0; i < Madera.length;i++){
492
+                    for (i = 0; i < all_artesanos.length;i++){
497 493
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
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>
499
-                        <div>${Madera[i].Nombre}</div>
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
+                        <div>${all_artesanos[i].Nombre}</div>
500 496
                     </ons-list-item>`);
501 497
                         // var artesano = ons.createElement(`
502 498
                         //   <ons-list-item class = "artists">
503
-                        //     <div class="center" >${Madera[i].Nombre}</div>
499
+                        //     <div class="center" >${all_artesanos[i].Nombre}</div>
504 500
                         //   </ons-list-item>`
505 501
                         // );
506 502
                         document.getElementById('results').appendChild(artesano);
@@ -547,7 +543,7 @@
547 543
                         if(mun.trim() != ""){
548 544
                             data+='Municipio: '+ mun +'<br>';
549 545
                         }
550
-                        
546
+
551 547
                         if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
552 548
                             data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
553 549
                         }
@@ -569,6 +565,7 @@
569 565
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
570 566
 
571 567
         <template id="renglones.html">
568
+          <ons-navigator swipeable animation="slide" id="myNavigator">
572 569
             <ons-page id="renglones">
573 570
 
574 571
             <!--div class="search-bar">
@@ -683,4 +680,4 @@
683 680
         <script type="text/javascript" src="cordova.js"></script>
684 681
         <script type="text/javascript" src="js/index.js"></script>
685 682
     </body>
686
-</html>
683
+</html>

+ 5
- 3
platforms/browser/www/js/renglones.js Прегледај датотеку

@@ -5,11 +5,13 @@ var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
5 5
 var list = document.getElementById("list");
6 6
 
7 7
   for (var i = 0; i < info.length; i++) {
8
+          var renglonLower = info[i].Renglones.toLowerCase()
9
+          var renglonCap = renglonLower.charAt(0).toUpperCase() + renglonLower.slice(1)
10
+
8 11
 
9
-          
10 12
 
11 13
           var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
12
-                      <div class="center">${info[i].Renglones}</div>
14
+                      <div class="center">${renglonCap}</div>
13 15
                       <div class="right"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.jpg"></div>
14 16
                       <div class="expandable-content">
15 17
                       <ons-list>
@@ -24,4 +26,4 @@ var list = document.getElementById("list");
24 26
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
25 27
                         <div class="title">${info[i].Renglones}</div>
26 28
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
27
-                    </ons-card>`*/
29
+                    </ons-card>`*/

+ 260
- 0
platforms/browser/www/js/searchfunctions.js Прегледај датотеку

@@ -0,0 +1,260 @@
1
+//Basic shit to understand
2
+//all_artesanos is the json that has the file that contains all the artesanos, this includes the studd they do,municipio,telefono,email and name
3
+//x is going to be what is displayed in the app, it basically has the same infromation as all_artesanos
4
+//THe basic mechanic is to display each artist in the search tab whenever something of them is found
5
+//You need at least 3 characters in one of the searchbars for it to display something
6
+//If nothing is written then it will display every artists
7
+//Some of these functions also try to make sure that the inputs are the same format as the thing they're looking up so that they dont have to follow a specific syntax to look for stuff
8
+
9
+//Tries to filter by the type of work that the artists do, if what they wrote in inputarte is included in one of them then the artists is displayed in the search bar
10
+function filter_artesanias(inputarte){
11
+    var x = document.getElementsByClassName('artists');
12
+    for (var i = 0; i < all_artesanos.length; i++){
13
+        var especificaciones = all_artesanos[i].Especificacion;
14
+        especificaciones = especificaciones.trim().toLowerCase();
15
+        especificaciones = acento_replace(especificaciones);
16
+        if (especificaciones.search(inputarte) != -1){
17
+            x[i].style.display = "list-item";
18
+        }
19
+        //before it did this down here but im keeping it just in case...
20
+        //especificaciones = especificaciones.split(',');
21
+        //for (var j = 0; j < especificaciones.length; j++){
22
+            //var especificacion = especificaciones[j];
23
+            //especificacion = especificacion.trim().toLowerCase();
24
+            //especificacion = acento_replace(especificacion);
25
+            //if (especificacion.search(inputarte) != -1){
26
+                //x[i].style.display = "list-item";
27
+                //break;
28
+            //}
29
+
30
+        }
31
+    return;
32
+}
33
+
34
+//Tries to filter by the municipio that they reside in or work in (not sure which one of the two it is)
35
+function filter_municipios(inputmuni){
36
+    var x = document.getElementsByClassName('artists');
37
+    for (var i = 0; i < all_artesanos.length; i++){
38
+        var municipio = all_artesanos[i].Municipio;
39
+        municipio = municipio.trim().toLowerCase();
40
+        municipio = acento_replace(municipio);
41
+        if (municipio.search(inputmuni)!= -1){
42
+            x[i].style.display = "list-item";
43
+        }
44
+    }
45
+    return;
46
+}
47
+
48
+//Tries to filter by any kind of information provided (name,artesania,municipio,telefono,email)
49
+function filter_any(input){
50
+    var x = document.getElementsByClassName('artists');
51
+    for (var i = 0; i < all_artesanos.length; i++){
52
+        if (find_name(i,input)){
53
+            x[i].style.display = "list-item";
54
+            continue;
55
+        }
56
+        else if (find_artesania(i,input)){
57
+            x[i].style.display = "list-item";
58
+            continue;
59
+        }
60
+        else if (find_municipio(i,input)){
61
+            x[i].style.display = "list-item";
62
+            continue;
63
+        }
64
+        else if (find_telefono(i,input)){
65
+            x[i].style.display = "list-item";
66
+            continue;
67
+        }
68
+        else if (find_email(i,input)){
69
+            x[i].style.display = "list-item";
70
+            continue;
71
+        }
72
+    }
73
+    return;
74
+}
75
+
76
+//Te trata de buscar si cualquiera de ellos tienen el input que se dio aplica a ese artista especifico (i)
77
+function find_any(i,input){
78
+    //if you find any of these in that space then return 1 if you didnt find that anything matched with the input then return 0
79
+    if (find_name(i,input) || find_telefono(i,input) || find_email(i,input) || find_artesania(i,input) || find_municipio(i,input)){
80
+        return 1;
81
+    }
82
+    else{
83
+        return 0;
84
+    }
85
+}
86
+
87
+//Trata de ver si el input es parte del nombre del artista i
88
+//Mayuscula y acento proof
89
+function find_name(i,input){
90
+    var name = all_artesanos[i].Nombre;
91
+    name = name.trim().toLowerCase();
92
+    name = acento_replace(name);
93
+    if(name.search(input) != -1){
94
+        return 1;
95
+    }
96
+    return 0;
97
+}
98
+
99
+//trata de ver si el input es parte de alguna artesania que trabaja el artista i
100
+//Mayuscula y acento proof
101
+function find_artesania(i,input){
102
+    var artesanias = all_artesanos[i].Especificacion;
103
+    artesanias = artesanias.trim().toLowerCase();
104
+    artesanias = acento_replace(artesanias);
105
+    if(artesanias.search(input) != -1){
106
+        return 1;
107
+    }
108
+    //artesanias = artesanias.split(',');
109
+    //for (var j = 0; j < artesanias.length; j++){
110
+        //var artesania = artesanias[j];
111
+        //artesania = artesania.trim().toLowerCase();
112
+        //artesania = acento_replace(artesania);
113
+        //if (artesania.search(input) != -1){
114
+            //return 1;
115
+        //}
116
+    //}
117
+    return 0;
118
+}
119
+
120
+//trata de ver si el input es parte del municipio del artista i
121
+//Mayuscula y acento proof
122
+function find_municipio(i,input){
123
+    var mun = all_artesanos[i].Municipio;
124
+    mun = mun.trim().toLowerCase();
125
+    mun = acento_replace(mun);
126
+    if(mun.search(input) != -1){
127
+        return 1;
128
+    }
129
+    return 0;
130
+}
131
+
132
+//trata de ver si el input es parte del telefono del artista i
133
+//'(',')','-' and ' ' proof
134
+function find_telefono(i,input){
135
+    var tel = all_artesanos[i]["Telefono 1"];
136
+    tel = tel.trim();
137
+    //To make sure they're both the same im taking out spaces,'(',')' and '-' to make sure they're both the same format
138
+    tel = tel.replace(/\s/g,'').replace(/\u0028/g,'').replace(/\u0029/g,'').replace(/\u002D/g,'');
139
+    input = input.replace(/\s/g,'').replace(/\u0028/g,'').replace(/\u0029/g,'').replace(/\u002D/g,'');
140
+    if(tel.search(input) != -1){
141
+        return 1;
142
+    }
143
+    return 0;
144
+}
145
+
146
+//trata de ver si el input es parte del email del artista i
147
+//Mayuscula and acento proof
148
+function find_email(i,input){
149
+    var email = all_artesanos[i]["E-mail"];
150
+    email = email.trim().toLowerCase();
151
+    email = acento_replace(email);
152
+    if(email.search(input) != -1){
153
+        return 1;
154
+    }
155
+    return 0;
156
+}
157
+
158
+//Esta funcion trata de coger el numero de caso que se esta buscando, esto es para saber que 
159
+//caso del switch para considerar
160
+//LOs casos dependen de lo que esta escrito en cada search bar, cada vez que se escribe en uno nuevo o cuando se borra completamente uno entonces es un caso nuevo
161
+function getcasenum(input,inputarte,inputmuni){
162
+    //this will get the case number
163
+    //think of this as 3 binary numbers where 001 would mean that only its input muni
164
+    //010 is only inputarte and 100 is only input
165
+    //max number is 7
166
+    var casenum = 0;
167
+    if (input.length != 0){
168
+        casenum += 4;
169
+    }
170
+    if (inputarte.length != 0){
171
+        casenum += 2;
172
+    }
173
+    if (inputmuni.length != 0){
174
+        casenum += 1;
175
+    }
176
+    return casenum;
177
+}
178
+
179
+//case 3: artesania y municipio
180
+//Busca todos los artistas que trabajan con esa artesania y en ese municipio
181
+function search_art_mun(inputarte,inputmuni){
182
+    var x = document.getElementsByClassName('artists');
183
+        for (var i = 0; i < all_artesanos.length; i++){
184
+            if (find_artesania(i,inputarte) && find_municipio(i,inputmuni)){
185
+                x[i].style.display = "list-item";
186
+            }
187
+        }
188
+}
189
+
190
+//Busca todos los artistas que salen con el primer input y trabajan en ese municipio
191
+function search_any_mun(input,inputmuni){
192
+    var x = document.getElementsByClassName('artists');
193
+        for (var i = 0; i < all_artesanos.length; i++){
194
+            if(find_any(i,input) && find_municipio(i,inputmuni)){
195
+                x[i].style.display = "list-item";
196
+            }
197
+        }
198
+}
199
+
200
+//Busca todos los artistas que salen con el primer input y trabajan con esa artesania
201
+function search_any_art(input,inputarte){
202
+    var x = document.getElementsByClassName('artists');
203
+    for (var i = 0; i < all_artesanos.length; i++){
204
+        if(find_any(i,input) && find_artesania(i,inputarte)){
205
+            x[i].style.display = "list-item";
206
+        }
207
+    }
208
+}
209
+
210
+//Busca todos los artistas que salen con el primer input, trabajan con esa artesania y trabajan en ese municipio
211
+function search_any_art_mun(input,inputarte,inputmuni){
212
+    var x = document.getElementsByClassName('artists');
213
+    for (var i = 0; i < all_artesanos.length; i++){
214
+        if(find_any(i,input) && find_artesania(i,inputarte) && find_municipio(i,inputmuni)){
215
+            x[i].style.display = "list-item";
216
+        }
217
+    }
218
+}
219
+
220
+//Replacing special characters with non special characters in case input doesnt include it
221
+function acento_replace(string){
222
+    var precstring = "";
223
+    var poststring = "";
224
+    for( i = 0; i < string.length ; i++){
225
+        if (string.charAt(i) == 'á' || string.charAt(i) == 'é' || string.charAt(i) == 'í'|| string.charAt(i) == 'ó' || string.charAt(i) == 'ú' || string.charAt(i) == 'ü' || string.charAt(i) == 'ñ' || string.charAt(i) == 'ö'){
226
+            precstring = string.slice(0,i);
227
+            postcstring = "";
228
+            if(i != string.length-1){
229
+              postcstring = string.slice(i+1,string.length);
230
+            }
231
+            switch(string.charAt(i)){
232
+                case 'á':
233
+                    string = precstring.concat('a',postcstring);
234
+                    break;
235
+                case 'é':
236
+                    string = precstring.concat('e',postcstring);
237
+                    break;
238
+                case 'í':
239
+                    string = precstring.concat('i',postcstring);
240
+                    break;
241
+                case 'ó':
242
+                    string = precstring.concat('o',postcstring);
243
+                    break;
244
+                case 'ú':
245
+                    string = precstring.concat('u',postcstring);
246
+                    break;
247
+                case 'ü':
248
+                    string = precstring.concat('u',postcstring);
249
+                    break;
250
+                case 'ñ':
251
+                    string = precstring.concat('n',postcstring);
252
+                    break;
253
+                case 'ö':
254
+                    string = precstring.concat('o',postcstring);
255
+                    break;
256
+            }
257
+        }
258
+    }
259
+    return string;
260
+}

+ 9
- 8
www/index.html Прегледај датотеку

@@ -53,10 +53,9 @@
53 53
 
54 54
       <script type="text/javascript" src="js/saveLocal.js"></script>
55 55
 
56
-      <script> console.log(window.localStorage.getItem("MADERA")); </script>
57 56
 
58 57
 
59
-        <ons-navigator swipeable animation="slide" id="myNavigator">
58
+
60 59
            <ons-page>
61 60
             <ons-toolbar>
62 61
                 <div class="center">Directorio Artesanal</div>
@@ -413,7 +412,7 @@
413 412
 <!----------------------------------------------------------------------------------->
414 413
         <script src = "js/searchfunctions.js"></script>
415 414
         <script>
416
-            //JSON file that has all the artesanos 
415
+            //JSON file that has all the artesanos
417 416
             var all_artesanos = JSON.parse(window.localStorage.getItem("TODOS"));
418 417
             function filter(){
419 418
                 var input = document.getElementById('searchbar').value;
@@ -471,15 +470,16 @@
471 470
                             break;
472 471
                     }
473 472
                 }
474
-            }            
473
+            }
475 474
         </script>
476 475
 
477 476
         <template id="search.html">
477
+          <ons-navigator swipeable animation="slide" id="SNavigator">
478 478
             <ons-page id="Buscar">
479 479
                 <p style="text-align: center; margin-top: 10px;">
480 480
                     <ons-search-input placeholder="Search anything" id = "searchbar"
481 481
                         onkeyup = "filter()"></ons-search-input>
482
-                    <ons-search-input placeholder="Tipo de artesania" id = "searchartesania" 
482
+                    <ons-search-input placeholder="Tipo de artesania" id = "searchartesania"
483 483
                         onkeyup = "filter()"></ons-search-input>
484 484
                     <ons-search-input placeholder = "Municipio" id = "searchbarmunicipio"
485 485
                         onkeyup = "filter()"></ons-search-input>
@@ -491,7 +491,7 @@
491 491
                 <script>
492 492
                     for (i = 0; i < all_artesanos.length;i++){
493 493
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
494
-                        onclick="myNavigator.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>
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 495
                         <div>${all_artesanos[i].Nombre}</div>
496 496
                     </ons-list-item>`);
497 497
                         // var artesano = ons.createElement(`
@@ -543,7 +543,7 @@
543 543
                         if(mun.trim() != ""){
544 544
                             data+='Municipio: '+ mun +'<br>';
545 545
                         }
546
-                        
546
+
547 547
                         if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
548 548
                             data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
549 549
                         }
@@ -565,6 +565,7 @@
565 565
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
566 566
 
567 567
         <template id="renglones.html">
568
+          <ons-navigator swipeable animation="slide" id="myNavigator">
568 569
             <ons-page id="renglones">
569 570
 
570 571
             <!--div class="search-bar">
@@ -679,4 +680,4 @@
679 680
         <script type="text/javascript" src="cordova.js"></script>
680 681
         <script type="text/javascript" src="js/index.js"></script>
681 682
     </body>
682
-</html>
683
+</html>

+ 5
- 3
www/js/renglones.js Прегледај датотеку

@@ -5,11 +5,13 @@ var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
5 5
 var list = document.getElementById("list");
6 6
 
7 7
   for (var i = 0; i < info.length; i++) {
8
+          var renglonLower = info[i].Renglones.toLowerCase()
9
+          var renglonCap = renglonLower.charAt(0).toUpperCase() + renglonLower.slice(1)
10
+
8 11
 
9
-          
10 12
 
11 13
           var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
12
-                      <div class="center">${info[i].Renglones}</div>
14
+                      <div class="center">${renglonCap}</div>
13 15
                       <div class="right"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.jpg"></div>
14 16
                       <div class="expandable-content">
15 17
                       <ons-list>
@@ -24,4 +26,4 @@ var list = document.getElementById("list");
24 26
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
25 27
                         <div class="title">${info[i].Renglones}</div>
26 28
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
27
-                    </ons-card>`*/
29
+                    </ons-card>`*/