PageSourceSearch

https://www.kelheim.de/wp-content/cache/min/1/wp-content/plugins/g…/assets/js/weather.js?ver=1790279139

js kelheim.de collected 2026-09-24 22:34:19 UTC 4,860 bytes, 47 lines download raw bytes

1jQuery(document).ready(function($){'use strict';window.openWeatherModal=function(){const modal=document.getElementById('weatherModal');if(modal){modal.style.display='block';document.body.style.overflow='hidden';setTimeout(()=>{const closeBtn=modal.querySelector('.modal-close');if(closeBtn){closeBtn.focus()}},100)}};window.closeWeatherModal=function(){const modal=document.getElementById('weatherModal');if(modal){const modalContent=modal.querySelector('.modal-content');modalContent.classList.add('closing');setTimeout(()=>{modal.style.display='none';modalContent.classList.remove('closing');document.body.style.overflow=''},300)}};$(document).on('keydown',function(e){if(e.key==='Escape'){closeWeatherModal()}});$(document).on('click','.modal-overlay',function(e){if(e.target===this){closeWeatherModal()}});$('.hourly-container').on('wheel',function(e){if(e.originalEvent.deltaY!==0){e.preventDefault();$(this).scrollLeft($(this).scrollLeft()+e.originalEvent.deltaY)}});$('.detail-item').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});$('.gemeinde-wetter-card').each(function(){$(this).hide().fadeIn(600)});$('.card-info-icon').hover(function(){$(this).addClass('pulse')},function(){$(this).removeClass('pulse')});function adjustHourlyScroll(){const container=$('.hourly-container');if(container.length){const containerWidth=container.width();const itemWidth=100;const visibleItems=Math.floor(containerWidth/itemWidth);if(visibleItems<24){container.addClass('scrollable')}else{container.removeClass('scrollable')}}}
2adjustHourlyScroll();$(window).on('resize',adjustHourlyScroll);let isScrolling=!1;let startX=0;let scrollLeft=0;$('.hourly-container').on('touchstart',function(e){isScrolling=!0;startX=e.originalEvent.touches[0].pageX-$(this).offset().left;scrollLeft=$(this).scrollLeft()});$('.hourly-container').on('touchmove',function(e){if(!isScrolling)return;e.preventDefault();const x=e.originalEvent.touches[0].pageX-$(this).offset().left;const walk=(x-startX)*2;$(this).scrollLeft(scrollLeft-walk)});$('.hourly-container').on('touchend',function(){isScrolling=!1});function setupAutoRefresh(){const refreshInterval=30*60*1000;setInterval(function(){$('.gemeinde-wetter-container').each(function(){const container=$(this);const shortcode=container.data('shortcode');if(shortcode){console.log('Auto-refresh triggered for:',shortcode)}})},refreshInterval)}
3if(typeof gemeindeWetterSettings!=='undefined'&&gemeindeWetterSettings.autoRefresh){setupAutoRefresh()}
4$('.weather-icon').attr('role','img');$('.weather-icon').attr('aria-label','Wetterbedingung');$('.detail-item').each(function(){const label=$(this).find('.label').text();const value=$(this).find('.value').text();$(this).attr('aria-label',label+': '+value)});$('.hourly-container').on('keydown',function(e){const container=$(this);const scrollAmount=200;switch(e.keyCode){case 37:container.scrollLeft(container.scrollLeft()-scrollAmount);e.preventDefault();break;case 39:container.scrollLeft(container.scrollLeft()+scrollAmount);e.preventDefault();break}});$('.hourly-item').attr('tabindex','0');$('.daily-item').attr('tabindex','0');$('.gemeinde-wetter-card').on('click',function(e){e.preventDefault();e.stopPropagation();openWeatherModal()});$(document).on('click','.gemeinde-wetter-error',function(){const errorMessage=$(this).text();console.error('Gemeinde Wetter Error:',errorMessage);if(typeof gemeindeWetterSettings!=='undefined'&&gemeindeWetterSettings.errorReporting){$.post(gemeindeWetterSettings.ajaxUrl,{action:'gemeinde_wetter_log_error',error:errorMessage,nonce:gemeindeWetterSettings.nonce})}});function showLoadingState(){$('.gemeinde-wetter-card').addClass('loading')}
5function hideLoadingState(){$('.gemeinde-wetter-card').removeClass('loading')}
6window.refreshWeatherData=function(){showLoadingState();setTimeout(()=>{hideLoadingState()},1000)}});const style=document.createElement('style');style.textContent=`
7    .card-info-icon.pulse {
8        animation: pulse 0.6s ease;
9    }
10    
11    @keyframes pulse {
12        0% {
13            transform: scale(1);
14        }
15        50% {
16            transform: scale(1.1);
17        }
18        100% {
19            transform: scale(1);
20        }
21    }
22    
23    .gemeinde-wetter-card.loading {
24        opacity: 0.7;
25        pointer-events: none;
26    }
27    
28    .gemeinde-wetter-card.loading::after {
29        content: '';
30        position: absolute;
31        top: 50%;
32        left: 50%;
33        width: 20px;
34        height: 20px;
35        margin: -10px 0 0 -10px;
36        border: 2px solid rgba(255, 255, 255, 0.3);
37        border-top: 2px solid white;
38        border-radius: 50%;
39        animation: spin 1s linear infinite;
40        z-index: 3;
41    }
42    
43    @keyframes spin {
44        0% { transform: rotate(0deg); }
45        100% { transform: rotate(360deg); }
46    }
47`;document.head.appendChild(style)

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.