PageSourceSearch

https://www.condeduquemadrid.es/modules/contrib/jquery_deprecated_…/js/jquery.deprecated.functions.js?v=1.x

js condeduquemadrid.es collected 2026-10-01 10:36:01 UTC 7,170 bytes, 215 lines download raw bytes

1(function ($) {
2  /**
3   * Determines if its argument is callable as a function.
4   * As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".
5   * More information: https://api.jquery.com/jQuery.isFunction/ */
6
7  /** CONSTANTS AND VARIABLES * */
8
9  const class2type = {};
10
11  const toString = class2type.toString;
12
13  // Populate the class2type map
14  jQuery.each(
15    'Boolean Number String Function Array Date RegExp Object Error Symbol'.split(
16      ' ',
17    ),
18    function (i, name) {
19      class2type[`[object ${name}]`] = name.toLowerCase();
20    },
21  );
22
23  jQuery.fx.interval = 13;
24
25  /**
26   * Takes a well-formed JSON string and returns the resulting JavaScript value.
27   * As of jQuery 3.0, $.parseJSON is deprecated. To parse JSON strings use the native JSON.parse method instead.
28   */
29  /* eslint-disable-next-line no-useless-escape */
30  const rvalidtokens =
31    /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
32
33  /** FUNCTIONS * */
34
35  $.fn.isFunction = function (fn) {
36    return typeof fn === 'function';
37  };
38
39  $.isFunction = function (obj) {
40    return typeof obj === 'function';
41  };
42
43  $.type = function (obj) {
44    if (obj == null) {
45      return `${obj}`;
46    }
47
48    // Support: Android <=2.3 only (functionish RegExp)
49    return typeof obj === 'object' || typeof obj === 'function'
50      ? class2type[toString.call(obj)] || 'object'
51      : typeof obj;
52  };
53
54  /**
55   * Remove the whitespace from the beginning and end of a string.
56   *
57   * Note: This API has been deprecated in jQuery 3.5; please use the
58   * native String.prototype.trim method instead. Unlike jQuery.trim,
59   * String.prototype.trim does not work with types other than strings
60   * (null, undefined, Number). Make sure that your code is compatible
61   * when migrating.
62   * More information: https://api.jquery.com/jQuery.trim/
63   */
64
65  // Support: Android<4.1, IE<9
66  // Make sure we trim BOM and NBSP
67  const rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
68
69  // Support: Android<4.1, IE<9
70  $.trim = (text) => {
71    return text == null ? '' : `${text}`.replace(rtrim, '');
72  };
73
74  /* Determine whether the argument is an array.
75   * This API has been deprecated in jQuery 3.2; please use the native Array.isArray method instead.
76   * MOre information: https://api.jquery.com/jQuery.isArray/ */
77  $.isArray = (obj) => {
78    return jQuery.type(obj) === 'array';
79  };
80
81  /* The $.camelCase() function in jQuery converts a hyphenated string to
82   * camel case. It is used internally by jQuery for manipulating CSS
83   * properties and data attributes.  */
84  // Matches dashed string for camelizing
85  const rmsPrefix = /^-ms-/;
86  const rdashAlpha = /-([\da-z])/gi;
87
88  // Used by jQuery.camelCase as callback to replace()
89  $.fcamelCase = (all, letter) => {
90    return letter.toUpperCase();
91  };
92
93  $.camelCase = (string) => {
94    return string.replace(rmsPrefix, 'ms-').replace(rdashAlpha, $.fcamelCase);
95  };
96
97  /** The jQuery.isWindow() function is a function used to determine if
98   * a given argument is a window object. It returned true if the
99   * object was a window and false otherwise. This function was
100   * deprecated in jQuery version 3.3 and has been removed */
101  $.isWindow = (obj) => {
102    /* jshint eqeqeq: false */
103    return obj != null && obj === obj.window;
104  };
105
106  /* This function was to check nodes names, but it
107   * was documented: https://github.com/jquery/jquery/issues/3475 */
108  $.nodeName = (elem, name) => {
109    return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
110  };
111
112  /* The $.isNumeric() method checks whether its argument represents a numeric
113   * value. If so, it returns true. Otherwise it returns false.
114   * The argument can be of any type. */
115  $.isNumeric = (obj) => {
116    return !Number.isNaN(parseFloat(obj)) && Number.isFinite(obj);
117  };
118
119  /* Return a number representing the current time. */
120  /* This API has been deprecated in jQuery 3.3; please use the native Date.now() method instead. */
121  jQuery.now = function () {
122    return new Date().getTime();
123  };
124
125  jQuery.parseJSON = function (data) {
126    // Attempt to parse using the native JSON parser first
127    if (window.JSON && window.JSON.parse) {
128      // Support: Android 2.3
129      // Workaround failure to string-cast null input
130      return window.JSON.parse(`${data}`);
131    }
132
133    let requireNonComma;
134    let depth = null;
135    /* eslint-disable-next-line no-jquery/no-trim */
136    const str = jQuery.trim(`${data}`);
137
138    // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
139    // after removing valid tokens
140
141    return str &&
142      /* eslint-disable-next-line no-jquery/no-trim */
143      !jQuery.trim(
144        str.replace(rvalidtokens, function (token, comma, open, close) {
145          // Force termination if we see a misplaced comma
146          if (requireNonComma && comma) {
147            depth = 0;
148          }
149
150          // Perform no more replacements after returning to outermost depth
151          if (depth === 0) {
152            return token;
153          }
154
155          // Commas must not follow "[", "{", or ","
156          requireNonComma = open || comma;
157
158          // Determine new depth
159          // array/object open ("[" or "{"): depth += true - false (increment)
160          // array/object close ("]" or "}"): depth += false - true (decrement)
161          // other cases ("," or primitive): depth += true - true (numeric cast)
162          depth += !close - !open;
163
164          // Remove this token
165          return '';
166        }),
167      )
168      ? /* eslint-disable-next-line no-new-func */
169        Function(`return ${str}`)()
170      : jQuery.error(`Invalid JSON: ${data}`);
171  };
172
173  /* It is a utility function used to sort an array of Document Object Model (DOM) elements and
174   * remove duplicate nodes, returning the result in document order */
175  /* The jQuery.unique() method is deprecated as of jQuery 3.0 and is now an alias for jQuery.uniqueSort() */
176  if (!$.fn.unique && $.fn.uniqueSort) {
177    $.fn.unique = $.fn.uniqueSort;
178  }
179  if (!$.unique && $.uniqueSort) {
180    $.unique = $.uniqueSort;
181  }
182
183  /* OBJECTS */
184
185  jQuery.extend({
186    /* cssNumber is an object containing all CSS properties that may be used without a 
187  unit. The .css() method uses this object to see if it may append 
188  px to unitless values.
189  More information about it and how to use it here: https://jqapi.com/jquery.cssnumber/ */
190    cssNumber: {
191      animationIterationCount: true,
192      columnCount: true,
193      fillOpacity: true,
194      flexGrow: true,
195      flexShrink: true,
196      fontWeight: true,
197      lineHeight: true,
198      opacity: true,
199      order: true,
200      orphans: true,
201      widows: true,
202      zIndex: true,
203      zoom: true,
204    },
205
206    /**
207     * jQuery.cssProps is an object used internally by jQuery to handle
208     * inconsistencies in CSS property naming across different browsers,
209     * particularly older ones. I set it to 'stylefloat' by default */
210    cssProps: {
211      // normalize float css property
212      float: 'styleFloat',
213    },
214  });
215})(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.