8 Commits

Author SHA1 Message Date
  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 years ago
  lyxaira.glass a3b3d983d9 Cambios de estructura de artesanos agregados. 4 years ago
  lyxaira.glass 80612e6f5f Saved 4 years ago
  lyxaira.glass cd391905ad Changes 4 years ago
  lyxaira.glass c739225bf5 Saved 4 years ago
  lyxaira.glass d710c8b2ff Merge branch 'Sprint6' of https://git.ccom.uprrp.edu/CCOM4030/artesanias into Sprint6 4 years ago
  lyxaira.glass cb61423f22 Merge branch 'Sprint6' of https://git.ccom.uprrp.edu/CCOM4030/artesanias into Sprint6 4 years ago
  lyxaira.glass c276b1f138 Changes 4 years ago

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

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

1
 var request = new XMLHttpRequest()
1
 var request = new XMLHttpRequest()
2
 
2
 
3
                         request.open('GET', 'json/azar.json', true)
3
                         request.open('GET', 'json/azar.json', true)
4
-    
4
+
5
                         request.onload = function() {
5
                         request.onload = function() {
6
                             // begin accessing JSON data here
6
                             // begin accessing JSON data here
7
                             var data = JSON.parse(this.response)
7
                             var data = JSON.parse(this.response)
8
-                            
8
+
9
                             var page = document.getElementById("home");
9
                             var page = document.getElementById("home");
10
-                            
10
+
11
                                 var aleatorio = Math.floor(Math.random()*32);
11
                                 var aleatorio = Math.floor(Math.random()*32);
12
                                 document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="300">`;
12
                                 document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="300">`;
13
                                 document.getElementById("Content").innerHTML = data[aleatorio].Renglones + "<br>" + data[aleatorio].Artesano + "<br>" + data[aleatorio].Municipio;
13
                                 document.getElementById("Content").innerHTML = data[aleatorio].Renglones + "<br>" + data[aleatorio].Artesano + "<br>" + data[aleatorio].Municipio;
14
-                          
14
+
15
                             page.addEventListener("show", function(event){
15
                             page.addEventListener("show", function(event){
16
                                 document.getElementById("image").innerHTML='';
16
                                 document.getElementById("image").innerHTML='';
17
                                 document.getElementById("Content").innerHTML='';
17
                                 document.getElementById("Content").innerHTML='';
23
                                 document.getElementById("Content").innerHTML = data[aleatorio].Renglones + "<br>" + data[aleatorio].Artesano + "<br>" + data[aleatorio].Municipio;
23
                                 document.getElementById("Content").innerHTML = data[aleatorio].Renglones + "<br>" + data[aleatorio].Artesano + "<br>" + data[aleatorio].Municipio;
24
                                 //azar.appendChild(img);
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
 var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
1
 var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
2
-
2
+console.log("TEST!!!");
3
 var list = document.getElementById("list");
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
           var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
8
           var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
8
                       <div class="center">${info[i].Renglones}</div>
9
                       <div class="center">${info[i].Renglones}</div>

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

13
 
13
 
14
 
14
 
15
 function checkDate() {
15
 function checkDate() {
16
-  var date = loadFile("https://artesaniaspr.online/date.txt");
16
+  var date = loadFile("https://136.145.181.12/date.txt");
17
   if (window.localStorage.getItem("DATE") == null || window.localStorage.getItem("DATE") != date) {
17
   if (window.localStorage.getItem("DATE") == null || window.localStorage.getItem("DATE") != date) {
18
   window.localStorage.setItem("DATE", date);
18
   window.localStorage.setItem("DATE", date);
19
     return false;
19
     return false;
27
 try {
27
 try {
28
   if (checkDate() == false) {
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
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
33
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
34
 
34
 
35
     for (var i = 0; i < renglones.length; i++) {
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
   } catch {
39
   } catch {

+ 38
- 42
platforms/browser/www/artesano.html View File

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
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
 </head>
10
 </head>
11
 <body>
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
 </body>
67
 </body>
72
 </html>
68
 </html>

+ 30
- 57
platforms/browser/www/index.html View File

220
                             if (Artesano["Telefono 1"].trim().length != 0) {
220
                             if (Artesano["Telefono 1"].trim().length != 0) {
221
                                 cont ++;
221
                                 cont ++;
222
                             }
222
                             }
223
-                            if (Artesano["E-mail"].trim().length != 0) {
223
+                            if (Artesano["E-mail"].trim().length != 0 & Artesano["E-mail"].toUpperCase().trim() != "NO TIENE") {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
                             if (Artesano.Especificacion.trim().length != 0) {
226
                             if (Artesano.Especificacion.trim().length != 0) {
230
 
230
 
231
                             //info a pasar
231
                             //info a pasar
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
233
-                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}' } })" tappable>
233
+                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', redes: '${Artesano["E-Commerce1"]}', esp: '${Artesano.Especificacion}' } })" tappable>
234
                         <div class="title">${Artesano.Nombre}</div>
234
                         <div class="title">${Artesano.Nombre}</div>
235
                     </ons-list-item>`);
235
                     </ons-list-item>`);
236
 
236
 
411
 
411
 
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
413
 
413
 
414
-        <template id="artesano.html">
415
-            <ons-page id="artesano">
416
-                <ons-toolbar>
417
-                    <div class="left"><ons-back-button>Atras</ons-back-button></div>
418
-                    <div class="center"></div>
419
-                </ons-toolbar>
420
-                <body>
421
-                    <ons-card id="all"></ons-card>
422
-                </body>
423
-                <script>
424
-                    ons.getScriptPage().onInit = function () {
425
-                        this.querySelector('ons-toolbar div.center').textContent = this.data.title;
426
-
427
-                        var 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
         <script>
414
         <script>
457
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
415
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
458
             function filter(){
416
             function filter(){
537
                 <script>
495
                 <script>
538
                     for (i = 0; i < Madera.length;i++){
496
                     for (i = 0; i < Madera.length;i++){
539
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
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
                         <div>${Madera[i].Nombre}</div>
499
                         <div>${Madera[i].Nombre}</div>
542
                     </ons-list-item>`);
500
                     </ons-list-item>`);
543
                         // var artesano = ons.createElement(`
501
                         // var artesano = ons.createElement(`
567
                     ons.getScriptPage().onInit = function () {
525
                     ons.getScriptPage().onInit = function () {
568
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
526
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
569
 
527
 
570
-                        var info = ``,
528
+                        var data = '',
571
                             mun = this.data.mun,
529
                             mun = this.data.mun,
572
                             tel = this.data.tel,
530
                             tel = this.data.tel,
573
-                            email = this.data.email,
531
+                            em = this.data.email,
574
                             esp = this.data.esp;
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
                 </script>
565
                 </script>
710
         <script type="text/javascript" src="cordova.js"></script>
683
         <script type="text/javascript" src="cordova.js"></script>
711
         <script type="text/javascript" src="js/index.js"></script>
684
         <script type="text/javascript" src="js/index.js"></script>
712
     </body>
685
     </body>
713
-</html>
686
+</html>

+ 3
- 3
platforms/browser/www/js/load.js View File

15
 
15
 
16
 window.fn.pushPage = function (page, anim) {
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
   if (anim) {
21
   if (anim) {
22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
23
   } else {
23
   } else {
24
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } });
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 View File

24
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
24
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
25
                         <div class="title">${info[i].Renglones}</div>
25
                         <div class="title">${info[i].Renglones}</div>
26
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
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 View File

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

+ 38
- 42
www/artesano.html View File

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
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
 </head>
10
 </head>
11
 <body>
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
 </body>
67
 </body>
72
 </html>
68
 </html>

+ 30
- 57
www/index.html View File

220
                             if (Artesano["Telefono 1"].trim().length != 0) {
220
                             if (Artesano["Telefono 1"].trim().length != 0) {
221
                                 cont ++;
221
                                 cont ++;
222
                             }
222
                             }
223
-                            if (Artesano["E-mail"].trim().length != 0) {
223
+                            if (Artesano["E-mail"].trim().length != 0 & Artesano["E-mail"].toUpperCase().trim() != "NO TIENE") {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
                             if (Artesano.Especificacion.trim().length != 0) {
226
                             if (Artesano.Especificacion.trim().length != 0) {
230
 
230
 
231
                             //info a pasar
231
                             //info a pasar
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
233
-                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}' } })" tappable>
233
+                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', redes: '${Artesano["E-Commerce1"]}', esp: '${Artesano.Especificacion}' } })" tappable>
234
                         <div class="title">${Artesano.Nombre}</div>
234
                         <div class="title">${Artesano.Nombre}</div>
235
                     </ons-list-item>`);
235
                     </ons-list-item>`);
236
 
236
 
411
 
411
 
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
412
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
413
 
413
 
414
-        <template id="artesano.html">
415
-            <ons-page id="artesano">
416
-                <ons-toolbar>
417
-                    <div class="left"><ons-back-button>Atras</ons-back-button></div>
418
-                    <div class="center"></div>
419
-                </ons-toolbar>
420
-                <body>
421
-                    <ons-card id="all"></ons-card>
422
-                </body>
423
-                <script>
424
-                    ons.getScriptPage().onInit = function () {
425
-                        this.querySelector('ons-toolbar div.center').textContent = this.data.title;
426
-
427
-                        var 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
         <script>
414
         <script>
457
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
415
             var Madera = JSON.parse(window.localStorage.getItem("TODOS"));
458
             function filter(){
416
             function filter(){
537
                 <script>
495
                 <script>
538
                     for (i = 0; i < Madera.length;i++){
496
                     for (i = 0; i < Madera.length;i++){
539
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
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
                         <div>${Madera[i].Nombre}</div>
499
                         <div>${Madera[i].Nombre}</div>
542
                     </ons-list-item>`);
500
                     </ons-list-item>`);
543
                         // var artesano = ons.createElement(`
501
                         // var artesano = ons.createElement(`
567
                     ons.getScriptPage().onInit = function () {
525
                     ons.getScriptPage().onInit = function () {
568
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
526
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
569
 
527
 
570
-                        var info = ``,
528
+                        var data = '',
571
                             mun = this.data.mun,
529
                             mun = this.data.mun,
572
                             tel = this.data.tel,
530
                             tel = this.data.tel,
573
-                            email = this.data.email,
531
+                            em = this.data.email,
574
                             esp = this.data.esp;
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
                 </script>
565
                 </script>
710
         <script type="text/javascript" src="cordova.js"></script>
683
         <script type="text/javascript" src="cordova.js"></script>
711
         <script type="text/javascript" src="js/index.js"></script>
684
         <script type="text/javascript" src="js/index.js"></script>
712
     </body>
685
     </body>
713
-</html>
686
+</html>

+ 3
- 3
www/js/load.js View File

15
 
15
 
16
 window.fn.pushPage = function (page, anim) {
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
   if (anim) {
21
   if (anim) {
22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
23
   } else {
23
   } else {
24
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } });
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 View File

24
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
24
   /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
25
                         <div class="title">${info[i].Renglones}</div>
25
                         <div class="title">${info[i].Renglones}</div>
26
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
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 View File

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