From 12e0f00369747c13f433a103cb2157e1e5eca12b Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Fri, 19 Apr 2019 19:25:14 +0100 Subject: [PATCH] resources: Remove unused jquery.effects.* modules * jquery.ui.effect-bounce [removed] * jquery.ui.effect-explode [removed] * jquery.ui.effect-fold [removed] * jquery.ui.effect-pulsate [removed] * jquery.ui.effect-slide [removed] * jquery.ui.effect-transfer [removed] Bug: T219604 Change-Id: I9a9acd8ed3d4a3b6c50f57fbb11e6038713a2a09 --- RELEASE-NOTES-1.34 | 3 + resources/Resources.php | 35 ------ .../lib/jquery.ui/jquery.ui.effect-bounce.js | 113 ------------------ .../lib/jquery.ui/jquery.ui.effect-explode.js | 97 --------------- .../lib/jquery.ui/jquery.ui.effect-fold.js | 76 ------------ .../lib/jquery.ui/jquery.ui.effect-pulsate.js | 63 ---------- .../lib/jquery.ui/jquery.ui.effect-slide.js | 64 ---------- .../jquery.ui/jquery.ui.effect-transfer.js | 47 -------- 8 files changed, 3 insertions(+), 495 deletions(-) delete mode 100644 resources/lib/jquery.ui/jquery.ui.effect-bounce.js delete mode 100644 resources/lib/jquery.ui/jquery.ui.effect-explode.js delete mode 100644 resources/lib/jquery.ui/jquery.ui.effect-fold.js delete mode 100644 resources/lib/jquery.ui/jquery.ui.effect-pulsate.js delete mode 100644 resources/lib/jquery.ui/jquery.ui.effect-slide.js delete mode 100644 resources/lib/jquery.ui/jquery.ui.effect-transfer.js diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index 76fa583d1a..d13159076f 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -202,6 +202,9 @@ because of Phabricator reports. getErrorsOrWarnings() instead. * SpecialPage::getTitle(), deprecated in 1.23, has been removed. Use SpecialPage::getPageTitle() instead. +* jquery.ui.effect-bounce, jquery.ui.effect-explode, jquery.ui.effect-fold + jquery.ui.effect-pulsate, jquery.ui.effect-slide, jquery.ui.effect-transfer, + which are no longer used, have now been removed. * … === Deprecations in 1.34 === diff --git a/resources/Resources.php b/resources/Resources.php index ecdd43fb83..ece1c90bd1 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -615,11 +615,6 @@ return [ 'dependencies' => 'jquery.effects.core', 'group' => 'jquery.ui', ], - 'jquery.effects.bounce' => [ - 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-bounce.js', - 'dependencies' => 'jquery.effects.core', - 'group' => 'jquery.ui', - ], 'jquery.effects.clip' => [ 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-clip.js', 'dependencies' => 'jquery.effects.core', @@ -630,31 +625,11 @@ return [ 'dependencies' => 'jquery.effects.core', 'group' => 'jquery.ui', ], - 'jquery.effects.explode' => [ - 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-explode.js', - 'dependencies' => 'jquery.effects.core', - 'group' => 'jquery.ui', - ], - 'jquery.effects.fade' => [ - 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-fade.js', - 'dependencies' => 'jquery.effects.core', - 'group' => 'jquery.ui', - ], - 'jquery.effects.fold' => [ - 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-fold.js', - 'dependencies' => 'jquery.effects.core', - 'group' => 'jquery.ui', - ], 'jquery.effects.highlight' => [ 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-highlight.js', 'dependencies' => 'jquery.effects.core', 'group' => 'jquery.ui', ], - 'jquery.effects.pulsate' => [ - 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-pulsate.js', - 'dependencies' => 'jquery.effects.core', - 'group' => 'jquery.ui', - ], 'jquery.effects.scale' => [ 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-scale.js', 'dependencies' => 'jquery.effects.core', @@ -665,16 +640,6 @@ return [ 'dependencies' => 'jquery.effects.core', 'group' => 'jquery.ui', ], - 'jquery.effects.slide' => [ - 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-slide.js', - 'dependencies' => 'jquery.effects.core', - 'group' => 'jquery.ui', - ], - 'jquery.effects.transfer' => [ - 'scripts' => 'resources/lib/jquery.ui/jquery.ui.effect-transfer.js', - 'dependencies' => 'jquery.effects.core', - 'group' => 'jquery.ui', - ], /* Moment.js */ diff --git a/resources/lib/jquery.ui/jquery.ui.effect-bounce.js b/resources/lib/jquery.ui/jquery.ui.effect-bounce.js deleted file mode 100644 index ab1977ef68..0000000000 --- a/resources/lib/jquery.ui/jquery.ui.effect-bounce.js +++ /dev/null @@ -1,113 +0,0 @@ -/*! - * jQuery UI Effects Bounce 1.9.2 - * http://jqueryui.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/bounce-effect/ - * - * Depends: - * jquery.ui.effect.js - */ -(function( $, undefined ) { - -$.effects.effect.bounce = function( o, done ) { - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - - // defaults: - mode = $.effects.setMode( el, o.mode || "effect" ), - hide = mode === "hide", - show = mode === "show", - direction = o.direction || "up", - distance = o.distance, - times = o.times || 5, - - // number of internal animations - anims = times * 2 + ( show || hide ? 1 : 0 ), - speed = o.duration / anims, - easing = o.easing, - - // utility: - ref = ( direction === "up" || direction === "down" ) ? "top" : "left", - motion = ( direction === "up" || direction === "left" ), - i, - upAnim, - downAnim, - - // we will need to re-assemble the queue to stack our animations in place - queue = el.queue(), - queuelen = queue.length; - - // Avoid touching opacity to prevent clearType and PNG issues in IE - if ( show || hide ) { - props.push( "opacity" ); - } - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); // Create Wrapper - - // default distance for the BIGGEST bounce is the outer Distance / 3 - if ( !distance ) { - distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; - } - - if ( show ) { - downAnim = { opacity: 1 }; - downAnim[ ref ] = 0; - - // if we are showing, force opacity 0 and set the initial position - // then do the "first" animation - el.css( "opacity", 0 ) - .css( ref, motion ? -distance * 2 : distance * 2 ) - .animate( downAnim, speed, easing ); - } - - // start at the smallest distance if we are hiding - if ( hide ) { - distance = distance / Math.pow( 2, times - 1 ); - } - - downAnim = {}; - downAnim[ ref ] = 0; - // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here - for ( i = 0; i < times; i++ ) { - upAnim = {}; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ) - .animate( downAnim, speed, easing ); - - distance = hide ? distance * 2 : distance / 2; - } - - // Last Bounce when Hiding - if ( hide ) { - upAnim = { opacity: 0 }; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ); - } - - el.queue(function() { - if ( hide ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - - // inject all the animations we just queued to be first in line (after "inprogress") - if ( queuelen > 1) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - el.dequeue(); - -}; - -})(jQuery); diff --git a/resources/lib/jquery.ui/jquery.ui.effect-explode.js b/resources/lib/jquery.ui/jquery.ui.effect-explode.js deleted file mode 100644 index 98d5be5c0b..0000000000 --- a/resources/lib/jquery.ui/jquery.ui.effect-explode.js +++ /dev/null @@ -1,97 +0,0 @@ -/*! - * jQuery UI Effects Explode 1.9.2 - * http://jqueryui.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/explode-effect/ - * - * Depends: - * jquery.ui.effect.js - */ -(function( $, undefined ) { - -$.effects.effect.explode = function( o, done ) { - - var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3, - cells = rows, - el = $( this ), - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - - // show and then visibility:hidden the element before calculating offset - offset = el.show().css( "visibility", "hidden" ).offset(), - - // width and height of a piece - width = Math.ceil( el.outerWidth() / cells ), - height = Math.ceil( el.outerHeight() / rows ), - pieces = [], - - // loop - i, j, left, top, mx, my; - - // children animate complete: - function childComplete() { - pieces.push( this ); - if ( pieces.length === rows * cells ) { - animComplete(); - } - } - - // clone the element for each row and cell. - for( i = 0; i < rows ; i++ ) { // ===> - top = offset.top + i * height; - my = i - ( rows - 1 ) / 2 ; - - for( j = 0; j < cells ; j++ ) { // ||| - left = offset.left + j * width; - mx = j - ( cells - 1 ) / 2 ; - - // Create a clone of the now hidden main element that will be absolute positioned - // within a wrapper div off the -left and -top equal to size of our pieces - el - .clone() - .appendTo( "body" ) - .wrap( "
" ) - .css({ - position: "absolute", - visibility: "visible", - left: -j * width, - top: -i * height - }) - - // select the wrapper - make it overflow: hidden and absolute positioned based on - // where the original was located +left and +top equal to the size of pieces - .parent() - .addClass( "ui-effects-explode" ) - .css({ - position: "absolute", - overflow: "hidden", - width: width, - height: height, - left: left + ( show ? mx * width : 0 ), - top: top + ( show ? my * height : 0 ), - opacity: show ? 0 : 1 - }).animate({ - left: left + ( show ? 0 : mx * width ), - top: top + ( show ? 0 : my * height ), - opacity: show ? 1 : 0 - }, o.duration || 500, o.easing, childComplete ); - } - } - - function animComplete() { - el.css({ - visibility: "visible" - }); - $( pieces ).remove(); - if ( !show ) { - el.hide(); - } - done(); - } -}; - -})(jQuery); diff --git a/resources/lib/jquery.ui/jquery.ui.effect-fold.js b/resources/lib/jquery.ui/jquery.ui.effect-fold.js deleted file mode 100644 index 9452c5da22..0000000000 --- a/resources/lib/jquery.ui/jquery.ui.effect-fold.js +++ /dev/null @@ -1,76 +0,0 @@ -/*! - * jQuery UI Effects Fold 1.9.2 - * http://jqueryui.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/fold-effect/ - * - * Depends: - * jquery.ui.effect.js - */ -(function( $, undefined ) { - -$.effects.effect.fold = function( o, done ) { - - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - hide = mode === "hide", - size = o.size || 15, - percent = /([0-9]+)%/.exec( size ), - horizFirst = !!o.horizFirst, - widthFirst = show !== horizFirst, - ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ], - duration = o.duration / 2, - wrapper, distance, - animation1 = {}, - animation2 = {}; - - $.effects.save( el, props ); - el.show(); - - // Create Wrapper - wrapper = $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - distance = widthFirst ? - [ wrapper.width(), wrapper.height() ] : - [ wrapper.height(), wrapper.width() ]; - - if ( percent ) { - size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; - } - if ( show ) { - wrapper.css( horizFirst ? { - height: 0, - width: size - } : { - height: size, - width: 0 - }); - } - - // Animation - animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size; - animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0; - - // Animate - wrapper - .animate( animation1, duration, o.easing ) - .animate( animation2, duration, o.easing, function() { - if ( hide ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - -}; - -})(jQuery); diff --git a/resources/lib/jquery.ui/jquery.ui.effect-pulsate.js b/resources/lib/jquery.ui/jquery.ui.effect-pulsate.js deleted file mode 100644 index 20f84dd3e3..0000000000 --- a/resources/lib/jquery.ui/jquery.ui.effect-pulsate.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * jQuery UI Effects Pulsate 1.9.2 - * http://jqueryui.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/pulsate-effect/ - * - * Depends: - * jquery.ui.effect.js - */ -(function( $, undefined ) { - -$.effects.effect.pulsate = function( o, done ) { - var elem = $( this ), - mode = $.effects.setMode( elem, o.mode || "show" ), - show = mode === "show", - hide = mode === "hide", - showhide = ( show || mode === "hide" ), - - // showing or hiding leaves of the "last" animation - anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), - duration = o.duration / anims, - animateTo = 0, - queue = elem.queue(), - queuelen = queue.length, - i; - - if ( show || !elem.is(":visible")) { - elem.css( "opacity", 0 ).show(); - animateTo = 1; - } - - // anims - 1 opacity "toggles" - for ( i = 1; i < anims; i++ ) { - elem.animate({ - opacity: animateTo - }, duration, o.easing ); - animateTo = 1 - animateTo; - } - - elem.animate({ - opacity: animateTo - }, duration, o.easing); - - elem.queue(function() { - if ( hide ) { - elem.hide(); - } - done(); - }); - - // We just queued up "anims" animations, we need to put them next in the queue - if ( queuelen > 1 ) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - elem.dequeue(); -}; - -})(jQuery); diff --git a/resources/lib/jquery.ui/jquery.ui.effect-slide.js b/resources/lib/jquery.ui/jquery.ui.effect-slide.js deleted file mode 100644 index 445ec48ec7..0000000000 --- a/resources/lib/jquery.ui/jquery.ui.effect-slide.js +++ /dev/null @@ -1,64 +0,0 @@ -/*! - * jQuery UI Effects Slide 1.9.2 - * http://jqueryui.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/slide-effect/ - * - * Depends: - * jquery.ui.effect.js - */ -(function( $, undefined ) { - -$.effects.effect.slide = function( o, done ) { - - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "width", "height" ], - mode = $.effects.setMode( el, o.mode || "show" ), - show = mode === "show", - direction = o.direction || "left", - ref = (direction === "up" || direction === "down") ? "top" : "left", - positiveMotion = (direction === "up" || direction === "left"), - distance, - animation = {}; - - // Adjust - $.effects.save( el, props ); - el.show(); - distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ); - - $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - - if ( show ) { - el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance ); - } - - // Animation - animation[ ref ] = ( show ? - ( positiveMotion ? "+=" : "-=") : - ( positiveMotion ? "-=" : "+=")) + - distance; - - // Animate - el.animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); -}; - -})(jQuery); diff --git a/resources/lib/jquery.ui/jquery.ui.effect-transfer.js b/resources/lib/jquery.ui/jquery.ui.effect-transfer.js deleted file mode 100644 index f133c04ba8..0000000000 --- a/resources/lib/jquery.ui/jquery.ui.effect-transfer.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * jQuery UI Effects Transfer 1.9.2 - * http://jqueryui.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/transfer-effect/ - * - * Depends: - * jquery.ui.effect.js - */ -(function( $, undefined ) { - -$.effects.effect.transfer = function( o, done ) { - var elem = $( this ), - target = $( o.to ), - targetFixed = target.css( "position" ) === "fixed", - body = $("body"), - fixTop = targetFixed ? body.scrollTop() : 0, - fixLeft = targetFixed ? body.scrollLeft() : 0, - endPosition = target.offset(), - animation = { - top: endPosition.top - fixTop , - left: endPosition.left - fixLeft , - height: target.innerHeight(), - width: target.innerWidth() - }, - startPosition = elem.offset(), - transfer = $( '
' ) - .appendTo( document.body ) - .addClass( o.className ) - .css({ - top: startPosition.top - fixTop , - left: startPosition.left - fixLeft , - height: elem.innerHeight(), - width: elem.innerWidth(), - position: targetFixed ? "fixed" : "absolute" - }) - .animate( animation, o.duration, o.easing, function() { - transfer.remove(); - done(); - }); -}; - -})(jQuery); -- 2.20.1