diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /resources/jquery/jquery.color.js | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'resources/jquery/jquery.color.js')
-rw-r--r-- | resources/jquery/jquery.color.js | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/resources/jquery/jquery.color.js b/resources/jquery/jquery.color.js index 8a619b5c..8bc45c97 100644 --- a/resources/jquery/jquery.color.js +++ b/resources/jquery/jquery.color.js @@ -1,44 +1,54 @@ /** * jQuery Color Animations - * Copyright 2007 John Resig + * + * @author John Resig, 2007 + * @author Krinkle, 2011 * Released under the MIT and GPL licenses. * - * - 2011-01-05: Modified by Krinkle to use the jQuery.colorUtil plugin (which has to be loaded first!) + * - 2011-01-05: Forked for MediaWiki. See also jQuery.colorUtil plugin */ -(function( $ ) { +( function ( $ ) { - // We override the animation for all of these color styles - $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], - function( i, attr ) { - $.fx.step[attr] = function( fx ) { - if ( fx.state == 0 ) { - fx.start = getColor( fx.elem, attr ); - fx.end = $.colorUtil.getRGB( fx.end ); - } - - fx.elem.style[attr] = 'rgb(' + [ - Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) - ].join( ',' ) + ')'; - } - } - ); - - function getColor(elem, attr) { + function getColor( elem, attr ) { + /*jshint boss:true */ var color; do { - color = $.curCSS(elem, attr); + color = $.curCSS( elem, attr ); // Keep going until we find an element that has color, or we hit the body - if ( color != '' && color != 'transparent' || $.nodeName(elem, 'body') ) + if ( color !== '' && color !== 'transparent' || $.nodeName( elem, 'body' ) ) { break; + } attr = 'backgroundColor'; } while ( elem = elem.parentNode ); - return $.colorUtil.getRGB(color); - }; + return $.colorUtil.getRGB( color ); + } + + // We override the animation for all of these color styles + $.each([ + 'backgroundColor', + 'borderBottomColor', + 'borderLeftColor', + 'borderRightColor', + 'borderTopColor', + 'color', + 'outlineColor' + ], function ( i, attr ) { + $.fx.step[attr] = function ( fx ) { + if ( fx.state === 0 ) { + fx.start = getColor( fx.elem, attr ); + fx.end = $.colorUtil.getRGB( fx.end ); + } + + fx.elem.style[attr] = 'rgb(' + [ + Math.max( Math.min( parseInt( (fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10 ), 255 ), 0 ), + Math.max( Math.min( parseInt( (fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10 ), 255 ), 0 ), + Math.max( Math.min( parseInt( (fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10 ), 255 ), 0 ) + ].join( ',' ) + ')'; + }; + } ); -} )( jQuery ); +}( jQuery ) ); |