govuk_publishing_components 18.1.1 → 18.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +11 -5
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +10 -7
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/jquery/AUTHORS.txt +266 -0
- data/node_modules/jquery/LICENSE.txt +36 -0
- data/node_modules/jquery/README.md +65 -0
- data/node_modules/jquery/bower.json +14 -0
- data/node_modules/jquery/dist/jquery.js +11008 -0
- data/node_modules/jquery/dist/jquery.min.js +5 -0
- data/node_modules/jquery/dist/jquery.min.map +1 -0
- data/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/node_modules/jquery/package.json +157 -0
- data/node_modules/jquery/src/ajax.js +842 -0
- data/node_modules/jquery/src/ajax/jsonp.js +100 -0
- data/node_modules/jquery/src/ajax/load.js +83 -0
- data/node_modules/jquery/src/ajax/parseJSON.js +53 -0
- data/node_modules/jquery/src/ajax/parseXML.js +31 -0
- data/node_modules/jquery/src/ajax/script.js +95 -0
- data/node_modules/jquery/src/ajax/var/location.js +3 -0
- data/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/node_modules/jquery/src/ajax/var/rquery.js +3 -0
- data/node_modules/jquery/src/ajax/xhr.js +229 -0
- data/node_modules/jquery/src/attributes.js +11 -0
- data/node_modules/jquery/src/attributes/attr.js +281 -0
- data/node_modules/jquery/src/attributes/classes.js +174 -0
- data/node_modules/jquery/src/attributes/prop.js +156 -0
- data/node_modules/jquery/src/attributes/support.js +70 -0
- data/node_modules/jquery/src/attributes/val.js +191 -0
- data/node_modules/jquery/src/callbacks.js +232 -0
- data/node_modules/jquery/src/core.js +529 -0
- data/node_modules/jquery/src/core/access.js +65 -0
- data/node_modules/jquery/src/core/init.js +140 -0
- data/node_modules/jquery/src/core/parseHTML.js +41 -0
- data/node_modules/jquery/src/core/ready.js +163 -0
- data/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
- data/node_modules/jquery/src/css.js +563 -0
- data/node_modules/jquery/src/css/addGetHookIf.js +24 -0
- data/node_modules/jquery/src/css/adjustCSS.js +65 -0
- data/node_modules/jquery/src/css/curCSS.js +137 -0
- data/node_modules/jquery/src/css/defaultDisplay.js +72 -0
- data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +42 -0
- data/node_modules/jquery/src/css/showHide.js +45 -0
- data/node_modules/jquery/src/css/support.js +184 -0
- data/node_modules/jquery/src/css/var/cssExpand.js +3 -0
- data/node_modules/jquery/src/css/var/isHidden.js +16 -0
- data/node_modules/jquery/src/css/var/rmargin.js +3 -0
- data/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
- data/node_modules/jquery/src/css/var/swap.js +24 -0
- data/node_modules/jquery/src/data.js +342 -0
- data/node_modules/jquery/src/data/support.js +23 -0
- data/node_modules/jquery/src/data/var/acceptData.js +20 -0
- data/node_modules/jquery/src/deferred.js +159 -0
- data/node_modules/jquery/src/deprecated.js +34 -0
- data/node_modules/jquery/src/dimensions.js +56 -0
- data/node_modules/jquery/src/effects.js +640 -0
- data/node_modules/jquery/src/effects/Tween.js +121 -0
- data/node_modules/jquery/src/effects/animatedSelector.js +13 -0
- data/node_modules/jquery/src/effects/support.js +58 -0
- data/node_modules/jquery/src/event.js +1134 -0
- data/node_modules/jquery/src/event/ajax.js +20 -0
- data/node_modules/jquery/src/event/alias.js +25 -0
- data/node_modules/jquery/src/event/support.js +28 -0
- data/node_modules/jquery/src/exports/amd.js +24 -0
- data/node_modules/jquery/src/exports/global.js +26 -0
- data/node_modules/jquery/src/intro.js +44 -0
- data/node_modules/jquery/src/jquery.js +37 -0
- data/node_modules/jquery/src/manipulation.js +585 -0
- data/node_modules/jquery/src/manipulation/_evalUrl.js +21 -0
- data/node_modules/jquery/src/manipulation/buildFragment.js +157 -0
- data/node_modules/jquery/src/manipulation/createSafeFragment.js +20 -0
- data/node_modules/jquery/src/manipulation/getAll.js +33 -0
- data/node_modules/jquery/src/manipulation/setGlobalEval.js +19 -0
- data/node_modules/jquery/src/manipulation/support.js +72 -0
- data/node_modules/jquery/src/manipulation/var/nodeNames.js +5 -0
- data/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
- data/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
- data/node_modules/jquery/src/offset.js +219 -0
- data/node_modules/jquery/src/outro.js +2 -0
- data/node_modules/jquery/src/queue.js +144 -0
- data/node_modules/jquery/src/queue/delay.js +22 -0
- data/node_modules/jquery/src/selector-sizzle.js +14 -0
- data/node_modules/jquery/src/selector.js +1 -0
- data/node_modules/jquery/src/serialize.js +125 -0
- data/node_modules/jquery/src/support.js +63 -0
- data/node_modules/jquery/src/traversing.js +179 -0
- data/node_modules/jquery/src/traversing/findFilter.js +100 -0
- data/node_modules/jquery/src/traversing/var/dir.js +20 -0
- data/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/node_modules/jquery/src/traversing/var/siblings.js +15 -0
- data/node_modules/jquery/src/var/class2type.js +5 -0
- data/node_modules/jquery/src/var/concat.js +5 -0
- data/node_modules/jquery/src/var/deletedIds.js +3 -0
- data/node_modules/jquery/src/var/document.js +3 -0
- data/node_modules/jquery/src/var/documentElement.js +5 -0
- data/node_modules/jquery/src/var/hasOwn.js +5 -0
- data/node_modules/jquery/src/var/indexOf.js +5 -0
- data/node_modules/jquery/src/var/pnum.js +3 -0
- data/node_modules/jquery/src/var/push.js +5 -0
- data/node_modules/jquery/src/var/rcssNum.js +7 -0
- data/node_modules/jquery/src/var/rnotwhite.js +3 -0
- data/node_modules/jquery/src/var/slice.js +5 -0
- data/node_modules/jquery/src/var/support.js +5 -0
- data/node_modules/jquery/src/var/toString.js +5 -0
- data/node_modules/jquery/src/wrap.js +77 -0
- metadata +109 -2
@@ -0,0 +1,20 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../event"
|
4
|
+
], function( jQuery ) {
|
5
|
+
|
6
|
+
// Attach a bunch of functions for handling common AJAX events
|
7
|
+
jQuery.each( [
|
8
|
+
"ajaxStart",
|
9
|
+
"ajaxStop",
|
10
|
+
"ajaxComplete",
|
11
|
+
"ajaxError",
|
12
|
+
"ajaxSuccess",
|
13
|
+
"ajaxSend"
|
14
|
+
], function( i, type ) {
|
15
|
+
jQuery.fn[ type ] = function( fn ) {
|
16
|
+
return this.on( type, fn );
|
17
|
+
};
|
18
|
+
} );
|
19
|
+
|
20
|
+
} );
|
@@ -0,0 +1,25 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../event"
|
4
|
+
], function( jQuery ) {
|
5
|
+
|
6
|
+
jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
|
7
|
+
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
8
|
+
"change select submit keydown keypress keyup error contextmenu" ).split( " " ),
|
9
|
+
function( i, name ) {
|
10
|
+
|
11
|
+
// Handle event binding
|
12
|
+
jQuery.fn[ name ] = function( data, fn ) {
|
13
|
+
return arguments.length > 0 ?
|
14
|
+
this.on( name, null, data, fn ) :
|
15
|
+
this.trigger( name );
|
16
|
+
};
|
17
|
+
} );
|
18
|
+
|
19
|
+
jQuery.fn.extend( {
|
20
|
+
hover: function( fnOver, fnOut ) {
|
21
|
+
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
22
|
+
}
|
23
|
+
} );
|
24
|
+
|
25
|
+
} );
|
@@ -0,0 +1,28 @@
|
|
1
|
+
define( [
|
2
|
+
"../var/document",
|
3
|
+
"../var/support"
|
4
|
+
], function( document, support ) {
|
5
|
+
|
6
|
+
( function() {
|
7
|
+
var i, eventName,
|
8
|
+
div = document.createElement( "div" );
|
9
|
+
|
10
|
+
// Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events)
|
11
|
+
for ( i in { submit: true, change: true, focusin: true } ) {
|
12
|
+
eventName = "on" + i;
|
13
|
+
|
14
|
+
if ( !( support[ i ] = eventName in window ) ) {
|
15
|
+
|
16
|
+
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
|
17
|
+
div.setAttribute( eventName, "t" );
|
18
|
+
support[ i ] = div.attributes[ eventName ].expando === false;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
// Null elements to avoid leaks in IE.
|
23
|
+
div = null;
|
24
|
+
} )();
|
25
|
+
|
26
|
+
return support;
|
27
|
+
|
28
|
+
} );
|
@@ -0,0 +1,24 @@
|
|
1
|
+
define( [
|
2
|
+
"../core"
|
3
|
+
], function( jQuery ) {
|
4
|
+
|
5
|
+
// Register as a named AMD module, since jQuery can be concatenated with other
|
6
|
+
// files that may use define, but not via a proper concatenation script that
|
7
|
+
// understands anonymous AMD modules. A named AMD is safest and most robust
|
8
|
+
// way to register. Lowercase jquery is used because AMD module names are
|
9
|
+
// derived from file names, and jQuery is normally delivered in a lowercase
|
10
|
+
// file name. Do this after creating the global so that if an AMD module wants
|
11
|
+
// to call noConflict to hide this version of jQuery, it will work.
|
12
|
+
|
13
|
+
// Note that for maximum portability, libraries that are not jQuery should
|
14
|
+
// declare themselves as anonymous modules, and avoid setting a global if an
|
15
|
+
// AMD loader is present. jQuery is a special case. For more information, see
|
16
|
+
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
|
17
|
+
|
18
|
+
if ( typeof define === "function" && define.amd ) {
|
19
|
+
define( "jquery", [], function() {
|
20
|
+
return jQuery;
|
21
|
+
} );
|
22
|
+
}
|
23
|
+
|
24
|
+
} );
|
@@ -0,0 +1,26 @@
|
|
1
|
+
var
|
2
|
+
|
3
|
+
// Map over jQuery in case of overwrite
|
4
|
+
_jQuery = window.jQuery,
|
5
|
+
|
6
|
+
// Map over the $ in case of overwrite
|
7
|
+
_$ = window.$;
|
8
|
+
|
9
|
+
jQuery.noConflict = function( deep ) {
|
10
|
+
if ( window.$ === jQuery ) {
|
11
|
+
window.$ = _$;
|
12
|
+
}
|
13
|
+
|
14
|
+
if ( deep && window.jQuery === jQuery ) {
|
15
|
+
window.jQuery = _jQuery;
|
16
|
+
}
|
17
|
+
|
18
|
+
return jQuery;
|
19
|
+
};
|
20
|
+
|
21
|
+
// Expose jQuery and $ identifiers, even in
|
22
|
+
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
|
23
|
+
// and CommonJS for browser emulators (#13566)
|
24
|
+
if ( !noGlobal ) {
|
25
|
+
window.jQuery = window.$ = jQuery;
|
26
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery JavaScript Library v@VERSION
|
3
|
+
* http://jquery.com/
|
4
|
+
*
|
5
|
+
* Includes Sizzle.js
|
6
|
+
* http://sizzlejs.com/
|
7
|
+
*
|
8
|
+
* Copyright jQuery Foundation and other contributors
|
9
|
+
* Released under the MIT license
|
10
|
+
* http://jquery.org/license
|
11
|
+
*
|
12
|
+
* Date: @DATE
|
13
|
+
*/
|
14
|
+
|
15
|
+
(function( global, factory ) {
|
16
|
+
|
17
|
+
if ( typeof module === "object" && typeof module.exports === "object" ) {
|
18
|
+
// For CommonJS and CommonJS-like environments where a proper `window`
|
19
|
+
// is present, execute the factory and get jQuery.
|
20
|
+
// For environments that do not have a `window` with a `document`
|
21
|
+
// (such as Node.js), expose a factory as module.exports.
|
22
|
+
// This accentuates the need for the creation of a real `window`.
|
23
|
+
// e.g. var jQuery = require("jquery")(window);
|
24
|
+
// See ticket #14549 for more info.
|
25
|
+
module.exports = global.document ?
|
26
|
+
factory( global, true ) :
|
27
|
+
function( w ) {
|
28
|
+
if ( !w.document ) {
|
29
|
+
throw new Error( "jQuery requires a window with a document" );
|
30
|
+
}
|
31
|
+
return factory( w );
|
32
|
+
};
|
33
|
+
} else {
|
34
|
+
factory( global );
|
35
|
+
}
|
36
|
+
|
37
|
+
// Pass this if window is not defined yet
|
38
|
+
}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
|
39
|
+
|
40
|
+
// Support: Firefox 18+
|
41
|
+
// Can't be in strict mode, several libs including ASP.NET trace
|
42
|
+
// the stack via arguments.caller.callee and Firefox dies if
|
43
|
+
// you try to trace through "use strict" call chains. (#13335)
|
44
|
+
//"use strict";
|
@@ -0,0 +1,37 @@
|
|
1
|
+
define( [
|
2
|
+
"./core",
|
3
|
+
"./selector",
|
4
|
+
"./traversing",
|
5
|
+
"./callbacks",
|
6
|
+
"./deferred",
|
7
|
+
"./core/ready",
|
8
|
+
"./support",
|
9
|
+
"./data",
|
10
|
+
"./queue",
|
11
|
+
"./queue/delay",
|
12
|
+
"./attributes",
|
13
|
+
"./event",
|
14
|
+
"./event/alias",
|
15
|
+
"./manipulation",
|
16
|
+
"./manipulation/_evalUrl",
|
17
|
+
"./wrap",
|
18
|
+
"./css",
|
19
|
+
"./css/hiddenVisibleSelectors",
|
20
|
+
"./serialize",
|
21
|
+
"./ajax",
|
22
|
+
"./ajax/xhr",
|
23
|
+
"./ajax/script",
|
24
|
+
"./ajax/jsonp",
|
25
|
+
"./ajax/load",
|
26
|
+
"./event/ajax",
|
27
|
+
"./effects",
|
28
|
+
"./effects/animatedSelector",
|
29
|
+
"./offset",
|
30
|
+
"./dimensions",
|
31
|
+
"./deprecated",
|
32
|
+
"./exports/amd"
|
33
|
+
], function( jQuery ) {
|
34
|
+
|
35
|
+
return ( window.jQuery = window.$ = jQuery );
|
36
|
+
|
37
|
+
} );
|
@@ -0,0 +1,585 @@
|
|
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
|
+
} );
|