govuk_publishing_components 28.9.1 → 29.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) 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/analytics/cross-domain-tracking.js +55 -0
  5. data/app/assets/javascripts/govuk_publishing_components/analytics.js +3 -0
  6. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +2 -5
  7. data/app/assets/javascripts/govuk_publishing_components/modules.js +15 -18
  8. data/app/assets/javascripts/govuk_publishing_components/{rum-loader.js.erb → rum-loader.js} +13 -10
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  12. data/app/views/govuk_publishing_components/components/_cards.html.erb +9 -25
  13. data/app/views/govuk_publishing_components/components/_input.html.erb +3 -0
  14. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +7 -1
  15. data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +0 -1
  16. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +27 -22
  17. data/app/views/govuk_publishing_components/components/docs/attachment.yml +1 -1
  18. data/app/views/govuk_publishing_components/components/docs/big_number.yml +3 -3
  19. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +3 -3
  20. data/app/views/govuk_publishing_components/components/docs/button.yml +2 -2
  21. data/app/views/govuk_publishing_components/components/docs/cards.yml +12 -6
  22. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +5 -5
  23. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +1 -1
  25. data/app/views/govuk_publishing_components/components/docs/contextual_guidance.yml +1 -1
  26. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
  27. data/app/views/govuk_publishing_components/components/docs/date_input.yml +1 -1
  28. data/app/views/govuk_publishing_components/components/docs/details.yml +1 -1
  29. data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +1 -1
  30. data/app/views/govuk_publishing_components/components/docs/document_list.yml +2 -2
  31. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -1
  32. data/app/views/govuk_publishing_components/components/docs/error_summary.yml +2 -2
  33. data/app/views/govuk_publishing_components/components/docs/feedback.yml +1 -1
  34. data/app/views/govuk_publishing_components/components/docs/fieldset.yml +4 -4
  35. data/app/views/govuk_publishing_components/components/docs/heading.yml +4 -4
  36. data/app/views/govuk_publishing_components/components/docs/hint.yml +1 -1
  37. data/app/views/govuk_publishing_components/components/docs/input.yml +18 -15
  38. data/app/views/govuk_publishing_components/components/docs/inset_text.yml +1 -1
  39. data/app/views/govuk_publishing_components/components/docs/label.yml +1 -1
  40. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +2 -2
  41. data/app/views/govuk_publishing_components/components/docs/lead_paragraph.yml +1 -1
  42. data/app/views/govuk_publishing_components/components/docs/list.yml +1 -1
  43. data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -1
  44. data/app/views/govuk_publishing_components/components/docs/notice.yml +2 -2
  45. data/app/views/govuk_publishing_components/components/docs/print_link.yml +1 -1
  46. data/app/views/govuk_publishing_components/components/docs/search.yml +4 -4
  47. data/app/views/govuk_publishing_components/components/docs/select.yml +5 -5
  48. data/app/views/govuk_publishing_components/components/docs/show_password.yml +3 -3
  49. data/app/views/govuk_publishing_components/components/docs/signup_link.yml +1 -1
  50. data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +2 -2
  51. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +1 -1
  52. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +3 -3
  53. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +3 -3
  54. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +1 -1
  55. data/app/views/govuk_publishing_components/components/docs/summary_list.yml +2 -7
  56. data/app/views/govuk_publishing_components/components/docs/table.yml +1 -1
  57. data/app/views/govuk_publishing_components/components/docs/textarea.yml +1 -1
  58. data/app/views/govuk_publishing_components/components/docs/title.yml +1 -1
  59. data/config/initializers/assets.rb +15 -45
  60. data/lib/govuk_publishing_components/presenters/attachment.rb +4 -7
  61. data/lib/govuk_publishing_components/version.rb +1 -1
  62. metadata +13 -119
  63. data/node_modules/jquery/AUTHORS.txt +0 -266
  64. data/node_modules/jquery/LICENSE.txt +0 -36
  65. data/node_modules/jquery/README.md +0 -65
  66. data/node_modules/jquery/bower.json +0 -14
  67. data/node_modules/jquery/dist/jquery.js +0 -11008
  68. data/node_modules/jquery/dist/jquery.min.js +0 -5
  69. data/node_modules/jquery/dist/jquery.min.map +0 -1
  70. data/node_modules/jquery/external/sizzle/LICENSE.txt +0 -36
  71. data/node_modules/jquery/external/sizzle/dist/sizzle.js +0 -2143
  72. data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +0 -3
  73. data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +0 -1
  74. data/node_modules/jquery/package.json +0 -85
  75. data/node_modules/jquery/src/ajax/jsonp.js +0 -100
  76. data/node_modules/jquery/src/ajax/load.js +0 -83
  77. data/node_modules/jquery/src/ajax/parseJSON.js +0 -53
  78. data/node_modules/jquery/src/ajax/parseXML.js +0 -31
  79. data/node_modules/jquery/src/ajax/script.js +0 -95
  80. data/node_modules/jquery/src/ajax/var/location.js +0 -3
  81. data/node_modules/jquery/src/ajax/var/nonce.js +0 -5
  82. data/node_modules/jquery/src/ajax/var/rquery.js +0 -3
  83. data/node_modules/jquery/src/ajax/xhr.js +0 -229
  84. data/node_modules/jquery/src/ajax.js +0 -842
  85. data/node_modules/jquery/src/attributes/attr.js +0 -281
  86. data/node_modules/jquery/src/attributes/classes.js +0 -174
  87. data/node_modules/jquery/src/attributes/prop.js +0 -156
  88. data/node_modules/jquery/src/attributes/support.js +0 -70
  89. data/node_modules/jquery/src/attributes/val.js +0 -191
  90. data/node_modules/jquery/src/attributes.js +0 -11
  91. data/node_modules/jquery/src/callbacks.js +0 -232
  92. data/node_modules/jquery/src/core/access.js +0 -65
  93. data/node_modules/jquery/src/core/init.js +0 -140
  94. data/node_modules/jquery/src/core/parseHTML.js +0 -41
  95. data/node_modules/jquery/src/core/ready.js +0 -163
  96. data/node_modules/jquery/src/core/var/rsingleTag.js +0 -5
  97. data/node_modules/jquery/src/core.js +0 -529
  98. data/node_modules/jquery/src/css/addGetHookIf.js +0 -24
  99. data/node_modules/jquery/src/css/adjustCSS.js +0 -65
  100. data/node_modules/jquery/src/css/curCSS.js +0 -137
  101. data/node_modules/jquery/src/css/defaultDisplay.js +0 -72
  102. data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +0 -42
  103. data/node_modules/jquery/src/css/showHide.js +0 -45
  104. data/node_modules/jquery/src/css/support.js +0 -184
  105. data/node_modules/jquery/src/css/var/cssExpand.js +0 -3
  106. data/node_modules/jquery/src/css/var/isHidden.js +0 -16
  107. data/node_modules/jquery/src/css/var/rmargin.js +0 -3
  108. data/node_modules/jquery/src/css/var/rnumnonpx.js +0 -5
  109. data/node_modules/jquery/src/css/var/swap.js +0 -24
  110. data/node_modules/jquery/src/css.js +0 -563
  111. data/node_modules/jquery/src/data/support.js +0 -23
  112. data/node_modules/jquery/src/data/var/acceptData.js +0 -20
  113. data/node_modules/jquery/src/data.js +0 -342
  114. data/node_modules/jquery/src/deferred.js +0 -159
  115. data/node_modules/jquery/src/deprecated.js +0 -34
  116. data/node_modules/jquery/src/dimensions.js +0 -56
  117. data/node_modules/jquery/src/effects/Tween.js +0 -121
  118. data/node_modules/jquery/src/effects/animatedSelector.js +0 -13
  119. data/node_modules/jquery/src/effects/support.js +0 -58
  120. data/node_modules/jquery/src/effects.js +0 -640
  121. data/node_modules/jquery/src/event/ajax.js +0 -20
  122. data/node_modules/jquery/src/event/alias.js +0 -25
  123. data/node_modules/jquery/src/event/support.js +0 -28
  124. data/node_modules/jquery/src/event.js +0 -1134
  125. data/node_modules/jquery/src/exports/amd.js +0 -24
  126. data/node_modules/jquery/src/exports/global.js +0 -26
  127. data/node_modules/jquery/src/intro.js +0 -44
  128. data/node_modules/jquery/src/jquery.js +0 -37
  129. data/node_modules/jquery/src/manipulation/_evalUrl.js +0 -21
  130. data/node_modules/jquery/src/manipulation/buildFragment.js +0 -157
  131. data/node_modules/jquery/src/manipulation/createSafeFragment.js +0 -20
  132. data/node_modules/jquery/src/manipulation/getAll.js +0 -33
  133. data/node_modules/jquery/src/manipulation/setGlobalEval.js +0 -19
  134. data/node_modules/jquery/src/manipulation/support.js +0 -72
  135. data/node_modules/jquery/src/manipulation/var/nodeNames.js +0 -5
  136. data/node_modules/jquery/src/manipulation/var/rcheckableType.js +0 -3
  137. data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +0 -3
  138. data/node_modules/jquery/src/manipulation/var/rscriptType.js +0 -3
  139. data/node_modules/jquery/src/manipulation/var/rtagName.js +0 -3
  140. data/node_modules/jquery/src/manipulation/wrapMap.js +0 -30
  141. data/node_modules/jquery/src/manipulation.js +0 -585
  142. data/node_modules/jquery/src/offset.js +0 -219
  143. data/node_modules/jquery/src/outro.js +0 -2
  144. data/node_modules/jquery/src/queue/delay.js +0 -22
  145. data/node_modules/jquery/src/queue.js +0 -144
  146. data/node_modules/jquery/src/selector-sizzle.js +0 -14
  147. data/node_modules/jquery/src/selector.js +0 -1
  148. data/node_modules/jquery/src/serialize.js +0 -125
  149. data/node_modules/jquery/src/support.js +0 -63
  150. data/node_modules/jquery/src/traversing/findFilter.js +0 -100
  151. data/node_modules/jquery/src/traversing/var/dir.js +0 -20
  152. data/node_modules/jquery/src/traversing/var/rneedsContext.js +0 -6
  153. data/node_modules/jquery/src/traversing/var/siblings.js +0 -15
  154. data/node_modules/jquery/src/traversing.js +0 -179
  155. data/node_modules/jquery/src/var/class2type.js +0 -5
  156. data/node_modules/jquery/src/var/concat.js +0 -5
  157. data/node_modules/jquery/src/var/deletedIds.js +0 -3
  158. data/node_modules/jquery/src/var/document.js +0 -3
  159. data/node_modules/jquery/src/var/documentElement.js +0 -5
  160. data/node_modules/jquery/src/var/hasOwn.js +0 -5
  161. data/node_modules/jquery/src/var/indexOf.js +0 -5
  162. data/node_modules/jquery/src/var/pnum.js +0 -3
  163. data/node_modules/jquery/src/var/push.js +0 -5
  164. data/node_modules/jquery/src/var/rcssNum.js +0 -7
  165. data/node_modules/jquery/src/var/rnotwhite.js +0 -3
  166. data/node_modules/jquery/src/var/slice.js +0 -5
  167. data/node_modules/jquery/src/var/support.js +0 -5
  168. data/node_modules/jquery/src/var/toString.js +0 -5
  169. data/node_modules/jquery/src/wrap.js +0 -77
@@ -1,585 +0,0 @@
1
- define( [
2
- "./core",
3
- "./var/document",
4
- "./var/concat",
5
- "./var/push",
6
- "./var/deletedIds",
7
- "./core/access",
8
-
9
- "./manipulation/var/rcheckableType",
10
- "./manipulation/var/rtagName",
11
- "./manipulation/var/rscriptType",
12
- "./manipulation/var/rleadingWhitespace",
13
- "./manipulation/var/nodeNames",
14
- "./manipulation/createSafeFragment",
15
- "./manipulation/wrapMap",
16
- "./manipulation/getAll",
17
- "./manipulation/setGlobalEval",
18
- "./manipulation/buildFragment",
19
- "./manipulation/support",
20
- "./data/var/acceptData",
21
-
22
- "./core/init",
23
- "./traversing",
24
- "./selector",
25
- "./event"
26
- ], function( jQuery, document, concat, push, deletedIds, access,
27
- rcheckableType, rtagName, rscriptType, rleadingWhitespace, nodeNames,
28
- createSafeFragment, wrapMap, getAll, setGlobalEval,
29
- buildFragment, support, acceptData ) {
30
-
31
- var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
32
- rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ),
33
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
34
-
35
- // Support: IE 10-11, Edge 10240+
36
- // In IE/Edge using regex groups here causes severe slowdowns.
37
- // See https://connect.microsoft.com/IE/feedback/details/1736512/
38
- rnoInnerhtml = /<script|<style|<link/i,
39
-
40
- // checked="checked" or checked
41
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
42
- rscriptTypeMasked = /^true\/(.*)/,
43
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
44
- safeFragment = createSafeFragment( document ),
45
- fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) );
46
-
47
- // Support: IE<8
48
- // Manipulating tables requires a tbody
49
- function manipulationTarget( elem, content ) {
50
- return jQuery.nodeName( elem, "table" ) &&
51
- jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
52
-
53
- elem.getElementsByTagName( "tbody" )[ 0 ] ||
54
- elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
55
- elem;
56
- }
57
-
58
- // Replace/restore the type attribute of script elements for safe DOM manipulation
59
- function disableScript( elem ) {
60
- elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type;
61
- return elem;
62
- }
63
- function restoreScript( elem ) {
64
- var match = rscriptTypeMasked.exec( elem.type );
65
- if ( match ) {
66
- elem.type = match[ 1 ];
67
- } else {
68
- elem.removeAttribute( "type" );
69
- }
70
- return elem;
71
- }
72
-
73
- function cloneCopyEvent( src, dest ) {
74
- if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
75
- return;
76
- }
77
-
78
- var type, i, l,
79
- oldData = jQuery._data( src ),
80
- curData = jQuery._data( dest, oldData ),
81
- events = oldData.events;
82
-
83
- if ( events ) {
84
- delete curData.handle;
85
- curData.events = {};
86
-
87
- for ( type in events ) {
88
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
89
- jQuery.event.add( dest, type, events[ type ][ i ] );
90
- }
91
- }
92
- }
93
-
94
- // make the cloned public data object a copy from the original
95
- if ( curData.data ) {
96
- curData.data = jQuery.extend( {}, curData.data );
97
- }
98
- }
99
-
100
- function fixCloneNodeIssues( src, dest ) {
101
- var nodeName, e, data;
102
-
103
- // We do not need to do anything for non-Elements
104
- if ( dest.nodeType !== 1 ) {
105
- return;
106
- }
107
-
108
- nodeName = dest.nodeName.toLowerCase();
109
-
110
- // IE6-8 copies events bound via attachEvent when using cloneNode.
111
- if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
112
- data = jQuery._data( dest );
113
-
114
- for ( e in data.events ) {
115
- jQuery.removeEvent( dest, e, data.handle );
116
- }
117
-
118
- // Event data gets referenced instead of copied if the expando gets copied too
119
- dest.removeAttribute( jQuery.expando );
120
- }
121
-
122
- // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
123
- if ( nodeName === "script" && dest.text !== src.text ) {
124
- disableScript( dest ).text = src.text;
125
- restoreScript( dest );
126
-
127
- // IE6-10 improperly clones children of object elements using classid.
128
- // IE10 throws NoModificationAllowedError if parent is null, #12132.
129
- } else if ( nodeName === "object" ) {
130
- if ( dest.parentNode ) {
131
- dest.outerHTML = src.outerHTML;
132
- }
133
-
134
- // This path appears unavoidable for IE9. When cloning an object
135
- // element in IE9, the outerHTML strategy above is not sufficient.
136
- // If the src has innerHTML and the destination does not,
137
- // copy the src.innerHTML into the dest.innerHTML. #10324
138
- if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) {
139
- dest.innerHTML = src.innerHTML;
140
- }
141
-
142
- } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
143
-
144
- // IE6-8 fails to persist the checked state of a cloned checkbox
145
- // or radio button. Worse, IE6-7 fail to give the cloned element
146
- // a checked appearance if the defaultChecked value isn't also set
147
-
148
- dest.defaultChecked = dest.checked = src.checked;
149
-
150
- // IE6-7 get confused and end up setting the value of a cloned
151
- // checkbox/radio button to an empty string instead of "on"
152
- if ( dest.value !== src.value ) {
153
- dest.value = src.value;
154
- }
155
-
156
- // IE6-8 fails to return the selected option to the default selected
157
- // state when cloning options
158
- } else if ( nodeName === "option" ) {
159
- dest.defaultSelected = dest.selected = src.defaultSelected;
160
-
161
- // IE6-8 fails to set the defaultValue to the correct value when
162
- // cloning other types of input fields
163
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
164
- dest.defaultValue = src.defaultValue;
165
- }
166
- }
167
-
168
- function domManip( collection, args, callback, ignored ) {
169
-
170
- // Flatten any nested arrays
171
- args = concat.apply( [], args );
172
-
173
- var first, node, hasScripts,
174
- scripts, doc, fragment,
175
- i = 0,
176
- l = collection.length,
177
- iNoClone = l - 1,
178
- value = args[ 0 ],
179
- isFunction = jQuery.isFunction( value );
180
-
181
- // We can't cloneNode fragments that contain checked, in WebKit
182
- if ( isFunction ||
183
- ( l > 1 && typeof value === "string" &&
184
- !support.checkClone && rchecked.test( value ) ) ) {
185
- return collection.each( function( index ) {
186
- var self = collection.eq( index );
187
- if ( isFunction ) {
188
- args[ 0 ] = value.call( this, index, self.html() );
189
- }
190
- domManip( self, args, callback, ignored );
191
- } );
192
- }
193
-
194
- if ( l ) {
195
- fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
196
- first = fragment.firstChild;
197
-
198
- if ( fragment.childNodes.length === 1 ) {
199
- fragment = first;
200
- }
201
-
202
- // Require either new content or an interest in ignored elements to invoke the callback
203
- if ( first || ignored ) {
204
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
205
- hasScripts = scripts.length;
206
-
207
- // Use the original fragment for the last item
208
- // instead of the first because it can end up
209
- // being emptied incorrectly in certain situations (#8070).
210
- for ( ; i < l; i++ ) {
211
- node = fragment;
212
-
213
- if ( i !== iNoClone ) {
214
- node = jQuery.clone( node, true, true );
215
-
216
- // Keep references to cloned scripts for later restoration
217
- if ( hasScripts ) {
218
-
219
- // Support: Android<4.1, PhantomJS<2
220
- // push.apply(_, arraylike) throws on ancient WebKit
221
- jQuery.merge( scripts, getAll( node, "script" ) );
222
- }
223
- }
224
-
225
- callback.call( collection[ i ], node, i );
226
- }
227
-
228
- if ( hasScripts ) {
229
- doc = scripts[ scripts.length - 1 ].ownerDocument;
230
-
231
- // Reenable scripts
232
- jQuery.map( scripts, restoreScript );
233
-
234
- // Evaluate executable scripts on first document insertion
235
- for ( i = 0; i < hasScripts; i++ ) {
236
- node = scripts[ i ];
237
- if ( rscriptType.test( node.type || "" ) &&
238
- !jQuery._data( node, "globalEval" ) &&
239
- jQuery.contains( doc, node ) ) {
240
-
241
- if ( node.src ) {
242
-
243
- // Optional AJAX dependency, but won't run scripts if not present
244
- if ( jQuery._evalUrl ) {
245
- jQuery._evalUrl( node.src );
246
- }
247
- } else {
248
- jQuery.globalEval(
249
- ( node.text || node.textContent || node.innerHTML || "" )
250
- .replace( rcleanScript, "" )
251
- );
252
- }
253
- }
254
- }
255
- }
256
-
257
- // Fix #11809: Avoid leaking memory
258
- fragment = first = null;
259
- }
260
- }
261
-
262
- return collection;
263
- }
264
-
265
- function remove( elem, selector, keepData ) {
266
- var node,
267
- elems = selector ? jQuery.filter( selector, elem ) : elem,
268
- i = 0;
269
-
270
- for ( ; ( node = elems[ i ] ) != null; i++ ) {
271
-
272
- if ( !keepData && node.nodeType === 1 ) {
273
- jQuery.cleanData( getAll( node ) );
274
- }
275
-
276
- if ( node.parentNode ) {
277
- if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
278
- setGlobalEval( getAll( node, "script" ) );
279
- }
280
- node.parentNode.removeChild( node );
281
- }
282
- }
283
-
284
- return elem;
285
- }
286
-
287
- jQuery.extend( {
288
- htmlPrefilter: function( html ) {
289
- return html.replace( rxhtmlTag, "<$1></$2>" );
290
- },
291
-
292
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
293
- var destElements, node, clone, i, srcElements,
294
- inPage = jQuery.contains( elem.ownerDocument, elem );
295
-
296
- if ( support.html5Clone || jQuery.isXMLDoc( elem ) ||
297
- !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
298
-
299
- clone = elem.cloneNode( true );
300
-
301
- // IE<=8 does not properly clone detached, unknown element nodes
302
- } else {
303
- fragmentDiv.innerHTML = elem.outerHTML;
304
- fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
305
- }
306
-
307
- if ( ( !support.noCloneEvent || !support.noCloneChecked ) &&
308
- ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
309
-
310
- // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
311
- destElements = getAll( clone );
312
- srcElements = getAll( elem );
313
-
314
- // Fix all IE cloning issues
315
- for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) {
316
-
317
- // Ensure that the destination node is not null; Fixes #9587
318
- if ( destElements[ i ] ) {
319
- fixCloneNodeIssues( node, destElements[ i ] );
320
- }
321
- }
322
- }
323
-
324
- // Copy the events from the original to the clone
325
- if ( dataAndEvents ) {
326
- if ( deepDataAndEvents ) {
327
- srcElements = srcElements || getAll( elem );
328
- destElements = destElements || getAll( clone );
329
-
330
- for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) {
331
- cloneCopyEvent( node, destElements[ i ] );
332
- }
333
- } else {
334
- cloneCopyEvent( elem, clone );
335
- }
336
- }
337
-
338
- // Preserve script evaluation history
339
- destElements = getAll( clone, "script" );
340
- if ( destElements.length > 0 ) {
341
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
342
- }
343
-
344
- destElements = srcElements = node = null;
345
-
346
- // Return the cloned set
347
- return clone;
348
- },
349
-
350
- cleanData: function( elems, /* internal */ forceAcceptData ) {
351
- var elem, type, id, data,
352
- i = 0,
353
- internalKey = jQuery.expando,
354
- cache = jQuery.cache,
355
- attributes = support.attributes,
356
- special = jQuery.event.special;
357
-
358
- for ( ; ( elem = elems[ i ] ) != null; i++ ) {
359
- if ( forceAcceptData || acceptData( elem ) ) {
360
-
361
- id = elem[ internalKey ];
362
- data = id && cache[ id ];
363
-
364
- if ( data ) {
365
- if ( data.events ) {
366
- for ( type in data.events ) {
367
- if ( special[ type ] ) {
368
- jQuery.event.remove( elem, type );
369
-
370
- // This is a shortcut to avoid jQuery.event.remove's overhead
371
- } else {
372
- jQuery.removeEvent( elem, type, data.handle );
373
- }
374
- }
375
- }
376
-
377
- // Remove cache only if it was not already removed by jQuery.event.remove
378
- if ( cache[ id ] ) {
379
-
380
- delete cache[ id ];
381
-
382
- // Support: IE<9
383
- // IE does not allow us to delete expando properties from nodes
384
- // IE creates expando attributes along with the property
385
- // IE does not have a removeAttribute function on Document nodes
386
- if ( !attributes && typeof elem.removeAttribute !== "undefined" ) {
387
- elem.removeAttribute( internalKey );
388
-
389
- // Webkit & Blink performance suffers when deleting properties
390
- // from DOM nodes, so set to undefined instead
391
- // https://code.google.com/p/chromium/issues/detail?id=378607
392
- } else {
393
- elem[ internalKey ] = undefined;
394
- }
395
-
396
- deletedIds.push( id );
397
- }
398
- }
399
- }
400
- }
401
- }
402
- } );
403
-
404
- jQuery.fn.extend( {
405
-
406
- // Keep domManip exposed until 3.0 (gh-2225)
407
- domManip: domManip,
408
-
409
- detach: function( selector ) {
410
- return remove( this, selector, true );
411
- },
412
-
413
- remove: function( selector ) {
414
- return remove( this, selector );
415
- },
416
-
417
- text: function( value ) {
418
- return access( this, function( value ) {
419
- return value === undefined ?
420
- jQuery.text( this ) :
421
- this.empty().append(
422
- ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value )
423
- );
424
- }, null, value, arguments.length );
425
- },
426
-
427
- append: function() {
428
- return domManip( this, arguments, function( elem ) {
429
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
430
- var target = manipulationTarget( this, elem );
431
- target.appendChild( elem );
432
- }
433
- } );
434
- },
435
-
436
- prepend: function() {
437
- return domManip( this, arguments, function( elem ) {
438
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
439
- var target = manipulationTarget( this, elem );
440
- target.insertBefore( elem, target.firstChild );
441
- }
442
- } );
443
- },
444
-
445
- before: function() {
446
- return domManip( this, arguments, function( elem ) {
447
- if ( this.parentNode ) {
448
- this.parentNode.insertBefore( elem, this );
449
- }
450
- } );
451
- },
452
-
453
- after: function() {
454
- return domManip( this, arguments, function( elem ) {
455
- if ( this.parentNode ) {
456
- this.parentNode.insertBefore( elem, this.nextSibling );
457
- }
458
- } );
459
- },
460
-
461
- empty: function() {
462
- var elem,
463
- i = 0;
464
-
465
- for ( ; ( elem = this[ i ] ) != null; i++ ) {
466
-
467
- // Remove element nodes and prevent memory leaks
468
- if ( elem.nodeType === 1 ) {
469
- jQuery.cleanData( getAll( elem, false ) );
470
- }
471
-
472
- // Remove any remaining nodes
473
- while ( elem.firstChild ) {
474
- elem.removeChild( elem.firstChild );
475
- }
476
-
477
- // If this is a select, ensure that it displays empty (#12336)
478
- // Support: IE<9
479
- if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
480
- elem.options.length = 0;
481
- }
482
- }
483
-
484
- return this;
485
- },
486
-
487
- clone: function( dataAndEvents, deepDataAndEvents ) {
488
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
489
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
490
-
491
- return this.map( function() {
492
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
493
- } );
494
- },
495
-
496
- html: function( value ) {
497
- return access( this, function( value ) {
498
- var elem = this[ 0 ] || {},
499
- i = 0,
500
- l = this.length;
501
-
502
- if ( value === undefined ) {
503
- return elem.nodeType === 1 ?
504
- elem.innerHTML.replace( rinlinejQuery, "" ) :
505
- undefined;
506
- }
507
-
508
- // See if we can take a shortcut and just use innerHTML
509
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
510
- ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
511
- ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
512
- !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
513
-
514
- value = jQuery.htmlPrefilter( value );
515
-
516
- try {
517
- for ( ; i < l; i++ ) {
518
-
519
- // Remove element nodes and prevent memory leaks
520
- elem = this[ i ] || {};
521
- if ( elem.nodeType === 1 ) {
522
- jQuery.cleanData( getAll( elem, false ) );
523
- elem.innerHTML = value;
524
- }
525
- }
526
-
527
- elem = 0;
528
-
529
- // If using innerHTML throws an exception, use the fallback method
530
- } catch ( e ) {}
531
- }
532
-
533
- if ( elem ) {
534
- this.empty().append( value );
535
- }
536
- }, null, value, arguments.length );
537
- },
538
-
539
- replaceWith: function() {
540
- var ignored = [];
541
-
542
- // Make the changes, replacing each non-ignored context element with the new content
543
- return domManip( this, arguments, function( elem ) {
544
- var parent = this.parentNode;
545
-
546
- if ( jQuery.inArray( this, ignored ) < 0 ) {
547
- jQuery.cleanData( getAll( this ) );
548
- if ( parent ) {
549
- parent.replaceChild( elem, this );
550
- }
551
- }
552
-
553
- // Force callback invocation
554
- }, ignored );
555
- }
556
- } );
557
-
558
- jQuery.each( {
559
- appendTo: "append",
560
- prependTo: "prepend",
561
- insertBefore: "before",
562
- insertAfter: "after",
563
- replaceAll: "replaceWith"
564
- }, function( name, original ) {
565
- jQuery.fn[ name ] = function( selector ) {
566
- var elems,
567
- i = 0,
568
- ret = [],
569
- insert = jQuery( selector ),
570
- last = insert.length - 1;
571
-
572
- for ( ; i <= last; i++ ) {
573
- elems = i === last ? this : this.clone( true );
574
- jQuery( insert[ i ] )[ original ]( elems );
575
-
576
- // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
577
- push.apply( ret, elems.get() );
578
- }
579
-
580
- return this.pushStack( ret );
581
- };
582
- } );
583
-
584
- return jQuery;
585
- } );