PageSourceSearch

https://inegi.org.mx/componentes/productos/js/buscadorPublicaciones_core.min.js?v=2.0.0

js inegi.org.mx collected 2026-09-24 09:08:37 UTC 12,371 bytes, 31 lines download raw bytes

1/**
2 * @fileOverview Contiene la declaración de variables y funciones necesarías para el funcionamiento del componente "Publicaciones".
3 * 
4 * @author Luis Gerardo Barba Ortega
5 * 
6 * @license
7 * MIT License
8 * Copyright (c) 2017 Instituto Nacional de Estadística y Geografía, INEGI
9 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 * 
13 * @version 1.5.0
14 * 
15 * @description
16 * Librería que contiene la funcionalidad para la construcción y el manejo de la información de la "Biblioteca Digital - Publicaciones" a través de un componente genérico. <br/><br/>
17 * 
18 * Notas de versión <br/>
19 * 1.5.0 <span style="margin-left:5px;">- Se cambiaron las rutas de consulta al API.</span><br/>
20 * 1.4.0 <span style="margin-left:5px;">- Se agregaron tooltips a los botones del buscador.</span><br/>
21 *      <span style="margin-left:40px;">- Se modifico ruta para consulta de API.</span><br/>
22 * 1.1.3 <span style="margin-left:5px;">- Se corrigío comportamiento de los tooltips.</span><br/>
23 * 1.1.2 <span style="margin-left:5px;">- Se corrigío comportamiento de imagen de carga.</span><br/>
24 * 1.1.1 <span style="margin-left:5px;">- Se corrigío la palabra "Title" en idioma ingles.</span><br/>
25 * 1.1.0 <span style="margin-left:5px;">- Se agregó versión en ingles.</span><br/>
26 * 1.0.0 <span style="margin-left:5px;">- Liberación de la libreria de funciones</span>
27 * 
28 * @requires JQuery 1.11.X => 3.X.X
29 * @requires INEGI - Contenidos
30 */
31(function(n,t){function g(){if(document.getElementById("slpComponenteCSS")==t){var n=i("link",[{atr:"id",val:"slpComponenteCSS"},{atr:"rel",val:"stylesheet"},{atr:"href",val:"/componentes/productos/estilos/buscadorPublicaciones.min.css?v=1.2.0"},]);document.head.appendChild(n)}}function nt(){var t=document.getElementById(f),d=i("div",[{atr:"id",val:"slpNoPubEnt"},{atr:"style",val:"width:98%; margin:0 10px 10px; display:none;"},],r?"No found publications for this municipality, so these ones are corresponding to the entity.":"No se encontraron publicaciones para este municipio, por lo que se muestran las correspondientes a la entidad."),s,p,k;t.appendChild(d);var a=i("div",[{atr:"style",val:"width:98%; margin:0 10px;"}]),u=i("div",[{atr:"class",val:"row"}]),v=i("div",[{atr:"class",val:"col-xs-12"}]),e=i("div",[{atr:"id",val:"slpBtnSearchTema"},{atr:"class",val:"input-group"},{atr:"style",val:"margin:5px 0 0;"},]),g=i("input",[{atr:"id",val:"slpTxtBuscador"},{atr:"type",val:"text"},{atr:"class",val:"form-control"},{atr:"onkeyup",val:'listadoFP.validaTecla(event, "slpTxtBuscador", "slpRemoveTxtBusca");'},{atr:"placeholder",val:r?"Search publications":"Buscar publicaciones"},{atr:"aria-label",val:r?"Search publications":"Buscar publicaciones"},{atr:"tabIndex",val:3700}]),o=i("span",[{atr:"class",val:"input-group-btn menubuttons"}]),y=i("button",[{atr:"id",val:"slpRemoveTxtBusca"},{atr:"type",val:"button"},{atr:"class",val:"btn btn-default"},{atr:"onclick",val:"listadoFP.QuitaBusqueda();"},{atr:"data-toggle",val:"tooltip"},{atr:"data-placement",val:"bottom"},{atr:"data-original-title",val:r?"Delete search":"Eliminar búsqueda"},{atr:"aria-label",val:r?"Delete search":"Eliminar búsqueda"},{atr:"style",val:"display:none;"},{atr:"tabindex",val:3703}]),nt=i("span",[{atr:"class",val:"glyphicon glyphicon-remove"},{atr:"aria-hidden",val:"true"}]);y.appendChild(nt);o.appendChild(y);s=i("button",[{atr:"type",val:"button"},{atr:"class",val:"btn btn-default"},{atr:"onclick",val:"listadoFP.Buscar();"},{atr:"data-toggle",val:"tooltip"},{atr:"data-placement",val:"bottom"},{atr:"data-original-title",val:r?"Search":"Buscar"},{atr:"aria-label",val:r?"Search":"Buscar"},{atr:"tabindex",val:3704},]);p=i("span",[{atr:"class",val:"glyphicon glyphicon-search"},{atr:"aria-hidden",val:"true"}]);s.appendChild(p);o.appendChild(s);e.appendChild(g);e.appendChild(o);v.appendChild(e);var n=i("div",[{atr:"class",val:"col-xs-12"},{atr:"style",val:"margin:10px 0;"},]),h=i("label",[{atr:"class",val:"radio-inline"},],r?"&nbsp;Complete phrase":"&nbsp;Frase completa"),tt=i("input",[{atr:"id",val:"slptipoRadio1"},{atr:"type",val:"radio"},{atr:"name",val:"tipoBusqueda"},{atr:"onclick",val:"listadoFP.CambiaBusqueda(1);"},{atr:"tabindex",val:3702}]),c=i("label",[{atr:"class",val:"radio-inline"},],r?"&nbsp;Any word":"&nbsp;Cualquier palabra"),it=i("input",[{atr:"id",val:"slptipoRadio2"},{atr:"type",val:"radio"},{atr:"name",val:"tipoBusqueda"},{atr:"onclick",val:"listadoFP.CambiaBusqueda(2);"},{atr:"tabindex",val:3701}]);h.insertBefore(tt,h.firstChild);c.insertBefore(it,c.firstChild);n.appendChild(c);n.appendChild(h);var l=i("div",[{atr:"style",val:"float:right;"},{atr:"tabindex",val:3705}]),rt=i("span",[{atr:"style",val:"margin:10px 5px;"}],r?"Results found:":"Resultados encontrados:"),ut=i("span",[{atr:"id",val:"slpTotalRes"},{atr:"class",val:"badge"}]);l.appendChild(rt);l.appendChild(ut);n.appendChild(l);u.appendChild(v);u.appendChild(n);a.appendChild(u);t.appendChild(a);divSubConte=i("div",null);var w=i("div",[{atr:"id",val:"slpFondoCarga-"+f},{atr:"class",val:"slpFondoCarga"},{atr:"style",val:"display:none;"}]),b=i("span",[{atr:"style",val:"position:relative;"}]),ft=i("img",[{atr:"src",val:"/img/cargando.gif"},{atr:"style",val:"width:1em;"}]);b.appendChild(ft);w.appendChild(b);divSubConte.appendChild(w);k=i("table",[{atr:"id",val:"tblRes_"+f},{atr:"class",val:"table table-responsive slpTable"},{atr:"aria-label",val:r?"Results table":"Tabla de resultados"},]);divSubConte.appendChild(k);t.appendChild(divSubConte);setTimeout(function(){ot("#"+f+' * [data-toggle="tooltip"]')},2e3)}function tt(n){f=n.contenedor;e=n.clave;var i=window.location;i.host.match(/en.\w+[inegi.org.mx]+/gi)&&(r=!0);n.fuentePro!=t&&n.fuentePro&&(u=1);n.porTema!=t&&n.porTema&&(u=2);n.ag!=t&&(regex=/\d{1,9}/g,regex.test(n.ag)&&(e=n.ag,u=3));n.top!=t&&(b=n.top);g();document.getElementById(f).innerHTML="";document.getElementById(f).innerHTML==""&&(nt(),document.getElementById("slptipoRadio2").click(),$("#"+f).css("padding-bottom","15px"),a=!0);document.getElementById("slpTxtBuscador").focus();k();$.ajax({method:"post",dataType:"json",url:v+"lista/resultados/",contentType:"application/json",data:JSON.stringify({clave:e,buscar:o,tipoB:l,opt:u})}).done(function(n){if(!n.success)if(u==3&&e.toString().length>2)e=e.toString().substring(0,2),it();else return h(n,u,!1),!1;y(n.list);document.getElementById("slpNoPubEnt").style.display="none"}).fail(function(n){h(n,u,!1)}).always(function(){w()})}function it(){$.ajax({method:"post",dataType:"json",url:v+"lista/resultados/",contentType:"application/json",data:JSON.stringify({clave:e,buscar:o,tipoB:l,opt:u})}).done(function(n){if(!n.success)return h(n,u,!1),!1;y(n.list);document.getElementById("slpNoPubEnt").style.display="block"}).fail(function(n){h(n,u,!0)}).always(function(){w()})}function y(n){var u,t,r,o,e;for(c=3710,u=document.getElementById("tblRes_"+f),u.innerHTML="",t=i("tbody",null),t.appendChild(rt()),r=0,o=n.length;r<o;r++)t.appendChild(ut(n[r]));e=n[0].total;document.getElementById("slpTotalRes").innerHTML=e;b&&e>10&&t.appendChild(ft());u.appendChild(t);a?a=!1:document.getElementById("slpTotalRes").parentElement.focus()}function rt(){var n=i("tr",[{atr:"class",val:"slpRowTitulo"},{atr:"style",val:"background:#ddd"}]),t=i("th",[{atr:"colspan",val:"2"},{atr:"style",val:"width:75%; text-align:center;"}],r?"Title":"Título"),u=i("th",[{atr:"style",val:"text-align:center;"}],r?"Edition":"Edición");return n.appendChild(t),n.appendChild(u),n}function ut(n){var t=i("tr",null),u=i("td",null),f=i("div",[{atr:"class",val:"slpDivPortada"}]),e=i("a",[{atr:"href",val:n.url.replace("ficha.html","ficha.html")},{atr:"target",val:"_blank"},]),a=i("img",[{atr:"class",val:"slpImgPortada"},{atr:"src",val:n.absoluto+n.imagen},{atr:"alt",val:r?"Front: "+(r&&!s(n.nombre_ing))?n.nombre_ing:n.nombre:"Portada: "+n.nombre}]),l;e.appendChild(a);f.appendChild(e);u.appendChild(f);var o=i("td",[{atr:"class",val:"notranslate"}]),h=i("div",[{atr:"class",val:"slpDivTitulo"}]),v=i("a",[{atr:"href",val:n.url.replace("ficha.html","ficha.html")},{atr:"target",val:"_blank"},{atr:"role",val:"button"},{atr:"aria-label",val:r?"Publication: "+(s(n.nombre_ing)?n.nombre:n.nombre_ing)+", Edition: "+n.edicion:"Publicación: "+n.nombre+", Edición: "+n.edicion},{atr:"tabindex",val:c},],r&&!s(n.nombre_ing)?n.nombre_ing:n.nombre);return c++,h.appendChild(v),o.appendChild(h),l=i("td",[{atr:"class",val:"slpDivEdicion"}],!s(n.edicion)&&n.edicion!=0?n.edicion:""),t.appendChild(u),t.appendChild(o),t.appendChild(l),t}function ft(){var t=i("tr",null),h=i("td",null),l=i("td",null),f=i("td",null),o=i("div",[{atr:"class",val:"slpDivMas"}]),n="?p=",s;return n=u==2?"?t=":n,n=u==3?"?ag=":n,s=i("a",[{atr:"href",val:"/app/publicaciones/"+n+e},{atr:"target",val:"_blank"},{atr:"role",val:"button"},{atr:"aria-label",val:r?"See more related publications from app.":"Ver más publicaciones relacionadas desde la aplicación."},{atr:"tabindex",val:c}],r?"See more":"Ver más"),c++,o.appendChild(s),f.appendChild(o),t.appendChild(h),t.appendChild(l),t.appendChild(f),t}function p(){k();$.ajax({method:"post",dataType:"json",url:v+"lista/resultados/",contentType:"application/json",data:JSON.stringify({clave:e,buscar:o,tipoB:l,opt:u})}).done(function(n){if(!n.success)return h(n,u,!1),!1;y(n.list)}).fail(function(n){h(n,u,!0)}).always(function(){w()})}function s(n){return answer=n===""||n===null||n===t||n==="null"?!0:!1}function i(n,i,r){var f,u,e;try{if(f=document.createElement(n),r!=t&&(f.innerHTML=r),i instanceof Array)for(u=0,e=i.length;u<e;u++)f.setAttribute(i[u].atr,i[u].val)}catch(o){console.log("Se detuvo");console.log(o)}return f}function w(){var n="#slpFondoCarga-"+f,i="#tblRes_"+f,t=$(n).parent();t.css("margin-bottom")!=="0px"&&t.css("margin-bottom","0px");$(n).css("display","none");$(i).css("display","")}function et(n,t){return n=n.replace(/["']/gi,""),t.value=n,n}function k(){var n="#slpFondoCarga-"+f,i="#tblRes_"+f,t=$(n).parent();$(n).css("width",t.width());$(n).css("height",t.height());a?t.css("margin-bottom","35px"):$(n).find("span").css("top","45%");$(n).css("display","block");$(i).css("display","none")}function d(n){return typeof n=="string"?n.replace(/^\s+|\s+$/gm,""):n}function ot(n){$(n).tooltip();$(n).on("show.bs.tooltip",function(n){"ontouchstart"in document.documentElement&&n.preventDefault()})}function h(){var n=r?"&nbsp;No results for your search.":"&nbsp;No se han encontrado resultados para tu búsqueda.";document.getElementById("slpTotalRes").innerHTML="0";document.getElementById("tblRes_"+f).innerHTML=n}if(1)var v="/app/api/productos/interna_v2/componente/publicaciones/",e="",u=1,b=!0,o="",l=1,r=!1,f="",a=!0,c=3710;n.Componentes=function(n){tt(n)};n.Buscar=function(){var n=document.getElementById("slpTxtBuscador");
31s(d(n.value))||(o=d(et(n.value,n)),n.value=o,$("#slpRemoveTxtBusca").css("display","inline-block"),p())};n.QuitaBusqueda=function(){document.getElementById("slpTxtBuscador").value="";$("#slpRemoveTxtBusca").css("display","none");o="";p()};n.CambiaBusqueda=function(n){l=n};n.validaTecla=function(t,i,r){var f=document.getElementById(i),u=document.getElementById(r),e=document.all?t.keyCode:t.which;e==13?i=="slpTxtBuscador"&&n.Buscar():(u.style.display!="none"||s(f.value)||(u.style.display="inline-block"),u.style.display!="none"&&s(f.value)&&(u.style.display="none",s(o)||(o="",p())))}})(window.listadoFP=window.listadoFP||{});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.