govuk_publishing_components 11.2.0 → 12.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/favicon-example.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/favicon-production.png +0 -0
  4. data/app/assets/javascripts/component_guide/application.js +1 -1
  5. data/app/assets/javascripts/component_guide/no_slimmer.js +15 -0
  6. data/app/assets/javascripts/govuk_publishing_components/admin_scripts.js +2 -4
  7. data/app/assets/javascripts/govuk_publishing_components/all_components.js +4 -0
  8. data/app/assets/stylesheets/component_guide/application.scss +80 -74
  9. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +4 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +26 -5
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +21 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +7 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +24 -5
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +2 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +19 -7
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +11 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +12 -0
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +9 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +2 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +11 -0
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +7 -2
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +9 -8
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +4 -2
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +12 -1
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +6 -0
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +16 -2
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -0
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +8 -2
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -0
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +5 -0
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +30 -7
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +14 -4
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +2 -0
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +2 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss +10 -0
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +4 -0
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +7 -2
  41. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +4 -0
  42. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +24 -8
  43. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +47 -13
  44. data/app/controllers/govuk_publishing_components/application_controller.rb +5 -6
  45. data/app/views/govuk_publishing_components/component_guide/index.html.erb +2 -2
  46. data/app/views/govuk_publishing_components/component_guide/show.html.erb +9 -9
  47. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  48. data/app/views/govuk_publishing_components/components/_feedback.html.erb +2 -2
  49. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
  50. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +4 -7
  51. data/app/views/govuk_publishing_components/components/_notice.html.erb +2 -2
  52. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +2 -2
  53. data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
  54. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +1 -1
  55. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +2 -2
  56. data/app/views/govuk_publishing_components/components/_taxonomy_navigation.html.erb +2 -2
  57. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +1 -1
  58. data/app/views/govuk_publishing_components/components/docs/fieldset.yml +1 -1
  59. data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +1 -0
  60. data/app/views/govuk_publishing_components/components/docs/tabs.yml +7 -7
  61. data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +1 -1
  62. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +3 -3
  63. data/app/views/layouts/govuk_publishing_components/application.html.erb +43 -44
  64. data/config/initializers/assets.rb +2 -0
  65. data/lib/govuk_publishing_components/app_helpers/environment.rb +1 -0
  66. data/lib/govuk_publishing_components/config.rb +1 -1
  67. data/lib/govuk_publishing_components/engine.rb +0 -1
  68. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +1 -1
  69. data/lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb +1 -1
  70. data/lib/govuk_publishing_components/version.rb +1 -1
  71. data/node_modules/jquery/AUTHORS.txt +266 -0
  72. data/node_modules/jquery/LICENSE.txt +36 -0
  73. data/node_modules/jquery/README.md +65 -0
  74. data/node_modules/jquery/bower.json +14 -0
  75. data/node_modules/jquery/dist/jquery.js +11008 -0
  76. data/node_modules/jquery/dist/jquery.min.js +5 -0
  77. data/node_modules/jquery/dist/jquery.min.map +1 -0
  78. data/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
  79. data/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
  80. data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  81. data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  82. data/node_modules/jquery/package.json +157 -0
  83. data/node_modules/jquery/src/ajax.js +842 -0
  84. data/node_modules/jquery/src/ajax/jsonp.js +100 -0
  85. data/node_modules/jquery/src/ajax/load.js +83 -0
  86. data/node_modules/jquery/src/ajax/parseJSON.js +53 -0
  87. data/node_modules/jquery/src/ajax/parseXML.js +31 -0
  88. data/node_modules/jquery/src/ajax/script.js +95 -0
  89. data/node_modules/jquery/src/ajax/var/location.js +3 -0
  90. data/node_modules/jquery/src/ajax/var/nonce.js +5 -0
  91. data/node_modules/jquery/src/ajax/var/rquery.js +3 -0
  92. data/node_modules/jquery/src/ajax/xhr.js +229 -0
  93. data/node_modules/jquery/src/attributes.js +11 -0
  94. data/node_modules/jquery/src/attributes/attr.js +281 -0
  95. data/node_modules/jquery/src/attributes/classes.js +174 -0
  96. data/node_modules/jquery/src/attributes/prop.js +156 -0
  97. data/node_modules/jquery/src/attributes/support.js +70 -0
  98. data/node_modules/jquery/src/attributes/val.js +191 -0
  99. data/node_modules/jquery/src/callbacks.js +232 -0
  100. data/node_modules/jquery/src/core.js +529 -0
  101. data/node_modules/jquery/src/core/access.js +65 -0
  102. data/node_modules/jquery/src/core/init.js +140 -0
  103. data/node_modules/jquery/src/core/parseHTML.js +41 -0
  104. data/node_modules/jquery/src/core/ready.js +163 -0
  105. data/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
  106. data/node_modules/jquery/src/css.js +563 -0
  107. data/node_modules/jquery/src/css/addGetHookIf.js +24 -0
  108. data/node_modules/jquery/src/css/adjustCSS.js +65 -0
  109. data/node_modules/jquery/src/css/curCSS.js +137 -0
  110. data/node_modules/jquery/src/css/defaultDisplay.js +72 -0
  111. data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +42 -0
  112. data/node_modules/jquery/src/css/showHide.js +45 -0
  113. data/node_modules/jquery/src/css/support.js +184 -0
  114. data/node_modules/jquery/src/css/var/cssExpand.js +3 -0
  115. data/node_modules/jquery/src/css/var/isHidden.js +16 -0
  116. data/node_modules/jquery/src/css/var/rmargin.js +3 -0
  117. data/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
  118. data/node_modules/jquery/src/css/var/swap.js +24 -0
  119. data/node_modules/jquery/src/data.js +342 -0
  120. data/node_modules/jquery/src/data/support.js +23 -0
  121. data/node_modules/jquery/src/data/var/acceptData.js +20 -0
  122. data/node_modules/jquery/src/deferred.js +159 -0
  123. data/node_modules/jquery/src/deprecated.js +34 -0
  124. data/node_modules/jquery/src/dimensions.js +56 -0
  125. data/node_modules/jquery/src/effects.js +640 -0
  126. data/node_modules/jquery/src/effects/Tween.js +121 -0
  127. data/node_modules/jquery/src/effects/animatedSelector.js +13 -0
  128. data/node_modules/jquery/src/effects/support.js +58 -0
  129. data/node_modules/jquery/src/event.js +1134 -0
  130. data/node_modules/jquery/src/event/ajax.js +20 -0
  131. data/node_modules/jquery/src/event/alias.js +25 -0
  132. data/node_modules/jquery/src/event/support.js +28 -0
  133. data/node_modules/jquery/src/exports/amd.js +24 -0
  134. data/node_modules/jquery/src/exports/global.js +26 -0
  135. data/node_modules/jquery/src/intro.js +44 -0
  136. data/node_modules/jquery/src/jquery.js +37 -0
  137. data/node_modules/jquery/src/manipulation.js +585 -0
  138. data/node_modules/jquery/src/manipulation/_evalUrl.js +21 -0
  139. data/node_modules/jquery/src/manipulation/buildFragment.js +157 -0
  140. data/node_modules/jquery/src/manipulation/createSafeFragment.js +20 -0
  141. data/node_modules/jquery/src/manipulation/getAll.js +33 -0
  142. data/node_modules/jquery/src/manipulation/setGlobalEval.js +19 -0
  143. data/node_modules/jquery/src/manipulation/support.js +72 -0
  144. data/node_modules/jquery/src/manipulation/var/nodeNames.js +5 -0
  145. data/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
  146. data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
  147. data/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
  148. data/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
  149. data/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
  150. data/node_modules/jquery/src/offset.js +219 -0
  151. data/node_modules/jquery/src/outro.js +2 -0
  152. data/node_modules/jquery/src/queue.js +144 -0
  153. data/node_modules/jquery/src/queue/delay.js +22 -0
  154. data/node_modules/jquery/src/selector-sizzle.js +14 -0
  155. data/node_modules/jquery/src/selector.js +1 -0
  156. data/node_modules/jquery/src/serialize.js +125 -0
  157. data/node_modules/jquery/src/support.js +63 -0
  158. data/node_modules/jquery/src/traversing.js +179 -0
  159. data/node_modules/jquery/src/traversing/findFilter.js +100 -0
  160. data/node_modules/jquery/src/traversing/var/dir.js +20 -0
  161. data/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
  162. data/node_modules/jquery/src/traversing/var/siblings.js +15 -0
  163. data/node_modules/jquery/src/var/class2type.js +5 -0
  164. data/node_modules/jquery/src/var/concat.js +5 -0
  165. data/node_modules/jquery/src/var/deletedIds.js +3 -0
  166. data/node_modules/jquery/src/var/document.js +3 -0
  167. data/node_modules/jquery/src/var/documentElement.js +5 -0
  168. data/node_modules/jquery/src/var/hasOwn.js +5 -0
  169. data/node_modules/jquery/src/var/indexOf.js +5 -0
  170. data/node_modules/jquery/src/var/pnum.js +3 -0
  171. data/node_modules/jquery/src/var/push.js +5 -0
  172. data/node_modules/jquery/src/var/rcssNum.js +7 -0
  173. data/node_modules/jquery/src/var/rnotwhite.js +3 -0
  174. data/node_modules/jquery/src/var/slice.js +5 -0
  175. data/node_modules/jquery/src/var/support.js +5 -0
  176. data/node_modules/jquery/src/var/toString.js +5 -0
  177. data/node_modules/jquery/src/wrap.js +77 -0
  178. metadata +111 -19
  179. data/app/assets/images/govuk_publishing_components/favicon-test.png +0 -0
  180. data/app/assets/stylesheets/govuk_publishing_components/admin_styles_ie8.scss +0 -3
  181. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_touch-friendly-links.scss +0 -11
@@ -0,0 +1,11 @@
1
+ define( [
2
+ "./core",
3
+ "./attributes/val",
4
+ "./attributes/attr",
5
+ "./attributes/prop",
6
+ "./attributes/classes"
7
+ ], function( jQuery ) {
8
+
9
+ // Return jQuery for attributes-only inclusion
10
+ return jQuery;
11
+ } );
@@ -0,0 +1,281 @@
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
+ } );
@@ -0,0 +1,174 @@
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
+ } );