| 1 | define( [
|
| 2 | "./core",
|
| 3 | "./core/nodeName",
|
| 4 | "./core/camelCase",
|
| 5 | "./core/toType",
|
| 6 | "./var/isFunction",
|
| 7 | "./var/isWindow",
|
| 8 | "./var/slice",
|
| 9 |
|
| 10 | "./deprecated/ajax-event-alias",
|
| 11 | "./deprecated/event"
|
| 12 | ], function( jQuery, nodeName, camelCase, toType, isFunction, isWindow, slice ) {
|
| 13 |
|
| 14 | "use strict";
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 | var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 | jQuery.proxy = function( fn, context ) {
|
| 27 | var tmp, args, proxy;
|
| 28 |
|
| 29 | if ( typeof context === "string" ) {
|
| 30 | tmp = fn[ context ];
|
| 31 | context = fn;
|
| 32 | fn = tmp;
|
| 33 | }
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 | if ( !isFunction( fn ) ) {
|
| 38 | return undefined;
|
| 39 | }
|
| 40 |
|
| 41 |
|
| 42 | args = slice.call( arguments, 2 );
|
| 43 | proxy = function() {
|
| 44 | return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
|
| 45 | };
|
| 46 |
|
| 47 |
|
| 48 | proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
| 49 |
|
| 50 | return proxy;
|
| 51 | };
|
| 52 |
|
| 53 | jQuery.holdReady = function( hold ) {
|
| 54 | if ( hold ) {
|
| 55 | jQuery.readyWait++;
|
| 56 | } else {
|
| 57 | jQuery.ready( true );
|
| 58 | }
|
| 59 | };
|
| 60 | jQuery.isArray = Array.isArray;
|
| 61 | jQuery.parseJSON = JSON.parse;
|
| 62 | jQuery.nodeName = nodeName;
|
| 63 | jQuery.isFunction = isFunction;
|
| 64 | jQuery.isWindow = isWindow;
|
| 65 | jQuery.camelCase = camelCase;
|
| 66 | jQuery.type = toType;
|
| 67 |
|
| 68 | jQuery.now = Date.now;
|
| 69 |
|
| 70 | jQuery.isNumeric = function( obj ) {
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 | var type = jQuery.type( obj );
|
| 76 | return ( type === "number" || type === "string" ) &&
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 | !isNaN( obj - parseFloat( obj ) );
|
| 82 | };
|
| 83 |
|
| 84 | jQuery.trim = function( text ) {
|
| 85 | return text == null ?
|
| 86 | "" :
|
| 87 | ( text + "" ).replace( rtrim, "$1" );
|
| 88 | };
|
| 89 | } );
|