PageSourceSearch

https://pechengator.ru/static_v3/js/baguettebox.js

js pechengator.ru collected 2026-10-03 18:57:14 UTC 27,793 bytes, 763 lines download raw bytes

vendor: 27,793 bytes, lines 1-763
1/*!
2 * baguetteBox.js
3 * @author  feimosi
4 * @version %%INJECT_VERSION%%
5 * @url https://github.com/feimosi/baguetteBox.js
6 */
7
8/* global define, module */
9
10(function (root, factory) {
11    'use strict';
12    if (typeof define === 'function' && define.amd) {
13        define(factory);
14    } else if (typeof exports === 'object') {
15        module.exports = factory();
16    } else {
17        root.baguetteBox = factory();
18    }
19}(this, function () {
20    'use strict';
21
22    // SVG shapes used on the buttons
23    var leftArrow = '<svg width="44" height="60">' +
24        '<polyline points="30 10 10 30 30 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"' +
25        'stroke-linecap="butt" fill="none" stroke-linejoin="round"/>' +
26        '</svg>',
27        rightArrow = '<svg width="44" height="60">' +
28            '<polyline points="14 10 34 30 14 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"' +
29            'stroke-linecap="butt" fill="none" stroke-linejoin="round"/>' +
30            '</svg>',
31        closeX = '<svg width="30" height="30">' +
32            '<g stroke="rgb(160,160,160)" stroke-width="4">' +
33            '<line x1="5" y1="5" x2="25" y2="25"/>' +
34            '<line x1="5" y1="25" x2="25" y2="5"/>' +
35            '</g></svg>';
36    // Global options and their defaults
37    var options = {},
38        defaults = {
39            captions: true,
40            buttons: 'auto',
41            fullScreen: false,
42            noScrollbars: false,
43            bodyClass: 'baguetteBox-open',
44            titleTag: false,
45            async: false,
46            preload: 2,
47            animation: 'slideIn',
48            afterShow: null,
49            afterHide: null,
50            onChange: null,
51            overlayBackgroundColor: 'rgba(0,0,0,.8)'
52        };
53    // Object containing information about features compatibility
54    var supports = {};
55    // DOM Elements references
56    var overlay, slider, previousButton, nextButton, closeButton;
57    // An array with all images in the current gallery
58    var currentGallery = [];
59    // Current image index inside the slider
60    var currentIndex = 0;
61    // Visibility of the overlay
62    var isOverlayVisible = false;
63    // Touch event start position (for slide gesture)
64    var touch = {};
65    // If set to true ignore touch events because animation was already fired
66    var touchFlag = false;
67    // Regex pattern to match image files
68    var regex = /.+\.(gif|jpe?g|png|webp)/i;
69    // Object of all used galleries
70    var data = {};
71    // Array containing temporary images DOM elements
72    var imagesElements = [];
73    // The last focused element before opening the overlay
74    var documentLastFocus = null;
75    var overlayClickHandler = function(event) {
76        // Close the overlay when user clicks directly on the background
77        if (event.target.id.indexOf('baguette-img') !== -1) {
78            hideOverlay();
79        }
80    };
81    var previousButtonClickHandler = function(event) {
82        event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true; // eslint-disable-line no-unused-expressions
83        showPreviousImage();
84    };
85    var nextButtonClickHandler = function(event) {
86        event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true; // eslint-disable-line no-unused-expressions
87        showNextImage();
88    };
89    var closeButtonClickHandler = function(event) {
90        event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true; // eslint-disable-line no-unused-expressions
91        hideOverlay();
92    };
93    var touchstartHandler = function(event) {
94        touch.count++;
95        if (touch.count > 1) {
96            touch.multitouch = true;
97        }
98        // Save x and y axis position
99        touch.startX = event.changedTouches[0].pageX;
100        touch.startY = event.changedTouches[0].pageY;
101    };
102    var touchmoveHandler = function(event) {
103        // If action was already triggered or multitouch return
104        if (touchFlag || touch.multitouch) {
105            return;
106        }
107        event.preventDefault ? event.preventDefault() : event.returnValue = false; // eslint-disable-line no-unused-expressions
108        var touchEvent = event.touches[0] || event.changedTouches[0];
109        // Move at least 40 pixels to trigger the action
110        if (touchEvent.pageX - touch.startX > 40) {
111            touchFlag = true;
112            showPreviousImage();
113        } else if (touchEvent.pageX - touch.startX < -40) {
114            touchFlag = true;
115            showNextImage();
116            // Move 100 pixels up to close the overlay
117        } else if (touch.startY - touchEvent.pageY > 100) {
118            hideOverlay();
119        }
120    };
121    var touchendHandler = function() {
122        touch.count--;
123        if (touch.count <= 0) {
124            touch.multitouch = false;
125        }
126        touchFlag = false;
127    };
128    var contextmenuHandler = function() {
129        touchendHandler();
130    };
131
132    var trapFocusInsideOverlay = function(event) {
133        if (overlay.style.display === 'block' && (overlay.contains && !overlay.contains(event.target))) {
134            event.stopPropagation();
135            initFocus();
136        }
137    };
138
139    // forEach polyfill for IE8
140    // http://stackoverflow.com/a/14827443/1077846
141    /* eslint-disable */
142    if (![].forEach) {
143        Array.prototype.forEach = function(callback, thisArg) {
144            for (var i = 0; i < this.length; i++) {
145                callback.call(thisArg, this[i], i, this);
146            }
147        };
148    }
149
150    // filter polyfill for IE8
151    // https://gist.github.com/eliperelman/1031656
152    if (![].filter) {
153        Array.prototype.filter = function(a, b, c, d, e) {
154            c = this;
155            d = [];
156            for (e = 0; e < c.length; e++)
157                a.call(b, c[e], e, c) && d.push(c[e]);
158            return d;
159        };
160    }
161    /* eslint-enable */
162
163    // Script entry point
164    function run(selector, userOptions) {
165        // Fill supports object
166        supports.transforms = testTransformsSupport();
167        supports.svg = testSvgSupport();
168        supports.passiveEvents = testPassiveEventsSupport();
169
170        buildOverlay();
171        removeFromCache(selector);
172        return bindImageClickListeners(selector, userOptions);
173    }
174
175    function bindImageClickListeners(selector, userOptions) {
176        // For each gallery bind a click event to every image inside it
177        var galleryNodeList = document.querySelectorAll(selector);
178        var selectorData = {
179            galleries: [],
180            nodeList: galleryNodeList
181        };
182        data[selector] = selectorData;
183
184        [].forEach.call(galleryNodeList, function(galleryElement) {
185            if (userOptions && userOptions.filter) {
186                regex = userOptions.filter;
187            }
188
189            // Get nodes from gallery elements or single-element galleries
190            var tagsNodeList = [];
191            if (galleryElement.tagName === 'A') {
192                tagsNodeList = [galleryElement];
193            } else {
194                tagsNodeList = galleryElement.getElementsByTagName('a');
195            }
196
197            // Filter 'a' elements from those not linking to images
198            tagsNodeList = [].filter.call(tagsNodeList, function(element) {
199                if (element.className.indexOf(userOptions && userOptions.ignoreClass) === -1) {
200                    return regex.test(element.href);
201                }
202            });
203            if (tagsNodeList.length === 0) {
204                return;
205            }
206
207            var gallery = [];
208            [].forEach.call(tagsNodeList, function(imageElement, imageIndex) {
209                var imageElementClickHandler = function(event) {
210                    event.preventDefault ? event.preventDefault() : event.returnValue = false; // eslint-disable-line no-unused-expressions
211                    prepareOverlay(gallery, userOptions);
212                    showOverlay(imageIndex);
213                };
214                var imageItem = {
215                    eventHandler: imageElementClickHandler,
216                    imageElement: imageElement
217                };
218                bind(imageElement, 'click', imageElementClickHandler);
219                gallery.push(imageItem);
220            });
221            selectorData.galleries.push(gallery);
222        });
223
224        return selectorData.galleries;
225    }
226
227    function clearCachedData() {
228        for (var selector in data) {
229            if (data.hasOwnProperty(selector)) {
230                removeFromCache(selector);
231            }
232        }
233    }
234
235    function removeFromCache(selector) {
236        if (!data.hasOwnProperty(selector)) {
237            return;
238        }
239        var galleries = data[selector].galleries;
240        [].forEach.call(galleries, function(gallery) {
241            [].forEach.call(gallery, function(imageItem) {
242                unbind(imageItem.imageElement, 'click', imageItem.eventHandler);
243            });
244
245            if (currentGallery === gallery) {
246                currentGallery = [];
247            }
248        });
249
250        delete data[selector];
251    }
252
253    function buildOverlay() {
254        overlay = getByID('baguetteBox-overlay');
255        // Check if the overlay already exists
256        if (overlay) {
257            slider = getByID('baguetteBox-slider');
258            previousButton = getByID('previous-button');
259            nextButton = getByID('next-button');
260            closeButton = getByID('close-button');
261            return;
262        }
263        // Create overlay element
264        overlay = create('div');
265        overlay.setAttribute('role', 'dialog');
266        overlay.id = 'baguetteBox-overlay';
267        document.getElementsByTagName('body')[0].appendChild(overlay);
268        // Create gallery slider element
269        slider = create('div');
270        slider.id = 'baguetteBox-slider';
271        overlay.appendChild(slider);
272        // Create all necessary buttons
273        previousButton = create('button');
274        previousButton.setAttribute('type', 'button');
275        previousButton.id = 'previous-button';
276        previousButton.setAttribute('aria-label', 'Previous');
277        previousButton.innerHTML = supports.svg ? leftArrow : '&lt;';
278        overlay.appendChild(previousButton);
279
280        nextButton = create('button');
281        nextButton.setAttribute('type', 'button');
282        nextButton.id = 'next-button';
283        nextButton.setAttribute('aria-label', 'Next');
284        nextButton.innerHTML = supports.svg ? rightArrow : '&gt;';
285        overlay.appendChild(nextButton);
286
287        closeButton = create('button');
288        closeButton.setAttribute('type', 'button');
289        closeButton.id = 'close-button';
290        closeButton.setAttribute('aria-label', 'Close');
291        closeButton.innerHTML = supports.svg ? closeX : '&times;';
292        overlay.appendChild(closeButton);
293
294        previousButton.className = nextButton.className = closeButton.className = 'baguetteBox-button';
295
296        bindEvents();
297    }
298
299    function keyDownHandler(event) {
300        switch (event.keyCode) {
301            case 37: // Left arrow
302                showPreviousImage();
303                break;
304            case 39: // Right arrow
305                showNextImage();
306                break;
307            case 27: // Esc
308                hideOverlay();
309                break;
310        }
311    }
312
313    function bindEvents() {
314        var options = supports.passiveEvents ? { passive: true } : null;
315        bind(overlay, 'click', overlayClickHandler);
316        bind(previousButton, 'click', previousButtonClickHandler);
317        bind(nextButton, 'click', nextButtonClickHandler);
318        bind(closeButton, 'click', closeButtonClickHandler);
319        bind(slider, 'contextmenu', contextmenuHandler);
320        bind(overlay, 'touchstart', touchstartHandler, options);
321        bind(overlay, 'touchmove', touchmoveHandler, options);
322        bind(overlay, 'touchend', touchendHandler);
323        bind(document, 'focus', trapFocusInsideOverlay, true);
324    }
325
326    function unbindEvents() {
327        var options = supports.passiveEvents ? { passive: true } : null;
328        unbind(overlay, 'click', overlayClickHandler);
329        unbind(previousButton, 'click', previousButtonClickHandler);
330        unbind(nextButton, 'click', nextButtonClickHandler);
331        unbind(closeButton, 'click', closeButtonClickHandler);
332        unbind(slider, 'contextmenu', contextmenuHandler);
333        unbind(overlay, 'touchstart', touchstartHandler, options);
334        unbind(overlay, 'touchmove', touchmoveHandler, options);
335        unbind(overlay, 'touchend', touchendHandler);
336        unbind(document, 'focus', trapFocusInsideOverlay, true);
337    }
338
339    function prepareOverlay(gallery, userOptions) {
340        // If the same gallery is being opened prevent from loading it once again
341        if (currentGallery === gallery) {
342            return;
343        }
344        currentGallery = gallery;
345        // Update gallery specific options
346        setOptions(userOptions);
347        // Empty slider of previous contents (more effective than .innerHTML = "")
348        while (slider.firstChild) {
349            slider.removeChild(slider.firstChild);
350        }
351        imagesElements.length = 0;
352
353        var imagesFiguresIds = [];
354        var imagesCaptionsIds = [];
355        // Prepare and append images containers and populate figure and captions IDs arrays
356        for (var i = 0, fullImage; i < gallery.length; i++) {
357            fullImage = create('div');
358            fullImage.className = 'full-image';
359            fullImage.id = 'baguette-img-' + i;
360            imagesElements.push(fullImage);
361
362            imagesFiguresIds.push('baguetteBox-figure-' + i);
363            imagesCaptionsIds.push('baguetteBox-figcaption-' + i);
364            slider.appendChild(imagesElements[i]);
365        }
366        overlay.setAttribute('aria-labelledby', imagesFiguresIds.join(' '));
367        overlay.setAttribute('aria-describedby', imagesCaptionsIds.join(' '));
368    }
369
370    function setOptions(newOptions) {
371        if (!newOptions) {
372            newOptions = {};
373        }
374        // Fill options object
375        for (var item in defaults) {
376            options[item] = defaults[item];
377            if (typeof newOptions[item] !== 'undefined') {
378                options[item] = newOptions[item];
379            }
380        }
381        /* Apply new options */
382        // Change transition for proper animation
383        slider.style.transition = slider.style.webkitTransition = (options.animation === 'fadeIn' ? 'opacity .4s ease' :
384            options.animation === 'slideIn' ? '' : 'none');
385        // Hide buttons if necessary
386        if (options.buttons === 'auto' && ('ontouchstart' in window || currentGallery.length === 1)) {
387            options.buttons = false;
388        }
389        // Set buttons style to hide or display them
390        previousButton.style.display = nextButton.style.display = (options.buttons ? '' : 'none');
391        // Set overlay color
392        try {
393            overlay.style.backgroundColor = options.overlayBackgroundColor;
394        } catch (e) {
395            // Silence the error and continue
396        }
397    }
398
399    function showOverlay(chosenImageIndex) {
400        if (options.noScrollbars) {
401            document.documentElement.style.overflowY = 'hidden';
402            document.body.style.overflowY = 'scroll';
403        }
404        if (overlay.style.display === 'block') {
405            return;
406        }
407
408        bind(document, 'keydown', keyDownHandler);
409        currentIndex = chosenImageIndex;
410        touch = {
411            count: 0,
412            startX: null,
413            startY: null
414        };
415        loadImage(currentIndex, function() {
416            preloadNext(currentIndex);
417            preloadPrev(currentIndex);
418        });
419
420        updateOffset();
421        overlay.style.display = 'block';
422        if (options.fullScreen) {
423            enterFullScreen();
424        }
425        // Fade in overlay
426        setTimeout(function() {
427            overlay.className = 'visible';
428            if (options.bodyClass && document.body.classList) {
429                document.body.classList.add(options.bodyClass);
430            }
431            if (options.afterShow) {
432                options.afterShow();
433            }
434        }, 50);
435        if (options.onChange) {
436            options.onChange(currentIndex, imagesElements.length);
437        }
438        documentLastFocus = document.activeElement;
439        initFocus();
440        isOverlayVisible = true;
441    }
442
443    function initFocus() {
444        if (options.buttons) {
445            previousButton.focus();
446        } else {
447            closeButton.focus();
448        }
449    }
450
451    function enterFullScreen() {
452        if (overlay.requestFullscreen) {
453            overlay.requestFullscreen();
454        } else if (overlay.webkitRequestFullscreen) {
455            overlay.webkitRequestFullscreen();
456        } else if (overlay.mozRequestFullScreen) {
457            overlay.mozRequestFullScreen();
458        }
459    }
460
461    function exitFullscreen() {
462        if (document.exitFullscreen) {
463            document.exitFullscreen();
464        } else if (document.mozCancelFullScreen) {
465            document.mozCancelFullScreen();
466        } else if (document.webkitExitFullscreen) {
467            document.webkitExitFullscreen();
468        }
469    }
470
471    function hideOverlay() {
472        if (options.noScrollbars) {
473            document.documentElement.style.overflowY = 'auto';
474            document.body.style.overflowY = 'auto';
475        }
476        if (overlay.style.display === 'none') {
477            return;
478        }
479
480        unbind(document, 'keydown', keyDownHandler);
481        // Fade out and hide the overlay
482        overlay.className = '';
483        setTimeout(function() {
484            overlay.style.display = 'none';
485            exitFullscreen();
486            if (options.bodyClass && document.body.classList) {
487                document.body.classList.remove(options.bodyClass);
488            }
489            if (options.afterHide) {
490                options.afterHide();
491            }
492            documentLastFocus && documentLastFocus.focus();
493            isOverlayVisible = false;
494        }, 500);
495    }
496
497    function loadImage(index, callback) {
498        var imageContainer = imagesElements[index];
499        var galleryItem = currentGallery[index];
500
501        // Return if the index exceeds prepared images in the overlay
502        // or if the current gallery has been changed / closed
503        if (typeof imageContainer === 'undefined' || typeof galleryItem === 'undefined') {
504            return;
505        }
506
507        // If image is already loaded run callback and return
508        if (imageContainer.getElementsByTagName('img')[0]) {
509            if (callback) {
510                callback();
511            }
512            return;
513        }
514
515        // Get element reference, optional caption and source path
516        var imageElement = galleryItem.imageElement;
517        var thumbnailElement = imageElement.getElementsByTagName('img')[0];
518        var imageCaption = typeof options.captions === 'function' ?
519            options.captions.call(currentGallery, imageElement) :
520            imageElement.getAttribute('data-caption') || imageElement.title;
521        var imageSrc = getImageSrc(imageElement);
522
523        // Prepare figure element
524        var figure = create('figure');
525        figure.id = 'baguetteBox-figure-' + index;
526        figure.innerHTML = '<div class="baguetteBox-spinner">' +
527            '<div class="baguetteBox-double-bounce1"></div>' +
528            '<div class="baguetteBox-double-bounce2"></div>' +
529            '</div>';
530        // Insert caption if available
531        if (options.captions && imageCaption) {
532            var figcaption = create('figcaption');
533            figcaption.id = 'baguetteBox-figcaption-' + index;
534            figcaption.innerHTML = imageCaption;
535            figure.appendChild(figcaption);
536        }
537        imageContainer.appendChild(figure);
538
539        // Prepare gallery img element
540        var image = create('img');
541        image.onload = function() {
542            // Remove loader element
543            var spinner = document.querySelector('#baguette-img-' + index + ' .baguetteBox-spinner');
544            figure.removeChild(spinner);
545            if (!options.async && callback) {
546                callback();
547            }
548        };
549        image.setAttribute('src', imageSrc);
550        image.alt = thumbnailElement ? thumbnailElement.alt || '' : '';
551        if (options.titleTag && imageCaption) {
552            image.title = imageCaption;
553        }
554        figure.appendChild(image);
555
556        // Run callback
557        if (options.async && callback) {
558            callback();
559        }
560    }
561
562    // Get image source location, mostly used for responsive images
563    function getImageSrc(image) {
564        // Set default image path from href
565        var result = image.href;
566        // If dataset is supported find the most suitable image
567        if (image.dataset) {
568            var srcs = [];
569            // Get all possible image versions depending on the resolution
570            for (var item in image.dataset) {
571                if (item.substring(0, 3) === 'at-' && !isNaN(item.substring(3))) {
572                    srcs[item.replace('at-', '')] = image.dataset[item];
573                }
574            }
575            // Sort resolutions ascending
576            var keys = Object.keys(srcs).sort(function(a, b) {
577                return parseInt(a, 10) < parseInt(b, 10) ? -1 : 1;
578            });
579            // Get real screen resolution
580            var width = window.innerWidth * window.devicePixelRatio;
581            // Find the first image bigger than or equal to the current width
582            var i = 0;
583            while (i < keys.length - 1 && keys[i] < width) {
584                i++;
585            }
586            result = srcs[keys[i]] || result;
587        }
588        return result;
589    }
590
591    // Return false at the right end of the gallery
592    function showNextImage() {
593        return show(currentIndex + 1);
594    }
595
596    // Return false at the left end of the gallery
597    function showPreviousImage() {
598        return show(currentIndex - 1);
599    }
600
601    /**
602     * Move the gallery to a specific index
603     * @param `index` {number} - the position of the image
604     * @param `gallery` {array} - gallery which should be opened, if omitted assumes the currently opened one
605     * @return {boolean} - true on success or false if the index is invalid
606     */
607    function show(index, gallery) {
608        if (!isOverlayVisible && index >= 0 && index < gallery.length) {
609            prepareOverlay(gallery, options);
610            showOverlay(index);
611            return true;
612        }
613        if (index < 0) {
614            if (options.animation) {
615                bounceAnimation('left');
616            }
617            return false;
618        }
619        if (index >= imagesElements.length) {
620            if (options.animation) {
621                bounceAnimation('right');
622            }
623            return false;
624        }
625
626        currentIndex = index;
627        loadImage(currentIndex, function() {
628            preloadNext(currentIndex);
629            preloadPrev(currentIndex);
630        });
631        updateOffset();
632
633        if (options.onChange) {
634            options.onChange(currentIndex, imagesElements.length);
635        }
636
637        return true;
638    }
639
640    /**
641     * Triggers the bounce animation
642     * @param {('left'|'right')} direction - Direction of the movement
643     */
644    function bounceAnimation(direction) {
645        slider.className = 'bounce-from-' + direction;
646        setTimeout(function() {
647            slider.className = '';
648        }, 400);
649    }
650
651    function updateOffset() {
652        var offset = -currentIndex * 100 + '%';
653        if (options.animation === 'fadeIn') {
654            slider.style.opacity = 0;
655            setTimeout(function() {
656                supports.transforms ?
657                    slider.style.transform = slider.style.webkitTransform = 'translate3d(' + offset + ',0,0)'
658                    : slider.style.left = offset;
659                slider.style.opacity = 1;
660            }, 400);
661        } else {
662            supports.transforms ?
663                slider.style.transform = slider.style.webkitTransform = 'translate3d(' + offset + ',0,0)'
664                : slider.style.left = offset;
665        }
666    }
667
668    // CSS 3D Transforms test
669    function testTransformsSupport() {
670        var div = create('div');
671        return typeof div.style.perspective !== 'undefined' || typeof div.style.webkitPerspective !== 'undefined';
672    }
673
674    // Inline SVG test
675    function testSvgSupport() {
676        var div = create('div');
677        div.innerHTML = '<svg/>';
678        return (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';
679    }
680
681    // Borrowed from https://github.com/seiyria/bootstrap-slider/pull/680/files
682    function testPassiveEventsSupport() {
683        var passiveEvents = false;
684        try {
685            var opts = Object.defineProperty({}, 'passive', {
686                get: function() {
687                    passiveEvents = true;
688                }
689            });
690            window.addEventListener('test', null, opts);
691        } catch (e) { /* Silence the error and continue */ }
692
693        return passiveEvents;
694    }
695
696    function preloadNext(index) {
697        if (index - currentIndex >= options.preload) {
698            return;
699        }
700        loadImage(index + 1, function() {
701            preloadNext(index + 1);
702        });
703    }
704
705    function preloadPrev(index) {
706        if (currentIndex - index >= options.preload) {
707            return;
708        }
709        loadImage(index - 1, function() {
710            preloadPrev(index - 1);
711        });
712    }
713
714    function bind(element, event, callback, options) {
715        if (element.addEventListener) {
716            element.addEventListener(event, callback, options);
717        } else {
718            // IE8 fallback
719            element.attachEvent('on' + event, function(event) {
720                // `event` and `event.target` are not provided in IE8
721                event = event || window.event;
722                event.target = event.target || event.srcElement;
723                callback(event);
724            });
725        }
726    }
727
728    function unbind(element, event, callback, options) {
729        if (element.removeEventListener) {
730            element.removeEventListener(event, callback, options);
731        } else {
732            // IE8 fallback
733            element.detachEvent('on' + event, callback);
734        }
735    }
736
737    function getByID(id) {
738        return document.getElementById(id);
739    }
740
741    function create(element) {
742        return document.createElement(element);
743    }
744
745    function destroyPlugin() {
746        unbindEvents();
747        clearCachedData();
748        unbind(document, 'keydown', keyDownHandler);
749        document.getElementsByTagName('body')[0].removeChild(document.getElementById('baguetteBox-overlay'));
750        data = {};
751        currentGallery = [];
752        currentIndex = 0;
753    }
754
755    return {
756        run: run,
757        show: show,
758        showNext: showNextImage,
759        showPrevious: showPreviousImage,
760        hide: hideOverlay,
761        destroy: destroyPlugin
762    };
763}));

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.