jqueryui-requirejs-rails 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,67 @@
1
+ define(['jquery','./effect'], function (jQuery) {
2
+ /*!
3
+ * jQuery UI Effects Slide 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/slide-effect/
11
+ *
12
+ * Depends:
13
+ * jquery.ui.effect.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ $.effects.effect.slide = function( o, done ) {
18
+
19
+ // Create element
20
+ var el = $( this ),
21
+ props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
22
+ mode = $.effects.setMode( el, o.mode || "show" ),
23
+ show = mode === "show",
24
+ direction = o.direction || "left",
25
+ ref = (direction === "up" || direction === "down") ? "top" : "left",
26
+ positiveMotion = (direction === "up" || direction === "left"),
27
+ distance,
28
+ animation = {};
29
+
30
+ // Adjust
31
+ $.effects.save( el, props );
32
+ el.show();
33
+ distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
34
+
35
+ $.effects.createWrapper( el ).css({
36
+ overflow: "hidden"
37
+ });
38
+
39
+ if ( show ) {
40
+ el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
41
+ }
42
+
43
+ // Animation
44
+ animation[ ref ] = ( show ?
45
+ ( positiveMotion ? "+=" : "-=") :
46
+ ( positiveMotion ? "-=" : "+=")) +
47
+ distance;
48
+
49
+ // Animate
50
+ el.animate( animation, {
51
+ queue: false,
52
+ duration: o.duration,
53
+ easing: o.easing,
54
+ complete: function() {
55
+ if ( mode === "hide" ) {
56
+ el.hide();
57
+ }
58
+ $.effects.restore( el, props );
59
+ $.effects.removeWrapper( el );
60
+ done();
61
+ }
62
+ });
63
+ };
64
+
65
+ })(jQuery);
66
+
67
+ });
@@ -0,0 +1,50 @@
1
+ define(['jquery','./effect'], function (jQuery) {
2
+ /*!
3
+ * jQuery UI Effects Transfer 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/transfer-effect/
11
+ *
12
+ * Depends:
13
+ * jquery.ui.effect.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ $.effects.effect.transfer = function( o, done ) {
18
+ var elem = $( this ),
19
+ target = $( o.to ),
20
+ targetFixed = target.css( "position" ) === "fixed",
21
+ body = $("body"),
22
+ fixTop = targetFixed ? body.scrollTop() : 0,
23
+ fixLeft = targetFixed ? body.scrollLeft() : 0,
24
+ endPosition = target.offset(),
25
+ animation = {
26
+ top: endPosition.top - fixTop ,
27
+ left: endPosition.left - fixLeft ,
28
+ height: target.innerHeight(),
29
+ width: target.innerWidth()
30
+ },
31
+ startPosition = elem.offset(),
32
+ transfer = $( "<div class='ui-effects-transfer'></div>" )
33
+ .appendTo( document.body )
34
+ .addClass( o.className )
35
+ .css({
36
+ top: startPosition.top - fixTop ,
37
+ left: startPosition.left - fixLeft ,
38
+ height: elem.innerHeight(),
39
+ width: elem.innerWidth(),
40
+ position: targetFixed ? "fixed" : "absolute"
41
+ })
42
+ .animate( animation, o.duration, o.easing, function() {
43
+ transfer.remove();
44
+ done();
45
+ });
46
+ };
47
+
48
+ })(jQuery);
49
+
50
+ });
@@ -0,0 +1,1292 @@
1
+ define(['jquery'], function (jQuery) {
2
+ /*!
3
+ * jQuery UI Effects 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/category/effects-core/
11
+ */
12
+ (function($, undefined) {
13
+
14
+ var dataSpace = "ui-effects-";
15
+
16
+ $.effects = {
17
+ effect: {}
18
+ };
19
+
20
+ /*!
21
+ * jQuery Color Animations v2.1.2
22
+ * https://github.com/jquery/jquery-color
23
+ *
24
+ * Copyright 2013 jQuery Foundation and other contributors
25
+ * Released under the MIT license.
26
+ * http://jquery.org/license
27
+ *
28
+ * Date: Wed Jan 16 08:47:09 2013 -0600
29
+ */
30
+ (function( jQuery, undefined ) {
31
+
32
+ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
33
+
34
+ // plusequals test for += 100 -= 100
35
+ rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
36
+ // a set of RE's that can match strings and generate color tuples.
37
+ stringParsers = [{
38
+ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
39
+ parse: function( execResult ) {
40
+ return [
41
+ execResult[ 1 ],
42
+ execResult[ 2 ],
43
+ execResult[ 3 ],
44
+ execResult[ 4 ]
45
+ ];
46
+ }
47
+ }, {
48
+ re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
49
+ parse: function( execResult ) {
50
+ return [
51
+ execResult[ 1 ] * 2.55,
52
+ execResult[ 2 ] * 2.55,
53
+ execResult[ 3 ] * 2.55,
54
+ execResult[ 4 ]
55
+ ];
56
+ }
57
+ }, {
58
+ // this regex ignores A-F because it's compared against an already lowercased string
59
+ re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
60
+ parse: function( execResult ) {
61
+ return [
62
+ parseInt( execResult[ 1 ], 16 ),
63
+ parseInt( execResult[ 2 ], 16 ),
64
+ parseInt( execResult[ 3 ], 16 )
65
+ ];
66
+ }
67
+ }, {
68
+ // this regex ignores A-F because it's compared against an already lowercased string
69
+ re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
70
+ parse: function( execResult ) {
71
+ return [
72
+ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
73
+ parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
74
+ parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
75
+ ];
76
+ }
77
+ }, {
78
+ re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
79
+ space: "hsla",
80
+ parse: function( execResult ) {
81
+ return [
82
+ execResult[ 1 ],
83
+ execResult[ 2 ] / 100,
84
+ execResult[ 3 ] / 100,
85
+ execResult[ 4 ]
86
+ ];
87
+ }
88
+ }],
89
+
90
+ // jQuery.Color( )
91
+ color = jQuery.Color = function( color, green, blue, alpha ) {
92
+ return new jQuery.Color.fn.parse( color, green, blue, alpha );
93
+ },
94
+ spaces = {
95
+ rgba: {
96
+ props: {
97
+ red: {
98
+ idx: 0,
99
+ type: "byte"
100
+ },
101
+ green: {
102
+ idx: 1,
103
+ type: "byte"
104
+ },
105
+ blue: {
106
+ idx: 2,
107
+ type: "byte"
108
+ }
109
+ }
110
+ },
111
+
112
+ hsla: {
113
+ props: {
114
+ hue: {
115
+ idx: 0,
116
+ type: "degrees"
117
+ },
118
+ saturation: {
119
+ idx: 1,
120
+ type: "percent"
121
+ },
122
+ lightness: {
123
+ idx: 2,
124
+ type: "percent"
125
+ }
126
+ }
127
+ }
128
+ },
129
+ propTypes = {
130
+ "byte": {
131
+ floor: true,
132
+ max: 255
133
+ },
134
+ "percent": {
135
+ max: 1
136
+ },
137
+ "degrees": {
138
+ mod: 360,
139
+ floor: true
140
+ }
141
+ },
142
+ support = color.support = {},
143
+
144
+ // element for support tests
145
+ supportElem = jQuery( "<p>" )[ 0 ],
146
+
147
+ // colors = jQuery.Color.names
148
+ colors,
149
+
150
+ // local aliases of functions called often
151
+ each = jQuery.each;
152
+
153
+ // determine rgba support immediately
154
+ supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
155
+ support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
156
+
157
+ // define cache name and alpha properties
158
+ // for rgba and hsla spaces
159
+ each( spaces, function( spaceName, space ) {
160
+ space.cache = "_" + spaceName;
161
+ space.props.alpha = {
162
+ idx: 3,
163
+ type: "percent",
164
+ def: 1
165
+ };
166
+ });
167
+
168
+ function clamp( value, prop, allowEmpty ) {
169
+ var type = propTypes[ prop.type ] || {};
170
+
171
+ if ( value == null ) {
172
+ return (allowEmpty || !prop.def) ? null : prop.def;
173
+ }
174
+
175
+ // ~~ is an short way of doing floor for positive numbers
176
+ value = type.floor ? ~~value : parseFloat( value );
177
+
178
+ // IE will pass in empty strings as value for alpha,
179
+ // which will hit this case
180
+ if ( isNaN( value ) ) {
181
+ return prop.def;
182
+ }
183
+
184
+ if ( type.mod ) {
185
+ // we add mod before modding to make sure that negatives values
186
+ // get converted properly: -10 -> 350
187
+ return (value + type.mod) % type.mod;
188
+ }
189
+
190
+ // for now all property types without mod have min and max
191
+ return 0 > value ? 0 : type.max < value ? type.max : value;
192
+ }
193
+
194
+ function stringParse( string ) {
195
+ var inst = color(),
196
+ rgba = inst._rgba = [];
197
+
198
+ string = string.toLowerCase();
199
+
200
+ each( stringParsers, function( i, parser ) {
201
+ var parsed,
202
+ match = parser.re.exec( string ),
203
+ values = match && parser.parse( match ),
204
+ spaceName = parser.space || "rgba";
205
+
206
+ if ( values ) {
207
+ parsed = inst[ spaceName ]( values );
208
+
209
+ // if this was an rgba parse the assignment might happen twice
210
+ // oh well....
211
+ inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
212
+ rgba = inst._rgba = parsed._rgba;
213
+
214
+ // exit each( stringParsers ) here because we matched
215
+ return false;
216
+ }
217
+ });
218
+
219
+ // Found a stringParser that handled it
220
+ if ( rgba.length ) {
221
+
222
+ // if this came from a parsed string, force "transparent" when alpha is 0
223
+ // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
224
+ if ( rgba.join() === "0,0,0,0" ) {
225
+ jQuery.extend( rgba, colors.transparent );
226
+ }
227
+ return inst;
228
+ }
229
+
230
+ // named colors
231
+ return colors[ string ];
232
+ }
233
+
234
+ color.fn = jQuery.extend( color.prototype, {
235
+ parse: function( red, green, blue, alpha ) {
236
+ if ( red === undefined ) {
237
+ this._rgba = [ null, null, null, null ];
238
+ return this;
239
+ }
240
+ if ( red.jquery || red.nodeType ) {
241
+ red = jQuery( red ).css( green );
242
+ green = undefined;
243
+ }
244
+
245
+ var inst = this,
246
+ type = jQuery.type( red ),
247
+ rgba = this._rgba = [];
248
+
249
+ // more than 1 argument specified - assume ( red, green, blue, alpha )
250
+ if ( green !== undefined ) {
251
+ red = [ red, green, blue, alpha ];
252
+ type = "array";
253
+ }
254
+
255
+ if ( type === "string" ) {
256
+ return this.parse( stringParse( red ) || colors._default );
257
+ }
258
+
259
+ if ( type === "array" ) {
260
+ each( spaces.rgba.props, function( key, prop ) {
261
+ rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
262
+ });
263
+ return this;
264
+ }
265
+
266
+ if ( type === "object" ) {
267
+ if ( red instanceof color ) {
268
+ each( spaces, function( spaceName, space ) {
269
+ if ( red[ space.cache ] ) {
270
+ inst[ space.cache ] = red[ space.cache ].slice();
271
+ }
272
+ });
273
+ } else {
274
+ each( spaces, function( spaceName, space ) {
275
+ var cache = space.cache;
276
+ each( space.props, function( key, prop ) {
277
+
278
+ // if the cache doesn't exist, and we know how to convert
279
+ if ( !inst[ cache ] && space.to ) {
280
+
281
+ // if the value was null, we don't need to copy it
282
+ // if the key was alpha, we don't need to copy it either
283
+ if ( key === "alpha" || red[ key ] == null ) {
284
+ return;
285
+ }
286
+ inst[ cache ] = space.to( inst._rgba );
287
+ }
288
+
289
+ // this is the only case where we allow nulls for ALL properties.
290
+ // call clamp with alwaysAllowEmpty
291
+ inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
292
+ });
293
+
294
+ // everything defined but alpha?
295
+ if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
296
+ // use the default of 1
297
+ inst[ cache ][ 3 ] = 1;
298
+ if ( space.from ) {
299
+ inst._rgba = space.from( inst[ cache ] );
300
+ }
301
+ }
302
+ });
303
+ }
304
+ return this;
305
+ }
306
+ },
307
+ is: function( compare ) {
308
+ var is = color( compare ),
309
+ same = true,
310
+ inst = this;
311
+
312
+ each( spaces, function( _, space ) {
313
+ var localCache,
314
+ isCache = is[ space.cache ];
315
+ if (isCache) {
316
+ localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
317
+ each( space.props, function( _, prop ) {
318
+ if ( isCache[ prop.idx ] != null ) {
319
+ same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
320
+ return same;
321
+ }
322
+ });
323
+ }
324
+ return same;
325
+ });
326
+ return same;
327
+ },
328
+ _space: function() {
329
+ var used = [],
330
+ inst = this;
331
+ each( spaces, function( spaceName, space ) {
332
+ if ( inst[ space.cache ] ) {
333
+ used.push( spaceName );
334
+ }
335
+ });
336
+ return used.pop();
337
+ },
338
+ transition: function( other, distance ) {
339
+ var end = color( other ),
340
+ spaceName = end._space(),
341
+ space = spaces[ spaceName ],
342
+ startColor = this.alpha() === 0 ? color( "transparent" ) : this,
343
+ start = startColor[ space.cache ] || space.to( startColor._rgba ),
344
+ result = start.slice();
345
+
346
+ end = end[ space.cache ];
347
+ each( space.props, function( key, prop ) {
348
+ var index = prop.idx,
349
+ startValue = start[ index ],
350
+ endValue = end[ index ],
351
+ type = propTypes[ prop.type ] || {};
352
+
353
+ // if null, don't override start value
354
+ if ( endValue === null ) {
355
+ return;
356
+ }
357
+ // if null - use end
358
+ if ( startValue === null ) {
359
+ result[ index ] = endValue;
360
+ } else {
361
+ if ( type.mod ) {
362
+ if ( endValue - startValue > type.mod / 2 ) {
363
+ startValue += type.mod;
364
+ } else if ( startValue - endValue > type.mod / 2 ) {
365
+ startValue -= type.mod;
366
+ }
367
+ }
368
+ result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
369
+ }
370
+ });
371
+ return this[ spaceName ]( result );
372
+ },
373
+ blend: function( opaque ) {
374
+ // if we are already opaque - return ourself
375
+ if ( this._rgba[ 3 ] === 1 ) {
376
+ return this;
377
+ }
378
+
379
+ var rgb = this._rgba.slice(),
380
+ a = rgb.pop(),
381
+ blend = color( opaque )._rgba;
382
+
383
+ return color( jQuery.map( rgb, function( v, i ) {
384
+ return ( 1 - a ) * blend[ i ] + a * v;
385
+ }));
386
+ },
387
+ toRgbaString: function() {
388
+ var prefix = "rgba(",
389
+ rgba = jQuery.map( this._rgba, function( v, i ) {
390
+ return v == null ? ( i > 2 ? 1 : 0 ) : v;
391
+ });
392
+
393
+ if ( rgba[ 3 ] === 1 ) {
394
+ rgba.pop();
395
+ prefix = "rgb(";
396
+ }
397
+
398
+ return prefix + rgba.join() + ")";
399
+ },
400
+ toHslaString: function() {
401
+ var prefix = "hsla(",
402
+ hsla = jQuery.map( this.hsla(), function( v, i ) {
403
+ if ( v == null ) {
404
+ v = i > 2 ? 1 : 0;
405
+ }
406
+
407
+ // catch 1 and 2
408
+ if ( i && i < 3 ) {
409
+ v = Math.round( v * 100 ) + "%";
410
+ }
411
+ return v;
412
+ });
413
+
414
+ if ( hsla[ 3 ] === 1 ) {
415
+ hsla.pop();
416
+ prefix = "hsl(";
417
+ }
418
+ return prefix + hsla.join() + ")";
419
+ },
420
+ toHexString: function( includeAlpha ) {
421
+ var rgba = this._rgba.slice(),
422
+ alpha = rgba.pop();
423
+
424
+ if ( includeAlpha ) {
425
+ rgba.push( ~~( alpha * 255 ) );
426
+ }
427
+
428
+ return "#" + jQuery.map( rgba, function( v ) {
429
+
430
+ // default to 0 when nulls exist
431
+ v = ( v || 0 ).toString( 16 );
432
+ return v.length === 1 ? "0" + v : v;
433
+ }).join("");
434
+ },
435
+ toString: function() {
436
+ return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
437
+ }
438
+ });
439
+ color.fn.parse.prototype = color.fn;
440
+
441
+ // hsla conversions adapted from:
442
+ // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
443
+
444
+ function hue2rgb( p, q, h ) {
445
+ h = ( h + 1 ) % 1;
446
+ if ( h * 6 < 1 ) {
447
+ return p + (q - p) * h * 6;
448
+ }
449
+ if ( h * 2 < 1) {
450
+ return q;
451
+ }
452
+ if ( h * 3 < 2 ) {
453
+ return p + (q - p) * ((2/3) - h) * 6;
454
+ }
455
+ return p;
456
+ }
457
+
458
+ spaces.hsla.to = function ( rgba ) {
459
+ if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
460
+ return [ null, null, null, rgba[ 3 ] ];
461
+ }
462
+ var r = rgba[ 0 ] / 255,
463
+ g = rgba[ 1 ] / 255,
464
+ b = rgba[ 2 ] / 255,
465
+ a = rgba[ 3 ],
466
+ max = Math.max( r, g, b ),
467
+ min = Math.min( r, g, b ),
468
+ diff = max - min,
469
+ add = max + min,
470
+ l = add * 0.5,
471
+ h, s;
472
+
473
+ if ( min === max ) {
474
+ h = 0;
475
+ } else if ( r === max ) {
476
+ h = ( 60 * ( g - b ) / diff ) + 360;
477
+ } else if ( g === max ) {
478
+ h = ( 60 * ( b - r ) / diff ) + 120;
479
+ } else {
480
+ h = ( 60 * ( r - g ) / diff ) + 240;
481
+ }
482
+
483
+ // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
484
+ // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
485
+ if ( diff === 0 ) {
486
+ s = 0;
487
+ } else if ( l <= 0.5 ) {
488
+ s = diff / add;
489
+ } else {
490
+ s = diff / ( 2 - add );
491
+ }
492
+ return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
493
+ };
494
+
495
+ spaces.hsla.from = function ( hsla ) {
496
+ if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
497
+ return [ null, null, null, hsla[ 3 ] ];
498
+ }
499
+ var h = hsla[ 0 ] / 360,
500
+ s = hsla[ 1 ],
501
+ l = hsla[ 2 ],
502
+ a = hsla[ 3 ],
503
+ q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
504
+ p = 2 * l - q;
505
+
506
+ return [
507
+ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
508
+ Math.round( hue2rgb( p, q, h ) * 255 ),
509
+ Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
510
+ a
511
+ ];
512
+ };
513
+
514
+
515
+ each( spaces, function( spaceName, space ) {
516
+ var props = space.props,
517
+ cache = space.cache,
518
+ to = space.to,
519
+ from = space.from;
520
+
521
+ // makes rgba() and hsla()
522
+ color.fn[ spaceName ] = function( value ) {
523
+
524
+ // generate a cache for this space if it doesn't exist
525
+ if ( to && !this[ cache ] ) {
526
+ this[ cache ] = to( this._rgba );
527
+ }
528
+ if ( value === undefined ) {
529
+ return this[ cache ].slice();
530
+ }
531
+
532
+ var ret,
533
+ type = jQuery.type( value ),
534
+ arr = ( type === "array" || type === "object" ) ? value : arguments,
535
+ local = this[ cache ].slice();
536
+
537
+ each( props, function( key, prop ) {
538
+ var val = arr[ type === "object" ? key : prop.idx ];
539
+ if ( val == null ) {
540
+ val = local[ prop.idx ];
541
+ }
542
+ local[ prop.idx ] = clamp( val, prop );
543
+ });
544
+
545
+ if ( from ) {
546
+ ret = color( from( local ) );
547
+ ret[ cache ] = local;
548
+ return ret;
549
+ } else {
550
+ return color( local );
551
+ }
552
+ };
553
+
554
+ // makes red() green() blue() alpha() hue() saturation() lightness()
555
+ each( props, function( key, prop ) {
556
+ // alpha is included in more than one space
557
+ if ( color.fn[ key ] ) {
558
+ return;
559
+ }
560
+ color.fn[ key ] = function( value ) {
561
+ var vtype = jQuery.type( value ),
562
+ fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
563
+ local = this[ fn ](),
564
+ cur = local[ prop.idx ],
565
+ match;
566
+
567
+ if ( vtype === "undefined" ) {
568
+ return cur;
569
+ }
570
+
571
+ if ( vtype === "function" ) {
572
+ value = value.call( this, cur );
573
+ vtype = jQuery.type( value );
574
+ }
575
+ if ( value == null && prop.empty ) {
576
+ return this;
577
+ }
578
+ if ( vtype === "string" ) {
579
+ match = rplusequals.exec( value );
580
+ if ( match ) {
581
+ value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
582
+ }
583
+ }
584
+ local[ prop.idx ] = value;
585
+ return this[ fn ]( local );
586
+ };
587
+ });
588
+ });
589
+
590
+ // add cssHook and .fx.step function for each named hook.
591
+ // accept a space separated string of properties
592
+ color.hook = function( hook ) {
593
+ var hooks = hook.split( " " );
594
+ each( hooks, function( i, hook ) {
595
+ jQuery.cssHooks[ hook ] = {
596
+ set: function( elem, value ) {
597
+ var parsed, curElem,
598
+ backgroundColor = "";
599
+
600
+ if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
601
+ value = color( parsed || value );
602
+ if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
603
+ curElem = hook === "backgroundColor" ? elem.parentNode : elem;
604
+ while (
605
+ (backgroundColor === "" || backgroundColor === "transparent") &&
606
+ curElem && curElem.style
607
+ ) {
608
+ try {
609
+ backgroundColor = jQuery.css( curElem, "backgroundColor" );
610
+ curElem = curElem.parentNode;
611
+ } catch ( e ) {
612
+ }
613
+ }
614
+
615
+ value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
616
+ backgroundColor :
617
+ "_default" );
618
+ }
619
+
620
+ value = value.toRgbaString();
621
+ }
622
+ try {
623
+ elem.style[ hook ] = value;
624
+ } catch( e ) {
625
+ // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
626
+ }
627
+ }
628
+ };
629
+ jQuery.fx.step[ hook ] = function( fx ) {
630
+ if ( !fx.colorInit ) {
631
+ fx.start = color( fx.elem, hook );
632
+ fx.end = color( fx.end );
633
+ fx.colorInit = true;
634
+ }
635
+ jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
636
+ };
637
+ });
638
+
639
+ };
640
+
641
+ color.hook( stepHooks );
642
+
643
+ jQuery.cssHooks.borderColor = {
644
+ expand: function( value ) {
645
+ var expanded = {};
646
+
647
+ each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
648
+ expanded[ "border" + part + "Color" ] = value;
649
+ });
650
+ return expanded;
651
+ }
652
+ };
653
+
654
+ // Basic color names only.
655
+ // Usage of any of the other color names requires adding yourself or including
656
+ // jquery.color.svg-names.js.
657
+ colors = jQuery.Color.names = {
658
+ // 4.1. Basic color keywords
659
+ aqua: "#00ffff",
660
+ black: "#000000",
661
+ blue: "#0000ff",
662
+ fuchsia: "#ff00ff",
663
+ gray: "#808080",
664
+ green: "#008000",
665
+ lime: "#00ff00",
666
+ maroon: "#800000",
667
+ navy: "#000080",
668
+ olive: "#808000",
669
+ purple: "#800080",
670
+ red: "#ff0000",
671
+ silver: "#c0c0c0",
672
+ teal: "#008080",
673
+ white: "#ffffff",
674
+ yellow: "#ffff00",
675
+
676
+ // 4.2.3. "transparent" color keyword
677
+ transparent: [ null, null, null, 0 ],
678
+
679
+ _default: "#ffffff"
680
+ };
681
+
682
+ })( jQuery );
683
+
684
+
685
+ /******************************************************************************/
686
+ /****************************** CLASS ANIMATIONS ******************************/
687
+ /******************************************************************************/
688
+ (function() {
689
+
690
+ var classAnimationActions = [ "add", "remove", "toggle" ],
691
+ shorthandStyles = {
692
+ border: 1,
693
+ borderBottom: 1,
694
+ borderColor: 1,
695
+ borderLeft: 1,
696
+ borderRight: 1,
697
+ borderTop: 1,
698
+ borderWidth: 1,
699
+ margin: 1,
700
+ padding: 1
701
+ };
702
+
703
+ $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
704
+ $.fx.step[ prop ] = function( fx ) {
705
+ if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
706
+ jQuery.style( fx.elem, prop, fx.end );
707
+ fx.setAttr = true;
708
+ }
709
+ };
710
+ });
711
+
712
+ function getElementStyles( elem ) {
713
+ var key, len,
714
+ style = elem.ownerDocument.defaultView ?
715
+ elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
716
+ elem.currentStyle,
717
+ styles = {};
718
+
719
+ if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
720
+ len = style.length;
721
+ while ( len-- ) {
722
+ key = style[ len ];
723
+ if ( typeof style[ key ] === "string" ) {
724
+ styles[ $.camelCase( key ) ] = style[ key ];
725
+ }
726
+ }
727
+ // support: Opera, IE <9
728
+ } else {
729
+ for ( key in style ) {
730
+ if ( typeof style[ key ] === "string" ) {
731
+ styles[ key ] = style[ key ];
732
+ }
733
+ }
734
+ }
735
+
736
+ return styles;
737
+ }
738
+
739
+
740
+ function styleDifference( oldStyle, newStyle ) {
741
+ var diff = {},
742
+ name, value;
743
+
744
+ for ( name in newStyle ) {
745
+ value = newStyle[ name ];
746
+ if ( oldStyle[ name ] !== value ) {
747
+ if ( !shorthandStyles[ name ] ) {
748
+ if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
749
+ diff[ name ] = value;
750
+ }
751
+ }
752
+ }
753
+ }
754
+
755
+ return diff;
756
+ }
757
+
758
+ // support: jQuery <1.8
759
+ if ( !$.fn.addBack ) {
760
+ $.fn.addBack = function( selector ) {
761
+ return this.add( selector == null ?
762
+ this.prevObject : this.prevObject.filter( selector )
763
+ );
764
+ };
765
+ }
766
+
767
+ $.effects.animateClass = function( value, duration, easing, callback ) {
768
+ var o = $.speed( duration, easing, callback );
769
+
770
+ return this.queue( function() {
771
+ var animated = $( this ),
772
+ baseClass = animated.attr( "class" ) || "",
773
+ applyClassChange,
774
+ allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
775
+
776
+ // map the animated objects to store the original styles.
777
+ allAnimations = allAnimations.map(function() {
778
+ var el = $( this );
779
+ return {
780
+ el: el,
781
+ start: getElementStyles( this )
782
+ };
783
+ });
784
+
785
+ // apply class change
786
+ applyClassChange = function() {
787
+ $.each( classAnimationActions, function(i, action) {
788
+ if ( value[ action ] ) {
789
+ animated[ action + "Class" ]( value[ action ] );
790
+ }
791
+ });
792
+ };
793
+ applyClassChange();
794
+
795
+ // map all animated objects again - calculate new styles and diff
796
+ allAnimations = allAnimations.map(function() {
797
+ this.end = getElementStyles( this.el[ 0 ] );
798
+ this.diff = styleDifference( this.start, this.end );
799
+ return this;
800
+ });
801
+
802
+ // apply original class
803
+ animated.attr( "class", baseClass );
804
+
805
+ // map all animated objects again - this time collecting a promise
806
+ allAnimations = allAnimations.map(function() {
807
+ var styleInfo = this,
808
+ dfd = $.Deferred(),
809
+ opts = $.extend({}, o, {
810
+ queue: false,
811
+ complete: function() {
812
+ dfd.resolve( styleInfo );
813
+ }
814
+ });
815
+
816
+ this.el.animate( this.diff, opts );
817
+ return dfd.promise();
818
+ });
819
+
820
+ // once all animations have completed:
821
+ $.when.apply( $, allAnimations.get() ).done(function() {
822
+
823
+ // set the final class
824
+ applyClassChange();
825
+
826
+ // for each animated element,
827
+ // clear all css properties that were animated
828
+ $.each( arguments, function() {
829
+ var el = this.el;
830
+ $.each( this.diff, function(key) {
831
+ el.css( key, "" );
832
+ });
833
+ });
834
+
835
+ // this is guarnteed to be there if you use jQuery.speed()
836
+ // it also handles dequeuing the next anim...
837
+ o.complete.call( animated[ 0 ] );
838
+ });
839
+ });
840
+ };
841
+
842
+ $.fn.extend({
843
+ addClass: (function( orig ) {
844
+ return function( classNames, speed, easing, callback ) {
845
+ return speed ?
846
+ $.effects.animateClass.call( this,
847
+ { add: classNames }, speed, easing, callback ) :
848
+ orig.apply( this, arguments );
849
+ };
850
+ })( $.fn.addClass ),
851
+
852
+ removeClass: (function( orig ) {
853
+ return function( classNames, speed, easing, callback ) {
854
+ return arguments.length > 1 ?
855
+ $.effects.animateClass.call( this,
856
+ { remove: classNames }, speed, easing, callback ) :
857
+ orig.apply( this, arguments );
858
+ };
859
+ })( $.fn.removeClass ),
860
+
861
+ toggleClass: (function( orig ) {
862
+ return function( classNames, force, speed, easing, callback ) {
863
+ if ( typeof force === "boolean" || force === undefined ) {
864
+ if ( !speed ) {
865
+ // without speed parameter
866
+ return orig.apply( this, arguments );
867
+ } else {
868
+ return $.effects.animateClass.call( this,
869
+ (force ? { add: classNames } : { remove: classNames }),
870
+ speed, easing, callback );
871
+ }
872
+ } else {
873
+ // without force parameter
874
+ return $.effects.animateClass.call( this,
875
+ { toggle: classNames }, force, speed, easing );
876
+ }
877
+ };
878
+ })( $.fn.toggleClass ),
879
+
880
+ switchClass: function( remove, add, speed, easing, callback) {
881
+ return $.effects.animateClass.call( this, {
882
+ add: add,
883
+ remove: remove
884
+ }, speed, easing, callback );
885
+ }
886
+ });
887
+
888
+ })();
889
+
890
+ /******************************************************************************/
891
+ /*********************************** EFFECTS **********************************/
892
+ /******************************************************************************/
893
+
894
+ (function() {
895
+
896
+ $.extend( $.effects, {
897
+ version: "1.10.2",
898
+
899
+ // Saves a set of properties in a data storage
900
+ save: function( element, set ) {
901
+ for( var i=0; i < set.length; i++ ) {
902
+ if ( set[ i ] !== null ) {
903
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
904
+ }
905
+ }
906
+ },
907
+
908
+ // Restores a set of previously saved properties from a data storage
909
+ restore: function( element, set ) {
910
+ var val, i;
911
+ for( i=0; i < set.length; i++ ) {
912
+ if ( set[ i ] !== null ) {
913
+ val = element.data( dataSpace + set[ i ] );
914
+ // support: jQuery 1.6.2
915
+ // http://bugs.jquery.com/ticket/9917
916
+ // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
917
+ // We can't differentiate between "" and 0 here, so we just assume
918
+ // empty string since it's likely to be a more common value...
919
+ if ( val === undefined ) {
920
+ val = "";
921
+ }
922
+ element.css( set[ i ], val );
923
+ }
924
+ }
925
+ },
926
+
927
+ setMode: function( el, mode ) {
928
+ if (mode === "toggle") {
929
+ mode = el.is( ":hidden" ) ? "show" : "hide";
930
+ }
931
+ return mode;
932
+ },
933
+
934
+ // Translates a [top,left] array into a baseline value
935
+ // this should be a little more flexible in the future to handle a string & hash
936
+ getBaseline: function( origin, original ) {
937
+ var y, x;
938
+ switch ( origin[ 0 ] ) {
939
+ case "top": y = 0; break;
940
+ case "middle": y = 0.5; break;
941
+ case "bottom": y = 1; break;
942
+ default: y = origin[ 0 ] / original.height;
943
+ }
944
+ switch ( origin[ 1 ] ) {
945
+ case "left": x = 0; break;
946
+ case "center": x = 0.5; break;
947
+ case "right": x = 1; break;
948
+ default: x = origin[ 1 ] / original.width;
949
+ }
950
+ return {
951
+ x: x,
952
+ y: y
953
+ };
954
+ },
955
+
956
+ // Wraps the element around a wrapper that copies position properties
957
+ createWrapper: function( element ) {
958
+
959
+ // if the element is already wrapped, return it
960
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
961
+ return element.parent();
962
+ }
963
+
964
+ // wrap the element
965
+ var props = {
966
+ width: element.outerWidth(true),
967
+ height: element.outerHeight(true),
968
+ "float": element.css( "float" )
969
+ },
970
+ wrapper = $( "<div></div>" )
971
+ .addClass( "ui-effects-wrapper" )
972
+ .css({
973
+ fontSize: "100%",
974
+ background: "transparent",
975
+ border: "none",
976
+ margin: 0,
977
+ padding: 0
978
+ }),
979
+ // Store the size in case width/height are defined in % - Fixes #5245
980
+ size = {
981
+ width: element.width(),
982
+ height: element.height()
983
+ },
984
+ active = document.activeElement;
985
+
986
+ // support: Firefox
987
+ // Firefox incorrectly exposes anonymous content
988
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
989
+ try {
990
+ active.id;
991
+ } catch( e ) {
992
+ active = document.body;
993
+ }
994
+
995
+ element.wrap( wrapper );
996
+
997
+ // Fixes #7595 - Elements lose focus when wrapped.
998
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
999
+ $( active ).focus();
1000
+ }
1001
+
1002
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
1003
+
1004
+ // transfer positioning properties to the wrapper
1005
+ if ( element.css( "position" ) === "static" ) {
1006
+ wrapper.css({ position: "relative" });
1007
+ element.css({ position: "relative" });
1008
+ } else {
1009
+ $.extend( props, {
1010
+ position: element.css( "position" ),
1011
+ zIndex: element.css( "z-index" )
1012
+ });
1013
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
1014
+ props[ pos ] = element.css( pos );
1015
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
1016
+ props[ pos ] = "auto";
1017
+ }
1018
+ });
1019
+ element.css({
1020
+ position: "relative",
1021
+ top: 0,
1022
+ left: 0,
1023
+ right: "auto",
1024
+ bottom: "auto"
1025
+ });
1026
+ }
1027
+ element.css(size);
1028
+
1029
+ return wrapper.css( props ).show();
1030
+ },
1031
+
1032
+ removeWrapper: function( element ) {
1033
+ var active = document.activeElement;
1034
+
1035
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
1036
+ element.parent().replaceWith( element );
1037
+
1038
+ // Fixes #7595 - Elements lose focus when wrapped.
1039
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
1040
+ $( active ).focus();
1041
+ }
1042
+ }
1043
+
1044
+
1045
+ return element;
1046
+ },
1047
+
1048
+ setTransition: function( element, list, factor, value ) {
1049
+ value = value || {};
1050
+ $.each( list, function( i, x ) {
1051
+ var unit = element.cssUnit( x );
1052
+ if ( unit[ 0 ] > 0 ) {
1053
+ value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
1054
+ }
1055
+ });
1056
+ return value;
1057
+ }
1058
+ });
1059
+
1060
+ // return an effect options object for the given parameters:
1061
+ function _normalizeArguments( effect, options, speed, callback ) {
1062
+
1063
+ // allow passing all options as the first parameter
1064
+ if ( $.isPlainObject( effect ) ) {
1065
+ options = effect;
1066
+ effect = effect.effect;
1067
+ }
1068
+
1069
+ // convert to an object
1070
+ effect = { effect: effect };
1071
+
1072
+ // catch (effect, null, ...)
1073
+ if ( options == null ) {
1074
+ options = {};
1075
+ }
1076
+
1077
+ // catch (effect, callback)
1078
+ if ( $.isFunction( options ) ) {
1079
+ callback = options;
1080
+ speed = null;
1081
+ options = {};
1082
+ }
1083
+
1084
+ // catch (effect, speed, ?)
1085
+ if ( typeof options === "number" || $.fx.speeds[ options ] ) {
1086
+ callback = speed;
1087
+ speed = options;
1088
+ options = {};
1089
+ }
1090
+
1091
+ // catch (effect, options, callback)
1092
+ if ( $.isFunction( speed ) ) {
1093
+ callback = speed;
1094
+ speed = null;
1095
+ }
1096
+
1097
+ // add options to effect
1098
+ if ( options ) {
1099
+ $.extend( effect, options );
1100
+ }
1101
+
1102
+ speed = speed || options.duration;
1103
+ effect.duration = $.fx.off ? 0 :
1104
+ typeof speed === "number" ? speed :
1105
+ speed in $.fx.speeds ? $.fx.speeds[ speed ] :
1106
+ $.fx.speeds._default;
1107
+
1108
+ effect.complete = callback || options.complete;
1109
+
1110
+ return effect;
1111
+ }
1112
+
1113
+ function standardAnimationOption( option ) {
1114
+ // Valid standard speeds (nothing, number, named speed)
1115
+ if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
1116
+ return true;
1117
+ }
1118
+
1119
+ // Invalid strings - treat as "normal" speed
1120
+ if ( typeof option === "string" && !$.effects.effect[ option ] ) {
1121
+ return true;
1122
+ }
1123
+
1124
+ // Complete callback
1125
+ if ( $.isFunction( option ) ) {
1126
+ return true;
1127
+ }
1128
+
1129
+ // Options hash (but not naming an effect)
1130
+ if ( typeof option === "object" && !option.effect ) {
1131
+ return true;
1132
+ }
1133
+
1134
+ // Didn't match any standard API
1135
+ return false;
1136
+ }
1137
+
1138
+ $.fn.extend({
1139
+ effect: function( /* effect, options, speed, callback */ ) {
1140
+ var args = _normalizeArguments.apply( this, arguments ),
1141
+ mode = args.mode,
1142
+ queue = args.queue,
1143
+ effectMethod = $.effects.effect[ args.effect ];
1144
+
1145
+ if ( $.fx.off || !effectMethod ) {
1146
+ // delegate to the original method (e.g., .show()) if possible
1147
+ if ( mode ) {
1148
+ return this[ mode ]( args.duration, args.complete );
1149
+ } else {
1150
+ return this.each( function() {
1151
+ if ( args.complete ) {
1152
+ args.complete.call( this );
1153
+ }
1154
+ });
1155
+ }
1156
+ }
1157
+
1158
+ function run( next ) {
1159
+ var elem = $( this ),
1160
+ complete = args.complete,
1161
+ mode = args.mode;
1162
+
1163
+ function done() {
1164
+ if ( $.isFunction( complete ) ) {
1165
+ complete.call( elem[0] );
1166
+ }
1167
+ if ( $.isFunction( next ) ) {
1168
+ next();
1169
+ }
1170
+ }
1171
+
1172
+ // If the element already has the correct final state, delegate to
1173
+ // the core methods so the internal tracking of "olddisplay" works.
1174
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
1175
+ elem[ mode ]();
1176
+ done();
1177
+ } else {
1178
+ effectMethod.call( elem[0], args, done );
1179
+ }
1180
+ }
1181
+
1182
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
1183
+ },
1184
+
1185
+ show: (function( orig ) {
1186
+ return function( option ) {
1187
+ if ( standardAnimationOption( option ) ) {
1188
+ return orig.apply( this, arguments );
1189
+ } else {
1190
+ var args = _normalizeArguments.apply( this, arguments );
1191
+ args.mode = "show";
1192
+ return this.effect.call( this, args );
1193
+ }
1194
+ };
1195
+ })( $.fn.show ),
1196
+
1197
+ hide: (function( orig ) {
1198
+ return function( option ) {
1199
+ if ( standardAnimationOption( option ) ) {
1200
+ return orig.apply( this, arguments );
1201
+ } else {
1202
+ var args = _normalizeArguments.apply( this, arguments );
1203
+ args.mode = "hide";
1204
+ return this.effect.call( this, args );
1205
+ }
1206
+ };
1207
+ })( $.fn.hide ),
1208
+
1209
+ toggle: (function( orig ) {
1210
+ return function( option ) {
1211
+ if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
1212
+ return orig.apply( this, arguments );
1213
+ } else {
1214
+ var args = _normalizeArguments.apply( this, arguments );
1215
+ args.mode = "toggle";
1216
+ return this.effect.call( this, args );
1217
+ }
1218
+ };
1219
+ })( $.fn.toggle ),
1220
+
1221
+ // helper functions
1222
+ cssUnit: function(key) {
1223
+ var style = this.css( key ),
1224
+ val = [];
1225
+
1226
+ $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
1227
+ if ( style.indexOf( unit ) > 0 ) {
1228
+ val = [ parseFloat( style ), unit ];
1229
+ }
1230
+ });
1231
+ return val;
1232
+ }
1233
+ });
1234
+
1235
+ })();
1236
+
1237
+ /******************************************************************************/
1238
+ /*********************************** EASING ***********************************/
1239
+ /******************************************************************************/
1240
+
1241
+ (function() {
1242
+
1243
+ // based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
1244
+
1245
+ var baseEasings = {};
1246
+
1247
+ $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
1248
+ baseEasings[ name ] = function( p ) {
1249
+ return Math.pow( p, i + 2 );
1250
+ };
1251
+ });
1252
+
1253
+ $.extend( baseEasings, {
1254
+ Sine: function ( p ) {
1255
+ return 1 - Math.cos( p * Math.PI / 2 );
1256
+ },
1257
+ Circ: function ( p ) {
1258
+ return 1 - Math.sqrt( 1 - p * p );
1259
+ },
1260
+ Elastic: function( p ) {
1261
+ return p === 0 || p === 1 ? p :
1262
+ -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
1263
+ },
1264
+ Back: function( p ) {
1265
+ return p * p * ( 3 * p - 2 );
1266
+ },
1267
+ Bounce: function ( p ) {
1268
+ var pow2,
1269
+ bounce = 4;
1270
+
1271
+ while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
1272
+ return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
1273
+ }
1274
+ });
1275
+
1276
+ $.each( baseEasings, function( name, easeIn ) {
1277
+ $.easing[ "easeIn" + name ] = easeIn;
1278
+ $.easing[ "easeOut" + name ] = function( p ) {
1279
+ return 1 - easeIn( 1 - p );
1280
+ };
1281
+ $.easing[ "easeInOut" + name ] = function( p ) {
1282
+ return p < 0.5 ?
1283
+ easeIn( p * 2 ) / 2 :
1284
+ 1 - easeIn( p * -2 + 2 ) / 2;
1285
+ };
1286
+ });
1287
+
1288
+ })();
1289
+
1290
+ })(jQuery);
1291
+
1292
+ });