TextContent: Normalize newlines in preSaveTransform()
[mediawiki.git] / resources / lib / jquery.ui / jquery.ui.effect-pulsate.js
blob20f84dd3e33b47b813ae0a3d8bea753c67e3777d
1 /*!
2 * jQuery UI Effects Pulsate 1.9.2
3 * http://jqueryui.com
5 * Copyright 2012 jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
9 * http://api.jqueryui.com/pulsate-effect/
11 * Depends:
12 * jquery.ui.effect.js
14 (function( $, undefined ) {
16 $.effects.effect.pulsate = function( o, done ) {
17 var elem = $( this ),
18 mode = $.effects.setMode( elem, o.mode || "show" ),
19 show = mode === "show",
20 hide = mode === "hide",
21 showhide = ( show || mode === "hide" ),
23 // showing or hiding leaves of the "last" animation
24 anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
25 duration = o.duration / anims,
26 animateTo = 0,
27 queue = elem.queue(),
28 queuelen = queue.length,
31 if ( show || !elem.is(":visible")) {
32 elem.css( "opacity", 0 ).show();
33 animateTo = 1;
36 // anims - 1 opacity "toggles"
37 for ( i = 1; i < anims; i++ ) {
38 elem.animate({
39 opacity: animateTo
40 }, duration, o.easing );
41 animateTo = 1 - animateTo;
44 elem.animate({
45 opacity: animateTo
46 }, duration, o.easing);
48 elem.queue(function() {
49 if ( hide ) {
50 elem.hide();
52 done();
53 });
55 // We just queued up "anims" animations, we need to put them next in the queue
56 if ( queuelen > 1 ) {
57 queue.splice.apply( queue,
58 [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
60 elem.dequeue();
63 })(jQuery);