formtastic-jquery_inputmask 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.bowerrc +3 -0
  3. data/bower.json +19 -0
  4. data/lib/formtastic/jquery_inputmask/engine.rb +1 -1
  5. data/lib/formtastic/jquery_inputmask/version.rb +1 -1
  6. data/vendor/inputmask/.bower.json +59 -0
  7. data/vendor/inputmask/bower.json +40 -0
  8. data/vendor/inputmask/dist/inputmask/bindings/inputmask.binding.js +21 -0
  9. data/vendor/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js +62 -0
  10. data/vendor/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.js +13 -0
  11. data/vendor/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js +133 -0
  12. data/vendor/inputmask/dist/inputmask/global/document.js +11 -0
  13. data/vendor/inputmask/dist/inputmask/global/window.js +11 -0
  14. data/vendor/inputmask/dist/inputmask/inputmask.date.extensions.js +490 -0
  15. data/vendor/inputmask/dist/inputmask/inputmask.extensions.js +97 -0
  16. data/vendor/inputmask/dist/inputmask/inputmask.js +1643 -0
  17. data/vendor/inputmask/dist/inputmask/inputmask.numeric.extensions.js +347 -0
  18. data/vendor/inputmask/dist/inputmask/inputmask.phone.extensions.js +61 -0
  19. data/vendor/inputmask/dist/inputmask/inputmask.regex.extensions.js +115 -0
  20. data/vendor/inputmask/dist/inputmask/jquery.inputmask.js +62 -0
  21. data/vendor/inputmask/dist/inputmask/phone-codes/phone-be.js +244 -0
  22. data/vendor/inputmask/dist/inputmask/phone-codes/phone-nl.js +924 -0
  23. data/vendor/inputmask/dist/inputmask/phone-codes/phone-ru.js +19240 -0
  24. data/vendor/inputmask/dist/inputmask/phone-codes/phone-uk.js +1009 -0
  25. data/vendor/inputmask/dist/inputmask/phone-codes/phone.js +2111 -0
  26. data/vendor/inputmask/dist/jquery.inputmask.bundle.js +3085 -0
  27. data/vendor/inputmask/dist/min/inputmask/inputmask.date.extensions.min.js +9 -0
  28. data/vendor/inputmask/dist/min/inputmask/inputmask.extensions.min.js +9 -0
  29. data/vendor/inputmask/dist/min/inputmask/inputmask.min.js +10 -0
  30. data/vendor/inputmask/dist/min/inputmask/inputmask.numeric.extensions.min.js +9 -0
  31. data/vendor/inputmask/dist/min/inputmask/inputmask.phone.extensions.min.js +9 -0
  32. data/vendor/inputmask/dist/min/inputmask/inputmask.regex.extensions.min.js +9 -0
  33. data/vendor/inputmask/dist/min/inputmask/jquery.inputmask.min.js +9 -0
  34. data/vendor/inputmask/dist/min/jquery.inputmask.bundle.min.js +11 -0
  35. data/vendor/jquery/.bower.json +25 -0
  36. data/vendor/jquery/AUTHORS.txt +301 -0
  37. data/vendor/jquery/LICENSE.txt +36 -0
  38. data/vendor/jquery/README.md +67 -0
  39. data/vendor/jquery/bower.json +14 -0
  40. data/vendor/jquery/dist/core.js +476 -0
  41. data/vendor/jquery/dist/jquery.js +10253 -0
  42. data/vendor/jquery/dist/jquery.min.js +4 -0
  43. data/vendor/jquery/dist/jquery.min.map +1 -0
  44. data/vendor/jquery/dist/jquery.slim.js +8160 -0
  45. data/vendor/jquery/dist/jquery.slim.min.js +4 -0
  46. data/vendor/jquery/dist/jquery.slim.min.map +1 -0
  47. data/vendor/jquery/external/sizzle/LICENSE.txt +36 -0
  48. data/vendor/jquery/external/sizzle/dist/sizzle.js +2272 -0
  49. data/vendor/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  50. data/vendor/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  51. data/vendor/jquery/src/.eslintrc.json +5 -0
  52. data/vendor/jquery/src/ajax.js +855 -0
  53. data/vendor/jquery/src/ajax/jsonp.js +102 -0
  54. data/vendor/jquery/src/ajax/load.js +76 -0
  55. data/vendor/jquery/src/ajax/parseXML.js +30 -0
  56. data/vendor/jquery/src/ajax/script.js +77 -0
  57. data/vendor/jquery/src/ajax/var/location.js +5 -0
  58. data/vendor/jquery/src/ajax/var/nonce.js +7 -0
  59. data/vendor/jquery/src/ajax/var/rquery.js +5 -0
  60. data/vendor/jquery/src/ajax/xhr.js +169 -0
  61. data/vendor/jquery/src/attributes.js +13 -0
  62. data/vendor/jquery/src/attributes/attr.js +141 -0
  63. data/vendor/jquery/src/attributes/classes.js +174 -0
  64. data/vendor/jquery/src/attributes/prop.js +143 -0
  65. data/vendor/jquery/src/attributes/support.js +33 -0
  66. data/vendor/jquery/src/attributes/val.js +190 -0
  67. data/vendor/jquery/src/callbacks.js +234 -0
  68. data/vendor/jquery/src/core.js +476 -0
  69. data/vendor/jquery/src/core/DOMEval.js +16 -0
  70. data/vendor/jquery/src/core/access.js +70 -0
  71. data/vendor/jquery/src/core/init.js +128 -0
  72. data/vendor/jquery/src/core/nodeName.js +13 -0
  73. data/vendor/jquery/src/core/parseHTML.js +65 -0
  74. data/vendor/jquery/src/core/ready-no-deferred.js +96 -0
  75. data/vendor/jquery/src/core/ready.js +86 -0
  76. data/vendor/jquery/src/core/readyException.js +13 -0
  77. data/vendor/jquery/src/core/stripAndCollapse.js +14 -0
  78. data/vendor/jquery/src/core/support.js +20 -0
  79. data/vendor/jquery/src/core/var/rsingleTag.js +6 -0
  80. data/vendor/jquery/src/css.js +438 -0
  81. data/vendor/jquery/src/css/addGetHookIf.js +26 -0
  82. data/vendor/jquery/src/css/adjustCSS.js +71 -0
  83. data/vendor/jquery/src/css/curCSS.js +65 -0
  84. data/vendor/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  85. data/vendor/jquery/src/css/showHide.js +105 -0
  86. data/vendor/jquery/src/css/support.js +89 -0
  87. data/vendor/jquery/src/css/var/cssExpand.js +5 -0
  88. data/vendor/jquery/src/css/var/getStyles.js +17 -0
  89. data/vendor/jquery/src/css/var/isHiddenWithinTree.js +34 -0
  90. data/vendor/jquery/src/css/var/rmargin.js +5 -0
  91. data/vendor/jquery/src/css/var/rnumnonpx.js +7 -0
  92. data/vendor/jquery/src/css/var/swap.js +26 -0
  93. data/vendor/jquery/src/data.js +179 -0
  94. data/vendor/jquery/src/data/Data.js +161 -0
  95. data/vendor/jquery/src/data/var/acceptData.js +19 -0
  96. data/vendor/jquery/src/data/var/dataPriv.js +7 -0
  97. data/vendor/jquery/src/data/var/dataUser.js +7 -0
  98. data/vendor/jquery/src/deferred.js +391 -0
  99. data/vendor/jquery/src/deferred/exceptionHook.js +21 -0
  100. data/vendor/jquery/src/deprecated.js +40 -0
  101. data/vendor/jquery/src/dimensions.js +56 -0
  102. data/vendor/jquery/src/effects.js +699 -0
  103. data/vendor/jquery/src/effects/Tween.js +123 -0
  104. data/vendor/jquery/src/effects/animatedSelector.js +15 -0
  105. data/vendor/jquery/src/event.js +746 -0
  106. data/vendor/jquery/src/event/ajax.js +22 -0
  107. data/vendor/jquery/src/event/alias.js +29 -0
  108. data/vendor/jquery/src/event/focusin.js +55 -0
  109. data/vendor/jquery/src/event/support.js +11 -0
  110. data/vendor/jquery/src/event/trigger.js +185 -0
  111. data/vendor/jquery/src/exports/amd.js +26 -0
  112. data/vendor/jquery/src/exports/global.js +34 -0
  113. data/vendor/jquery/src/jquery.js +41 -0
  114. data/vendor/jquery/src/manipulation.js +488 -0
  115. data/vendor/jquery/src/manipulation/_evalUrl.js +23 -0
  116. data/vendor/jquery/src/manipulation/buildFragment.js +104 -0
  117. data/vendor/jquery/src/manipulation/getAll.js +32 -0
  118. data/vendor/jquery/src/manipulation/setGlobalEval.js +22 -0
  119. data/vendor/jquery/src/manipulation/support.js +35 -0
  120. data/vendor/jquery/src/manipulation/var/rcheckableType.js +5 -0
  121. data/vendor/jquery/src/manipulation/var/rscriptType.js +5 -0
  122. data/vendor/jquery/src/manipulation/var/rtagName.js +5 -0
  123. data/vendor/jquery/src/manipulation/wrapMap.js +29 -0
  124. data/vendor/jquery/src/offset.js +229 -0
  125. data/vendor/jquery/src/queue.js +145 -0
  126. data/vendor/jquery/src/queue/delay.js +24 -0
  127. data/vendor/jquery/src/selector-native.js +237 -0
  128. data/vendor/jquery/src/selector-sizzle.js +19 -0
  129. data/vendor/jquery/src/selector.js +3 -0
  130. data/vendor/jquery/src/serialize.js +130 -0
  131. data/vendor/jquery/src/traversing.js +191 -0
  132. data/vendor/jquery/src/traversing/findFilter.js +106 -0
  133. data/vendor/jquery/src/traversing/var/dir.js +22 -0
  134. data/vendor/jquery/src/traversing/var/rneedsContext.js +8 -0
  135. data/vendor/jquery/src/traversing/var/siblings.js +17 -0
  136. data/vendor/jquery/src/var/ObjectFunctionString.js +7 -0
  137. data/vendor/jquery/src/var/arr.js +5 -0
  138. data/vendor/jquery/src/var/class2type.js +6 -0
  139. data/vendor/jquery/src/var/concat.js +7 -0
  140. data/vendor/jquery/src/var/document.js +5 -0
  141. data/vendor/jquery/src/var/documentElement.js +7 -0
  142. data/vendor/jquery/src/var/fnToString.js +7 -0
  143. data/vendor/jquery/src/var/getProto.js +5 -0
  144. data/vendor/jquery/src/var/hasOwn.js +7 -0
  145. data/vendor/jquery/src/var/indexOf.js +7 -0
  146. data/vendor/jquery/src/var/pnum.js +5 -0
  147. data/vendor/jquery/src/var/push.js +7 -0
  148. data/vendor/jquery/src/var/rcssNum.js +9 -0
  149. data/vendor/jquery/src/var/rnothtmlwhite.js +8 -0
  150. data/vendor/jquery/src/var/slice.js +7 -0
  151. data/vendor/jquery/src/var/support.js +6 -0
  152. data/vendor/jquery/src/var/toString.js +7 -0
  153. data/vendor/jquery/src/wrap.js +77 -0
  154. metadata +152 -3
  155. data/.gitmodules +0 -3
@@ -0,0 +1,21 @@
1
+ define( [
2
+ "../core",
3
+ "../deferred"
4
+ ], function( jQuery ) {
5
+
6
+ "use strict";
7
+
8
+ // These usually indicate a programmer mistake during development,
9
+ // warn about them ASAP rather than swallowing them by default.
10
+ var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
11
+
12
+ jQuery.Deferred.exceptionHook = function( error, stack ) {
13
+
14
+ // Support: IE 8 - 9 only
15
+ // Console exists when dev tools are open, which can happen at any time
16
+ if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
17
+ window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
18
+ }
19
+ };
20
+
21
+ } );
@@ -0,0 +1,40 @@
1
+ define( [
2
+ "./core",
3
+ "./core/nodeName"
4
+ ], function( jQuery, nodeName ) {
5
+
6
+ "use strict";
7
+
8
+ jQuery.fn.extend( {
9
+
10
+ bind: function( types, data, fn ) {
11
+ return this.on( types, null, data, fn );
12
+ },
13
+ unbind: function( types, fn ) {
14
+ return this.off( types, null, fn );
15
+ },
16
+
17
+ delegate: function( selector, types, data, fn ) {
18
+ return this.on( types, selector, data, fn );
19
+ },
20
+ undelegate: function( selector, types, fn ) {
21
+
22
+ // ( namespace ) or ( selector, types [, fn] )
23
+ return arguments.length === 1 ?
24
+ this.off( selector, "**" ) :
25
+ this.off( types, selector || "**", fn );
26
+ }
27
+ } );
28
+
29
+ jQuery.holdReady = function( hold ) {
30
+ if ( hold ) {
31
+ jQuery.readyWait++;
32
+ } else {
33
+ jQuery.ready( true );
34
+ }
35
+ };
36
+ jQuery.isArray = Array.isArray;
37
+ jQuery.parseJSON = JSON.parse;
38
+ jQuery.nodeName = nodeName;
39
+
40
+ } );
@@ -0,0 +1,56 @@
1
+ define( [
2
+ "./core",
3
+ "./core/access",
4
+ "./css"
5
+ ], function( jQuery, access ) {
6
+
7
+ "use strict";
8
+
9
+ // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10
+ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
11
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
12
+ function( defaultExtra, funcName ) {
13
+
14
+ // Margin is only for outerHeight, outerWidth
15
+ jQuery.fn[ funcName ] = function( margin, value ) {
16
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
17
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
18
+
19
+ return access( this, function( elem, type, value ) {
20
+ var doc;
21
+
22
+ if ( jQuery.isWindow( elem ) ) {
23
+
24
+ // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
25
+ return funcName.indexOf( "outer" ) === 0 ?
26
+ elem[ "inner" + name ] :
27
+ elem.document.documentElement[ "client" + name ];
28
+ }
29
+
30
+ // Get document width or height
31
+ if ( elem.nodeType === 9 ) {
32
+ doc = elem.documentElement;
33
+
34
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
35
+ // whichever is greatest
36
+ return Math.max(
37
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
38
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
39
+ doc[ "client" + name ]
40
+ );
41
+ }
42
+
43
+ return value === undefined ?
44
+
45
+ // Get width or height on the element, requesting but not forcing parseFloat
46
+ jQuery.css( elem, type, extra ) :
47
+
48
+ // Set width or height on the element
49
+ jQuery.style( elem, type, value, extra );
50
+ }, type, chainable ? margin : undefined, chainable );
51
+ };
52
+ } );
53
+ } );
54
+
55
+ return jQuery;
56
+ } );
@@ -0,0 +1,699 @@
1
+ define( [
2
+ "./core",
3
+ "./var/document",
4
+ "./var/rcssNum",
5
+ "./var/rnothtmlwhite",
6
+ "./css/var/cssExpand",
7
+ "./css/var/isHiddenWithinTree",
8
+ "./css/var/swap",
9
+ "./css/adjustCSS",
10
+ "./data/var/dataPriv",
11
+ "./css/showHide",
12
+
13
+ "./core/init",
14
+ "./queue",
15
+ "./deferred",
16
+ "./traversing",
17
+ "./manipulation",
18
+ "./css",
19
+ "./effects/Tween"
20
+ ], function( jQuery, document, rcssNum, rnothtmlwhite, cssExpand, isHiddenWithinTree, swap,
21
+ adjustCSS, dataPriv, showHide ) {
22
+
23
+ "use strict";
24
+
25
+ var
26
+ fxNow, inProgress,
27
+ rfxtypes = /^(?:toggle|show|hide)$/,
28
+ rrun = /queueHooks$/;
29
+
30
+ function schedule() {
31
+ if ( inProgress ) {
32
+ if ( document.hidden === false && window.requestAnimationFrame ) {
33
+ window.requestAnimationFrame( schedule );
34
+ } else {
35
+ window.setTimeout( schedule, jQuery.fx.interval );
36
+ }
37
+
38
+ jQuery.fx.tick();
39
+ }
40
+ }
41
+
42
+ // Animations created synchronously will run synchronously
43
+ function createFxNow() {
44
+ window.setTimeout( function() {
45
+ fxNow = undefined;
46
+ } );
47
+ return ( fxNow = jQuery.now() );
48
+ }
49
+
50
+ // Generate parameters to create a standard animation
51
+ function genFx( type, includeWidth ) {
52
+ var which,
53
+ i = 0,
54
+ attrs = { height: type };
55
+
56
+ // If we include width, step value is 1 to do all cssExpand values,
57
+ // otherwise step value is 2 to skip over Left and Right
58
+ includeWidth = includeWidth ? 1 : 0;
59
+ for ( ; i < 4; i += 2 - includeWidth ) {
60
+ which = cssExpand[ i ];
61
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
62
+ }
63
+
64
+ if ( includeWidth ) {
65
+ attrs.opacity = attrs.width = type;
66
+ }
67
+
68
+ return attrs;
69
+ }
70
+
71
+ function createTween( value, prop, animation ) {
72
+ var tween,
73
+ collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
74
+ index = 0,
75
+ length = collection.length;
76
+ for ( ; index < length; index++ ) {
77
+ if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
78
+
79
+ // We're done with this property
80
+ return tween;
81
+ }
82
+ }
83
+ }
84
+
85
+ function defaultPrefilter( elem, props, opts ) {
86
+ var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
87
+ isBox = "width" in props || "height" in props,
88
+ anim = this,
89
+ orig = {},
90
+ style = elem.style,
91
+ hidden = elem.nodeType && isHiddenWithinTree( elem ),
92
+ dataShow = dataPriv.get( elem, "fxshow" );
93
+
94
+ // Queue-skipping animations hijack the fx hooks
95
+ if ( !opts.queue ) {
96
+ hooks = jQuery._queueHooks( elem, "fx" );
97
+ if ( hooks.unqueued == null ) {
98
+ hooks.unqueued = 0;
99
+ oldfire = hooks.empty.fire;
100
+ hooks.empty.fire = function() {
101
+ if ( !hooks.unqueued ) {
102
+ oldfire();
103
+ }
104
+ };
105
+ }
106
+ hooks.unqueued++;
107
+
108
+ anim.always( function() {
109
+
110
+ // Ensure the complete handler is called before this completes
111
+ anim.always( function() {
112
+ hooks.unqueued--;
113
+ if ( !jQuery.queue( elem, "fx" ).length ) {
114
+ hooks.empty.fire();
115
+ }
116
+ } );
117
+ } );
118
+ }
119
+
120
+ // Detect show/hide animations
121
+ for ( prop in props ) {
122
+ value = props[ prop ];
123
+ if ( rfxtypes.test( value ) ) {
124
+ delete props[ prop ];
125
+ toggle = toggle || value === "toggle";
126
+ if ( value === ( hidden ? "hide" : "show" ) ) {
127
+
128
+ // Pretend to be hidden if this is a "show" and
129
+ // there is still data from a stopped show/hide
130
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
131
+ hidden = true;
132
+
133
+ // Ignore all other no-op show/hide data
134
+ } else {
135
+ continue;
136
+ }
137
+ }
138
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
139
+ }
140
+ }
141
+
142
+ // Bail out if this is a no-op like .hide().hide()
143
+ propTween = !jQuery.isEmptyObject( props );
144
+ if ( !propTween && jQuery.isEmptyObject( orig ) ) {
145
+ return;
146
+ }
147
+
148
+ // Restrict "overflow" and "display" styles during box animations
149
+ if ( isBox && elem.nodeType === 1 ) {
150
+
151
+ // Support: IE <=9 - 11, Edge 12 - 13
152
+ // Record all 3 overflow attributes because IE does not infer the shorthand
153
+ // from identically-valued overflowX and overflowY
154
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
155
+
156
+ // Identify a display type, preferring old show/hide data over the CSS cascade
157
+ restoreDisplay = dataShow && dataShow.display;
158
+ if ( restoreDisplay == null ) {
159
+ restoreDisplay = dataPriv.get( elem, "display" );
160
+ }
161
+ display = jQuery.css( elem, "display" );
162
+ if ( display === "none" ) {
163
+ if ( restoreDisplay ) {
164
+ display = restoreDisplay;
165
+ } else {
166
+
167
+ // Get nonempty value(s) by temporarily forcing visibility
168
+ showHide( [ elem ], true );
169
+ restoreDisplay = elem.style.display || restoreDisplay;
170
+ display = jQuery.css( elem, "display" );
171
+ showHide( [ elem ] );
172
+ }
173
+ }
174
+
175
+ // Animate inline elements as inline-block
176
+ if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
177
+ if ( jQuery.css( elem, "float" ) === "none" ) {
178
+
179
+ // Restore the original display value at the end of pure show/hide animations
180
+ if ( !propTween ) {
181
+ anim.done( function() {
182
+ style.display = restoreDisplay;
183
+ } );
184
+ if ( restoreDisplay == null ) {
185
+ display = style.display;
186
+ restoreDisplay = display === "none" ? "" : display;
187
+ }
188
+ }
189
+ style.display = "inline-block";
190
+ }
191
+ }
192
+ }
193
+
194
+ if ( opts.overflow ) {
195
+ style.overflow = "hidden";
196
+ anim.always( function() {
197
+ style.overflow = opts.overflow[ 0 ];
198
+ style.overflowX = opts.overflow[ 1 ];
199
+ style.overflowY = opts.overflow[ 2 ];
200
+ } );
201
+ }
202
+
203
+ // Implement show/hide animations
204
+ propTween = false;
205
+ for ( prop in orig ) {
206
+
207
+ // General show/hide setup for this element animation
208
+ if ( !propTween ) {
209
+ if ( dataShow ) {
210
+ if ( "hidden" in dataShow ) {
211
+ hidden = dataShow.hidden;
212
+ }
213
+ } else {
214
+ dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
215
+ }
216
+
217
+ // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
218
+ if ( toggle ) {
219
+ dataShow.hidden = !hidden;
220
+ }
221
+
222
+ // Show elements before animating them
223
+ if ( hidden ) {
224
+ showHide( [ elem ], true );
225
+ }
226
+
227
+ /* eslint-disable no-loop-func */
228
+
229
+ anim.done( function() {
230
+
231
+ /* eslint-enable no-loop-func */
232
+
233
+ // The final step of a "hide" animation is actually hiding the element
234
+ if ( !hidden ) {
235
+ showHide( [ elem ] );
236
+ }
237
+ dataPriv.remove( elem, "fxshow" );
238
+ for ( prop in orig ) {
239
+ jQuery.style( elem, prop, orig[ prop ] );
240
+ }
241
+ } );
242
+ }
243
+
244
+ // Per-property setup
245
+ propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
246
+ if ( !( prop in dataShow ) ) {
247
+ dataShow[ prop ] = propTween.start;
248
+ if ( hidden ) {
249
+ propTween.end = propTween.start;
250
+ propTween.start = 0;
251
+ }
252
+ }
253
+ }
254
+ }
255
+
256
+ function propFilter( props, specialEasing ) {
257
+ var index, name, easing, value, hooks;
258
+
259
+ // camelCase, specialEasing and expand cssHook pass
260
+ for ( index in props ) {
261
+ name = jQuery.camelCase( index );
262
+ easing = specialEasing[ name ];
263
+ value = props[ index ];
264
+ if ( Array.isArray( value ) ) {
265
+ easing = value[ 1 ];
266
+ value = props[ index ] = value[ 0 ];
267
+ }
268
+
269
+ if ( index !== name ) {
270
+ props[ name ] = value;
271
+ delete props[ index ];
272
+ }
273
+
274
+ hooks = jQuery.cssHooks[ name ];
275
+ if ( hooks && "expand" in hooks ) {
276
+ value = hooks.expand( value );
277
+ delete props[ name ];
278
+
279
+ // Not quite $.extend, this won't overwrite existing keys.
280
+ // Reusing 'index' because we have the correct "name"
281
+ for ( index in value ) {
282
+ if ( !( index in props ) ) {
283
+ props[ index ] = value[ index ];
284
+ specialEasing[ index ] = easing;
285
+ }
286
+ }
287
+ } else {
288
+ specialEasing[ name ] = easing;
289
+ }
290
+ }
291
+ }
292
+
293
+ function Animation( elem, properties, options ) {
294
+ var result,
295
+ stopped,
296
+ index = 0,
297
+ length = Animation.prefilters.length,
298
+ deferred = jQuery.Deferred().always( function() {
299
+
300
+ // Don't match elem in the :animated selector
301
+ delete tick.elem;
302
+ } ),
303
+ tick = function() {
304
+ if ( stopped ) {
305
+ return false;
306
+ }
307
+ var currentTime = fxNow || createFxNow(),
308
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
309
+
310
+ // Support: Android 2.3 only
311
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
312
+ temp = remaining / animation.duration || 0,
313
+ percent = 1 - temp,
314
+ index = 0,
315
+ length = animation.tweens.length;
316
+
317
+ for ( ; index < length; index++ ) {
318
+ animation.tweens[ index ].run( percent );
319
+ }
320
+
321
+ deferred.notifyWith( elem, [ animation, percent, remaining ] );
322
+
323
+ // If there's more to do, yield
324
+ if ( percent < 1 && length ) {
325
+ return remaining;
326
+ }
327
+
328
+ // If this was an empty animation, synthesize a final progress notification
329
+ if ( !length ) {
330
+ deferred.notifyWith( elem, [ animation, 1, 0 ] );
331
+ }
332
+
333
+ // Resolve the animation and report its conclusion
334
+ deferred.resolveWith( elem, [ animation ] );
335
+ return false;
336
+ },
337
+ animation = deferred.promise( {
338
+ elem: elem,
339
+ props: jQuery.extend( {}, properties ),
340
+ opts: jQuery.extend( true, {
341
+ specialEasing: {},
342
+ easing: jQuery.easing._default
343
+ }, options ),
344
+ originalProperties: properties,
345
+ originalOptions: options,
346
+ startTime: fxNow || createFxNow(),
347
+ duration: options.duration,
348
+ tweens: [],
349
+ createTween: function( prop, end ) {
350
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
351
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
352
+ animation.tweens.push( tween );
353
+ return tween;
354
+ },
355
+ stop: function( gotoEnd ) {
356
+ var index = 0,
357
+
358
+ // If we are going to the end, we want to run all the tweens
359
+ // otherwise we skip this part
360
+ length = gotoEnd ? animation.tweens.length : 0;
361
+ if ( stopped ) {
362
+ return this;
363
+ }
364
+ stopped = true;
365
+ for ( ; index < length; index++ ) {
366
+ animation.tweens[ index ].run( 1 );
367
+ }
368
+
369
+ // Resolve when we played the last frame; otherwise, reject
370
+ if ( gotoEnd ) {
371
+ deferred.notifyWith( elem, [ animation, 1, 0 ] );
372
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
373
+ } else {
374
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
375
+ }
376
+ return this;
377
+ }
378
+ } ),
379
+ props = animation.props;
380
+
381
+ propFilter( props, animation.opts.specialEasing );
382
+
383
+ for ( ; index < length; index++ ) {
384
+ result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
385
+ if ( result ) {
386
+ if ( jQuery.isFunction( result.stop ) ) {
387
+ jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
388
+ jQuery.proxy( result.stop, result );
389
+ }
390
+ return result;
391
+ }
392
+ }
393
+
394
+ jQuery.map( props, createTween, animation );
395
+
396
+ if ( jQuery.isFunction( animation.opts.start ) ) {
397
+ animation.opts.start.call( elem, animation );
398
+ }
399
+
400
+ // Attach callbacks from options
401
+ animation
402
+ .progress( animation.opts.progress )
403
+ .done( animation.opts.done, animation.opts.complete )
404
+ .fail( animation.opts.fail )
405
+ .always( animation.opts.always );
406
+
407
+ jQuery.fx.timer(
408
+ jQuery.extend( tick, {
409
+ elem: elem,
410
+ anim: animation,
411
+ queue: animation.opts.queue
412
+ } )
413
+ );
414
+
415
+ return animation;
416
+ }
417
+
418
+ jQuery.Animation = jQuery.extend( Animation, {
419
+
420
+ tweeners: {
421
+ "*": [ function( prop, value ) {
422
+ var tween = this.createTween( prop, value );
423
+ adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
424
+ return tween;
425
+ } ]
426
+ },
427
+
428
+ tweener: function( props, callback ) {
429
+ if ( jQuery.isFunction( props ) ) {
430
+ callback = props;
431
+ props = [ "*" ];
432
+ } else {
433
+ props = props.match( rnothtmlwhite );
434
+ }
435
+
436
+ var prop,
437
+ index = 0,
438
+ length = props.length;
439
+
440
+ for ( ; index < length; index++ ) {
441
+ prop = props[ index ];
442
+ Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
443
+ Animation.tweeners[ prop ].unshift( callback );
444
+ }
445
+ },
446
+
447
+ prefilters: [ defaultPrefilter ],
448
+
449
+ prefilter: function( callback, prepend ) {
450
+ if ( prepend ) {
451
+ Animation.prefilters.unshift( callback );
452
+ } else {
453
+ Animation.prefilters.push( callback );
454
+ }
455
+ }
456
+ } );
457
+
458
+ jQuery.speed = function( speed, easing, fn ) {
459
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
460
+ complete: fn || !fn && easing ||
461
+ jQuery.isFunction( speed ) && speed,
462
+ duration: speed,
463
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
464
+ };
465
+
466
+ // Go to the end state if fx are off
467
+ if ( jQuery.fx.off ) {
468
+ opt.duration = 0;
469
+
470
+ } else {
471
+ if ( typeof opt.duration !== "number" ) {
472
+ if ( opt.duration in jQuery.fx.speeds ) {
473
+ opt.duration = jQuery.fx.speeds[ opt.duration ];
474
+
475
+ } else {
476
+ opt.duration = jQuery.fx.speeds._default;
477
+ }
478
+ }
479
+ }
480
+
481
+ // Normalize opt.queue - true/undefined/null -> "fx"
482
+ if ( opt.queue == null || opt.queue === true ) {
483
+ opt.queue = "fx";
484
+ }
485
+
486
+ // Queueing
487
+ opt.old = opt.complete;
488
+
489
+ opt.complete = function() {
490
+ if ( jQuery.isFunction( opt.old ) ) {
491
+ opt.old.call( this );
492
+ }
493
+
494
+ if ( opt.queue ) {
495
+ jQuery.dequeue( this, opt.queue );
496
+ }
497
+ };
498
+
499
+ return opt;
500
+ };
501
+
502
+ jQuery.fn.extend( {
503
+ fadeTo: function( speed, to, easing, callback ) {
504
+
505
+ // Show any hidden elements after setting opacity to 0
506
+ return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
507
+
508
+ // Animate to the value specified
509
+ .end().animate( { opacity: to }, speed, easing, callback );
510
+ },
511
+ animate: function( prop, speed, easing, callback ) {
512
+ var empty = jQuery.isEmptyObject( prop ),
513
+ optall = jQuery.speed( speed, easing, callback ),
514
+ doAnimation = function() {
515
+
516
+ // Operate on a copy of prop so per-property easing won't be lost
517
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
518
+
519
+ // Empty animations, or finishing resolves immediately
520
+ if ( empty || dataPriv.get( this, "finish" ) ) {
521
+ anim.stop( true );
522
+ }
523
+ };
524
+ doAnimation.finish = doAnimation;
525
+
526
+ return empty || optall.queue === false ?
527
+ this.each( doAnimation ) :
528
+ this.queue( optall.queue, doAnimation );
529
+ },
530
+ stop: function( type, clearQueue, gotoEnd ) {
531
+ var stopQueue = function( hooks ) {
532
+ var stop = hooks.stop;
533
+ delete hooks.stop;
534
+ stop( gotoEnd );
535
+ };
536
+
537
+ if ( typeof type !== "string" ) {
538
+ gotoEnd = clearQueue;
539
+ clearQueue = type;
540
+ type = undefined;
541
+ }
542
+ if ( clearQueue && type !== false ) {
543
+ this.queue( type || "fx", [] );
544
+ }
545
+
546
+ return this.each( function() {
547
+ var dequeue = true,
548
+ index = type != null && type + "queueHooks",
549
+ timers = jQuery.timers,
550
+ data = dataPriv.get( this );
551
+
552
+ if ( index ) {
553
+ if ( data[ index ] && data[ index ].stop ) {
554
+ stopQueue( data[ index ] );
555
+ }
556
+ } else {
557
+ for ( index in data ) {
558
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
559
+ stopQueue( data[ index ] );
560
+ }
561
+ }
562
+ }
563
+
564
+ for ( index = timers.length; index--; ) {
565
+ if ( timers[ index ].elem === this &&
566
+ ( type == null || timers[ index ].queue === type ) ) {
567
+
568
+ timers[ index ].anim.stop( gotoEnd );
569
+ dequeue = false;
570
+ timers.splice( index, 1 );
571
+ }
572
+ }
573
+
574
+ // Start the next in the queue if the last step wasn't forced.
575
+ // Timers currently will call their complete callbacks, which
576
+ // will dequeue but only if they were gotoEnd.
577
+ if ( dequeue || !gotoEnd ) {
578
+ jQuery.dequeue( this, type );
579
+ }
580
+ } );
581
+ },
582
+ finish: function( type ) {
583
+ if ( type !== false ) {
584
+ type = type || "fx";
585
+ }
586
+ return this.each( function() {
587
+ var index,
588
+ data = dataPriv.get( this ),
589
+ queue = data[ type + "queue" ],
590
+ hooks = data[ type + "queueHooks" ],
591
+ timers = jQuery.timers,
592
+ length = queue ? queue.length : 0;
593
+
594
+ // Enable finishing flag on private data
595
+ data.finish = true;
596
+
597
+ // Empty the queue first
598
+ jQuery.queue( this, type, [] );
599
+
600
+ if ( hooks && hooks.stop ) {
601
+ hooks.stop.call( this, true );
602
+ }
603
+
604
+ // Look for any active animations, and finish them
605
+ for ( index = timers.length; index--; ) {
606
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
607
+ timers[ index ].anim.stop( true );
608
+ timers.splice( index, 1 );
609
+ }
610
+ }
611
+
612
+ // Look for any animations in the old queue and finish them
613
+ for ( index = 0; index < length; index++ ) {
614
+ if ( queue[ index ] && queue[ index ].finish ) {
615
+ queue[ index ].finish.call( this );
616
+ }
617
+ }
618
+
619
+ // Turn off finishing flag
620
+ delete data.finish;
621
+ } );
622
+ }
623
+ } );
624
+
625
+ jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
626
+ var cssFn = jQuery.fn[ name ];
627
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
628
+ return speed == null || typeof speed === "boolean" ?
629
+ cssFn.apply( this, arguments ) :
630
+ this.animate( genFx( name, true ), speed, easing, callback );
631
+ };
632
+ } );
633
+
634
+ // Generate shortcuts for custom animations
635
+ jQuery.each( {
636
+ slideDown: genFx( "show" ),
637
+ slideUp: genFx( "hide" ),
638
+ slideToggle: genFx( "toggle" ),
639
+ fadeIn: { opacity: "show" },
640
+ fadeOut: { opacity: "hide" },
641
+ fadeToggle: { opacity: "toggle" }
642
+ }, function( name, props ) {
643
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
644
+ return this.animate( props, speed, easing, callback );
645
+ };
646
+ } );
647
+
648
+ jQuery.timers = [];
649
+ jQuery.fx.tick = function() {
650
+ var timer,
651
+ i = 0,
652
+ timers = jQuery.timers;
653
+
654
+ fxNow = jQuery.now();
655
+
656
+ for ( ; i < timers.length; i++ ) {
657
+ timer = timers[ i ];
658
+
659
+ // Run the timer and safely remove it when done (allowing for external removal)
660
+ if ( !timer() && timers[ i ] === timer ) {
661
+ timers.splice( i--, 1 );
662
+ }
663
+ }
664
+
665
+ if ( !timers.length ) {
666
+ jQuery.fx.stop();
667
+ }
668
+ fxNow = undefined;
669
+ };
670
+
671
+ jQuery.fx.timer = function( timer ) {
672
+ jQuery.timers.push( timer );
673
+ jQuery.fx.start();
674
+ };
675
+
676
+ jQuery.fx.interval = 13;
677
+ jQuery.fx.start = function() {
678
+ if ( inProgress ) {
679
+ return;
680
+ }
681
+
682
+ inProgress = true;
683
+ schedule();
684
+ };
685
+
686
+ jQuery.fx.stop = function() {
687
+ inProgress = null;
688
+ };
689
+
690
+ jQuery.fx.speeds = {
691
+ slow: 600,
692
+ fast: 200,
693
+
694
+ // Default speed
695
+ _default: 400
696
+ };
697
+
698
+ return jQuery;
699
+ } );