PageSourceSearch

https://brandonherreraforcongress.com/wp-content/themes/brandonher…/assets/build/js/polling-places.js

js brandonherreraforcongress.com collected 2026-10-02 07:28:57 UTC 3,094 bytes, 1 lines download raw bytes

1jQuery(function($){var b=$('#modal'),c=$(document),d=window.pollingAjax?.ajax_url?window.pollingAjax.ajax_url+'/wp-json/elections/v1/polling-places':null;if(!b.length)return;function a(A){if(!A)return'Unknown';return `${A}`.split('_').map(w=>w.charAt(0).toUpperCase()+w.slice(1)).join(' ')}function f(_){var B={};return B[_]||null}function g(){var C=$('.polling-list'),_b=$('.fade-overlay');if(!C.length||!_b.length)return;C[0].scrollHeight<=C.scrollTop()+C.innerHeight()?_b.hide():_b.show()}function h(_a){var D=encodeURIComponent(_a||'');return ''+'<p class="mt-2 flex items-center justify-start gap-1">'+'<a href="https://www.google.com/maps/search/?api=1&query='+D+'" target="_blank" rel="noopener" class="bg-[#EC1D2D] hover:bg-[#EC1D2D]/75 text-white px-2 py-1 rounded font-bold text-sm transition-all duration-300 ease-in-out">Google Maps</a>'+'<a href="http://maps.apple.com/?q='+D+'" target="_blank" rel="noopener" class="bg-[#EC1D2D] hover:bg-[#EC1D2D]/75 text-white px-2 py-1 rounded font-bold text-sm transition-all duration-300 ease-in-out">Apple Maps</a>'+'</p>'}function i(_A){if(!_A)return;$('.county-name').text(a(_A.county));$('.count').text(_A.count||0);var _B=$('.polling-list'),H=$('.modal-content'),I=H.outerHeight(!0),J=$(window).height(),K=16,l=16,m=J-K-l;_B.empty();if(_A.items&&_A.items.length>0)for(const aA of _A.items){var _c=aA.name||'Unknown',_d=aA.address||'N/A',E=aA.hours||'N/A',F=aA.notes||'N/A',G=$('<li class="polling-item mb-4 p-4 border border-[#dddddd] rounded-lg">');G.append(`<h4 class="font-poster font-bold text-lg text-[#EC1D2D]">${_c}</h4>`);G.append(`<p><strong>Address:</strong> ${_d}</p>`);G.append(`<p><strong>Hours:</strong> ${E}</p>`);G.append(`<p><strong>Notes:</strong> ${F}</p>`);G.append(h(_d));_B.append(G)}else _B.append('<li class="mb-4">No polling places found at the moment. We\'ll update this information as it becomes available. Check back soon.</li>');g();_B.off('scroll.polling').on('scroll.polling',g);b.fadeIn(120).removeClass('opacity-0 pointer-events-none').addClass('opacity-100');I>m?b.removeClass('items-center').addClass('items-start').css('overflow-y','auto'):b.removeClass('items-start').addClass('items-center').css('overflow-y','visible');b.attr('tabindex','-1').focus()}function j(){b.fadeOut(120).addClass('opacity-0 pointer-events-none').removeClass('opacity-100')}function k(aB){if(!aB)return;if(!d){var aC=f(aB);aC&&i(aC);return}$.ajax({url:d,method:'GET',data:{county:aB},dataType:'json',timeout:10000}).done(aD=>{if(aD&&(aD.items||aD.count||aD.county)){i(aD);return}var aE=f(aB);aE&&i(aE)}).fail(()=>{var aF=f(aB);aF&&i(aF)})}c.on('click','#closeBtn, #modal',function(e){e.target==this||$(e.target).hasClass('close')||e.target.id=='closeBtn'&&j()});c.on('keydown',function(e){e.key=='Escape'||e.keyCode==27&&j()});$('#county-select').on('change',function(){var aG=$(this).val();aG&&k(aG)});$(window).on('load',function(){$('svg path[county]').each(function(){$(this).css('cursor','pointer').off('click.polling').on('click.polling',function(e){e.preventDefault();var aH=$(this).attr('county');aH&&k(aH)})})})});

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.