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

newerIndex.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; media-src *; img-src 'self' data: content:;">
  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, 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. </head>
  47. <body>
  48. <ons-navigator swipeable animation="slide" id="myNavigator">
  49. <ons-page>
  50. <ons-toolbar>
  51. <div class="center">Instituto de Cultura</div>
  52. </ons-toolbar>
  53. <ons-tabbar swipeable position="auto">
  54. <ons-tab page="home.html" label="Hogar"></ons-tab>
  55. <ons-tab page="renglones.html" label="Artesanias"active></ons-tab>
  56. <ons-tab page="ferias.html" label="Ferias"></ons-tab>
  57. <ons-tab page="instituto.html" label="Instituto"></ons-tab>
  58. </ons-tabbar>
  59. </ons-page>
  60. </ons-navigator>
  61. <template id="home.html">
  62. <ons-page id="home">
  63. <ons-card id="azar">
  64. <div class="title" id="Title"></div>
  65. <div id="image"></div><br>
  66. <div class="content" id="Content"></div>
  67. <script type="text/javascript" src="js/azar.js"> </script>
  68. </ons-card>
  69. </ons-page>
  70. </template>
  71. <template id="artesanias.html">
  72. <ons-page id="artesanias">
  73. <ons-toolbar>
  74. <div class="left"><ons-back-button>Atrás</ons-back-button></div>
  75. <div class="center"></div>
  76. </ons-toolbar>
  77. <ons-pull-hook id="pull-hook" threshold-height="120px">
  78. <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
  79. </ons-pull-hook>
  80. <ons-list id="artesania-list" src="">
  81. <ons-list-header>Artesanias</ons-list-header>
  82. </ons-list>
  83. <ons-list id="artesanos-list" src="">
  84. <ons-list-header>Artesanos</ons-list-header>
  85. </ons-list>
  86. <script>
  87. ons.getScriptPage().onInit = function () {
  88. this.querySelector('ons-toolbar div.center').textContent = this.data.title;
  89. //var File = this.data.title.toUpperCase() + '.json' ;
  90. var Esp = this.data.esp.split(', ');
  91. var artesanos_json = this.data.json;
  92. //Convertir en mayuscula primera letra del string.
  93. for(var i=0; i<Esp.length; i++) {
  94. Esp[i] = Esp[i].charAt(0).toUpperCase() + Esp[i].slice(1);
  95. };
  96. var pullHook = document.getElementById('pull-hook');
  97. var icon = document.getElementById('pull-hook-icon');
  98. pullHook.addEventListener('changestate', function (event) {
  99. switch (event.state) {
  100. case 'initial':
  101. icon.setAttribute('icon', 'fa-arrow-down');
  102. icon.removeAttribute('rotate');
  103. icon.removeAttribute('spin');
  104. break;
  105. case 'preaction':
  106. icon.setAttribute('icon', 'fa-arrow-down');
  107. icon.setAttribute('rotate', '180');
  108. icon.removeAttribute('spin');
  109. break;
  110. case 'action':
  111. icon.setAttribute('icon', 'fa-spinner');
  112. icon.removeAttribute('rotate');
  113. icon.setAttribute('spin', true);
  114. break;
  115. }
  116. });
  117. var getArtesania = function (num) {
  118. var Artesanos = ``;
  119. console.log('Filtrado de ',Esp[num])
  120. var results = [];
  121. var searchVal = "my Name";
  122. for (var i=0 ; i < artesanos_json.length ; i++)
  123. {
  124. if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
  125. results.push(artesanos_json[i]);
  126. }
  127. }
  128. /*var arr1=artesanos_json.filter(function(item){
  129. return item.Nombre=="Ana";
  130. });*/
  131. for(var i=0; i<results.length; i++) {
  132. //if(Esp[num] in artesanos_json.) {}
  133. Artesanos=Artesanos+`<a id='home.html'>${results[i].Nombre} | ${results[i].Municipio}<br>`
  134. //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
  135. }
  136. return {
  137. name: Esp[num],
  138. artesan: Artesanos
  139. };
  140. };
  141. var getData = function () {
  142. const data = [];
  143. for (var i = 0; i < Esp.length; i++) {
  144. data.push(getArtesania(i));
  145. }
  146. return data;
  147. };
  148. var createArtesania = function (Artesania) {
  149. //console.log('Devuelto elemento')
  150. return ons.createElement(`
  151. <ons-list-item expandable tappable>
  152. <div class="center" >${Artesania.name}</div>
  153. <div class="expandable-content"> Artesanos que trabajan con ${Artesania.name}:<br><br>${Artesania.artesan}</div>
  154. </ons-list-item>`
  155. );
  156. };
  157. var Artesanias = getData();
  158. for (Art of Artesanias) {
  159. var Artesania = createArtesania(Art);
  160. document.getElementById('artesania-list').appendChild(Artesania);
  161. };
  162. pullHook.onAction = function (done) {
  163. setTimeout(function() {
  164. document.getElementById('artesania-list').appendChild(createArtesania(getArtesania()));
  165. done();
  166. }, 400);
  167. }
  168. var createArtesano = function (Artesano) {
  169. return ons.createElement(`
  170. <ons-list-item expandable tappable>
  171. <div class="center" >${Artesano.Nombre}</div>
  172. <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
  173. Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
  174. Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
  175. Trabaja con: ${Artesano.Especificaciones}<br>
  176. </div>
  177. </ons-list-item>`
  178. );
  179. };
  180. //var Artesanias = getData();
  181. //artesanos_json
  182. for (arte of artesanos_json) {
  183. var Artesano = createArtesano(arte);
  184. document.getElementById('artesanos-list').appendChild(Artesano);
  185. };
  186. };
  187. </script>
  188. <style>
  189. .pull-hook-content {
  190. color: #333;
  191. transition: transform .25s ease-in-out;
  192. }
  193. </style>
  194. </ons-page>
  195. </template>
  196. <template id="renglones.html">
  197. <ons-page id="renglones">
  198. <!--div class="search-bar">
  199. <p style="text-align: center; margin-top: 10px;">
  200. <ons-search-input placeholder="Search" onchange="ons.notification.alert('Searched for: ' + this.value)"
  201. style="width: 96%; margin: 6px auto 6px auto;"></ons-search-input>
  202. </p>
  203. </div-->
  204. <ons-card id="list">
  205. <script type="text/javascript" src="js/renglones.js"></script>
  206. </ons-card>
  207. <style>
  208. .intro {
  209. text-align: center;
  210. padding: 20px;
  211. margin-top: 30px;
  212. }
  213. ons-card {
  214. cursor: pointer;
  215. color: #333;
  216. }
  217. .card__title,
  218. .card--material__title {
  219. font-size: 15px;
  220. }
  221. </style>
  222. </ons-page>
  223. <!--script>
  224. ons.getScriptPage().onInit = function () {
  225. this.querySelector('ons-toolbar div.center').textContent = this.data.title;
  226. var createArtesania = function (Artesania) {
  227. return ons.createElement(`
  228. <ons-list-item expandable tappable>
  229. <div class="center" >${Artesania.name}</div>
  230. <div class="expandable-content"> -Artesanos que trabajan con ${Artesania.name}- <br><br> Luis Lao | Naguabo
  231. <br> <a id='home.html'>Jorge Rivera | Naguabo</a> </div>
  232. </ons-list-item>` );
  233. document.getElementById('artesania-list').appendChild(createArtesania(getArtesania())); };
  234. </script-->
  235. </template>
  236. <template id="ferias.html">
  237. <ons-page id="ferias">
  238. <div id = "caleandar" class = "calendar" style="margin-top: 50px;">
  239. <script type="text/javascript" src="calendar_files/js/caleandar.js"></script>
  240. <script type="text/javascript" src="calendar_files/js/events.js"></script>
  241. </div>
  242. </ons-page>
  243. </template>
  244. <template id="instituto.html">
  245. <ons-page id="instituto">
  246. <p style="text-align: center;">
  247. <h1>Instituto de Cultura Puertorriqueña</h1>
  248. <h3>Ven, descubre lo que nuestra riqueza cultural puertorriqueña tiene para tí.<br> Disfrútala, es tu identidad.
  249. </h3>
  250. <body>
  251. <br>
  252. 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.
  253. <br><br>
  254. 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.
  255. <br><br>
  256. Prof. Carlos R. Ruiz Cortés<br>
  257. Director Ejecutivo<br>
  258. Instituto de Cultura Puertorriqueña<br>
  259. <br><br>
  260. </body>
  261. Visita nuestra <a href="https://www.icp.pr.gov/">Página Web</a> o síguenos en nuestras redes sociales: <br>
  262. <a href="https://twitter.com/icppr"><img src="img/twitter.png" alt="Twitter" style="width:35px;height:35px;border:0;">
  263. </a>
  264. <a href="https://facebook.com/icppr"><img src="img/facebook.png" alt="Facebook" style="width:35px;height:35px;border:0;">
  265. </a>
  266. <a href="https://youtube.com/user/icppr"><img src="img/youtube.png" alt="Youtube" style="width:35px;height:35px;border:0;">
  267. </a>
  268. <a href="https://instagram.com/icppr"><img src="img/instagram.png" alt="Instagram" style="width:35px;height:35px;border:0;">
  269. </a>
  270. </p>
  271. </ons-page>
  272. </template>
  273. <script src="js/load.js"></script>
  274. <script type="text/javascript" src="cordova.js"></script>
  275. <script type="text/javascript" src="js/index.js"></script>
  276. </body>
  277. </html>