PageSourceSearch

https://www.minutouno.com/js-custom/150/polls-min-version-1790827608.js

js minutouno.com collected 2026-10-02 03:08:38 UTC 8,910 bytes, 37 lines download raw bytes

1(function($){var votes={};var COOKIE_POLL_VOTES='pollsv';var COOKIE_POLLS_DATA='pollsData';var CLASS_OPTIONS='show-votes';var CLASS_RESULTS='show-results';var URL_GET_DATA_POLLS='/_post/getDataPolls.php';var checkTablet=function(){var tabletKind=navigator.userAgent;var retorno='click';if(tabletKind.search('/iPhone|iPad|iPod|Android|IEmobile|BlackBerry/i')>-1){$('body').addClass('body-mobile-device');retorno='touchstart'}
2return retorno};var ev_device=checkTablet();function loadVotes(){var cookie=$.cookie(COOKIE_POLL_VOTES);votes={};if(cookie){votes=$.parseJSON(cookie)}}
3function updateVotes(){$.cookie(COOKIE_POLL_VOTES,JSON.stringify(votes),{expires:720})}
4function sendVote(pid,val,url,ctcha,callback){$.ajax({type:'POST',url:url+'?'+ctcha,dataType:'jsonp',data:{idSurvey:pid,idOption:val},success:function(data,status,xhr){if(callback){callback(data)}}})}
5function updateNumVotes($poll,value){var $total=$poll.find('[data-total]');var total=parseInt($total.text(),10);var $results=$poll.find('[data-votes]');if(total==0){refreshPolls('[data-poll]')}
6total+=1;$total.text(total);var $has_max_votes,max_votes=-1;$results.each(function(i,r){var $r=$(r);var $rbar=$r.find('[data-bar]');var $rpc=$r.find('[data-percent]');var rnv=parseInt($r.attr('data-votes'),10);var rv=$r.attr('data-value');var verenc=$r.attr('data-version');var percent;if(value==rv){rnv+=1}
7if(rnv>max_votes){max_votes=rnv;$has_max_votes=$r}
8var num=(100*rnv/total);percent=+(Math.round(num+"e+2")+"e-2");if(!verenc&&verenc==="2"){$rpc.text(percent+'%');$rbar.css('width',percent+'%');$r.attr('data-votes',rnv);Maxvotos($poll)}else{if(!$rpc.hasClass('interior-de-encuesta')){}
9$rpc.text(percent+' %');$rbar.css('width',percent+'%')}})}
10function Maxvotos($poll){var $results=$poll.find('[data-votes]');var $has_max_votes,max_votes=-1;$results.each(function(i,r){var $r=$(r);var rnv=parseInt($r.attr('data-votes'),10);if(rnv>max_votes){max_votes=rnv;$has_max_votes=$r}})}
11function vote($poll,pid,value,portalId){var noVote=$poll.parents('.object-survey').hasClass('show-results')||votes.pid;if(!noVote){var privado=$poll.find('[name=privado]').val();var contexto=$poll.find('[name=context]').val();var $captcha;var url=$poll.data('url-action');var privada=privado=="1"||privado=="3";if(privada){var isLogued=(contexto&&contexto=='iframe')?window.parent.UsuariosWeb.isUserLogued():UsuariosWeb.isUserLogued();if(!isLogued){if(contexto=='iframe'){window.parent.UsuariosWeb.openLogin()}else{UsuariosWeb.openLogin()}
12return!1}}
13$poll.votoCookie=!0;var conCaptcha=privado=="2"||privado=="3";if(conCaptcha){var $section=$poll.parents('.object-survey');$section.addClass('with-captcha');$captcha=$section.find('.captcha-wrapper');$form=$captcha.find('form');if(privado=="2"||(privado=="3"&&UsuariosWeb&&UsuariosWeb.isUserLogued())){captchaToogle(pid,value,portalId,$poll)}
14$captcha.on(ev_device,'input[type="button"]',function(event){event.preventDefault();event.stopPropagation();var ctcha=$form.serialize();sendVote(pid,value,url,ctcha,function(data){if(data.status=='Ok'){votes[pid]=1;if($poll.find("[data-link]").length>0){window.location.href=$poll.find("[data-link]").attr("data-link")}else{updateVotes();updateNumVotes($poll,value);removeNavLinks($poll);Recaptcha.destroy();showResults($poll)}}else if(data.status=='Nok'){$captcha.find('.error').html(data.message);$captcha.find('.error').show();Recaptcha.reload()}});return!1})}else{if(typeof EmbedEnc!='undefined'){setTimeout(function(){EmbedEnc.resizeEmbed()},250)}
15sendVote(pid,value,url);votes[pid]=1;if($poll.find("[data-link]").length){window.location.href=$poll.find("[data-link]").attr("data-link")}else{removeNavLinks($poll);updateVotes();updateNumVotes($poll,value);showResults($poll);$poll.children('.object-survey').removeClass('show-votes');$poll.children('.object-survey').addClass('voted');return!1}}}}
16var captchaLoaded=function(section){Recaptcha.focus_response_field();$('.captcha-wrapper .spinner-wrapper').css('display','none');$('.captcha-wrapper .captcha-subtitle').css('display','block');$('.captcha-wrapper .captcha-subtitle').css('display','block');$('.captcha-wrapper .captcha-btn').css('display','block');var thisCaptchaHeight=section.find('.captcha-wrapper').outerHeight();section.css('min-height',thisCaptchaHeight)}
17function removeNavLinks($poll){$poll.find('.survey-action-btn').remove();$poll.off(ev_device,'[data-votes]')}
18function showResults($poll){var $section=$poll.parents('.object-survey');var privado=$poll.find('[name=privado]').val();if(privado=="2"||privado=="3"){$section.removeClass('with-captcha')}
19$section.removeClass(CLASS_OPTIONS).addClass(CLASS_RESULTS)}
20function initPoll(i,poll){var $poll=$(poll),pid=parseInt($poll.attr('data-poll'),10);$poll.votoCookie=!1;var pexp=$poll.attr('data-expiracion');var pnow=$poll.attr('data-now');var portalId=$poll.data('portal-id');var contexto=$poll.find('[name=context]').val();if(isNaN(pid)){console.error('Invalid poll ID: '+$poll.attr('data-poll'));return}
21pid=String(pid);$poll.start=!0;if(typeof(pexp)!='undefined'&&typeof(pnow)!='undefined'){var fechaExp=parseInt(pexp.substring(0,4)+pexp.substring(5,7)+pexp.substring(8,10)+pexp.substring(11,13)+pexp.substring(14,16)+pexp.substring(17,19),10);var fechaNow=parseInt(pnow.substring(0,4)+pnow.substring(5,7)+pnow.substring(8,10)+pnow.substring(11,13)+pnow.substring(14,16)+pnow.substring(17,19),10);if(fechaExp!==0&&fechaExp<=fechaNow){removeNavLinks($poll);showResults($poll);return}}
22Maxvotos($poll);var voto=$.cookie('s_survey_'+pid+'_'+portalId);if(voto){$poll.votoCookie=!0;removeNavLinks($poll);showResults($poll);$('#survey'+pid+' .object-survey').removeClass('show-votes');$('#survey'+pid+' .object-survey').addClass('show-results');$('#survey'+pid+' .survey-action-wrapper').hide();return}
23$poll.on(ev_device,'.survey-action-btn',function(event){event.preventDefault();event.stopPropagation();if(typeof EmbedEnc!='undefined'){setTimeout(function(){EmbedEnc.resizeEmbed()},250)}
24$(this).parents('.object-survey').toggleClass('show-votes show-results');var optionGraphicPercentage=$(this).parents('.object-survey').find('.all-options-wrapper .option-wrapper');optionGraphicPercentage.each(function(){});if($(this).text()=='Votar'){$(this).text('Ver Resultados')}else{$(this).text('Votar')}});if(!voto){$poll.on(ev_device,'[data-votes-wrapper]',function(event){event.preventDefault();event.stopPropagation();var voto=$(this).find('input[type=radio]');voto.attr('checked',!0);vote($poll,pid,voto.val(),portalId)})}}
25function initPolls(domPoll){var $polls=$(domPoll);if(!$polls.length){return}
26loadVotes();$polls.each(initPoll)}
27function refreshPolls(domPoll){var $polls=$(domPoll);if(!$polls.length){return}
28var cookie=$.cookie(COOKIE_POLLS_DATA);if(cookie){var data=$.parseJSON(cookie);updatePolls(data,0);return}
29var arrIds=[];var strIds='';$polls.each(function(i,p){var $p=$(p);var id=$p.attr('data-poll');arrIds[i]=id});strIds=arrIds.join(',');if(arrIds.length>0){$.ajax({type:'POST',url:URL_GET_DATA_POLLS+'?polls='+strIds,data:{polls:strIds},success:function(data){updatePolls(data,1)}})}}
30function updatePolls(data,setCookie){if(setCookie==1){$.cookie(COOKIE_POLLS_DATA,data);objData=JSON.parse(data)}else{objData=data}
31$.each(objData,function(i,encuesta){idEncuesta=i;$.each(encuesta,function(o,votos){idOpcion=o;updateOption(idEncuesta,idOpcion,votos)})})}
32function updateOption(idEncuesta,idOpcion,porcentaje){var optionGraphic=$('#survey'+idEncuesta).find('.opcion.survey'+idEncuesta+idOpcion+' .option-percentage-graphic').css('width',porcentaje+'%');var optionNumber=$('#survey'+idEncuesta).find('.opcion.survey'+idEncuesta+idOpcion+' .option-percentage-number').text(porcentaje+'%')}
33function checkCookie(idEncuesta,idPortal,idOpcion,$poll,el){if(Cookie.read('s_survey_'+idEncuesta+'_'+idPortal)){updateVotes();refreshPolls('[data-poll]');removeNavLinks($poll);showResults($poll);$poll.children('.object-survey').removeClass('show-votes');$poll.children('.object-survey').addClass('voted');$poll.off(ev_device,'[data-votes-wrapper]','');el.removeEvents("close");parent.milkbox.removeEvents("close")}}
34function checkForEmptyPolls(domPoll){var $polls=$(domPoll);if(!$polls.length){return}
35$polls.each(function(i,p){var $total=$(p).find('[data-total]');total=$total.text();if(total==0){refreshPolls(domPoll);return}})}
36var captchaToogle=function(idEncuesta,idOpcion,idPortal,$poll){jQuery.fancybox.open({src:'/_post/survey_captcha.php?idSurvey='+idEncuesta+'&idOption='+idOpcion+'&idCMSPortal='+idPortal,type:'iframe',opts:{iframe:{css:{padding:'20px','border-radius':'20px',width:350,height:495},attr:{scrolling:"none"}},afterClose:function(instance,current){checkCookie(idEncuesta,idPortal,idOpcion,$poll,this)}}})}
37$(document).on(ev_device,'.captcha-close-icon',function(event){event.preventDefault();event.stopPropagation()});$(document).ready(function(){initPolls('[data-poll]');checkForEmptyPolls('[data-poll]')})}(jq))

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.