PageSourceSearch

https://www.hotelrestart.cz/wp-content/cache/min/1/wp-content/them…/assets/gallery.js?ver=1790687465

js hotelrestart.cz collected 2026-10-08 07:14:31 UTC 3,899 bytes, 16 lines download raw bytes

1(function(){'use strict';var GAP=2;var TARGET_ROW=250;function ratioOf(item){var img=item.querySelector('img');if(!img)return 1.5;var w=parseFloat(img.getAttribute('width'))||img.naturalWidth;var h=parseFloat(img.getAttribute('height'))||img.naturalHeight;return w&&h?w/h:1.5}
2function layout(gallery){var items=Array.prototype.filter.call(gallery.children,function(el){return el.classList.contains('wp-block-image')});if(!items.length)return;var width=Math.floor(gallery.clientWidth);if(!width)return;gallery.classList.add('is-justified');var row=[];var ratioSum=0;var lastHeight=TARGET_ROW;function heightFor(count,sum){return(width-GAP*(count-1))/sum}
3function flush(isLastRow){if(!row.length)return;var height=heightFor(row.length,ratioSum);if(isLastRow&&height>lastHeight)height=lastHeight;else lastHeight=height;var widths=row.map(function(entry){return Math.floor(entry.ratio*height)});var spill=widths.reduce(function(a,b){return a+b},0)+GAP*(row.length-1)-width;if(spill>0)widths[widths.length-1]-=Math.ceil(spill);row.forEach(function(entry,i){entry.el.style.width=widths[i]+'px';entry.el.style.height=height+'px'});row=[];ratioSum=0}
4items.forEach(function(el){var ratio=ratioOf(el);if(row.length){var taking=heightFor(row.length+1,ratioSum+ratio);var stopping=heightFor(row.length,ratioSum);if(Math.abs(taking-TARGET_ROW)>Math.abs(stopping-TARGET_ROW)){flush(!1)}}
5row.push({el:el,ratio:ratio});ratioSum+=ratio});flush(!0)}
6function layoutAll(){document.querySelectorAll('.wp-block-gallery.restart-native-gallery').forEach(layout)}
7layoutAll();window.addEventListener('load',layoutAll);var resizeTimer;window.addEventListener('resize',function(){clearTimeout(resizeTimer);resizeTimer=setTimeout(layoutAll,120)});var overlay;var image;var caption;var links=[];var index=0;function buildOverlay(){if(overlay){return}
8overlay=document.createElement('div');overlay.className='restart-gallery-lightbox';overlay.hidden=!0;overlay.innerHTML='<button type="button" class="restart-gallery-close" aria-label="Zavřít">×</button>'+'<button type="button" class="restart-gallery-prev" aria-label="Předchozí fotografie">‹</button>'+'<figure><img alt=""><figcaption></figcaption></figure>'+'<button type="button" class="restart-gallery-next" aria-label="Další fotografie">›</button>';document.body.appendChild(overlay);image=overlay.querySelector('img');caption=overlay.querySelector('figcaption');overlay.querySelector('.restart-gallery-close').addEventListener('click',close);overlay.querySelector('.restart-gallery-prev').addEventListener('click',function(){show(index-1)});overlay.querySelector('.restart-gallery-next').addEventListener('click',function(){show(index+1)});overlay.addEventListener('click',function(event){if(event.target===overlay){close()}})}
9function show(nextIndex){if(!links.length){return}
10index=(nextIndex+links.length)%links.length;var link=links[index];var thumb=link.querySelector('img');image.src=link.href;image.alt=thumb?thumb.alt:'';caption.textContent=image.alt;caption.hidden=!image.alt}
11function open(link){buildOverlay();links=Array.prototype.slice.call(link.closest('.restart-native-gallery').querySelectorAll('a[href]'));index=Math.max(0,links.indexOf(link));show(index);overlay.hidden=!1;document.documentElement.classList.add('restart-gallery-open');overlay.querySelector('.restart-gallery-close').focus()}
12function close(){if(!overlay){return}
13overlay.hidden=!0;image.removeAttribute('src');document.documentElement.classList.remove('restart-gallery-open')}
14document.addEventListener('click',function(event){var link=event.target.closest('.restart-native-gallery a[href]');if(!link){return}
15event.preventDefault();open(link)});document.addEventListener('keydown',function(event){if(!overlay||overlay.hidden){return}
16if(event.key==='Escape'){close()}else if(event.key==='ArrowLeft'){show(index-1)}else if(event.key==='ArrowRight'){show(index+1)}})}())

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.