PageSourceSearch

https://mycherrylipsblog.com/assets/mycherrylipsblog.com/ink3/js/autoload.js

js mycherrylipsblog.com collected 2026-09-27 09:43:47 UTC 8,819 bytes, 216 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__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 opener = _____WB$wombat$assign$function_____("opener");
10/** 
11 * @module Ink.Autoload
12 * @version 1
13 * Create Ink UI components easily
14 */
15Ink.createModule('Ink.Autoload', 1, ['Ink.Dom.Selector_1', 'Ink.Util.Array_1', 'Ink.Dom.Loaded_1', 'Ink.UI.SmoothScroller_1', 'Ink.UI.Close_1', 'Ink.UI.Drawer_1'], function( Selector, InkArray, Loaded, Scroller, Close, Drawer ){
16    'use strict';
17
18    /**
19     * @namespace Ink.Autoload
20     * @static
21     */
22
23    var el = document.createElement('div');
24    // See if a selector is valid.
25    function validSelector(sel) {
26        try {
27            Selector.select(sel, el);
28        } catch(e) {
29            Ink.error(e);
30            return false;
31        }
32        return true;
33    }
34
35    var Autoload = {
36        /**
37         * Matches module names to default selectors.
38         * 
39         * @property selectors {Object}
40         * @public
41         **/
42        selectors: {
43            /* Match module names to element classes (or more complex selectors)
44             * which get the UI modules instantiated automatically. */
45            'Animate_1'     : '.ink-animate',
46            'Carousel_1'    : '.ink-carousel',
47            'DatePicker_1'  : '.ink-datepicker',
48            'DragDrop_1'    : '.ink-dragdrop',
49            'Draggable_1'   : '.ink-draggable',
50            'Dropdown_1'    : '.ink-dropdown',
51            'Droppable_1.add' : '.ink-droppable',
52            'FormValidator_2' : '.ink-formvalidator',
53            'Gallery_1'     : 'ul.ink-gallery-source',
54            'LazyLoad_1'    : '.ink-lazyload',
55            'Modal_1'       : '.ink-modal',
56            'ProgressBar_1' : '.ink-progress-bar',
57            'SortableList_1': '.ink-sortable-list',
58            'Spy_1'         : '[data-spy="true"]',
59            'Stacker_1'     : '.ink-stacker',
60            'Sticky_1'      : '.ink-sticky, .sticky',
61            'Table_1'       : '.ink-table',
62            'Tabs_1'        : '.ink-tabs',
63            'Toggle_1'      : '.ink-toggle, .toggle',
64            'Tooltip_1'     : '.ink-tooltip, .tooltip',
65            'TreeView_1'    : '.ink-tree-view'
66        },
67        defaultOptions: {},
68
69        /**
70         * Run Autoload on a specific element.
71         *
72         * Useful when you load something from AJAX and want it to have automatically loaded Ink modules.
73         * @method run
74         * @param {Element} parentEl Root element. The children of this element will be processed by Autoload.
75         * @param {Object}  [options] Options object, containing:
76         * @param {Boolean} [options.forceAutoload] Autoload things on elements even if they have `data-autoload="false"`
77         * @param {Boolean} [options.createClose] Whether to create the Ink.UI.Close component. Defaults to `true`.
78         * @param {Boolean} [options.createSmoothScroller] Whether to create the Scroller component. Defaults to `true`.
79         * @param {Object} [options.selectors=Ink.Autoload.selectors] A hash mapping module names to selectors that match elements to load these modules. For example, `{ 'Modal_1': '.my-specific-modal' }`.
80         * @param {Boolean} [options.waitForDOMLoaded=false] Do nothing until the DOM is loaded. Uses Ink.Dom.Loaded.run();
81         * @return {void}
82         * @public
83         * @sample Autoload_1.html
84         **/
85        run: function (parentEl, options){
86            options = Ink.extendObj({
87                // The below lines are not required because undefined is falsy anyway..
88                // forceAutoload: false,
89                // waitForDOMLoaded: false,
90                // createClose: false,
91                // createSmoothScroller: false,
92                selectors: Autoload.selectors
93            }, options || {});
94
95            for(var mod in options.selectors) if (options.selectors.hasOwnProperty(mod)) {
96                // `elements` need to be in a closure because requireModules is async.
97                findElements(mod);
98            }
99            if (options.createClose !== false) {
100                new Close();
101            }
102            if (options.createSmoothScroller !== false) {
103                Scroller.init();
104            }
105            if (options.createDrawer !== false) {
106                if (Selector.matchesSelector(document.body, '.ink-drawer') &&
107                        !(Drawer.getInstance && Drawer.getInstance(document.body))) {
108                    new Drawer(document.body);
109                }
110            }
111
112            function findElements(mod) {
113                var fname;
114                if (/\./.test(mod)) {  // Droppable.add(elm, options)
115                    mod = mod.split('.');
116                    fname = mod[1];
117                    mod = mod[0];
118                }
119                var modName = 'Ink.UI.' + mod;
120                var elements = Selector.select( options.selectors[mod], parentEl );
121
122                elements = InkArray.filter(elements, autoloadElement);
123
124                if( elements.length ){
125                    Ink.requireModules( [modName], function( Component ) {
126                        InkArray.forEach(elements, function (el) {
127                            if (typeof Component.getInstance === 'function' &&
128                                    Component.getInstance(el) != null) {
129                                return; // Avoid multiple instantiation.
130                            }
131                            if (!fname) {
132                                new Component(el, Autoload.defaultOptions[mod]);
133                            } else {
134                                Component[fname](el, Autoload.defaultOptions[mod]);
135                            }
136                        });
137                    });
138                }
139            }
140
141            function autoloadElement(element) {
142                if (options.forceAutoload === true) { return true; }
143                if (typeof element.getAttribute === 'function' || typeof element.getAttribute === 'object') {
144                    return element.getAttribute('data-autoload') !== 'false';
145                }
146            }
147        },
148        /**
149         * Add a new entry to be autoloaded.
150         * @method add
151         * @param {String} moduleName The module name (Example: 'Modal_1', or 'Dropdown_1')
152         * @param {String} selector   A selector which finds elements where this module should be autoloaded (Example: '.my-modal' or '.my-dropdown')
153         * @return {void}
154         * @public
155         */
156        add: function (moduleName, selector) {
157            if (!validSelector(selector)) { return false; }
158
159            if (Autoload.selectors[moduleName]) {
160                Autoload.selectors[moduleName] += ', ' + selector;
161            } else {
162                Autoload.selectors[moduleName] = selector;
163            }
164        },
165        /**
166         * Removes a module from autoload, making it not be automatically loaded.
167         * @method remove
168         * @param {String} moduleName The module's name and version ('Name_ver')
169         * @return {void}
170         * @public
171         **/
172        remove: function (moduleName) {
173            delete Autoload.selectors[moduleName];
174        }
175    };
176
177    for (var k in Autoload.selectors) if (Autoload.selectors.hasOwnProperty(k)) {
178        Autoload.defaultOptions[k] = {};
179    }
180
181    if (!window.INK_NO_AUTO_LOAD) {
182        Loaded.run(function () {
183            Autoload.run(document, {
184                createSmoothScroller: true,
185                createClose: true
186            });
187            Autoload.firstRunDone = true;
188        });
189    }
190
191    return Autoload;
192});
193
194
195}
196
197/*
198     FILE ARCHIVED ON 18:32:59 Jan 13, 2026 AND RETRIEVED FROM THE
199     INTERNET ARCHIVE ON 12:34:26 Jul 10, 2026.
200     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
201
202     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
203     SECTION 108(a)(3)).
204*/
205/*
206playback timings (ms):
207  captures_list: 0.645
208  exclusion.robots: 0.066
209  exclusion.robots.policy: 0.051
210  esindex: 0.01
211  cdx.remote: 22.841
212  LoadShardBlock: 246.183 (3)
213  PetaboxLoader3.resolve: 240.625 (4)
214  PetaboxLoader3.datanode: 166.777 (4)
215  load_resource: 168.988
216*/

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.