PageSourceSearch

https://www.corporacioncapilar.es/wp-content/themes/summer-blog/js/jquery.matchHeight.js?ver=0.0.16

js corporacioncapilar.es collected 2026-09-26 08:55:45 UTC 13,126 bytes, 424 lines download raw bytes

vendor: 12,731 bytes, lines 1-408
1var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
2if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
3{
4  let window = _____WB$wombat$assign$function_____("window");
5  let self = _____WB$wombat$assign$function_____("self");
6  let document = _____WB$wombat$assign$function_____("document");
7  let location = _____WB$wombat$assign$function_____("location");
8  let top = _____WB$wombat$assign$function_____("top");
9  let parent = _____WB$wombat$assign$function_____("parent");
10  let frames = _____WB$wombat$assign$function_____("frames");
11  let opener = _____WB$wombat$assign$function_____("opener");
12
13/**
14* jquery-match-height 0.7.2 by @liabru
15* http://brm.io/jquery-match-height/
16* License: MIT
17*/
18
19;(function(factory) { // eslint-disable-line no-extra-semi
20    'use strict';
21    if (typeof define === 'function' && define.amd) {
22        // AMD
23        define(['jquery'], factory);
24    } else if (typeof module !== 'undefined' && module.exports) {
25        // CommonJS
26        module.exports = factory(require('jquery'));
27    } else {
28        // Global
29        factory(jQuery);
30    }
31})(function($) {
32    /*
33    *  internal
34    */
35
36    var _previousResizeWidth = -1,
37        _updateTimeout = -1;
38
39    /*
40    *  _parse
41    *  value parse utility function
42    */
43
44    var _parse = function(value) {
45        // parse value and convert NaN to 0
46        return parseFloat(value) || 0;
47    };
48
49    /*
50    *  _rows
51    *  utility function returns array of jQuery selections representing each row
52    *  (as displayed after float wrapping applied by browser)
53    */
54
55    var _rows = function(elements) {
56        var tolerance = 1,
57            $elements = $(elements),
58            lastTop = null,
59            rows = [];
60
61        // group elements by their top position
62        $elements.each(function(){
63            var $that = $(this),
64                top = $that.offset().top - _parse($that.css('margin-top')),
65                lastRow = rows.length > 0 ? rows[rows.length - 1] : null;
66
67            if (lastRow === null) {
68                // first item on the row, so just push it
69                rows.push($that);
70            } else {
71                // if the row top is the same, add to the row group
72                if (Math.floor(Math.abs(lastTop - top)) <= tolerance) {
73                    rows[rows.length - 1] = lastRow.add($that);
74                } else {
75                    // otherwise start a new row group
76                    rows.push($that);
77                }
78            }
79
80            // keep track of the last row top
81            lastTop = top;
82        });
83
84        return rows;
85    };
86
87    /*
88    *  _parseOptions
89    *  handle plugin options
90    */
91
92    var _parseOptions = function(options) {
93        var opts = {
94            byRow: true,
95            property: 'height',
96            target: null,
97            remove: false
98        };
99
100        if (typeof options === 'object') {
101            return $.extend(opts, options);
102        }
103
104        if (typeof options === 'boolean') {
105            opts.byRow = options;
106        } else if (options === 'remove') {
107            opts.remove = true;
108        }
109
110        return opts;
111    };
112
113    /*
114    *  matchHeight
115    *  plugin definition
116    */
117
118    var matchHeight = $.fn.matchHeight = function(options) {
119        var opts = _parseOptions(options);
120
121        // handle remove
122        if (opts.remove) {
123            var that = this;
124
125            // remove fixed height from all selected elements
126            this.css(opts.property, '');
127
128            // remove selected elements from all groups
129            $.each(matchHeight._groups, function(key, group) {
130                group.elements = group.elements.not(that);
131            });
132
133            // TODO: cleanup empty groups
134
135            return this;
136        }
137
138        if (this.length <= 1 && !opts.target) {
139            return this;
140        }
141
142        // keep track of this group so we can re-apply later on load and resize events
143        matchHeight._groups.push({
144            elements: this,
145            options: opts
146        });
147
148        // match each element's height to the tallest element in the selection
149        matchHeight._apply(this, opts);
150
151        return this;
152    };
153
154    /*
155    *  plugin global options
156    */
157
158    matchHeight.version = '0.7.2';
159    matchHeight._groups = [];
160    matchHeight._throttle = 80;
161    matchHeight._maintainScroll = false;
162    matchHeight._beforeUpdate = null;
163    matchHeight._afterUpdate = null;
164    matchHeight._rows = _rows;
165    matchHeight._parse = _parse;
166    matchHeight._parseOptions = _parseOptions;
167
168    /*
169    *  matchHeight._apply
170    *  apply matchHeight to given elements
171    */
172
173    matchHeight._apply = function(elements, options) {
174        var opts = _parseOptions(options),
175            $elements = $(elements),
176            rows = [$elements];
177
178        // take note of scroll position
179        var scrollTop = $(window).scrollTop(),
180            htmlHeight = $('html').outerHeight(true);
181
182        // get hidden parents
183        var $hiddenParents = $elements.parents().filter(':hidden');
184
185        // cache the original inline style
186        $hiddenParents.each(function() {
187            var $that = $(this);
188            $that.data('style-cache', $that.attr('style'));
189        });
190
191        // temporarily must force hidden parents visible
192        $hiddenParents.css('display', 'block');
193
194        // get rows if using byRow, otherwise assume one row
195        if (opts.byRow && !opts.target) {
196
197            // must first force an arbitrary equal height so floating elements break evenly
198            $elements.each(function() {
199                var $that = $(this),
200                    display = $that.css('display');
201
202                // temporarily force a usable display value
203                if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
204                    display = 'block';
205                }
206
207                // cache the original inline style
208                $that.data('style-cache', $that.attr('style'));
209
210                $that.css({
211                    'display': display,
212                    'padding-top': '0',
213                    'padding-bottom': '0',
214                    'margin-top': '0',
215                    'margin-bottom': '0',
216                    'border-top-width': '0',
217                    'border-bottom-width': '0',
218                    'height': '100px',
219                    'overflow': 'hidden'
220                });
221            });
222
223            // get the array of rows (based on element top position)
224            rows = _rows($elements);
225
226            // revert original inline styles
227            $elements.each(function() {
228                var $that = $(this);
229                $that.attr('style', $that.data('style-cache') || '');
230            });
231        }
232
233        $.each(rows, function(key, row) {
234            var $row = $(row),
235                targetHeight = 0;
236
237            if (!opts.target) {
238                // skip apply to rows with only one item
239                if (opts.byRow && $row.length <= 1) {
240                    $row.css(opts.property, '');
241                    return;
242                }
243
244                // iterate the row and find the max height
245                $row.each(function(){
246                    var $that = $(this),
247                        style = $that.attr('style'),
248                        display = $that.css('display');
249
250                    // temporarily force a usable display value
251                    if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
252                        display = 'block';
253                    }
254
255                    // ensure we get the correct actual height (and not a previously set height value)
256                    var css = { 'display': display };
257                    css[opts.property] = '';
258                    $that.css(css);
259
260                    // find the max height (including padding, but not margin)
261                    if ($that.outerHeight(false) > targetHeight) {
262                        targetHeight = $that.outerHeight(false);
263                    }
264
265                    // revert styles
266                    if (style) {
267                        $that.attr('style', style);
268                    } else {
269                        $that.css('display', '');
270                    }
271                });
272            } else {
273                // if target set, use the height of the target element
274                targetHeight = opts.target.outerHeight(false);
275            }
276
277            // iterate the row and apply the height to all elements
278            $row.each(function(){
279                var $that = $(this),
280                    verticalPadding = 0;
281
282                // don't apply to a target
283                if (opts.target && $that.is(opts.target)) {
284                    return;
285                }
286
287                // handle padding and border correctly (required when not using border-box)
288                if ($that.css('box-sizing') !== 'border-box') {
289                    verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width'));
290                    verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom'));
291                }
292
293                // set the height (accounting for padding and border)
294                $that.css(opts.property, (targetHeight - verticalPadding) + 'px');
295            });
296        });
297
298        // revert hidden parents
299        $hiddenParents.each(function() {
300            var $that = $(this);
301            $that.attr('style', $that.data('style-cache') || null);
302        });
303
304        // restore scroll position if enabled
305        if (matchHeight._maintainScroll) {
306            $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true));
307        }
308
309        return this;
310    };
311
312    /*
313    *  matchHeight._applyDataApi
314    *  applies matchHeight to all elements with a data-match-height attribute
315    */
316
317    matchHeight._applyDataApi = function() {
318        var groups = {};
319
320        // generate groups by their groupId set by elements using data-match-height
321        $('[data-match-height], [data-mh]').each(function() {
322            var $this = $(this),
323                groupId = $this.attr('data-mh') || $this.attr('data-match-height');
324
325            if (groupId in groups) {
326                groups[groupId] = groups[groupId].add($this);
327            } else {
328                groups[groupId] = $this;
329            }
330        });
331
332        // apply matchHeight to each group
333        $.each(groups, function() {
334            this.matchHeight(true);
335        });
336    };
337
338    /*
339    *  matchHeight._update
340    *  updates matchHeight on all current groups with their correct options
341    */
342
343    var _update = function(event) {
344        if (matchHeight._beforeUpdate) {
345            matchHeight._beforeUpdate(event, matchHeight._groups);
346        }
347
348        $.each(matchHeight._groups, function() {
349            matchHeight._apply(this.elements, this.options);
350        });
351
352        if (matchHeight._afterUpdate) {
353            matchHeight._afterUpdate(event, matchHeight._groups);
354        }
355    };
356
357    matchHeight._update = function(throttle, event) {
358        // prevent update if fired from a resize event
359        // where the viewport width hasn't actually changed
360        // fixes an event looping bug in IE8
361        if (event && event.type === 'resize') {
362            var windowWidth = $(window).width();
363            if (windowWidth === _previousResizeWidth) {
364                return;
365            }
366            _previousResizeWidth = windowWidth;
367        }
368
369        // throttle updates
370        if (!throttle) {
371            _update(event);
372        } else if (_updateTimeout === -1) {
373            _updateTimeout = setTimeout(function() {
374                _update(event);
375                _updateTimeout = -1;
376            }, matchHeight._throttle);
377        }
378    };
379
380    /*
381    *  bind events
382    */
383
384    // apply on DOM ready event
385    $(matchHeight._applyDataApi);
386
387    // use on or bind where supported
388    var on = $.fn.on ? 'on' : 'bind';
389
390    // update heights on load and resize events
391    $(window)[on]('load', function(event) {
392        matchHeight._update(false, event);
393    });
394
395    // throttled update heights on resize events
396    $(window)[on]('resize orientationchange', function(event) {
397        matchHeight._update(true, event);
398    });
399
400});
401
402
403}
404/*
405     FILE ARCHIVED ON 11:55:32 Mar 02, 2022 AND RETRIEVED FROM THE
406     INTERNET ARCHIVE ON 06:57:20 Jul 22, 2024.
407     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
408
409     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
410     SECTION 108(a)(3)).
411*/
412/*
413playback timings (ms):
414  captures_list: 0.852
415  exclusion.robots: 0.055
416  exclusion.robots.policy: 0.033
417  esindex: 0.017
418  cdx.remote: 23.741
419  LoadShardBlock: 256.244 (3)
420  PetaboxLoader3.datanode: 219.41 (5)
421  PetaboxLoader3.resolve: 108.949 (2)
422  load_resource: 105.261
423  loaddict: 31.786
424*/

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.