govuk_publishing_components 28.9.2 → 29.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/config/govuk_publishing_components_manifest.js +15 -3
  4. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +2 -5
  5. data/app/assets/javascripts/govuk_publishing_components/modules.js +15 -18
  6. data/app/assets/javascripts/govuk_publishing_components/{rum-loader.js.erb → rum-loader.js} +13 -10
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -0
  8. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +7 -1
  9. data/app/views/govuk_publishing_components/components/docs/big_number.yml +3 -3
  10. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +3 -3
  11. data/app/views/govuk_publishing_components/components/docs/button.yml +2 -2
  12. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +5 -5
  13. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +1 -1
  14. data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +1 -1
  15. data/app/views/govuk_publishing_components/components/docs/contextual_guidance.yml +1 -1
  16. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
  17. data/app/views/govuk_publishing_components/components/docs/date_input.yml +1 -1
  18. data/app/views/govuk_publishing_components/components/docs/details.yml +1 -1
  19. data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +1 -1
  20. data/app/views/govuk_publishing_components/components/docs/document_list.yml +2 -2
  21. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -1
  22. data/app/views/govuk_publishing_components/components/docs/error_summary.yml +2 -2
  23. data/app/views/govuk_publishing_components/components/docs/feedback.yml +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/fieldset.yml +4 -4
  25. data/app/views/govuk_publishing_components/components/docs/heading.yml +4 -4
  26. data/app/views/govuk_publishing_components/components/docs/hint.yml +1 -1
  27. data/app/views/govuk_publishing_components/components/docs/input.yml +3 -3
  28. data/app/views/govuk_publishing_components/components/docs/inset_text.yml +1 -1
  29. data/app/views/govuk_publishing_components/components/docs/label.yml +1 -1
  30. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +2 -2
  31. data/app/views/govuk_publishing_components/components/docs/lead_paragraph.yml +1 -1
  32. data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -1
  33. data/app/views/govuk_publishing_components/components/docs/notice.yml +2 -2
  34. data/app/views/govuk_publishing_components/components/docs/print_link.yml +1 -1
  35. data/app/views/govuk_publishing_components/components/docs/search.yml +4 -4
  36. data/app/views/govuk_publishing_components/components/docs/select.yml +5 -5
  37. data/app/views/govuk_publishing_components/components/docs/show_password.yml +3 -3
  38. data/app/views/govuk_publishing_components/components/docs/signup_link.yml +1 -1
  39. data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +2 -2
  40. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +1 -1
  41. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +3 -3
  42. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +3 -3
  43. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +1 -1
  44. data/app/views/govuk_publishing_components/components/docs/table.yml +1 -1
  45. data/app/views/govuk_publishing_components/components/docs/textarea.yml +1 -1
  46. data/app/views/govuk_publishing_components/components/docs/title.yml +1 -1
  47. data/config/initializers/assets.rb +15 -45
  48. data/lib/govuk_publishing_components/version.rb +1 -1
  49. metadata +10 -117
  50. data/node_modules/jquery/AUTHORS.txt +0 -266
  51. data/node_modules/jquery/LICENSE.txt +0 -36
  52. data/node_modules/jquery/README.md +0 -65
  53. data/node_modules/jquery/bower.json +0 -14
  54. data/node_modules/jquery/dist/jquery.js +0 -11008
  55. data/node_modules/jquery/dist/jquery.min.js +0 -5
  56. data/node_modules/jquery/dist/jquery.min.map +0 -1
  57. data/node_modules/jquery/external/sizzle/LICENSE.txt +0 -36
  58. data/node_modules/jquery/external/sizzle/dist/sizzle.js +0 -2143
  59. data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +0 -3
  60. data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +0 -1
  61. data/node_modules/jquery/package.json +0 -85
  62. data/node_modules/jquery/src/ajax/jsonp.js +0 -100
  63. data/node_modules/jquery/src/ajax/load.js +0 -83
  64. data/node_modules/jquery/src/ajax/parseJSON.js +0 -53
  65. data/node_modules/jquery/src/ajax/parseXML.js +0 -31
  66. data/node_modules/jquery/src/ajax/script.js +0 -95
  67. data/node_modules/jquery/src/ajax/var/location.js +0 -3
  68. data/node_modules/jquery/src/ajax/var/nonce.js +0 -5
  69. data/node_modules/jquery/src/ajax/var/rquery.js +0 -3
  70. data/node_modules/jquery/src/ajax/xhr.js +0 -229
  71. data/node_modules/jquery/src/ajax.js +0 -842
  72. data/node_modules/jquery/src/attributes/attr.js +0 -281
  73. data/node_modules/jquery/src/attributes/classes.js +0 -174
  74. data/node_modules/jquery/src/attributes/prop.js +0 -156
  75. data/node_modules/jquery/src/attributes/support.js +0 -70
  76. data/node_modules/jquery/src/attributes/val.js +0 -191
  77. data/node_modules/jquery/src/attributes.js +0 -11
  78. data/node_modules/jquery/src/callbacks.js +0 -232
  79. data/node_modules/jquery/src/core/access.js +0 -65
  80. data/node_modules/jquery/src/core/init.js +0 -140
  81. data/node_modules/jquery/src/core/parseHTML.js +0 -41
  82. data/node_modules/jquery/src/core/ready.js +0 -163
  83. data/node_modules/jquery/src/core/var/rsingleTag.js +0 -5
  84. data/node_modules/jquery/src/core.js +0 -529
  85. data/node_modules/jquery/src/css/addGetHookIf.js +0 -24
  86. data/node_modules/jquery/src/css/adjustCSS.js +0 -65
  87. data/node_modules/jquery/src/css/curCSS.js +0 -137
  88. data/node_modules/jquery/src/css/defaultDisplay.js +0 -72
  89. data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +0 -42
  90. data/node_modules/jquery/src/css/showHide.js +0 -45
  91. data/node_modules/jquery/src/css/support.js +0 -184
  92. data/node_modules/jquery/src/css/var/cssExpand.js +0 -3
  93. data/node_modules/jquery/src/css/var/isHidden.js +0 -16
  94. data/node_modules/jquery/src/css/var/rmargin.js +0 -3
  95. data/node_modules/jquery/src/css/var/rnumnonpx.js +0 -5
  96. data/node_modules/jquery/src/css/var/swap.js +0 -24
  97. data/node_modules/jquery/src/css.js +0 -563
  98. data/node_modules/jquery/src/data/support.js +0 -23
  99. data/node_modules/jquery/src/data/var/acceptData.js +0 -20
  100. data/node_modules/jquery/src/data.js +0 -342
  101. data/node_modules/jquery/src/deferred.js +0 -159
  102. data/node_modules/jquery/src/deprecated.js +0 -34
  103. data/node_modules/jquery/src/dimensions.js +0 -56
  104. data/node_modules/jquery/src/effects/Tween.js +0 -121
  105. data/node_modules/jquery/src/effects/animatedSelector.js +0 -13
  106. data/node_modules/jquery/src/effects/support.js +0 -58
  107. data/node_modules/jquery/src/effects.js +0 -640
  108. data/node_modules/jquery/src/event/ajax.js +0 -20
  109. data/node_modules/jquery/src/event/alias.js +0 -25
  110. data/node_modules/jquery/src/event/support.js +0 -28
  111. data/node_modules/jquery/src/event.js +0 -1134
  112. data/node_modules/jquery/src/exports/amd.js +0 -24
  113. data/node_modules/jquery/src/exports/global.js +0 -26
  114. data/node_modules/jquery/src/intro.js +0 -44
  115. data/node_modules/jquery/src/jquery.js +0 -37
  116. data/node_modules/jquery/src/manipulation/_evalUrl.js +0 -21
  117. data/node_modules/jquery/src/manipulation/buildFragment.js +0 -157
  118. data/node_modules/jquery/src/manipulation/createSafeFragment.js +0 -20
  119. data/node_modules/jquery/src/manipulation/getAll.js +0 -33
  120. data/node_modules/jquery/src/manipulation/setGlobalEval.js +0 -19
  121. data/node_modules/jquery/src/manipulation/support.js +0 -72
  122. data/node_modules/jquery/src/manipulation/var/nodeNames.js +0 -5
  123. data/node_modules/jquery/src/manipulation/var/rcheckableType.js +0 -3
  124. data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +0 -3
  125. data/node_modules/jquery/src/manipulation/var/rscriptType.js +0 -3
  126. data/node_modules/jquery/src/manipulation/var/rtagName.js +0 -3
  127. data/node_modules/jquery/src/manipulation/wrapMap.js +0 -30
  128. data/node_modules/jquery/src/manipulation.js +0 -585
  129. data/node_modules/jquery/src/offset.js +0 -219
  130. data/node_modules/jquery/src/outro.js +0 -2
  131. data/node_modules/jquery/src/queue/delay.js +0 -22
  132. data/node_modules/jquery/src/queue.js +0 -144
  133. data/node_modules/jquery/src/selector-sizzle.js +0 -14
  134. data/node_modules/jquery/src/selector.js +0 -1
  135. data/node_modules/jquery/src/serialize.js +0 -125
  136. data/node_modules/jquery/src/support.js +0 -63
  137. data/node_modules/jquery/src/traversing/findFilter.js +0 -100
  138. data/node_modules/jquery/src/traversing/var/dir.js +0 -20
  139. data/node_modules/jquery/src/traversing/var/rneedsContext.js +0 -6
  140. data/node_modules/jquery/src/traversing/var/siblings.js +0 -15
  141. data/node_modules/jquery/src/traversing.js +0 -179
  142. data/node_modules/jquery/src/var/class2type.js +0 -5
  143. data/node_modules/jquery/src/var/concat.js +0 -5
  144. data/node_modules/jquery/src/var/deletedIds.js +0 -3
  145. data/node_modules/jquery/src/var/document.js +0 -3
  146. data/node_modules/jquery/src/var/documentElement.js +0 -5
  147. data/node_modules/jquery/src/var/hasOwn.js +0 -5
  148. data/node_modules/jquery/src/var/indexOf.js +0 -5
  149. data/node_modules/jquery/src/var/pnum.js +0 -3
  150. data/node_modules/jquery/src/var/push.js +0 -5
  151. data/node_modules/jquery/src/var/rcssNum.js +0 -7
  152. data/node_modules/jquery/src/var/rnotwhite.js +0 -3
  153. data/node_modules/jquery/src/var/slice.js +0 -5
  154. data/node_modules/jquery/src/var/support.js +0 -5
  155. data/node_modules/jquery/src/var/toString.js +0 -5
  156. data/node_modules/jquery/src/wrap.js +0 -77
@@ -1,13 +0,0 @@
1
- define( [
2
- "../core",
3
- "../selector",
4
- "../effects"
5
- ], function( jQuery ) {
6
-
7
- jQuery.expr.filters.animated = function( elem ) {
8
- return jQuery.grep( jQuery.timers, function( fn ) {
9
- return elem === fn.elem;
10
- } ).length;
11
- };
12
-
13
- } );
@@ -1,58 +0,0 @@
1
- define( [
2
- "../var/support",
3
- "../var/document"
4
- ], function( support, document ) {
5
-
6
- ( function() {
7
- var shrinkWrapBlocksVal;
8
-
9
- support.shrinkWrapBlocks = function() {
10
- if ( shrinkWrapBlocksVal != null ) {
11
- return shrinkWrapBlocksVal;
12
- }
13
-
14
- // Will be changed later if needed.
15
- shrinkWrapBlocksVal = false;
16
-
17
- // Minified: var b,c,d
18
- var div, body, container;
19
-
20
- body = document.getElementsByTagName( "body" )[ 0 ];
21
- if ( !body || !body.style ) {
22
-
23
- // Test fired too early or in an unsupported environment, exit.
24
- return;
25
- }
26
-
27
- // Setup
28
- div = document.createElement( "div" );
29
- container = document.createElement( "div" );
30
- container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
31
- body.appendChild( container ).appendChild( div );
32
-
33
- // Support: IE6
34
- // Check if elements with layout shrink-wrap their children
35
- if ( typeof div.style.zoom !== "undefined" ) {
36
-
37
- // Reset CSS: box-sizing; display; margin; border
38
- div.style.cssText =
39
-
40
- // Support: Firefox<29, Android 2.3
41
- // Vendor-prefix box-sizing
42
- "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
43
- "box-sizing:content-box;display:block;margin:0;border:0;" +
44
- "padding:1px;width:1px;zoom:1";
45
- div.appendChild( document.createElement( "div" ) ).style.width = "5px";
46
- shrinkWrapBlocksVal = div.offsetWidth !== 3;
47
- }
48
-
49
- body.removeChild( container );
50
-
51
- return shrinkWrapBlocksVal;
52
- };
53
-
54
- } )();
55
-
56
- return support;
57
-
58
- } );
@@ -1,640 +0,0 @@
1
- define( [
2
- "./core",
3
- "./effects/support",
4
- "./var/rcssNum",
5
- "./var/rnotwhite",
6
- "./css/var/cssExpand",
7
- "./css/var/isHidden",
8
- "./css/adjustCSS",
9
- "./css/defaultDisplay",
10
-
11
- "./var/document",
12
- "./core/init",
13
- "./effects/Tween",
14
- "./queue",
15
- "./css",
16
- "./deferred",
17
- "./traversing"
18
- ], function( jQuery, support, rcssNum, rnotwhite,
19
- cssExpand, isHidden, adjustCSS, defaultDisplay ) {
20
-
21
- var
22
- fxNow, timerId,
23
- rfxtypes = /^(?:toggle|show|hide)$/,
24
- rrun = /queueHooks$/;
25
-
26
- // Animations created synchronously will run synchronously
27
- function createFxNow() {
28
- window.setTimeout( function() {
29
- fxNow = undefined;
30
- } );
31
- return ( fxNow = jQuery.now() );
32
- }
33
-
34
- // Generate parameters to create a standard animation
35
- function genFx( type, includeWidth ) {
36
- var which,
37
- attrs = { height: type },
38
- i = 0;
39
-
40
- // if we include width, step value is 1 to do all cssExpand values,
41
- // if we don't include width, step value is 2 to skip over Left and Right
42
- includeWidth = includeWidth ? 1 : 0;
43
- for ( ; i < 4 ; i += 2 - includeWidth ) {
44
- which = cssExpand[ i ];
45
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
46
- }
47
-
48
- if ( includeWidth ) {
49
- attrs.opacity = attrs.width = type;
50
- }
51
-
52
- return attrs;
53
- }
54
-
55
- function createTween( value, prop, animation ) {
56
- var tween,
57
- collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
58
- index = 0,
59
- length = collection.length;
60
- for ( ; index < length; index++ ) {
61
- if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
62
-
63
- // we're done with this property
64
- return tween;
65
- }
66
- }
67
- }
68
-
69
- function defaultPrefilter( elem, props, opts ) {
70
- /* jshint validthis: true */
71
- var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
72
- anim = this,
73
- orig = {},
74
- style = elem.style,
75
- hidden = elem.nodeType && isHidden( elem ),
76
- dataShow = jQuery._data( elem, "fxshow" );
77
-
78
- // handle queue: false promises
79
- if ( !opts.queue ) {
80
- hooks = jQuery._queueHooks( elem, "fx" );
81
- if ( hooks.unqueued == null ) {
82
- hooks.unqueued = 0;
83
- oldfire = hooks.empty.fire;
84
- hooks.empty.fire = function() {
85
- if ( !hooks.unqueued ) {
86
- oldfire();
87
- }
88
- };
89
- }
90
- hooks.unqueued++;
91
-
92
- anim.always( function() {
93
-
94
- // doing this makes sure that the complete handler will be called
95
- // before this completes
96
- anim.always( function() {
97
- hooks.unqueued--;
98
- if ( !jQuery.queue( elem, "fx" ).length ) {
99
- hooks.empty.fire();
100
- }
101
- } );
102
- } );
103
- }
104
-
105
- // height/width overflow pass
106
- if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
107
-
108
- // Make sure that nothing sneaks out
109
- // Record all 3 overflow attributes because IE does not
110
- // change the overflow attribute when overflowX and
111
- // overflowY are set to the same value
112
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
113
-
114
- // Set display property to inline-block for height/width
115
- // animations on inline elements that are having width/height animated
116
- display = jQuery.css( elem, "display" );
117
-
118
- // Test default display if display is currently "none"
119
- checkDisplay = display === "none" ?
120
- jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
121
-
122
- if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
123
-
124
- // inline-level elements accept inline-block;
125
- // block-level elements need to be inline with layout
126
- if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
127
- style.display = "inline-block";
128
- } else {
129
- style.zoom = 1;
130
- }
131
- }
132
- }
133
-
134
- if ( opts.overflow ) {
135
- style.overflow = "hidden";
136
- if ( !support.shrinkWrapBlocks() ) {
137
- anim.always( function() {
138
- style.overflow = opts.overflow[ 0 ];
139
- style.overflowX = opts.overflow[ 1 ];
140
- style.overflowY = opts.overflow[ 2 ];
141
- } );
142
- }
143
- }
144
-
145
- // show/hide pass
146
- for ( prop in props ) {
147
- value = props[ prop ];
148
- if ( rfxtypes.exec( value ) ) {
149
- delete props[ prop ];
150
- toggle = toggle || value === "toggle";
151
- if ( value === ( hidden ? "hide" : "show" ) ) {
152
-
153
- // If there is dataShow left over from a stopped hide or show
154
- // and we are going to proceed with show, we should pretend to be hidden
155
- if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
156
- hidden = true;
157
- } else {
158
- continue;
159
- }
160
- }
161
- orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
162
-
163
- // Any non-fx value stops us from restoring the original display value
164
- } else {
165
- display = undefined;
166
- }
167
- }
168
-
169
- if ( !jQuery.isEmptyObject( orig ) ) {
170
- if ( dataShow ) {
171
- if ( "hidden" in dataShow ) {
172
- hidden = dataShow.hidden;
173
- }
174
- } else {
175
- dataShow = jQuery._data( elem, "fxshow", {} );
176
- }
177
-
178
- // store state if its toggle - enables .stop().toggle() to "reverse"
179
- if ( toggle ) {
180
- dataShow.hidden = !hidden;
181
- }
182
- if ( hidden ) {
183
- jQuery( elem ).show();
184
- } else {
185
- anim.done( function() {
186
- jQuery( elem ).hide();
187
- } );
188
- }
189
- anim.done( function() {
190
- var prop;
191
- jQuery._removeData( elem, "fxshow" );
192
- for ( prop in orig ) {
193
- jQuery.style( elem, prop, orig[ prop ] );
194
- }
195
- } );
196
- for ( prop in orig ) {
197
- tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
198
-
199
- if ( !( prop in dataShow ) ) {
200
- dataShow[ prop ] = tween.start;
201
- if ( hidden ) {
202
- tween.end = tween.start;
203
- tween.start = prop === "width" || prop === "height" ? 1 : 0;
204
- }
205
- }
206
- }
207
-
208
- // If this is a noop like .hide().hide(), restore an overwritten display value
209
- } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
210
- style.display = display;
211
- }
212
- }
213
-
214
- function propFilter( props, specialEasing ) {
215
- var index, name, easing, value, hooks;
216
-
217
- // camelCase, specialEasing and expand cssHook pass
218
- for ( index in props ) {
219
- name = jQuery.camelCase( index );
220
- easing = specialEasing[ name ];
221
- value = props[ index ];
222
- if ( jQuery.isArray( value ) ) {
223
- easing = value[ 1 ];
224
- value = props[ index ] = value[ 0 ];
225
- }
226
-
227
- if ( index !== name ) {
228
- props[ name ] = value;
229
- delete props[ index ];
230
- }
231
-
232
- hooks = jQuery.cssHooks[ name ];
233
- if ( hooks && "expand" in hooks ) {
234
- value = hooks.expand( value );
235
- delete props[ name ];
236
-
237
- // not quite $.extend, this wont overwrite keys already present.
238
- // also - reusing 'index' from above because we have the correct "name"
239
- for ( index in value ) {
240
- if ( !( index in props ) ) {
241
- props[ index ] = value[ index ];
242
- specialEasing[ index ] = easing;
243
- }
244
- }
245
- } else {
246
- specialEasing[ name ] = easing;
247
- }
248
- }
249
- }
250
-
251
- function Animation( elem, properties, options ) {
252
- var result,
253
- stopped,
254
- index = 0,
255
- length = Animation.prefilters.length,
256
- deferred = jQuery.Deferred().always( function() {
257
-
258
- // don't match elem in the :animated selector
259
- delete tick.elem;
260
- } ),
261
- tick = function() {
262
- if ( stopped ) {
263
- return false;
264
- }
265
- var currentTime = fxNow || createFxNow(),
266
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
267
-
268
- // Support: Android 2.3
269
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
270
- temp = remaining / animation.duration || 0,
271
- percent = 1 - temp,
272
- index = 0,
273
- length = animation.tweens.length;
274
-
275
- for ( ; index < length ; index++ ) {
276
- animation.tweens[ index ].run( percent );
277
- }
278
-
279
- deferred.notifyWith( elem, [ animation, percent, remaining ] );
280
-
281
- if ( percent < 1 && length ) {
282
- return remaining;
283
- } else {
284
- deferred.resolveWith( elem, [ animation ] );
285
- return false;
286
- }
287
- },
288
- animation = deferred.promise( {
289
- elem: elem,
290
- props: jQuery.extend( {}, properties ),
291
- opts: jQuery.extend( true, {
292
- specialEasing: {},
293
- easing: jQuery.easing._default
294
- }, options ),
295
- originalProperties: properties,
296
- originalOptions: options,
297
- startTime: fxNow || createFxNow(),
298
- duration: options.duration,
299
- tweens: [],
300
- createTween: function( prop, end ) {
301
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
302
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
303
- animation.tweens.push( tween );
304
- return tween;
305
- },
306
- stop: function( gotoEnd ) {
307
- var index = 0,
308
-
309
- // if we are going to the end, we want to run all the tweens
310
- // otherwise we skip this part
311
- length = gotoEnd ? animation.tweens.length : 0;
312
- if ( stopped ) {
313
- return this;
314
- }
315
- stopped = true;
316
- for ( ; index < length ; index++ ) {
317
- animation.tweens[ index ].run( 1 );
318
- }
319
-
320
- // resolve when we played the last frame
321
- // otherwise, reject
322
- if ( gotoEnd ) {
323
- deferred.notifyWith( elem, [ animation, 1, 0 ] );
324
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
325
- } else {
326
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
327
- }
328
- return this;
329
- }
330
- } ),
331
- props = animation.props;
332
-
333
- propFilter( props, animation.opts.specialEasing );
334
-
335
- for ( ; index < length ; index++ ) {
336
- result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
337
- if ( result ) {
338
- if ( jQuery.isFunction( result.stop ) ) {
339
- jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
340
- jQuery.proxy( result.stop, result );
341
- }
342
- return result;
343
- }
344
- }
345
-
346
- jQuery.map( props, createTween, animation );
347
-
348
- if ( jQuery.isFunction( animation.opts.start ) ) {
349
- animation.opts.start.call( elem, animation );
350
- }
351
-
352
- jQuery.fx.timer(
353
- jQuery.extend( tick, {
354
- elem: elem,
355
- anim: animation,
356
- queue: animation.opts.queue
357
- } )
358
- );
359
-
360
- // attach callbacks from options
361
- return animation.progress( animation.opts.progress )
362
- .done( animation.opts.done, animation.opts.complete )
363
- .fail( animation.opts.fail )
364
- .always( animation.opts.always );
365
- }
366
-
367
- jQuery.Animation = jQuery.extend( Animation, {
368
-
369
- tweeners: {
370
- "*": [ function( prop, value ) {
371
- var tween = this.createTween( prop, value );
372
- adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
373
- return tween;
374
- } ]
375
- },
376
-
377
- tweener: function( props, callback ) {
378
- if ( jQuery.isFunction( props ) ) {
379
- callback = props;
380
- props = [ "*" ];
381
- } else {
382
- props = props.match( rnotwhite );
383
- }
384
-
385
- var prop,
386
- index = 0,
387
- length = props.length;
388
-
389
- for ( ; index < length ; index++ ) {
390
- prop = props[ index ];
391
- Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
392
- Animation.tweeners[ prop ].unshift( callback );
393
- }
394
- },
395
-
396
- prefilters: [ defaultPrefilter ],
397
-
398
- prefilter: function( callback, prepend ) {
399
- if ( prepend ) {
400
- Animation.prefilters.unshift( callback );
401
- } else {
402
- Animation.prefilters.push( callback );
403
- }
404
- }
405
- } );
406
-
407
- jQuery.speed = function( speed, easing, fn ) {
408
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
409
- complete: fn || !fn && easing ||
410
- jQuery.isFunction( speed ) && speed,
411
- duration: speed,
412
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
413
- };
414
-
415
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
416
- opt.duration in jQuery.fx.speeds ?
417
- jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
418
-
419
- // normalize opt.queue - true/undefined/null -> "fx"
420
- if ( opt.queue == null || opt.queue === true ) {
421
- opt.queue = "fx";
422
- }
423
-
424
- // Queueing
425
- opt.old = opt.complete;
426
-
427
- opt.complete = function() {
428
- if ( jQuery.isFunction( opt.old ) ) {
429
- opt.old.call( this );
430
- }
431
-
432
- if ( opt.queue ) {
433
- jQuery.dequeue( this, opt.queue );
434
- }
435
- };
436
-
437
- return opt;
438
- };
439
-
440
- jQuery.fn.extend( {
441
- fadeTo: function( speed, to, easing, callback ) {
442
-
443
- // show any hidden elements after setting opacity to 0
444
- return this.filter( isHidden ).css( "opacity", 0 ).show()
445
-
446
- // animate to the value specified
447
- .end().animate( { opacity: to }, speed, easing, callback );
448
- },
449
- animate: function( prop, speed, easing, callback ) {
450
- var empty = jQuery.isEmptyObject( prop ),
451
- optall = jQuery.speed( speed, easing, callback ),
452
- doAnimation = function() {
453
-
454
- // Operate on a copy of prop so per-property easing won't be lost
455
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
456
-
457
- // Empty animations, or finishing resolves immediately
458
- if ( empty || jQuery._data( this, "finish" ) ) {
459
- anim.stop( true );
460
- }
461
- };
462
- doAnimation.finish = doAnimation;
463
-
464
- return empty || optall.queue === false ?
465
- this.each( doAnimation ) :
466
- this.queue( optall.queue, doAnimation );
467
- },
468
- stop: function( type, clearQueue, gotoEnd ) {
469
- var stopQueue = function( hooks ) {
470
- var stop = hooks.stop;
471
- delete hooks.stop;
472
- stop( gotoEnd );
473
- };
474
-
475
- if ( typeof type !== "string" ) {
476
- gotoEnd = clearQueue;
477
- clearQueue = type;
478
- type = undefined;
479
- }
480
- if ( clearQueue && type !== false ) {
481
- this.queue( type || "fx", [] );
482
- }
483
-
484
- return this.each( function() {
485
- var dequeue = true,
486
- index = type != null && type + "queueHooks",
487
- timers = jQuery.timers,
488
- data = jQuery._data( this );
489
-
490
- if ( index ) {
491
- if ( data[ index ] && data[ index ].stop ) {
492
- stopQueue( data[ index ] );
493
- }
494
- } else {
495
- for ( index in data ) {
496
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
497
- stopQueue( data[ index ] );
498
- }
499
- }
500
- }
501
-
502
- for ( index = timers.length; index--; ) {
503
- if ( timers[ index ].elem === this &&
504
- ( type == null || timers[ index ].queue === type ) ) {
505
-
506
- timers[ index ].anim.stop( gotoEnd );
507
- dequeue = false;
508
- timers.splice( index, 1 );
509
- }
510
- }
511
-
512
- // start the next in the queue if the last step wasn't forced
513
- // timers currently will call their complete callbacks, which will dequeue
514
- // but only if they were gotoEnd
515
- if ( dequeue || !gotoEnd ) {
516
- jQuery.dequeue( this, type );
517
- }
518
- } );
519
- },
520
- finish: function( type ) {
521
- if ( type !== false ) {
522
- type = type || "fx";
523
- }
524
- return this.each( function() {
525
- var index,
526
- data = jQuery._data( this ),
527
- queue = data[ type + "queue" ],
528
- hooks = data[ type + "queueHooks" ],
529
- timers = jQuery.timers,
530
- length = queue ? queue.length : 0;
531
-
532
- // enable finishing flag on private data
533
- data.finish = true;
534
-
535
- // empty the queue first
536
- jQuery.queue( this, type, [] );
537
-
538
- if ( hooks && hooks.stop ) {
539
- hooks.stop.call( this, true );
540
- }
541
-
542
- // look for any active animations, and finish them
543
- for ( index = timers.length; index--; ) {
544
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
545
- timers[ index ].anim.stop( true );
546
- timers.splice( index, 1 );
547
- }
548
- }
549
-
550
- // look for any animations in the old queue and finish them
551
- for ( index = 0; index < length; index++ ) {
552
- if ( queue[ index ] && queue[ index ].finish ) {
553
- queue[ index ].finish.call( this );
554
- }
555
- }
556
-
557
- // turn off finishing flag
558
- delete data.finish;
559
- } );
560
- }
561
- } );
562
-
563
- jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
564
- var cssFn = jQuery.fn[ name ];
565
- jQuery.fn[ name ] = function( speed, easing, callback ) {
566
- return speed == null || typeof speed === "boolean" ?
567
- cssFn.apply( this, arguments ) :
568
- this.animate( genFx( name, true ), speed, easing, callback );
569
- };
570
- } );
571
-
572
- // Generate shortcuts for custom animations
573
- jQuery.each( {
574
- slideDown: genFx( "show" ),
575
- slideUp: genFx( "hide" ),
576
- slideToggle: genFx( "toggle" ),
577
- fadeIn: { opacity: "show" },
578
- fadeOut: { opacity: "hide" },
579
- fadeToggle: { opacity: "toggle" }
580
- }, function( name, props ) {
581
- jQuery.fn[ name ] = function( speed, easing, callback ) {
582
- return this.animate( props, speed, easing, callback );
583
- };
584
- } );
585
-
586
- jQuery.timers = [];
587
- jQuery.fx.tick = function() {
588
- var timer,
589
- timers = jQuery.timers,
590
- i = 0;
591
-
592
- fxNow = jQuery.now();
593
-
594
- for ( ; i < timers.length; i++ ) {
595
- timer = timers[ i ];
596
-
597
- // Checks the timer has not already been removed
598
- if ( !timer() && timers[ i ] === timer ) {
599
- timers.splice( i--, 1 );
600
- }
601
- }
602
-
603
- if ( !timers.length ) {
604
- jQuery.fx.stop();
605
- }
606
- fxNow = undefined;
607
- };
608
-
609
- jQuery.fx.timer = function( timer ) {
610
- jQuery.timers.push( timer );
611
- if ( timer() ) {
612
- jQuery.fx.start();
613
- } else {
614
- jQuery.timers.pop();
615
- }
616
- };
617
-
618
- jQuery.fx.interval = 13;
619
-
620
- jQuery.fx.start = function() {
621
- if ( !timerId ) {
622
- timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
623
- }
624
- };
625
-
626
- jQuery.fx.stop = function() {
627
- window.clearInterval( timerId );
628
- timerId = null;
629
- };
630
-
631
- jQuery.fx.speeds = {
632
- slow: 600,
633
- fast: 200,
634
-
635
- // Default speed
636
- _default: 400
637
- };
638
-
639
- return jQuery;
640
- } );