Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

deprecated.js 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. define( [
  2. "./core",
  3. "./core/nodeName",
  4. "./core/camelCase",
  5. "./core/toType",
  6. "./var/isFunction",
  7. "./var/isWindow",
  8. "./var/slice",
  9. "./event/alias"
  10. ], function( jQuery, nodeName, camelCase, toType, isFunction, isWindow, slice ) {
  11. "use strict";
  12. jQuery.fn.extend( {
  13. bind: function( types, data, fn ) {
  14. return this.on( types, null, data, fn );
  15. },
  16. unbind: function( types, fn ) {
  17. return this.off( types, null, fn );
  18. },
  19. delegate: function( selector, types, data, fn ) {
  20. return this.on( types, selector, data, fn );
  21. },
  22. undelegate: function( selector, types, fn ) {
  23. // ( namespace ) or ( selector, types [, fn] )
  24. return arguments.length === 1 ?
  25. this.off( selector, "**" ) :
  26. this.off( types, selector || "**", fn );
  27. }
  28. } );
  29. // Bind a function to a context, optionally partially applying any
  30. // arguments.
  31. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  32. // However, it is not slated for removal any time soon
  33. jQuery.proxy = function( fn, context ) {
  34. var tmp, args, proxy;
  35. if ( typeof context === "string" ) {
  36. tmp = fn[ context ];
  37. context = fn;
  38. fn = tmp;
  39. }
  40. // Quick check to determine if target is callable, in the spec
  41. // this throws a TypeError, but we will just return undefined.
  42. if ( !isFunction( fn ) ) {
  43. return undefined;
  44. }
  45. // Simulated bind
  46. args = slice.call( arguments, 2 );
  47. proxy = function() {
  48. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  49. };
  50. // Set the guid of unique handler to the same of original handler, so it can be removed
  51. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  52. return proxy;
  53. };
  54. jQuery.holdReady = function( hold ) {
  55. if ( hold ) {
  56. jQuery.readyWait++;
  57. } else {
  58. jQuery.ready( true );
  59. }
  60. };
  61. jQuery.isArray = Array.isArray;
  62. jQuery.parseJSON = JSON.parse;
  63. jQuery.nodeName = nodeName;
  64. jQuery.isFunction = isFunction;
  65. jQuery.isWindow = isWindow;
  66. jQuery.camelCase = camelCase;
  67. jQuery.type = toType;
  68. jQuery.now = Date.now;
  69. jQuery.isNumeric = function( obj ) {
  70. // As of jQuery 3.0, isNumeric is limited to
  71. // strings and numbers (primitives or objects)
  72. // that can be coerced to finite numbers (gh-2662)
  73. var type = jQuery.type( obj );
  74. return ( type === "number" || type === "string" ) &&
  75. // parseFloat NaNs numeric-cast false positives ("")
  76. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  77. // subtraction forces infinities to NaN
  78. !isNaN( obj - parseFloat( obj ) );
  79. };
  80. } );