git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made a number of spacing changes to bring the code more-inline with the jQuery Core...
[jquery.git]
/
src
/
manipulation.js
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
d5523dd
..
7500730
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-1,12
+1,12
@@
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
- rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,
+ rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&\w+;/,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&\w+;/,
- fcloseTag = function(all, front, tag){
- return rselfClosing.test(tag) ?
+ fcloseTag = function( all, front, tag ) {
+ return rselfClosing.test( tag ) ?
all :
front + "></" + tag + ">";
},
all :
front + "></" + tag + ">";
},
@@
-32,7
+32,7
@@
if ( !jQuery.support.htmlSerialize ) {
jQuery.fn.extend({
text: function( text ) {
jQuery.fn.extend({
text: function( text ) {
- if(jQuery.isFunction(text)) {
+ if ( jQuery.isFunction(text) ) {
return this.each(function() {
return jQuery(this).text( text.call(this) );
});
return this.each(function() {
return jQuery(this).text( text.call(this) );
});
@@
-60,7
+60,7
@@
jQuery.fn.extend({
wrap.insertBefore( this[0] );
}
wrap.insertBefore( this[0] );
}
- wrap.map(function(){
+ wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
@@
-75,19
+75,19
@@
jQuery.fn.extend({
},
wrapInner: function( html ) {
},
wrapInner: function( html ) {
- return this.each(function(){
+ return this.each(function() {
jQuery( this ).contents().wrapAll( html );
});
},
wrap: function( html ) {
jQuery( this ).contents().wrapAll( html );
});
},
wrap: function( html ) {
- return this.each(function(){
+ return this.each(function() {
jQuery( this ).wrapAll( html );
});
},
unwrap: function() {
jQuery( this ).wrapAll( html );
});
},
unwrap: function() {
- return this.parent().each(function(){
+ return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
@@
-95,7
+95,7
@@
jQuery.fn.extend({
},
append: function() {
},
append: function() {
- return this.domManip(arguments, true, function(elem){
+ return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
@@
-103,7
+103,7
@@
jQuery.fn.extend({
},
prepend: function() {
},
prepend: function() {
- return this.domManip(arguments, true, function(elem){
+ return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.insertBefore( elem, this.firstChild );
}
if ( this.nodeType === 1 ) {
this.insertBefore( elem, this.firstChild );
}
@@
-112,7
+112,7
@@
jQuery.fn.extend({
before: function() {
if ( this[0] && this[0].parentNode ) {
before: function() {
if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function(elem){
+ return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this );
});
} else if ( arguments.length ) {
this.parentNode.insertBefore( elem, this );
});
} else if ( arguments.length ) {
@@
-124,7
+124,7
@@
jQuery.fn.extend({
after: function() {
if ( this[0] && this[0].parentNode ) {
after: function() {
if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function(elem){
+ return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
} else if ( arguments.length ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
} else if ( arguments.length ) {
@@
-136,7
+136,7
@@
jQuery.fn.extend({
clone: function( events ) {
// Do the clone
clone: function( events ) {
// Do the clone
- var ret = this.map(function(){
+ var ret = this.map(function() {
if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
// IE copies events bound via attachEvent when
// using cloneNode. Calling detachEvent on the
if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
// IE copies events bound via attachEvent when
// using cloneNode. Calling detachEvent on the
@@
-204,7
+204,7
@@
jQuery.fn.extend({
replaceWith: function( value ) {
if ( this[0] && this[0].parentNode ) {
replaceWith: function( value ) {
if ( this[0] && this[0].parentNode ) {
- return this.each(function(){
+ return this.each(function() {
var next = this.nextSibling, parent = this.parentNode;
jQuery(this).remove();
var next = this.nextSibling, parent = this.parentNode;
jQuery(this).remove();
@@
-278,7
+278,7
@@
jQuery.fn.extend({
function cloneCopyEvent(orig, ret) {
var i = 0;
function cloneCopyEvent(orig, ret) {
var i = 0;
- ret.each(function(){
+ ret.each(function() {
if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
return;
}
if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
return;
}
@@
-287,7
+287,7
@@
function cloneCopyEvent(orig, ret) {
});
}
});
}
-function buildFragment(args, nodes, scripts){
+function buildFragment( args, nodes, scripts ) {
var fragment, cacheable, cached, cacheresults, doc;
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
var fragment, cacheable, cached, cacheresults, doc;
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
@@
-322,7
+322,7
@@
jQuery.each({
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
-}, function(name, original){
+}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var ret = [], insert = jQuery( selector );
jQuery.fn[ name ] = function( selector ) {
var ret = [], insert = jQuery( selector );
@@
-361,8
+361,8
@@
jQuery.each({
this.removeChild( this.firstChild );
}
}
this.removeChild( this.firstChild );
}
}
-}, function(name, fn){
- jQuery.fn[ name ] = function(){
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function() {
return this.each( fn, arguments );
};
});
return this.each( fn, arguments );
};
});
@@
-378,12
+378,14
@@
jQuery.extend({
var ret = [];
var ret = [];
- jQuery.each(elems, function(i, elem){
+ jQuery.each(elems, function( i, elem ) {
if ( typeof elem === "number" ) {
elem += '';
}
if ( typeof elem === "number" ) {
elem += '';
}
- if ( !elem ) { return; }
+ if ( !elem ) {
+ return;
+ }
// Convert html string into DOM nodes
if ( typeof elem === "string" && !rhtml.test( elem ) ) {
// Convert html string into DOM nodes
if ( typeof elem === "string" && !rhtml.test( elem ) ) {
@@
-416,7
+418,7
@@
jQuery.extend({
div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
- wrap[1] == "<table>" && !hasBody ?
+ wrap[1] === "<table>" && !hasBody ?
div.childNodes :
[];
div.childNodes :
[];