From 9f3bec98c30695f4753ebdf0319c829ed2879d45 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 5 May 2017 16:31:25 -0700 Subject: [PATCH] jquery.ui: Avoid deprecated jQuery.expr[":"] Compatible with jQuery 1.11 and 3.x, as jQuery.expr.pseudos was introduced in jQuery 1.8. Note that this is not blocking jQuery 3 (T124742) since it is covered by jQuery Migrate. But fixing this makes the edit page less noisy by default. Change-Id: I7ffbfd2e55aa7dcc31860eb0117b203e63ca7283 --- resources/lib/jquery.ui/PATCHES | 8 ++++++++ resources/lib/jquery.ui/jquery.ui.core.js | 2 +- resources/lib/jquery.ui/jquery.ui.widget.js | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/lib/jquery.ui/PATCHES b/resources/lib/jquery.ui/PATCHES index a8eba943cd..bcff2ac3b1 100644 --- a/resources/lib/jquery.ui/PATCHES +++ b/resources/lib/jquery.ui/PATCHES @@ -1,3 +1,7 @@ +jquery.ui.core.js +* I7ffbfd2e5 Avoid deprecated jQuery.expr[":"]. + + jquery.ui.draggable.js * 71e11de2a3 Fix positioning error with draggable, revert and grid. https://phabricator.wikimedia.org/T140965#2944610 @@ -9,6 +13,10 @@ jquery.ui.datepicker * 19531f3c23 Add translations in de-AT and de-CH +jquery.ui.widget.js +* I7ffbfd2e5 Avoid deprecated jQuery.expr[":"]. + + themes/smoothness/jquery.ui.theme.css * 5e772e39dd Remove dark color from links inside dialogs https://phabricator.wikimedia.org/T85857 diff --git a/resources/lib/jquery.ui/jquery.ui.core.js b/resources/lib/jquery.ui/jquery.ui.core.js index 4ef4b7610b..19f0069e25 100644 --- a/resources/lib/jquery.ui/jquery.ui.core.js +++ b/resources/lib/jquery.ui/jquery.ui.core.js @@ -157,7 +157,7 @@ function visible( element ) { }).length; } -$.extend( $.expr[ ":" ], { +$.extend( $.expr.pseudos, { data: $.expr.createPseudo ? $.expr.createPseudo(function( dataName ) { return function( elem ) { diff --git a/resources/lib/jquery.ui/jquery.ui.widget.js b/resources/lib/jquery.ui/jquery.ui.widget.js index 067476d979..4d84afcf39 100644 --- a/resources/lib/jquery.ui/jquery.ui.widget.js +++ b/resources/lib/jquery.ui/jquery.ui.widget.js @@ -36,7 +36,7 @@ $.widget = function( name, base, prototype ) { } // create selector for plugin - $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { + $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) { return !!$.data( elem, fullName ); }; -- 2.20.1