Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

index.html 46KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. <!DOCTYPE html>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements. See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership. The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. -->
  18. <html>
  19. <head>
  20. <!--
  21. Customize this policy to fit your own app's needs. For more guidance, see:
  22. https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy
  23. Some notes:
  24. * gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
  25. * https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
  26. * Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
  27. * Enable inline JS: add 'unsafe-inline' to default-src
  28. -->
  29. <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
  30. <!--these three for the calendar-->
  31. <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
  32. <link href="css/robotocondensed.css" rel="stylesheet">
  33. <link rel="stylesheet" href="calendar_files/css/demo.css"/>
  34. <link rel="stylesheet" href="css/file.css"/>
  35. <link rel="stylesheet" href="calendar_files/css/theme1.css"/>
  36. <!--this is for the search bar-->
  37. <link rel = "stylesheet" href = "css/searchbar1.css">
  38. <meta name="format-detection" content="telephone=no">
  39. <meta name="msapplication-tap-highlight" content="no">
  40. <meta name="viewport" content="initial-scale=1, width=device-width, height=device-height, viewport-fit=cover">
  41. <link rel="stylesheet" type="text/css" href="css/index.css">
  42. <link rel="stylesheet" href="lib/OnsenUI/css/onsenui.css">
  43. <link rel="stylesheet" href="lib/OnsenUI/css/onsen-css-components.min.css">
  44. <script src="lib/OnsenUI/js/onsenui.min.js"></script>
  45. <script src="js/jquery_.js"></script>
  46. <script type="text/javascript" src="js/saveLocal.js"></script>
  47. </head>
  48. <body>
  49. <!--the toolbar is where it will have the main name of the app and the ICP logo (top center)-->
  50. <ons-page>
  51. <ons-toolbar>
  52. <div class="center">ArtesaníasICP</div>
  53. <div class="right"><img class="list-item__thumbnail" src="img/ICP.png"></div>
  54. </ons-toolbar>
  55. <!--The tabbar is the place where the user can get acces to the different sections of the app-->
  56. <!--Each tab will hace a page name (which we use to reference and define them later one), then we have a laber, this is what will be used as a name for that page in the tabbar-->
  57. <ons-tabbar swipeable position="bottom" modifier="autogrow">
  58. <ons-tab page="home.html" label="Hogar" icon = "md-home" active></ons-tab>
  59. <ons-tab page="renglones.html" label="Artesanías" icon = "fa-paint-brush"></ons-tab>
  60. <ons-tab page ="search.html" label="Buscar" icon = "fa-search"> </ons-tab>
  61. <ons-tab page ="ferias.html" label="Eventos" icon = "fa-calendar-alt"> </ons-tab>
  62. <ons-tab page="colaboradores.html" label="Colab" icon = "fa-users"></ons-tab>
  63. </ons-tabbar>
  64. </ons-page>
  65. <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  66. <template id="home.html">
  67. <ons-page id="home" class="red">
  68. <ons-card id="azar"><!--style="height: 100%"-->
  69. <!--<div class="title" id="Title"></div>-->
  70. <div id="image" style= "max-height:500px"></div><br>
  71. <div class="content" id="Content"></div>
  72. <!--This javascript will randomly choose an image and information of a certain type of artesania used by a certain artists-->
  73. <!--For now all this information is stored inside a .csv file-->
  74. <script type="text/javascript" src="js/azar.js"> </script>
  75. </ons-card>
  76. </ons-page>
  77. </template>
  78. <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  79. <!-- This is the page that's accesed when someone clicks on a renglon (tipo de material usado) and then artesanos, it will show a list of all theartists that work with that type of material
  80. -->
  81. <template id="artesanos.html">
  82. <ons-page id="artesanos">
  83. <!-- This button lets the user go back to the previous page of the artesanias tab-->
  84. <ons-toolbar>
  85. <div class="left"><ons-back-button>Atrás</ons-back-button></div>
  86. <div class="center"></div>
  87. </ons-toolbar>
  88. <!--Not sure what this does....-->
  89. <!-- when you pull down and are already at the top of the artesanos list then you see that fa-arrow-down on the top-->
  90. <ons-pull-hook id="pull-hook" threshold-height="120px">
  91. <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
  92. </ons-pull-hook>
  93. <!--This is where it will make the list, so the function that puts the artists here should reference this -->
  94. <ons-list id="artesanos-list" src="">
  95. <ons-list-header>Artesanos</ons-list-header>
  96. </ons-list>
  97. <script>
  98. ons.getScriptPage().onInit = function () {
  99. //not sure what this does, because I dont really know what this.data.title have inside
  100. //But I think what it has is the renglon that the user chose in the previous tab, and then using it as the title on this page
  101. this.querySelector('ons-toolbar div.center').textContent = this.data.title;
  102. //var File = this.data.title.toUpperCase() + '.json' ;
  103. //seperates all different types of especificaciones
  104. var Esp = this.data.esp.split(', ');
  105. //Puts the json file of all the artesanos into this variable
  106. var artesanos_json = this.data.json;
  107. //Turns the first character into an upper case
  108. //Convertir en mayuscula primera letra del string.
  109. for(var i=0; i<Esp.length; i++) {
  110. Esp[i] = Esp[i].charAt(0).toUpperCase() + Esp[i].slice(1);
  111. };
  112. //This is what happens when you scroll the list of names down when its already at the top
  113. //First the arrow faces down, at some point it spins and points to the top, right before the user's finger stops touching the screen
  114. //or if their finger goes back down.
  115. var pullHook = document.getElementById('pull-hook');
  116. var icon = document.getElementById('pull-hook-icon');
  117. pullHook.addEventListener('changestate', function (event) {
  118. switch (event.state) {
  119. case 'initial':
  120. icon.setAttribute('icon', 'fa-arrow-down');
  121. icon.removeAttribute('rotate');
  122. icon.removeAttribute('spin');
  123. break;
  124. case 'preaction':
  125. icon.setAttribute('icon', 'fa-arrow-down');
  126. icon.setAttribute('rotate', '180');
  127. icon.removeAttribute('spin');
  128. break;
  129. case 'action':
  130. icon.setAttribute('icon', 'fa-spinner');
  131. icon.removeAttribute('rotate');
  132. icon.setAttribute('spin', true);
  133. break;
  134. }
  135. });
  136. //This function recieves a number that is tied to a specific Especificacion (type of artesania that artist make like: boligrafos,figuras...) in the variable Esp declared beforehand
  137. //Then it finds and copies all the information of the artists that work on that type of artesania
  138. //It ends up returning the especificacion in 'name' and retuns all the names and municipios of the artists that it found in 'artesan'
  139. var getArtesania = function (num) {
  140. //First it empty in case we dont find anyone, this is the variable where the information of the artist's name and municipio will be sent
  141. var Artesanos = ``;
  142. console.log('Filtrado de ',Esp[num])
  143. //results: This variable will have all the information about the artists who work with that especificacion, it will look for this in the artesanos_json that has the whole json file of artesanos.
  144. //I dont think its using 'searchVal' for anything....
  145. var results = [];
  146. var searchVal = "my Name";
  147. for (var i=0 ; i < artesanos_json.length ; i++)
  148. {
  149. if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
  150. results.push(artesanos_json[i]);
  151. }
  152. }
  153. /*var arr1=artesanos_json.filter(function(item){
  154. return item.Nombre=="Ana";
  155. });*/
  156. //After going through the whole json file
  157. //It adds the names and municipios of the ones found and later stored in 'results' to the 'Artesanos' variable
  158. for(var i=0; i<results.length; i++) {
  159. //if(Esp[num] in artesanos_json.) {}
  160. Artesanos=Artesanos+`<a id='home.html'>${results[i].Nombre} | ${results[i].Municipio}<br>`
  161. //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
  162. }
  163. return {
  164. name: Esp[num],
  165. artesan: Artesanos
  166. };
  167. };
  168. //Then this function returns the name of the Especificacion that was searched in 'name'
  169. //And it also returns all the names and municipios of the artesanos that work with that especificacion
  170. var getData = function () {
  171. const data = [];
  172. for (var i = 0; i < Esp.length; i++) {
  173. data.push(getArtesania(i));
  174. }
  175. return data;
  176. };
  177. //not sure what this does because the element is also created later on, with even more information so idk if this one is just wrong
  178. //This will create a new tab with the information of the arteanos?
  179. var createArtesano = function (Artesano) {
  180. return ons.createElement(`
  181. <ons-list-item expandable tappable>
  182. <div class="center" >${Artesano.Nombre}</div>
  183. <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
  184. Tel\u00e9fono: ${Artesano["Telefono 1"]}<br>
  185. Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
  186. </div>
  187. </ons-list-item>`
  188. );
  189. };
  190. //var Artesanias = getData();
  191. //artesanos_json
  192. for (Artesano of artesanos_json) {
  193. var cont = 0;
  194. var lista = document.getElementById('artesanos-list');
  195. //Recopilar datos no vacios.
  196. //Counts all the tyoes of data that the artists don't have
  197. //Later on, if you discover that they didn't have 'municipios', telephone numbers, emails and especificaciones then you wont display it.
  198. if (Artesano.Municipio.trim().length != 0) {
  199. cont ++;
  200. }
  201. if (Artesano["Telefono 1"].trim().length != 0) {
  202. cont ++;
  203. }
  204. if (Artesano["E-mail"].trim().length != 0 & Artesano["E-mail"].toUpperCase().trim() != "NO TIENE") {
  205. cont ++;
  206. }
  207. if (Artesano.Especificacion.trim().length != 0) {
  208. cont ++;
  209. }
  210. //info a pasar
  211. //'title':'${Artesano.Nombre}','esp': '${info}'
  212. //Tries to pass all the info of each artesano into a new page, the page that display this information is 'artesano.html', not to be confused with 'artesanias.html' or 'artesanos.html'(current page)
  213. //And puts this into the 'item' variable
  214. var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}', redes: '${Artesano["E-Commerce 1"]}', tecnicas: '' } })" tappable>
  215. <div class="title">${Artesano.Nombre}</div>
  216. </ons-list-item>`);
  217. //If it didn't find 'municipios', telephone numbers, emails and 'especificaciones' of that artists then it wont include it on the 'artesanos-list' (variable: 'lista')
  218. //If it found that it has at least one of them then it will include it into the list.
  219. if(cont == 0){
  220. //console.log(Artesano.Nombre+' no tiene ningun tipo de informacion.');
  221. //return ons.createElement(``);
  222. }
  223. else {
  224. lista.appendChild(item);
  225. }
  226. };
  227. };
  228. </script>
  229. <style>
  230. .pull-hook-content {
  231. color: #333;
  232. transition: transform .25s ease-in-out;
  233. }
  234. </style>
  235. </ons-page>
  236. </template>
  237. <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  238. <template id="artesanias.html">
  239. <ons-page id="artesanias">
  240. <ons-toolbar>
  241. <div class="left"><ons-back-button>Atrás</ons-back-button></div>
  242. <div class="center"></div>
  243. </ons-toolbar>
  244. <ons-pull-hook id="pull-hook" threshold-height="120px">
  245. <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
  246. </ons-pull-hook>
  247. <ons-list id="artesania-list" src="">
  248. <ons-list-header>Artesanias</ons-list-header>
  249. </ons-list>
  250. <script>
  251. ons.getScriptPage().onInit = function () {
  252. this.querySelector('ons-toolbar div.center').textContent = this.data.title;
  253. //var File = this.data.title.toUpperCase() + '.json' ;
  254. var Esp = this.data.esp.split(', ');
  255. var artesanos_json = this.data.json;
  256. //Convertir en mayuscula primera letra del string.
  257. for(var i=0; i<Esp.length; i++) {
  258. Esp[i] = Esp[i].charAt(0).toUpperCase() + Esp[i].slice(1);
  259. };
  260. var pullHook = document.getElementById('pull-hook');
  261. var icon = document.getElementById('pull-hook-icon');
  262. pullHook.addEventListener('changestate', function (event) {
  263. switch (event.state) {
  264. case 'initial':
  265. icon.setAttribute('icon', 'fa-arrow-down');
  266. icon.removeAttribute('rotate');
  267. icon.removeAttribute('spin');
  268. break;
  269. case 'preaction':
  270. icon.setAttribute('icon', 'fa-arrow-down');
  271. icon.setAttribute('rotate', '180');
  272. icon.removeAttribute('spin');
  273. break;
  274. case 'action':
  275. icon.setAttribute('icon', 'fa-spinner');
  276. icon.removeAttribute('rotate');
  277. icon.setAttribute('spin', true);
  278. break;
  279. }
  280. });
  281. var getArtesania = function (num) {
  282. var Artesanos = ``,
  283. ArtesanosInfo = ``;
  284. //console.log('Filtrado de ',Esp[num])
  285. var results = [];
  286. var searchVal = "my Name";
  287. for (var i=0 ; i < artesanos_json.length ; i++)
  288. {
  289. if (artesanos_json[i].Especificacion.includes(Esp[num])) {
  290. results.push(artesanos_json[i]);
  291. }
  292. }
  293. /*var arr1=artesanos_json.filter(function(item){
  294. return item.Nombre=="Ana";
  295. });*/
  296. for(var i=0; i<results.length; i++) {
  297. //if(Esp[num] in artesanos_json.) {}
  298. Artesanos+=`${results[i].Nombre}|`
  299. ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Telefono 1"]}|${results[i]["E-mail"]}|${results[i].Especificacion}&&`
  300. //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
  301. }
  302. return {
  303. name: Esp[num],
  304. artesan: Artesanos,
  305. info: ArtesanosInfo
  306. };
  307. };
  308. var getData = function () {
  309. const data = [];
  310. for (var i = 0; i < Esp.length; i++) {
  311. data.push(getArtesania(i));
  312. }
  313. return data;
  314. };
  315. var createArtesania = function (Artesania) {
  316. //console.log('Devuelto elemento')
  317. var listaArt=``;
  318. var arts = Artesania.artesan.split('|');
  319. var artsInfo = Artesania.info.split('&&');
  320. for(var i=0; i<arts.length; i++) {
  321. var lot = artsInfo[i].split('|'),
  322. mun = lot[0],
  323. tel = lot[1],
  324. email = lot[2],
  325. esp = lot[3],
  326. redes = lot[4],
  327. tecnicas = '';
  328. listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', redes: '${redes}', tecnicas: '' }} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
  329. }
  330. return ons.createElement(`
  331. <ons-list-item expandable tappable>
  332. <div class="center" >${Artesania.name}</div>
  333. <div class="expandable-content">Artesanos que trabajan con ${Artesania.name}
  334. <ons-card>${listaArt}</ons-card></div>
  335. </ons-list-item>`
  336. );
  337. };
  338. var Artesanias = getData();
  339. for (Art of Artesanias) {
  340. var Artesania = createArtesania(Art);
  341. document.getElementById('artesania-list').appendChild(Artesania);
  342. };
  343. pullHook.onAction = function (done) {
  344. setTimeout(function() {
  345. document.getElementById('artesania-list').appendChild(createArtesania(getArtesania()));
  346. done();
  347. }, 400);
  348. }
  349. };
  350. </script>
  351. <style>
  352. .pull-hook-content {
  353. color: #333;
  354. transition: transform .25s ease-in-out;
  355. }
  356. </style>
  357. </ons-page>
  358. </template>
  359. <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  360. <!----------------------------------------------------------------------------------->
  361. <!--
  362. The searchfunctions.js file is just a file that has all the definitions of the functions used later on in the switch
  363. -->
  364. <script src = "js/searchfunctions.js"></script>
  365. <script>
  366. //'all_artesanos' is the variable containing the JSON file that has all the artesanos with their data
  367. var all_artesanos = JSON.parse(window.localStorage.getItem('TODOS'));
  368. function filter(){
  369. //finds the values of the search bar which are sent from the block of code after this script
  370. //input is the one you use to filter by any parameter
  371. //inputarte is the one you use to filter by the type of art the artists make
  372. //inputmuni is the one you use to filter by municipio
  373. //informacion is the variable that has all the information that will be sent to this tab, what we're going to use here is just to declare which artists are seen (informacion[i].style.display = "list-item") and which are not seen (informacion[i].style.display = "none")
  374. var input = document.getElementById('searchbar').value;
  375. var inputarte = document.getElementById('searchartesania').value;
  376. var inputmuni = document.getElementById('searchbarmunicipio').value;
  377. var x = document.getElementsByClassName('artists');
  378. //just making sure everything is at the same format by taking out special characters, trimming it and putting it in lowercase (same thing will be done to the arguments it's being compared to later on)
  379. //acento_replace(): it's a function I made that takes out any special characters of a word and changes them back to the plain ones (quitar acentos o cosas asi)
  380. input = input.trim().toLowerCase();
  381. inputarte = inputarte.trim().toLowerCase();
  382. inputmuni = inputmuni.trim().toLowerCase();
  383. input = acento_replace(input);
  384. inputarte = acento_replace(inputarte);
  385. inputmuni = acento_replace(inputmuni);
  386. //default case is where evey one of them has nothing or less than 3 characters (displays every artist until it passes that length)
  387. if (input.length <= 3 && inputarte.length <= 3 && inputmuni.length <= 3){
  388. for (var i = 0; all_artesanos.length; i++){
  389. x[i].style.display = "list-item";
  390. }
  391. }
  392. else{
  393. var cases = 0;
  394. cases = getcasenum(input,inputarte,inputmuni);
  395. //take every one of them out first (dont display any)
  396. for (var i = 0; i < all_artesanos.length; i++){
  397. x[i].style.display = "none";
  398. }
  399. switch(cases){
  400. //cases == 1 when only inputmuni has been writen on
  401. case 1:
  402. filter_municipios(inputmuni);
  403. break;
  404. //cases == 2 when only inputarte has been written on
  405. case 2:
  406. filter_artesanias(inputarte);
  407. break;
  408. //cases == 3 when inputarte and inputmuni has been written on
  409. case 3:
  410. search_art_mun(inputarte,inputmuni);
  411. break;
  412. //cases == 4 when input has been writen on
  413. case 4:
  414. filter_any(input);
  415. break;
  416. //cases == 5 when input and inputmuni has been written on
  417. case 5:
  418. search_any_mun(input,inputmuni);
  419. break;
  420. //cases == 6 when input and inputart has been written on
  421. case 6:
  422. search_any_art(input,inputarte);
  423. break;
  424. //cases == 7 when input, inputart and inputmuni has been writen on
  425. case 7:
  426. search_any_art_mun(input,inputarte,inputmuni);
  427. break;
  428. }
  429. }
  430. }
  431. </script>
  432. <template id="search.html">
  433. <ons-navigator swipeable animation="slide" id="SNavigator">
  434. <ons-page id="Buscar">
  435. <!--
  436. This is the search bars, each time you type a character into any of the search bars, they will run the filter() function with what they all have as arguments (even if the other search bars have nothing in them)
  437. The first search bar is to find by any information related to the artist
  438. The second searchbar is to find by the type of artwork they work on
  439. The third searchbar is to find by the municipio where the artists works or lives
  440. -->
  441. <p style="text-align: center; margin-top: 10px;">
  442. <ons-search-input placeholder="Busqueda en cualquiera" id = "searchbar"
  443. onkeyup = "filter()"></ons-search-input>
  444. <ons-search-input placeholder="Busqueda por artesanias" id = "searchartesania"
  445. onkeyup = "filter()"></ons-search-input>
  446. <ons-search-input placeholder = "Busqueda por municipio" id = "searchbarmunicipio"
  447. onkeyup = "filter()"></ons-search-input>
  448. </p>
  449. <ons-list id="results" src="">
  450. </ons-list>
  451. <script>
  452. //This is basically declaring what we refer to as informacion in the filter() function
  453. //It iterates though each artists in the all_artesanos json file from before, it displays their name in the "Buscar" page, and it gets prepared so that when its clicked it redirects to the "artesano.html" page with the other aditional information that we have other than the name.
  454. for (i = 0; i < all_artesanos.length;i++){
  455. var artesano = ons.createElement(`<ons-list-item class = "artists"
  456. onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', esp: '${all_artesanos[i].Especificacion}', redes: '${all_artesanos[i]["E-Commerce 1"]}', tecnicas: '${all_artesanos[i]["Tecnica 1"]}' } })" tappable>
  457. <div>${all_artesanos[i].Nombre}</div>
  458. </ons-list-item>`);
  459. document.getElementById('results').appendChild(artesano);
  460. }
  461. </script>
  462. </ons-page>
  463. </ons-navigator>
  464. </template>
  465. <!-- ---------------------------------------------------------------------------------------------------------------------------------------- -->
  466. <!--This page is used so that we can display the information of a specific artists, and whenever the artists is missing information then we just dont include that in the page-->
  467. <template id= "artesano.html">
  468. <ons-page id = "artesano">
  469. <ons-toolbar>
  470. <!-- Pretty self explanatory, its a button that goes back to the previous page -->
  471. <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
  472. <div class = "center"></div>
  473. </ons-toolbar>
  474. <body>
  475. <!-- This is where we'll put all the information of that artsts -->
  476. <ons-card id="all"></ons-card>
  477. </body>
  478. <script>
  479. //when it opens this page this function starts to run, it first recieves the information that was sent to "artesano.html"
  480. ons.getScriptPage().onInit = function () {
  481. this.querySelector('ons-toolbar div.center').textContent = this.data.title;
  482. var data = '',
  483. mun = this.data.mun,
  484. tel = this.data.tel,
  485. em = this.data.email,
  486. esp = this.data.esp,
  487. redes = this.data.redes,
  488. tecnicas = this.data.tecnicas;
  489. //here the email is the string made from the start to where the '#' is.
  490. email = em.slice(0, em.search("#"));
  491. //Here it's dividing all the especificaciones and writing them into the page (data) and then goes to the next line
  492. //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
  493. //but if theres only one then you just write it into the page
  494. if(esp.trim() != ""){
  495. if(esp.includes(";", 0)){
  496. esp=esp.replace(/;/g,", ");
  497. data+='Tipos de artesanias: '+esp+'<br>';
  498. }
  499. else {
  500. data+='Tipo de artesania: '+esp+'<br>';
  501. }
  502. }
  503. //console.log("Las redes son..."+this.data.redes);
  504. //Here it's making sure theres something in municipio and writing their municipio into the page
  505. if(mun.trim() != ""){
  506. data+='Municipio: '+ mun +'<br>';
  507. }
  508. //Here it's writing their email, in blue color and its used as a link to send one when it's clicked, then it goes to the next line
  509. //Whenever the variable is empty or if it has "NO TIENE" then it doesnt write anything
  510. if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
  511. data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
  512. }
  513. //Here it's writing their phone number into the page,its in blue and whenever its clicked the app will redirect the user to call them, then it goes to the next line
  514. if(tel.trim() != "" ){
  515. data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
  516. }
  517. console.log("Redes: "+redes);
  518. //Here it has to decide what to do depending on the links they give to their social media pages
  519. //if the link is to a facebook, instagram or myspace account then it will show the picture of the social media site, and when you click the picture then the app redirects you to their social media.
  520. //The alt attribute is required for images, it's in case theres no internet connection, then it will display that tet instead, I think screen readers can also read that text
  521. //If the link is to another website (but isn't a mailto link) then it will display a default picture we chose to display a default web browser, like the other ones clikcing on it will take you to the link.
  522. //If it's none of them then it will not display anything
  523. if(redes.includes("facebook")){
  524. console.log(redes.substring(1,redes.length-2));
  525. data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;"><br>';
  526. }
  527. else if(redes.includes("instagram")){
  528. console.log(redes.substring(1,redes.length-2));
  529. data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;"><br>';
  530. }
  531. else if(redes.includes("myspace")){
  532. console.log(redes.substring(1,redes.length-2));
  533. data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;"><br>';
  534. }
  535. else if((redes.includes(".org") || redes.includes(".com")) && !redes.includes("mailto")){
  536. redes = redes.substr(redes.indexOf("#")+1,redes.length);
  537. redes = redes.substr(0, redes.length-1);
  538. console.log(redes);
  539. data+='<br><a href="'+ redes + '"><img src="img/internet.jpg" style="width:35px;height:35px;border:0;"><br>';
  540. }
  541. else if(redes.includes("#") || redes.includes("mailto")){
  542. console.log("tiene un disparate");
  543. } else {
  544. console.log("no tiene nada");
  545. }
  546. if(tecnicas.trim() != ''){
  547. if(tecnicas.includes(";", 0)){
  548. tecnicas = tecnicas.replace(/;/g,", ");
  549. data+='Tecnicas que usan: '+tecnicas+'<br>';
  550. }
  551. else {
  552. data+='Tecnicas que usan: '+tecnicas+'<br>';
  553. }
  554. }
  555. //This is the part that allows eveything (data) to be displayed
  556. document.getElementById("all").innerHTML = `${data}`;
  557. }
  558. </script>
  559. </ons-page>
  560. </template>
  561. <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  562. <template id="renglones.html">
  563. <ons-navigator swipeable animation="slide" id="myNavigator">
  564. <ons-page id="renglones">
  565. <!--div class="search-bar">
  566. <p style="text-align: center; margin-top: 10px;">
  567. <ons-search-input placeholder="Search" onchange="ons.notification.alert('Searched for: ' + this.value)"
  568. style="width: 96%; margin: 6px auto 6px auto;"></ons-search-input>
  569. </p>
  570. </div-->
  571. <ons-card id="list">
  572. <script type="text/javascript" src="js/renglones.js"></script>
  573. </ons-card>
  574. <!--Javascript function to hide other open expandables-->
  575. <script>
  576. const hideAll = () => {
  577. Array.from(document.querySelector('#list').children)
  578. .forEach(item => {
  579. if (item.expanded) {
  580. item.hideExpansion();
  581. }
  582. });
  583. };
  584. </script>
  585. <style>
  586. .intro {
  587. text-align: center;
  588. padding: 20px;
  589. margin-top: 30px;
  590. }
  591. ons-card {
  592. cursor: pointer;
  593. color: #333;
  594. }
  595. .card__title,
  596. .card--material__title {
  597. font-size: 15px;
  598. }
  599. </style>
  600. </ons-page>
  601. </ons-navigator>
  602. </template>
  603. <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  604. <template id="ferias.html">
  605. <ons-page id="ferias">
  606. <!--<ons-card>
  607. <div id = "caleandar" class = "calendar" style="margin-top: 20px;">
  608. <script type="text/javascript" src="calendar_files/js/caleandar.js"></script>
  609. <script type="text/javascript" src="calendar_files/js/events.js"></script>
  610. </div>
  611. </ons-card>-->
  612. <br><br><br>
  613. <button onclick="redirect()">Pasar a la pagina de eventos</button>
  614. <script>
  615. function redirect() {
  616. location.replace("https://facebook.com/icppr")
  617. }
  618. </script>
  619. </ons-page>
  620. </template>
  621. <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  622. <template id="colaboradores.html">
  623. <ons-page id="colaboradores">
  624. <ons-card>
  625. <h1>Colaboradores</h1>
  626. <h2>Instituto de Cultura Puertorriqueña</h2>
  627. <h3>Ven, descubre lo que nuestra riqueza cultural puertorriqueña tiene para tí.<br> Disfrútala, es tu identidad.
  628. </h3>
  629. <body>
  630. <br>
  631. El Instituto de Cultura Puertorriqueña (ICP) tiene como misión investigar, conservar, promover y divulgar la cultura puertorriqueña en su diversidad y complejidad. Con la memoria y la promesa de la cultura, los distintos niveles, sectores, edades e intereses de la comunidad crean el conjunto de modos de vida, costumbres y manifestaciones artísticas que nos identifica como país. El ICP existe para preservar y divulgar estos saberes, difundir internacionalmente nuestro talento y enriquecer el amor a lo propio.
  632. <br><br>
  633. Nuestras tradiciones no son rígidos objetos de museo, sino actividades vivas en constante renovación y reapropiación, según van también desarrollándose nuevas tradiciones. El respeto a la diversidad, a lo híbrido, a lo apropiado y a lo replanteado también son parte esencial de esta institución que busca activamente la colaboración de todos en un quehacer que debe ser siempre compartido de la mano con su ingente diversidad.
  634. <br><br>
  635. Prof. Carlos R. Ruiz Cortés<br>
  636. Director Ejecutivo<br>
  637. Instituto de Cultura Puertorriqueña<br>
  638. Directorio Artesanal Cultural PR <img src="img/gobierno.png" style="width:35px;height:35px;border:0;">
  639. <br><br>
  640. </body>
  641. Visita nuestra <a href="https://www.icp.pr.gov/">Página Web</a> o síguenos en nuestras redes sociales: <br>
  642. <a href="https://twitter.com/icppr"><img src="img/twitter.png" alt="Twitter" style="width:35px;height:35px;border:0;">
  643. </a>
  644. <a href="https://facebook.com/icppr"><img src="img/facebook.png" alt="Facebook" style="width:35px;height:35px;border:0;">
  645. </a>
  646. <a href="https://youtube.com/user/icppr"><img src="img/youtube.png" alt="Youtube" style="width:35px;height:35px;border:0;">
  647. </a>
  648. <a href="https://instagram.com/icppr"><img src="img/instagram.png" alt="Instagram" style="width:35px;height:35px;border:0;">
  649. </a>
  650. <br><br><br>
  651. <button onclick="redirect()">Pasar a la pagina de eventos</button>
  652. <script>
  653. function redirect() {
  654. location.replace("https://facebook.com/icppr")
  655. }
  656. </script>
  657. <br><br>
  658. <style>
  659. .column {
  660. float: left;
  661. width: 50%;
  662. }
  663. .row {
  664. width: 100%;
  665. }
  666. </style>
  667. <h2>SINFINESPR</h2>
  668. <div class = "column">
  669. SINFINESPR es un programa de Titín Foundation que responde a nuestro interés y compromiso con el fortalecimiento del tercer sector.
  670. <br><br>
  671. En esta plataforma agrupamos herramientas que permitirán que tu organización adquiera mayor visibilidad, recursos, conexiones, capacidad para una operación más eficiente y efectiva.
  672. <br><br>
  673. Saludos Cordiales,
  674. Aziria
  675. </div>
  676. <div class = "column">
  677. <img src="img/sfpr.svg" style="width:150px;height:100px">
  678. </div>
  679. <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
  680. Visita nuesta Página Web o siguenos en nuestras redes sociales<br>
  681. <a href="https://twitter.com/SINFINESPR"><img src="img/twitter.png" alt="Twitter" style="width:35px;height:35px;border:0;">
  682. </a>
  683. <a href="https://www.facebook.com/sinfinespr"><img src="img/facebook.png" alt="Facebook" style="width:35px;height:35px;border:0;">
  684. </a>
  685. <a href="https://www.linkedin.com/company/sinfinespr/"><img src="img/linkedin.png" alt="Linkedin" style="width:35px;height:35px;border:0;">
  686. </a>
  687. <a href="https://www.instagram.com/sinfinespr/"><img src="img/instagram.png" alt="Instagram" style="width:35px;height:35px;border:0;">
  688. </a>
  689. <br><br>
  690. <h2>Centro de Desarrollo y Consultoria Computacional</h2>
  691. El Centro de Desarrollo y Consultoría Computacional está compuesto por profesores y estudiantes del departamento de Ciencia de Cómputos de la Universidad de Puerto Rico Recinto de Río Piedras. Nuestra meta es aportar al desarrollo computacional de la Universidad y de Puerto Rico al proveer servicios al día, de calidad y con precios accesibles, a la misma vez que se le ofrece experiencias prácticas a los estudiantes del departamento de Ciencia de Cómputos.
  692. <br><br>
  693. Si tiene alguna duda nos puede conactar por:
  694. <br>
  695. Teléfono: 787-764-0000 Ext. 88341, 88349
  696. <br>
  697. o
  698. <br>
  699. Correo electrónico: <a href = "mailto:carlos.corrada2@upr.edu" style ="color:#0000EE;text-decoration: underline;">carlos.corrada2@upr.edu</a>
  700. </ons-card>
  701. </ons-page>
  702. </template>
  703. <script src="js/load.js"></script>
  704. <script type="text/javascript" src="cordova.js"></script>
  705. <script type="text/javascript" src="js/index.js"></script>
  706. </body>
  707. </html>