From 88b8e29f0db8935e2f4500c4ba64a42c96d012d3 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 15 Feb 2013 16:09:04 +0000 Subject: [PATCH] jQuery 1.9.1 and jQuery Migrate 1.1.0. Remains uncompressed for now, until we work out all 1.9.x issues. Fixes custom fields. props ocean90, wonderboymusic. see #22975. git-svn-id: https://develop.svn.wordpress.org/trunk@23421 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/jquery/jquery-migrate.js | 86 +++-- wp-includes/js/jquery/jquery.js | 424 +++++++++++++----------- wp-includes/script-loader.php | 4 +- 3 files changed, 277 insertions(+), 237 deletions(-) diff --git a/wp-includes/js/jquery/jquery-migrate.js b/wp-includes/js/jquery/jquery-migrate.js index 27111d80f9..3185ed1f34 100644 --- a/wp-includes/js/jquery/jquery-migrate.js +++ b/wp-includes/js/jquery/jquery-migrate.js @@ -1,5 +1,5 @@ /*! - * jQuery Migrate - v1.0.0 - 2013-01-14 + * jQuery Migrate - v1.1.0 - 2013-01-31 * https://github.com/jquery/jquery-migrate * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT */ @@ -15,6 +15,16 @@ jQuery.migrateWarnings = []; // Set to true to prevent console output; migrateWarnings still maintained // jQuery.migrateMute = false; +// Show a message on the console so devs know we're active +if ( !jQuery.migrateMute && window.console && console.log ) { + console.log("JQMIGRATE: Logging is active"); +} + +// Set to false to disable traces that appear with warnings +if ( jQuery.migrateTrace === undefined ) { + jQuery.migrateTrace = true; +} + // Forget any warnings we've already given; public jQuery.migrateReset = function() { warnedAbout = {}; @@ -27,6 +37,9 @@ function migrateWarn( msg) { jQuery.migrateWarnings.push( msg ); if ( window.console && console.warn && !jQuery.migrateMute ) { console.warn( "JQMIGRATE: " + msg ); + if ( jQuery.migrateTrace && console.trace ) { + console.trace(); + } } } } @@ -66,7 +79,7 @@ if ( document.compatMode === "BackCompat" ) { var attrFn = {}, - attr = jQuery.attr, + oldAttr = jQuery.attr, valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || function() { return null; }, valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || @@ -83,15 +96,18 @@ jQuery.attr = function( elem, name, value, pass ) { var lowerName = name.toLowerCase(), nType = elem && elem.nodeType; - if ( pass ) { + // Since pass is used internally, we only warn and shim for new jQuery + // versions where there isn't a pass arg in the formal params + if ( pass && oldAttr.length < 4 ) { migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) { return jQuery( elem )[ name ]( value ); } } - // Warn if user tries to set `type` since it breaks on IE 6/7/8 - if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) ) { + // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking + // for disconnected elements we don't warn on $( "