jquery-ui-rails 2.0.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jquery-ui-rails might be problematic. Click here for more details.

Files changed (131) hide show
  1. data/History.md +15 -0
  2. data/License.txt +2 -3
  3. data/README.md +17 -19
  4. data/Rakefile +79 -28
  5. data/lib/jquery/ui/rails/version.rb +1 -1
  6. data/vendor/assets/javascripts/jquery.ui.accordion.js +537 -417
  7. data/vendor/assets/javascripts/jquery.ui.all.js +17 -14
  8. data/vendor/assets/javascripts/jquery.ui.autocomplete.js +311 -339
  9. data/vendor/assets/javascripts/jquery.ui.button.js +63 -59
  10. data/vendor/assets/javascripts/jquery.ui.core.js +134 -112
  11. data/vendor/assets/javascripts/jquery.ui.datepicker-ar-DZ.js +2 -2
  12. data/vendor/assets/javascripts/jquery.ui.datepicker-ar.js +3 -3
  13. data/vendor/assets/javascripts/jquery.ui.datepicker-az.js +3 -3
  14. data/vendor/assets/javascripts/jquery.ui.datepicker-bg.js +16 -16
  15. data/vendor/assets/javascripts/jquery.ui.datepicker-bs.js +5 -5
  16. data/vendor/assets/javascripts/jquery.ui.datepicker-ca.js +13 -13
  17. data/vendor/assets/javascripts/jquery.ui.datepicker-cs.js +3 -3
  18. data/vendor/assets/javascripts/jquery.ui.datepicker-cy-GB.js +1 -1
  19. data/vendor/assets/javascripts/jquery.ui.datepicker-da.js +9 -9
  20. data/vendor/assets/javascripts/jquery.ui.datepicker-de.js +2 -2
  21. data/vendor/assets/javascripts/jquery.ui.datepicker-el.js +1 -1
  22. data/vendor/assets/javascripts/jquery.ui.datepicker-eo.js +2 -2
  23. data/vendor/assets/javascripts/jquery.ui.datepicker-es.js +6 -6
  24. data/vendor/assets/javascripts/jquery.ui.datepicker-et.js +1 -1
  25. data/vendor/assets/javascripts/jquery.ui.datepicker-eu.js +3 -3
  26. data/vendor/assets/javascripts/jquery.ui.datepicker-fa.js +3 -3
  27. data/vendor/assets/javascripts/jquery.ui.datepicker-fi.js +5 -5
  28. data/vendor/assets/javascripts/jquery.ui.datepicker-fo.js +3 -3
  29. data/vendor/assets/javascripts/jquery.ui.datepicker-fr-CH.js +3 -3
  30. data/vendor/assets/javascripts/jquery.ui.datepicker-fr.js +2 -2
  31. data/vendor/assets/javascripts/jquery.ui.datepicker-gl.js +6 -6
  32. data/vendor/assets/javascripts/jquery.ui.datepicker-he.js +2 -2
  33. data/vendor/assets/javascripts/jquery.ui.datepicker-hr.js +3 -3
  34. data/vendor/assets/javascripts/jquery.ui.datepicker-hy.js +3 -3
  35. data/vendor/assets/javascripts/jquery.ui.datepicker-id.js +3 -3
  36. data/vendor/assets/javascripts/jquery.ui.datepicker-is.js +11 -11
  37. data/vendor/assets/javascripts/jquery.ui.datepicker-it.js +3 -3
  38. data/vendor/assets/javascripts/jquery.ui.datepicker-ja.js +3 -3
  39. data/vendor/assets/javascripts/jquery.ui.datepicker-kk.js +2 -2
  40. data/vendor/assets/javascripts/jquery.ui.datepicker-ko.js +1 -1
  41. data/vendor/assets/javascripts/jquery.ui.datepicker-lt.js +3 -3
  42. data/vendor/assets/javascripts/jquery.ui.datepicker-lv.js +1 -1
  43. data/vendor/assets/javascripts/jquery.ui.datepicker-ml.js +1 -1
  44. data/vendor/assets/javascripts/jquery.ui.datepicker-ms.js +3 -3
  45. data/vendor/assets/javascripts/jquery.ui.datepicker-nl.js +1 -1
  46. data/vendor/assets/javascripts/jquery.ui.datepicker-no.js +18 -18
  47. data/vendor/assets/javascripts/jquery.ui.datepicker-pl.js +2 -2
  48. data/vendor/assets/javascripts/jquery.ui.datepicker-pt-BR.js +7 -7
  49. data/vendor/assets/javascripts/jquery.ui.datepicker-pt.js +6 -6
  50. data/vendor/assets/javascripts/jquery.ui.datepicker-rm.js +2 -2
  51. data/vendor/assets/javascripts/jquery.ui.datepicker-ro.js +2 -2
  52. data/vendor/assets/javascripts/jquery.ui.datepicker-ru.js +3 -3
  53. data/vendor/assets/javascripts/jquery.ui.datepicker-sk.js +2 -2
  54. data/vendor/assets/javascripts/jquery.ui.datepicker-sl.js +6 -6
  55. data/vendor/assets/javascripts/jquery.ui.datepicker-sq.js +2 -2
  56. data/vendor/assets/javascripts/jquery.ui.datepicker-sr-SR.js +2 -2
  57. data/vendor/assets/javascripts/jquery.ui.datepicker-sr.js +2 -2
  58. data/vendor/assets/javascripts/jquery.ui.datepicker-sv.js +9 -9
  59. data/vendor/assets/javascripts/jquery.ui.datepicker-th.js +3 -3
  60. data/vendor/assets/javascripts/jquery.ui.datepicker-tj.js +1 -1
  61. data/vendor/assets/javascripts/jquery.ui.datepicker-tr.js +2 -2
  62. data/vendor/assets/javascripts/jquery.ui.datepicker-uk.js +3 -3
  63. data/vendor/assets/javascripts/jquery.ui.datepicker-vi.js +2 -2
  64. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-CN.js +2 -2
  65. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-HK.js +2 -2
  66. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-TW.js +2 -2
  67. data/vendor/assets/javascripts/jquery.ui.datepicker.js +51 -59
  68. data/vendor/assets/javascripts/jquery.ui.dialog.js +402 -409
  69. data/vendor/assets/javascripts/jquery.ui.draggable.js +79 -75
  70. data/vendor/assets/javascripts/jquery.ui.droppable.js +10 -17
  71. data/vendor/assets/javascripts/jquery.ui.effect-blind.js +84 -0
  72. data/vendor/assets/javascripts/jquery.ui.effect-bounce.js +115 -0
  73. data/vendor/assets/javascripts/jquery.ui.effect-clip.js +69 -0
  74. data/vendor/assets/javascripts/jquery.ui.effect-drop.js +67 -0
  75. data/vendor/assets/javascripts/jquery.ui.effect-explode.js +99 -0
  76. data/vendor/assets/javascripts/jquery.ui.effect-fade.js +32 -0
  77. data/vendor/assets/javascripts/jquery.ui.effect-fold.js +78 -0
  78. data/vendor/assets/javascripts/jquery.ui.effect-highlight.js +52 -0
  79. data/vendor/assets/javascripts/jquery.ui.effect-pulsate.js +65 -0
  80. data/vendor/assets/javascripts/jquery.ui.effect-scale.js +320 -0
  81. data/vendor/assets/javascripts/jquery.ui.effect-shake.js +76 -0
  82. data/vendor/assets/javascripts/jquery.ui.effect-slide.js +66 -0
  83. data/vendor/assets/javascripts/jquery.ui.effect-transfer.js +49 -0
  84. data/vendor/assets/javascripts/jquery.ui.effect.all.js +14 -0
  85. data/vendor/assets/javascripts/jquery.ui.effect.js +1276 -0
  86. data/vendor/assets/javascripts/jquery.ui.menu.js +614 -0
  87. data/vendor/assets/javascripts/jquery.ui.mouse.js +22 -20
  88. data/vendor/assets/javascripts/jquery.ui.position.js +367 -158
  89. data/vendor/assets/javascripts/jquery.ui.progressbar.js +10 -14
  90. data/vendor/assets/javascripts/jquery.ui.resizable.js +143 -149
  91. data/vendor/assets/javascripts/jquery.ui.selectable.js +22 -28
  92. data/vendor/assets/javascripts/jquery.ui.slider.js +88 -106
  93. data/vendor/assets/javascripts/jquery.ui.sortable.js +97 -95
  94. data/vendor/assets/javascripts/jquery.ui.spinner.js +482 -0
  95. data/vendor/assets/javascripts/jquery.ui.tabs.js +1189 -580
  96. data/vendor/assets/javascripts/jquery.ui.tooltip.js +402 -0
  97. data/vendor/assets/javascripts/jquery.ui.widget.js +373 -117
  98. data/vendor/assets/stylesheets/jquery.ui.accordion.css.erb +10 -13
  99. data/vendor/assets/stylesheets/jquery.ui.all.css.erb +4 -3
  100. data/vendor/assets/stylesheets/jquery.ui.autocomplete.css.erb +10 -44
  101. data/vendor/assets/stylesheets/jquery.ui.base.css.erb +7 -3
  102. data/vendor/assets/stylesheets/jquery.ui.button.css.erb +6 -4
  103. data/vendor/assets/stylesheets/jquery.ui.core.css.erb +5 -4
  104. data/vendor/assets/stylesheets/jquery.ui.datepicker.css.erb +4 -3
  105. data/vendor/assets/stylesheets/jquery.ui.dialog.css.erb +6 -5
  106. data/vendor/assets/stylesheets/jquery.ui.menu.css.erb +34 -0
  107. data/vendor/assets/stylesheets/jquery.ui.progressbar.css.erb +4 -3
  108. data/vendor/assets/stylesheets/jquery.ui.resizable.css.erb +4 -3
  109. data/vendor/assets/stylesheets/jquery.ui.selectable.css.erb +4 -3
  110. data/vendor/assets/stylesheets/jquery.ui.slider.css.erb +4 -3
  111. data/vendor/assets/stylesheets/jquery.ui.spinner.css.erb +27 -0
  112. data/vendor/assets/stylesheets/jquery.ui.tabs.css.erb +8 -8
  113. data/vendor/assets/stylesheets/jquery.ui.theme.css.erb +8 -7
  114. data/vendor/assets/stylesheets/jquery.ui.tooltip.css.erb +25 -0
  115. metadata +24 -19
  116. data/dependencies.js +0 -31
  117. data/vendor/assets/javascripts/jquery.effects.all.js +0 -14
  118. data/vendor/assets/javascripts/jquery.effects.blind.js +0 -51
  119. data/vendor/assets/javascripts/jquery.effects.bounce.js +0 -80
  120. data/vendor/assets/javascripts/jquery.effects.clip.js +0 -56
  121. data/vendor/assets/javascripts/jquery.effects.core.js +0 -612
  122. data/vendor/assets/javascripts/jquery.effects.drop.js +0 -52
  123. data/vendor/assets/javascripts/jquery.effects.explode.js +0 -81
  124. data/vendor/assets/javascripts/jquery.effects.fade.js +0 -34
  125. data/vendor/assets/javascripts/jquery.effects.fold.js +0 -58
  126. data/vendor/assets/javascripts/jquery.effects.highlight.js +0 -52
  127. data/vendor/assets/javascripts/jquery.effects.pulsate.js +0 -53
  128. data/vendor/assets/javascripts/jquery.effects.scale.js +0 -180
  129. data/vendor/assets/javascripts/jquery.effects.shake.js +0 -59
  130. data/vendor/assets/javascripts/jquery.effects.slide.js +0 -52
  131. data/vendor/assets/javascripts/jquery.effects.transfer.js +0 -47
@@ -1,52 +0,0 @@
1
- //= require jquery.effects.core
2
-
3
- /*!
4
- * jQuery UI Effects Drop 1.8.24
5
- *
6
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
- * Dual licensed under the MIT or GPL Version 2 licenses.
8
- * http://jquery.org/license
9
- *
10
- * http://docs.jquery.com/UI/Effects/Drop
11
- *
12
- * Depends:
13
- * jquery.effects.core.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.effects.drop = function(o) {
18
-
19
- return this.queue(function() {
20
-
21
- // Create element
22
- var el = $(this), props = ['position','top','bottom','left','right','opacity'];
23
-
24
- // Set options
25
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
26
- var direction = o.options.direction || 'left'; // Default Direction
27
-
28
- // Adjust
29
- $.effects.save(el, props); el.show(); // Save & Show
30
- $.effects.createWrapper(el); // Create Wrapper
31
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
32
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
33
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight( true ) / 2 : el.outerWidth( true ) / 2);
34
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
35
-
36
- // Animation
37
- var animation = {opacity: mode == 'show' ? 1 : 0};
38
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
39
-
40
- // Animate
41
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
42
- if(mode == 'hide') el.hide(); // Hide
43
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
44
- if(o.callback) o.callback.apply(this, arguments); // Callback
45
- el.dequeue();
46
- }});
47
-
48
- });
49
-
50
- };
51
-
52
- })(jQuery);
@@ -1,81 +0,0 @@
1
- //= require jquery.effects.core
2
-
3
- /*!
4
- * jQuery UI Effects Explode 1.8.24
5
- *
6
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
- * Dual licensed under the MIT or GPL Version 2 licenses.
8
- * http://jquery.org/license
9
- *
10
- * http://docs.jquery.com/UI/Effects/Explode
11
- *
12
- * Depends:
13
- * jquery.effects.core.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.effects.explode = function(o) {
18
-
19
- return this.queue(function() {
20
-
21
- var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
22
- var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
23
-
24
- o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
25
- var el = $(this).show().css('visibility', 'hidden');
26
- var offset = el.offset();
27
-
28
- //Substract the margins - not fixing the problem yet.
29
- offset.top -= parseInt(el.css("marginTop"),10) || 0;
30
- offset.left -= parseInt(el.css("marginLeft"),10) || 0;
31
-
32
- var width = el.outerWidth(true);
33
- var height = el.outerHeight(true);
34
-
35
- for(var i=0;i<rows;i++) { // =
36
- for(var j=0;j<cells;j++) { // ||
37
- el
38
- .clone()
39
- .appendTo('body')
40
- .wrap('<div></div>')
41
- .css({
42
- position: 'absolute',
43
- visibility: 'visible',
44
- left: -j*(width/cells),
45
- top: -i*(height/rows)
46
- })
47
- .parent()
48
- .addClass('ui-effects-explode')
49
- .css({
50
- position: 'absolute',
51
- overflow: 'hidden',
52
- width: width/cells,
53
- height: height/rows,
54
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
55
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
56
- opacity: o.options.mode == 'show' ? 0 : 1
57
- }).animate({
58
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
59
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
60
- opacity: o.options.mode == 'show' ? 1 : 0
61
- }, o.duration || 500);
62
- }
63
- }
64
-
65
- // Set a timeout, to call the callback approx. when the other animations have finished
66
- setTimeout(function() {
67
-
68
- o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
69
- if(o.callback) o.callback.apply(el[0]); // Callback
70
- el.dequeue();
71
-
72
- $('div.ui-effects-explode').remove();
73
-
74
- }, o.duration || 500);
75
-
76
-
77
- });
78
-
79
- };
80
-
81
- })(jQuery);
@@ -1,34 +0,0 @@
1
- //= require jquery.effects.core
2
-
3
- /*!
4
- * jQuery UI Effects Fade 1.8.24
5
- *
6
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
- * Dual licensed under the MIT or GPL Version 2 licenses.
8
- * http://jquery.org/license
9
- *
10
- * http://docs.jquery.com/UI/Effects/Fade
11
- *
12
- * Depends:
13
- * jquery.effects.core.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.effects.fade = function(o) {
18
- return this.queue(function() {
19
- var elem = $(this),
20
- mode = $.effects.setMode(elem, o.options.mode || 'hide');
21
-
22
- elem.animate({ opacity: mode }, {
23
- queue: false,
24
- duration: o.duration,
25
- easing: o.options.easing,
26
- complete: function() {
27
- (o.callback && o.callback.apply(this, arguments));
28
- elem.dequeue();
29
- }
30
- });
31
- });
32
- };
33
-
34
- })(jQuery);
@@ -1,58 +0,0 @@
1
- //= require jquery.effects.core
2
-
3
- /*!
4
- * jQuery UI Effects Fold 1.8.24
5
- *
6
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
- * Dual licensed under the MIT or GPL Version 2 licenses.
8
- * http://jquery.org/license
9
- *
10
- * http://docs.jquery.com/UI/Effects/Fold
11
- *
12
- * Depends:
13
- * jquery.effects.core.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.effects.fold = function(o) {
18
-
19
- return this.queue(function() {
20
-
21
- // Create element
22
- var el = $(this), props = ['position','top','bottom','left','right'];
23
-
24
- // Set options
25
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
26
- var size = o.options.size || 15; // Default fold size
27
- var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
28
- var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
29
-
30
- // Adjust
31
- $.effects.save(el, props); el.show(); // Save & Show
32
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
33
- var widthFirst = ((mode == 'show') != horizFirst);
34
- var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
35
- var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
36
- var percent = /([0-9]+)%/.exec(size);
37
- if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1];
38
- if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift
39
-
40
- // Animation
41
- var animation1 = {}, animation2 = {};
42
- animation1[ref[0]] = mode == 'show' ? distance[0] : size;
43
- animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
44
-
45
- // Animate
46
- wrapper.animate(animation1, duration, o.options.easing)
47
- .animate(animation2, duration, o.options.easing, function() {
48
- if(mode == 'hide') el.hide(); // Hide
49
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
50
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
51
- el.dequeue();
52
- });
53
-
54
- });
55
-
56
- };
57
-
58
- })(jQuery);
@@ -1,52 +0,0 @@
1
- //= require jquery.effects.core
2
-
3
- /*!
4
- * jQuery UI Effects Highlight 1.8.24
5
- *
6
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
- * Dual licensed under the MIT or GPL Version 2 licenses.
8
- * http://jquery.org/license
9
- *
10
- * http://docs.jquery.com/UI/Effects/Highlight
11
- *
12
- * Depends:
13
- * jquery.effects.core.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.effects.highlight = function(o) {
18
- return this.queue(function() {
19
- var elem = $(this),
20
- props = ['backgroundImage', 'backgroundColor', 'opacity'],
21
- mode = $.effects.setMode(elem, o.options.mode || 'show'),
22
- animation = {
23
- backgroundColor: elem.css('backgroundColor')
24
- };
25
-
26
- if (mode == 'hide') {
27
- animation.opacity = 0;
28
- }
29
-
30
- $.effects.save(elem, props);
31
- elem
32
- .show()
33
- .css({
34
- backgroundImage: 'none',
35
- backgroundColor: o.options.color || '#ffff99'
36
- })
37
- .animate(animation, {
38
- queue: false,
39
- duration: o.duration,
40
- easing: o.options.easing,
41
- complete: function() {
42
- (mode == 'hide' && elem.hide());
43
- $.effects.restore(elem, props);
44
- (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter'));
45
- (o.callback && o.callback.apply(this, arguments));
46
- elem.dequeue();
47
- }
48
- });
49
- });
50
- };
51
-
52
- })(jQuery);
@@ -1,53 +0,0 @@
1
- //= require jquery.effects.core
2
-
3
- /*!
4
- * jQuery UI Effects Pulsate 1.8.24
5
- *
6
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
- * Dual licensed under the MIT or GPL Version 2 licenses.
8
- * http://jquery.org/license
9
- *
10
- * http://docs.jquery.com/UI/Effects/Pulsate
11
- *
12
- * Depends:
13
- * jquery.effects.core.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.effects.pulsate = function(o) {
18
- return this.queue(function() {
19
- var elem = $(this),
20
- mode = $.effects.setMode(elem, o.options.mode || 'show'),
21
- times = ((o.options.times || 5) * 2) - 1,
22
- duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2,
23
- isVisible = elem.is(':visible'),
24
- animateTo = 0;
25
-
26
- if (!isVisible) {
27
- elem.css('opacity', 0).show();
28
- animateTo = 1;
29
- }
30
-
31
- if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) {
32
- times--;
33
- }
34
-
35
- for (var i = 0; i < times; i++) {
36
- elem.animate({ opacity: animateTo }, duration, o.options.easing);
37
- animateTo = (animateTo + 1) % 2;
38
- }
39
-
40
- elem.animate({ opacity: animateTo }, duration, o.options.easing, function() {
41
- if (animateTo == 0) {
42
- elem.hide();
43
- }
44
- (o.callback && o.callback.apply(this, arguments));
45
- });
46
-
47
- elem
48
- .queue('fx', function() { elem.dequeue(); })
49
- .dequeue();
50
- });
51
- };
52
-
53
- })(jQuery);
@@ -1,180 +0,0 @@
1
- //= require jquery.effects.core
2
-
3
- /*!
4
- * jQuery UI Effects Scale 1.8.24
5
- *
6
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
7
- * Dual licensed under the MIT or GPL Version 2 licenses.
8
- * http://jquery.org/license
9
- *
10
- * http://docs.jquery.com/UI/Effects/Scale
11
- *
12
- * Depends:
13
- * jquery.effects.core.js
14
- */
15
- (function( $, undefined ) {
16
-
17
- $.effects.puff = function(o) {
18
- return this.queue(function() {
19
- var elem = $(this),
20
- mode = $.effects.setMode(elem, o.options.mode || 'hide'),
21
- percent = parseInt(o.options.percent, 10) || 150,
22
- factor = percent / 100,
23
- original = { height: elem.height(), width: elem.width() };
24
-
25
- $.extend(o.options, {
26
- fade: true,
27
- mode: mode,
28
- percent: mode == 'hide' ? percent : 100,
29
- from: mode == 'hide'
30
- ? original
31
- : {
32
- height: original.height * factor,
33
- width: original.width * factor
34
- }
35
- });
36
-
37
- elem.effect('scale', o.options, o.duration, o.callback);
38
- elem.dequeue();
39
- });
40
- };
41
-
42
- $.effects.scale = function(o) {
43
-
44
- return this.queue(function() {
45
-
46
- // Create element
47
- var el = $(this);
48
-
49
- // Set options
50
- var options = $.extend(true, {}, o.options);
51
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
52
- var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
53
- var direction = o.options.direction || 'both'; // Set default axis
54
- var origin = o.options.origin; // The origin of the scaling
55
- if (mode != 'effect') { // Set default origin and restore for show/hide
56
- options.origin = origin || ['middle','center'];
57
- options.restore = true;
58
- }
59
- var original = {height: el.height(), width: el.width()}; // Save original
60
- el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state
61
-
62
- // Adjust
63
- var factor = { // Set scaling factor
64
- y: direction != 'horizontal' ? (percent / 100) : 1,
65
- x: direction != 'vertical' ? (percent / 100) : 1
66
- };
67
- el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state
68
-
69
- if (o.options.fade) { // Fade option to support puff
70
- if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
71
- if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
72
- };
73
-
74
- // Animation
75
- options.from = el.from; options.to = el.to; options.mode = mode;
76
-
77
- // Animate
78
- el.effect('size', options, o.duration, o.callback);
79
- el.dequeue();
80
- });
81
-
82
- };
83
-
84
- $.effects.size = function(o) {
85
-
86
- return this.queue(function() {
87
-
88
- // Create element
89
- var el = $(this), props = ['position','top','bottom','left','right','width','height','overflow','opacity'];
90
- var props1 = ['position','top','bottom','left','right','overflow','opacity']; // Always restore
91
- var props2 = ['width','height','overflow']; // Copy for children
92
- var cProps = ['fontSize'];
93
- var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
94
- var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];
95
-
96
- // Set options
97
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
98
- var restore = o.options.restore || false; // Default restore
99
- var scale = o.options.scale || 'both'; // Default scale mode
100
- var origin = o.options.origin; // The origin of the sizing
101
- var original = {height: el.height(), width: el.width()}; // Save original
102
- el.from = o.options.from || original; // Default from state
103
- el.to = o.options.to || original; // Default to state
104
- // Adjust
105
- if (origin) { // Calculate baseline shifts
106
- var baseline = $.effects.getBaseline(origin, original);
107
- el.from.top = (original.height - el.from.height) * baseline.y;
108
- el.from.left = (original.width - el.from.width) * baseline.x;
109
- el.to.top = (original.height - el.to.height) * baseline.y;
110
- el.to.left = (original.width - el.to.width) * baseline.x;
111
- };
112
- var factor = { // Set scaling factor
113
- from: {y: el.from.height / original.height, x: el.from.width / original.width},
114
- to: {y: el.to.height / original.height, x: el.to.width / original.width}
115
- };
116
- if (scale == 'box' || scale == 'both') { // Scale the css box
117
- if (factor.from.y != factor.to.y) { // Vertical props scaling
118
- props = props.concat(vProps);
119
- el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
120
- el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
121
- };
122
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
123
- props = props.concat(hProps);
124
- el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
125
- el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
126
- };
127
- };
128
- if (scale == 'content' || scale == 'both') { // Scale the content
129
- if (factor.from.y != factor.to.y) { // Vertical props scaling
130
- props = props.concat(cProps);
131
- el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
132
- el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
133
- };
134
- };
135
- $.effects.save(el, restore ? props : props1); el.show(); // Save & Show
136
- $.effects.createWrapper(el); // Create Wrapper
137
- el.css('overflow','hidden').css(el.from); // Shift
138
-
139
- // Animate
140
- if (scale == 'content' || scale == 'both') { // Scale the children
141
- vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
142
- hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
143
- props2 = props.concat(vProps).concat(hProps); // Concat
144
- el.find("*[width]").each(function(){
145
- var child = $(this);
146
- if (restore) $.effects.save(child, props2);
147
- var c_original = {height: child.height(), width: child.width()}; // Save original
148
- child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
149
- child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
150
- if (factor.from.y != factor.to.y) { // Vertical props scaling
151
- child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
152
- child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
153
- };
154
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
155
- child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
156
- child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
157
- };
158
- child.css(child.from); // Shift children
159
- child.animate(child.to, o.duration, o.options.easing, function(){
160
- if (restore) $.effects.restore(child, props2); // Restore children
161
- }); // Animate children
162
- });
163
- };
164
-
165
- // Animate
166
- el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
167
- if (el.to.opacity === 0) {
168
- el.css('opacity', el.from.opacity);
169
- }
170
- if(mode == 'hide') el.hide(); // Hide
171
- $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
172
- if(o.callback) o.callback.apply(this, arguments); // Callback
173
- el.dequeue();
174
- }});
175
-
176
- });
177
-
178
- };
179
-
180
- })(jQuery);