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,281 +0,0 @@
1
- define( [
2
- "../core",
3
- "../core/access",
4
- "./support",
5
- "../var/rnotwhite",
6
- "./val",
7
- "../selector"
8
- ], function( jQuery, access, support, rnotwhite ) {
9
-
10
- var nodeHook, boolHook,
11
- attrHandle = jQuery.expr.attrHandle,
12
- ruseDefault = /^(?:checked|selected)$/i,
13
- getSetAttribute = support.getSetAttribute,
14
- getSetInput = support.input;
15
-
16
- jQuery.fn.extend( {
17
- attr: function( name, value ) {
18
- return access( this, jQuery.attr, name, value, arguments.length > 1 );
19
- },
20
-
21
- removeAttr: function( name ) {
22
- return this.each( function() {
23
- jQuery.removeAttr( this, name );
24
- } );
25
- }
26
- } );
27
-
28
- jQuery.extend( {
29
- attr: function( elem, name, value ) {
30
- var ret, hooks,
31
- nType = elem.nodeType;
32
-
33
- // Don't get/set attributes on text, comment and attribute nodes
34
- if ( nType === 3 || nType === 8 || nType === 2 ) {
35
- return;
36
- }
37
-
38
- // Fallback to prop when attributes are not supported
39
- if ( typeof elem.getAttribute === "undefined" ) {
40
- return jQuery.prop( elem, name, value );
41
- }
42
-
43
- // All attributes are lowercase
44
- // Grab necessary hook if one is defined
45
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
46
- name = name.toLowerCase();
47
- hooks = jQuery.attrHooks[ name ] ||
48
- ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
49
- }
50
-
51
- if ( value !== undefined ) {
52
- if ( value === null ) {
53
- jQuery.removeAttr( elem, name );
54
- return;
55
- }
56
-
57
- if ( hooks && "set" in hooks &&
58
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
59
- return ret;
60
- }
61
-
62
- elem.setAttribute( name, value + "" );
63
- return value;
64
- }
65
-
66
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
67
- return ret;
68
- }
69
-
70
- ret = jQuery.find.attr( elem, name );
71
-
72
- // Non-existent attributes return null, we normalize to undefined
73
- return ret == null ? undefined : ret;
74
- },
75
-
76
- attrHooks: {
77
- type: {
78
- set: function( elem, value ) {
79
- if ( !support.radioValue && value === "radio" &&
80
- jQuery.nodeName( elem, "input" ) ) {
81
-
82
- // Setting the type on a radio button after the value resets the value in IE8-9
83
- // Reset value to default in case type is set after value during creation
84
- var val = elem.value;
85
- elem.setAttribute( "type", value );
86
- if ( val ) {
87
- elem.value = val;
88
- }
89
- return value;
90
- }
91
- }
92
- }
93
- },
94
-
95
- removeAttr: function( elem, value ) {
96
- var name, propName,
97
- i = 0,
98
- attrNames = value && value.match( rnotwhite );
99
-
100
- if ( attrNames && elem.nodeType === 1 ) {
101
- while ( ( name = attrNames[ i++ ] ) ) {
102
- propName = jQuery.propFix[ name ] || name;
103
-
104
- // Boolean attributes get special treatment (#10870)
105
- if ( jQuery.expr.match.bool.test( name ) ) {
106
-
107
- // Set corresponding property to false
108
- if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
109
- elem[ propName ] = false;
110
-
111
- // Support: IE<9
112
- // Also clear defaultChecked/defaultSelected (if appropriate)
113
- } else {
114
- elem[ jQuery.camelCase( "default-" + name ) ] =
115
- elem[ propName ] = false;
116
- }
117
-
118
- // See #9699 for explanation of this approach (setting first, then removal)
119
- } else {
120
- jQuery.attr( elem, name, "" );
121
- }
122
-
123
- elem.removeAttribute( getSetAttribute ? name : propName );
124
- }
125
- }
126
- }
127
- } );
128
-
129
- // Hooks for boolean attributes
130
- boolHook = {
131
- set: function( elem, value, name ) {
132
- if ( value === false ) {
133
-
134
- // Remove boolean attributes when set to false
135
- jQuery.removeAttr( elem, name );
136
- } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
137
-
138
- // IE<8 needs the *property* name
139
- elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
140
-
141
- } else {
142
-
143
- // Support: IE<9
144
- // Use defaultChecked and defaultSelected for oldIE
145
- elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
146
- }
147
- return name;
148
- }
149
- };
150
-
151
- jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
152
- var getter = attrHandle[ name ] || jQuery.find.attr;
153
-
154
- if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
155
- attrHandle[ name ] = function( elem, name, isXML ) {
156
- var ret, handle;
157
- if ( !isXML ) {
158
-
159
- // Avoid an infinite loop by temporarily removing this function from the getter
160
- handle = attrHandle[ name ];
161
- attrHandle[ name ] = ret;
162
- ret = getter( elem, name, isXML ) != null ?
163
- name.toLowerCase() :
164
- null;
165
- attrHandle[ name ] = handle;
166
- }
167
- return ret;
168
- };
169
- } else {
170
- attrHandle[ name ] = function( elem, name, isXML ) {
171
- if ( !isXML ) {
172
- return elem[ jQuery.camelCase( "default-" + name ) ] ?
173
- name.toLowerCase() :
174
- null;
175
- }
176
- };
177
- }
178
- } );
179
-
180
- // fix oldIE attroperties
181
- if ( !getSetInput || !getSetAttribute ) {
182
- jQuery.attrHooks.value = {
183
- set: function( elem, value, name ) {
184
- if ( jQuery.nodeName( elem, "input" ) ) {
185
-
186
- // Does not return so that setAttribute is also used
187
- elem.defaultValue = value;
188
- } else {
189
-
190
- // Use nodeHook if defined (#1954); otherwise setAttribute is fine
191
- return nodeHook && nodeHook.set( elem, value, name );
192
- }
193
- }
194
- };
195
- }
196
-
197
- // IE6/7 do not support getting/setting some attributes with get/setAttribute
198
- if ( !getSetAttribute ) {
199
-
200
- // Use this for any attribute in IE6/7
201
- // This fixes almost every IE6/7 issue
202
- nodeHook = {
203
- set: function( elem, value, name ) {
204
-
205
- // Set the existing or create a new attribute node
206
- var ret = elem.getAttributeNode( name );
207
- if ( !ret ) {
208
- elem.setAttributeNode(
209
- ( ret = elem.ownerDocument.createAttribute( name ) )
210
- );
211
- }
212
-
213
- ret.value = value += "";
214
-
215
- // Break association with cloned elements by also using setAttribute (#9646)
216
- if ( name === "value" || value === elem.getAttribute( name ) ) {
217
- return value;
218
- }
219
- }
220
- };
221
-
222
- // Some attributes are constructed with empty-string values when not defined
223
- attrHandle.id = attrHandle.name = attrHandle.coords =
224
- function( elem, name, isXML ) {
225
- var ret;
226
- if ( !isXML ) {
227
- return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ?
228
- ret.value :
229
- null;
230
- }
231
- };
232
-
233
- // Fixing value retrieval on a button requires this module
234
- jQuery.valHooks.button = {
235
- get: function( elem, name ) {
236
- var ret = elem.getAttributeNode( name );
237
- if ( ret && ret.specified ) {
238
- return ret.value;
239
- }
240
- },
241
- set: nodeHook.set
242
- };
243
-
244
- // Set contenteditable to false on removals(#10429)
245
- // Setting to empty string throws an error as an invalid value
246
- jQuery.attrHooks.contenteditable = {
247
- set: function( elem, value, name ) {
248
- nodeHook.set( elem, value === "" ? false : value, name );
249
- }
250
- };
251
-
252
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
253
- // This is for removals
254
- jQuery.each( [ "width", "height" ], function( i, name ) {
255
- jQuery.attrHooks[ name ] = {
256
- set: function( elem, value ) {
257
- if ( value === "" ) {
258
- elem.setAttribute( name, "auto" );
259
- return value;
260
- }
261
- }
262
- };
263
- } );
264
- }
265
-
266
- if ( !support.style ) {
267
- jQuery.attrHooks.style = {
268
- get: function( elem ) {
269
-
270
- // Return undefined in the case of empty string
271
- // Note: IE uppercases css property names, but if we were to .toLowerCase()
272
- // .cssText, that would destroy case sensitivity in URL's, like in "background"
273
- return elem.style.cssText || undefined;
274
- },
275
- set: function( elem, value ) {
276
- return ( elem.style.cssText = value + "" );
277
- }
278
- };
279
- }
280
-
281
- } );
@@ -1,174 +0,0 @@
1
- define( [
2
- "../core",
3
- "../var/rnotwhite",
4
- "../core/init"
5
- ], function( jQuery, rnotwhite ) {
6
-
7
- var rclass = /[\t\r\n\f]/g;
8
-
9
- function getClass( elem ) {
10
- return jQuery.attr( elem, "class" ) || "";
11
- }
12
-
13
- jQuery.fn.extend( {
14
- addClass: function( value ) {
15
- var classes, elem, cur, curValue, clazz, j, finalValue,
16
- i = 0;
17
-
18
- if ( jQuery.isFunction( value ) ) {
19
- return this.each( function( j ) {
20
- jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
21
- } );
22
- }
23
-
24
- if ( typeof value === "string" && value ) {
25
- classes = value.match( rnotwhite ) || [];
26
-
27
- while ( ( elem = this[ i++ ] ) ) {
28
- curValue = getClass( elem );
29
- cur = elem.nodeType === 1 &&
30
- ( " " + curValue + " " ).replace( rclass, " " );
31
-
32
- if ( cur ) {
33
- j = 0;
34
- while ( ( clazz = classes[ j++ ] ) ) {
35
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
36
- cur += clazz + " ";
37
- }
38
- }
39
-
40
- // only assign if different to avoid unneeded rendering.
41
- finalValue = jQuery.trim( cur );
42
- if ( curValue !== finalValue ) {
43
- jQuery.attr( elem, "class", finalValue );
44
- }
45
- }
46
- }
47
- }
48
-
49
- return this;
50
- },
51
-
52
- removeClass: function( value ) {
53
- var classes, elem, cur, curValue, clazz, j, finalValue,
54
- i = 0;
55
-
56
- if ( jQuery.isFunction( value ) ) {
57
- return this.each( function( j ) {
58
- jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
59
- } );
60
- }
61
-
62
- if ( !arguments.length ) {
63
- return this.attr( "class", "" );
64
- }
65
-
66
- if ( typeof value === "string" && value ) {
67
- classes = value.match( rnotwhite ) || [];
68
-
69
- while ( ( elem = this[ i++ ] ) ) {
70
- curValue = getClass( elem );
71
-
72
- // This expression is here for better compressibility (see addClass)
73
- cur = elem.nodeType === 1 &&
74
- ( " " + curValue + " " ).replace( rclass, " " );
75
-
76
- if ( cur ) {
77
- j = 0;
78
- while ( ( clazz = classes[ j++ ] ) ) {
79
-
80
- // Remove *all* instances
81
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
82
- cur = cur.replace( " " + clazz + " ", " " );
83
- }
84
- }
85
-
86
- // Only assign if different to avoid unneeded rendering.
87
- finalValue = jQuery.trim( cur );
88
- if ( curValue !== finalValue ) {
89
- jQuery.attr( elem, "class", finalValue );
90
- }
91
- }
92
- }
93
- }
94
-
95
- return this;
96
- },
97
-
98
- toggleClass: function( value, stateVal ) {
99
- var type = typeof value;
100
-
101
- if ( typeof stateVal === "boolean" && type === "string" ) {
102
- return stateVal ? this.addClass( value ) : this.removeClass( value );
103
- }
104
-
105
- if ( jQuery.isFunction( value ) ) {
106
- return this.each( function( i ) {
107
- jQuery( this ).toggleClass(
108
- value.call( this, i, getClass( this ), stateVal ),
109
- stateVal
110
- );
111
- } );
112
- }
113
-
114
- return this.each( function() {
115
- var className, i, self, classNames;
116
-
117
- if ( type === "string" ) {
118
-
119
- // Toggle individual class names
120
- i = 0;
121
- self = jQuery( this );
122
- classNames = value.match( rnotwhite ) || [];
123
-
124
- while ( ( className = classNames[ i++ ] ) ) {
125
-
126
- // Check each className given, space separated list
127
- if ( self.hasClass( className ) ) {
128
- self.removeClass( className );
129
- } else {
130
- self.addClass( className );
131
- }
132
- }
133
-
134
- // Toggle whole class name
135
- } else if ( value === undefined || type === "boolean" ) {
136
- className = getClass( this );
137
- if ( className ) {
138
-
139
- // store className if set
140
- jQuery._data( this, "__className__", className );
141
- }
142
-
143
- // If the element has a class name or if we're passed "false",
144
- // then remove the whole classname (if there was one, the above saved it).
145
- // Otherwise bring back whatever was previously saved (if anything),
146
- // falling back to the empty string if nothing was stored.
147
- jQuery.attr( this, "class",
148
- className || value === false ?
149
- "" :
150
- jQuery._data( this, "__className__" ) || ""
151
- );
152
- }
153
- } );
154
- },
155
-
156
- hasClass: function( selector ) {
157
- var className, elem,
158
- i = 0;
159
-
160
- className = " " + selector + " ";
161
- while ( ( elem = this[ i++ ] ) ) {
162
- if ( elem.nodeType === 1 &&
163
- ( " " + getClass( elem ) + " " ).replace( rclass, " " )
164
- .indexOf( className ) > -1
165
- ) {
166
- return true;
167
- }
168
- }
169
-
170
- return false;
171
- }
172
- } );
173
-
174
- } );
@@ -1,156 +0,0 @@
1
- define( [
2
- "../core",
3
- "../core/access",
4
- "./support",
5
- "../selector"
6
- ], function( jQuery, access, support ) {
7
-
8
- var rfocusable = /^(?:input|select|textarea|button|object)$/i,
9
- rclickable = /^(?:a|area)$/i;
10
-
11
- jQuery.fn.extend( {
12
- prop: function( name, value ) {
13
- return access( this, jQuery.prop, name, value, arguments.length > 1 );
14
- },
15
-
16
- removeProp: function( name ) {
17
- name = jQuery.propFix[ name ] || name;
18
- return this.each( function() {
19
-
20
- // try/catch handles cases where IE balks (such as removing a property on window)
21
- try {
22
- this[ name ] = undefined;
23
- delete this[ name ];
24
- } catch ( e ) {}
25
- } );
26
- }
27
- } );
28
-
29
- jQuery.extend( {
30
- prop: function( elem, name, value ) {
31
- var ret, hooks,
32
- nType = elem.nodeType;
33
-
34
- // Don't get/set properties on text, comment and attribute nodes
35
- if ( nType === 3 || nType === 8 || nType === 2 ) {
36
- return;
37
- }
38
-
39
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
40
-
41
- // Fix name and attach hooks
42
- name = jQuery.propFix[ name ] || name;
43
- hooks = jQuery.propHooks[ name ];
44
- }
45
-
46
- if ( value !== undefined ) {
47
- if ( hooks && "set" in hooks &&
48
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
49
- return ret;
50
- }
51
-
52
- return ( elem[ name ] = value );
53
- }
54
-
55
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
56
- return ret;
57
- }
58
-
59
- return elem[ name ];
60
- },
61
-
62
- propHooks: {
63
- tabIndex: {
64
- get: function( elem ) {
65
-
66
- // elem.tabIndex doesn't always return the
67
- // correct value when it hasn't been explicitly set
68
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
69
- // Use proper attribute retrieval(#12072)
70
- var tabindex = jQuery.find.attr( elem, "tabindex" );
71
-
72
- return tabindex ?
73
- parseInt( tabindex, 10 ) :
74
- rfocusable.test( elem.nodeName ) ||
75
- rclickable.test( elem.nodeName ) && elem.href ?
76
- 0 :
77
- -1;
78
- }
79
- }
80
- },
81
-
82
- propFix: {
83
- "for": "htmlFor",
84
- "class": "className"
85
- }
86
- } );
87
-
88
- // Some attributes require a special call on IE
89
- // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
90
- if ( !support.hrefNormalized ) {
91
-
92
- // href/src property should get the full normalized URL (#10299/#12915)
93
- jQuery.each( [ "href", "src" ], function( i, name ) {
94
- jQuery.propHooks[ name ] = {
95
- get: function( elem ) {
96
- return elem.getAttribute( name, 4 );
97
- }
98
- };
99
- } );
100
- }
101
-
102
- // Support: Safari, IE9+
103
- // Accessing the selectedIndex property
104
- // forces the browser to respect setting selected
105
- // on the option
106
- // The getter ensures a default option is selected
107
- // when in an optgroup
108
- if ( !support.optSelected ) {
109
- jQuery.propHooks.selected = {
110
- get: function( elem ) {
111
- var parent = elem.parentNode;
112
-
113
- if ( parent ) {
114
- parent.selectedIndex;
115
-
116
- // Make sure that it also works with optgroups, see #5701
117
- if ( parent.parentNode ) {
118
- parent.parentNode.selectedIndex;
119
- }
120
- }
121
- return null;
122
- },
123
- set: function( elem ) {
124
- var parent = elem.parentNode;
125
- if ( parent ) {
126
- parent.selectedIndex;
127
-
128
- if ( parent.parentNode ) {
129
- parent.parentNode.selectedIndex;
130
- }
131
- }
132
- }
133
- };
134
- }
135
-
136
- jQuery.each( [
137
- "tabIndex",
138
- "readOnly",
139
- "maxLength",
140
- "cellSpacing",
141
- "cellPadding",
142
- "rowSpan",
143
- "colSpan",
144
- "useMap",
145
- "frameBorder",
146
- "contentEditable"
147
- ], function() {
148
- jQuery.propFix[ this.toLowerCase() ] = this;
149
- } );
150
-
151
- // IE6/7 call enctype encoding
152
- if ( !support.enctype ) {
153
- jQuery.propFix.enctype = "encoding";
154
- }
155
-
156
- } );
@@ -1,70 +0,0 @@
1
- define( [
2
- "../var/document",
3
- "../var/support"
4
- ], function( document, support ) {
5
-
6
- ( function() {
7
- var a,
8
- input = document.createElement( "input" ),
9
- div = document.createElement( "div" ),
10
- select = document.createElement( "select" ),
11
- opt = select.appendChild( document.createElement( "option" ) );
12
-
13
- // Setup
14
- div = document.createElement( "div" );
15
- div.setAttribute( "className", "t" );
16
- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
17
- a = div.getElementsByTagName( "a" )[ 0 ];
18
-
19
- // Support: Windows Web Apps (WWA)
20
- // `type` must use .setAttribute for WWA (#14901)
21
- input.setAttribute( "type", "checkbox" );
22
- div.appendChild( input );
23
-
24
- a = div.getElementsByTagName( "a" )[ 0 ];
25
-
26
- // First batch of tests.
27
- a.style.cssText = "top:1px";
28
-
29
- // Test setAttribute on camelCase class.
30
- // If it works, we need attrFixes when doing get/setAttribute (ie6/7)
31
- support.getSetAttribute = div.className !== "t";
32
-
33
- // Get the style information from getAttribute
34
- // (IE uses .cssText instead)
35
- support.style = /top/.test( a.getAttribute( "style" ) );
36
-
37
- // Make sure that URLs aren't manipulated
38
- // (IE normalizes it by default)
39
- support.hrefNormalized = a.getAttribute( "href" ) === "/a";
40
-
41
- // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
42
- support.checkOn = !!input.value;
43
-
44
- // Make sure that a selected-by-default option has a working selected property.
45
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
46
- support.optSelected = opt.selected;
47
-
48
- // Tests for enctype support on a form (#6743)
49
- support.enctype = !!document.createElement( "form" ).enctype;
50
-
51
- // Make sure that the options inside disabled selects aren't marked as disabled
52
- // (WebKit marks them as disabled)
53
- select.disabled = true;
54
- support.optDisabled = !opt.disabled;
55
-
56
- // Support: IE8 only
57
- // Check if we can trust getAttribute("value")
58
- input = document.createElement( "input" );
59
- input.setAttribute( "value", "" );
60
- support.input = input.getAttribute( "value" ) === "";
61
-
62
- // Check if an input maintains its value after becoming a radio
63
- input.value = "t";
64
- input.setAttribute( "type", "radio" );
65
- support.radioValue = input.value === "t";
66
- } )();
67
-
68
- return support;
69
-
70
- } );