mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 06:29:30 +00:00
External Libraries: Update jQuery to 1.12.0 and jQuery Migrate to 1.3.0.
jQuery: * Release post: http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/ * Changes: https://github.com/jquery/jquery/compare/1.11.3...1.12.0 jQuery Migrate: * Release post: http://blog.jquery.com/2016/01/13/jquery-migrate-1-3-0-released/ * Changes: https://github.com/jquery/jquery-migrate/compare/1.2.1...1.3.0 See #35380. Built from https://develop.svn.wordpress.org/trunk@36285 git-svn-id: http://core.svn.wordpress.org/trunk@36252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b8f2a138e7
commit
b1a9983584
249
wp-includes/js/jquery/jquery-migrate.js
vendored
249
wp-includes/js/jquery/jquery-migrate.js
vendored
@ -1,13 +1,15 @@
|
||||
/*!
|
||||
* jQuery Migrate - v1.2.1 - 2013-05-08
|
||||
* https://github.com/jquery/jquery-migrate
|
||||
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
|
||||
* jQuery Migrate - v1.3.0 - 2016-01-13
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
// See http://bugs.jquery.com/ticket/13335
|
||||
// "use strict";
|
||||
|
||||
|
||||
jQuery.migrateVersion = "1.3.0";
|
||||
|
||||
|
||||
var warnedAbout = {};
|
||||
|
||||
// List of warnings already given; public read only
|
||||
@ -152,7 +154,7 @@ jQuery.attr = function( elem, name, value, pass ) {
|
||||
|
||||
// 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" );
|
||||
migrateWarn( "jQuery.fn.attr('" + lowerName + "') might use property instead of attribute" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,22 +192,24 @@ jQuery.attrHooks.value = {
|
||||
var matched, browser,
|
||||
oldInit = jQuery.fn.init,
|
||||
oldParseJSON = jQuery.parseJSON,
|
||||
rspaceAngle = /^\s*</,
|
||||
// Note: XSS check is done below after string is trimmed
|
||||
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
|
||||
|
||||
// $(html) "looks like html" rule change
|
||||
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
var match;
|
||||
var match, ret;
|
||||
|
||||
if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( selector.charAt( 0 ) !== "<" ) {
|
||||
if ( !rspaceAngle.test( selector ) ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
|
||||
// Consistently reject any HTML-like string starting with a hash (#9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
@ -218,17 +222,40 @@ jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
context = context.context;
|
||||
}
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),
|
||||
context, rootjQuery );
|
||||
return oldInit.call( this,
|
||||
jQuery.parseHTML( match[ 2 ], context && context.ownerDocument ||
|
||||
context || document, true ), context, rootjQuery );
|
||||
}
|
||||
}
|
||||
return oldInit.apply( this, arguments );
|
||||
|
||||
// jQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
|
||||
if ( selector === "#" ) {
|
||||
migrateWarn( "jQuery( '#' ) is not a valid selector" );
|
||||
selector = [];
|
||||
}
|
||||
|
||||
ret = oldInit.apply( this, arguments );
|
||||
|
||||
// Fill in selector and context properties so .live() works
|
||||
if ( selector && selector.selector !== undefined ) {
|
||||
// A jQuery object, copy its properties
|
||||
ret.selector = selector.selector;
|
||||
ret.context = selector.context;
|
||||
|
||||
} else {
|
||||
ret.selector = typeof selector === "string" ? selector : "";
|
||||
if ( selector ) {
|
||||
ret.context = selector.nodeType? selector : context || document;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json && json !== null ) {
|
||||
if ( !json ) {
|
||||
migrateWarn("jQuery.parseJSON requires a valid JSON string");
|
||||
return null;
|
||||
}
|
||||
@ -274,6 +301,11 @@ if ( !jQuery.browser ) {
|
||||
// Warn if the code tries to get jQuery.browser
|
||||
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
|
||||
|
||||
// jQuery.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7
|
||||
jQuery.boxModel = jQuery.support.boxModel = (document.compatMode === "CSS1Compat");
|
||||
migrateWarnProp( jQuery, "boxModel", jQuery.boxModel, "jQuery.boxModel is deprecated" );
|
||||
migrateWarnProp( jQuery.support, "boxModel", jQuery.support.boxModel, "jQuery.support.boxModel is deprecated" );
|
||||
|
||||
jQuery.sub = function() {
|
||||
function jQuerySub( selector, context ) {
|
||||
return new jQuerySub.fn.init( selector, context );
|
||||
@ -284,11 +316,10 @@ jQuery.sub = function() {
|
||||
jQuerySub.fn.constructor = jQuerySub;
|
||||
jQuerySub.sub = this.sub;
|
||||
jQuerySub.fn.init = function init( selector, context ) {
|
||||
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
||||
context = jQuerySub( context );
|
||||
}
|
||||
|
||||
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
||||
var instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
||||
return instance instanceof jQuerySub ?
|
||||
instance :
|
||||
jQuerySub( instance );
|
||||
};
|
||||
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
||||
var rootjQuerySub = jQuerySub(document);
|
||||
@ -296,6 +327,57 @@ jQuery.sub = function() {
|
||||
return jQuerySub;
|
||||
};
|
||||
|
||||
// The number of elements contained in the matched element set
|
||||
jQuery.fn.size = function() {
|
||||
migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
|
||||
return this.length;
|
||||
};
|
||||
|
||||
|
||||
var internalSwapCall = false;
|
||||
|
||||
// If this version of jQuery has .swap(), don't false-alarm on internal uses
|
||||
if ( jQuery.swap ) {
|
||||
jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
|
||||
var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
|
||||
|
||||
if ( oldHook ) {
|
||||
jQuery.cssHooks[ name ].get = function() {
|
||||
var ret;
|
||||
|
||||
internalSwapCall = true;
|
||||
ret = oldHook.apply( this, arguments );
|
||||
internalSwapCall = false;
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery.swap = function( elem, options, callback, args ) {
|
||||
var ret, name,
|
||||
old = {};
|
||||
|
||||
if ( !internalSwapCall ) {
|
||||
migrateWarn( "jQuery.swap() is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Remember the old values, and insert the new ones
|
||||
for ( name in options ) {
|
||||
old[ name ] = elem.style[ name ];
|
||||
elem.style[ name ] = options[ name ];
|
||||
}
|
||||
|
||||
ret = callback.apply( elem, args || [] );
|
||||
|
||||
// Revert the old values
|
||||
for ( name in options ) {
|
||||
elem.style[ name ] = old[ name ];
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
// Ensure that $.ajax gets the new parseJSON defined in core.js
|
||||
jQuery.ajaxSetup({
|
||||
@ -324,13 +406,7 @@ jQuery.fn.data = function( name ) {
|
||||
};
|
||||
|
||||
|
||||
var rscriptType = /\/(java|ecma)script/i,
|
||||
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 );
|
||||
};
|
||||
var rscriptType = /\/(java|ecma)script/i;
|
||||
|
||||
// Since jQuery.clean is used internally on older versions, we only shim if it's missing
|
||||
if ( !jQuery.clean ) {
|
||||
@ -388,6 +464,7 @@ var eventAdd = jQuery.event.add,
|
||||
oldToggle = jQuery.fn.toggle,
|
||||
oldLive = jQuery.fn.live,
|
||||
oldDie = jQuery.fn.die,
|
||||
oldLoad = jQuery.fn.load,
|
||||
ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
|
||||
rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
|
||||
rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
|
||||
@ -422,17 +499,34 @@ jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
|
||||
eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
|
||||
};
|
||||
|
||||
jQuery.fn.error = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0);
|
||||
migrateWarn("jQuery.fn.error() is deprecated");
|
||||
args.splice( 0, 0, "error" );
|
||||
if ( arguments.length ) {
|
||||
return this.bind.apply( this, args );
|
||||
}
|
||||
// error event should not bubble to window, although it does pre-1.7
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
|
||||
|
||||
jQuery.fn[ name ] = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0 );
|
||||
migrateWarn( "jQuery.fn." + name + "() is deprecated" );
|
||||
|
||||
// If this is an ajax load() the first arg should be the string URL;
|
||||
// technically this could also be the "Anything" arg of the event .load()
|
||||
// which just goes to show why this dumb signature has been deprecated!
|
||||
// jQuery custom builds that exclude the Ajax module justifiably die here.
|
||||
if ( name === "load" && typeof arguments[ 0 ] === "string" ) {
|
||||
return oldLoad.apply( this, arguments );
|
||||
}
|
||||
|
||||
args.splice( 0, 0, name );
|
||||
if ( arguments.length ) {
|
||||
return this.bind.apply( this, args );
|
||||
}
|
||||
|
||||
// Use .triggerHandler here because:
|
||||
// - load and unload events don't need to bubble, only applied to window or image
|
||||
// - error event should not bubble to window, although it does pre-1.7
|
||||
// See http://bugs.jquery.com/ticket/11820
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
jQuery.fn.toggle = function( fn, fn2 ) {
|
||||
|
||||
@ -501,7 +595,7 @@ jQuery.each( ajaxEvents.split("|"),
|
||||
// The document needs no shimming; must be !== for oldIE
|
||||
if ( elem !== document ) {
|
||||
jQuery.event.add( document, name + "." + jQuery.guid, function() {
|
||||
jQuery.event.trigger( name, null, elem, true );
|
||||
jQuery.event.trigger( name, Array.prototype.slice.call( arguments, 1 ), elem, true );
|
||||
});
|
||||
jQuery._data( this, name, jQuery.guid++ );
|
||||
}
|
||||
@ -517,5 +611,92 @@ jQuery.each( ajaxEvents.split("|"),
|
||||
}
|
||||
);
|
||||
|
||||
jQuery.event.special.ready = {
|
||||
setup: function() { migrateWarn( "'ready' event is deprecated" ); }
|
||||
};
|
||||
|
||||
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
|
||||
oldFind = jQuery.fn.find;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.fn.find = function( selector ) {
|
||||
var ret = oldFind.apply( this, arguments );
|
||||
ret.context = this.context;
|
||||
ret.selector = this.selector ? this.selector + " " + selector : selector;
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
// jQuery 1.6 did not support Callbacks, do not warn there
|
||||
if ( jQuery.Callbacks ) {
|
||||
|
||||
var oldDeferred = jQuery.Deferred,
|
||||
tuples = [
|
||||
// action, add listener, callbacks, .then handlers, final state
|
||||
[ "resolve", "done", jQuery.Callbacks("once memory"),
|
||||
jQuery.Callbacks("once memory"), "resolved" ],
|
||||
[ "reject", "fail", jQuery.Callbacks("once memory"),
|
||||
jQuery.Callbacks("once memory"), "rejected" ],
|
||||
[ "notify", "progress", jQuery.Callbacks("memory"),
|
||||
jQuery.Callbacks("memory") ]
|
||||
];
|
||||
|
||||
jQuery.Deferred = function( func ) {
|
||||
var deferred = oldDeferred(),
|
||||
promise = deferred.promise();
|
||||
|
||||
deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
|
||||
var fns = arguments;
|
||||
|
||||
migrateWarn( "deferred.pipe() is deprecated" );
|
||||
|
||||
return jQuery.Deferred(function( newDefer ) {
|
||||
jQuery.each( tuples, function( i, tuple ) {
|
||||
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
|
||||
// deferred.done(function() { bind to newDefer or newDefer.resolve })
|
||||
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
||||
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
||||
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[ tuple[ 0 ] + "With" ](
|
||||
this === promise ? newDefer.promise() : this,
|
||||
fn ? [ returned ] : arguments
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
fns = null;
|
||||
}).promise();
|
||||
|
||||
};
|
||||
|
||||
deferred.isResolved = function() {
|
||||
migrateWarn( "deferred.isResolved is deprecated" );
|
||||
return deferred.state() === "resolved";
|
||||
};
|
||||
|
||||
deferred.isRejected = function() {
|
||||
migrateWarn( "deferred.isRejected is deprecated" );
|
||||
return deferred.state() === "rejected";
|
||||
};
|
||||
|
||||
if ( func ) {
|
||||
func.call( deferred, deferred );
|
||||
}
|
||||
|
||||
return deferred;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
})( jQuery, window );
|
||||
|
4
wp-includes/js/jquery/jquery-migrate.min.js
vendored
4
wp-includes/js/jquery/jquery-migrate.min.js
vendored
File diff suppressed because one or more lines are too long
12
wp-includes/js/jquery/jquery.js
vendored
12
wp-includes/js/jquery/jquery.js
vendored
File diff suppressed because one or more lines are too long
@ -184,9 +184,9 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop') );
|
||||
|
||||
// jQuery
|
||||
$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.11.3' );
|
||||
$scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.11.3' );
|
||||
$scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.2.1' );
|
||||
$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.0' );
|
||||
$scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.12.0' );
|
||||
$scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.3.0' );
|
||||
|
||||
// full jQuery UI
|
||||
$scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.4', 1 );
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5-alpha-36284';
|
||||
$wp_version = '4.5-alpha-36285';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user