8 Incheckningar

Upphovsman SHA1 Meddelande Datum
  lyxaira.glass 58484d7a3d Artesanos page correclty ordered with functioning links to call and send emails. As well as dividing the specifications by commas and other context related structures. 4 år sedan
  lyxaira.glass a3b3d983d9 Cambios de estructura de artesanos agregados. 4 år sedan
  lyxaira.glass 80612e6f5f Saved 4 år sedan
  lyxaira.glass cd391905ad Changes 4 år sedan
  lyxaira.glass c739225bf5 Saved 4 år sedan
  lyxaira.glass d710c8b2ff Merge branch 'Sprint6' of https://git.ccom.uprrp.edu/CCOM4030/artesanias into Sprint6 4 år sedan
  lyxaira.glass cb61423f22 Merge branch 'Sprint6' of https://git.ccom.uprrp.edu/CCOM4030/artesanias into Sprint6 4 år sedan
  lyxaira.glass c276b1f138 Changes 4 år sedan

platforms/android/app/src/main/assets/www/img/BARRO.jpg → platforms/android/app/src/main/assets/www/img/Barro.jpg Visa fil


platforms/android/app/src/main/assets/www/img/CRISTAL.jpg → platforms/android/app/src/main/assets/www/img/Cristal.jpg Visa fil


platforms/android/app/src/main/assets/www/img/CUERO.jpg → platforms/android/app/src/main/assets/www/img/Cuero.jpg Visa fil


platforms/android/app/src/main/assets/www/img/FIBRAS.jpg → platforms/android/app/src/main/assets/www/img/Fibras.jpg Visa fil


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


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


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


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


platforms/android/app/src/main/assets/www/img/MADERA.jpg → platforms/android/app/src/main/assets/www/img/Madera.jpg Visa fil


platforms/android/app/src/main/assets/www/img/METAL.jpg → platforms/android/app/src/main/assets/www/img/Metal.jpg Visa fil


platforms/android/app/src/main/assets/www/img/TABACOS.jpg → platforms/android/app/src/main/assets/www/img/Tabacos.jpg Visa fil


platforms/android/app/src/main/assets/www/img/TEXTILES.jpg → platforms/android/app/src/main/assets/www/img/Textiles.jpg Visa fil


+ 25
- 22
platforms/android/app/src/main/assets/www/index.html Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

@@ -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 {

+ 38
- 42
platforms/browser/www/artesano.html Visa fil

@@ -1,72 +1,68 @@
1 1
 <!DOCTYPE html>
2 2
 <html>
3 3
 <head>
4
-	<title>Artesanos</title>
4
+    <title>Artesanos</title>
5 5
 
6
-	<script src="jquery/dist/jquery.min.js">
7
-	</script>
6
+    <script src="jquery/dist/jquery.min.js">
7
+    </script>
8 8
 
9 9
 
10 10
 </head>
11 11
 <body>
12 12
 
13
-	<ons-toolbar>
14
-  		<div class="left">
15
-    		<ons-back-button>Back</ons-back-button>
16
-  		</div>
17
-	</ons-toolbar>
13
+    <ons-toolbar>
14
+        <div class="left">
15
+            <ons-back-button>Back</ons-back-button>
16
+        </div>
17
+    </ons-toolbar>
18 18
 
19 19
 
20 20
 
21
-	<script type="text/javascript">
22
-	function getUrlVars() {
23
-    	var vars = [], hash;
24
-    	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
25
-    	for(var i = 0; i < hashes.length; i++)
26
-    	{
27
-        	hash = hashes[i].split('=');
28
-        	vars.push(hash[0]);
29
-        	vars[hash[0]] = hash[1];
30
-    	}
31
-    	return vars;
32
-	}
21
+    <script type="text/javascript">
22
+    function getUrlVars() {
23
+        var vars = [], hash;
24
+        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
25
+        for(var i = 0; i < hashes.length; i++)
26
+        {
27
+            hash = hashes[i].split('=');
28
+            vars.push(hash[0]);
29
+            vars[hash[0]] = hash[1];
30
+        }
31
+        return vars;
32
+    }
33 33
 
34
-	nombre = decodeURIComponent(getUrlVars()["nombre"]);
35
-	renglon = "json/MADERA.json";
36
-	
34
+    nombre = decodeURIComponent(getUrlVars()["nombre"]);
35
+    renglon = "json/MADERA.json";
36
+    
37 37
 
38
-	$.getJSON(renglon, function(json) {
39
-    	for (i = 0; i < json.length; i++) {
40
-    		if (json[i].Nombre == nombre) {
41
-    			break;
42
-    		}
43
-    	}
38
+    $.getJSON(renglon, function(json) {
39
+        for (i = 0; i < json.length; i++) {
40
+            if (json[i].Nombre == nombre) {
41
+                break;
42
+            }
43
+        }
44 44
 
45
-    	var telefono = "Teléfono 1";
46
-    	var clickTel = (((json[i]["Teléfono 1"].replace('(', "")).replace(')', "")).replace('-', "")).replace(' ', "");
45
+        console.log("entre a artesano.html...???");
47 46
 
48
-    	var email = "E-mail";
47
+        document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
49 48
 
49
+        document.write("<h2 align='center'>" + json[i].Municipio + "</h1>");
50 50
 
51
-    	document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
51
+        document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
52 52
 
53
-    	document.write("<h2 align='center'>" + json[i].Municipio + "</h1>");
53
+        document.write("<a class='button' href='tel://" + json[i]["Teléfono 1"] + "'>" + "<h2 align='center'>" + json[i]["Teléfono 1"] + "</h2>" + "</a>");
54 54
 
55
-    	document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
55
+        document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");
56 56
 
57
-    	document.write("<a class='button' href='tel://" + clickTel + "'>" + "<h2 align='center'>" + json[i][telefono] + "</h2>" + "</a>");
58 57
 
59
-    	document.write("<a href='mailto:" + json[i][email] + "'>" + "<h2 align='center'>" + json[i][email] + "</h2>" + "</a>");
60 58
 
59
+    });
61 60
 
62 61
 
63
-	});
64 62
 
65 63
 
66
-
67
-
68
-	
69
-	</script>
64
+    
65
+    </script>
70 66
 
71 67
 </body>
72 68
 </html>

+ 30
- 57
platforms/browser/www/index.html Visa fil

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

+ 3
- 3
platforms/browser/www/js/load.js Visa fil

@@ -15,12 +15,12 @@ window.fn.loadLink = function (url) {
15 15
 
16 16
 window.fn.pushPage = function (page, anim) {
17 17
 
18
-	//Open and send json file that is equivalent with the especification.
19
-	var artesanos = JSON.parse(window.localStorage.getItem(page.title.toUpperCase()));
18
+  //Open and send json file that is equivalent with the especification.
19
+  var artesanos = JSON.parse(window.localStorage.getItem(page.title.toUpperCase()));
20 20
 
21 21
   if (anim) {
22 22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
23 23
   } else {
24 24
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } });
25 25
   }
26
-};
26
+};

+ 1
- 1
platforms/browser/www/js/renglones.js Visa fil

@@ -24,4 +24,4 @@ var list = document.getElementById("list");
24 24
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
25 25
                         <div class="title">${info[i].Renglones}</div>
26 26
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
27
-                    </ons-card>`*/
27
+                    </ons-card>`*/

+ 1
- 1
platforms/browser/www/js/saveLocal.js Visa fil

@@ -38,4 +38,4 @@ try {
38 38
   }
39 39
   } catch {
40 40
     console.log("error");
41
-  }
41
+  }

+ 38
- 42
www/artesano.html Visa fil

@@ -1,72 +1,68 @@
1 1
 <!DOCTYPE html>
2 2
 <html>
3 3
 <head>
4
-	<title>Artesanos</title>
4
+    <title>Artesanos</title>
5 5
 
6
-	<script src="jquery/dist/jquery.min.js">
7
-	</script>
6
+    <script src="jquery/dist/jquery.min.js">
7
+    </script>
8 8
 
9 9
 
10 10
 </head>
11 11
 <body>
12 12
 
13
-	<ons-toolbar>
14
-  		<div class="left">
15
-    		<ons-back-button>Back</ons-back-button>
16
-  		</div>
17
-	</ons-toolbar>
13
+    <ons-toolbar>
14
+        <div class="left">
15
+            <ons-back-button>Back</ons-back-button>
16
+        </div>
17
+    </ons-toolbar>
18 18
 
19 19
 
20 20
 
21
-	<script type="text/javascript">
22
-	function getUrlVars() {
23
-    	var vars = [], hash;
24
-    	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
25
-    	for(var i = 0; i < hashes.length; i++)
26
-    	{
27
-        	hash = hashes[i].split('=');
28
-        	vars.push(hash[0]);
29
-        	vars[hash[0]] = hash[1];
30
-    	}
31
-    	return vars;
32
-	}
21
+    <script type="text/javascript">
22
+    function getUrlVars() {
23
+        var vars = [], hash;
24
+        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
25
+        for(var i = 0; i < hashes.length; i++)
26
+        {
27
+            hash = hashes[i].split('=');
28
+            vars.push(hash[0]);
29
+            vars[hash[0]] = hash[1];
30
+        }
31
+        return vars;
32
+    }
33 33
 
34
-	nombre = decodeURIComponent(getUrlVars()["nombre"]);
35
-	renglon = "json/MADERA.json";
36
-	
34
+    nombre = decodeURIComponent(getUrlVars()["nombre"]);
35
+    renglon = "json/MADERA.json";
36
+    
37 37
 
38
-	$.getJSON(renglon, function(json) {
39
-    	for (i = 0; i < json.length; i++) {
40
-    		if (json[i].Nombre == nombre) {
41
-    			break;
42
-    		}
43
-    	}
38
+    $.getJSON(renglon, function(json) {
39
+        for (i = 0; i < json.length; i++) {
40
+            if (json[i].Nombre == nombre) {
41
+                break;
42
+            }
43
+        }
44 44
 
45
-    	var telefono = "Teléfono 1";
46
-    	var clickTel = (((json[i]["Teléfono 1"].replace('(', "")).replace(')', "")).replace('-', "")).replace(' ', "");
45
+        console.log("entre a artesano.html...???");
47 46
 
48
-    	var email = "E-mail";
47
+        document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
49 48
 
49
+        document.write("<h2 align='center'>" + json[i].Municipio + "</h1>");
50 50
 
51
-    	document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
51
+        document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
52 52
 
53
-    	document.write("<h2 align='center'>" + json[i].Municipio + "</h1>");
53
+        document.write("<a class='button' href='tel://" + json[i]["Teléfono 1"] + "'>" + "<h2 align='center'>" + json[i]["Teléfono 1"] + "</h2>" + "</a>");
54 54
 
55
-    	document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
55
+        document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");
56 56
 
57
-    	document.write("<a class='button' href='tel://" + clickTel + "'>" + "<h2 align='center'>" + json[i][telefono] + "</h2>" + "</a>");
58 57
 
59
-    	document.write("<a href='mailto:" + json[i][email] + "'>" + "<h2 align='center'>" + json[i][email] + "</h2>" + "</a>");
60 58
 
59
+    });
61 60
 
62 61
 
63
-	});
64 62
 
65 63
 
66
-
67
-
68
-	
69
-	</script>
64
+    
65
+    </script>
70 66
 
71 67
 </body>
72 68
 </html>

+ 30
- 57
www/index.html Visa fil

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

+ 3
- 3
www/js/load.js Visa fil

@@ -15,12 +15,12 @@ window.fn.loadLink = function (url) {
15 15
 
16 16
 window.fn.pushPage = function (page, anim) {
17 17
 
18
-	//Open and send json file that is equivalent with the especification.
19
-	var artesanos = JSON.parse(window.localStorage.getItem(page.title.toUpperCase()));
18
+  //Open and send json file that is equivalent with the especification.
19
+  var artesanos = JSON.parse(window.localStorage.getItem(page.title.toUpperCase()));
20 20
 
21 21
   if (anim) {
22 22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
23 23
   } else {
24 24
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } });
25 25
   }
26
-};
26
+};

+ 1
- 1
www/js/renglones.js Visa fil

@@ -24,4 +24,4 @@ var list = document.getElementById("list");
24 24
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
25 25
                         <div class="title">${info[i].Renglones}</div>
26 26
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
27
-                    </ons-card>`*/
27
+                    </ons-card>`*/

+ 1
- 1
www/js/saveLocal.js Visa fil

@@ -38,4 +38,4 @@ try {
38 38
   }
39 39
   } catch {
40 40
     console.log("error");
41
-  }
41
+  }