PageSourceSearch

https://margrietvanbreevoort.com/wp-content/themes/shapely/assets/js/jquery-compat.js?ver=1.3.7

js margrietvanbreevoort.com collected 2026-10-06 01:30:21 UTC 3,820 bytes, 127 lines download raw bytes

1/**
2 * jQuery 4 compatibility shim for the bundled plugins.
3 *
4 * jQuery 4.0 removed $.camelCase, $.type, $.isFunction, $.isArray, $.trim,
5 * $.isNumeric and $.now. OwlCarousel 2.3.4 calls $.camelCase every time it
6 * fires an event, so on jQuery 4 its first trigger throws and takes the rest
7 * of document-ready down with it.
8 *
9 * The event aliases (.bind(), .delegate(), .click(), ...) are only deprecated
10 * in 4.0 and still ship, but FlexSlider calls them and a later major or the
11 * slim build drops them, so they are covered too.
12 *
13 * Every definition is guarded, so on jQuery 3.x this file does nothing. Not
14 * `.load()`, which was both an AJAX method and an event alias and cannot be
15 * shimmed unambiguously.
16 *
17 * @package Shapely
18 */
19( function ( $ ) {
20	'use strict';
21
22	if ( ! $ || ! $.fn ) {
23		return;
24	}
25
26	if ( 'function' !== typeof $.fn.bind ) {
27		$.fn.bind = function ( types, data, fn ) {
28			return this.on( types, null, data, fn );
29		};
30	}
31
32	if ( 'function' !== typeof $.fn.unbind ) {
33		$.fn.unbind = function ( types, fn ) {
34			return this.off( types, null, fn );
35		};
36	}
37
38	if ( 'function' !== typeof $.fn.delegate ) {
39		// Note the argument order flip: .delegate(selector, types, ...) maps to
40		// .on(types, selector, ...).
41		$.fn.delegate = function ( selector, types, data, fn ) {
42			return this.on( types, selector, data, fn );
43		};
44	}
45
46	if ( 'function' !== typeof $.fn.undelegate ) {
47		$.fn.undelegate = function ( selector, types, fn ) {
48			return 1 === arguments.length ?
49				this.off( selector, '**' ) :
50				this.off( types, selector || '**', fn );
51		};
52	}
53
54	/*
55	 * The per-event shorthand methods. FlexSlider calls .blur()/.focus() and
56	 * OwlCarousel .resize(); any third-party widget may use others.
57	 */
58	'blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu'
59		.split( ' ' )
60		.forEach( function ( name ) {
61			if ( 'function' !== typeof $.fn[ name ] ) {
62				$.fn[ name ] = function ( data, fn ) {
63					return arguments.length > 0 ?
64						this.on( name, null, data, fn ) :
65						this.trigger( name );
66				};
67			}
68		} );
69
70	/*
71	 * Utilities removed in jQuery 4. OwlCarousel uses $.type() and
72	 * $.camelCase(); the others travel together in older plugins.
73	 */
74	if ( 'function' !== typeof $.type ) {
75		var class2type = {};
76		'Boolean Number String Function Array Date RegExp Object Error Symbol'
77			.split( ' ' )
78			.forEach( function ( name ) {
79				class2type[ '[object ' + name + ']' ] = name.toLowerCase();
80			} );
81
82		$.type = function ( obj ) {
83			if ( null == obj ) {
84				return obj + '';
85			}
86			return 'object' === typeof obj || 'function' === typeof obj ?
87				class2type[ Object.prototype.toString.call( obj ) ] || 'object' :
88				typeof obj;
89		};
90	}
91
92	if ( 'function' !== typeof $.isFunction ) {
93		$.isFunction = function ( obj ) {
94			return 'function' === typeof obj && 'number' !== typeof obj.nodeType;
95		};
96	}
97
98	if ( 'function' !== typeof $.isArray ) {
99		$.isArray = Array.isArray;
100	}
101
102	if ( 'function' !== typeof $.trim ) {
103		$.trim = function ( text ) {
104			return null == text ? '' : ( text + '' ).replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '' );
105		};
106	}
107
108	if ( 'function' !== typeof $.isNumeric ) {
109		$.isNumeric = function ( obj ) {
110			var type = $.type( obj );
111			return ( 'number' === type || 'string' === type ) && ! isNaN( obj - parseFloat( obj ) );
112		};
113	}
114
115	if ( 'function' !== typeof $.camelCase ) {
116		// jQuery 3's implementation, including its "-ms-" special case.
117		$.camelCase = function ( string ) {
118			return String( string ).replace( /^-ms-/, 'ms-' ).replace( /-([a-z])/g, function ( all, letter ) {
119				return letter.toUpperCase();
120			} );
121		};
122	}
123
124	if ( 'function' !== typeof $.now ) {
125		$.now = Date.now;
126	}
127}( 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.