Permalink
Browse files

Bump jQuery to v2.2.2

  • Loading branch information...
kabel committed Mar 23, 2016
1 parent 1bf3c9f commit b288b4589a310f30a0a363e230b15cee863aa847
Showing with 60 additions and 49 deletions.
  1. +60 −49 wdn/templates_4.1/scripts/jquery.js
@@ -1,5 +1,5 @@
/*! /*!
* jQuery JavaScript Library v2.2.0 * jQuery JavaScript Library v2.2.2
* http://jquery.com/ * http://jquery.com/
* *
* Includes Sizzle.js * Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license * Released under the MIT license
* http://jquery.org/license * http://jquery.org/license
* *
* Date: 2016-01-08T20:02Z * Date: 2016-03-17T17:51Z
*/ */
(function( global, factory ) { (function( global, factory ) {
@@ -65,7 +65,7 @@ var support = {};
var var
version = "2.2.0", version = "2.2.2",
// Define a local copy of jQuery // Define a local copy of jQuery
jQuery = function( selector, context ) { jQuery = function( selector, context ) {
@@ -276,6 +276,7 @@ jQuery.extend( {
}, },
isPlainObject: function( obj ) { isPlainObject: function( obj ) {
var key;
// Not plain objects: // Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]" // - Any object or value whose internal [[Class]] property is not "[object Object]"
@@ -285,14 +286,18 @@ jQuery.extend( {
return false; return false;
} }
// Not own constructor property must be Object
if ( obj.constructor && if ( obj.constructor &&
!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { !hasOwn.call( obj, "constructor" ) &&
!hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) {
return false; return false;
} }
// If the function hasn't returned already, we're confident that // Own properties are enumerated firstly, so to speed up,
// |obj| is a plain object, created by {} or constructed with new Object // if last one is own, then all properties are own
return true; for ( key in obj ) {}
return key === undefined || hasOwn.call( obj, key );
}, },
isEmptyObject: function( obj ) { isEmptyObject: function( obj ) {
@@ -4479,7 +4484,7 @@ function on( elem, types, selector, data, fn, one ) {
if ( fn === false ) { if ( fn === false ) {
fn = returnFalse; fn = returnFalse;
} else if ( !fn ) { } else if ( !fn ) {
return this; return elem;
} }
if ( one === 1 ) { if ( one === 1 ) {
@@ -5128,14 +5133,14 @@ var
rscriptTypeMasked = /^true\/(.*)/, rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
// Manipulating tables requires a tbody
function manipulationTarget( elem, content ) { function manipulationTarget( elem, content ) {
if ( jQuery.nodeName( elem, "table" ) && return jQuery.nodeName( elem, "table" ) &&
jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
}
return elem; elem.getElementsByTagName( "tbody" )[ 0 ] ||
elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
elem;
} }
// Replace/restore the type attribute of script elements for safe DOM manipulation // Replace/restore the type attribute of script elements for safe DOM manipulation
@@ -5642,7 +5647,7 @@ var getStyles = function( elem ) {
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle" // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
var view = elem.ownerDocument.defaultView; var view = elem.ownerDocument.defaultView;
if ( !view.opener ) { if ( !view || !view.opener ) {
view = window; view = window;
} }
@@ -5791,15 +5796,18 @@ function curCSS( elem, name, computed ) {
style = elem.style; style = elem.style;
computed = computed || getStyles( elem ); computed = computed || getStyles( elem );
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
// Support: Opera 12.1x only
// Fall back to style even without computed
// computed is undefined for elems on document fragments
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// Support: IE9 // Support: IE9
// getPropertyValue is only needed for .css('filter') (#12537) // getPropertyValue is only needed for .css('filter') (#12537)
if ( computed ) { if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// A tribute to the "awesome hack by Dean Edwards" // A tribute to the "awesome hack by Dean Edwards"
// Android Browser returns percentage for some values, // Android Browser returns percentage for some values,
@@ -7322,6 +7330,12 @@ jQuery.extend( {
} }
} ); } );
// Support: IE <=11 only
// Accessing the selectedIndex property
// forces the browser to respect setting selected
// on the option
// The getter ensures a default option is selected
// when in an optgroup
if ( !support.optSelected ) { if ( !support.optSelected ) {
jQuery.propHooks.selected = { jQuery.propHooks.selected = {
get: function( elem ) { get: function( elem ) {
@@ -7330,6 +7344,16 @@ if ( !support.optSelected ) {
parent.parentNode.selectedIndex; parent.parentNode.selectedIndex;
} }
return null; return null;
},
set: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
} }
}; };
} }
@@ -7524,7 +7548,8 @@ jQuery.fn.extend( {
var rreturn = /\r/g; var rreturn = /\r/g,
rspaces = /[\x20\t\r\n\f]+/g;
jQuery.fn.extend( { jQuery.fn.extend( {
val: function( value ) { val: function( value ) {
@@ -7600,9 +7625,15 @@ jQuery.extend( {
option: { option: {
get: function( elem ) { get: function( elem ) {
// Support: IE<11 var val = jQuery.find.attr( elem, "value" );
// option.value not trimmed (#14858) return val != null ?
return jQuery.trim( elem.value ); val :
// Support: IE10-11+
// option.text throws exceptions (#14686, #14858)
// Strip and collapse whitespace
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
} }
}, },
select: { select: {
@@ -7655,7 +7686,7 @@ jQuery.extend( {
while ( i-- ) { while ( i-- ) {
option = options[ i ]; option = options[ i ];
if ( option.selected = if ( option.selected =
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
) { ) {
optionSet = true; optionSet = true;
} }
@@ -7849,7 +7880,7 @@ jQuery.extend( jQuery.event, {
// But now, this "simulate" function is used only for events // But now, this "simulate" function is used only for events
// for which stopPropagation() is noop, so there is no need for that anymore. // for which stopPropagation() is noop, so there is no need for that anymore.
// //
// For the compat branch though, guard for "click" and "submit" // For the 1.x branch though, guard for "click" and "submit"
// events is still used, but was moved to jQuery.event.stopPropagation function // events is still used, but was moved to jQuery.event.stopPropagation function
// because `originalEvent` should point to the original event for the constancy // because `originalEvent` should point to the original event for the constancy
// with other events and for more focused logic // with other events and for more focused logic
@@ -9350,18 +9381,6 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
// Support: Safari 8+
// In Safari 8 documents created via document.implementation.createHTMLDocument
// collapse sibling forms: the second one becomes a child of the first one.
// Because of that, this security measure has to be disabled in Safari 8.
// https://bugs.webkit.org/show_bug.cgi?id=137337
support.createHTMLDocument = ( function() {
var body = document.implementation.createHTMLDocument( "" ).body;
body.innerHTML = "<form></form><form></form>";
return body.childNodes.length === 2;
} )();
// Argument "data" should be string of html // Argument "data" should be string of html
// context (optional): If specified, the fragment will be created in this context, // context (optional): If specified, the fragment will be created in this context,
// defaults to document // defaults to document
@@ -9374,12 +9393,7 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
keepScripts = context; keepScripts = context;
context = false; context = false;
} }
context = context || document;
// Stop scripts or inline event handlers from being executed immediately
// by using document.implementation
context = context || ( support.createHTMLDocument ?
document.implementation.createHTMLDocument( "" ) :
document );
var parsed = rsingleTag.exec( data ), var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && []; scripts = !keepScripts && [];
@@ -9619,11 +9633,8 @@ jQuery.fn.extend( {
} }
// Add offsetParent borders // Add offsetParent borders
// Subtract offsetParent scroll positions parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ) - parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
offsetParent.scrollTop();
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) -
offsetParent.scrollLeft();
} }
// Subtract parent offsets and element margins // Subtract parent offsets and element margins

0 comments on commit b288b45

Please sign in to comment.