PageSourceSearch

https://sucha24.pl/static/nextgen/scripts/main.js?ver=1.36

js sucha24.pl collected 2026-09-24 09:54:49 UTC 17,813 bytes, 428 lines download raw bytes

1const audioPlayer = document.querySelector(".player");
2if(typeof(audioPlayer) != 'undefined' && audioPlayer != null) {
3  var audioID = audioData[0].id;
4  const audioObj = audioData.find(obj => obj.id === audioID);
5  
6  var audioTitle = audioObj.title;
7  var audioURL = audioObj.url;
8
9  const audio = new Audio(audioURL);
10
11  audio.addEventListener(
12    "loadeddata",
13    () => {
14      audioPlayer.querySelector(".player__time .player__length").textContent = getTimeCodeFromNum(
15        audio.duration
16      );
17      audioPlayer.querySelector(".player__title").textContent = audioTitle;
18    },
19    false
20  );
21
22  //click on timeline to skip around
23  const timeline = audioPlayer.querySelector(".player__timeline");
24  timeline.addEventListener("click", e => {
25    const timelineWidth = window.getComputedStyle(timeline).width;
26    const timeToSeek = e.offsetX / parseInt(timelineWidth) * audio.duration;
27    audio.currentTime = timeToSeek;
28  }, false);
29
30  setInterval(() => {
31    const progressBar = audioPlayer.querySelector(".player__progress");
32    progressBar.style.width = audio.currentTime / audio.duration * 100 + "%";
33    audioPlayer.querySelector(".player__time .player__current").textContent = getTimeCodeFromNum(
34      audio.currentTime
35    );
36  }, 500);
37
38  const playBtn = audioPlayer.querySelector(".player__controls .player__toggle-play");
39  const playBtnIcon = audioPlayer.querySelector(".player__controls .player__toggle-play .player__toggle-btn");
40  playBtn.addEventListener(
41    "click",
42    () => {
43      let activePodcastBtn = document.querySelector('#podcast-id-' + audioID + ' .podcast__button .fa');
44      if (audio.paused) {
45        playBtnIcon.classList.remove("fa-play");
46        playBtnIcon.classList.add("fa-pause");
47        podcastButtonsIcons.forEach(button => {
48          button.classList.remove("fa-pause");
49          button.classList.add("fa-play");
50        });
51        if(activePodcastBtn) {
52          activePodcastBtn.classList.remove("fa-play");
53          activePodcastBtn.classList.add("fa-pause");
54        }
55        audio.play();
56        markActive(audioID);
57      } else {
58        playBtnIcon.classList.remove("fa-pause");
59        playBtnIcon.classList.add("fa-play");
60        if(activePodcastBtn) {
61          activePodcastBtn.classList.add("fa-play");
62          activePodcastBtn.classList.remove("fa-pause");
63        } else {
64          activePodcastBtn.classList.remove("fa-play");
65          activePodcastBtn.classList.add("fa-pause");
66        }
67        audio.pause();
68      }
69    },
70    false
71  );
72
73  audioPlayer.querySelector(".player__vol-button").addEventListener("click", () => {
74    const volumeBtn = audioPlayer.querySelector(".player__vol-button .fas");
75    audio.muted = !audio.muted;
76    if (audio.muted) {
77      volumeBtn.classList.remove("fa-volume-up");
78      volumeBtn.classList.add("fa-volume-mute");
79    } else {
80      volumeBtn.classList.add("fa-volume-up");
81      volumeBtn.classList.remove("fa-volume-mute");
82    }
83  });
84
85  //turn 60 seconds into 1:00
86  function getTimeCodeFromNum(num) {
87    let seconds = parseInt(num);
88    let minutes = parseInt(seconds / 60);
89    seconds -= minutes * 60;
90    const hours = parseInt(minutes / 60);
91    minutes -= hours * 60;
92
93    if (hours === 0) return `${minutes}:${String(seconds % 60).padStart(2, 0)}`;
94    return `${String(hours).padStart(2, 0)}:${minutes}:${String(
95      seconds % 60
96    ).padStart(2, 0)}`;
97  }
98
99  // change audio ID
100  let podcastButtons = document.querySelectorAll('.podcast__button');
101  let podcastButtonsIcons = document.querySelectorAll('.podcast__button i');
102
103  let changeAudio = (newAudioID) => {
104    var newAudioID = parseInt(newAudioID);
105    if( audioID === newAudioID ) {
106      playBtn.click();
107      return;
108    } else {
109      audioID = newAudioID;
110      const newAudioObj = audioData.find(obj => obj.id === audioID);
111      audioTitle = newAudioObj.title;
112      audioURL = newAudioObj.url;
113      audio.src = audioURL;
114      playBtn.click();
115    }
116  }
117  podcastButtons.forEach((item) => {
118    item.addEventListener('click', () => changeAudio(item.getAttribute('data-audio-id')));
119  });
120
121  // mark active podcast
122  function markActive(elementID) {
123    const podcastElements = document.querySelectorAll('.podcast-list__list .podcast-list__item');
124    podcastElements.forEach((podcastItem) => {
125      if( podcastItem.getAttribute('id') === "podcast-id-" + elementID ) {
126        podcastItem.classList.add("active");
127      } else {
128        podcastItem.classList.remove("active");
129      }
130    });
131  }
132}
133$(document).ready(function(){
134    $('.button-toggle').each(function () {
135        var $this = $(this);
136        $this.on("click", function (e) {
137            var target = $(this).data('target');
138            e.preventDefault();
139            $('.toggle').each(function () {
140                if($(this).attr('id') == target) {
141                    $(this).toggleClass("is--active");
142                    $('body').toggleClass("m--ovh");
143                } else {
144                    $(this).removeClass("is--active");
145                    $('body').toggleClass("m--ovh");
146                };
147            });
148        });
149    });
150});
151
152
153if(window.innerWidth < 426) {
154    const accordion = document.getElementsByClassName('catalog__block');
155
156    for (i=0; i<accordion.length; i++) {
157    accordion[i].addEventListener('click', function () {
158
159        clearAccordions();
160
161        this.classList.toggle('catalog__block--active')
162    })
163    }
164}
165
166function clearAccordions() {
167    const accordions = document.getElementsByClassName('catalog__block');
168    for (j=0; j<accordions.length; j++) {
169        if(accordions[j].classList.contains('catalog__block--active')) {
170            accordions[j].classList.remove('catalog__block--active');
171        }
172    }
173}
174
175const contextBtn = document.getElementsByClassName('context-menu__button');
176
177for (i=0; i<contextBtn.length; i++) {
178contextBtn[i].addEventListener('click', function () {
179
180    toggleContextMenu(this);
181});
182}
183
184
185function toggleContextMenu(contextMenu) {
186    let  contextMenuDOM = contextMenu.parentNode.querySelector('.context-menu');
187    contextMenuDOM.classList.toggle("is--shown");
188
189}
190    const openDrawerButtons = document.querySelectorAll('.open-drawer'),
191    drawer = document.querySelector('.drawer'),
192    closeDrawerButtons = document.querySelectorAll('.close-drawer');
193
194    openDrawerButtons.forEach(openBtn => {
195    openBtn.addEventListener('click', opendrawer)
196    });
197
198    closeDrawerButtons.forEach(closeBtn => {
199    closeBtn.addEventListener('click', closedrawer)
200    });
201
202    function opendrawer(e) {
203        e.preventDefault();
204    drawer.classList.add('visible');
205    body.classList.add('m--ovh');
206
207    }
208
209    function closedrawer(e) {
210        e.preventDefault();
211    drawer.classList.remove('visible');
212    body.classList.remove('m--ovh');
213    }
214$(document).ready(function(){
215    $('.filters__toggle').each(function () {
216        var $this = $(this);
217        $this.on("click", function (e) {
218            var target = $(this).data('target');
219            e.preventDefault();
220            $('.filters').each(function () {
221                if($(this).attr('id') == target) {
222                    $(this).toggleClass("is--shown");
223                    $('body').toggleClass("m--ovh");
224                } else {
225                    $(this).removeClass("is--shown");
226                    $('body').toggleClass("m--ovh");
227                };
228            });
229        });
230    });
231});
232
233
234/*jQuery easy ticker v3.5.0 - (c) 2022 Aakash Chakravarthy*/
235!function(p,u){var e="easyTicker",d={direction:"up",easing:"swing",speed:"slow",interval:2e3,height:"auto",visible:0,mousePause:!0,autoplay:!0,controls:{up:"",down:"",toggle:"",playText:"Play",stopText:"Stop"},callbacks:{before:!1,after:!1,finish:!1}};function i(t,e){var a=this;function i(){a.opts.autoplay&&o()}function o(){0==a.timer&&(a.timer=setInterval(function(){s(a.opts.direction)},a.opts.interval),p(a.opts.controls.toggle).addClass("et-run").html(a.opts.controls.stopText))}function n(){clearInterval(a.timer),a.timer=0,p(a.opts.controls.toggle).removeClass("et-run").html(a.opts.controls.playText)}function s(t){var e,i,o;if(!a.moving&&a.elem.is(":visible")){o="up"==t?(e=":first-child",i="-=","appendTo"):(e=":last-child",i="+=","prependTo");var n=a.targ.children(e),s=n.outerHeight();"function"==typeof a.opts.callbacks.before&&a.opts.callbacks.before.call(a,a.targ,n),a.moving=!0,a.targ.stop(!0,!0).animate({top:i+s+"px"},a.opts.speed,a.opts.easing,function(){n.hide()[o](a.targ).fadeIn(),a.targ.css("top",0),c(!0),a.moving=!1,"function"==typeof a.opts.callbacks.after&&a.opts.callbacks.after.call(a,a.targ,n)})}}function l(t){n(),s("up"==t?"up":"down")}function c(t){var e,i,o,n,s;"auto"==a.opts.height&&(0<a.opts.visible?(o=t,n=0,s="et-item-visible",a.targ.children().removeClass(s),a.targ.children(":lt("+a.opts.visible+")").each(function(){n+=p(this).outerHeight(),p(this).addClass(s)}),o?a.elem.stop(!0,!0).animate({height:n},a.opts.speed,function(){r()}):a.elem.css("height",n)):(e=0,i=a.elem.css("display"),a.elem.css("display","block"),a.targ.children().each(function(){e+=p(this).outerHeight()}),a.elem.css({display:i,height:e}))),t||r()}function r(){"function"==typeof a.opts.callbacks.finish&&a.opts.callbacks.finish.call(a,a.targ)}return a.opts=p.extend({},d,e),a.elem=p(t),a.targ=p(t).children(":first-child"),a.timer=0,a.moving=!1,a.elem.children().css("margin",0).children().css("margin",0),a.elem.css({position:"relative",height:a.opts.height,overflow:"hidden"}),a.targ.css({position:"absolute",margin:0}),c(!1),i(),function(){var t,e;void 0!==u.hidden?(t="hidden",e="visibilitychange"):void 0!==u.msHidden?(t="msHidden",e="msvisibilitychange"):void 0!==u.webkitHidden&&(t="webkitHidden",e="webkitvisibilitychange");u.addEventListener(e,function(){(u[t]?n:i)()},!1)}(),a.opts.mousePause&&a.elem.on("mouseenter",function(){a.timerTemp=a.timer,n()}).on("mouseleave",function(){0!==a.timerTemp&&i()}),p(a.opts.controls.up).on("click",function(t){t.preventDefault(),l("up")}),p(a.opts.controls.down).on("click",function(t){t.preventDefault(),l("down")}),p(a.opts.controls.toggle).on("click",function(t){t.preventDefault(),(0==a.timer?i:n)()}),{up:function(){l("up")},down:function(){l("down")},start:o,stop:n,options:a.opts}}p.fn[e]=function(t){return this.each(function(){p.data(this,e)||p.data(this,e,new i(this,t))})}}(jQuery,(window,document));
236$(document).ready(function(){
237    $('.tabs-trigger').each(function () {
238        var $this = $(this);
239        $this.on("click", function (e) {
240            var target = $(this).data('target');
241            var parent = $(this).closest('.box').attr('id');
242
243            e.preventDefault();
244            $('#' + parent + ' .tabs__tab').removeClass("tabs__tab--active");
245            $(this).addClass("tabs__tab--active");
246            $('#' + parent + ' .tabs__content').each(function () {
247                if($(this).attr('id') == target) {
248                    $(this).addClass("tabs__content--active")
249                } else {
250                    $(this).removeClass("tabs__content--active");
251                };
252            });
253        });
254    });
255    $(".tabs-trigger, .tabs__content").click(function (e) {
256        e.stopPropagation();
257    });
258});
259let mobileSidebarTrigger = document.getElementById('mobile-sidebar-trigger');
260
261if(mobileSidebarTrigger) {
262    let mobileSidebarTriggerClose = document.getElementById('mobile-sidebar-trigger-close');
263    // var mobileSidebarBackdrop = mobileSidebarBackdrop[0];
264    let mobileSidebar = document.getElementById('mobile-sidebar');
265
266
267    mobileSidebarTrigger.addEventListener('click', (e) => {
268        e.preventDefault();
269        if(!mobileSidebar.classList.contains('site-header__mobile-sidebar--shown')) {
270            mobileSidebar.classList.add('site-header__mobile-sidebar--shown');
271            document.body.classList.add('m--ovh');
272        }
273    });
274
275    mobileSidebarTriggerClose.addEventListener('click', (e) => {
276        e.preventDefault();
277        if(mobileSidebar.classList.contains('site-header__mobile-sidebar--shown')) {
278            mobileSidebar.classList.remove('site-header__mobile-sidebar--shown');
279            document.body.classList.remove('m--ovh');
280        }
281    });
282}
283
284// let drawerTrigger = document.getElementById('drawer-trigger');
285
286// if(drawerTrigger) {
287//     let drawerTriggerClose = document.getElementById('drawer-trigger-close');
288//     let drawer = document.getElementById('mobile-drawer');
289
290
291//     drawerTrigger.addEventListener('click', (e) => {
292//         e.preventDefault();
293//         if(!drawer.classList.contains('drawer--shown')) {
294//             drawer.classList.add('drawer--shown');
295//             document.body.classList.add('m--ovh');
296//         }
297//     });
298
299//     drawerTriggerClose.addEventListener('click', (e) => {
300//         e.preventDefault();
301//         if(drawer.classList.contains('drawer--shown')) {
302//             drawer.classList.remove('drawer--shown');
303//             document.body.classList.remove('m--ovh');
304//         }
305//     });
306// }
307$(window).scroll(function () {
308    var windscroll = $(window).scrollTop();
309    
310    if($(".page__filters").length && $(window).width() < 768) { 
311        var $filters = $('.page__filters');
312        var filtersTop = $filters.offset().top;
313        var filtersBottom = filtersTop + $filters.outerHeight(true);
314 
315        if (windscroll >= filtersBottom) {
316            $(".page-filters").addClass("page-filters--fixed");
317            } else if (windscroll < filtersTop) {
318            $(".page-filters").removeClass("page-filters--fixed");
319        }
320    } else {
321        if (windscroll >= 60) {
322                $('header.site-header').addClass('site-header--scrolled');
323                if ($('.site-header__wrapper').hasClass("site-header__wrapper--centered-logo")) {
324                    $('.site-header__wrapper').addClass("site-header__wrapper--scrolled");
325                }
326                $('.go-back').addClass('go-back--visible');
327                $('.bottom-bar').addClass('bottom-bar--scrolled');
328        } else {
329            $('header.site-header').removeClass('site-header--scrolled');
330            if ($('.site-header__wrapper').hasClass("site-header__wrapper--centered-logo")) {
331                $('.site-header__wrapper').removeClass("site-header__wrapper--scrolled");
332            }
333            $('.go-back').removeClass('go-back--visible');
334            $('.bottom-bar').removeClass('bottom-bar--scrolled');
335        }
336    }
337});
338scroll();
339
340if($(".body--list").length) {
341    $(function(){
342        var lastScrollTop = 0, delta = 60;
343        $(window).scroll(function(event){
344        var st = $(this).scrollTop();
345        
346        if(Math.abs(lastScrollTop - st) <= delta)
347            return;
348            if ((st > lastScrollTop) && (lastScrollTop>0)) {
349                // $(".site-header").css("top","-90px");
350                
351                // if($(".page__filters").length) { 
352                    $(".page-filters").css("top","-160px");
353                // }
354            } else {
355                // $(".site-header").css("top","0px");
356                
357                // if($(".page__filters").length) { 
358                    $(".page-filters").css("top","0");
359                // }
360            }
361        lastScrollTop = st;
362        });
363    });
364}
365$(document).ready(function(){
366    $('.dropdown-trigger').each(function () {
367        var $this = $(this);
368        $this.on("click", function (e) {
369            var target = $(this).data('target');
370            e.preventDefault();
371            $('.site-nav__dropdown, .mobile-nav__dropdown').each(function () {
372                if($(this).attr('id') == target) {
373                    $(this).toggleClass("site-nav__dropdown--is-shown")
374                } else {
375                    $(this).removeClass("site-nav__dropdown--is-shown");
376                };
377            });
378        });
379    });
380    $(document).click(function () {
381        $('.site-nav__dropdown, .mobile-nav__dropdown').each(function() {
382            var $this = $(this);
383            if ( $this.hasClass("site-nav__dropdown--is-shown") ) {
384                $this.removeClass("site-nav__dropdown--is-shown");
385            };
386        });
387    });
388    $(".dropdown-trigger, .site-nav__dropdown, .mobile-nav__dropdown").click(function (e) {
389        e.stopPropagation();
390    });
391});
392
393
394    const openModalButtons = document.querySelectorAll('.open-modal'),
395    modal = document.querySelector('.modal'),
396    body = document.body;
397    closeModalButtons = document.querySelectorAll('.close-modal');
398
399    openModalButtons.forEach(openBtn => {
400    openBtn.addEventListener('click', openModal)
401    });
402
403    closeModalButtons.forEach(closeBtn => {
404    closeBtn.addEventListener('click', closeModal)
405    });
406
407    function openModal(e) {
408        e.preventDefault();
409    modal.classList.add('visible');
410    body.classList.add('m--ovh');
411    }
412
413    function closeModal(e) {
414        e.preventDefault();
415    modal.classList.remove('visible');
416    body.classList.remove('m--ovh');
417    }
418if ($('.m--stick-to-top').length) {
419    let stickToTopElement = $('.m--stick-to-top').position().top;
420    $(window).scroll(function () {
421        var windscroll = $(window).scrollTop();
422        if (windscroll >= stickToTopElement) {
423            $('.m--stick-to-top').addClass('m--stick-to-top--active');
424        } else {
425            $('.m--stick-to-top').removeClass('m--stick-to-top--active');
426        }
427    });
428}

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.