aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2012-12-20 21:11:13 +0400
committerOleg <markelog@gmail.com>2012-12-24 03:04:19 +0400
commit9e703a2a19c0b248f4efb8cf8343d317c3a557f1 (patch)
tree0c6bdc281c2d835623a968ffe1d6894a83550143 /src/manipulation.js
parentd41ac85ca3773f1be5dd91d59060fc064ac22673 (diff)
downloadjquery-9e703a2a19c0b248f4efb8cf8343d317c3a557f1.tar.gz
jquery-9e703a2a19c0b248f4efb8cf8343d317c3a557f1.zip
Code style changes
Save one byte
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index f24f1e9b1..665e53b61 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -132,7 +132,8 @@ jQuery.fn.extend({
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
- var elem, i = 0;
+ var elem,
+ i = 0;
for ( ; ( elem = this[ i ] ) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
@@ -191,12 +192,12 @@ jQuery.fn.extend({
// See if we can take a shortcut and just use innerHTML
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[ 1 ].toLowerCase() ] ) {
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
value = value.replace( rxhtmlTag, "<$1></$2>" );
try {
- for (; i < l; i++ ) {
+ for ( ; i < l; i++ ) {
elem = this[ i ] || {};
// Remove element nodes and prevent memory leaks
@@ -397,7 +398,7 @@ jQuery.extend({
srcElements = srcElements || getAll( elem );
destElements = destElements || getAll( clone );
- for ( i = 0; (node = srcElements[ i ]) != null; i++ ) {
+ for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) {
cloneCopyEvent( node, destElements[ i ] );
}
} else {
@@ -425,7 +426,7 @@ jQuery.extend({
context = document;
}
- for ( i = 0; (elem = elems[ i ]) != null; i++ ) {
+ for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
if ( elem || elem === 0 ) {
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {
@@ -469,7 +470,7 @@ jQuery.extend({
}
if ( fragment ) {
- for ( i = 0; (elem = ret[ i ]) != null; i++ ) {
+ for ( i = 0; ( elem = ret[ i ] ) != null; i++ ) {
container = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
@@ -487,7 +488,7 @@ jQuery.extend({
// Capture executables
if ( scripts ) {
- for ( j = 0; (elem = tmp[ j ]) != null; j++ ) {
+ for ( j = 0; ( elem = tmp[ j ] ) != null; j++ ) {
if ( rscriptType.test( elem.type || "" ) ) {
scripts.push( elem );
}
@@ -506,7 +507,7 @@ jQuery.extend({
cache = jQuery.cache,
special = jQuery.event.special;
- for ( ; (elem = elems[ i ]) != null; i++ ) {
+ for ( ; ( elem = elems[ i ] ) != null; i++ ) {
if ( acceptData || jQuery.acceptData( elem ) ) {
@@ -536,7 +537,7 @@ jQuery.extend({
});
function findOrAppend( elem, tag ) {
- return elem.getElementsByTagName( tag )[ 0 ] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
+ return elem.getElementsByTagName( tag )[ 0 ] || elem.appendChild( elem.ownerDocument.createElement(tag) );
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
@@ -549,9 +550,11 @@ function restoreScript( elem ) {
var match = rscriptTypeMasked.exec( elem.type );
if ( match ) {
elem.type = match[ 1 ];
+
} else {
elem.removeAttribute("type");
}
+
return elem;
}
@@ -559,7 +562,7 @@ function restoreScript( elem ) {
function setGlobalEval( elems, refElements ) {
var elem,
i = 0;
- for ( ; (elem = elems[ i ]) != null; i++ ) {
+ for ( ; ( elem = elems[ i ] ) != null; i++ ) {
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[ i ], "globalEval" ) );
}
}
@@ -570,7 +573,7 @@ function cloneCopyEvent( src, dest ) {
return;
}
- var type, i, l,
+ var type, l, i,
oldData = jQuery._data( src ),
curData = jQuery._data( dest, oldData ),
events = oldData.events;