PageSourceSearch

https://nmperinatalcollaborative.com/wp-content/plugins/modern-eve…/featherlight/featherlight_ver-6.5.3.js

js nmperinatalcollaborative.com collected 2026-10-06 12:21:31 UTC 30,867 bytes, 677 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10/**
11 * Featherlight - ultra slim jQuery lightbox
12 * Version 1.7.14-UMD - http://noelboss.github.io/featherlight/
13 *
14 * Copyright 2019, Noël Raoul Bossart (http://www.noelboss.com)
15 * MIT Licensed.
16**/
17(function (factory) {
18    if (typeof define === 'function' && define.amd) {
19        // AMD. Register as an anonymous module.
20        define(['jquery'], factory);
21    } else if (typeof module === 'object' && module.exports) {
22        // Node/CommonJS
23        module.exports = function (root, jQuery) {
24            if (jQuery === undefined) {
25                // require('jQuery') returns a factory that requires window to
26                // build a jQuery instance, we normalize how we use modules
27                // that require this pattern but the window provided is a noop
28                // if it's defined (how jquery works)
29                if (typeof window !== 'undefined') {
30                    jQuery = require('jquery');
31                } else {
32                    jQuery = require('jquery')(root);
33                }
34            }
35            factory(jQuery);
36            return jQuery;
37        };
38    } else {
39        // Browser globals
40        factory(jQuery);
41    }
42})(function ($) {
43    "use strict";
44
45    if ('undefined' === typeof $) {
46        if ('console' in window) { window.console.info('Too much lightness, Featherlight needs jQuery.'); }
47        return;
48    }
49    if ($.fn.jquery.match(/-ajax/)) {
50        if ('console' in window) { window.console.info('Featherlight needs regular jQuery, not the slim version.'); }
51        return;
52    }
53	/* Featherlight is exported as $.featherlight.
54	   It is a function used to open a featherlight lightbox.
55	   [tech]
56	   Featherlight uses prototype inheritance.
57	   Each opened lightbox will have a corresponding object.
58	   That object may have some attributes that override the
59	   prototype's.
60	   Extensions created with Featherlight.extend will have their
61	   own prototype that inherits from Featherlight's prototype,
62	   thus attributes can be overriden either at the object level,
63	   or at the extension level.
64	   To create callbacks that chain themselves instead of overriding,
65	   use chainCallbacks.
66	   For those familiar with CoffeeScript, this correspond to
67	   Featherlight being a class and the Gallery being a class
68	   extending Featherlight.
69	   The chainCallbacks is used since we don't have access to
70	   CoffeeScript's `super`.
71	*/
72
73    function Featherlight($content, config) {
74        if (this instanceof Featherlight) {  /* called with new */
75            this.id = Featherlight.id++;
76            this.setup($content, config);
77            this.chainCallbacks(Featherlight._callbackChain);
78        } else {
79            var fl = new Featherlight($content, config);
80            fl.open();
81            return fl;
82        }
83    }
84
85    var opened = [],
86        pruneOpened = function (remove) {
87            opened = $.grep(opened, function (fl) {
88                return fl !== remove && fl.$instance.closest('body').length > 0;
89            });
90            return opened;
91        };
92
93    // Removes keys of `set` from `obj` and returns the removed key/values.
94    function slice(obj, set) {
95        var r = {};
96        for (var key in obj) {
97            if (key in set) {
98                r[key] = obj[key];
99                delete obj[key];
100            }
101        }
102        return r;
103    }
104
105    // NOTE: List of available [iframe attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).
106    var iFrameAttributeSet = {
107        allow: 1, allowfullscreen: 1, frameborder: 1, height: 1, longdesc: 1, marginheight: 1, marginwidth: 1,
108        mozallowfullscreen: 1, name: 1, referrerpolicy: 1, sandbox: 1, scrolling: 1, src: 1, srcdoc: 1, style: 1,
109        webkitallowfullscreen: 1, width: 1
110    };
111
112    // Converts camelCased attributes to dasherized versions for given prefix:
113    //   parseAttrs({hello: 1, hellFrozeOver: 2}, 'hell') => {froze-over: 2}
114    function parseAttrs(obj, prefix) {
115        var attrs = {},
116            regex = new RegExp('^' + prefix + '([A-Z])(.*)');
117        for (var key in obj) {
118            var match = key.match(regex);
119            if (match) {
120                var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase();
121                attrs[dasherized] = obj[key];
122            }
123        }
124        return attrs;
125    }
126
127    /* document wide key handler */
128    var eventMap = { keyup: 'onKeyUp', resize: 'onResize' };
129
130    var globalEventHandler = function (event) {
131        $.each(Featherlight.opened().reverse(), function () {
132            if (!event.isDefaultPrevented()) {
133                if (false === this[eventMap[event.type]](event)) {
134                    event.preventDefault(); event.stopPropagation(); return false;
135                }
136            }
137        });
138    };
139
140    var toggleGlobalEvents = function (set) {
141        if (set !== Featherlight._globalHandlerInstalled) {
142            Featherlight._globalHandlerInstalled = set;
143            var events = $.map(eventMap, function (_, name) { return name + '.' + Featherlight.prototype.namespace; }).join(' ');
144            $(window)[set ? 'on' : 'off'](events, globalEventHandler);
145        }
146    };
147
148    Featherlight.prototype = {
149        constructor: Featherlight,
150        /*** defaults ***/
151        /* extend featherlight with defaults and methods */
152        namespace: 'featherlight',        /* Name of the events and css class prefix */
153        targetAttr: 'data-featherlight',   /* Attribute of the triggered element that contains the selector to the lightbox content */
154        variant: null,                  /* Class that will be added to change look of the lightbox */
155        resetCss: false,                 /* Reset all css */
156        background: null,                  /* Custom DOM for the background, wrapper and the closebutton */
157        openTrigger: 'click',               /* Event that triggers the lightbox */
158        closeTrigger: 'click',               /* Event that triggers the closing of the lightbox */
159        filter: null,                  /* Selector to filter events. Think $(...).on('click', filter, eventHandler) */
160        root: 'body',                /* Where to append featherlights */
161        openSpeed: 250,                   /* Duration of opening animation */
162        closeSpeed: 250,                   /* Duration of closing animation */
163        closeOnClick: 'background',          /* Close lightbox on click ('background', 'anywhere' or false) */
164        closeOnEsc: true,                  /* Close lightbox when pressing esc */
165        closeIcon: '✕',            /* Close icon */
166        loading: '',                    /* Content to show while initial content is loading */
167        persist: false,                 /* If set, the content will persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */
168        otherClose: null,                  /* Selector for alternate close buttons (e.g. "a.close") */
169        beforeOpen: $.noop,                /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
170        beforeContent: $.noop,                /* Called when content is loaded. Gets event as parameter, this contains all data */
171        beforeClose: $.noop,                /* Called before close. can return false to prevent closing of lightbox. Gets event as parameter, this contains all data */
172        afterOpen: $.noop,                /* Called after open. Gets event as parameter, this contains all data */
173        afterContent: $.noop,                /* Called after content is ready and has been set. Gets event as parameter, this contains all data */
174        afterClose: $.noop,                /* Called after close. Gets event as parameter, this contains all data */
175        onKeyUp: $.noop,                /* Called on key up for the frontmost featherlight */
176        onResize: $.noop,                /* Called after new content and when a window is resized */
177        type: null,                  /* Specify type of lightbox. If unset, it will check for the targetAttrs value. */
178        contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'], /* List of content filters to use to determine the content */
179
180        /*** methods ***/
181        /* setup iterates over a single instance of featherlight and prepares the background and binds the events */
182        setup: function (target, config) {
183            /* all arguments are optional */
184            if (typeof target === 'object' && target instanceof $ === false && !config) {
185                config = target;
186                target = undefined;
187            }
188
189            var self = $.extend(this, config, { target: target }),
190                css = !self.resetCss ? self.namespace : self.namespace + '-reset', /* by adding -reset to the classname, we reset all the default css */
191                $background = $(self.background || [
192                    '<div class="' + css + '-loading ' + css + '">',
193                    '<div class="' + css + '-content">',
194                    '<button class="' + css + '-close-icon ' + self.namespace + '-close" aria-label="Close">',
195                    self.closeIcon,
196                    '</button>',
197                    '<div class="' + self.namespace + '-inner">' + self.loading + '</div>',
198                    '</div>',
199                    '</div>'].join('')),
200                closeButtonSelector = '.' + self.namespace + '-close' + (self.otherClose ? ',' + self.otherClose : '');
201
202            self.$instance = $background.clone().addClass(self.variant); /* clone DOM for the background, wrapper and the close button */
203
204            /* close when click on background/anywhere/null or closebox */
205            self.$instance.on(self.closeTrigger + '.' + self.namespace, function (event) {
206                if (event.isDefaultPrevented()) {
207                    return;
208                }
209                var $target = $(event.target);
210                if (('background' === self.closeOnClick && $target.is('.' + self.namespace))
211                    || 'anywhere' === self.closeOnClick
212                    || $target.closest(closeButtonSelector).length) {
213                    self.close(event);
214                    event.preventDefault();
215                }
216            });
217
218            return this;
219        },
220
221        /* this method prepares the content and converts it into a 
221jQuery object or a promise */
222        getContent: function () {
223            if (this.persist !== false && this.$content) {
224                return this.$content;
225            }
226            var self = this,
227                filters = this.constructor.contentFilters,
228                readTargetAttr = function (name) { return self.$currentTarget && self.$currentTarget.attr(name); },
229                targetValue = readTargetAttr(self.targetAttr),
230                data = self.target || targetValue || '';
231
232            /* Find which filter applies */
233            var filter = filters[self.type]; /* check explicit type like {type: 'image'} */
234
235            /* check explicit type like data-featherlight="image" */
236            if (!filter && data in filters) {
237                filter = filters[data];
238                data = self.target && targetValue;
239            }
240            data = data || readTargetAttr('href') || '';
241
242            /* check explicity type & content like {image: 'photo.jpg'} */
243            if (!filter) {
244                for (var filterName in filters) {
245                    if (self[filterName]) {
246                        filter = filters[filterName];
247                        data = self[filterName];
248                    }
249                }
250            }
251
252            /* otherwise it's implicit, run checks */
253            if (!filter) {
254                var target = data;
255                data = null;
256                $.each(self.contentFilters, function () {
257                    filter = filters[this];
258                    if (filter.test) {
259                        data = filter.test(target);
260                    }
261                    if (!data && filter.regex && target.match && target.match(filter.regex)) {
262                        data = target;
263                    }
264                    return !data;
265                });
266                if (!data) {
267                    if ('console' in window) { window.console.error('Featherlight: no content filter found ' + (target ? ' for "' + target + '"' : ' (no target specified)')); }
268                    return false;
269                }
270            }
271            /* Process it */
272            return filter.process.call(self, data);
273        },
274
275        /* sets the content of $instance to $content */
276        setContent: function ($content) {
277            this.$instance.removeClass(this.namespace + '-loading');
278
279            /* we need a special class for the iframe */
280            this.$instance.toggleClass(this.namespace + '-iframe', $content.is('iframe'));
281
282            /* replace content by appending to existing one before it is removed
283               this insures that featherlight-inner remain at the same relative
284               position to any other items added to featherlight-content */
285            this.$instance.find('.' + this.namespace + '-inner')
286                .not($content)                /* excluded new content, important if persisted */
287                .slice(1).remove().end()      /* In the unexpected event where there are many inner elements, remove all but the first one */
288                .replaceWith($.contains(this.$instance[0], $content[0]) ? '' : $content);
289
290            this.$content = $content.addClass(this.namespace + '-inner');
291
292            return this;
293        },
294
295		/* opens the lightbox. "this" contains $instance with the lightbox, and with the config.
296			Returns a promise that is resolved after is successfully opened. */
297        open: function (event) {
298            var self = this;
299            self.$instance.hide().appendTo(self.root);
300            if ((!event || !event.isDefaultPrevented())
301                && self.beforeOpen(event) !== false) {
302
303                if (event) {
304                    event.preventDefault();
305                }
306                var $content = self.getContent();
307
308                if ($content) {
309                    opened.push(self);
310
311                    toggleGlobalEvents(true);
312
313                    self.$instance.fadeIn(self.openSpeed);
314                    self.beforeContent(event);
315
316                    /* Set content and show */
317                    return $.when($content)
318                        .always(function ($openendContent) {
319                            if ($openendContent) {
320                                self.setContent($openendContent);
321                                self.afterContent(event);
322                            }
323                        })
324                        .then(self.$instance.promise())
325                        /* Call afterOpen after fadeIn is done */
326                        .done(function () { self.afterOpen(event); });
327                }
328            }
329            self.$instance.detach();
330            return $.Deferred().reject().promise();
331        },
332
333		/* closes the lightbox. "this" contains $instance with the lightbox, and with the config
334			returns a promise, resolved after the lightbox is successfully closed. */
335        close: function (event) {
336            var self = this,
337                deferred = $.Deferred();
338
339            if (self.beforeClose(event) === false) {
340                deferred.reject();
341            } else {
342
343                if (0 === pruneOpened(self).length) {
344                    toggleGlobalEvents(false);
345                }
346
347                self.$instance.fadeOut(self.closeSpeed, function () {
348                    self.$instance.detach();
349                    self.afterClose(event);
350                    deferred.resolve();
351                });
352            }
353            return deferred.promise();
354        },
355
356		/* resizes the content so it fits in visible area and keeps the same aspect ratio.
357				Does nothing if either the width or the height is not specified.
358				Called automatically on window resize.
359				Override if you want different behavior. */
360        resize: function (w, h) {
361            if (w && h) {
362                /* Reset apparent image size first so container grows */
363                this.$content.css('width', '').css('height', '');
364                /* Calculate the worst ratio so that dimensions fit */
365                /* Note: -1 to avoid rounding errors */
366                var ratio = Math.max(
367                    w / (this.$content.parent().width() - 1),
368                    h / (this.$content.parent().height() - 1));
369                /* Resize content */
370                if (ratio > 1) {
371                    ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */
372                    this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px');
373                }
374            }
375        },
376
377		/* Utility function to chain callbacks
378		   [Warning: guru-level]
379		   Used be extensions that want to let users specify callbacks but
380		   also need themselves to use the callbacks.
381		   The argument 'chain' has callback names as keys and function(super, event)
382		   as values. That function is meant to call `super` at some point.
383		*/
384        chainCallbacks: function (chain) {
385            for (var name in chain) {
386                this[name] = $.proxy(chain[name], this, $.proxy(this[name], this));
387            }
388        }
389    };
390
391    $.extend(Featherlight, {
392        id: 0,                                    /* Used to id single featherlight instances */
393        autoBind: '[data-featherlight]',    /* Will automatically bind elements matching this selector. Clear or set before onReady */
394        defaults: Featherlight.prototype,   /* You can access and override all defaults using $.featherlight.defaults, which is just a synonym for $.featherlight.prototype */
395        /* Contains the logic to determine content */
396        contentFilters: {
397            jquery: {
398                regex: /^[#.]\w/,         /* Anything that starts with a class name or identifiers */
399                test: function (elem) { return elem instanceof $ && elem; },
400                process: function (elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); }
401            },
402            image: {
403                regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,
404                process: function (url) {
405                    var self = this,
406                        deferred = $.Deferred(),
407                        img = new Image(),
408                        $img = $('<img src="' + url + '" alt="" class="' + self.namespace + '-image" />');
409                    img.onload = function () {
410                        /* Store naturalWidth & height for IE8 */
411                        $img.naturalWidth = img.width; $img.naturalHeight = img.height;
412                        deferred.resolve($img);
413                    };
414                    img.onerror = function () { deferred.reject($img); };
415                    img.src = url;
416                    return deferred.promise();
417                }
418            },
419            html: {
420                regex: /^\s*<[\w!][^<]*>/, /* Anything that starts with some kind of valid tag */
421                process: function (html) { return $(html); }
422            },
423            ajax: {
424                regex: /./,            /* At this point, any content is assumed to be an URL */
425                process: function (url) {
426                    var self = this,
427                        deferred = $.Deferred();
428                    /* we are using load so one can specify a target with: url.html #targetelement */
429                    var $container = $('<div></div>').load(url, function (response, status) {
430                        if (status !== "error") {
431                            deferred.resolve($container.contents());
432                        }
433                        deferred.reject();
434                    });
435                    return deferred.promise();
436                }
437            },
438            iframe: {
439                process: function (url) {
440                    var deferred = new $.Deferred();
441                    var $content = $('<iframe/>');
442                    var css = parseAttrs(this, 'iframe');
443                    var attrs = slice(css, iFrameAttributeSet);
444                    $content.hide()
445                        .attr('src', url)
446                        .attr(attrs)
447                        .css(css)
448                        .on('load', function () { deferred.resolve($content.show()); })
449                        // We can't move an <iframe> and avoid reloading it,
450                        // so let's put it in place ourselves right now:
451                        .appendTo(this.$instance.find('.' + this.namespace + '-content'));
452                    return deferred.promise();
453                }
454            },
455            text: {
456                process: function (text) { return $('<div>', { text: text }); }
457            }
458        },
459
460        functionAttributes: ['beforeOpen', 'afterOpen', 'beforeContent', 'afterContent', 'beforeClose', 'afterClose'],
461
462        /*** class methods ***/
463        /* read element's attributes starting with data-featherlight- */
464        readElementConfig: function (element, namespace) {
465            var Klass = this,
466                regexp = new RegExp('^data-' + namespace + '-(.*)'),
467                config = {};
468            if (element && element.attributes) {
469                $.each(element.attributes, function () {
470                    var match = this.name.match(regexp);
471                    if (match) {
472                        var val = this.value,
473                            name = $.camelCase(match[1]);
474                        if ($.inArray(name, Klass.functionAttributes) >= 0) {  /* jshint -W054 */
475                            val = new Function(val);                           /* jshint +W054 */
476                        } else {
477                            try { val = JSON.parse(val); }
478                            catch (e) { }
479                        }
480                        config[name] = val;
481                    }
482                });
483            }
484            return config;
485        },
486
487		/* Used to create a Featherlight extension
488		   [Warning: guru-level]
489		   Creates the extension's prototype that in turn
490		   inherits Featherlight's prototype.
491		   Could be used to extend an extension too...
492		   This is pretty high level wizardy, it comes pretty much straight
493		   from CoffeeScript and won't teach you anything about Featherlight
494		   as it's not really specific to this library.
495		   My suggestion: move along and keep your sanity.
496		*/
497        extend: function (child, defaults) {
498            /* Setup class hierarchy, adapted from CoffeeScript */
499            var Ctor = function () { this.constructor = child; };
500            Ctor.prototype = this.prototype;
501            child.prototype = new Ctor();
502            child.__super__ = this.prototype;
503            /* Copy class methods & attributes */
504            $.extend(child, this, defaults);
505            child.defaults = child.prototype;
506            return child;
507        },
508
509        attach: function ($source, $content, config) {
510            var Klass = this;
511            if (typeof $content === 'object' && $content instanceof $ === false && !config) {
512                config = $content;
513                $content = undefined;
514            }
515            /* make a copy */
516            config = $.extend({}, config);
517
518            /* Only for openTrigger, filter & namespace... */
519            var namespace = config.namespace || Klass.defaults.namespace,
520                tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), c
520onfig),
521                sharedPersist;
522            var handler = function (event) {
523                var $target = $(event.currentTarget);
524                /* ... since we might as well compute the config on the actual target */
525                var elemConfig = $.extend(
526                    { $source: $source, $currentTarget: $target },
527                    Klass.readElementConfig($source[0], tempConfig.namespace),
528                    Klass.readElementConfig(event.currentTarget, tempConfig.namespace),
529                    config);
530                var fl = sharedPersist || $target.data('featherlight-persisted') || new Klass($content, elemConfig);
531                if (fl.persist === 'shared') {
532                    sharedPersist = fl;
533                } else if (fl.persist !== false) {
534                    $target.data('featherlight-persisted', fl);
535                }
536                if (elemConfig.$currentTarget.blur) {
537                    elemConfig.$currentTarget.blur(); // Otherwise 'enter' key might trigger the dialog again
538                }
539                fl.open(event);
540            };
541
542            $source.on(tempConfig.openTrigger + '.' + tempConfig.namespace, tempConfig.filter, handler);
543
544            return { filter: tempConfig.filter, handler: handler };
545        },
546
547        current: function () {
548            var all = this.opened();
549            return all[all.length - 1] || null;
550        },
551
552        opened: function () {
553            var klass = this;
554            pruneOpened();
555            return $.grep(opened, function (fl) { return fl instanceof klass; });
556        },
557
558        close: function (event) {
559            var cur = this.current();
560            if (cur) { return cur.close(event); }
561        },
562
563		/* Does the auto binding on startup.
564		   Meant only to be used by Featherlight and its extensions
565		*/
566        _onReady: function () {
567            var Klass = this;
568            if (Klass.autoBind) {
569                var $autobound = $(Klass.autoBind);
570                /* Bind existing elements */
571                $autobound.each(function () {
572                    Klass.attach($(this));
573                });
574                /* If a click propagates to the document level, then we have an item that was added later on */
575                $(document).on('click', Klass.autoBind, function (evt) {
576                    if (evt.isDefaultPrevented()) {
577                        return;
578                    }
579                    var $cur = $(evt.currentTarget);
580                    var len = $autobound.length;
581                    $autobound = $autobound.add($cur);
582                    if (len === $autobound.length) {
583                        return; /* already bound */
584                    }
585                    /* Bind featherlight */
586                    var data = Klass.attach($cur);
587                    /* Dispatch event directly */
588                    if (!data.filter || $(evt.target).parentsUntil($cur, data.filter).length > 0) {
589                        data.handler(evt);
590                    }
591                });
592            }
593        },
594
595		/* Featherlight uses the onKeyUp callback to intercept the escape key.
596		   Private to Featherlight.
597		*/
598        _callbackChain: {
599            onKeyUp: function (_super, event) {
600                if (27 === event.keyCode) {
601                    if (this.closeOnEsc) {
602                        $.featherlight.close(event);
603                    }
604                    return false;
605                } else {
606                    return _super(event);
607                }
608            },
609
610            beforeOpen: function (_super, event) {
611                // Used to disable scrolling
612                $(document.documentElement).addClass('with-featherlight');
613
614                // Remember focus:
615                this._previouslyActive = document.activeElement;
616
617                // Disable tabbing:
618                // See http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus
619                this._$previouslyTabbable = $("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]")
620                    .not('[tabindex]')
621                    .not(this.$instance.find('button'));
622
623                this._$previouslyWithTabIndex = $('[tabindex]').not('[tabindex="-1"]');
624                this._previousWithTabIndices = this._$previouslyWithTabIndex.map(function (_i, elem) {
625                    return $(elem).attr('tabindex');
626                });
627
628                this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr('tabindex', -1);
629
630                if (document.activeElement.blur) {
631                    document.activeElement.blur();
632                }
633                return _super(event);
634            },
635
636            afterClose: function (_super, event) {
637                var r = _super(event);
638                // Restore focus
639                var self = this;
640                this._$previouslyTabbable.removeAttr('tabindex');
641                this._$previouslyWithTabIndex.each(function (i, elem) {
642                    $(elem).attr('tabindex', self._previousWithTabIndices[i]);
643                });
644                this._previouslyActive.focus();
645                // Restore scroll
646                if (Featherlight.opened().length === 0) {
647                    $(document.documentElement).removeClass('with-featherlight');
648                }
649                return r;
650            },
651
652            onResize: function (_super, event) {
653                this.resize(this.$content.naturalWidth, this.$content.naturalHeight);
654                return _super(event);
655            },
656
657            afterContent: function (_super, event) {
658                var r = _super(event);
659                this.$instance.find('[autofocus]:not([disabled])').focus();
660                this.onResize(event);
661                return r;
662            }
663        }
664    });
665
666    $.featherlight = Featherlight;
667
668    /* bind jQuery elements to trigger featherlight */
669    $.fn.featherlight = function ($content, config) {
670        Featherlight.attach(this, $content, config);
671        return this;
672    };
673
674    /* bind featherlight on ready if config autoBind is set */
675    $(document).ready(function () { Featherlight._onReady(); });
676});
677}

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.