diff options
author | nikrou <nikrou@piwigo.org> | 2010-02-20 19:56:36 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2010-02-20 19:56:36 +0000 |
commit | 6acc3ff7909dd7f070973c112ebd9291862982f8 (patch) | |
tree | 20a0875d668206917f88b73983d7021038b43170 /template-common/lib/ui/effects.scale.js | |
parent | 0c4bdbe01325869a62380c1d2804c34e8a31c1dd (diff) |
Feature 1442 : update jquery
* update jquery to 1.4.1
* update jquery ui to 1.7.2
git-svn-id: http://piwigo.org/svn/trunk@4918 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'template-common/lib/ui/effects.scale.js')
-rw-r--r-- | template-common/lib/ui/effects.scale.js | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/template-common/lib/ui/effects.scale.js b/template-common/lib/ui/effects.scale.js index 216b0172e..ec15cf853 100644 --- a/template-common/lib/ui/effects.scale.js +++ b/template-common/lib/ui/effects.scale.js @@ -1,10 +1,10 @@ /* - * jQuery UI Effects Scale + * jQuery UI Effects Scale 1.7.2 * - * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com) + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. - * + * * http://docs.jquery.com/UI/Effects/Scale * * Depends: @@ -18,41 +18,41 @@ $.effects.puff = function(o) { // Create element var el = $(this); - + // Set options var options = $.extend(true, {}, o.options); var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var percent = parseInt(o.options.percent) || 150; // Set default puff percent + var percent = parseInt(o.options.percent,10) || 150; // Set default puff percent options.fade = true; // It's not a puff if it doesn't fade! :) var original = {height: el.height(), width: el.width()}; // Save original - + // Adjust var factor = percent / 100; el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor}; - + // Animation options.from = el.from; options.percent = (mode == 'hide') ? percent : 100; options.mode = mode; - + // Animate el.effect('scale', options, o.duration, o.callback); el.dequeue(); }); - + }; $.effects.scale = function(o) { - + return this.queue(function() { - + // Create element var el = $(this); // Set options var options = $.extend(true, {}, o.options); var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var percent = parseInt(o.options.percent) || (parseInt(o.options.percent) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent + var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent var direction = o.options.direction || 'both'; // Set default axis var origin = o.options.origin; // The origin of the scaling if (mode != 'effect') { // Set default origin and restore for show/hide @@ -61,33 +61,33 @@ $.effects.scale = function(o) { } var original = {height: el.height(), width: el.width()}; // Save original el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state - + // Adjust var factor = { // Set scaling factor y: direction != 'horizontal' ? (percent / 100) : 1, x: direction != 'vertical' ? (percent / 100) : 1 }; el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state - + if (o.options.fade) { // Fade option to support puff if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; }; - + // Animation options.from = el.from; options.to = el.to; options.mode = mode; - + // Animate el.effect('size', options, o.duration, o.callback); el.dequeue(); }); - + }; $.effects.size = function(o) { return this.queue(function() { - + // Create element var el = $(this), props = ['position','top','left','width','height','overflow','opacity']; var props1 = ['position','top','left','overflow','opacity']; // Always restore @@ -95,7 +95,7 @@ $.effects.size = function(o) { var cProps = ['fontSize']; var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; - + // Set options var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode var restore = o.options.restore || false; // Default restore @@ -138,7 +138,7 @@ $.effects.size = function(o) { $.effects.save(el, restore ? props : props1); el.show(); // Save & Show $.effects.createWrapper(el); // Create Wrapper el.css('overflow','hidden').css(el.from); // Shift - + // Animate if (scale == 'content' || scale == 'both') { // Scale the children vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size @@ -164,15 +164,15 @@ $.effects.size = function(o) { }); // Animate children }); }; - + // Animate el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { if(mode == 'hide') el.hide(); // Hide $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore if(o.callback) o.callback.apply(this, arguments); // Callback el.dequeue(); - }}); - + }}); + }); }; |