2015-10-18 15:02:16 +00:00
|
|
|
define( [
|
2017-01-17 16:52:50 +00:00
|
|
|
"./core",
|
2017-06-23 04:14:43 +00:00
|
|
|
"./core/nodeName",
|
2017-12-04 21:38:37 +00:00
|
|
|
"./core/camelCase",
|
2018-01-14 08:46:20 +00:00
|
|
|
"./core/toType",
|
2017-12-13 06:43:30 +00:00
|
|
|
"./var/isFunction",
|
2017-12-11 17:58:35 +00:00
|
|
|
"./var/isWindow",
|
2017-12-29 21:58:45 +00:00
|
|
|
"./var/slice",
|
|
|
|
|
2020-01-21 13:12:35 +00:00
|
|
|
"./deprecated/ajax-event-alias",
|
|
|
|
"./deprecated/event"
|
2018-01-14 08:46:20 +00:00
|
|
|
], function( jQuery, nodeName, camelCase, toType, isFunction, isWindow, slice ) {
|
2015-10-01 20:03:10 +00:00
|
|
|
|
2016-04-25 18:25:08 +00:00
|
|
|
"use strict";
|
|
|
|
|
2019-08-22 00:06:26 +00:00
|
|
|
// Support: Android <=4.0 only
|
|
|
|
// Make sure we trim BOM and NBSP
|
2022-07-20 08:51:13 +00:00
|
|
|
// Require that the "whitespace run" starts from a non-whitespace
|
|
|
|
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
|
|
|
|
var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
|
2019-08-22 00:06:26 +00:00
|
|
|
|
2017-12-11 17:58:35 +00:00
|
|
|
// Bind a function to a context, optionally partially applying any
|
|
|
|
// arguments.
|
|
|
|
// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
|
|
|
|
// However, it is not slated for removal any time soon
|
|
|
|
jQuery.proxy = function( fn, context ) {
|
|
|
|
var tmp, args, proxy;
|
|
|
|
|
|
|
|
if ( typeof context === "string" ) {
|
|
|
|
tmp = fn[ context ];
|
|
|
|
context = fn;
|
|
|
|
fn = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Quick check to determine if target is callable, in the spec
|
|
|
|
// this throws a TypeError, but we will just return undefined.
|
2017-12-13 06:43:30 +00:00
|
|
|
if ( !isFunction( fn ) ) {
|
2017-12-11 17:58:35 +00:00
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Simulated bind
|
|
|
|
args = slice.call( arguments, 2 );
|
|
|
|
proxy = function() {
|
|
|
|
return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
|
|
|
|
};
|
|
|
|
|
|
|
|
// Set the guid of unique handler to the same of original handler, so it can be removed
|
|
|
|
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
|
|
|
|
|
|
|
return proxy;
|
|
|
|
};
|
|
|
|
|
2016-09-25 04:12:20 +00:00
|
|
|
jQuery.holdReady = function( hold ) {
|
|
|
|
if ( hold ) {
|
|
|
|
jQuery.readyWait++;
|
|
|
|
} else {
|
|
|
|
jQuery.ready( true );
|
|
|
|
}
|
|
|
|
};
|
2016-08-14 10:54:16 +00:00
|
|
|
jQuery.isArray = Array.isArray;
|
2016-02-24 22:47:19 +00:00
|
|
|
jQuery.parseJSON = JSON.parse;
|
2017-03-06 22:51:26 +00:00
|
|
|
jQuery.nodeName = nodeName;
|
2017-12-13 06:43:30 +00:00
|
|
|
jQuery.isFunction = isFunction;
|
2017-06-23 04:14:43 +00:00
|
|
|
jQuery.isWindow = isWindow;
|
2017-12-04 21:38:37 +00:00
|
|
|
jQuery.camelCase = camelCase;
|
2018-01-14 08:46:20 +00:00
|
|
|
jQuery.type = toType;
|
2016-02-24 22:47:19 +00:00
|
|
|
|
2017-12-11 17:39:11 +00:00
|
|
|
jQuery.now = Date.now;
|
|
|
|
|
2017-12-13 05:51:49 +00:00
|
|
|
jQuery.isNumeric = function( obj ) {
|
|
|
|
|
|
|
|
// As of jQuery 3.0, isNumeric is limited to
|
|
|
|
// strings and numbers (primitives or objects)
|
|
|
|
// that can be coerced to finite numbers (gh-2662)
|
|
|
|
var type = jQuery.type( obj );
|
|
|
|
return ( type === "number" || type === "string" ) &&
|
|
|
|
|
|
|
|
// parseFloat NaNs numeric-cast false positives ("")
|
|
|
|
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
|
|
|
// subtraction forces infinities to NaN
|
|
|
|
!isNaN( obj - parseFloat( obj ) );
|
|
|
|
};
|
|
|
|
|
2019-08-22 00:06:26 +00:00
|
|
|
jQuery.trim = function( text ) {
|
|
|
|
return text == null ?
|
|
|
|
"" :
|
2022-07-20 08:51:13 +00:00
|
|
|
( text + "" ).replace( rtrim, "$1" );
|
2019-08-22 00:06:26 +00:00
|
|
|
};
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|