X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=inline;f=src%2Fmanipulation.js;h=1fe82fa27ebe86b9addc06cfbc36d72ad0fe8a0a;hb=813886a4dff0cf4be62fea51c3ae8be9ef88e12a;hp=2a6b9dc3009064efa1e995bfe117690158bad5e2;hpb=b30af34f28074b491929445f5aad3d62c63e772f;p=jquery.git
diff --git a/src/manipulation.js b/src/manipulation.js
index 2a6b9dc..1fe82fa 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -17,6 +17,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
tr: [ 2, "
" ],
td: [ 3, "" ],
col: [ 2, "" ],
+ area: [ 1, "" ],
_default: [ 0, "", "" ]
};
@@ -35,20 +36,7 @@ jQuery.fn.extend({
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
- var ret = "";
-
- jQuery.each( this, function() {
- // Get the text from text nodes and CDATA nodes
- if ( this.nodeType === 3 || this.nodeType === 4 ) {
- ret += this.nodeValue;
-
- // Traverse everything else, except comment nodes
- } else if ( this.nodeType !== 8 ) {
- ret += jQuery.fn.text.call( this.childNodes );
- }
- });
-
- return ret;
+ return jQuery.getText( this );
},
wrapAll: function( html ) {
@@ -168,21 +156,8 @@ jQuery.fn.extend({
// Copy the events from the original to the clone
if ( events === true ) {
- var orig = this.find("*").andSelf(), i = 0;
-
- ret.find("*").andSelf().each(function(){
- if ( this.nodeName !== orig[i].nodeName ) { return; }
-
- var events = jQuery.data( orig[i], "events" );
-
- for ( var type in events ) {
- for ( var handler in events[ type ] ) {
- jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
- }
- }
-
- i++;
- });
+ cloneCopyEvent( this, ret );
+ cloneCopyEvent( this.find("*"), ret.find("*") );
}
// Return the cloned set
@@ -197,7 +172,7 @@ jQuery.fn.extend({
// See if we can take a shortcut and just use innerHTML
} else if ( typeof value === "string" && !/