1// Hardcoded path for compression of js 2import lightGallery from '/fileadmin/templates/js/upgrade/libs/lightgallery/lightgallery.es5.js'; 3import lgThumbnail from '/fileadmin/templates/js/upgrade/libs/lightgallery/plugins/thumbnail/lg-thumbnail.es5.js'; 4import lgAutoplay from '/fileadmin/templates/js/upgrade/libs/lightgallery/plugins/autoplay/lg-autoplay.es5.js'; 5import { 6 callFocusFunction 7} from '/fileadmin/templates/js/upgrade/parts/hw_focus.js'; 8 9// sometimes it happens that the js is loaded just in the right time so that the document is already ready, 10// if we listen only to the readystatechange, we would miss these cases 11 12if (document.readyState === 'complete') { 13 hwMainJs(); 14} else { 15 document.addEventListener('readystatechange', () => { 16 if (document.readyState === 'complete') { 17 hwMainJs(); 18 } 19 }); 20} 21function hwMainJs() { 22 23 let lg_pause = 5000; 24 let lg_autoplay = false; 25 let lg_galleryWrapper = document.getElementById( 26 'hw_record_show__image_autoplay' 27 ); 28 29 if (lg_galleryWrapper) { 30 lg_pause = parseInt(lg_galleryWrapper.dataset.diaShowDuration) * 1000; 31 32 if (lg_pause !== 0) { 33 lg_autoplay = true; 34 35 const reducedMotionMediaQuery = window.matchMedia( 36 '(prefers-reduced-motion: reduce)' 37 ); 38 39 40 if (!reducedMotionMediaQuery || reducedMotionMediaQuery.matches) { 41 lg_autoplay = false; 42 } 43 } 44 } 45 46 // ToDo strings from language-block/module/domelement 47 window._lightGallery = (function initLightGallery() { 48 return lightGallery(document.getElementById('content'), { 49 licenseKey: '27478BF9-0613-44C1-A768-B16094C84869', 50 trapFocus: true, 51 thumbnail: true, 52 showThumbByDefault: true, 53 selector: 'a.lightbox', 54 download: false, 55 mousewheel: false, 56 hideBarsDelay: '3000', 57 autoplay: lg_autoplay, 58 slideShowAutoplay: lg_autoplay, 59 slideShowInterval: lg_pause, 60 autoplayControls: lg_autoplay, 61 plugins: [lgThumbnail, lgAutoplay], 62 mobileSettings: { 63 controls: true, 64 showCloseIcon: true, 65 }, 66 strings: { 67 closeGallery: 'Bildergalerie schlieÃen', 68 toggleMaximize: 'Zwischen Vollbild wechseln', 69 previousSlide: 'Vorheriges Bild', 70 nextSlide: 'Nächstes Bild', 71 download: 'Herunterladen', 72 playVideo: 'Video abspielen', 73 }, 74 }); 75 })(); 76 77 const contentElement = document.getElementById('content'); 78 79 if (contentElement) { 80 let focusedObjectBeforeLG; 81 82 contentElement.addEventListener('lgAfterOpen', () => { 83 focusedObjectBeforeLG = document.activeElement; 84 }); 85 86 contentElement.addEventListener('lgAfterClose', () => { 87 focusedObjectBeforeLG.focus(); 88 }); 89 } 90 91 let imgElementsToFocus = document.querySelectorAll( 92 "img.focus[data-crop]" 93 ); 94 callFocusFunction(imgElementsToFocus); 95 96} 97 98 99document.addEventListener("DOMContentLoaded", function (event) { 100 if (document.querySelector('.hw_solr__main_content__wrap')) { 101 var pagination = document.querySelector('.hw_pagination'); 102 var activeElement = pagination.querySelector('.active'); 103 var buttons = pagination.querySelectorAll('.hw_button'); 104 105 var startIndex = Array.from(buttons).indexOf(activeElement) + 1; 106 var endIndex = startIndex + 4; 107 108 buttons.forEach(function (button, index) { 109 if (index === 0 || index === buttons.length - 1 || index === 1 || index === buttons.length - 2) { 110 button.style.display = 'inline-flex'; 111 } else if (!button.classList.contains('active')) { 112 button.style.display = 'none'; 113 } 114 115 if (index >= startIndex && index < endIndex && index < buttons.length - 1) { 116 button.style.display = 'inline-flex'; 117 } 118 }); 119 } 120}); 121
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.