https://www.defesa.org/wp-content/plugins/instituto-defesa-radar-eleitoral/assets/radar.js?ver=0.6.3
1 2(function(){ 3 function postVote(root, topic){ 4 var body = new URLSearchParams(); 5 body.set('action','id_radar_vote_topic'); 6 body.set('nonce', IDRadar.nonce); 7 body.set('topic', topic); 8 9 root.querySelectorAll('.id-topic-option').forEach(function(b){b.disabled=true;}); 10 fetch(IDRadar.ajaxurl, { 11 method:'POST', 12 headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}, 13 body:body.toString(), 14 credentials:'same-origin' 15 }) 16 .then(function(r){return r.json();}) 17 .then(function(data){ 18 var feedback = root.querySelector('.id-topic-feedback'); 19 if(!data.success){ 20 feedback.textContent = data.data && data.data.message ? data.data.message : 'Não foi possÃvel registrar.'; 21 return; 22 } 23 feedback.textContent = data.data.message; 24 root.querySelectorAll('.id-topic-option').forEach(function(btn, i){ 25 var pct = btn.querySelector('[data-topic-pct]'); 26 if(pct && data.data.percentages[i] !== undefined) pct.textContent = Number(data.data.percentages[i]).toFixed(1).replace('.',',')+'%'; 27 }); 28 var total = root.querySelector('.id-topic-total'); 29 if(total) total.textContent = data.data.total+' participações registradas.'; 30 }) 31 .catch(function(){ 32 root.querySelector('.id-topic-feedback').textContent='Falha de conexão.'; 33 root.querySelectorAll('.id-topic-option').forEach(function(b){b.disabled=false;}); 34 }); 35 } 36 37 document.addEventListener('click', function(e){ 38 var btn = e.target.closest('.id-topic-option'); 39 if(!btn) return; 40 var root = btn.closest('[data-id-topic-poll]'); 41 if(!root) return; 42 postVote(root, btn.getAttribute('data-topic')); 43 }); 44})();
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.