kanpachi 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bowerrc +3 -0
- data/.travis.yml +3 -1
- data/bower.json +22 -0
- data/kanpachi.gemspec +6 -6
- data/lib/kanpachi/doc/template/components/html5shiv/.bower.json +26 -0
- data/lib/kanpachi/doc/template/components/html5shiv/dist/html5shiv-printshiv.js +11 -0
- data/lib/kanpachi/doc/template/{source/javascripts → components/html5shiv/dist}/html5shiv.js +4 -5
- data/lib/kanpachi/doc/template/components/html5shiv/readme.md +143 -0
- data/lib/kanpachi/doc/template/components/jquery/.bower.json +37 -0
- data/lib/kanpachi/doc/template/components/jquery/MIT-LICENSE.txt +21 -0
- data/lib/kanpachi/doc/template/components/jquery/bower.json +27 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.js +10337 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.min.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.min.map +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax.js +807 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/jsonp.js +89 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/load.js +75 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/parseJSON.js +51 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/parseXML.js +31 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/script.js +93 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/var/rquery.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/xhr.js +196 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes.js +11 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/attr.js +271 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/classes.js +157 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/prop.js +134 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/support.js +64 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/val.js +176 -0
- data/lib/kanpachi/doc/template/components/jquery/src/callbacks.js +205 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core.js +542 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/access.js +60 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/init.js +132 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/parseHTML.js +39 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/ready.js +151 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/var/rsingleTag.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css.js +508 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/addGetHookIf.js +32 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/curCSS.js +117 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/defaultDisplay.js +68 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/hiddenVisibleSelectors.js +20 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/support.js +193 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/swap.js +28 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/cssExpand.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/isHidden.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/rmargin.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data.js +332 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data/accepts.js +21 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data/support.js +25 -0
- data/lib/kanpachi/doc/template/components/jquery/src/deferred.js +150 -0
- data/lib/kanpachi/doc/template/components/jquery/src/deprecated.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/dimensions.js +50 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects.js +648 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/Tween.js +114 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/animatedSelector.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/support.js +76 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event.js +1029 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event/alias.js +39 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event/support.js +26 -0
- data/lib/kanpachi/doc/template/components/jquery/src/exports/amd.js +18 -0
- data/lib/kanpachi/doc/template/components/jquery/src/exports/global.js +32 -0
- data/lib/kanpachi/doc/template/components/jquery/src/intro.js +44 -0
- data/lib/kanpachi/doc/template/components/jquery/src/jquery.js +37 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation.js +744 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/_evalUrl.js +18 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/support.js +79 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/offset.js +211 -0
- data/lib/kanpachi/doc/template/components/jquery/src/outro.js +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/queue.js +142 -0
- data/lib/kanpachi/doc/template/components/jquery/src/queue/delay.js +22 -0
- data/lib/kanpachi/doc/template/components/jquery/src/selector-sizzle.js +14 -0
- data/lib/kanpachi/doc/template/components/jquery/src/selector.js +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/serialize.js +110 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.js +2015 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/support.js +62 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing.js +200 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing/findFilter.js +100 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/class2type.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/concat.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/deletedIds.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/hasOwn.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/indexOf.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/pnum.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/push.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/rnotwhite.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/slice.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/strundefined.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/support.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/toString.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/trim.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/wrap.js +75 -0
- data/lib/kanpachi/doc/template/components/respond/.bower.json +20 -0
- data/lib/kanpachi/doc/template/components/respond/Gruntfile.js +90 -0
- data/lib/kanpachi/doc/template/components/respond/LICENSE-MIT +22 -0
- data/lib/kanpachi/doc/template/components/respond/README.md +114 -0
- data/lib/kanpachi/doc/template/components/respond/bower.json +10 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/example.html +24 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond-proxy.html +96 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond.proxy.gif +0 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond.proxy.js +127 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.matchmedia.addListener.min.js +5 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.matchmedia.addListener.src.js +273 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.min.js +5 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.src.js +224 -0
- data/lib/kanpachi/doc/template/components/respond/package.json +32 -0
- data/lib/kanpachi/doc/template/components/respond/src/matchmedia.addListener.js +76 -0
- data/lib/kanpachi/doc/template/components/respond/src/matchmedia.polyfill.js +36 -0
- data/lib/kanpachi/doc/template/components/respond/src/respond.js +341 -0
- data/lib/kanpachi/doc/template/config.rb +4 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.svg +201 -200
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/kanpachi/doc/template/source/javascripts/all.coffee +2 -0
- data/lib/kanpachi/doc/template/source/javascripts/bootstrap.js +271 -319
- data/lib/kanpachi/doc/template/source/javascripts/bootstrap.min.js +6 -6
- data/lib/kanpachi/doc/template/source/javascripts/ie.coffee +2 -0
- data/lib/kanpachi/doc/template/source/layouts/layout.slim +4 -6
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.css +192 -229
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.css.map +1 -0
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.min.css +7 -1
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.css +2036 -3056
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.css.map +1 -0
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.min.css +6 -8
- data/lib/kanpachi/version.rb +1 -1
- data/wercker.yml +27 -0
- metadata +143 -31
- data/lib/kanpachi/doc/template/source/javascripts/all.js +0 -1
- data/lib/kanpachi/doc/template/source/javascripts/jquery-1.10.2.min.js +0 -6
- data/lib/kanpachi/doc/template/source/javascripts/respond.min.js +0 -7
@@ -0,0 +1,39 @@
|
|
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(" "), function( i, name ) {
|
9
|
+
|
10
|
+
// Handle event binding
|
11
|
+
jQuery.fn[ name ] = function( data, fn ) {
|
12
|
+
return arguments.length > 0 ?
|
13
|
+
this.on( name, null, data, fn ) :
|
14
|
+
this.trigger( name );
|
15
|
+
};
|
16
|
+
});
|
17
|
+
|
18
|
+
jQuery.fn.extend({
|
19
|
+
hover: function( fnOver, fnOut ) {
|
20
|
+
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
21
|
+
},
|
22
|
+
|
23
|
+
bind: function( types, data, fn ) {
|
24
|
+
return this.on( types, null, data, fn );
|
25
|
+
},
|
26
|
+
unbind: function( types, fn ) {
|
27
|
+
return this.off( types, null, fn );
|
28
|
+
},
|
29
|
+
|
30
|
+
delegate: function( selector, types, data, fn ) {
|
31
|
+
return this.on( types, selector, data, fn );
|
32
|
+
},
|
33
|
+
undelegate: function( selector, types, fn ) {
|
34
|
+
// ( namespace ) or ( selector, types [, fn] )
|
35
|
+
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
|
36
|
+
}
|
37
|
+
});
|
38
|
+
|
39
|
+
});
|
@@ -0,0 +1,26 @@
|
|
1
|
+
define([
|
2
|
+
"../var/support"
|
3
|
+
], function( support ) {
|
4
|
+
|
5
|
+
(function() {
|
6
|
+
var i, eventName,
|
7
|
+
div = document.createElement( "div" );
|
8
|
+
|
9
|
+
// Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
|
10
|
+
for ( i in { submit: true, change: true, focusin: true }) {
|
11
|
+
eventName = "on" + i;
|
12
|
+
|
13
|
+
if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
|
14
|
+
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
|
15
|
+
div.setAttribute( eventName, "t" );
|
16
|
+
support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
// Null elements to avoid leaks in IE.
|
21
|
+
div = null;
|
22
|
+
})();
|
23
|
+
|
24
|
+
return support;
|
25
|
+
|
26
|
+
});
|
@@ -0,0 +1,18 @@
|
|
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
|
+
if ( typeof define === "function" && define.amd ) {
|
13
|
+
define( "jquery", [], function() {
|
14
|
+
return jQuery;
|
15
|
+
});
|
16
|
+
}
|
17
|
+
|
18
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"../var/strundefined"
|
4
|
+
], function( jQuery, strundefined ) {
|
5
|
+
|
6
|
+
var
|
7
|
+
// Map over jQuery in case of overwrite
|
8
|
+
_jQuery = window.jQuery,
|
9
|
+
|
10
|
+
// Map over the $ in case of overwrite
|
11
|
+
_$ = window.$;
|
12
|
+
|
13
|
+
jQuery.noConflict = function( deep ) {
|
14
|
+
if ( window.$ === jQuery ) {
|
15
|
+
window.$ = _$;
|
16
|
+
}
|
17
|
+
|
18
|
+
if ( deep && window.jQuery === jQuery ) {
|
19
|
+
window.jQuery = _jQuery;
|
20
|
+
}
|
21
|
+
|
22
|
+
return jQuery;
|
23
|
+
};
|
24
|
+
|
25
|
+
// Expose jQuery and $ identifiers, even in
|
26
|
+
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
|
27
|
+
// and CommonJS for browser emulators (#13566)
|
28
|
+
if ( typeof noGlobal === strundefined ) {
|
29
|
+
window.jQuery = window.$ = jQuery;
|
30
|
+
}
|
31
|
+
|
32
|
+
});
|
@@ -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 2005, 2014 jQuery Foundation, Inc. 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 is present,
|
19
|
+
// execute the factory and get jQuery
|
20
|
+
// For environments that do not inherently posses a window with a document
|
21
|
+
// (such as Node.js), expose a jQuery-making 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
|
+
// Can't do this because several apps including ASP.NET trace
|
41
|
+
// the stack via arguments.caller.callee and Firefox dies if
|
42
|
+
// you try to trace through "use strict" call chains. (#13335)
|
43
|
+
// Support: Firefox 18+
|
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
|
+
"./effects",
|
27
|
+
"./effects/animatedSelector",
|
28
|
+
"./offset",
|
29
|
+
"./dimensions",
|
30
|
+
"./deprecated",
|
31
|
+
"./exports/amd",
|
32
|
+
"./exports/global"
|
33
|
+
], function( jQuery ) {
|
34
|
+
|
35
|
+
return jQuery;
|
36
|
+
|
37
|
+
});
|
@@ -0,0 +1,744 @@
|
|
1
|
+
define([
|
2
|
+
"./core",
|
3
|
+
"./var/strundefined",
|
4
|
+
"./var/concat",
|
5
|
+
"./var/push",
|
6
|
+
"./var/deletedIds",
|
7
|
+
"./core/access",
|
8
|
+
"./manipulation/var/rcheckableType",
|
9
|
+
"./manipulation/support",
|
10
|
+
|
11
|
+
"./core/init",
|
12
|
+
"./data/accepts",
|
13
|
+
"./traversing",
|
14
|
+
"./selector",
|
15
|
+
"./event"
|
16
|
+
], function( jQuery, strundefined, concat, push, deletedIds, access, rcheckableType, support ) {
|
17
|
+
|
18
|
+
function createSafeFragment( document ) {
|
19
|
+
var list = nodeNames.split( "|" ),
|
20
|
+
safeFrag = document.createDocumentFragment();
|
21
|
+
|
22
|
+
if ( safeFrag.createElement ) {
|
23
|
+
while ( list.length ) {
|
24
|
+
safeFrag.createElement(
|
25
|
+
list.pop()
|
26
|
+
);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
return safeFrag;
|
30
|
+
}
|
31
|
+
|
32
|
+
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
|
33
|
+
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
|
34
|
+
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
|
35
|
+
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
|
36
|
+
rleadingWhitespace = /^\s+/,
|
37
|
+
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
|
38
|
+
rtagName = /<([\w:]+)/,
|
39
|
+
rtbody = /<tbody/i,
|
40
|
+
rhtml = /<|&#?\w+;/,
|
41
|
+
rnoInnerhtml = /<(?:script|style|link)/i,
|
42
|
+
// checked="checked" or checked
|
43
|
+
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
44
|
+
rscriptType = /^$|\/(?:java|ecma)script/i,
|
45
|
+
rscriptTypeMasked = /^true\/(.*)/,
|
46
|
+
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
|
47
|
+
|
48
|
+
// We have to close these tags to support XHTML (#13200)
|
49
|
+
wrapMap = {
|
50
|
+
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
51
|
+
legend: [ 1, "<fieldset>", "</fieldset>" ],
|
52
|
+
area: [ 1, "<map>", "</map>" ],
|
53
|
+
param: [ 1, "<object>", "</object>" ],
|
54
|
+
thead: [ 1, "<table>", "</table>" ],
|
55
|
+
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
|
56
|
+
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
57
|
+
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
58
|
+
|
59
|
+
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
|
60
|
+
// unless wrapped in a div with non-breaking characters in front of it.
|
61
|
+
_default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
|
62
|
+
},
|
63
|
+
safeFragment = createSafeFragment( document ),
|
64
|
+
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
|
65
|
+
|
66
|
+
wrapMap.optgroup = wrapMap.option;
|
67
|
+
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
68
|
+
wrapMap.th = wrapMap.td;
|
69
|
+
|
70
|
+
function getAll( context, tag ) {
|
71
|
+
var elems, elem,
|
72
|
+
i = 0,
|
73
|
+
found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
|
74
|
+
typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
|
75
|
+
undefined;
|
76
|
+
|
77
|
+
if ( !found ) {
|
78
|
+
for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
|
79
|
+
if ( !tag || jQuery.nodeName( elem, tag ) ) {
|
80
|
+
found.push( elem );
|
81
|
+
} else {
|
82
|
+
jQuery.merge( found, getAll( elem, tag ) );
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
|
88
|
+
jQuery.merge( [ context ], found ) :
|
89
|
+
found;
|
90
|
+
}
|
91
|
+
|
92
|
+
// Used in buildFragment, fixes the defaultChecked property
|
93
|
+
function fixDefaultChecked( elem ) {
|
94
|
+
if ( rcheckableType.test( elem.type ) ) {
|
95
|
+
elem.defaultChecked = elem.checked;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
// Support: IE<8
|
100
|
+
// Manipulating tables requires a tbody
|
101
|
+
function manipulationTarget( elem, content ) {
|
102
|
+
return jQuery.nodeName( elem, "table" ) &&
|
103
|
+
jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
|
104
|
+
|
105
|
+
elem.getElementsByTagName("tbody")[0] ||
|
106
|
+
elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
|
107
|
+
elem;
|
108
|
+
}
|
109
|
+
|
110
|
+
// Replace/restore the type attribute of script elements for safe DOM manipulation
|
111
|
+
function disableScript( elem ) {
|
112
|
+
elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
|
113
|
+
return elem;
|
114
|
+
}
|
115
|
+
function restoreScript( elem ) {
|
116
|
+
var match = rscriptTypeMasked.exec( elem.type );
|
117
|
+
if ( match ) {
|
118
|
+
elem.type = match[1];
|
119
|
+
} else {
|
120
|
+
elem.removeAttribute("type");
|
121
|
+
}
|
122
|
+
return elem;
|
123
|
+
}
|
124
|
+
|
125
|
+
// Mark scripts as having already been evaluated
|
126
|
+
function setGlobalEval( elems, refElements ) {
|
127
|
+
var elem,
|
128
|
+
i = 0;
|
129
|
+
for ( ; (elem = elems[i]) != null; i++ ) {
|
130
|
+
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
function cloneCopyEvent( src, dest ) {
|
135
|
+
|
136
|
+
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
|
140
|
+
var type, i, l,
|
141
|
+
oldData = jQuery._data( src ),
|
142
|
+
curData = jQuery._data( dest, oldData ),
|
143
|
+
events = oldData.events;
|
144
|
+
|
145
|
+
if ( events ) {
|
146
|
+
delete curData.handle;
|
147
|
+
curData.events = {};
|
148
|
+
|
149
|
+
for ( type in events ) {
|
150
|
+
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
151
|
+
jQuery.event.add( dest, type, events[ type ][ i ] );
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
// make the cloned public data object a copy from the original
|
157
|
+
if ( curData.data ) {
|
158
|
+
curData.data = jQuery.extend( {}, curData.data );
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
function fixCloneNodeIssues( src, dest ) {
|
163
|
+
var nodeName, e, data;
|
164
|
+
|
165
|
+
// We do not need to do anything for non-Elements
|
166
|
+
if ( dest.nodeType !== 1 ) {
|
167
|
+
return;
|
168
|
+
}
|
169
|
+
|
170
|
+
nodeName = dest.nodeName.toLowerCase();
|
171
|
+
|
172
|
+
// IE6-8 copies events bound via attachEvent when using cloneNode.
|
173
|
+
if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
|
174
|
+
data = jQuery._data( dest );
|
175
|
+
|
176
|
+
for ( e in data.events ) {
|
177
|
+
jQuery.removeEvent( dest, e, data.handle );
|
178
|
+
}
|
179
|
+
|
180
|
+
// Event data gets referenced instead of copied if the expando gets copied too
|
181
|
+
dest.removeAttribute( jQuery.expando );
|
182
|
+
}
|
183
|
+
|
184
|
+
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
|
185
|
+
if ( nodeName === "script" && dest.text !== src.text ) {
|
186
|
+
disableScript( dest ).text = src.text;
|
187
|
+
restoreScript( dest );
|
188
|
+
|
189
|
+
// IE6-10 improperly clones children of object elements using classid.
|
190
|
+
// IE10 throws NoModificationAllowedError if parent is null, #12132.
|
191
|
+
} else if ( nodeName === "object" ) {
|
192
|
+
if ( dest.parentNode ) {
|
193
|
+
dest.outerHTML = src.outerHTML;
|
194
|
+
}
|
195
|
+
|
196
|
+
// This path appears unavoidable for IE9. When cloning an object
|
197
|
+
// element in IE9, the outerHTML strategy above is not sufficient.
|
198
|
+
// If the src has innerHTML and the destination does not,
|
199
|
+
// copy the src.innerHTML into the dest.innerHTML. #10324
|
200
|
+
if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
|
201
|
+
dest.innerHTML = src.innerHTML;
|
202
|
+
}
|
203
|
+
|
204
|
+
} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
|
205
|
+
// IE6-8 fails to persist the checked state of a cloned checkbox
|
206
|
+
// or radio button. Worse, IE6-7 fail to give the cloned element
|
207
|
+
// a checked appearance if the defaultChecked value isn't also set
|
208
|
+
|
209
|
+
dest.defaultChecked = dest.checked = src.checked;
|
210
|
+
|
211
|
+
// IE6-7 get confused and end up setting the value of a cloned
|
212
|
+
// checkbox/radio button to an empty string instead of "on"
|
213
|
+
if ( dest.value !== src.value ) {
|
214
|
+
dest.value = src.value;
|
215
|
+
}
|
216
|
+
|
217
|
+
// IE6-8 fails to return the selected option to the default selected
|
218
|
+
// state when cloning options
|
219
|
+
} else if ( nodeName === "option" ) {
|
220
|
+
dest.defaultSelected = dest.selected = src.defaultSelected;
|
221
|
+
|
222
|
+
// IE6-8 fails to set the defaultValue to the correct value when
|
223
|
+
// cloning other types of input fields
|
224
|
+
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
225
|
+
dest.defaultValue = src.defaultValue;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
|
229
|
+
jQuery.extend({
|
230
|
+
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
231
|
+
var destElements, node, clone, i, srcElements,
|
232
|
+
inPage = jQuery.contains( elem.ownerDocument, elem );
|
233
|
+
|
234
|
+
if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
|
235
|
+
clone = elem.cloneNode( true );
|
236
|
+
|
237
|
+
// IE<=8 does not properly clone detached, unknown element nodes
|
238
|
+
} else {
|
239
|
+
fragmentDiv.innerHTML = elem.outerHTML;
|
240
|
+
fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
|
241
|
+
}
|
242
|
+
|
243
|
+
if ( (!support.noCloneEvent || !support.noCloneChecked) &&
|
244
|
+
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
245
|
+
|
246
|
+
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
|
247
|
+
destElements = getAll( clone );
|
248
|
+
srcElements = getAll( elem );
|
249
|
+
|
250
|
+
// Fix all IE cloning issues
|
251
|
+
for ( i = 0; (node = srcElements[i]) != null; ++i ) {
|
252
|
+
// Ensure that the destination node is not null; Fixes #9587
|
253
|
+
if ( destElements[i] ) {
|
254
|
+
fixCloneNodeIssues( node, destElements[i] );
|
255
|
+
}
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
// Copy the events from the original to the clone
|
260
|
+
if ( dataAndEvents ) {
|
261
|
+
if ( deepDataAndEvents ) {
|
262
|
+
srcElements = srcElements || getAll( elem );
|
263
|
+
destElements = destElements || getAll( clone );
|
264
|
+
|
265
|
+
for ( i = 0; (node = srcElements[i]) != null; i++ ) {
|
266
|
+
cloneCopyEvent( node, destElements[i] );
|
267
|
+
}
|
268
|
+
} else {
|
269
|
+
cloneCopyEvent( elem, clone );
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
273
|
+
// Preserve script evaluation history
|
274
|
+
destElements = getAll( clone, "script" );
|
275
|
+
if ( destElements.length > 0 ) {
|
276
|
+
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
|
277
|
+
}
|
278
|
+
|
279
|
+
destElements = srcElements = node = null;
|
280
|
+
|
281
|
+
// Return the cloned set
|
282
|
+
return clone;
|
283
|
+
},
|
284
|
+
|
285
|
+
buildFragment: function( elems, context, scripts, selection ) {
|
286
|
+
var j, elem, contains,
|
287
|
+
tmp, tag, tbody, wrap,
|
288
|
+
l = elems.length,
|
289
|
+
|
290
|
+
// Ensure a safe fragment
|
291
|
+
safe = createSafeFragment( context ),
|
292
|
+
|
293
|
+
nodes = [],
|
294
|
+
i = 0;
|
295
|
+
|
296
|
+
for ( ; i < l; i++ ) {
|
297
|
+
elem = elems[ i ];
|
298
|
+
|
299
|
+
if ( elem || elem === 0 ) {
|
300
|
+
|
301
|
+
// Add nodes directly
|
302
|
+
if ( jQuery.type( elem ) === "object" ) {
|
303
|
+
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
|
304
|
+
|
305
|
+
// Convert non-html into a text node
|
306
|
+
} else if ( !rhtml.test( elem ) ) {
|
307
|
+
nodes.push( context.createTextNode( elem ) );
|
308
|
+
|
309
|
+
// Convert html into DOM nodes
|
310
|
+
} else {
|
311
|
+
tmp = tmp || safe.appendChild( context.createElement("div") );
|
312
|
+
|
313
|
+
// Deserialize a standard representation
|
314
|
+
tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
|
315
|
+
wrap = wrapMap[ tag ] || wrapMap._default;
|
316
|
+
|
317
|
+
tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
|
318
|
+
|
319
|
+
// Descend through wrappers to the right content
|
320
|
+
j = wrap[0];
|
321
|
+
while ( j-- ) {
|
322
|
+
tmp = tmp.lastChild;
|
323
|
+
}
|
324
|
+
|
325
|
+
// Manually add leading whitespace removed by IE
|
326
|
+
if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
|
327
|
+
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
|
328
|
+
}
|
329
|
+
|
330
|
+
// Remove IE's autoinserted <tbody> from table fragments
|
331
|
+
if ( !support.tbody ) {
|
332
|
+
|
333
|
+
// String was a <table>, *may* have spurious <tbody>
|
334
|
+
elem = tag === "table" && !rtbody.test( elem ) ?
|
335
|
+
tmp.firstChild :
|
336
|
+
|
337
|
+
// String was a bare <thead> or <tfoot>
|
338
|
+
wrap[1] === "<table>" && !rtbody.test( elem ) ?
|
339
|
+
tmp :
|
340
|
+
0;
|
341
|
+
|
342
|
+
j = elem && elem.childNodes.length;
|
343
|
+
while ( j-- ) {
|
344
|
+
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
|
345
|
+
elem.removeChild( tbody );
|
346
|
+
}
|
347
|
+
}
|
348
|
+
}
|
349
|
+
|
350
|
+
jQuery.merge( nodes, tmp.childNodes );
|
351
|
+
|
352
|
+
// Fix #12392 for WebKit and IE > 9
|
353
|
+
tmp.textContent = "";
|
354
|
+
|
355
|
+
// Fix #12392 for oldIE
|
356
|
+
while ( tmp.firstChild ) {
|
357
|
+
tmp.removeChild( tmp.firstChild );
|
358
|
+
}
|
359
|
+
|
360
|
+
// Remember the top-level container for proper cleanup
|
361
|
+
tmp = safe.lastChild;
|
362
|
+
}
|
363
|
+
}
|
364
|
+
}
|
365
|
+
|
366
|
+
// Fix #11356: Clear elements from fragment
|
367
|
+
if ( tmp ) {
|
368
|
+
safe.removeChild( tmp );
|
369
|
+
}
|
370
|
+
|
371
|
+
// Reset defaultChecked for any radios and checkboxes
|
372
|
+
// about to be appended to the DOM in IE 6/7 (#8060)
|
373
|
+
if ( !support.appendChecked ) {
|
374
|
+
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
|
375
|
+
}
|
376
|
+
|
377
|
+
i = 0;
|
378
|
+
while ( (elem = nodes[ i++ ]) ) {
|
379
|
+
|
380
|
+
// #4087 - If origin and destination elements are the same, and this is
|
381
|
+
// that element, do not do anything
|
382
|
+
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
|
383
|
+
continue;
|
384
|
+
}
|
385
|
+
|
386
|
+
contains = jQuery.contains( elem.ownerDocument, elem );
|
387
|
+
|
388
|
+
// Append to fragment
|
389
|
+
tmp = getAll( safe.appendChild( elem ), "script" );
|
390
|
+
|
391
|
+
// Preserve script evaluation history
|
392
|
+
if ( contains ) {
|
393
|
+
setGlobalEval( tmp );
|
394
|
+
}
|
395
|
+
|
396
|
+
// Capture executables
|
397
|
+
if ( scripts ) {
|
398
|
+
j = 0;
|
399
|
+
while ( (elem = tmp[ j++ ]) ) {
|
400
|
+
if ( rscriptType.test( elem.type || "" ) ) {
|
401
|
+
scripts.push( elem );
|
402
|
+
}
|
403
|
+
}
|
404
|
+
}
|
405
|
+
}
|
406
|
+
|
407
|
+
tmp = null;
|
408
|
+
|
409
|
+
return safe;
|
410
|
+
},
|
411
|
+
|
412
|
+
cleanData: function( elems, /* internal */ acceptData ) {
|
413
|
+
var elem, type, id, data,
|
414
|
+
i = 0,
|
415
|
+
internalKey = jQuery.expando,
|
416
|
+
cache = jQuery.cache,
|
417
|
+
deleteExpando = support.deleteExpando,
|
418
|
+
special = jQuery.event.special;
|
419
|
+
|
420
|
+
for ( ; (elem = elems[i]) != null; i++ ) {
|
421
|
+
if ( acceptData || jQuery.acceptData( elem ) ) {
|
422
|
+
|
423
|
+
id = elem[ internalKey ];
|
424
|
+
data = id && cache[ id ];
|
425
|
+
|
426
|
+
if ( data ) {
|
427
|
+
if ( data.events ) {
|
428
|
+
for ( type in data.events ) {
|
429
|
+
if ( special[ type ] ) {
|
430
|
+
jQuery.event.remove( elem, type );
|
431
|
+
|
432
|
+
// This is a shortcut to avoid jQuery.event.remove's overhead
|
433
|
+
} else {
|
434
|
+
jQuery.removeEvent( elem, type, data.handle );
|
435
|
+
}
|
436
|
+
}
|
437
|
+
}
|
438
|
+
|
439
|
+
// Remove cache only if it was not already removed by jQuery.event.remove
|
440
|
+
if ( cache[ id ] ) {
|
441
|
+
|
442
|
+
delete cache[ id ];
|
443
|
+
|
444
|
+
// IE does not allow us to delete expando properties from nodes,
|
445
|
+
// nor does it have a removeAttribute function on Document nodes;
|
446
|
+
// we must handle all of these cases
|
447
|
+
if ( deleteExpando ) {
|
448
|
+
delete elem[ internalKey ];
|
449
|
+
|
450
|
+
} else if ( typeof elem.removeAttribute !== strundefined ) {
|
451
|
+
elem.removeAttribute( internalKey );
|
452
|
+
|
453
|
+
} else {
|
454
|
+
elem[ internalKey ] = null;
|
455
|
+
}
|
456
|
+
|
457
|
+
deletedIds.push( id );
|
458
|
+
}
|
459
|
+
}
|
460
|
+
}
|
461
|
+
}
|
462
|
+
}
|
463
|
+
});
|
464
|
+
|
465
|
+
jQuery.fn.extend({
|
466
|
+
text: function( value ) {
|
467
|
+
return access( this, function( value ) {
|
468
|
+
return value === undefined ?
|
469
|
+
jQuery.text( this ) :
|
470
|
+
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
|
471
|
+
}, null, value, arguments.length );
|
472
|
+
},
|
473
|
+
|
474
|
+
append: function() {
|
475
|
+
return this.domManip( arguments, function( elem ) {
|
476
|
+
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
|
477
|
+
var target = manipulationTarget( this, elem );
|
478
|
+
target.appendChild( elem );
|
479
|
+
}
|
480
|
+
});
|
481
|
+
},
|
482
|
+
|
483
|
+
prepend: function() {
|
484
|
+
return this.domManip( arguments, function( elem ) {
|
485
|
+
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
|
486
|
+
var target = manipulationTarget( this, elem );
|
487
|
+
target.insertBefore( elem, target.firstChild );
|
488
|
+
}
|
489
|
+
});
|
490
|
+
},
|
491
|
+
|
492
|
+
before: function() {
|
493
|
+
return this.domManip( arguments, function( elem ) {
|
494
|
+
if ( this.parentNode ) {
|
495
|
+
this.parentNode.insertBefore( elem, this );
|
496
|
+
}
|
497
|
+
});
|
498
|
+
},
|
499
|
+
|
500
|
+
after: function() {
|
501
|
+
return this.domManip( arguments, function( elem ) {
|
502
|
+
if ( this.parentNode ) {
|
503
|
+
this.parentNode.insertBefore( elem, this.nextSibling );
|
504
|
+
}
|
505
|
+
});
|
506
|
+
},
|
507
|
+
|
508
|
+
remove: function( selector, keepData /* Internal Use Only */ ) {
|
509
|
+
var elem,
|
510
|
+
elems = selector ? jQuery.filter( selector, this ) : this,
|
511
|
+
i = 0;
|
512
|
+
|
513
|
+
for ( ; (elem = elems[i]) != null; i++ ) {
|
514
|
+
|
515
|
+
if ( !keepData && elem.nodeType === 1 ) {
|
516
|
+
jQuery.cleanData( getAll( elem ) );
|
517
|
+
}
|
518
|
+
|
519
|
+
if ( elem.parentNode ) {
|
520
|
+
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
|
521
|
+
setGlobalEval( getAll( elem, "script" ) );
|
522
|
+
}
|
523
|
+
elem.parentNode.removeChild( elem );
|
524
|
+
}
|
525
|
+
}
|
526
|
+
|
527
|
+
return this;
|
528
|
+
},
|
529
|
+
|
530
|
+
empty: function() {
|
531
|
+
var elem,
|
532
|
+
i = 0;
|
533
|
+
|
534
|
+
for ( ; (elem = this[i]) != null; i++ ) {
|
535
|
+
// Remove element nodes and prevent memory leaks
|
536
|
+
if ( elem.nodeType === 1 ) {
|
537
|
+
jQuery.cleanData( getAll( elem, false ) );
|
538
|
+
}
|
539
|
+
|
540
|
+
// Remove any remaining nodes
|
541
|
+
while ( elem.firstChild ) {
|
542
|
+
elem.removeChild( elem.firstChild );
|
543
|
+
}
|
544
|
+
|
545
|
+
// If this is a select, ensure that it displays empty (#12336)
|
546
|
+
// Support: IE<9
|
547
|
+
if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
|
548
|
+
elem.options.length = 0;
|
549
|
+
}
|
550
|
+
}
|
551
|
+
|
552
|
+
return this;
|
553
|
+
},
|
554
|
+
|
555
|
+
clone: function( dataAndEvents, deepDataAndEvents ) {
|
556
|
+
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
|
557
|
+
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
|
558
|
+
|
559
|
+
return this.map(function() {
|
560
|
+
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
|
561
|
+
});
|
562
|
+
},
|
563
|
+
|
564
|
+
html: function( value ) {
|
565
|
+
return access( this, function( value ) {
|
566
|
+
var elem = this[ 0 ] || {},
|
567
|
+
i = 0,
|
568
|
+
l = this.length;
|
569
|
+
|
570
|
+
if ( value === undefined ) {
|
571
|
+
return elem.nodeType === 1 ?
|
572
|
+
elem.innerHTML.replace( rinlinejQuery, "" ) :
|
573
|
+
undefined;
|
574
|
+
}
|
575
|
+
|
576
|
+
// See if we can take a shortcut and just use innerHTML
|
577
|
+
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
578
|
+
( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
|
579
|
+
( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
|
580
|
+
!wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
|
581
|
+
|
582
|
+
value = value.replace( rxhtmlTag, "<$1></$2>" );
|
583
|
+
|
584
|
+
try {
|
585
|
+
for (; i < l; i++ ) {
|
586
|
+
// Remove element nodes and prevent memory leaks
|
587
|
+
elem = this[i] || {};
|
588
|
+
if ( elem.nodeType === 1 ) {
|
589
|
+
jQuery.cleanData( getAll( elem, false ) );
|
590
|
+
elem.innerHTML = value;
|
591
|
+
}
|
592
|
+
}
|
593
|
+
|
594
|
+
elem = 0;
|
595
|
+
|
596
|
+
// If using innerHTML throws an exception, use the fallback method
|
597
|
+
} catch(e) {}
|
598
|
+
}
|
599
|
+
|
600
|
+
if ( elem ) {
|
601
|
+
this.empty().append( value );
|
602
|
+
}
|
603
|
+
}, null, value, arguments.length );
|
604
|
+
},
|
605
|
+
|
606
|
+
replaceWith: function() {
|
607
|
+
var arg = arguments[ 0 ];
|
608
|
+
|
609
|
+
// Make the changes, replacing each context element with the new content
|
610
|
+
this.domManip( arguments, function( elem ) {
|
611
|
+
arg = this.parentNode;
|
612
|
+
|
613
|
+
jQuery.cleanData( getAll( this ) );
|
614
|
+
|
615
|
+
if ( arg ) {
|
616
|
+
arg.replaceChild( elem, this );
|
617
|
+
}
|
618
|
+
});
|
619
|
+
|
620
|
+
// Force removal if there was no new content (e.g., from empty arguments)
|
621
|
+
return arg && (arg.length || arg.nodeType) ? this : this.remove();
|
622
|
+
},
|
623
|
+
|
624
|
+
detach: function( selector ) {
|
625
|
+
return this.remove( selector, true );
|
626
|
+
},
|
627
|
+
|
628
|
+
domManip: function( args, callback ) {
|
629
|
+
|
630
|
+
// Flatten any nested arrays
|
631
|
+
args = concat.apply( [], args );
|
632
|
+
|
633
|
+
var first, node, hasScripts,
|
634
|
+
scripts, doc, fragment,
|
635
|
+
i = 0,
|
636
|
+
l = this.length,
|
637
|
+
set = this,
|
638
|
+
iNoClone = l - 1,
|
639
|
+
value = args[0],
|
640
|
+
isFunction = jQuery.isFunction( value );
|
641
|
+
|
642
|
+
// We can't cloneNode fragments that contain checked, in WebKit
|
643
|
+
if ( isFunction ||
|
644
|
+
( l > 1 && typeof value === "string" &&
|
645
|
+
!support.checkClone && rchecked.test( value ) ) ) {
|
646
|
+
return this.each(function( index ) {
|
647
|
+
var self = set.eq( index );
|
648
|
+
if ( isFunction ) {
|
649
|
+
args[0] = value.call( this, index, self.html() );
|
650
|
+
}
|
651
|
+
self.domManip( args, callback );
|
652
|
+
});
|
653
|
+
}
|
654
|
+
|
655
|
+
if ( l ) {
|
656
|
+
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
|
657
|
+
first = fragment.firstChild;
|
658
|
+
|
659
|
+
if ( fragment.childNodes.length === 1 ) {
|
660
|
+
fragment = first;
|
661
|
+
}
|
662
|
+
|
663
|
+
if ( first ) {
|
664
|
+
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
|
665
|
+
hasScripts = scripts.length;
|
666
|
+
|
667
|
+
// Use the original fragment for the last item instead of the first because it can end up
|
668
|
+
// being emptied incorrectly in certain situations (#8070).
|
669
|
+
for ( ; i < l; i++ ) {
|
670
|
+
node = fragment;
|
671
|
+
|
672
|
+
if ( i !== iNoClone ) {
|
673
|
+
node = jQuery.clone( node, true, true );
|
674
|
+
|
675
|
+
// Keep references to cloned scripts for later restoration
|
676
|
+
if ( hasScripts ) {
|
677
|
+
jQuery.merge( scripts, getAll( node, "script" ) );
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
callback.call( this[i], node, i );
|
682
|
+
}
|
683
|
+
|
684
|
+
if ( hasScripts ) {
|
685
|
+
doc = scripts[ scripts.length - 1 ].ownerDocument;
|
686
|
+
|
687
|
+
// Reenable scripts
|
688
|
+
jQuery.map( scripts, restoreScript );
|
689
|
+
|
690
|
+
// Evaluate executable scripts on first document insertion
|
691
|
+
for ( i = 0; i < hasScripts; i++ ) {
|
692
|
+
node = scripts[ i ];
|
693
|
+
if ( rscriptType.test( node.type || "" ) &&
|
694
|
+
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
|
695
|
+
|
696
|
+
if ( node.src ) {
|
697
|
+
// Optional AJAX dependency, but won't run scripts if not present
|
698
|
+
if ( jQuery._evalUrl ) {
|
699
|
+
jQuery._evalUrl( node.src );
|
700
|
+
}
|
701
|
+
} else {
|
702
|
+
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
|
703
|
+
}
|
704
|
+
}
|
705
|
+
}
|
706
|
+
}
|
707
|
+
|
708
|
+
// Fix #11809: Avoid leaking memory
|
709
|
+
fragment = first = null;
|
710
|
+
}
|
711
|
+
}
|
712
|
+
|
713
|
+
return this;
|
714
|
+
}
|
715
|
+
});
|
716
|
+
|
717
|
+
jQuery.each({
|
718
|
+
appendTo: "append",
|
719
|
+
prependTo: "prepend",
|
720
|
+
insertBefore: "before",
|
721
|
+
insertAfter: "after",
|
722
|
+
replaceAll: "replaceWith"
|
723
|
+
}, function( name, original ) {
|
724
|
+
jQuery.fn[ name ] = function( selector ) {
|
725
|
+
var elems,
|
726
|
+
i = 0,
|
727
|
+
ret = [],
|
728
|
+
insert = jQuery( selector ),
|
729
|
+
last = insert.length - 1;
|
730
|
+
|
731
|
+
for ( ; i <= last; i++ ) {
|
732
|
+
elems = i === last ? this : this.clone(true);
|
733
|
+
jQuery( insert[i] )[ original ]( elems );
|
734
|
+
|
735
|
+
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
|
736
|
+
push.apply( ret, elems.get() );
|
737
|
+
}
|
738
|
+
|
739
|
+
return this.pushStack( ret );
|
740
|
+
};
|
741
|
+
});
|
742
|
+
|
743
|
+
return jQuery;
|
744
|
+
});
|