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",
|
2017-12-13 06:43:30 +00:00
|
|
|
"./var/isFunction",
|
2017-12-11 17:58:35 +00:00
|
|
|
"./var/isWindow",
|
|
|
|
"./var/slice"
|
2017-12-13 06:43:30 +00:00
|
|
|
], function( jQuery, nodeName, camelCase, isFunction, isWindow, slice ) {
|
2015-10-01 20:03:10 +00:00
|
|
|
|
2016-04-25 18:25:08 +00:00
|
|
|
"use strict";
|
|
|
|
|
2015-10-01 20:03:10 +00:00
|
|
|
jQuery.fn.extend( {
|
|
|
|
|
|
|
|
bind: function( types, data, fn ) {
|
|
|
|
return this.on( types, null, data, fn );
|
|
|
|
},
|
|
|
|
unbind: function( types, fn ) {
|
|
|
|
return this.off( types, null, fn );
|
|
|
|
},
|
|
|
|
|
|
|
|
delegate: function( selector, types, data, fn ) {
|
|
|
|
return this.on( types, selector, data, fn );
|
|
|
|
},
|
|
|
|
undelegate: function( selector, types, fn ) {
|
|
|
|
|
|
|
|
// ( namespace ) or ( selector, types [, fn] )
|
|
|
|
return arguments.length === 1 ?
|
|
|
|
this.off( selector, "**" ) :
|
|
|
|
this.off( types, selector || "**", fn );
|
2017-03-06 22:51:26 +00:00
|
|
|
}
|
2015-10-01 20:03:10 +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;
|
2016-02-24 22:47:19 +00:00
|
|
|
|
2017-12-11 17:39:11 +00:00
|
|
|
jQuery.now = Date.now;
|
|
|
|
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|