123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954 |
- <!DOCTYPE html>
- <!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- -->
- <html>
- <head>
- <!--
- Customize this policy to fit your own app's needs. For more guidance, see:
- https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy
- Some notes:
- * gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
- * https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
- * Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
- * Enable inline JS: add 'unsafe-inline' to default-src
- -->
- <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
- <!--these three for the calendar-->
- <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
- <link href="css/robotocondensed.css" rel="stylesheet">
- <link rel="stylesheet" href="calendar_files/css/demo.css"/>
- <link rel="stylesheet" href="css/file.css"/>
- <link rel="stylesheet" href="calendar_files/css/theme1.css"/>
- <!--this is for the search bar-->
- <link rel = "stylesheet" href = "css/searchbar1.css">
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
- <meta name="format-detection" content="telephone=no">
- <meta name="msapplication-tap-highlight" content="no">
- <meta charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="css/index.css">
- <link rel="stylesheet" href="lib/OnsenUI/css/onsenui.css">
- <link rel="stylesheet" href="lib/OnsenUI/css/onsen-css-components.min.css">
- <script src="lib/OnsenUI/js/onsenui.min.js"></script>
- <script src="js/jquery_.js"></script>
- <script type="text/javascript" src="js/saveLocal.js"></script>
-
-
- </head>
- <body>
-
- <script>
-
-
-
- </script>
-
- <!--the toolbar is where it will have the main name of the app and the ICP logo (top center)-->
- <ons-page>
- <ons-toolbar>
- <div class="center">ArtesaníasICP</div>
- <div class="right"><img class="list-item__thumbnail" src="img/ICP.png"></div>
- </ons-toolbar>
- <!--The tabbar is the place where the user can get acces to the different sections of the app-->
- <!--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-->
- <ons-tabbar swipeable position="bottom" modifier="autogrow">
- <ons-tab page="home.html" label="Hogar" icon = "md-home" active></ons-tab>
- <ons-tab page="renglones.html" label="Artesanías" icon = "fa-paint-brush"></ons-tab>
- <ons-tab page ="search.html" label="Buscar" icon = "fa-search"> </ons-tab>
- <ons-tab page ="ferias.html" label="Eventos" icon = "fa-calendar-alt"> </ons-tab>
- <ons-tab page="colaboradores.html" label="Colab" icon = "fa-users"></ons-tab>
- </ons-tabbar>
- </ons-page>
-
-
- <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- <template id="home.html">
-
- <ons-page id="home" class="red">
-
- <ons-card id="azar"><!--style="height: 100%"-->
-
- <!--<div class="title" id="Title"></div>-->
- <div id="image" style= "max-height:450px"></div><br>
- <div class="content" id="Content"></div>
- <!--This javascript will randomly choose an image and information of a certain type of artesania used by a certain artists-->
- <!--For now all this information is stored inside a .csv file-->
- <script type="text/javascript" src="js/azar.js"> </script>
-
- </ons-card>
-
-
- </ons-page>
-
- </template>
-
- <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
- <!-- 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
- -->
- <template id="artesanos.html">
- <ons-page id="artesanos">
- <!-- This button lets the user go back to the previous page of the artesanias tab-->
- <ons-toolbar>
- <div class="left"><ons-back-button>Atrás</ons-back-button></div>
- <div class="center"></div>
- </ons-toolbar>
-
- <!--Not sure what this does....-->
- <!-- when you pull down and are already at the top of the artesanos list then you see that fa-arrow-down on the top-->
- <ons-pull-hook id="pull-hook" threshold-height="120px">
- <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
- </ons-pull-hook>
-
- <!--This is where it will make the list, so the function that puts the artists here should reference this -->
- <ons-list id="artesanos-list" src="">
- <ons-list-header>Artesanos</ons-list-header>
- </ons-list>
-
- <script>
-
- ons.getScriptPage().onInit = function () {
- //not sure what this does, because I dont really know what this.data.title have inside
- //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
- this.querySelector('ons-toolbar div.center').textContent = this.data.title;
-
-
- //var File = this.data.title.toUpperCase() + '.json' ;
- //seperates all different types of especificaciones
- var Esp = this.data.esp.split(', ');
- //Puts the json file of all the artesanos into this variable
- var artesanos_json = this.data.json;
-
- //Turns the first character into an upper case
- //Convertir en mayuscula primera letra del string.
- for(var i=0; i<Esp.length; i++) {
- Esp[i] = Esp[i].charAt(0).toUpperCase() + Esp[i].slice(1);
- };
-
- //This is what happens when you scroll the list of names down when its already at the top
- //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
- //or if their finger goes back down.
- var pullHook = document.getElementById('pull-hook');
- var icon = document.getElementById('pull-hook-icon');
- pullHook.addEventListener('changestate', function (event) {
- switch (event.state) {
- case 'initial':
- icon.setAttribute('icon', 'fa-arrow-down');
- icon.removeAttribute('rotate');
- icon.removeAttribute('spin');
- break;
- case 'preaction':
- icon.setAttribute('icon', 'fa-arrow-down');
- icon.setAttribute('rotate', '180');
- icon.removeAttribute('spin');
- break;
- case 'action':
- icon.setAttribute('icon', 'fa-spinner');
- icon.removeAttribute('rotate');
- icon.setAttribute('spin', true);
- break;
- }
- });
-
- //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
- //Then it finds and copies all the information of the artists that work on that type of artesania
- //It ends up returning the especificacion in 'name' and retuns all the names and municipios of the artists that it found in 'artesan'
- var getArtesania = function (num) {
- //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
- var Artesanos = ``;
-
- console.log('Filtrado de ',Esp[num])
-
- //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.
- //I dont think its using 'searchVal' for anything....
- var results = [];
- var searchVal = "my Name";
- for (var i=0 ; i < artesanos_json.length ; i++)
- {
- if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
- results.push(artesanos_json[i]);
- }
- }
-
- /*var arr1=artesanos_json.filter(function(item){
- return item.Nombre=="Ana";
- });*/
- //After going through the whole json file
- //It adds the names and municipios of the ones found and later stored in 'results' to the 'Artesanos' variable
- for(var i=0; i<results.length; i++) {
-
- //if(Esp[num] in artesanos_json.) {}
- Artesanos=Artesanos+`<a id='home.html'>${results[i].Nombre} | ${results[i].Municipio}<br>`
- //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
- }
-
-
- return {
- name: Esp[num],
- artesan: Artesanos
- };
- };
-
- //Then this function returns the name of the Especificacion that was searched in 'name'
- //And it also returns all the names and municipios of the artesanos that work with that especificacion
- var getData = function () {
- const data = [];
- for (var i = 0; i < Esp.length; i++) {
- data.push(getArtesania(i));
- }
- return data;
- };
-
- //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
- //This will create a new tab with the information of the arteanos?
- var createArtesano = function (Artesano) {
-
- return ons.createElement(`
- <ons-list-item expandable tappable>
- <div class="center" >${Artesano.Nombre}</div>
- <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
- Tel\u00e9fono: ${Artesano["Telefono 1"]}<br>
- Correo Electr\u00f3nico: ${Artesano["Email"]}<br>
- </div>
- </ons-list-item>`
- );
- };
-
- //var Artesanias = getData();
- //artesanos_json
-
- for (Artesano of artesanos_json) {
-
- var cont = 0;
- var lista = document.getElementById('artesanos-list');
-
- //Recopilar datos no vacios.
- //Counts all the tyoes of data that the artists don't have
- //Later on, if you discover that they didn't have 'municipios', telephone numbers, emails and especificaciones then you wont display it.
- if (Artesano.Municipio.trim().length != 0) {
- cont ++;
- }
- if (Artesano["Telefono 1"].trim().length != 0) {
- cont ++;
- }
- if (Artesano["Email"].trim().length != 0 & Artesano["Email"].toUpperCase().trim() != "NO TIENE") {
- cont ++;
- }
- if (Artesano.Especificacion.trim().length != 0) {
- cont ++;
- }
-
- Artesano.Nombre = Artesano.Nombre + " " + Artesano["Apellido Paterno"] + " " + Artesano["Apellido Materno"];
-
- //info a pasar
- //'title':'${Artesano.Nombre}','esp': '${info}'
- //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)
- //And puts this into the 'item' variable
- var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre.replace(/"/g, " ")}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["Email"]}', esp: '${Artesano.Especificacion}', red1: '${Artesano["Red Social 1"]}', red2: '${Artesano["Red Social 2"]}', ecom: '${Artesano["E-Commerce 1"]}', tecnicas: '${Artesano["Tecnica"]}' } })" tappable>
- <div class="title">${Artesano.Nombre}</div>
- </ons-list-item>`);
-
- //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')
- //If it found that it has at least one of them then it will include it into the list.
- if(cont == 0){
- //console.log(Artesano.Nombre+' no tiene ningun tipo de informacion.');
- //return ons.createElement(``);
- }
- else {
- lista.appendChild(item);
- }
-
- };
-
- };
- </script>
-
- <style>
- .pull-hook-content {
- color: #333;
- transition: transform .25s ease-in-out;
- }
- </style>
-
- </ons-page>
-
- </template>
-
- <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- <template id="artesanias.html">
- <ons-page id="artesanias">
-
- <ons-toolbar>
- <div class="left"><ons-back-button>Atrás</ons-back-button></div>
- <div class="center"></div>
- </ons-toolbar>
-
- <ons-pull-hook id="pull-hook" threshold-height="120px">
- <ons-icon id="pull-hook-icon" size="22px" class="pull-hook-content" icon="fa-arrow-down"></ons-icon>
- </ons-pull-hook>
-
- <ons-list id="artesania-list" src="">
- <ons-list-header>Artesanias</ons-list-header>
- </ons-list>
-
- <script>
-
- ons.getScriptPage().onInit = function () {
- this.querySelector('ons-toolbar div.center').textContent = this.data.title;
-
- //var File = this.data.title.toUpperCase() + '.json' ;
- var Esp = this.data.esp.split(', ');
- var artesanos_json = this.data.json;
-
- //Convertir en mayuscula primera letra del string.
- for(var i=0; i<Esp.length; i++) {
- Esp[i] = Esp[i].charAt(0).toUpperCase() + Esp[i].slice(1);
- };
-
- var pullHook = document.getElementById('pull-hook');
- var icon = document.getElementById('pull-hook-icon');
- pullHook.addEventListener('changestate', function (event) {
- switch (event.state) {
- case 'initial':
- icon.setAttribute('icon', 'fa-arrow-down');
- icon.removeAttribute('rotate');
- icon.removeAttribute('spin');
- break;
- case 'preaction':
- icon.setAttribute('icon', 'fa-arrow-down');
- icon.setAttribute('rotate', '180');
- icon.removeAttribute('spin');
- break;
- case 'action':
- icon.setAttribute('icon', 'fa-spinner');
- icon.removeAttribute('rotate');
- icon.setAttribute('spin', true);
- break;
- }
- });
-
- var getArtesania = function (num) {
-
- var Artesanos = ``,
- ArtesanosInfo = ``;
-
- //console.log('Filtrado de ',Esp[num])
-
- var results = [];
- var searchVal = "my Name";
- for (var i=0 ; i < artesanos_json.length ; i++)
- {
- if (artesanos_json[i].Especificacion.includes(Esp[num])) {
- results.push(artesanos_json[i]);
- }
- }
-
- /*var arr1=artesanos_json.filter(function(item){
- return item.Nombre=="Ana";
- });*/
-
- for(var i=0; i<results.length; i++) {
-
- //if(Esp[num] in artesanos_json.) {}
- //results[i].Nombre = results[i].Nombre + " " + results[i]["Apellido Paterno"] + " " + results[i]["Apellido Materno"]
- ANombre = results[i].Nombre + " " + results[i]["Apellido Paterno"] + " " + results[i]["Apellido Materno"]
- Artesanos+=`${ANombre}|`
- ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Telefono 1"]}|${results[i]["Email"]}|${results[i].Especificacion}|${results[i]["E-Commerce 1"]}|${results[i]["Red Social 1"]}|${results[i]["Red Social 2"]}|${results[i]["Tecnica"]}&&`
- //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
- }
-
- return {
- name: Esp[num],
- artesan: Artesanos,
- info: ArtesanosInfo
- };
- };
-
- var getData = function () {
- const data = [];
- for (var i = 0; i < Esp.length; i++) {
- data.push(getArtesania(i));
- }
- return data;
- };
- var createArtesania = function (Artesania) {
-
- //console.log('Devuelto elemento')
- var listaArt=``;
- var arts = Artesania.artesan.split('|');
- var artsInfo = Artesania.info.split('&&');
-
- for(var i=0; i<arts.length; i++) {
- var lot = artsInfo[i].split('|'),
- mun = lot[0],
- tel = lot[1],
- email = lot[2],
- esp = lot[3],
- ecom = lot[4],
- red1 = lot[5];
- red2 = lot[6];
- tecnicas = lot[7]
- console.log(lot)
-
- listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i].replace(/"/g, " ")}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', red1: '${red1}', red2: '${red2}', ecom: '${ecom}', tecnicas: '${tecnicas}' }} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
- }
-
- if (Artesania.name == "Figuras y simbolos indigenas") {
- Artesania.name = "Figuras y símbolos indígenas";
- }
-
-
-
- return ons.createElement(`
- <ons-list-item expandable tappable>
- <div class="center" >${Artesania.name}</div>
- <div class="expandable-content">Artesanos que trabajan con ${Artesania.name}
- <ons-card>${listaArt}</ons-card></div>
- </ons-list-item>`
- );
- };
-
- var Artesanias = getData();
-
- for (Art of Artesanias) {
-
- var Artesania = createArtesania(Art);
- document.getElementById('artesania-list').appendChild(Artesania);
- };
- pullHook.onAction = function (done) {
-
- setTimeout(function() {
- document.getElementById('artesania-list').appendChild(createArtesania(getArtesania()));
- done();
- }, 400);
- }
-
- };
- </script>
-
- <style>
- .pull-hook-content {
- color: #333;
- transition: transform .25s ease-in-out;
- }
- </style>
- </ons-page>
- </template>
-
- <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
- <!----------------------------------------------------------------------------------->
- <!--
- The searchfunctions.js file is just a file that has all the definitions of the functions used later on in the switch
- -->
- <script src = "js/searchfunctions.js"></script>
- <script>
- //'all_artesanos' is the variable containing the JSON file that has all the artesanos with their data
-
-
- var all_artesanos = JSON.parse(window.localStorage.getItem('TODOS'));
- function filter(){
- //finds the values of the search bar which are sent from the block of code after this script
- //input is the one you use to filter by any parameter
- //inputarte is the one you use to filter by the type of art the artists make
- //inputmuni is the one you use to filter by municipio
- //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")
- var input = document.getElementById('searchbar').value;
- var inputarte = document.getElementById('searchartesania').value;
- var inputmuni = document.getElementById('searchbarmunicipio').value;
- var x = document.getElementsByClassName('artists');
-
- //validating input so that its not as easy to attack
- //no acepta strings mayores que 40 caracteres y no acepta '>' o '<' en el string
- input = input_validation(input);
- inputarte = input_validation(inputarte);
- inputmuni = input_validation(inputmuni);
- //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)
- //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)
- input = input.trim().toLowerCase();
- inputarte = inputarte.trim().toLowerCase();
- inputmuni = inputmuni.trim().toLowerCase();
- input = acento_replace(input);
- inputarte = acento_replace(inputarte);
- inputmuni = acento_replace(inputmuni);
- //default case is where evey one of them has nothing or less than 3 characters (displays every artist until it passes that length)
- if (input.length <= 3 && inputarte.length <= 3 && inputmuni.length <= 3){
- for (var i = 0; all_artesanos.length; i++){
- x[i].style.display = "list-item";
- }
- }
- else{
- var cases = 0;
- cases = getcasenum(input,inputarte,inputmuni);
- //take every one of them out first (dont display any)
- for (var i = 0; i < all_artesanos.length; i++){
- x[i].style.display = "none";
- }
- switch(cases){
- //cases == 1 when only inputmuni has been writen on
- case 1:
- filter_municipios(inputmuni);
- break;
- //cases == 2 when only inputarte has been written on
- case 2:
- filter_artesanias(inputarte);
- break;
- //cases == 3 when inputarte and inputmuni has been written on
- case 3:
- search_art_mun(inputarte,inputmuni);
- break;
- //cases == 4 when input has been writen on
- case 4:
- filter_any(input);
- break;
- //cases == 5 when input and inputmuni has been written on
- case 5:
- search_any_mun(input,inputmuni);
- break;
- //cases == 6 when input and inputart has been written on
- case 6:
- search_any_art(input,inputarte);
- break;
- //cases == 7 when input, inputart and inputmuni has been writen on
- case 7:
- search_any_art_mun(input,inputarte,inputmuni);
- break;
- }
- }
- }
- </script>
-
- <template id="search.html">
- <ons-navigator swipeable animation="slide" id="SNavigator">
- <ons-page id="Buscar">
- <!--
- 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)
- The first search bar is to find by any information related to the artist
- The second searchbar is to find by the type of artwork they work on
- The third searchbar is to find by the municipio where the artists works or lives
- -->
- <p style="text-align: center; margin-top: 10px;">
- <ons-search-input placeholder="Búsqueda con cualquier término" id = "searchbar"
- onkeyup = "filter()" style = "width: 300px;" ></ons-search-input>
- <ons-search-input placeholder="Búsqueda por artesanias" id = "searchartesania"
- onkeyup = "filter()" style = "width: 300px;"></ons-search-input>
- <ons-search-input placeholder = "Búsqueda por municipio" id = "searchbarmunicipio"
- onkeyup = "filter()" style = "width: 300px;"></ons-search-input>
- </p>
-
- <ons-list id="results" src="">
- </ons-list>
-
- <script>
- //This is basically declaring what we refer to as informacion in the filter() function
- //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.
- for (i = 0; i < all_artesanos.length;i++){
- all_artesanos[i].Nombre = all_artesanos[i].Nombre + " " + all_artesanos[i]["Apellido Paterno"] + " " + all_artesanos[i]["Apellido Materno"];
- var artesano = ons.createElement(`<ons-list-item class = "artists"
- onclick="SNavigator.pushPage('artesano_s.html', { data: {title: '${all_artesanos[i].Nombre.replace(/"/g, " ")}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["Email"]}', esp: '${all_artesanos[i].Especificacion}', red1: '${all_artesanos[i]["Red Social 1"]}', red2: '${all_artesanos[i]["Red Social 2"]}', ecom: '${all_artesanos[i]["E-Commerce 1"]}', tecnicas: '${all_artesanos[i]["Tecnica"]}' } })" tappable>
- <div>${all_artesanos[i].Nombre}</div>
- </ons-list-item>`);
- document.getElementById('results').appendChild(artesano);
- }
- </script>
-
- </ons-page>
- </ons-navigator>
- </template>
-
- <!-- ---------------------------------------------------------------------------------------------------------------------------------------- -->
- <!--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-->
- <template id= "artesano.html">
- <ons-page id = "artesano">
- <ons-toolbar>
- <!-- Pretty self explanatory, its a button that goes back to the previous page -->
- <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
- <div class = "center"></div>
- </ons-toolbar>
- <body>
- <font size="+1">
- <!-- This is where we'll put all the information of that artsts -->
- <ons-card id="all"></ons-card>
- </font>
- </body>
- <script>
- //when it opens this page this function starts to run, it first recieves the information that was sent to "artesano.html"
- ons.getScriptPage().onInit = function () {
- this.querySelector('ons-toolbar div.center').textContent = this.data.title;
-
- var data = '',
- mun = this.data.mun,
- tel = this.data.tel,
- em = this.data.email,
- esp = this.data.esp,
- red1 = this.data.red1,
- red2 = this.data.red2,
- ecom = this.data.ecom,
- tecnicas = this.data.tecnicas;
-
-
-
- //here the email is the string made from the start to where the '#' is.
-
-
- //Here it's dividing all the especificaciones and writing them into the page (data) and then goes to the next line
- //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
- //but if theres only one then you just write it into the page
- if(esp.trim() != ""){
-
- //Fixes phrase error in json
- if(esp.includes("Figuras y simbolos indigenas")) {
- esp = esp.replace("Figuras y simbolos indigenas", "Figuras y símbolos indígenas")
- }
-
- if(esp.includes(";", 0)){
- esp=esp.replace(/;/g,", ");
- data+='Tipos de artesanías: '+esp+'<br>';
- }
- else {
- data+='Tipo de artesanía: '+esp+'<br>';
- }
- }
-
- if(tecnicas.trim() != ''){
- if(tecnicas.includes(";", 0)){
- tecnicas = tecnicas.replace(/;/g,", ");
- data+='Técnicas que usan: '+tecnicas+'<br>';
- }
- else {
- data+='Técnicas que usan: '+tecnicas+'<br>';
- }
- }
- //console.log("Las redes son..."+this.data.redes);
- //Here it's making sure theres something in municipio and writing their municipio into the page
- if(mun.trim() != ""){
- data+='Municipio: '+ mun +'<br>';
- }
-
- //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
- //Whenever the variable is empty or if it has "NO TIENE" then it doesnt write anything
- if(em.trim() != "" & em.toUpperCase().trim() != "NO TIENE"){
- data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+em+'"><u>'+em+'</u></a><br>';
- }
-
- //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
- if(tel.trim() != "" ){
- data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
- }
-
-
-
- //Here it has to decide what to do depending on the links they give to their social media pages
- //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.
-
-
- //If it's none of them then it will not display anything
- //First Social Media
- if(red1.includes("facebook")){
- data+='<a style="margin-right:10px;" href="'+ red1 + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;">';
- }
- else if(red1.includes("instagram")){
- data+='<a style="margin-right:10px;" href="'+ red1 + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;">';
- }
- else if(red1.includes("myspace")){
- data+='<a style="margin-right:10px;" href="'+ red1 + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;">';
- }
-
- //Second Social Media
- if(red2.includes("facebook")){
- data+='<a style="margin-right:10px;" href="'+ red2 + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;">';
- }
- else if(red2.includes("instagram")){
- data+='<a style="margin-right:10px;" href="'+ red2 + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;">';
- }
- else if(red2.includes("myspace")){
- data+='<a style="margin-right:10px;" href="'+ red2 + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;">';
- }
-
- //E-commerce
- if ((ecom.includes(".org") || ecom.includes(".com")) && !ecom.includes("mailto")){
- ecom = ecom.substr(ecom.indexOf("#")+1,ecom.length);
- ecom = ecom.substr(0, ecom.length-1);
-
- data+='<a href="'+ ecom + '"><img src="img/internet.jpg" style="width:35px;height:35px;border:0;">';
- }
-
-
- //This is the part that allows eveything (data) to be displayed
- document.getElementById("all").innerHTML = `${data}`;
-
- }
- </script>
- </ons-page>
- </template>
-
- <template id= "artesano_s.html">
- <ons-page id = "artesano_s">
- <ons-toolbar>
- <!-- Pretty self explanatory, its a button that goes back to the previous page -->
- <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
- <div class = "center"></div>
- </ons-toolbar>
- <body>
- <!-- This is where we'll put all the information of that artsts -->
- <font size="+1">
- <ons-card id="all2"></ons-card>
- </font>
- </body>
- <script>
- //when it opens this page this function starts to run, it first recieves the information that was sent to "artesano.html"
- ons.getScriptPage().onInit = function () {
- this.querySelector('ons-toolbar div.center').textContent = this.data.title;
-
- var data = '',
- mun = this.data.mun,
- tel = this.data.tel,
- em = this.data.email,
- esp = this.data.esp,
- red1 = this.data.red1,
- red2 = this.data.red2,
- ecom = this.data.ecom,
- tecnicas = this.data.tecnicas;
-
- //here the email is the string made from the start to where the '#' is.
-
-
- //Here it's dividing all the especificaciones and writing them into the page (data) and then goes to the next line
- //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
- //but if theres only one then you just write it into the page
- if(esp.trim() != ""){
-
- if(esp.includes("Figuras y simbolos indigenas")) {
- esp = esp.replace("Figuras y simbolos indigenas", "Figuras y símbolos indígenas")
- }
-
- if(esp.includes(";", 0)){
- esp=esp.replace(/;/g,", ");
- data+='Tipos de artesanías: '+esp+'<br>';
- }
- else {
- data+='Tipo de artesanía: '+esp+'<br>';
- }
- }
-
- if(tecnicas.trim() != ''){
- if(tecnicas.includes(";", 0)){
- tecnicas = tecnicas.replace(/;/g,", ");
- data+='Técnicas que usan: '+tecnicas+'<br>';
- }
- else {
- data+='Técnicas que usan: '+tecnicas+'<br>';
- }
- }
- //console.log("Las redes son..."+this.data.redes);
- //Here it's making sure theres something in municipio and writing their municipio into the page
- if(mun.trim() != ""){
- data+='Municipio: '+ mun +'<br>';
- }
-
- //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
- //Whenever the variable is empty or if it has "NO TIENE" then it doesnt write anything
- if(em.trim() != "" & em.toUpperCase().trim() != "NO TIENE"){
- data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+em+'"><u>'+em+'</u></a><br>';
- }
-
- //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
- if(tel.trim() != "" ){
- data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
- }
-
-
-
- //Here it has to decide what to do depending on the links they give to their social media pages
- //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.
- //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
- //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.
- //If it's none of them then it will not display anything
- if(red1.includes("facebook")){
- data+='<a style="margin-right:10px;" href="'+ red1 + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;">';
- }
- else if(red1.includes("instagram")){
- data+='<a style="margin-right:10px;" href="'+ red1 + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;">';
- }
- else if(red1.includes("myspace")){
- data+='<a style="margin-right:10px;" href="'+ red1 + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;">';
- }
-
- //Second Social Media
- if(red2.includes("facebook")){
- data+='<a style="margin-right:10px;" href="'+ red2 + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;">';
- }
- else if(red2.includes("instagram")){
- data+='<a style="margin-right:10px;" href="'+ red2 + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;">';
- }
- else if(red2.includes("myspace")){
- data+='<a style="margin-right:10px;" href="'+ red2 + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;">';
- }
-
-
- if((ecom.includes(".org") || ecom.includes(".com")) && !ecom.includes("mailto")){
- ecom = ecom.substr(ecom.indexOf("#")+1,ecom.length);
- ecom = ecom.substr(0, ecom.length-1);
-
- data+='<a href="'+ ecom + '"><img src="img/internet.jpg" style="width:35px;height:35px;border:0;">';
- }
-
-
- //This is the part that allows eveything (data) to be displayed
- document.getElementById("all2").innerHTML = `${data}`;
-
- }
- </script>
- </ons-page>
- </template>
- <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- <template id="renglones.html">
- <ons-navigator swipeable animation="slide" id="myNavigator">
- <ons-page id="renglones">
-
- <ons-card id="list">
- <script type="text/javascript" src="js/renglones.js"></script>
- </ons-card>
-
- <!--Javascript function to hide other open expandables-->
- <script>
- const hideAll = () => {
- Array.from(document.querySelector('#list').children)
- .forEach(item => {
- if (item.expanded) {
- item.hideExpansion();
- }
- });
- };
- </script>
-
- <style>
- .intro {
- text-align: center;
- padding: 20px;
- margin-top: 30px;
- }
-
- ons-card {
- cursor: pointer;
- color: #333;
- }
-
- .card__title,
- .card--material__title {
- font-size: 15px;
- }
- </style>
- </ons-page>
- </ons-navigator>
-
- </template>
-
- <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- <template id="ferias.html">
- <ons-page id="ferias">
-
- <ons-card>
- <div id="logo" style="text-align: center">
- <img src="img/culturalpr1800x3200-2-01.png" style="width:150px;height:100px">
- </div>
- <br><br>
- <div id="button" style="text-align: center">
- <ons-button onclick="redirect()" modifier="large" style="background-color: #00abc1;"> Pasar a la página de eventos </ons-button>
- </div>
- <br><br>
- <div id="Mensaje">
- El Instituto de Cultura Puertorriqueña, el Gobierno de Puerto Rico, los Colaboradores de esta aplicación, así como los funcionarios, empleados y contratistas de los anteriores, no se hacen responsables de los mensajes, imágenes, opiniones, servicios, declaraciones, representaciones o cualquier forma de contenido incluido en cualquiera de los enlaces accesibles, vinculados o referidos a través de ArtesaníasICP.
- </div>
- </ons-card>
-
- <script>
- function redirect() {
- location.replace("https://facebook.com/icppr")
- }
- </script>
- </ons-page>
- </template>
-
- <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- <template id="colaboradores.html">
- <ons-page id="colaboradores">
- <ons-card>
-
- <h1>Colaboradores</h1>
-
- <style>
- .column {
- float: left;
- width: 50%;
- }
- .row {
- width: 100%;
- }
- </style>
- <h2>SINFINESPR</h2>
- <div class = "column">
- SINFINESPR es un programa de Titín Foundation que responde a nuestro interés y compromiso con el fortalecimiento del tercer sector.
- <br><br>
- 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.
- <br><br>
- Saludos Cordiales,
- Aziria
- </div>
- <div class = "column">
- <img src="img/sfpr.svg" style="width:150px;height:100px">
- </div>
- <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
- Visita nuesta Página Web o siguenos en nuestras redes sociales <br> <br>
- <a href="https://twitter.com/SINFINESPR"><img src="img/twitter.png" alt="Twitter" style="width:35px;height:35px;border:0;">
- </a>
- <a href="https://www.facebook.com/sinfinespr"><img src="img/facebook.png" alt="Facebook" style="width:35px;height:35px;border:0;">
- </a>
- <a href="https://www.linkedin.com/company/sinfinespr/"><img src="img/linkedin.png" alt="Linkedin" style="width:35px;height:35px;border:0;">
- </a>
- <a href="https://www.instagram.com/sinfinespr/"><img src="img/instagram.png" alt="Instagram" style="width:35px;height:35px;border:0;">
- </a>
- <br><br>
- <h2>Centro de Desarrollo y Consultoría Computacional</h2>
- 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.
- <br><br>
-
- <img src="img/logo_cdcc.png" style="width: 150px; height: 100px">
-
- <br><br>
- Si tiene alguna duda nos puede contactar por:
- <br>
- Teléfono: 787-764-0000 Ext. 88341, 88349
- <br>
- o
- <br>
- Correo electrónico: <a href = "mailto:carlos.corrada2@upr.edu" style ="color:#0000EE;text-decoration: underline;">carlos.corrada2@upr.edu</a>
-
- </ons-card>
- </ons-page>
- </template>
- <script src="js/load.js"></script>
-
-
- <script type="text/javascript" src="cordova.js"></script>
- <script type="text/javascript" src="js/index.js"></script>
- </body>
- </html>
|