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.
- data/History.md +15 -0
- data/License.txt +2 -3
- data/README.md +17 -19
- data/Rakefile +79 -28
- data/lib/jquery/ui/rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.ui.accordion.js +537 -417
- data/vendor/assets/javascripts/jquery.ui.all.js +17 -14
- data/vendor/assets/javascripts/jquery.ui.autocomplete.js +311 -339
- data/vendor/assets/javascripts/jquery.ui.button.js +63 -59
- data/vendor/assets/javascripts/jquery.ui.core.js +134 -112
- data/vendor/assets/javascripts/jquery.ui.datepicker-ar-DZ.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-ar.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-az.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-bg.js +16 -16
- data/vendor/assets/javascripts/jquery.ui.datepicker-bs.js +5 -5
- data/vendor/assets/javascripts/jquery.ui.datepicker-ca.js +13 -13
- data/vendor/assets/javascripts/jquery.ui.datepicker-cs.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-cy-GB.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-da.js +9 -9
- data/vendor/assets/javascripts/jquery.ui.datepicker-de.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-el.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-eo.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-es.js +6 -6
- data/vendor/assets/javascripts/jquery.ui.datepicker-et.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-eu.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-fa.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-fi.js +5 -5
- data/vendor/assets/javascripts/jquery.ui.datepicker-fo.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-fr-CH.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-fr.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-gl.js +6 -6
- data/vendor/assets/javascripts/jquery.ui.datepicker-he.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-hr.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-hy.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-id.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-is.js +11 -11
- data/vendor/assets/javascripts/jquery.ui.datepicker-it.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-ja.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-kk.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-ko.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-lt.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-lv.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-ml.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-ms.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-nl.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-no.js +18 -18
- data/vendor/assets/javascripts/jquery.ui.datepicker-pl.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-pt-BR.js +7 -7
- data/vendor/assets/javascripts/jquery.ui.datepicker-pt.js +6 -6
- data/vendor/assets/javascripts/jquery.ui.datepicker-rm.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-ro.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-ru.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-sk.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-sl.js +6 -6
- data/vendor/assets/javascripts/jquery.ui.datepicker-sq.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-sr-SR.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-sr.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-sv.js +9 -9
- data/vendor/assets/javascripts/jquery.ui.datepicker-th.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-tj.js +1 -1
- data/vendor/assets/javascripts/jquery.ui.datepicker-tr.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-uk.js +3 -3
- data/vendor/assets/javascripts/jquery.ui.datepicker-vi.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-zh-CN.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-zh-HK.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker-zh-TW.js +2 -2
- data/vendor/assets/javascripts/jquery.ui.datepicker.js +51 -59
- data/vendor/assets/javascripts/jquery.ui.dialog.js +402 -409
- data/vendor/assets/javascripts/jquery.ui.draggable.js +79 -75
- data/vendor/assets/javascripts/jquery.ui.droppable.js +10 -17
- data/vendor/assets/javascripts/jquery.ui.effect-blind.js +84 -0
- data/vendor/assets/javascripts/jquery.ui.effect-bounce.js +115 -0
- data/vendor/assets/javascripts/jquery.ui.effect-clip.js +69 -0
- data/vendor/assets/javascripts/jquery.ui.effect-drop.js +67 -0
- data/vendor/assets/javascripts/jquery.ui.effect-explode.js +99 -0
- data/vendor/assets/javascripts/jquery.ui.effect-fade.js +32 -0
- data/vendor/assets/javascripts/jquery.ui.effect-fold.js +78 -0
- data/vendor/assets/javascripts/jquery.ui.effect-highlight.js +52 -0
- data/vendor/assets/javascripts/jquery.ui.effect-pulsate.js +65 -0
- data/vendor/assets/javascripts/jquery.ui.effect-scale.js +320 -0
- data/vendor/assets/javascripts/jquery.ui.effect-shake.js +76 -0
- data/vendor/assets/javascripts/jquery.ui.effect-slide.js +66 -0
- data/vendor/assets/javascripts/jquery.ui.effect-transfer.js +49 -0
- data/vendor/assets/javascripts/jquery.ui.effect.all.js +14 -0
- data/vendor/assets/javascripts/jquery.ui.effect.js +1276 -0
- data/vendor/assets/javascripts/jquery.ui.menu.js +614 -0
- data/vendor/assets/javascripts/jquery.ui.mouse.js +22 -20
- data/vendor/assets/javascripts/jquery.ui.position.js +367 -158
- data/vendor/assets/javascripts/jquery.ui.progressbar.js +10 -14
- data/vendor/assets/javascripts/jquery.ui.resizable.js +143 -149
- data/vendor/assets/javascripts/jquery.ui.selectable.js +22 -28
- data/vendor/assets/javascripts/jquery.ui.slider.js +88 -106
- data/vendor/assets/javascripts/jquery.ui.sortable.js +97 -95
- data/vendor/assets/javascripts/jquery.ui.spinner.js +482 -0
- data/vendor/assets/javascripts/jquery.ui.tabs.js +1189 -580
- data/vendor/assets/javascripts/jquery.ui.tooltip.js +402 -0
- data/vendor/assets/javascripts/jquery.ui.widget.js +373 -117
- data/vendor/assets/stylesheets/jquery.ui.accordion.css.erb +10 -13
- data/vendor/assets/stylesheets/jquery.ui.all.css.erb +4 -3
- data/vendor/assets/stylesheets/jquery.ui.autocomplete.css.erb +10 -44
- data/vendor/assets/stylesheets/jquery.ui.base.css.erb +7 -3
- data/vendor/assets/stylesheets/jquery.ui.button.css.erb +6 -4
- data/vendor/assets/stylesheets/jquery.ui.core.css.erb +5 -4
- data/vendor/assets/stylesheets/jquery.ui.datepicker.css.erb +4 -3
- data/vendor/assets/stylesheets/jquery.ui.dialog.css.erb +6 -5
- data/vendor/assets/stylesheets/jquery.ui.menu.css.erb +34 -0
- data/vendor/assets/stylesheets/jquery.ui.progressbar.css.erb +4 -3
- data/vendor/assets/stylesheets/jquery.ui.resizable.css.erb +4 -3
- data/vendor/assets/stylesheets/jquery.ui.selectable.css.erb +4 -3
- data/vendor/assets/stylesheets/jquery.ui.slider.css.erb +4 -3
- data/vendor/assets/stylesheets/jquery.ui.spinner.css.erb +27 -0
- data/vendor/assets/stylesheets/jquery.ui.tabs.css.erb +8 -8
- data/vendor/assets/stylesheets/jquery.ui.theme.css.erb +8 -7
- data/vendor/assets/stylesheets/jquery.ui.tooltip.css.erb +25 -0
- metadata +24 -19
- data/dependencies.js +0 -31
- data/vendor/assets/javascripts/jquery.effects.all.js +0 -14
- data/vendor/assets/javascripts/jquery.effects.blind.js +0 -51
- data/vendor/assets/javascripts/jquery.effects.bounce.js +0 -80
- data/vendor/assets/javascripts/jquery.effects.clip.js +0 -56
- data/vendor/assets/javascripts/jquery.effects.core.js +0 -612
- data/vendor/assets/javascripts/jquery.effects.drop.js +0 -52
- data/vendor/assets/javascripts/jquery.effects.explode.js +0 -81
- data/vendor/assets/javascripts/jquery.effects.fade.js +0 -34
- data/vendor/assets/javascripts/jquery.effects.fold.js +0 -58
- data/vendor/assets/javascripts/jquery.effects.highlight.js +0 -52
- data/vendor/assets/javascripts/jquery.effects.pulsate.js +0 -53
- data/vendor/assets/javascripts/jquery.effects.scale.js +0 -180
- data/vendor/assets/javascripts/jquery.effects.shake.js +0 -59
- data/vendor/assets/javascripts/jquery.effects.slide.js +0 -52
- data/vendor/assets/javascripts/jquery.effects.transfer.js +0 -47
@@ -0,0 +1,52 @@
|
|
1
|
+
//= require jquery.ui.effect
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI Effects Highlight 1.9.2
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright 2012 jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*
|
11
|
+
* http://api.jqueryui.com/highlight-effect/
|
12
|
+
*
|
13
|
+
* Depends:
|
14
|
+
* jquery.ui.effect.js
|
15
|
+
*/
|
16
|
+
(function( $, undefined ) {
|
17
|
+
|
18
|
+
$.effects.effect.highlight = function( o, done ) {
|
19
|
+
var elem = $( this ),
|
20
|
+
props = [ "backgroundImage", "backgroundColor", "opacity" ],
|
21
|
+
mode = $.effects.setMode( elem, o.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
|
+
|
32
|
+
elem
|
33
|
+
.show()
|
34
|
+
.css({
|
35
|
+
backgroundImage: "none",
|
36
|
+
backgroundColor: o.color || "#ffff99"
|
37
|
+
})
|
38
|
+
.animate( animation, {
|
39
|
+
queue: false,
|
40
|
+
duration: o.duration,
|
41
|
+
easing: o.easing,
|
42
|
+
complete: function() {
|
43
|
+
if ( mode === "hide" ) {
|
44
|
+
elem.hide();
|
45
|
+
}
|
46
|
+
$.effects.restore( elem, props );
|
47
|
+
done();
|
48
|
+
}
|
49
|
+
});
|
50
|
+
};
|
51
|
+
|
52
|
+
})(jQuery);
|
@@ -0,0 +1,65 @@
|
|
1
|
+
//= require jquery.ui.effect
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI Effects Pulsate 1.9.2
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright 2012 jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*
|
11
|
+
* http://api.jqueryui.com/pulsate-effect/
|
12
|
+
*
|
13
|
+
* Depends:
|
14
|
+
* jquery.ui.effect.js
|
15
|
+
*/
|
16
|
+
(function( $, undefined ) {
|
17
|
+
|
18
|
+
$.effects.effect.pulsate = function( o, done ) {
|
19
|
+
var elem = $( this ),
|
20
|
+
mode = $.effects.setMode( elem, o.mode || "show" ),
|
21
|
+
show = mode === "show",
|
22
|
+
hide = mode === "hide",
|
23
|
+
showhide = ( show || mode === "hide" ),
|
24
|
+
|
25
|
+
// showing or hiding leaves of the "last" animation
|
26
|
+
anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
|
27
|
+
duration = o.duration / anims,
|
28
|
+
animateTo = 0,
|
29
|
+
queue = elem.queue(),
|
30
|
+
queuelen = queue.length,
|
31
|
+
i;
|
32
|
+
|
33
|
+
if ( show || !elem.is(":visible")) {
|
34
|
+
elem.css( "opacity", 0 ).show();
|
35
|
+
animateTo = 1;
|
36
|
+
}
|
37
|
+
|
38
|
+
// anims - 1 opacity "toggles"
|
39
|
+
for ( i = 1; i < anims; i++ ) {
|
40
|
+
elem.animate({
|
41
|
+
opacity: animateTo
|
42
|
+
}, duration, o.easing );
|
43
|
+
animateTo = 1 - animateTo;
|
44
|
+
}
|
45
|
+
|
46
|
+
elem.animate({
|
47
|
+
opacity: animateTo
|
48
|
+
}, duration, o.easing);
|
49
|
+
|
50
|
+
elem.queue(function() {
|
51
|
+
if ( hide ) {
|
52
|
+
elem.hide();
|
53
|
+
}
|
54
|
+
done();
|
55
|
+
});
|
56
|
+
|
57
|
+
// We just queued up "anims" animations, we need to put them next in the queue
|
58
|
+
if ( queuelen > 1 ) {
|
59
|
+
queue.splice.apply( queue,
|
60
|
+
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
|
61
|
+
}
|
62
|
+
elem.dequeue();
|
63
|
+
};
|
64
|
+
|
65
|
+
})(jQuery);
|
@@ -0,0 +1,320 @@
|
|
1
|
+
//= require jquery.ui.effect
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI Effects Scale 1.9.2
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright 2012 jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*
|
11
|
+
* http://api.jqueryui.com/scale-effect/
|
12
|
+
*
|
13
|
+
* Depends:
|
14
|
+
* jquery.ui.effect.js
|
15
|
+
*/
|
16
|
+
(function( $, undefined ) {
|
17
|
+
|
18
|
+
$.effects.effect.puff = function( o, done ) {
|
19
|
+
var elem = $( this ),
|
20
|
+
mode = $.effects.setMode( elem, o.mode || "hide" ),
|
21
|
+
hide = mode === "hide",
|
22
|
+
percent = parseInt( o.percent, 10 ) || 150,
|
23
|
+
factor = percent / 100,
|
24
|
+
original = {
|
25
|
+
height: elem.height(),
|
26
|
+
width: elem.width(),
|
27
|
+
outerHeight: elem.outerHeight(),
|
28
|
+
outerWidth: elem.outerWidth()
|
29
|
+
};
|
30
|
+
|
31
|
+
$.extend( o, {
|
32
|
+
effect: "scale",
|
33
|
+
queue: false,
|
34
|
+
fade: true,
|
35
|
+
mode: mode,
|
36
|
+
complete: done,
|
37
|
+
percent: hide ? percent : 100,
|
38
|
+
from: hide ?
|
39
|
+
original :
|
40
|
+
{
|
41
|
+
height: original.height * factor,
|
42
|
+
width: original.width * factor,
|
43
|
+
outerHeight: original.outerHeight * factor,
|
44
|
+
outerWidth: original.outerWidth * factor
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
elem.effect( o );
|
49
|
+
};
|
50
|
+
|
51
|
+
$.effects.effect.scale = function( o, done ) {
|
52
|
+
|
53
|
+
// Create element
|
54
|
+
var el = $( this ),
|
55
|
+
options = $.extend( true, {}, o ),
|
56
|
+
mode = $.effects.setMode( el, o.mode || "effect" ),
|
57
|
+
percent = parseInt( o.percent, 10 ) ||
|
58
|
+
( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
|
59
|
+
direction = o.direction || "both",
|
60
|
+
origin = o.origin,
|
61
|
+
original = {
|
62
|
+
height: el.height(),
|
63
|
+
width: el.width(),
|
64
|
+
outerHeight: el.outerHeight(),
|
65
|
+
outerWidth: el.outerWidth()
|
66
|
+
},
|
67
|
+
factor = {
|
68
|
+
y: direction !== "horizontal" ? (percent / 100) : 1,
|
69
|
+
x: direction !== "vertical" ? (percent / 100) : 1
|
70
|
+
};
|
71
|
+
|
72
|
+
// We are going to pass this effect to the size effect:
|
73
|
+
options.effect = "size";
|
74
|
+
options.queue = false;
|
75
|
+
options.complete = done;
|
76
|
+
|
77
|
+
// Set default origin and restore for show/hide
|
78
|
+
if ( mode !== "effect" ) {
|
79
|
+
options.origin = origin || ["middle","center"];
|
80
|
+
options.restore = true;
|
81
|
+
}
|
82
|
+
|
83
|
+
options.from = o.from || ( mode === "show" ? {
|
84
|
+
height: 0,
|
85
|
+
width: 0,
|
86
|
+
outerHeight: 0,
|
87
|
+
outerWidth: 0
|
88
|
+
} : original );
|
89
|
+
options.to = {
|
90
|
+
height: original.height * factor.y,
|
91
|
+
width: original.width * factor.x,
|
92
|
+
outerHeight: original.outerHeight * factor.y,
|
93
|
+
outerWidth: original.outerWidth * factor.x
|
94
|
+
};
|
95
|
+
|
96
|
+
// Fade option to support puff
|
97
|
+
if ( options.fade ) {
|
98
|
+
if ( mode === "show" ) {
|
99
|
+
options.from.opacity = 0;
|
100
|
+
options.to.opacity = 1;
|
101
|
+
}
|
102
|
+
if ( mode === "hide" ) {
|
103
|
+
options.from.opacity = 1;
|
104
|
+
options.to.opacity = 0;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
// Animate
|
109
|
+
el.effect( options );
|
110
|
+
|
111
|
+
};
|
112
|
+
|
113
|
+
$.effects.effect.size = function( o, done ) {
|
114
|
+
|
115
|
+
// Create element
|
116
|
+
var original, baseline, factor,
|
117
|
+
el = $( this ),
|
118
|
+
props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
|
119
|
+
|
120
|
+
// Always restore
|
121
|
+
props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
|
122
|
+
|
123
|
+
// Copy for children
|
124
|
+
props2 = [ "width", "height", "overflow" ],
|
125
|
+
cProps = [ "fontSize" ],
|
126
|
+
vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
|
127
|
+
hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
|
128
|
+
|
129
|
+
// Set options
|
130
|
+
mode = $.effects.setMode( el, o.mode || "effect" ),
|
131
|
+
restore = o.restore || mode !== "effect",
|
132
|
+
scale = o.scale || "both",
|
133
|
+
origin = o.origin || [ "middle", "center" ],
|
134
|
+
position = el.css( "position" ),
|
135
|
+
props = restore ? props0 : props1,
|
136
|
+
zero = {
|
137
|
+
height: 0,
|
138
|
+
width: 0,
|
139
|
+
outerHeight: 0,
|
140
|
+
outerWidth: 0
|
141
|
+
};
|
142
|
+
|
143
|
+
if ( mode === "show" ) {
|
144
|
+
el.show();
|
145
|
+
}
|
146
|
+
original = {
|
147
|
+
height: el.height(),
|
148
|
+
width: el.width(),
|
149
|
+
outerHeight: el.outerHeight(),
|
150
|
+
outerWidth: el.outerWidth()
|
151
|
+
};
|
152
|
+
|
153
|
+
if ( o.mode === "toggle" && mode === "show" ) {
|
154
|
+
el.from = o.to || zero;
|
155
|
+
el.to = o.from || original;
|
156
|
+
} else {
|
157
|
+
el.from = o.from || ( mode === "show" ? zero : original );
|
158
|
+
el.to = o.to || ( mode === "hide" ? zero : original );
|
159
|
+
}
|
160
|
+
|
161
|
+
// Set scaling factor
|
162
|
+
factor = {
|
163
|
+
from: {
|
164
|
+
y: el.from.height / original.height,
|
165
|
+
x: el.from.width / original.width
|
166
|
+
},
|
167
|
+
to: {
|
168
|
+
y: el.to.height / original.height,
|
169
|
+
x: el.to.width / original.width
|
170
|
+
}
|
171
|
+
};
|
172
|
+
|
173
|
+
// Scale the css box
|
174
|
+
if ( scale === "box" || scale === "both" ) {
|
175
|
+
|
176
|
+
// Vertical props scaling
|
177
|
+
if ( factor.from.y !== factor.to.y ) {
|
178
|
+
props = props.concat( vProps );
|
179
|
+
el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
|
180
|
+
el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
|
181
|
+
}
|
182
|
+
|
183
|
+
// Horizontal props scaling
|
184
|
+
if ( factor.from.x !== factor.to.x ) {
|
185
|
+
props = props.concat( hProps );
|
186
|
+
el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
|
187
|
+
el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
// Scale the content
|
192
|
+
if ( scale === "content" || scale === "both" ) {
|
193
|
+
|
194
|
+
// Vertical props scaling
|
195
|
+
if ( factor.from.y !== factor.to.y ) {
|
196
|
+
props = props.concat( cProps ).concat( props2 );
|
197
|
+
el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
|
198
|
+
el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
$.effects.save( el, props );
|
203
|
+
el.show();
|
204
|
+
$.effects.createWrapper( el );
|
205
|
+
el.css( "overflow", "hidden" ).css( el.from );
|
206
|
+
|
207
|
+
// Adjust
|
208
|
+
if (origin) { // Calculate baseline shifts
|
209
|
+
baseline = $.effects.getBaseline( origin, original );
|
210
|
+
el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
|
211
|
+
el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
|
212
|
+
el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
|
213
|
+
el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
|
214
|
+
}
|
215
|
+
el.css( el.from ); // set top & left
|
216
|
+
|
217
|
+
// Animate
|
218
|
+
if ( scale === "content" || scale === "both" ) { // Scale the children
|
219
|
+
|
220
|
+
// Add margins/font-size
|
221
|
+
vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
|
222
|
+
hProps = hProps.concat([ "marginLeft", "marginRight" ]);
|
223
|
+
props2 = props0.concat(vProps).concat(hProps);
|
224
|
+
|
225
|
+
el.find( "*[width]" ).each( function(){
|
226
|
+
var child = $( this ),
|
227
|
+
c_original = {
|
228
|
+
height: child.height(),
|
229
|
+
width: child.width(),
|
230
|
+
outerHeight: child.outerHeight(),
|
231
|
+
outerWidth: child.outerWidth()
|
232
|
+
};
|
233
|
+
if (restore) {
|
234
|
+
$.effects.save(child, props2);
|
235
|
+
}
|
236
|
+
|
237
|
+
child.from = {
|
238
|
+
height: c_original.height * factor.from.y,
|
239
|
+
width: c_original.width * factor.from.x,
|
240
|
+
outerHeight: c_original.outerHeight * factor.from.y,
|
241
|
+
outerWidth: c_original.outerWidth * factor.from.x
|
242
|
+
};
|
243
|
+
child.to = {
|
244
|
+
height: c_original.height * factor.to.y,
|
245
|
+
width: c_original.width * factor.to.x,
|
246
|
+
outerHeight: c_original.height * factor.to.y,
|
247
|
+
outerWidth: c_original.width * factor.to.x
|
248
|
+
};
|
249
|
+
|
250
|
+
// Vertical props scaling
|
251
|
+
if ( factor.from.y !== factor.to.y ) {
|
252
|
+
child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
|
253
|
+
child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
|
254
|
+
}
|
255
|
+
|
256
|
+
// Horizontal props scaling
|
257
|
+
if ( factor.from.x !== factor.to.x ) {
|
258
|
+
child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
|
259
|
+
child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
|
260
|
+
}
|
261
|
+
|
262
|
+
// Animate children
|
263
|
+
child.css( child.from );
|
264
|
+
child.animate( child.to, o.duration, o.easing, function() {
|
265
|
+
|
266
|
+
// Restore children
|
267
|
+
if ( restore ) {
|
268
|
+
$.effects.restore( child, props2 );
|
269
|
+
}
|
270
|
+
});
|
271
|
+
});
|
272
|
+
}
|
273
|
+
|
274
|
+
// Animate
|
275
|
+
el.animate( el.to, {
|
276
|
+
queue: false,
|
277
|
+
duration: o.duration,
|
278
|
+
easing: o.easing,
|
279
|
+
complete: function() {
|
280
|
+
if ( el.to.opacity === 0 ) {
|
281
|
+
el.css( "opacity", el.from.opacity );
|
282
|
+
}
|
283
|
+
if( mode === "hide" ) {
|
284
|
+
el.hide();
|
285
|
+
}
|
286
|
+
$.effects.restore( el, props );
|
287
|
+
if ( !restore ) {
|
288
|
+
|
289
|
+
// we need to calculate our new positioning based on the scaling
|
290
|
+
if ( position === "static" ) {
|
291
|
+
el.css({
|
292
|
+
position: "relative",
|
293
|
+
top: el.to.top,
|
294
|
+
left: el.to.left
|
295
|
+
});
|
296
|
+
} else {
|
297
|
+
$.each([ "top", "left" ], function( idx, pos ) {
|
298
|
+
el.css( pos, function( _, str ) {
|
299
|
+
var val = parseInt( str, 10 ),
|
300
|
+
toRef = idx ? el.to.left : el.to.top;
|
301
|
+
|
302
|
+
// if original was "auto", recalculate the new value from wrapper
|
303
|
+
if ( str === "auto" ) {
|
304
|
+
return toRef + "px";
|
305
|
+
}
|
306
|
+
|
307
|
+
return val + toRef + "px";
|
308
|
+
});
|
309
|
+
});
|
310
|
+
}
|
311
|
+
}
|
312
|
+
|
313
|
+
$.effects.removeWrapper( el );
|
314
|
+
done();
|
315
|
+
}
|
316
|
+
});
|
317
|
+
|
318
|
+
};
|
319
|
+
|
320
|
+
})(jQuery);
|
@@ -0,0 +1,76 @@
|
|
1
|
+
//= require jquery.ui.effect
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI Effects Shake 1.9.2
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright 2012 jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*
|
11
|
+
* http://api.jqueryui.com/shake-effect/
|
12
|
+
*
|
13
|
+
* Depends:
|
14
|
+
* jquery.ui.effect.js
|
15
|
+
*/
|
16
|
+
(function( $, undefined ) {
|
17
|
+
|
18
|
+
$.effects.effect.shake = function( o, done ) {
|
19
|
+
|
20
|
+
var el = $( this ),
|
21
|
+
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
|
22
|
+
mode = $.effects.setMode( el, o.mode || "effect" ),
|
23
|
+
direction = o.direction || "left",
|
24
|
+
distance = o.distance || 20,
|
25
|
+
times = o.times || 3,
|
26
|
+
anims = times * 2 + 1,
|
27
|
+
speed = Math.round(o.duration/anims),
|
28
|
+
ref = (direction === "up" || direction === "down") ? "top" : "left",
|
29
|
+
positiveMotion = (direction === "up" || direction === "left"),
|
30
|
+
animation = {},
|
31
|
+
animation1 = {},
|
32
|
+
animation2 = {},
|
33
|
+
i,
|
34
|
+
|
35
|
+
// we will need to re-assemble the queue to stack our animations in place
|
36
|
+
queue = el.queue(),
|
37
|
+
queuelen = queue.length;
|
38
|
+
|
39
|
+
$.effects.save( el, props );
|
40
|
+
el.show();
|
41
|
+
$.effects.createWrapper( el );
|
42
|
+
|
43
|
+
// Animation
|
44
|
+
animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
|
45
|
+
animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
|
46
|
+
animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
|
47
|
+
|
48
|
+
// Animate
|
49
|
+
el.animate( animation, speed, o.easing );
|
50
|
+
|
51
|
+
// Shakes
|
52
|
+
for ( i = 1; i < times; i++ ) {
|
53
|
+
el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
|
54
|
+
}
|
55
|
+
el
|
56
|
+
.animate( animation1, speed, o.easing )
|
57
|
+
.animate( animation, speed / 2, o.easing )
|
58
|
+
.queue(function() {
|
59
|
+
if ( mode === "hide" ) {
|
60
|
+
el.hide();
|
61
|
+
}
|
62
|
+
$.effects.restore( el, props );
|
63
|
+
$.effects.removeWrapper( el );
|
64
|
+
done();
|
65
|
+
});
|
66
|
+
|
67
|
+
// inject all the animations we just queued to be first in line (after "inprogress")
|
68
|
+
if ( queuelen > 1) {
|
69
|
+
queue.splice.apply( queue,
|
70
|
+
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
|
71
|
+
}
|
72
|
+
el.dequeue();
|
73
|
+
|
74
|
+
};
|
75
|
+
|
76
|
+
})(jQuery);
|