From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- resources/jquery.effects/jquery.effects.core.js | 131 ++++++++++++++++-------- 1 file changed, 90 insertions(+), 41 deletions(-) (limited to 'resources/jquery.effects/jquery.effects.core.js') diff --git a/resources/jquery.effects/jquery.effects.core.js b/resources/jquery.effects/jquery.effects.core.js index 4589fe21..7f568964 100644 --- a/resources/jquery.effects/jquery.effects.core.js +++ b/resources/jquery.effects/jquery.effects.core.js @@ -1,13 +1,13 @@ /* - * jQuery UI Effects 1.8.2 + * jQuery UI Effects 1.8.17 * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/ */ -;jQuery.effects || (function($) { +;jQuery.effects || (function($, undefined) { $.effects = {}; @@ -19,7 +19,7 @@ $.effects = {}; // override the animation for color styles $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', - 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], + 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'], function(i, attr) { $.fx.step[attr] = function(fx) { if (!fx.colorInit) { @@ -52,7 +52,7 @@ function getRGB(color) { return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; // Look for rgb(num%,num%,num%) - if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(color)) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 @@ -231,13 +231,12 @@ $.effects.animateClass = function(value, duration, easing, callback) { easing = null; } - return this.each(function() { - + return this.queue(function() { var that = $(this), originalStyleAttr = that.attr('style') || ' ', originalStyle = filterStyles(getElementStyles.call(this)), newStyle, - className = that.attr('className'); + className = that.attr('class'); $.each(classAnimationActions, function(i, action) { if (value[action]) { @@ -245,20 +244,26 @@ $.effects.animateClass = function(value, duration, easing, callback) { } }); newStyle = filterStyles(getElementStyles.call(this)); - that.attr('className', className); - - that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() { - $.each(classAnimationActions, function(i, action) { - if (value[action]) { that[action + 'Class'](value[action]); } - }); - // work around bug in IE by clearing the cssText before setting it - if (typeof that.attr('style') == 'object') { - that.attr('style').cssText = ''; - that.attr('style').cssText = originalStyleAttr; - } else { - that.attr('style', originalStyleAttr); + that.attr('class', className); + + that.animate(styleDifference(originalStyle, newStyle), { + queue: false, + duration: duration, + easing: easing, + complete: function() { + $.each(classAnimationActions, function(i, action) { + if (value[action]) { that[action + 'Class'](value[action]); } + }); + // work around bug in IE by clearing the cssText before setting it + if (typeof that.attr('style') == 'object') { + that.attr('style').cssText = ''; + that.attr('style').cssText = originalStyleAttr; + } else { + that.attr('style', originalStyleAttr); + } + if (callback) { callback.apply(this, arguments); } + $.dequeue( this ); } - if (callback) { callback.apply(this, arguments); } }); }); }; @@ -301,7 +306,7 @@ $.fn.extend({ /******************************************************************************/ $.extend($.effects, { - version: "1.8.2", + version: "1.8.17", // Saves a set of properties in a data storage save: function(element, set) { @@ -362,9 +367,16 @@ $.extend($.effects, { border: 'none', margin: 0, padding: 0 - }); + }), + active = document.activeElement; element.wrap(wrapper); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element // transfer positioning properties to the wrapper @@ -382,15 +394,25 @@ $.extend($.effects, { props[pos] = 'auto'; } }); - element.css({position: 'relative', top: 0, left: 0 }); + element.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' }); } return wrapper.css(props).show(); }, removeWrapper: function(element) { - if (element.parent().is('.ui-effects-wrapper')) - return element.parent().replaceWith(element); + var parent, + active = document.activeElement; + + if (element.parent().is('.ui-effects-wrapper')) { + parent = element.parent().replaceWith(element); + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + return parent; + } + return element; }, @@ -418,44 +440,72 @@ function _normalizeArguments(effect, options, speed, callback) { speed = null; options = {}; } - if ($.isFunction(speed)) { - callback = speed; - speed = null; - } - if (typeof options == 'number' || $.fx.speeds[options]) { + if (typeof options == 'number' || $.fx.speeds[options]) { callback = speed; speed = options; options = {}; } + if ($.isFunction(speed)) { + callback = speed; + speed = null; + } options = options || {}; speed = speed || options.duration; speed = $.fx.off ? 0 : typeof speed == 'number' - ? speed : $.fx.speeds[speed] || $.fx.speeds._default; + ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default; callback = callback || options.complete; return [effect, options, speed, callback]; } +function standardSpeed( speed ) { + // valid standard speeds + if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { + return true; + } + + // invalid strings - treat as "normal" speed + if ( typeof speed === "string" && !$.effects[ speed ] ) { + return true; + } + + return false; +} + $.fn.extend({ effect: function(effect, options, speed, callback) { var args = _normalizeArguments.apply(this, arguments), - // TODO: make effects takes actual parameters instead of a hash + // TODO: make effects take actual parameters instead of a hash args2 = { options: args[1], duration: args[2], callback: args[3] }, + mode = args2.options.mode, effectMethod = $.effects[effect]; - return effectMethod && !$.fx.off ? effectMethod.call(this, args2) : this; + if ( $.fx.off || !effectMethod ) { + // delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args2.duration, args2.callback ); + } else { + return this.each(function() { + if ( args2.callback ) { + args2.callback.call( this ); + } + }); + } + } + + return effectMethod.call(this, args2); }, _show: $.fn.show, show: function(speed) { - if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) { + if ( standardSpeed( speed ) ) { return this._show.apply(this, arguments); } else { var args = _normalizeArguments.apply(this, arguments); @@ -466,7 +516,7 @@ $.fn.extend({ _hide: $.fn.hide, hide: function(speed) { - if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) { + if ( standardSpeed( speed ) ) { return this._hide.apply(this, arguments); } else { var args = _normalizeArguments.apply(this, arguments); @@ -475,11 +525,10 @@ $.fn.extend({ } }, - // jQuery core overloads toggle and create _toggle + // jQuery core overloads toggle and creates _toggle __toggle: $.fn.toggle, toggle: function(speed) { - if (!speed || typeof speed == 'number' || $.fx.speeds[speed] || - typeof speed == 'boolean' || $.isFunction(speed)) { + if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { return this.__toggle.apply(this, arguments); } else { var args = _normalizeArguments.apply(this, arguments); -- cgit v1.2.2