PageSourceSearch

https://zazriva.com/wp-content/cache/wpo-minify/1790060418/assets/wpo-minify-footer-wp-polls1788329653.min.js

js zazriva.com collected 2026-09-25 00:48:59 UTC 3,501 bytes, 24 lines download raw bytes

1
2(function(){'use strict';const l10n=window.wpPollsL10n||{};const FADE_DURATION=400;function prefersReducedMotion(){return(typeof window.matchMedia==='function'&&window.matchMedia('(prefers-reduced-motion: reduce)').matches)}
3function pollContainer(currentPollId){return document.getElementById('polls-'+currentPollId)}
4function setLoading(currentPollId,visible){const loading=document.getElementById('polls-'+currentPollId+'-loading',);if(loading){loading.style.display=visible?'block':'none'}}
5function fadeTo(element,opacity){if(!element){return}
6element.style.transition=prefersReducedMotion()?'':'opacity '+FADE_DURATION+'ms';element.style.opacity=opacity}
7function show(element){if(element){element.style.transition='';element.style.opacity=''}}
8function pollVote(currentPollId){const form=document.getElementById('polls_form_'+currentPollId);if(!form){return}
9const multipleField=document.getElementById('poll_multiple_ans_'+currentPollId,);const pollMultipleAns=multipleField?parseInt(multipleField.value,10):0;const selected=[];const choices=form.querySelectorAll('input[type="checkbox"], input[type="radio"], option',);Array.prototype.forEach.call(choices,function(choice){if(choice.checked||choice.selected){selected.push(choice.value)}});if(pollMultipleAns>0){if(selected.length===0){alert(l10n.text_valid)}else if(selected.length>pollMultipleAns){alert(l10n.text_multiple+' '+pollMultipleAns)}else{pollProcess(currentPollId,selected.join(','))}
10return}
11const pollAnswerId=selected.length?parseInt(selected[selected.length-1],10):0;if(pollAnswerId>0){pollProcess(currentPollId,pollAnswerId)}else{alert(l10n.text_valid)}}
12function pollRequest(currentPollId,view,extraFields){const nonceField=document.getElementById('poll_'+currentPollId+'_nonce',);const body=new URLSearchParams();body.append('action','polls');body.append('view',view);body.append('poll_id',currentPollId);body.append('poll_'+currentPollId+'_nonce',nonceField?nonceField.value:'',);if(extraFields){Object.keys(extraFields).forEach(function(name){body.append(name,extraFields[name])})}
13fadeTo(pollContainer(currentPollId),0);setLoading(currentPollId,!0);fetch(l10n.ajax_url,{method:'POST',credentials:'include',cache:'no-cache',body,}).then(function(response){return response.text()}).then(function(data){pollProcessSuccess(currentPollId,data)}).catch(function(){setLoading(currentPollId,!1);show(pollContainer(currentPollId))})}
14function pollProcess(currentPollId,pollAnswerId){const fields={};fields['poll_'+currentPollId]=pollAnswerId;pollRequest(currentPollId,'process',fields)}
15function pollResult(currentPollId){pollRequest(currentPollId,'result')}
16function pollBooth(currentPollId){pollRequest(currentPollId,'booth')}
17function pollProcessSuccess(currentPollId,data){const container=pollContainer(currentPollId);if(container){const parsed=document.createElement('div');parsed.innerHTML=data;container.replaceWith.apply(container,Array.prototype.slice.call(parsed.childNodes),)}
18setLoading(currentPollId,!1);show(pollContainer(currentPollId))}
19document.addEventListener('click',function(event){const target=event.target;if(!target||typeof target.closest!=='function'){return}
20const trigger=target.closest('[data-poll-action]');if(!trigger){return}
21const pollId=trigger.getAttribute('data-poll-id');if(trigger.tagName==='A'){event.preventDefault()}
22switch(trigger.getAttribute('data-poll-action')){case 'vote':pollVote(pollId);break;case 'result':pollResult(pollId);break;case 'booth':pollBooth(pollId);break}})}());
23
24

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.