Adds src/deprecated.js, test/unit/deprecated.js; -deprecated flag; Moves jQuery.browser and removes use in test/unit/ajax.js. Fixes #11965

This commit is contained in:
Rick Waldron
2012-06-25 10:02:28 -04:00
parent b47147118c
commit a2758377df
9 changed files with 100 additions and 77 deletions

View File

@@ -30,9 +30,6 @@ var
// The deferred used on DOM ready
readyList,
// For matching the engine and version of the browser
browserMatch,
// Used for detecting and trimming whitespace
core_rnotwhite = /\S/,
core_rspace = /\s+/,
@@ -53,12 +50,6 @@ var
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
// Useragent RegExp
rmsie = /(msie) ([\w.]+)/,
rwebkit = /(webkit)[ \/]([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
@@ -68,9 +59,6 @@ var
return ( letter + "" ).toUpperCase();
},
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
// The ready event handler and self cleanup method
DOMContentLoaded = function() {
if ( document.addEventListener ) {
@@ -802,20 +790,6 @@ jQuery.extend({
return ( new Date() ).getTime();
},
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
uaMatch: function( ua ) {
ua = ua.toLowerCase();
var match = rwebkit.exec( ua ) ||
ropera.exec( ua ) ||
rmsie.exec( ua ) ||
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
[];
return { browser: match[1] || "", version: match[2] || "0" };
},
sub: function() {
function jQuerySub( selector, context ) {
return new jQuerySub.fn.init( selector, context );
@@ -835,9 +809,7 @@ jQuery.extend({
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub(document);
return jQuerySub;
},
browser: {}
}
});
jQuery.ready.promise = function( object ) {
@@ -903,16 +875,5 @@ jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" ")
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] = true;
jQuery.browser.version = browserMatch.version;
}
// Deprecated, use jQuery.browser.webkit instead
if ( jQuery.browser.webkit ) {
jQuery.browser.safari = true;
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);