aboutsummaryrefslogtreecommitdiffstats
path: root/resources/lib
diff options
context:
space:
mode:
authorAmir Sarabadani <Ladsgroup@gmail.com>2021-07-14 18:57:48 +0200
committerAmir Sarabadani <Ladsgroup@gmail.com>2021-07-14 20:17:38 +0200
commit39be905fd49c6b1315cba9fa28f7479cd23ddd8c (patch)
tree3bd8d0e6e0f47da4cf355ad6e50a1e48af203b36 /resources/lib
parentc97e526d87c78c3196c2ac9e0a60040805bfd275 (diff)
downloadmediawikicore-39be905fd49c6b1315cba9fa28f7479cd23ddd8c.tar.gz
mediawikicore-39be905fd49c6b1315cba9fa28f7479cd23ddd8c.zip
Fix most of jquery.ui deprecations
The second round of checking it against WikibaseRepo's UI. This time doing edits and such. Bug: T280944 Change-Id: Ie2e3e06dcb741bb0c6af106200cf6b5165ff69c9
Diffstat (limited to 'resources/lib')
-rw-r--r--resources/lib/jquery.ui/PATCHES2
-rw-r--r--resources/lib/jquery.ui/jquery.ui.draggable.js2
-rw-r--r--resources/lib/jquery.ui/jquery.ui.droppable.js2
-rw-r--r--resources/lib/jquery.ui/jquery.ui.effect.js2
-rw-r--r--resources/lib/jquery.ui/jquery.ui.menu.js6
-rw-r--r--resources/lib/jquery.ui/jquery.ui.selectable.js2
-rw-r--r--resources/lib/jquery.ui/jquery.ui.slider.js2
-rw-r--r--resources/lib/jquery.ui/jquery.ui.sortable.js2
-rw-r--r--resources/lib/jquery.ui/jquery.ui.tabs.js4
-rw-r--r--resources/lib/jquery.ui/jquery.ui.tooltip.js4
-rw-r--r--resources/lib/jquery.ui/jquery.ui.widget.js10
11 files changed, 18 insertions, 20 deletions
diff --git a/resources/lib/jquery.ui/PATCHES b/resources/lib/jquery.ui/PATCHES
index c2915b4d217a..26ba42e21cf4 100644
--- a/resources/lib/jquery.ui/PATCHES
+++ b/resources/lib/jquery.ui/PATCHES
@@ -1,5 +1,5 @@
General:
-* Icb54f847 Fixing multiple jQuery deprecations.
+* Icb54f847 and Ie2e3e06d Fixing multiple jQuery deprecations.
jquery.ui.position.js
* I047a92b45 Avoid deprecated jQuery.offset() on invalid DOM element.
diff --git a/resources/lib/jquery.ui/jquery.ui.draggable.js b/resources/lib/jquery.ui/jquery.ui.draggable.js
index 6f14c9ab3e8b..413b831398b9 100644
--- a/resources/lib/jquery.ui/jquery.ui.draggable.js
+++ b/resources/lib/jquery.ui/jquery.ui.draggable.js
@@ -261,7 +261,7 @@ $.widget("ui.draggable", $.ui.mouse, {
var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
$(this.options.handle, this.element)
.find("*")
- .andSelf()
+ .addBack()
.each(function() {
if(this == event.target) handle = true;
});
diff --git a/resources/lib/jquery.ui/jquery.ui.droppable.js b/resources/lib/jquery.ui/jquery.ui.droppable.js
index d3f7f4007839..fe1696a1ab81 100644
--- a/resources/lib/jquery.ui/jquery.ui.droppable.js
+++ b/resources/lib/jquery.ui/jquery.ui.droppable.js
@@ -197,7 +197,7 @@ $.ui.ddmanager = {
var m = $.ui.ddmanager.droppables[t.options.scope] || [];
var type = event ? event.type : null; // workaround for #2317
- var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+ var list = (t.currentItem || t.element).find(":data(droppable)").addBack();
droppablesLoop: for (var i = 0; i < m.length; i++) {
diff --git a/resources/lib/jquery.ui/jquery.ui.effect.js b/resources/lib/jquery.ui/jquery.ui.effect.js
index 14adbe91323a..f61ed2e606ad 100644
--- a/resources/lib/jquery.ui/jquery.ui.effect.js
+++ b/resources/lib/jquery.ui/jquery.ui.effect.js
@@ -756,7 +756,7 @@ $.effects.animateClass = function( value, duration, easing, callback ) {
var animated = $( this ),
baseClass = animated.attr( "class" ) || "",
applyClassChange,
- allAnimations = o.children ? animated.find( "*" ).andSelf() : animated;
+ allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
// map the animated objects to store the original styles.
allAnimations = allAnimations.map(function() {
diff --git a/resources/lib/jquery.ui/jquery.ui.menu.js b/resources/lib/jquery.ui/jquery.ui.menu.js
index 6342f2d3b7d3..1117994b963a 100644
--- a/resources/lib/jquery.ui/jquery.ui.menu.js
+++ b/resources/lib/jquery.ui/jquery.ui.menu.js
@@ -48,9 +48,7 @@ $.widget( "ui.menu", {
role: this.options.role,
tabIndex: 0
})
- // need to catch all clicks on disabled menu
- // not possible through _on
- .bind( "click" + this.eventNamespace, $.proxy(function( event ) {
+ .on( "click" + this.eventNamespace, $.proxy(function( event ) {
if ( this.options.disabled ) {
event.preventDefault();
}
@@ -139,7 +137,7 @@ $.widget( "ui.menu", {
// Destroy (sub)menus
this.element
.removeAttr( "aria-activedescendant" )
- .find( ".ui-menu" ).andSelf()
+ .find( ".ui-menu" ).addBack()
.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
.removeAttr( "role" )
.removeAttr( "tabIndex" )
diff --git a/resources/lib/jquery.ui/jquery.ui.selectable.js b/resources/lib/jquery.ui/jquery.ui.selectable.js
index 3f27b7320b0f..51e686660b60 100644
--- a/resources/lib/jquery.ui/jquery.ui.selectable.js
+++ b/resources/lib/jquery.ui/jquery.ui.selectable.js
@@ -113,7 +113,7 @@ $.widget("ui.selectable", $.ui.mouse, {
}
});
- $(event.target).parents().andSelf().each(function() {
+ $(event.target).parents().addBack().each(function() {
var selectee = $.data(this, "selectable-item");
if (selectee) {
var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
diff --git a/resources/lib/jquery.ui/jquery.ui.slider.js b/resources/lib/jquery.ui/jquery.ui.slider.js
index 0108e7056fe6..45483bca4b93 100644
--- a/resources/lib/jquery.ui/jquery.ui.slider.js
+++ b/resources/lib/jquery.ui/jquery.ui.slider.js
@@ -261,7 +261,7 @@ $.widget( "ui.slider", $.ui.mouse, {
.focus();
offset = closestHandle.offset();
- mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
+ mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
top: event.pageY - offset.top -
diff --git a/resources/lib/jquery.ui/jquery.ui.sortable.js b/resources/lib/jquery.ui/jquery.ui.sortable.js
index ff16b7df7607..f31d3b651c66 100644
--- a/resources/lib/jquery.ui/jquery.ui.sortable.js
+++ b/resources/lib/jquery.ui/jquery.ui.sortable.js
@@ -113,7 +113,7 @@ $.widget("ui.sortable", $.ui.mouse, {
if(this.options.handle && !overrideHandle) {
var validHandle = false;
- $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
+ $(this.options.handle, currentItem).find("*").addBack().each(function() { if(this == event.target) validHandle = true; });
if(!validHandle) return false;
}
diff --git a/resources/lib/jquery.ui/jquery.ui.tabs.js b/resources/lib/jquery.ui/jquery.ui.tabs.js
index 10ae17b01cb8..e7f9478cb2a6 100644
--- a/resources/lib/jquery.ui/jquery.ui.tabs.js
+++ b/resources/lib/jquery.ui/jquery.ui.tabs.js
@@ -61,7 +61,7 @@ $.widget( "ui.tabs", {
.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
.toggleClass( "ui-tabs-collapsible", options.collapsible )
// Prevent users from focusing disabled tabs via click
- .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) {
+ .on( "mousedown" + this.eventNamespace, ".ui-tabs-nav > li", function( event ) {
if ( $( this ).is( ".ui-state-disabled" ) ) {
event.preventDefault();
}
@@ -72,7 +72,7 @@ $.widget( "ui.tabs", {
// We don't have to worry about focusing the previously focused
// element since clicking on a non-focusable element should focus
// the body anyway.
- .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
+ .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
this.blur();
}
diff --git a/resources/lib/jquery.ui/jquery.ui.tooltip.js b/resources/lib/jquery.ui/jquery.ui.tooltip.js
index 782f8ff5a2f2..1549614f85ca 100644
--- a/resources/lib/jquery.ui/jquery.ui.tooltip.js
+++ b/resources/lib/jquery.ui/jquery.ui.tooltip.js
@@ -111,7 +111,7 @@ $.widget( "ui.tooltip", {
});
// remove title attributes to prevent native tooltips
- this.element.find( this.options.items ).andSelf().each(function() {
+ this.element.find( this.options.items ).addBack().each(function() {
var element = $( this );
if ( element.is( "[title]" ) ) {
element
@@ -123,7 +123,7 @@ $.widget( "ui.tooltip", {
_enable: function() {
// restore title attributes
- this.element.find( this.options.items ).andSelf().each(function() {
+ this.element.find( this.options.items ).addBack().each(function() {
var element = $( this );
if ( element.data( "ui-tooltip-title" ) ) {
element.attr( "title", element.data( "ui-tooltip-title" ) );
diff --git a/resources/lib/jquery.ui/jquery.ui.widget.js b/resources/lib/jquery.ui/jquery.ui.widget.js
index f9f0387c2398..e2270869ca70 100644
--- a/resources/lib/jquery.ui/jquery.ui.widget.js
+++ b/resources/lib/jquery.ui/jquery.ui.widget.js
@@ -266,7 +266,7 @@ $.Widget.prototype = {
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
- .unbind( this.eventNamespace )
+ .off( this.eventNamespace )
// 1.9 BC for #7810
// TODO remove dual storage
.removeData( this.widgetName )
@@ -275,14 +275,14 @@ $.Widget.prototype = {
// http://bugs.jquery.com/ticket/9413
.removeData( $.camelCase( this.widgetFullName ) );
this.widget()
- .unbind( this.eventNamespace )
+ .off( this.eventNamespace )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetFullName + "-disabled " +
"ui-state-disabled" );
// clean up events and states
- this.bindings.unbind( this.eventNamespace );
+ this.bindings.off( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
@@ -407,7 +407,7 @@ $.Widget.prototype = {
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
- delegateElement.delegate( selector, eventName, handlerProxy );
+ delegateElement.on( eventName, selector, handlerProxy );
} else {
element.on( eventName, handlerProxy );
}
@@ -416,7 +416,7 @@ $.Widget.prototype = {
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
- element.unbind( eventName ).undelegate( eventName );
+ element.off( eventName );
},
_delay: function( handler, delay ) {