1document.addEventListener("DOMContentLoaded", function (event) { 2 /*** Limpa os filtros selecionados *****/ 3// let filtrosForm = document.querySelector("#filtros-limpar"); 4 let filtrosMobo = document.querySelector("#filtros-mobo-limpar"); 5 let btgetterm = document.querySelectorAll(".get_tax"); 6 let mobobtgetterm = document.querySelectorAll(".accordion-button"); 7 8 for (let i = 0; i < mobobtgetterm.length; i++) { 9 mobobtgetterm[i].addEventListener("click", function () { 10 //console.log('clicou!' + i) 11 document.getElementById("filtros-form").reset(); 12 //btgetterm[i].classList.toggle("red"); 13 }); 14 } 15 16 for (let i = 0; i < btgetterm.length; i++) { 17 btgetterm[i].addEventListener("click", function () { 18 //console.log('clicou!' + i) 19 document.getElementById("filtros-form").reset(); 20 //btgetterm[i].classList.toggle("red"); 21 }); 22 } 23 24 filtrosForm.addEventListener("click", function (e) { 25 e.preventDefault(); 26 document.getElementById("filtros-form").reset(); 27 }); 28 29 filtrosMobo.addEventListener("click", function (e) { 30 e.preventDefault(); 31 document.getElementById("filtros-form").reset(); 32 }); 33 34 /* 35 filtrosForm.addEventListener("click", function (e) { 36 e.preventDefault(); 37 document.getElementById("filtros-form").reset(); 38 });*/ 39}); 40 41function fetchFilter() { 42 var taxonomia = ""; 43 let aterm = []; 44 45 jQuery("#datafetch").hide(500); 46 jQuery("#datafetch").empty(); 47 48 jQuery(".accordion-button").each(function () { 49 if (jQuery(this).attr("aria-expanded") == "true") { 50 taxonomia = jQuery(this).attr("id"); 51 } 52 }); 53 54 jQuery(".get_tax").each(function () { 55 if (jQuery(this).attr("aria-expanded") == "true") { 56 taxonomia = jQuery(this).attr("id"); 57 } 58 }); 59 60 jQuery(".get_tax").each(function () { 61 if (jQuery(this).hasClass('collapsed') == "false") { 62 console.log(jQuery(this).attr("id")); 63 taxonomia = jQuery(this).attr("id"); 64 } 65 }); 66 67 //jQuery('.get_formato').each(function(){ 68 jQuery(".get_term").each(function () { 69 if (jQuery(this).is(":checked")) { 70 aterm.push(jQuery(this).val()); 71 } 72 }); 73 74 //console.log (aterm); 75 76 if (aterm.length !== 0) { 77 jQuery("#firstrow").hide("slow"); 78 jQuery("#secondrow").hide("slow"); 79 80 jQuery.post( 81 "/wp-admin/admin-ajax.php", 82 { action: "get_filters", taxonomia: taxonomia, aterm: aterm }, 83 function (resposta) { 84 jQuery("#datafetch").append(resposta); 85 jQuery("#datafetch").show("slow"); 86 } 87 ); 88 89 aterm = aterm.join(","); 90 91 var arrStr = encodeURIComponent(aterm); 92 93 let _href = jQuery("#insightlink").attr("href"); 94 95 if (_href.indexOf("?") != -1) { 96 let pars = _href.split("?"); 97 let thePart = pars[0]; 98 jQuery("#insightlink").attr( 99 "href", 100 thePart + "?taxonomia=" + taxonomia + "&termo=" + arrStr 101 ); 102 } else { 103 jQuery("#insightlink").attr( 104 "href", 105 _href + "/?taxonomia=" + taxonomia + "&termo=" + arrStr 106 ); 107 } 108 } else { 109 let _href = jQuery("#insightlink").attr("href"); 110 let pars = _href.split("?"); 111 let thePart = pars[0]; 112 jQuery("#insightlink").attr("href", thePart); 113 //console.log(thePart); 114 115 jQuery("#datafetch").hide("slow"); 116 jQuery("#firstrow").show("slow"); 117 jQuery("#secondrow").show("slow"); 118 } 119} 120 121function fetchFilterInsights() { 122 var taxonomia = ""; 123 let aterm = []; 124 var getUrl = window.location; 125 var baseUrl = 126 getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname; 127 128 jQuery(".accordion-button").each(function () { 129 if (jQuery(this).attr("aria-expanded") == "true") { 130 taxonomia = jQuery(this).attr("id"); 131 } 132 }); 133 134 jQuery(".get_tax").each(function () { 135 if (jQuery(this).attr("aria-expanded") == "true") { 136 taxonomia = jQuery(this).attr("id"); 137 } 138 }); 139 140 //jQuery('.get_formato').each(function(){ 141 jQuery(".get_term").each(function () { 142 if (jQuery(this).is(":checked")) { 143 aterm.push(jQuery(this).val()); 144 taxonomia = jQuery(this).data('tax'); 145 } 146 }); 147 148 if (aterm.length > 0) { 149 aterm = aterm.join(","); 150 let arrStr = encodeURIComponent(aterm); 151 152 let kick = baseUrl + "/?taxonomia=" + taxonomia + "&termo=" + arrStr; 153 //console.log(kick, 'console') 154 155 window.location = kick; 156 } else { 157 let kick = baseUrl; 158 159 window.location = kick; 160 } 161} 162 163function fetchFilterSearch() { 164 //aplicar filtro na página de busca 165 if (jQuery("#menu-search-field-2").val().length === 0) { 166 //}.is(":empty")) { 167 jQuery("#fieldRequidedSearch").removeClass("d-none"); 168 jQuery("#menu-search-field-2").addClass("obrigatorio"); 169 170 return false;
171 } 172 173 //console.log("não esta vazio"); 174 var sterm = jQuery("#menu-search-field-2").val(); 175 console.log(sterm); 176 177 var taxonomia = ""; 178 let aterm = []; 179 180 var getUrl = window.location; 181 var baseUrl = 182 getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1]; 183 184 jQuery(".accordion-button").each(function () { 185 if (jQuery(this).attr("aria-expanded") == "true") { 186 taxonomia = jQuery(this).attr("id"); 187 } 188 }); 189 190 jQuery(".get_tax").each(function () { 191 if (jQuery(this).attr("aria-expanded") == "true") { 192 taxonomia = jQuery(this).attr("id"); 193 console.log(taxonomia); 194 } 195 }); 196 197 //jQuery('.get_formato').each(function(){ 198 jQuery(".get_term").each(function () { 199 if (jQuery(this).is(":checked")) { 200 aterm.push(jQuery(this).val()); 201 } 202 }); 203 204 console.log(aterm); 205 console.log(baseUrl); 206 207 208 if (aterm.length !== 0) { 209 aterm = aterm.join(","); 210 let arrStr = encodeURIComponent(aterm); 211 //let _href = jQuery("#depoisgrupo").attr("href"); 212 //console.log(baseUrl) 213 let kick = 214 baseUrl + "?s=" + sterm + "&taxonomia=" + taxonomia + "&termo=" + arrStr; 215 console.log(kick, "console"); 216 217 window.location = kick; 218 } else { 219 let kick = baseUrl; 220 221 window.location = kick; 222 } 223}
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.