PageSourceSearch

https://celestynow.pl/js/sam3/concept.newsbox.0.5b.js

js celestynow.pl collected 2026-10-02 20:35:51 UTC 4,100 bytes, 165 lines download raw bytes

1if (typeof globalpause == 'undefined') {
2	globalPause=false;
3}
4
5/* przeniesione z portal.php */
6function newsboxrespo() {
7    var height;
8    height = jQuery(".newsbox-container li.zaj-wrapper.active").outerHeight();				
9    jQuery(".newsbox-container").css("height",height);
10}
11
12jQuery(window).on("load", function () {
13	newsboxrespo();			
14	setTimeout(function(){ newsboxrespo(); }, 300);  	
15});
16
17
18
19var createNewsbox;
20createNewsbox = function(newsboxParams) {
21	
22	var localPause = false;
23	var focusPause = false;
24	
25	var currentNews = 0;
26	var total = 0;
27	
28	var sliderTimer;
29	
30	
31	//container,slideClass,pager,pagerNumbers,arrows,progressBar
32	var params = newsboxParams;
33	var con = jQuery(params.containerClass);
34	var slides = jQuery(con).find(params.singleSlideClass);
35	var pagerButtons = [];
36	
37	total = slides.length;
38	
39	//	ustaw paametry jako false je�li nie okreslone
40	if (!params.showPager) params.showPager = false;
41	if (!params.showPagerNumbers) params.showPagerNumbers = false;
42	if (!params.showNavigationArrows) params.showNavigationArrows = false;
43	if (!params.showTimer) params.showTimer = false;
44	if (!params.delay) params.delay = 5000;
45	if (!params.mouseHoverPauseDuration) params.mouseHoverPauseDuration = 1000;
46	
47
48	//	slides data
49	for (var i=0;i<slides.length;i++){
50		jQuery(slides[i]).attr('data-news-id',(i+1));
51	}
52	
53	//	timer
54	if (params.showTimer) {
55		timer = jQuery('<span class="timer"></span>');
56		timerBar = jQuery('<span class="timer-bar"></span>');
57		jQuery(timer).append(timerBar);
58		jQuery(con).append(timer);
59	}
60	
61	//	pager
62	if (params.showPager) {
63		pager = jQuery('<span class="pager" aria-hidden="true"></span>');
64		
65		for (var i=0;i<slides.length;i++){
66			var pagerButtonContent = '';
67			if (params.showPagerNumbers) pagerButtonContent=(i+1);
68			button = jQuery('<span class="pager-button" data-news-id="'+(i+1)+'"><span class="hidden-wcag">Przejdź na stronę: </span>'+pagerButtonContent+'</span>');
69			pagerButtons.push(button);
70			jQuery(pager).append(button);
71		};
72		jQuery(con).append(pager);
73		
74		jQuery('.pager-button',pager).click(function(){
75			if (!jQuery(this).hasClass('active')){
76				nextNews = jQuery(this).attr('data-news-id');
77				showNews(nextNews);
78			}
79		});
80	}
81	
82	//	navigation arrows
83	if (params.showNavigationArrows) {
84		navArrows = jQuery('<span class="nav-arrows" aria-hidden="true"></span>');
85		prev = jQuery('<span class="nav-arrow prev">PREV</span>');
86		next = jQuery('<span class="nav-arrow next">NEXT</span>');
87		jQuery(navArrows).append(prev).append(next);
88		jQuery(con).append(navArrows);
89		
90		//	prev click
91		jQuery(prev).click(function(){
92			showPrevNews();
93		});
94		
95		//	next click
96		jQuery(next).click(function(){
97			showNextNews();
98		});
99	}
100	
101	//	focus
102	jQuery(con).focusout(function(){
103		jQuery(con).removeClass('focused');
104		focusPause = false;
105		startTimer();
106	});
107	jQuery(params.singleSlideClass,con).focusin(function(){
108		jQuery(con).addClass('focused');
109		focusPause = true;
110		stopTimer();
111
112		nextNews = jQuery(this).attr('data-news-id');
113		showNews(nextNews);
114	});
115	
116	//	init
117	currentNews = 1;
118	showNews(currentNews);
119	startTimer();
120	
121	function showNews(newsId){
122		currentNews = parseInt(newsId);
123		newsId--;
124		jQuery(params.singleSlideClass,con).removeClass('active');
125		jQuery(slides[newsId]).addClass('active');
126		
127		jQuery('.pager-button',con).removeClass('active');
128		jQuery(pagerButtons[newsId]).addClass('active');
129		newsboxrespo();
130	}	
131	
132	function showPrevNews(){
133		nextNews = currentNews-1;
134		if (nextNews===0) {nextNews = total;}
135		showNews(nextNews);
136	}
137	function showNextNews(){
138		nextNews = currentNews+1;
139		if (nextNews>total) {nextNews = 1;}
140		showNews(nextNews);				
141		newsboxrespo();
142	}
143	
144	function startTimer(){
145		clearInterval(sliderTimer);
146		sliderTimer = setInterval(function(){
147			if (!globalPause && !focusPause && !localPause) showNextNews();
148		}, params.delay);
149	}
150	function stopTimer(){
151		clearInterval(sliderTimer);
152	}
153	
154	jQuery(con).mouseenter(function(){
155		localPause=true;
156		stopTimer()
157	});
158	
159	jQuery(con).mouseleave(function(){
160		localPause=false;
161		if (!localPause){
162			startTimer();
163		}
164	});
165}

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.