diff options
author | rvelices <rv-github@modusoptimus.com> | 2012-11-06 21:00:59 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2012-11-06 21:00:59 +0000 |
commit | f0d061d613497ccfb20765a81e85dbaa4de74484 (patch) | |
tree | 1e73d778468a0d07515908499e6ba7ce8d11f717 /themes/default/js/ui/jquery.ui.effect-pulsate.js | |
parent | 8ec9fb34c76af8ec1e6bbe1a647f3ad0dd78f407 (diff) |
feature 2771 upgrade jquery ui - forgot to add non minimified files (not used anywhere in the code, but for the sake of coherence)
git-svn-id: http://piwigo.org/svn/trunk@18953 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/js/ui/jquery.ui.effect-pulsate.js')
-rw-r--r-- | themes/default/js/ui/jquery.ui.effect-pulsate.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/themes/default/js/ui/jquery.ui.effect-pulsate.js b/themes/default/js/ui/jquery.ui.effect-pulsate.js new file mode 100644 index 000000000..3920034ab --- /dev/null +++ b/themes/default/js/ui/jquery.ui.effect-pulsate.js @@ -0,0 +1,63 @@ +/*! + * jQuery UI Effects Pulsate 1.9.0 + * 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); |