lyxaira.glass 4 years ago
parent
commit
c276b1f138

platforms/android/app/src/main/assets/www/img/BARRO.jpg → platforms/android/app/src/main/assets/www/img/Barro.jpg View File


platforms/android/app/src/main/assets/www/img/CRISTAL.jpg → platforms/android/app/src/main/assets/www/img/Cristal.jpg View File


platforms/android/app/src/main/assets/www/img/CUERO.jpg → platforms/android/app/src/main/assets/www/img/Cuero.jpg View File


platforms/android/app/src/main/assets/www/img/FIBRAS.jpg → platforms/android/app/src/main/assets/www/img/Fibras.jpg View File


platforms/android/app/src/main/assets/www/img/HIGÜERA.jpg → platforms/android/app/src/main/assets/www/img/Higüera.jpg View File


platforms/android/app/src/main/assets/www/img/INSTRUMENTOS TÍPICOS.jpg → platforms/android/app/src/main/assets/www/img/Instrumento musical.jpg View File


platforms/android/app/src/main/assets/www/img/JUGUETES TRADICIONALES.jpg → platforms/android/app/src/main/assets/www/img/Juguetes tradicional.jpg View File


platforms/android/app/src/main/assets/www/img/LABORES EN AGUJA.jpg → platforms/android/app/src/main/assets/www/img/Labores en aguja.jpg View File


platforms/android/app/src/main/assets/www/img/MADERA.jpg → platforms/android/app/src/main/assets/www/img/Madera.jpg View File


platforms/android/app/src/main/assets/www/img/METAL.jpg → platforms/android/app/src/main/assets/www/img/Metal.jpg View File


platforms/android/app/src/main/assets/www/img/TABACOS.jpg → platforms/android/app/src/main/assets/www/img/Tabacos.jpg View File


platforms/android/app/src/main/assets/www/img/TEXTILES.jpg → platforms/android/app/src/main/assets/www/img/Textiles.jpg View File


+ 25
- 22
platforms/android/app/src/main/assets/www/index.html View File

@@ -53,6 +53,9 @@
53 53
 
54 54
       <script type="text/javascript" src="js/saveLocal.js"></script>
55 55
 
56
+
57
+
58
+
56 59
         <ons-navigator swipeable animation="slide" id="myNavigator">
57 60
            <ons-page>
58 61
             <ons-toolbar>
@@ -114,8 +117,10 @@
114 117
                     ons.getScriptPage().onInit = function () {
115 118
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
116 119
 
120
+                        console.log("test");
121
+
117 122
                         //var File = this.data.title.toUpperCase() + '.json' ;
118
-                        var Esp = this.data.esp.split(', ');
123
+                        var Esp = this.data.esp.split(';');
119 124
                         var artesanos_json = this.data.json;
120 125
 
121 126
                         //Convertir en mayuscula primera letra del string.
@@ -155,7 +160,7 @@
155 160
                             var searchVal = "my Name";
156 161
                             for (var i=0 ; i < artesanos_json.length ; i++)
157 162
                             {
158
-                                if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
163
+                                if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
159 164
                                     results.push(artesanos_json[i]);
160 165
                                 }
161 166
                             }
@@ -193,8 +198,8 @@
193 198
               <ons-list-item expandable tappable>
194 199
                 <div class="center" >${Artesano.Nombre}</div>
195 200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
196
-                                                 Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
197
-                                                 Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
201
+                                                 Tel\u00e9fono: ${Artesano["Telefono1"]}<br>
202
+                                                 Correo Electr\u00f3nico: ${Artesano["E-mail1"]}<br>
198 203
                                                  </div>
199 204
               </ons-list-item>`
200 205
                                                     );
@@ -212,20 +217,20 @@
212 217
                             if (Artesano.Municipio.trim().length != 0) {
213 218
                                 cont ++;
214 219
                             }
215
-                            if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
220
+                            if (Artesano["Telefono1"].trim().length != 0) {
216 221
                                 cont ++;
217 222
                             }
218
-                            if (Artesano["E-mail"].trim().length != 0) {
223
+                            if (Artesano["E-mail1"].trim().length != 0) {
219 224
                                 cont ++;
220 225
                             }
221
-                            if (Artesano.Especificaciones.trim().length != 0) {
226
+                            if (Artesano.Especificaciones1.trim().length != 0) {
222 227
                                 cont ++;
223 228
                             }
224 229
 
225 230
 
226 231
                             //info a pasar
227 232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
228
-                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Tel\u00e9fono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificaciones}' } })" tappable>
233
+                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono1"]}', email: '${Artesano["E-mail1"]}', esp: '${Artesano.Especificaciones1}' } })" tappable>
229 234
                         <div class="title">${Artesano.Nombre}</div>
230 235
                     </ons-list-item>`);
231 236
 
@@ -319,7 +324,7 @@
319 324
                              var searchVal = "my Name";
320 325
                              for (var i=0 ; i < artesanos_json.length ; i++)
321 326
                              {
322
-                                 if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
327
+                                 if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
323 328
                                      results.push(artesanos_json[i]);
324 329
                                  }
325 330
                              }
@@ -332,7 +337,7 @@
332 337
 
333 338
                                  //if(Esp[num] in artesanos_json.) {}
334 339
                                  Artesanos+=`${results[i].Nombre}|`
335
-                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Tel\u00e9fono1"]}|${results[i]["E-mail"]}|${results[i].Especificaciones}&&`
340
+                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Tel\u00e9fono 1"]}|${results[i]["E-mail"]}|${results[i].Especificaciones}&&`
336 341
                                  //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
337 342
                              }
338 343
 
@@ -449,9 +454,7 @@
449 454
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
450 455
 
451 456
         <script>
452
-
453
-            var todos = window.localStorage.getItem("TODOS");
454
-
457
+            var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
455 458
             function filter(){
456 459
 
457 460
 
@@ -468,17 +471,17 @@
468 471
                 var x = document.getElementsByClassName('artists');
469 472
                 input = input.trim().toLowerCase();
470 473
                 if (input.length == 0){
471
-                    for (i = 0; todos.length; i++){
474
+                    for (i = 0; Madera.length; i++){
472 475
                         x[i].style.display = "list-item";
473 476
                     }
474 477
                 }
475 478
                 else{
476 479
                     var foundesp = 0;
477
-                    for (i = 0; i < todos.length; i++){
480
+                    for (i = 0; i < Madera.length; i++){
478 481
                         console.log("damn")
479 482
                         //try checking the especificacion first
480
-                        var especificaciones = todos[i].Especificaciones1;
481
-                        especificaciones = especificaciones.split(',');
483
+                        var especificaciones = Madera[i].Especificaciones1;
484
+                        especificaciones = especificaciones.split(';');
482 485
                         for (var j = 0; j < especificaciones.length; j++){
483 486
                             var especificacion = especificaciones[j];
484 487
                             especificacion = especificacion.trim().toLowerCase();
@@ -499,9 +502,9 @@
499 502
                             input[i] = input[i].charAt(0).toUpperCase() + input[i].slice(1);
500 503
                         }
501 504
                         console.log(input);
502
-                        for(var i = 0; i < todos.length; i++){
505
+                        for(var i = 0; i < Madera.length; i++){
503 506
                             count = 0;
504
-                            artist = todos[i].Nombre.trim().split(' ');
507
+                            artist = Madera[i].Nombre.trim().split(' ');
505 508
                             for (k = 0; k < input.length; k++){
506 509
                                 for (var l = 0; l < artist.length; l++){
507 510
                                     if(artist[l] == input[k]){
@@ -532,10 +535,10 @@
532 535
                 </ons-list>
533 536
 
534 537
                 <script>
535
-                    for (i = 0; i < todos.length;i++){
538
+                    for (i = 0; i < Madera.length;i++){
536 539
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
537
-                        onclick="myNavigator.pushPage('artesano.html', { data: {title: '${todos[i].Nombre}', mun: '${todos[i].Municipio}', tel: '${todos[i]["Tel\u00e9fono 1"]}', email: '${todos[i]["E-mail"]}', esp: '${todos[i].Especificaciones}' } })" tappable>
538
-                        <div>${todos[i].Nombre}</div>
540
+                        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>
541
+                        <div>${Madera[i].Nombre}</div>
539 542
                     </ons-list-item>`);
540 543
                         // var artesano = ons.createElement(`
541 544
                         //   <ons-list-item class = "artists">

+ 7
- 7
platforms/android/app/src/main/assets/www/js/azar.js View File

@@ -1,17 +1,17 @@
1 1
 var request = new XMLHttpRequest()
2 2
 
3 3
                         request.open('GET', 'json/azar.json', true)
4
-    
4
+
5 5
                         request.onload = function() {
6 6
                             // begin accessing JSON data here
7 7
                             var data = JSON.parse(this.response)
8
-                            
8
+
9 9
                             var page = document.getElementById("home");
10
-                            
10
+
11 11
                                 var aleatorio = Math.floor(Math.random()*32);
12 12
                                 document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="300">`;
13 13
                                 document.getElementById("Content").innerHTML = data[aleatorio].Renglones + "<br>" + data[aleatorio].Artesano + "<br>" + data[aleatorio].Municipio;
14
-                          
14
+
15 15
                             page.addEventListener("show", function(event){
16 16
                                 document.getElementById("image").innerHTML='';
17 17
                                 document.getElementById("Content").innerHTML='';
@@ -23,7 +23,7 @@ var request = new XMLHttpRequest()
23 23
                                 document.getElementById("Content").innerHTML = data[aleatorio].Renglones + "<br>" + data[aleatorio].Artesano + "<br>" + data[aleatorio].Municipio;
24 24
                                 //azar.appendChild(img);
25 25
                             });
26
-                            
26
+
27 27
                             }
28
-    
29
-request.send() 
28
+
29
+request.send()

+ 3
- 2
platforms/android/app/src/main/assets/www/js/renglones.js View File

@@ -1,8 +1,9 @@
1 1
 var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
2
-
2
+console.log("TEST!!!");
3 3
 var list = document.getElementById("list");
4 4
 
5
-  for (var i = 0; i < info.length; i++) {
5
+console.log(info.length);
6
+  for (var i = 0; i < info.length(); i++) {
6 7
 
7 8
           var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
8 9
                       <div class="center">${info[i].Renglones}</div>

+ 4
- 4
platforms/android/app/src/main/assets/www/js/saveLocal.js View File

@@ -13,7 +13,7 @@ function loadFile(filePath) {
13 13
 
14 14
 
15 15
 function checkDate() {
16
-  var date = loadFile("https://artesaniaspr.online/date.txt");
16
+  var date = loadFile("https://136.145.181.12/date.txt");
17 17
   if (window.localStorage.getItem("DATE") == null || window.localStorage.getItem("DATE") != date) {
18 18
   window.localStorage.setItem("DATE", date);
19 19
     return false;
@@ -27,13 +27,13 @@ function checkDate() {
27 27
 try {
28 28
   if (checkDate() == false) {
29 29
 
30
-    window.localStorage.setItem("RENGLONES", loadFile("https://artesaniaspr.online/renglones.json"));
31
-    window.localStorage.setItem("TODOS", loadFile("https://artesaniaspr.online/artesanias.json"))
30
+    window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
31
+    window.localStorage.setItem("TODOS", loadFile("https://136.145.181.12/artesanias.json"))
32 32
 
33 33
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
34 34
 
35 35
     for (var i = 0; i < renglones.length; i++) {
36
-      window.localStorage.setItem(renglones[i].Renglones, loadFile("https://artesaniaspr.online/" + renglones[i].Renglones + ".json"));
36
+      window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
37 37
     }
38 38
   }
39 39
   } catch {

+ 1
- 3
platforms/browser/www/index.html View File

@@ -51,9 +51,7 @@
51 51
     </head>
52 52
     <body>
53 53
 
54
-      <script type="text/javascript" src="js/saveLocal.js"></script>
55
-
56
-
54
+      <script type="text/javascript" src="js/saveLocal.js">console.log("DATA: "+window.localStorage.getItem("DATE"));</script>
57 55
 
58 56
 
59 57
         <ons-navigator swipeable animation="slide" id="myNavigator">

+ 3
- 6
platforms/browser/www/js/renglones.js View File

@@ -1,12 +1,9 @@
1 1
 var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
2
-
3
-
4
-
2
+console.log("TEST!!!");
5 3
 var list = document.getElementById("list");
6 4
 
7
-  for (var i = 0; i < info.length; i++) {
8
-
9
-          
5
+console.log(info.length);
6
+  for (var i = 0; i < info.length(); i++) {
10 7
 
11 8
           var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
12 9
                       <div class="center">${info[i].Renglones}</div>

+ 1
- 3
www/index.html View File

@@ -51,9 +51,7 @@
51 51
     </head>
52 52
     <body>
53 53
 
54
-      <script type="text/javascript" src="js/saveLocal.js"></script>
55
-
56
-
54
+      <script type="text/javascript" src="js/saveLocal.js">console.log("DATA: "+window.localStorage.getItem("DATE"));</script>
57 55
 
58 56
 
59 57
         <ons-navigator swipeable animation="slide" id="myNavigator">

+ 3
- 6
www/js/renglones.js View File

@@ -1,12 +1,9 @@
1 1
 var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
2
-
3
-
4
-
2
+console.log("TEST!!!");
5 3
 var list = document.getElementById("list");
6 4
 
7
-  for (var i = 0; i < info.length; i++) {
8
-
9
-          
5
+console.log(info.length);
6
+  for (var i = 0; i < info.length(); i++) {
10 7
 
11 8
           var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
12 9
                       <div class="center">${info[i].Renglones}</div>