jqueryui-requirejs-rails 0.1.0

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