Bug 20489 Configure illegal file characters https://bugzilla.wikimedia.org/show_bug...
[mediawiki.git] / js2 / mwEmbed / jquery / jquery.ui / ui / effects.pulsate.js
blobe845634605b1ba772e236213b199d502e442eacf
1 /*
2  * jQuery UI Effects Pulsate 1.7.1
3  *
4  * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5  * Dual licensed under the MIT (MIT-LICENSE.txt)
6  * and GPL (GPL-LICENSE.txt) licenses.
7  *
8  * http://docs.jquery.com/UI/Effects/Pulsate
9  *
10  * Depends:
11  *      effects.core.js
12  */
13 (function($) {
15 $.effects.pulsate = function(o) {
17         return this.queue(function() {
19                 // Create element
20                 var el = $(this);
22                 // Set options
23                 var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
24                 var times = o.options.times || 5; // Default # of times
25                 var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
27                 // Adjust
28                 if (mode == 'hide') times--;
29                 if (el.is(':hidden')) { // Show fadeIn
30                         el.css('opacity', 0);
31                         el.show(); // Show
32                         el.animate({opacity: 1}, duration, o.options.easing);
33                         times = times-2;
34                 }
36                 // Animate
37                 for (var i = 0; i < times; i++) { // Pulsate
38                         el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing);
39                 };
40                 if (mode == 'hide') { // Last Pulse
41                         el.animate({opacity: 0}, duration, o.options.easing, function(){
42                                 el.hide(); // Hide
43                                 if(o.callback) o.callback.apply(this, arguments); // Callback
44                         });
45                 } else {
46                         el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing, function(){
47                                 if(o.callback) o.callback.apply(this, arguments); // Callback
48                         });
49                 };
50                 el.queue('fx', function() { el.dequeue(); });
51                 el.dequeue();
52         });
56 })(jQuery);