PageSourceSearch

http://zithromaxtab.com/js/script-3.js

js zithromaxtab.com collected 2026-09-26 17:38:34 UTC 5,728 bytes, 239 lines download raw bytes

1// console.log('match slider loaded 2');
2
3
4
5function loadSlick(){
6	// news video slider
7	if( $('.match-center-slider').length ) {
8		
9		let element = $('.match-center-slider');
10		let settings = element.data('params');
11
12		// console.log('slider loaded');
13		element.slick({
14			arrows: true,
15			prevArrow: '<div class="video-left"><i class="far fa-chevron-left"></i></div>',
16			nextArrow: '<div class="video-right"><i class="far fa-chevron-right"></i></div>',
17			dots: false,
18			centerMode: true,
19			centerPadding: '60px',
20			slidesToShow: 3,
21			slidesToScroll: 1,
22			responsive: [
23				{
24					breakpoint: 1200,
25					settings: {
26					slidesToShow: 3,
27					slidesToScroll: 3,
28					}
29				},
30				{
31					breakpoint: 993,
32					settings: {
33					slidesToShow: 2,
34					slidesToScroll: 2
35					}
36				},
37				{
38					breakpoint: 769,
39					settings: {
40					slidesToShow: 1,
41					slidesToScroll: 1
42					}
43				}
44				],
45			autoplay: false,
46			autoplaySpeed: 5000,
47			adaptiveHeight: true,
48			infinite: false,
49		});
50		element.on("afterChange", function() {
51			slide = $(this).slick('slickCurrentSlide');
52			total = $(this)[0].slick.slideCount;
53
54			var pos = ((100 / total) * slide);
55			$(this).parent().find('.slick-nav-bar .progress').css({'left':pos+'%'});
56		});
57		element.on("setPosition", function() {
58			$('.wow',this).addClass('wow-visible');
59		});
60		element.slick('slickGoTo',settings.desktopViewStart,true);
61
62		
63	}
64	
65
66}
67
68
69
70
71
72
73$(function() {
74
75	$('.rl-slick-feature-slider').slick({
76		arrows: false,
77		//prevArrow: false,
78		//nextArrow: false,
79		dots: true,
80		slidesToShow: 1,
81		slidesToScroll: 1,
82		autoplay: true,
83		autoplaySpeed: 5000,
84		adaptiveHeight: true
85	});
86
87	$('.rl-slick-match-slider').slick({
88		arrows: false,
89		//prevArrow: false,
90		//nextArrow: false,
91		dots: false,
92		slidesToShow: 1,
93		slidesToScroll: 1,
94		autoplay: false,
95		autoplaySpeed: 5000,
96		adaptiveHeight: true,
97		infinite: false
98	});
99
100	// get total matches panels
101	var totalMatches = $('.rl-slick-match-slider .matches').length;
102
103	// determin which panel to load on
104	var slideToLoad = $('.rl-slick-match-slider').data("load-panel");
105	var dates = $('.rl-slick-match-slider').data("all-dates");
106
107
108	$('.rl-slick-match-slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
109	//   console.log('test slide ',nextSlide);
110	});
111
112	$('.controls .next').click(function(e){
113		e.preventDefault();
114		$('.rl-slick-match-slider').slick('slickNext');
115	});
116	$('.controls .prev').click(function(e){
117		e.preventDefault();
118		$('.rl-slick-match-slider').slick('slickPrev');
119	});
120
121	// after the matches slide determin whether to show the nav controls
122	$('.rl-slick-match-slider').on('afterChange', function(event, slick, currentSlide, nextSlide){
123	  	display_nav_controls(currentSlide,totalMatches,dates);
124	});
125
126	// slide to the right slide
127	$('.rl-slick-match-slider').slick('slickGoTo',slideToLoad,true);
128	display_nav_controls(slideToLoad,totalMatches,dates);
129
130
131	function display_nav_controls(currentSlide,totalMatches,dates) {
132		
133		if( (currentSlide+1) ==totalMatches) {
134		  $('.controls .next').hide();
135		} else {
136		  $('.controls .next').show().find('span').html(dates[currentSlide+2]);
137		}
138		if(currentSlide==0) {
139		  $('.controls .prev').hide();
140		} else {
141		  $('.controls .prev').show().find('span').html(dates[currentSlide]);
142		}
143
144		$('.current-date').html(dates[currentSlide+1]);
145
146	}
147
148	// poll live match data
149	var matchesToPoll = new Array();
150	var liveMatches = false;
151	$('.rl-slick-match-slider .matches').each(function(i) {
152		if( $(this).data('live')=='yes') {
153
154			$(this).find('.match').each(function(m){
155				matchID = $(this).data('match-id');
156				matchesToPoll.push(matchID);
157			});
158
159			liveMatches = true;
160		}
161
162	});
163
164	// now poll the live matches
165	if(liveMatches && 1 ==2) {
166
167		var params = {'matches':matchesToPoll.toString(), 'type':'score'};
168
169		setInterval(function(){ 
170
171			$.ajax({
172				url: '/ajaxAPI',
173				data: {'ajax': 1,'type':'loadPlugin','plugin':'match_slider','params':params}
174			}).done(function(data){
175				
176				var mID = 0;
177
178				jsonData = JSON.parse(data);
179
180				//console.log(jsonData);
181				
182				// remove these two lines after testing
183				//jsonData = {"3620":{"matchID":"3620","match_latest":"20:30<br \/><span class=\"uk-kickoff\">UK: 19:30<\/span>"},"3621":{"matchID":"3621","match_latest":"20:00"},"3623":{"matchID":"3623","match_latest":"20:00"},"3622":{"matchID":"3622","match_latest":"10-20"}};
184				//console.log(jsonData);
185
186				// mobile view
187				$('.rl-slick-match-slider .matches').each(function(i) {
188					if( $(this).data('live')=='yes') {
189						$(this).find('.match').each(function(e){
190							mID = $(this).data('match-id');
191							newData = jsonData[mID];
192
193							$(this).find('.match-latest').html(newData.match_latest);
194							$(this).find('.match-inplay-status').html(newData.match_inplay_status);
195
196						});
197					}
198				});
199
200				// desktop view
201				$('.match-center-slider .match').each(function(i) {
202					mID = $(this).data('match-id');
203					newData = jsonData[mID];
204					if(newData) {
205						//console.log(newData,mID);
206						$(this).find('.match-latest').html(newData.match_latest);
207						$(this).find('.match-inplay-status').html(newData.match_inplay_status);
208					}
209				});
210
211			});
212
213		}, 10000);
214
215	}
216
217
218	//console.log(matchesToPoll.toString());
219		
220
221		// console.log('live data');
222
223		// var params = {'divisionID':1};
224
225		// parentPlugin = $('.rugby-league-feature-match-slider');
226
227		// setInterval(function(){ 
228		// // load data
229		// 	parentPlugin.find('.rl-slick-match-slider').load('/ajaxAPI .rl-slick-match-slider > *',{'ajax': 1,'type':'loadPlugin','plugin':'feature_match_slider','params':params}, function(response, status, xhr) {
230		// 		console.log('new data');
231		// 	});
232
233		// }, 3000);
234
235		loadSlick();
236
237	
238	
239});

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.