PageSourceSearch

http://www.otuzilci-praha.cz/cz/wp-content/themes/ipko-praha/assets/main.js?ver=1.0.5

js otuzilci-praha.cz collected 2026-10-07 04:05:33 UTC 7,458 bytes, 72 lines download raw bytes

1(function(){
2 'use strict';
3 // Move the existing widgets on mobile, keeping their live data and original settings.
4 var social=document.querySelector('.original-social'),socialFooter=document.getElementById('mobile-social-footer'),socialMenu=document.getElementById('mobile-social-menu'),socialIntro=document.getElementById('mobile-intro-social');
5 var water=document.getElementById('vltava-widget'),waterSlot=document.getElementById('mobile-water-slot');
6 var waterWidget=water ? water.closest('.widget') : null;
7 function markerFor(node){var marker=document.createComment('Original widget position');node.parentNode.insertBefore(marker,node);return marker;}
8 var socialMarker=social ? markerFor(social) : null,waterMarker=waterWidget ? markerFor(waterWidget) : null;
9 var browseMenu=document.getElementById('mobile-browse-menu'),browseWidgets=[];
10 function archiveTree(widget){
11   // Keep the original URLs and counts; only group their presentation by year.
12   var entries=widget.querySelectorAll('select option[value]'),tree=document.createElement('div'),years={};
13   if(!entries.length)entries=widget.querySelectorAll('a[href]');
14   tree.className='mobile-archive-tree';
15   Array.prototype.forEach.call(entries,function(source){
16     var href=source.value||source.getAttribute('href'),label=source.textContent.trim(),match=label.match(/\b(?:19|20)\d{2}\b/);
17     if(!href||!match)return;
18     var year=match[0];
19     if(!years[year]){
20       var group=document.createElement('details'),heading=document.createElement('summary'),list=document.createElement('ul');
21       group.className='mobile-archive-year';heading.textContent=year;group.appendChild(heading);group.appendChild(list);tree.appendChild(group);years[year]=list;
22     }
23     var item=document.createElement('li'),link=document.createElement('a');
24     link.href=href;link.textContent=label.replace(year,'').replace(/\s+/g,' ').trim();link.setAttribute('aria-label',label);
25     item.appendChild(link);years[year].appendChild(item);
26   });
27   return tree.children.length?tree:null;
28 }
29 if(browseMenu){['.widget_archive','.widget_categories','.widget_tag_cloud'].forEach(function(selector){
30   var widget=document.querySelector('.original-sidebar '+selector)||document.querySelector('#mobile-browse-source '+selector);
31   if(!widget)return;
32   var details=document.createElement('details'),summary=document.createElement('summary'),heading=widget.querySelector('.widget-title');
33   details.className='mobile-browse-section';summary.textContent=heading?heading.textContent:'Další články';details.appendChild(summary);browseMenu.appendChild(details);
34   if(selector==='.widget_archive'){var tree=archiveTree(widget);if(tree){details.classList.add('has-archive-tree');summary.textContent='Archiv článků';details.appendChild(tree);}}
35   browseWidgets.push({widget:widget,marker:markerFor(widget),details:details});
36 });}
37 if(social&&socialMenu){Array.prototype.forEach.call(social.querySelectorAll('a[href]'),function(source){
38   var item=document.createElement('a'),widget=source.closest('.widget'),heading=widget&&widget.querySelector('.widget-title');
39   var label=(heading ? heading.textContent : source.textContent).trim();
40   item.href=source.href;item.textContent=label.toLowerCase()==='facebook'?'Facebook':label;
41   if(source.target)item.target=source.target;if(source.rel)item.rel=source.rel;
42   socialMenu.appendChild(item);
43   if(socialIntro){
44     var iconLink=document.createElement('a'),sourceImage=source.querySelector('img');
45     iconLink.href=source.href;iconLink.setAttribute('aria-label',item.textContent);iconLink.title=item.textContent;
46     if(source.target)iconLink.target=source.target;if(source.rel)iconLink.rel=source.rel;
47     if(sourceImage){var icon=sourceImage.cloneNode(true);icon.removeAttribute('id');icon.removeAttribute('style');icon.width=24;icon.height=24;icon.alt='';iconLink.appendChild(icon);}else iconLink.textContent=item.textContent;
48     socialIntro.appendChild(iconLink);
49   }
50 });}
51 function arrangeMobileWidgets(){var mobile=window.matchMedia('(max-width: 900px)').matches;
52   if(social&&socialFooter){if(mobile)socialFooter.appendChild(social);else socialMarker.parentNode.insertBefore(social,socialMarker.nextSibling);}
53   if(waterWidget&&waterSlot){if(mobile)waterSlot.appendChild(waterWidget);else waterMarker.parentNode.insertBefore(waterWidget,waterMarker.nextSibling);}
54   browseWidgets.forEach(function(item){if(mobile)item.details.appendChild(item.widget);else item.marker.parentNode.insertBefore(item.widget,item.marker.nextSibling);});
55 }
56 arrangeMobileWidgets();window.addEventListener('resize',arrangeMobileWidgets);
57 var toggle=document.getElementById('mobilni-prepinac'),nav=document.getElementById('mobilni-nav');
58 if(toggle&&nav){
59  var backdrop=document.getElementById('mobile-menu-backdrop'),closeButton=document.getElementById('mobile-menu-close');
60  function close(){nav.hidden=true;if(backdrop)backdrop.hidden=true;document.body.classList.remove('mobile-menu-open');toggle.setAttribute('aria-expanded','false');toggle.querySelector('span').textContent='Otevřít menu';}
61  function closeAndFocus(){close();toggle.focus();}
62  toggle.addEventListener('click',function(){if(!nav.hidden){closeAndFocus();return;}nav.hidden=false;if(backdrop)backdrop.hidden=false;document.body.classList.add('mobile-menu-open');toggle.setAttribute('aria-expanded','true');toggle.querySelector('span').textContent='Zavřít menu';if(closeButton)closeButton.focus();});
63  if(closeButton)closeButton.addEventListener('click',closeAndFocus);
64  if(backdrop)backdrop.addEventListener('click',closeAndFocus);
65  nav.addEventListener('click',function(e){if(e.target.closest('a'))close();});
66  document.addEventListener('keydown',function(e){if(nav.hidden)return;if(e.key==='Escape'){e.preventDefault();closeAndFocus();return;}if(e.key==='Tab'){var items=Array.prototype.filter.call(nav.querySelectorAll('a[href],button,summary,select'),function(item){return item.getClientRects().length>0;}),first=items[0],last=items[items.length-1];if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}}});
67  window.addEventListener('resize',function(){if(window.innerWidth>900)close();});
68 }
69 // Keep the original live event source; adapt only its fixed-width presentation.
70 var eventFrame=document.querySelector('iframe[src="/subdom/widgets/akce.php"]');
71 if(eventFrame){eventFrame.title='Nejbližší klubová akce';function fitEvent(){try{var doc=eventFrame.contentDocument;if(!doc||!doc.getElementById('table'))return;var style=doc.getElementById('ipko-responsive-event');if(!style){style=doc.createElement('style');style.id='ipko-responsive-event';style.textContent='html,body{margin:0;padding:0;background:transparent}#table{position:static;width:100%;height:auto}#txdays,#txname,#txdate{position:static;width:100%;height:auto;box-sizing:border-box;padding:10px 8px;line-height:1.45;letter-spacing:.035em}#txdays{background:#005680;font-size:11px}#txname{background:#eaf5f9;color:#123446;text-shadow:none;font-size:16px}#txdate{background:#123446;font-size:11px}';doc.head.appendChild(style);}eventFrame.style.height=doc.getElementById('table').scrollHeight+'px';}catch(e){/* Cross-origin embeds retain their original presentation. */}}eventFrame.addEventListener('load',fitEvent);window.addEventListener('resize',fitEvent);fitEvent();}
72})();

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.