PageSourceSearch

https://www.hdct.at/modules/mod_eblogocarousel_4x/assets/js/slider_stack.js?v=1988495009

js hdct.at collected 2026-10-09 23:03:09 UTC 11,767 bytes, 352 lines download raw bytes

1(function($){
2
3    $.fn.multislider = function(data, callback){
4
5
6        var $multislider = $(this);
7        var $msContent = $multislider.find('.eblc-content');
8        var $msRight = $multislider.find('button.eblc-right');
9        var $msLeft = $multislider.find('button.eblc-left');
10        var $imgFirst = $msContent.find('.item:first');
11        if(typeof data === 'string'){
12            getStringArgs(data);
13            return $multislider;
14        } else if (typeof data === 'object' || typeof data  ==='undefined'){
15            init();
16        }
17
18        var $imgLast,
19        totalWidth,
20        numberVisibleSlides,
21        animateDistance,
22        animateSlideRight,
23        animateSlideLeft,
24        defaults,
25        settings,
26        animateDuration,
27        autoSlideInterval;
28
29
30        function init(){
31            minifyContent();        
32            createSettings();      
33            saveData();            
34            selectAnimations();   
35        }
36
37
38        $msRight.on('click', animateSlideLeft);
39        $msLeft.on('click', animateSlideRight);
40        $multislider.on('click','.eblc-right, .eblc-left', resetInterval);
41        $(window).on('resize', findItemWidth);
42
43        function pauseAbove(){
44            if (window.innerWidth > settings.pauseAbove){ $multislider.addClass('ms-PAUSE'); }
45            $(window).on('resize',function(){
46                if (window.innerWidth > settings.pauseAbove){
47                    $multislider.addClass('ms-PAUSE');
48                } else {
49                    $multislider.removeClass('ms-PAUSE');
50                }
51            });
52        }
53
54        function pauseBelow(){
55            if (window.innerWidth < settings.pauseBelow){ $multislider.addClass('ms-PAUSE'); }
56            $(window).on('resize',function(){
57                if (window.innerWidth < settings.pauseBelow){
58                    $multislider.addClass('ms-PAUSE');
59                } else {
60                    $multislider.removeClass('ms-PAUSE');
61                }
62            });
63        }
64
65
66        function getStringArgs(str){
67            if (typeof $multislider.data(str) !== 'undefined'){
68                $multislider.data(str)();
69            } else {
70                console.error("Multislider currently only accepts the following methods: next, prev, pause, play");
71            }
72        }
73
74
75        function saveData(){
76            $multislider.data({
77                "pause":function(){ $multislider.addClass('ms-PAUSE'); },
78                "unPause":function(){ $multislider.removeClass('ms-PAUSE'); },
79                "continuous":function(){ $multislider.removeClass('ms-PAUSE'); continuousLeft(); },
80                "next":function(){ overRidePause(singleLeft); },
81                "nextAll":function(){ overRidePause(allLeft); },
82                "prev":function(){ overRidePause(singleRight); },
83                "prevAll":function(){ overRidePause(allRight); },
84                "settings":settings
85            });
86        }
87
88
89        function overRidePause(animation){
90            if ($multislider.hasClass('ms-PAUSE')){
91                $multislider.removeClass('ms-PAUSE');
92                animation();
93                $multislider.addClass('ms-PAUSE');
94            } else {
95                animation();
96            }
97            resetInterval();
98        }
99
100
101        function minifyContent(){
102            $msContent.contents().filter(function(){
103                return (this.nodeType == 3 && !/\S/.test(this.nodeValue));
104            }).remove();
105        }
106
107
108        function createSettings() {
109            defaults = settings || {
110    			continuous: false,	
111    			slideAll: false,	
112    			autoSlide: false,	
113    			interval: 2000,		
114    			duration: 500,	    
115    			hoverPause: true,	
116                pauseAbove: null,   
117                pauseBelow: null    
118    		};
119
120    		settings = $.extend({},defaults,data);
121
122            findItemWidth();
123            animateDuration = settings.duration;
124
125            if (settings.hoverPause){pauseHover();}
126        
127            if (settings.continuous !== true && settings.interval !== 0 && settings.interval !== false && settings.autoSlide !== false){autoSlide();}
128            if (settings.pauseAbove !== null && typeof settings.pauseAbove === 'number'){ pauseAbove(); }
129            if (settings.pauseBelow !== null && typeof settings.pauseBelow === 'number'){ pauseBelow(); }
130        }
131
132
133        function selectAnimations () {
134            if (settings.continuous){
135                settings.autoSlide = false;
136                continuousLeft();
137            } else if (settings.slideAll){
138                animateSlideRight = $multislider.data('prevAll');
139                animateSlideLeft = $multislider.data('nextAll');
140            } else {
141                animateSlideRight = $multislider.data('prev');
142                animateSlideLeft = $multislider.data('next');
143            }
144        }
145
146
147        function findItemWidth(){
148            reTargetSlides();
149            animateDistance = $imgFirst.width();
150            var left = parseInt($msContent.find('.item:first').css('padding-left'));
151            var right = parseInt($msContent.find('.item:first').css('padding-right'));
152            if (left !== 0){animateDistance += left;}
153            if (right !== 0){animateDistance += right;}
154        }
155
156
157        function autoSlide() {
158            autoSlideInterval = setInterval(function(){
159                if (!$multislider.hasClass('ms-PAUSE')){
160                    animateSlideLeft();
161                }
162            }, settings.interval);
163        }
164
165        function resetInterval() {
166            if (settings.interval !== 0 && settings.interval !== false && settings.continuous !== true){
167                clearInterval(autoSlideInterval);
168                if(settings.autoSlide == true){
169                     autoSlide();
170                }
171                
172            }
173        }
174
175
176        function reTargetSlides(){
177            $imgFirst = $msContent.find('.item:first');
178            $imgLast = $msContent.find('.item:last');
179        }
180
181
182
183        function isItAnimating(callback){
184			if(!$multislider.hasClass('ms-animating') &&
185               !$multislider.hasClass('ms-HOVER') &&
186               !$multislider.hasClass('ms-PAUSE')){
187                    $multislider.trigger('ms.before.animate'); 
188                    $multislider.addClass('ms-animating');
189                    callback();    
190			}
191		}
192
193
194        function doneAnimating() {
195			if($multislider.hasClass('ms-animating')){
196				$multislider.removeClass('ms-animating');
197                $multislider.trigger('ms.after.animate'); 
198            }
199		}
200
201
202        function pauseHover() {
203        
204            if(settings.continuous){
205				$msContent.on('mouseover',function(){
206					doneAnimating();
207					$msContent.children('.item:first').stop();
208				});
209				$msContent.on('mouseout',function(){
210					continuousLeft();
211				});
212			} else {
213        
214                $msContent.on('mouseover',function(){
215                    $multislider.addClass('ms-HOVER');
216                });
217                $msContent.on('mouseout',function(){
218                    $multislider.removeClass('ms-HOVER');
219                });
220			}
221        }
222
223
224        function midAnimateResume(){
225            animateDuration = settings.duration;
226            var currentMargin = parseFloat($msContent.find('.item:first').css("margin-left"));
227            var percentageRemaining = 1-(currentMargin/-(animateDistance-1));
228            animateDuration = percentageRemaining*animateDuration;
229        }
230
231
232        function calcNumSlidesToMove(){
233            totalWidth = $msContent.width();						         
234		    // numberVisibleSlides = Math.floor(totalWidth/animateDistance); 
235            numberVisibleSlides = settings.numberVisibleSlides;   
236        }
237
238
239
240
241        function continuousLeft () {
242            isItAnimating(function(){
243                reTargetSlides();
244                midAnimateResume();
245                $imgFirst.animate(
246                    {marginLeft: -(animateDistance+1)},
247                    {
248                        duration: animateDuration,
249                        easing: "linear",
250                        complete: function(){
251                            $imgFirst.insertAfter($imgLast).removeAttr("style");
252                            doneAnimating();
253                            continuousLeft ();
254                        }
255                    }
256                );
257            });
258        }
259
260        function allLeft(){
261            isItAnimating(function(){
262                reTargetSlides();
263                calcNumSlidesToMove();
264
265                var $clonedItemSet = $msContent.children('.item').clone();
266                var filteredClones = $clonedItemSet.splice(0, numberVisibleSlides);
267
268                $msContent.append(filteredClones);
269
270                $imgFirst.animate(
271                    {marginLeft: -totalWidth}, {
272                        duration: animateDuration,
273                        easing: "swing",
274                        complete: function(){
275                            $($msContent.children('.item').splice(0,numberVisibleSlides)).remove();
276                            doneAnimating();
277                        }
278                    }
279                );
280            });
281        }
282
283        function allRight() {
284            isItAnimating(function(){
285                reTargetSlides();
286                calcNumSlidesToMove();
287
288                var numberTotalSlides = $msContent.children('.item').length;
289                var $clonedItemSet = $msContent.children('.item').clone();
290                var filteredClones = $clonedItemSet.splice(numberTotalSlides-numberVisibleSlides,numberTotalSlides);
291
292                $($(filteredClones)[0]).css('margin-left',-totalWidth); 
293                $msContent.prepend(filteredClones);
294
295                reTargetSlides();
296
297                $imgFirst.animate(
298                    {
299                        marginLeft: 0
300                    }, {
301                        duration: animateDuration,
302                        easing: "swing",
303                        complete: function(){
304                            numberTotalSlides = $msContent.find('.item').length;
305                            $($msContent.find('.item').splice(numberTotalSlides-numberVisibleSlides,numberTotalSlides)).remove();
306                            $imgFirst.removeAttr('style');
307                            doneAnimating();
308                        }
309                    }
310                );
311            });
312        }
313
314        function singleLeft(){
315            isItAnimating(function(){
316                reTargetSlides();
317                $imgFirst.animate(
318                    {
319                        marginLeft: -animateDistance
320                    }, {
321                        duration: animateDuration,
322                        easing: "swing",
323                        complete: function(){
324                            $imgFirst.detach().removeAttr('style').appendTo($msContent);
325                            doneAnimating();
326                        }
327                    }
328                );
329            });
330        }
331
332        function singleRight(){
333            isItAnimating(function(){
334                reTargetSlides();
335                $imgLast.css('margin-left',-animateDistance).prependTo($msContent);
336                $imgLast.animate(
337                    {
338                        marginLeft: 0
339                    }, {
340                        duration: animateDuration,
341                        easing: "swing",
342                        complete: function(){
343                            $imgLast.removeAttr("style");
344                            doneAnimating();
345                        }
346                    }
347                );
348            });
349        } 
350        return $multislider;
351    }
352})(jQuery);

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.