Index: wp-includes/js/jquery/jquery.js
===================================================================
--- wp-includes/js/jquery/jquery.js (revision 23296)
+++ wp-includes/js/jquery/jquery.js (working copy)
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.9.0b1
+ * jQuery JavaScript Library v1.9.0rc1
* http://jquery.com/
*
* Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license
* http://jquery.org/license
*
- * Date: 2012-12-16
+ * Date: 2013-1-8
*/
(function( window, undefined ) {
"use strict";
@@ -36,7 +36,7 @@
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
- core_version = "1.9.0b1",
+ core_version = "1.9.0rc1",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
@@ -111,13 +111,6 @@
return this;
}
- // HANDLE: $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
// Handle HTML strings
if ( typeof selector === "string" ) {
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
@@ -191,6 +184,12 @@
return this.constructor( context ).find( selector );
}
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
@@ -442,9 +441,12 @@
},
type: function( obj ) {
- return obj == null ?
- String( obj ) :
- class2type[ core_toString.call(obj) ] || "object";
+ if ( obj == null ) {
+ return String( obj );
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ core_toString.call(obj) ] || "object" :
+ typeof obj;
},
isPlainObject: function( obj ) {
@@ -509,8 +511,7 @@
return [ context.createElement( parsed[1] ) ];
}
- parsed = context.createDocumentFragment();
- jQuery.clean( [ data ], context, parsed, scripts );
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts ) {
jQuery( scripts ).remove();
}
@@ -1164,22 +1165,19 @@
return jQuery.Deferred(function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) {
var action = tuple[ 0 ],
- fn = fns[ i ];
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
// deferred[ done | fail | progress ] for forwarding actions to newDefer
- deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
- function() {
- var returned = fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .done( newDefer.resolve )
- .fail( newDefer.reject )
- .progress( newDefer.notify );
- } else {
- newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, [ returned ] );
- }
- } :
- newDefer[ action ]
- );
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
});
fns = null;
}).promise();
@@ -1215,7 +1213,7 @@
// deferred[ resolve | reject | notify ]
deferred[ tuple[0] ] = function() {
- deferred[ tuple[0] + "With" ]( promise, arguments );
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
return this;
};
deferred[ tuple[0] + "With" ] = list.fireWith;
@@ -1287,17 +1285,7 @@
});
jQuery.support = (function() {
- var support,
- all,
- a,
- select,
- opt,
- input,
- fragment,
- eventName,
- i,
- isSupported,
- clickFn,
+ var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
div = document.createElement("div");
// Setup
@@ -1367,9 +1355,6 @@
boxModel: document.compatMode === "CSS1Compat",
// Will be defined later
- submitBubbles: true,
- changeBubbles: true,
- focusinBubbles: false,
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
@@ -1388,24 +1373,13 @@
select.disabled = true;
support.optDisabled = !opt.disabled;
- // Test to see if it's possible to delete an expando from an element
- // Fails in Internet Explorer
+ // Support: IE<9
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
- if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
- div.attachEvent( "onclick", clickFn = function() {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- support.noCloneEvent = false;
- });
- div.cloneNode( true ).fireEvent("onclick");
- div.detachEvent( "onclick", clickFn );
- }
-
// Check if we can trust getAttribute("value")
input = document.createElement("input");
input.setAttribute( "value", "" );
@@ -1417,49 +1391,46 @@
support.radioValue = input.value === "t";
// #11217 - WebKit loses check when the name is after the checked attribute
- input.setAttribute( "checked", "checked" );
+ input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
- div.appendChild( input );
fragment = document.createDocumentFragment();
- fragment.appendChild( div.lastChild );
+ fragment.appendChild( input );
- // WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
- fragment.removeChild( input );
- fragment.appendChild( div );
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
- // Technique from Juriy Zaytsev
- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
- // We only care about the case where non-standard event systems
- // are used, namely in IE. Short-circuiting here helps us to
- // avoid an eval call (in setAttribute) which can cause CSP
- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ // Support: IE<9
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
if ( div.attachEvent ) {
- for ( i in {
- submit: true,
- change: true,
- focusin: true
- }) {
- eventName = "on" + i;
- isSupported = ( eventName in div );
- if ( !isSupported ) {
- div.setAttribute( eventName, "return;" );
- isSupported = ( typeof div[ eventName ] === "function" );
- }
- support[ i + "Bubbles" ] = isSupported;
- }
+ div.attachEvent( "onclick", function() {
+ support.noCloneEvent = false;
+ });
+
+ div.cloneNode( true ).click();
}
+ // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
+ for ( i in { submit: true, change: true, focusin: true }) {
+ div.setAttribute( eventName = "on" + i, "t" );
+
+ support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
+ }
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
// Run tests that need a body at doc ready
jQuery(function() {
- var container, div, tds, marginDiv,
- divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
+ var container, marginDiv, tds,
+ divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
@@ -1468,20 +1439,17 @@
}
container = document.createElement("div");
- container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
- body.insertBefore( container, body.firstChild );
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
- // Construct the test element
- div = document.createElement("div");
- container.appendChild( div );
+ body.appendChild( container ).appendChild( div );
+ // Support: IE8
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
- // (only IE 8 fails this test)
div.innerHTML = "
";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
@@ -1490,8 +1458,8 @@
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
+ // Support: IE8
// Check if empty table cells still have offsetWidth/Height
- // (IE <= 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
@@ -1500,39 +1468,36 @@
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
- // NOTE: To any future maintainer, we've window.getComputedStyle
- // because jsdom on node.js will break without it.
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. For more
- // info see bug #3333
+ // gets computed margin-right based on width of container. (#3333)
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- marginDiv = document.createElement("div");
+ marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
- div.appendChild( marginDiv );
+
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== "undefined" ) {
+ // Support: IE<8
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
- // (IE < 8 does this)
div.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+ // Support: IE6
// Check if elements with layout shrink-wrap their children
- // (IE 6 does this)
div.style.display = "block";
- div.style.overflow = "visible";
div.innerHTML = "";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
@@ -1542,17 +1507,18 @@
body.style.zoom = 1;
}
+ body.removeChild( container );
+
// Null elements to avoid leaks in IE
- body.removeChild( container );
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
- fragment.removeChild( div );
- all = a = select = opt = input = fragment = div = null;
+ all = select = fragment = opt = a = input = null;
return support;
})();
+
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
@@ -1926,6 +1892,7 @@
startLength--;
}
+ hooks.cur = fn;
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
@@ -2367,7 +2334,11 @@
} else {
- ret = elem.getAttribute( name );
+ // In IE9+, Flash objects don't have .getAttribute (#12945)
+ // Support: IE9+
+ if ( typeof elem.getAttribute !== "undefined" ) {
+ ret = elem.getAttribute( name );
+ }
// Non-existent attributes return null, we normalize to undefined
return ret == null ?
@@ -2637,8 +2608,9 @@
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
- // Normalize to lowercase since IE uppercases css property names
- return elem.style.cssText.toLowerCase() || undefined;
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = value + "" );
@@ -3633,15 +3605,6 @@
return this.off( types, null, fn );
},
- live: function( types, data, fn ) {
- jQuery( this.context ).on( types, this.selector, data, fn );
- return this;
- },
- die: function( types, fn ) {
- jQuery( this.context ).off( types, this.selector || "**", fn );
- return this;
- },
-
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
@@ -3713,19 +3676,21 @@
contains,
sortOrder,
+ // Instance-specific data
expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ support = {},
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ // General-purpose constants
+ Token = String,
strundefined = typeof undefined,
-
- // Used in sorting
MAX_NEGATIVE = 1 << 31,
- preferredDoc = window.document,
- Token = String,
- dirruns = 0,
- done = 0,
- support = {},
-
// Array methods
arr = [],
pop = arr.pop,
@@ -3743,40 +3708,16 @@
return -1;
},
- // Augment a function for special use by Sizzle
- markFunction = function( fn, value ) {
- fn[ expando ] = value == null || value;
- return fn;
- },
- createCache = function() {
- var cache = {},
- keys = [];
+ // Regular expressions
- return markFunction(function( key, value ) {
- // Only keep the most recent entries
- if ( keys.push( key ) > Expr.cacheLength ) {
- delete cache[ keys.shift() ];
- }
-
- // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157)
- return (cache[ key + " " ] = value);
- }, cache );
- },
-
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
-
- // Regex
-
// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
// http://www.w3.org/TR/css3-syntax/#characters
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
// Loosely modeled on CSS identifier characters
- // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = characterEncoding.replace( "w", "w#" ),
@@ -3799,22 +3740,8 @@
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[\x20\t\r\n\f]*[+~]/,
-
- rheader = /h\d/i,
- rinputs = /input|select|textarea|button/i,
-
- rnative = /\{\s*\[native code\]\s*\}/,
-
- rbackslash = /\\(?!\\)/g,
-
- rescape = /'|\\/g,
- rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
-
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
@@ -3831,29 +3758,31 @@
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
- /**
- * For feature detection
- * @param {Function} fn The function to test for native support
- */
- isNative = function( fn ) {
- return rnative.test( fn + "" );
- },
+ rsibling = /[\x20\t\r\n\f]*[+~]/,
- /**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
- assert = function( fn ) {
- var div = document.createElement("div");
+ rnative = /\{\s*\[native code\]\s*\}/,
- try {
- return fn( div );
- } catch (e) {
- return false;
- } finally {
- // release memory in IE
- div = null;
- }
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rescape = /'|\\/g,
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
+ funescape = function( _, escaped ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ return high !== high ?
+ escaped :
+ // BMP codepoint
+ high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
// Use a stripped-down slice if we can't use a native one
@@ -3870,12 +3799,66 @@
};
}
+/**
+ * For feature detection
+ * @param {Function} fn The function to test for native support
+ */
+function isNative( fn ) {
+ return rnative.test( fn + "" );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var cache,
+ keys = [];
+
+ return (cache = function( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key ] = value);
+ });
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // release memory in IE
+ div = null;
+ }
+}
+
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
- if ( context && (( context.ownerDocument || context ) !== document) ) {
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
setDocument( context );
}
@@ -3996,11 +3979,11 @@
* @param {Element|Object} [doc] An element or document object to use to set the document
* @returns {Object} Returns the current document
*/
-setDocument = Sizzle.setDocument = function( doc ) {
- doc = doc && doc.ownerDocument || doc || window.document;
+setDocument = Sizzle.setDocument = function( node ) {
+ var doc = node ? node.ownerDocument || node : preferredDoc;
// If no document and documentElement is available, return
- if ( !doc || doc.nodeType !== 9 || !doc.documentElement || document === doc ) {
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
return document;
}
@@ -4087,7 +4070,7 @@
}
};
Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( rbackslash, "" );
+ var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute("id") === attrId;
};
@@ -4105,7 +4088,7 @@
}
};
Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( rbackslash, "" );
+ var attrId = id.replace( runescape, funescape );
return function( elem ) {
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
return node && node.value === attrId;
@@ -4189,16 +4172,15 @@
assert(function( div ) {
- // Opera 10-12/IE9 - ^= $= *= and empty values
+ // Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
- div.innerHTML = "";
- if ( div.querySelectorAll("[test^='']").length ) {
+ div.innerHTML = "";
+ if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests
- div.innerHTML = "";
if ( !div.querySelectorAll(":enabled").length ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
@@ -4222,7 +4204,7 @@
// This should fail with an exception
// Gecko does not error, returns false instead
- matches.call( div, "[test!='']:x" );
+ matches.call( div, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos );
});
}
@@ -4344,12 +4326,12 @@
};
Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, window.document, null, elements );
+ return Sizzle( expr, null, null, elements );
};
Sizzle.matchesSelector = function( elem, expr ) {
// Set document vars if needed
- if ( elem && (( elem.ownerDocument || elem ) !== document) ) {
+ if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
@@ -4376,7 +4358,7 @@
Sizzle.contains = function( context, elem ) {
// Set document vars if needed
- if ( context && (( context.ownerDocument || context ) !== document) ) {
+ if ( ( context.ownerDocument || context ) !== document ) {
setDocument( context );
}
return contains( context, elem );
@@ -4386,7 +4368,7 @@
var val;
// Set document vars if needed
- if ( elem && (( elem.ownerDocument || elem ) !== document) ) {
+ if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
@@ -4535,10 +4517,10 @@
preFilter: {
"ATTR": function( match ) {
- match[1] = match[1].replace( rbackslash, "" );
+ match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
if ( match[2] === "~=" ) {
match[3] = " " + match[3] + " ";
@@ -4615,14 +4597,14 @@
return function() { return true; };
}
- nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
+ nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
};
},
"CLASS": function( className ) {
- var pattern = classCache[ expando ][ className + " " ];
+ var pattern = classCache[ className + " " ];
return pattern ||
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
@@ -4824,6 +4806,34 @@
};
}),
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifider
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsXML ?
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
+ elem.lang) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
// Miscellaneous
"target": function( elem ) {
var hash = window.location && window.location.hash;
@@ -4964,7 +4974,7 @@
function tokenize( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
- cached = tokenCache[ expando ][ selector + " " ];
+ cached = tokenCache[ selector + " " ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
@@ -5357,7 +5367,7 @@
var i,
setMatchers = [],
elementMatchers = [],
- cached = compilerCache[ expando ][ selector + " " ];
+ cached = compilerCache[ selector + " " ];
if ( !cached ) {
// Generate a function of recursive functions that can be used to check each element
@@ -5403,7 +5413,7 @@
context.nodeType === 9 && !documentIsXML &&
Expr.relative[ tokens[1].type ] ) {
- context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context )[0];
+ context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
if ( !context ) {
return results;
}
@@ -5422,7 +5432,7 @@
if ( (find = Expr.find[ type ]) ) {
// Search, expanding context for leading sibling combinators
if ( (seed = find(
- token.matches[0].replace( rbackslash, "" ),
+ token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && context.parentNode || context
)) ) {
@@ -5944,6 +5954,12 @@
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
+
+ // If this is a select, ensure that it displays empty (#12336)
+ // Support: IE<9
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+ elem.options.length = 0;
+ }
}
return this;
@@ -6038,16 +6054,17 @@
var fragment, first, scripts, hasScripts, node, doc,
i = 0,
l = this.length,
+ set = this,
iNoClone = l - 1,
value = args[0],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
- return this.each(function() {
- var self = jQuery( this );
+ return this.each(function( index ) {
+ var self = set.eq( index );
if ( isFunction ) {
- args[0] = value.call( this, i, table ? self.html() : undefined );
+ args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});
@@ -6055,8 +6072,7 @@
if ( this[0] ) {
doc = this[0].ownerDocument;
- fragment = doc.createDocumentFragment();
- jQuery.clean( args, doc, fragment, undefined, this );
+ fragment = jQuery.buildFragment( args, doc, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
@@ -6301,7 +6317,7 @@
found;
}
-// Used in clean, fixes the defaultChecked property
+// Used in buildFragment, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
if ( manipulation_rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
@@ -6364,9 +6380,10 @@
return clone;
},
- clean: function( elems, context, fragment, scripts, selection ) {
+ buildFragment: function( elems, context, scripts, selection ) {
var elem, i, j, tmp, tag, wrap, tbody,
ret = [],
+ fragment = context.createDocumentFragment(),
safe = context === document && safeFragment;
// Ensure that context is a document
@@ -6453,29 +6470,27 @@
jQuery.grep( getAll( ret, "input" ), fixDefaultChecked );
}
- if ( fragment ) {
- for ( i = 0; (elem = ret[i]) != null; i++ ) {
- safe = jQuery.contains( elem.ownerDocument, elem );
+ for ( i = 0; (elem = ret[i]) != null; i++ ) {
+ safe = jQuery.contains( elem.ownerDocument, elem );
- // Append to fragment
- // #4087 - If origin and destination elements are the same, and this is
- // that element, do not append to fragment
- if ( !selection || jQuery.inArray( elem, selection ) === -1 ) {
- fragment.appendChild( elem );
- }
- tmp = getAll( elem, "script" );
+ // Append to fragment
+ // #4087 - If origin and destination elements are the same, and this is
+ // that element, do not append to fragment
+ if ( !selection || jQuery.inArray( elem, selection ) === -1 ) {
+ fragment.appendChild( elem );
+ }
+ tmp = getAll( elem, "script" );
- // Preserve script evaluation history
- if ( safe ) {
- setGlobalEval( tmp );
- }
+ // Preserve script evaluation history
+ if ( safe ) {
+ setGlobalEval( tmp );
+ }
- // Capture executables
- if ( scripts ) {
- for ( j = 0; (elem = tmp[j]) != null; j++ ) {
- if ( rscriptType.test( elem.type || "" ) ) {
- scripts.push( elem );
- }
+ // Capture executables
+ if ( scripts ) {
+ for ( j = 0; (elem = tmp[j]) != null; j++ ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
}
}
}
@@ -6483,7 +6498,7 @@
elem = tmp = safe = null;
- return ret;
+ return fragment;
},
cleanData: function( elems, /* internal */ acceptData ) {
@@ -6525,7 +6540,7 @@
if ( deleteExpando ) {
delete elem[ internalKey ];
- } else if ( elem.removeAttribute ) {
+ } else if ( typeof elem.removeAttribute !== "undefined" ) {
elem.removeAttribute( internalKey );
} else {
@@ -6754,8 +6769,8 @@
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
// but it would mean to define eight (for every problematic property) identical functions
- if ( value === "" && name.indexOf("background") === 0 ) {
- value = " ";
+ if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+ style[ name ] = "inherit";
}
// If a hook was provided, use that value, otherwise just set the specified value
@@ -8609,6 +8624,7 @@
function Animation( elem, properties, options ) {
var result,
+ stopped,
index = 0,
length = animationPrefilters.length,
deferred = jQuery.Deferred().always( function() {
@@ -8616,6 +8632,9 @@
delete tick.elem;
}),
tick = function() {
+ if ( stopped ) {
+ return false;
+ }
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
@@ -8657,7 +8676,10 @@
// if we are going to the end, we want to run all the tweens
// otherwise we skip this part
length = gotoEnd ? animation.tweens.length : 0;
-
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( 1 );
}
@@ -9014,12 +9036,15 @@
doAnimation = function() {
// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
- // Empty animations resolve immediately
- if ( empty ) {
+ doAnimation.finish = function() {
anim.stop( true );
+ };
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
}
};
+ doAnimation.finish = doAnimation;
return empty || optall.queue === false ?
this.each( doAnimation ) :
@@ -9074,6 +9099,47 @@
jQuery.dequeue( this, type );
}
});
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = jQuery._data( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.cur && hooks.cur.finish ) {
+ hooks.cur.finish.call( this );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ });
}
});
Index: wp-includes/js/jquery/jquery-migrate.js
===================================================================
--- wp-includes/js/jquery/jquery-migrate.js (revision 23296)
+++ wp-includes/js/jquery/jquery-migrate.js (working copy)
@@ -1,17 +1,14 @@
/*!
- * jQuery Migrate - v1.0.0pre - 2012-12-17
+ * jQuery Migrate - v1.0.0pre - 2013-01-09
* https://github.com/jquery/jquery-migrate
- * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT
*/
-
(function( jQuery, window, undefined ) {
"use strict";
// Use Uglify to do conditional compilation of warning messages;
-// the minified version will set this to false and remove dead code.
-if ( typeof window.JQMIGRATE_WARN === "undefined" ) {
- window.JQMIGRATE_WARN = true;
-}
+// the minified version will set this to false during compilation.
+window.JQMIGRATE_WARN = typeof JQMIGRATE_WARN === "undefined";
var warnedAbout = {};
@@ -19,6 +16,10 @@
// List of warnings already given; public read only
jQuery.migrateWarnings = [];
+// Set to true to prevent console output; migrateWarnings still maintained
+// Leave as undefined so that it can be set before plugin is loaded
+//jQuery.migrateMute = false;
+
// Forget any warnings we've already given; public
jQuery.migrateReset = function() {
warnedAbout = {};
@@ -30,7 +31,7 @@
if ( !warnedAbout[ msg ] ) {
warnedAbout[ msg ] = true;
jQuery.migrateWarnings.push( msg );
- if ( window.console && console.warn ) {
+ if ( window.console && console.warn && !jQuery.migrateMute ) {
console.warn( "JQMIGRATE: " + msg );
}
}
@@ -78,15 +79,20 @@
valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
function() { return undefined; },
rnoType = /^(?:input|button)$/i,
- rnoAttrNodeType = /^[238]$/;
+ rnoAttrNodeType = /^[238]$/,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ ruseDefault = /^(?:checked|selected)$/i;
// jQuery.attrFn
migrateWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" );
jQuery.attr = function( elem, name, value, pass ) {
+ var lowerName = name.toLowerCase(),
+ nType = elem && elem.nodeType;
+
if ( pass ) {
migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
- if ( elem && !rnoAttrNodeType.test( elem.nodeType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
+ if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
return jQuery( elem )[ name ]( value );
}
}
@@ -96,25 +102,71 @@
migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
}
+ // Restore boolHook for boolean property/attribute synchronization
+ if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
+ jQuery.attrHooks[ lowerName ] = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode,
+ property = jQuery.prop( elem, name );
+ return property === true || typeof property !== "boolean" &&
+ ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
+
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+ };
+
+ // Warn only for attributes that can remain distinct from their properties post-1.9
+ if ( ruseDefault.test( lowerName ) ) {
+ migrateWarn( "jQuery.fn.attr(" + lowerName + ") may use property instead of attribute" );
+ }
+ }
+
return attr.call( jQuery, elem, name, value );
};
// attrHooks: value
jQuery.attrHooks.value = {
get: function( elem, name ) {
- if ( jQuery.nodeName( elem, "button" ) ) {
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
+ if ( nodeName === "button" ) {
return valueAttrGet.apply( this, arguments );
}
- migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
+ if ( nodeName !== "input" && nodeName !== "option" ) {
+ migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
+ }
return name in elem ?
elem.value :
null;
},
- set: function( elem, value, name ) {
- if ( jQuery.nodeName( elem, "button" ) ) {
+ set: function( elem, value ) {
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
+ if ( nodeName === "button" ) {
return valueAttrSet.apply( this, arguments );
}
- migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
+ if ( nodeName !== "input" && nodeName !== "option" ) {
+ migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
+ }
// Does not return so that setAttribute is also used
elem.value = value;
}
@@ -122,10 +174,9 @@
var matched, browser,
- oldAccess = jQuery.access,
oldInit = jQuery.fn.init,
// Note this does NOT include the # XSS fix from 1.7!
- rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
+ rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;
// $(html) "looks like html" rule change
jQuery.fn.init = function( selector, context, rootjQuery ) {
@@ -151,27 +202,6 @@
};
jQuery.fn.init.prototype = jQuery.fn;
-if ( jQuery.fn.jquery >= "1.9" ) {
- // jQuery.access( ..., pass )
- jQuery.access = function( elems, fn, key, value, chainable, emptyGet, pass ) {
- var i = 0,
- length = elems.length;
-
- if ( key && typeof key === "object" && value ) {
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], true, emptyGet, value );
- }
- return elems;
- } else if ( pass && key != null && value !== undefined ) {
- for ( ; i < length; i++ ) {
- fn( elems[i], key, value, true );
- }
- return elems;
- }
- return oldAccess.call( jQuery, elems, fn, key, value, chainable, emptyGet );
- };
-}
-
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
@@ -250,34 +280,29 @@
};
-var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
- oldFragment = jQuery.buildFragment;
+var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
jQuery.fn.andSelf = function() {
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
return oldSelf.apply( this, arguments );
};
-jQuery.buildFragment = function( args, context, scripts ) {
- var fragment;
+// Since jQuery.clean is used internally on older versions, we only shim if it's missing
+if ( !jQuery.clean ) {
+ jQuery.clean = function( elems, context, fragment, scripts, selection ) {
+ var newFragment = jQuery.buildFragment( elems, context || document, scripts, selection );
- if ( !oldFragment ) {
- // Set context from what may come in as undefined or a jQuery collection or a node
- // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
- // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
- context = context || document;
- context = !context.nodeType && context[0] || context;
- context = context.ownerDocument || context;
+ migrateWarn("jQuery.clean() is deprecated");
+ if ( fragment ) {
+ fragment.appendChild( newFragment );
- fragment = context.createDocumentFragment();
- jQuery.clean( args, context, fragment, scripts );
+ } else {
+ fragment = newFragment;
+ }
- migrateWarn("jQuery.buildFragment() is deprecated");
- return { fragment: fragment, cacheable: false };
- }
- // Don't warn if we are in a version where buildFragment is used internally
- return oldFragment.apply( this, arguments );
-};
+ return jQuery.merge( [], fragment.childNodes );
+ };
+}
var eventAdd = jQuery.event.add,
eventRemove = jQuery.event.remove,
@@ -314,7 +339,7 @@
eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
};
-jQuery.fn.error = function( data, fn ) {
+jQuery.fn.error = function() {
var args = Array.prototype.slice.call( arguments, 0);
migrateWarn("jQuery.fn.error() is deprecated");
args.splice( 0, 0, "error" );
@@ -387,25 +412,25 @@
jQuery.each( ajaxEvents.split("|"),
function( _, name ) {
jQuery.event.special[ name ] = {
- setup: function( data ) {
+ setup: function() {
var elem = this;
// The document needs no shimming; must be !== for oldIE
if ( elem !== document ) {
- jQuery.event.add( document, name + "." + jQuery.guid, function( event ) {
+ jQuery.event.add( document, name + "." + jQuery.guid, function() {
jQuery.event.trigger( name, null, elem, true );
});
jQuery._data( this, name, jQuery.guid++ );
}
return false;
},
- teardown: function( data, handleObj ) {
+ teardown: function() {
if ( this !== document ) {
jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
}
return false;
}
- }
+ };
}
);