PageSourceSearch

https://camara-araras.sp.gov.br/Scripts/PgwSlider/pgwslider.js

js camara-araras.sp.gov.br collected 2026-10-02 23:02:59 UTC 29,633 bytes, 754 lines download raw bytes

1/**
2 * PgwSlider - Version 2.3
3 *
4 * Copyright 2014, Jonathan M. Piat
5 * http://pgwjs.com - http://pagawa.com
6 * 
7 * Released under the GNU GPLv3 license - http://opensource.org/licenses/gpl-3.0
8 */
9;(function($){
10    $.fn.pgwSlider = function(options) {
11
12        var defaults = {
13            mainClassName : 'pgwSlider',
14            listPosition : 'right',
15            selectionMode : 'click',
16            transitionEffect : 'fading',
17            autoSlide : true,
18            displayList : false,
19            displayControls : false,
20            touchControls : true,
21            verticalCentering : false,
22            adaptiveHeight : false,
23            maxHeight : null,
24            beforeSlide : null,
25            afterSlide : null,
26            adaptiveDuration : 200,
27            transitionDuration : 500,
28            intervalDuration : 5000
29        };
30
31        if (this.length == 0) {
32            return this;
33        } else if(this.length > 1) {
34            this.each(function() {
35                $(this).pgwSlider(options);
36            });
37            return this;
38        }
39
40        var pgwSlider = this;
41        pgwSlider.plugin = this;
42        pgwSlider.data = [];
43        pgwSlider.config = {};
44        pgwSlider.currentSlide = 0;
45        pgwSlider.slideCount = 0;
46        pgwSlider.resizeEvent = null;
47        pgwSlider.intervalEvent = null;
48        pgwSlider.touchFirstPosition = null;
49        pgwSlider.transitionInProgress = false;
50        pgwSlider.window = $(window);
51
52        // Init
53        var init = function() {
54
55            // Merge user options with the default configuration
56            pgwSlider.config = $.extend({}, defaults, options);
57
58            // Setup
59            setup();
60
61            // Activate interval
62            if (pgwSlider.config.autoSlide) {
63                activateInterval();
64            }
65
66            return true;
67        };
68
69        // Get element
70        var getElement = function(obj) {
71            var element = {};
72
73            // Get link
74            var elementLink = obj.find('a').attr('href');
75            if ((typeof elementLink != 'undefined') && (elementLink != '')) {
76                element.link = elementLink;
77                var elementLinkTarget = obj.find('a').attr('target');
78                if ((typeof elementLinkTarget != 'undefined') && (elementLinkTarget != '')) {
79                    element.linkTarget = elementLinkTarget;
80                }
81            }
82
83            // Get image 
84            var elementThumbnail = obj.find('img').attr('src');
85            if ((typeof elementThumbnail != 'undefined') && (elementThumbnail != '')) {
86                element.thumbnail = elementThumbnail;
87            }
88
89            var elementImage = obj.find('img').attr('data-large-src');
90            if ((typeof elementImage != 'undefined') && (elementImage != '')) {
91                element.image = elementImage;
92            }
93
94            // Get title 
95            var elementSpan = obj.find('span').text();
96            if ((typeof elementSpan != 'undefined') && (elementSpan != '') && (elementSpan != null)) {
97                element.title = elementSpan;
98            } else {
99                var elementTitle = obj.find('img').attr('alt');
100                if ((typeof elementTitle != 'undefined') && (elementTitle != '')) {
101                    element.title = elementTitle;
102                }
103            }
104
105            // Get description
106            var elementDescription = obj.find('img').attr('data-description');
107            if ((typeof elementDescription != 'undefined') && (elementDescription != '')) {
108                element.description = elementDescription;
109            }
110
111            return element;
112        };
113
114        // Update the current height
115        var updateHeight = function(height, animate) {
116
117            // Check maxHeight
118            if (pgwSlider.config.maxHeight) {
119                if (pgwSlider.plugin.width() > 480 && height > pgwSlider.config.maxHeight) {
120                    height = pgwSlider.config.maxHeight;
121                } else if (pgwSlider.plugin.width() <= 480) {
122                    if (height + pgwSlider.plugin.find('.ps-list').height() > pgwSlider.config.maxHeight) {
123                        height = pgwSlider.config.maxHeight - pgwSlider.plugin.find('.ps-list').height();
124                    }
125                }
126            }
127
128            // Prevents multiple calculations in a short time
129            clearTimeout(pgwSlider.resizeEvent);
130            pgwSlider.resizeEvent = setTimeout(function() {
131
132                // Adjust right list
133                var elementHeight = ((height - ((pgwSlider.slideCount - 1) * 6)) / pgwSlider.slideCount);
134                var elementWidth = (100 / pgwSlider.slideCount);
135                pgwSlider.plugin.find('.ps-list > li').css({ width: elementWidth + '%' });
136
137                // Adjust main container
138                if (typeof animate != 'undefined' && animate && pgwSlider.config.maxHeight == null) {
139
140                    if (typeof pgwSlider.plugin.find('.ps-current').animate == 'function') {
141                        pgwSlider.plugin.find('.ps-current').animate({
142                            height: height
143                        }, pgwSlider.config.adaptiveDuration, function() {
144                            pgwSlider.plugin.find('.ps-list > li').animate({ height: elementHeight }, pgwSlider.config.adaptiveDuration);
145                        });
146                    } else {
147                        pgwSlider.plugin.find('.ps-current').css('height', height);
148                        pgwSlider.plugin.find('.ps-list > li').css('height', elementHeight);
149                    }
150
151                } else {
152                    pgwSlider.plugin.find('.ps-current').css('height', height);
153                    pgwSlider.plugin.find('.ps-list > li').css('height', elementHeight);
154                }
155
156                // Vertical alignement
157                if (pgwSlider.config.verticalCentering) {
158
159                    // List elements
160                    pgwSlider.plugin.find('.ps-list > li').each(function(){
161                        if ((elementHeight > 50) && ($(this).find('img').height() > elementHeight)) {
162                            var imageMargin = Math.round(($(this).find('img').height() - elementHeight) / 2);
163                            $(this).find('img').css('margin-top', -imageMargin);
164
165                        } else if ($(this).find('img').height() < elementHeight) {
166                            var imageMargin = Math.round((elementHeight - $(this).find('img').height()) / 2);
167                            $(this).find('img').css('margin-top', imageMargin);
168
169                        } else {
170                            $(this).find('img').css('margin-top', '');
171                        }
172                    });
173
174                    // Current elements
175                    pgwSlider.plugin.find('.ps-current > ul > li').each(function(){
176                        var isVisible = ($(this).css('display') == 'none') ? false : true;
177
178                        if (! isVisible) {
179                            $(this).show();
180                        }
181
182                        if ($(this).show().find('img').height() > height) {
183                            var imageMargin = Math.round(($(this).find('img').height() - height) / 2);
184                            $(this).find('img').css('margin-top', -imageMargin);
185
186                        } else if ($(this).show().find('img').height() < height) {
187                            var imageMargin = Math.round((height - $(this).find('img').height()) / 2);
188                            $(this).find('img').css('margin-top', imageMargin);
189
190                        } else {
191                            $(this).find('img').css('margin-top', '');
192                        }
193
194                        if (! isVisible) {
195                            $(this).hide();
196                        }
197                    });
198                }
199
200            }, 100);
201
202            return true;
203        };
204
205        // Set size class
206        var setSizeClass = function() {
207
208            if (pgwSlider.plugin.width() <= 480) {
209                pgwSlider.plugin.addClass('narrow').removeClass('wide');
210            } else {
211                pgwSlider.plugin.addClass('wide').removeClass('narrow');
212            }
213
214            return true;
215        };
216
217        // Setup
218        var setup = function() {
219
220            // Create container
221            pgwSlider.plugin.removeClass(pgwSlider.config.mainClassName).addClass('ps-list');
222            pgwSlider.plugin.wrap('<div class="' + pgwSlider.config.mainClassName + '"></div>');
223            pgwSlider.plugin = pgwSlider.plugin.parent();
224            pgwSlider.plugin.prepend('<div class="ps-current"><ul></ul><span class="ps-caption"></span></div>');
225            pgwSlider.slideCount = pgwSlider.plugin.find('.ps-list > li').length;
226
227            if (pgwSlider.slideCount == 0) {
228                throw new Error('PgwSlider - No slider item has been found');
229                return false;
230            }
231
232            // Add controls
233            if (pgwSlider.config.displayControls && pgwSlider.slideCount > 1) {
234                pgwSlider.plugin.find('.ps-current').prepend('<span class="ps-prev"><span class="ps-prevIcon"></span></span>');
235                pgwSlider.plugin.find('.ps-current').append('<span class="ps-next"><span class="ps-nextIcon"></span></span>');
236                pgwSlider.plugin.find('.ps-current .ps-prev').click(function() {
237                    pgwSlider.previousSlide();
238                });
239                pgwSlider.plugin.find('.ps-current .ps-next').click(function() {
240                    pgwSlider.nextSlide();
241                });
242            }
243
244            // Disable list
245            if (! pgwSlider.config.displayList) {
246                pgwSlider.plugin.find('.ps-current').css('width', '100%');
247                pgwSlider.plugin.find('.ps-list').hide();
248            }
249
250            // Get slider elements
251            var elementId = 1;
252            pgwSlider.plugin.find('.ps-list > li').each(function() {
253                var element = getElement($(this));
254                element.id = elementId;
255                pgwSlider.data.push(element);
256
257                $(this).addClass('elt_' + element.id);
258
259                // Check element title
260                if (element.title) {
261                    if ($(this).find('span').length == 1) {
262                        if ($(this).find('span').text() == '') {
263                            $(this).find('span').text(element.title);
264                        }
265                    } else {
266                        $(this).find('img').after('<span>' + element.title + '</span>');
267                    }
268                }
269
270                // Set element in the current list
271                var currentElement = $('<li class="elt_' + elementId + '"></li>');
272
273                if (element.image) {
274                    currentElement.html('<img src="' + element.image + '" alt="' + (element.title ? element.title : '') + '">');
275                } else if (element.thumbnail) {
276                    currentElement.html('<img src="' + element.thumbnail + '" alt="' + (element.title ? element.title : '') + '">');
277                }
278
279                if (element.link) {
280                    currentElement.html('<a href="' + element.link + '"' + (element.linkTarget ? ' target="' + element.linkTarget + '"' : '') + '>' + currentElement.html() + '</a>');
281                }
282
283                pgwSlider.plugin.find('.ps-current > ul').append(currentElement);
284
285                // Set selection mode
286                if ((pgwSlider.config.selectionMode == 'mouseOver') && (pgwSlider.config.transitionEffect == 'fading')) {
287                    $(this).css('cursor', 'default').click(function(event) {
288                        event.preventDefault();
289                    }).bind('mouseenter', function(event) {
290                        displayElement(element.id);
291                    });
292                    $(this).find('a').css('cursor', 'default');
293                } else {
294                    $(this).css('cursor', 'pointer').click(function(event) {
295                        event.preventDefault();
296                        displayElement(element.id);
297                    });
298                }
299
300                elementId++;
301            });
302
303            // Set list position
304            if (pgwSlider.config.listPosition == 'left') {
305                pgwSlider.plugin.addClass('listOnTheLeft');
306            }
307
308            // Attach slide events
309            if (pgwSlider.config.autoSlide) {
310                pgwSlider.plugin.on('mouseenter', function() {
311                    clearInterval(pgwSlider.intervalEvent);
312                    pgwSlider.intervalEvent = null;
313                }).on('mouseleave', function() {
314                    activateInterval();
315                });
316            }
317
318            // Display the first element
319            displayElement(1);
320
321            // Set the first height
322            pgwSlider.plugin.find('.ps-current > ul > li.elt_1 img').on('load', function() {
323                setSizeClass();
324
325                var maxHeight = pgwSlider.plugin.find('.ps-current > ul > li.elt_1 img').height();
326                updateHeight(maxHeight);
327
328                pgwSlider.window.resize(function() {
329                    // The new class must be set before the recalculation of the height.
330                    setSizeClass();
331
332                    var maxHeight = pgwSlider.plugin.find('.ps-current > ul > li.elt_' + pgwSlider.currentSlide + ' img').height();
333                    updateHeight(maxHeight, pgwSlider.config.adaptiveHeight);
334                });
335            });
336
337            // Touch controls for current image
338            if (pgwSlider.config.touchControls && pgwSlider.slideCount > 1) {
339
340                pgwSlider.plugin.find('.ps-current').on('touchstart', function(e) {
341                    try {
342                        if (e.originalEvent.touches[0].clientX && pgwSlider.touchFirstPosition == null) {
343                            pgwSlider.touchFirstPosition = e.originalEvent.touches[0].clientX;
344                        }
345                    } catch(e) {
346                        pgwSlider.touchFirstPosition = null;
347                    }
348                });
349
350                pgwSlider.plugin.find('.ps-current').on('touchmove', function(e) {
351                    try {
352                        if (e.originalEvent.touches[0].clientX && pgwSlider.touchFirstPosition != null) {
353                            if (e.originalEvent.touches[0].clientX > (pgwSlider.touchFirstPosition + 50)) {
354                                pgwSlider.touchFirstPosition = null;
355                                pgwSlider.previousSlide();
356                            } else if (e.originalEvent.touches[0].clientX < (pgwSlider.touchFirstPosition - 50)) {
357                                pgwSlider.touchFirstPosition = null;
358                                pgwSlider.nextSlide();
359                            }
360                        }
361                    } catch(e) {
362                        pgwSlider.touchFirstPosition = null;
363                    }
364                });
365
366                pgwSlider.plugin.find('.ps-current').on('touchend', function(e) {
367                    pgwSlider.touchFirstPosition = null;
368                });
369            }
370
371            return true;
372        };
373
374        // Finish element
375        var finishElement = function(element) {
376
377            // Element caption
378            var elementText = '';
379            if (element.title) {
380                elementText += '<b>' + element.title + '</b>';
381            }
382
383            if (element.description) {
384                if (elementText != '') elementText += '<br>';
385                elementText += element.description;
386            }
387
388            if (elementText != '') {
389                if (element.link) {
390                    elementText = '<a href="' + element.link + '"' + (element.linkTarget ? ' target="' + element.linkTarget + '"' : '') + '>' + elementText + '</a>';
391                }
392
393                if (typeof pgwSlider.plugin.find('.ps-caption').fadeIn == 'function') {
394                    pgwSlider.plugin.find('.ps-caption').html(elementText);
395                    pgwSlider.plugin.find('.ps-caption').fadeIn(pgwSlider.config.transitionDuration / 2);
396                } else {
397                    pgwSlider.plugin.find('.ps-caption').html(elementText);
398                    pgwSlider.plugin.find('.ps-caption').show();
399                }
400            }
401
402            // Slider controls
403            if (pgwSlider.config.displayControls) {
404                if (typeof pgwSlider.plugin.find('.ps-current > .ps-prev').fadeIn == 'function') {
405                    pgwSlider.plugin.find('.ps-current > .ps-prev, .ps-current > .ps-next').fadeIn(pgwSlider.config.transitionDuration / 2);
406                } else {
407                    pgwSlider.plugin.find('.ps-current > .ps-prev, .ps-current > .ps-next').show();
408                }
409            }
410
411            // After slide
412            if (typeof pgwSlider.config.afterSlide == 'function') {
413                pgwSlider.config.afterSlide(element.id);
414            }
415
416            // Set the container height
417            if (pgwSlider.config.adaptiveHeight) {
418                var maxHeight = pgwSlider.plugin.find('.ps-current .elt_' + element.id + ' img').height();
419                updateHeight(maxHeight, true);
420            }
421
422            return true;
423        }
424
425        // Fade an element
426        var fadeElement = function(element) {
427            var elementContainer = pgwSlider.plugin.find('.ps-current > ul');
428
429            // Update list items
430            pgwSlider.plugin.find('.ps-list > li').css('opacity', '0.6');
431            pgwSlider.plugin.find('.ps-list > li.elt_' + element.id).css('opacity', '1');
432
433            elementContainer.find('li').not('.elt_' + pgwSlider.currentSlide).not('.elt_' + element.id).each(function(){
434                if (typeof $(this).stop == 'function') {
435                    $(this).stop();
436                }
437                $(this).css('position', '').css('z-index', 1).hide();
438            });
439
440            // Current element
441            if (pgwSlider.currentSlide > 0) {
442                var currentElement = elementContainer.find('.elt_' + pgwSlider.currentSlide);
443
444                if (typeof currentElement.animate != 'function') {
445                    currentElement.animate = function(css, duration, callback) {
446                        currentElement.css(css);
447                        if (callback) {
448                            callback();
449                        }
450                    };
451                }
452
453                if (typeof currentElement.stop == 'function') {
454                    currentElement.stop();
455                }
456
457                currentElement.css('position', 'absolute').animate({
458                    opacity : 0,
459                }, pgwSlider.config.transitionDuration, function() {
460                    currentElement.css('position', '').css('z-index', 1).hide();
461                });
462            }
463
464            // Update current id
465            pgwSlider.currentSlide = element.id;
466
467            // Next element
468            var nextElement = elementContainer.find('.elt_' + element.id);
469
470            if (typeof nextElement.animate != 'function') {
471                nextElement.animate = function(css, duration, callback) {
472                    nextElement.css(css);
473                    if (callback) {
474                        callback();
475                    }
476                };
477            }
478
479            if (typeof nextElement.stop == 'function') {
480                nextElement.stop();
481            }
482
483            nextElement.css('position', 'absolute').show().animate({
484                opacity : 1,
485            }, pgwSlider.config.transitionDuration, function() {
486                nextElement.css('position', '').css('z-index', 2).show();
487                finishElement(element);
488            });
489
490            return true;
491        }
492
493        // Slide an element
494        var slideElement = function(element, direction) {
495            var elementContainer = pgwSlider.plugin.find('.ps-current > ul');
496
497            if (typeof direction == 'undefined') {
498                direction = 'left';
499            }
500
501            if (pgwSlider.currentSlide == 0) {
502                elementContainer.find('.elt_1').css({
503                    position : '',
504                    left : '',
505                    opacity : 1,
506                    'z-index' : 2
507                }).show();
508                pgwSlider.plugin.find('.ps-list > li.elt_1').css('opacity', '1');
509                finishElement(element);
510
511            } else {
512
513                if (pgwSlider.transitionInProgress) {
514                    return false;
515                }
516
517                pgwSlider.transitionInProgress = true;
518
519                // Get direction details
520                var elementWidth = elementContainer.width();
521
522                if (direction == 'left') {
523                    var elementDest = -elementWidth;
524                    var nextOrigin = elementWidth;
525                } else {
526                    var elementDest = elementWidth;
527                    var nextOrigin = -elementWidth;
528                }
529
530                var currentElement = elementContainer.find('.elt_' + pgwSlider.currentSlide);
531
532                if (typeof currentElement.animate != 'function') {
533                    currentElement.animate = function(css, duration, callback) {
534                        currentElement.css(css);
535                        if (callback) {
536                            callback();
537                        }
538                    };
539                }
540
541                currentElement.css('position', 'absolute').animate({
542                    left : elementDest,
543                }, pgwSlider.config.transitionDuration, function() {
544                    currentElement.css('position', '').css('z-index', 1).css('left', '').css('opacity', 0).hide();
545                });
546
547                // Next element
548                var nextElement = elementContainer.find('.elt_' + element.i
548d);
549
550                if (typeof nextElement.animate != 'function') {
551                    nextElement.animate = function(css, duration, callback) {
552                        nextElement.css(css);
553                        if (callback) {
554                            callback();
555                        }
556                    };
557                }
558
559                nextElement.css('position', 'absolute').css('left', nextOrigin).css('opacity', 1).show().animate({
560                    left : 0,
561                }, pgwSlider.config.transitionDuration, function() {
562                    nextElement.css('position', '').css('left', '').css('z-index', 2).show();
563                    pgwSlider.transitionInProgress = false;
564
565                    // Display new element
566                    pgwSlider.plugin.find('.ps-list > li').css('opacity', '0.6');
567                    pgwSlider.plugin.find('.ps-list > li.elt_' + element.id).css('opacity', '1');
568
569                    finishElement(element);
570                });
571            }
572
573            // Update current id
574            pgwSlider.currentSlide = element.id;
575
576            return true;
577        }
578
579        // Display the current element
580        var displayElement = function(elementId, apiController, direction) {
581
582            if (elementId == pgwSlider.currentSlide) {
583                return false;
584            }
585
586            var element = pgwSlider.data[elementId - 1];
587
588            if (typeof element == 'undefined') {
589                throw new Error('PgwSlider - The element ' + elementId + ' is undefined');
590                return false;
591            }
592
593            if (typeof direction == 'undefined') {
594                direction = 'left';
595            }
596
597            // Before slide
598            if (typeof pgwSlider.config.beforeSlide == 'function') {
599                pgwSlider.config.beforeSlide(elementId);
600            }
601
602            if (typeof pgwSlider.plugin.find('.ps-caption').fadeOut == 'function') {
603                pgwSlider.plugin.find('.ps-caption, .ps-prev, .ps-next').fadeOut(pgwSlider.config.transitionDuration / 2);
604            } else {
605                pgwSlider.plugin.find('.ps-caption, .ps-prev, .ps-next').hide();
606            }
607
608            // Choose the transition effect
609            if (pgwSlider.config.transitionEffect == 'sliding') {
610                slideElement(element, direction);
611            } else {
612                fadeElement(element);
613            }
614
615            // Reset interval to avoid a half interval after an API control
616            if (typeof apiController != 'undefined' && pgwSlider.config.autoSlide) {
617                activateInterval();
618            }
619
620            return true;
621        };
622
623        // Activate interval
624        var activateInterval = function() {
625            clearInterval(pgwSlider.intervalEvent);
626
627            if (pgwSlider.slideCount > 1 && pgwSlider.config.autoSlide) {
628                pgwSlider.intervalEvent = setInterval(function() {
629                    if (pgwSlider.currentSlide + 1 <= pgwSlider.slideCount) {
630                        var nextItem = pgwSlider.currentSlide + 1;
631                    } else {
632                        var nextItem = 1;
633                    }
634                    displayElement(nextItem);
635                }, pgwSlider.config.intervalDuration);
636            }
637
638            return true;
639        };
640
641        // Start auto slide
642        pgwSlider.startSlide = function() {
643            pgwSlider.config.autoSlide = true;
644            activateInterval();
645            return true;
646        };
647
648        // Stop auto slide
649        pgwSlider.stopSlide = function() {
650            pgwSlider.config.autoSlide = false;
651            clearInterval(pgwSlider.intervalEvent);
652            return true;
653        };
654
655        // Get current slide
656        pgwSlider.getCurrentSlide = function() {
657            return pgwSlider.currentSlide;
658        };
659
660        // Get slide count
661        pgwSlider.getSlideCount = function() {
662            return pgwSlider.slideCount;
663        };
664
665        // Display slide
666        pgwSlider.displaySlide = function(itemId) {
667            displayElement(itemId, true);
668            return true;
669        };
670
671        // Next slide
672        pgwSlider.nextSlide = function() {
673            if (pgwSlider.currentSlide + 1 <= pgwSlider.slideCount) {
674                var nextItem = pgwSlider.currentSlide + 1;
675            } else {
676                var nextItem = 1;
677            }
678            displayElement(nextItem, true, 'left');
679            return true;
680        };
681
682        // Previous slide
683        pgwSlider.previousSlide = function() {
684            if (pgwSlider.currentSlide - 1 >= 1) {
685                var previousItem = pgwSlider.currentSlide - 1;
686            } else {
687                var previousItem = pgwSlider.slideCount;
688            }
689            displayElement(previousItem, true, 'right');
690            return true;
691        };
692
693        // Destroy slider
694        pgwSlider.destroy = function(soft) {
695            clearInterval(pgwSlider.intervalEvent);
696
697            if (typeof soft != 'undefined') {
698                pgwSlider.plugin.find('.ps-list > li').each(function() {
699                    $(this).attr('style', null).removeClass().css('cursor', '').unbind('click').unbind('mouseenter');
700                    $(this).find('a').css('cursor', '');
701                    $(this).find('img').attr('style', null);
702                });
703
704                pgwSlider.plugin.find('.ps-list').addClass(pgwSlider.config.mainClassName).removeClass('ps-list');
705                pgwSlider.plugin.find('.ps-current').unwrap().remove();
706                pgwSlider.hide();
707
708            } else {
709                pgwSlider.parent().remove();
710            }
711
712            pgwSlider.plugin = null;
713            pgwSlider.data = [];
714            pgwSlider.config = {};
715            pgwSlider.currentSlide = 0;
716            pgwSlider.slideCount = 0;
717            pgwSlider.resizeEvent = null;
718            pgwSlider.intervalEvent = null;
719            pgwSlider.touchFirstPosition = null;
720            pgwSlider.transitionInProgress = false;
721            pgwSlider.window = null;
722
723            return true;
724        };
725
726        // Reload slider
727        pgwSlider.reload = function(newOptions) {
728            pgwSlider.destroy(true);
729
730            pgwSlider = this;
731            pgwSlider.plugin = this;
732            pgwSlider.window = $(window);
733            pgwSlider.plugin.show();
734
735            // Merge new options with the default configuration
736            pgwSlider.config = $.extend({}, defaults, newOptions);
737
738            // Setup
739            setup();
740
741            // Activate interval
742            if (pgwSlider.config.autoSlide) {
743                activateInterval();
744            }
745
746            return true;
747        };
748
749        // Slider initialization
750        init();
751
752        return this;
753    }
754})(window.Zepto || window.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.