git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Append colgroup and col elements (#1044)
[jquery.git]
/
src
/
jquery
/
jquery.js
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
ddb08a4
..
c22c12c
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-840,7
+840,7
@@
jQuery.fn = jQuery.prototype = {
*/
clone: function(deep) {
return this.pushStack( jQuery.map( this, function(a){
*/
clone: function(deep) {
return this.pushStack( jQuery.map( this, function(a){
- var a = a.cloneNode( deep != undefined ? deep : true );
+ a = a.cloneNode( deep != undefined ? deep : true );
a.$events = null; // drop $events expando to avoid firing incorrect events
return a;
}) );
a.$events = null; // drop $events expando to avoid firing incorrect events
return a;
}) );
@@
-1199,8
+1199,7
@@
jQuery.fn = jQuery.prototype = {
*/
jQuery.extend = jQuery.fn.extend = function() {
// copy reference to target object
*/
jQuery.extend = jQuery.fn.extend = function() {
// copy reference to target object
- var target = arguments[0],
- a = 1;
+ var target = arguments[0], a = 1;
// extend jQuery itself if only one argument is passed
if ( arguments.length == 1 ) {
// extend jQuery itself if only one argument is passed
if ( arguments.length == 1 ) {
@@
-1208,7
+1207,7
@@
jQuery.extend = jQuery.fn.extend = function() {
a = 0;
}
var prop;
a = 0;
}
var prop;
- while (prop = arguments[a++])
+ while ( (prop = arguments[a++]) != null )
// Extend the base object
for ( var i in prop ) target[i] = prop[i];
// Extend the base object
for ( var i in prop ) target[i] = prop[i];
@@
-1373,7
+1372,7
@@
jQuery.extend({
});
jQuery.swap( e, old, function() {
});
jQuery.swap( e, old, function() {
- if (jQuery.css(e,"display") != "none") {
+ if ( jQuery(e).is(':visible') ) {
oHeight = e.offsetHeight;
oWidth = e.offsetWidth;
} else {
oHeight = e.offsetHeight;
oWidth = e.offsetWidth;
} else {
@@
-1383,14
+1382,14
@@
jQuery.extend({
visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
}).appendTo(e.parentNode)[0];
visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
}).appendTo(e.parentNode)[0];
- var parPos = jQuery.css(e.parentNode,"position");
- if ( parPos == "" || parPos == "static" )
+ var parPos = jQuery.css(e.parentNode,"position") || "static";
+ if ( parPos == "static" )
e.parentNode.style.position = "relative";
oHeight = e.clientHeight;
oWidth = e.clientWidth;
e.parentNode.style.position = "relative";
oHeight = e.clientHeight;
oWidth = e.clientWidth;
- if ( parPos == "" || parPos == "static" )
+ if ( parPos == "static" )
e.parentNode.style.position = "static";
e.parentNode.removeChild(e);
e.parentNode.style.position = "static";
e.parentNode.removeChild(e);
@@
-1456,14
+1455,17
@@
jQuery.extend({
// Convert html string into DOM nodes
if ( typeof arg == "string" ) {
// Trim whitespace, otherwise indexOf won't work as expected
// Convert html string into DOM nodes
if ( typeof arg == "string" ) {
// Trim whitespace, otherwise indexOf won't work as expected
- var s = jQuery.trim(arg), div = doc.createElement("div"), tb = [];
+ var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
var wrap =
// option or optgroup
!s.indexOf("<opt") &&
[1, "<select>", "</select>"] ||
var wrap =
// option or optgroup
!s.indexOf("<opt") &&
[1, "<select>", "</select>"] ||
- (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot")) &&
+ !s.indexOf("<leg") &&
+ [1, "<fieldset>", "</fieldset>"] ||
+
+ (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot") || !s.indexOf("<colg")) &&
[1, "<table>", "</table>"] ||
!s.indexOf("<tr") &&
[1, "<table>", "</table>"] ||
!s.indexOf("<tr") &&
@@
-1473,6
+1475,9
@@
jQuery.extend({
(!s.indexOf("<td") || !s.indexOf("<th")) &&
[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
(!s.indexOf("<td") || !s.indexOf("<th")) &&
[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
+ !s.indexOf("<col") &&
+ [2, "<table><colgroup>", "</colgroup></table>"] ||
+
[0,"",""];
// Go to html and back, then peel off extra wrappers
[0,"",""];
// Go to html and back, then peel off extra wrappers
@@
-1502,10
+1507,10
@@
jQuery.extend({
arg = jQuery.makeArray( div.childNodes );
}
arg = jQuery.makeArray( div.childNodes );
}
- if ( arg.length === 0 && !jQuery.nodeName(arg, "form") )
+ if ( 0 === arg.length && !jQuery(arg).is("form, select") )
return;
return;
-
- if ( arg[0] == undefined || jQuery.nodeName(arg, "form") )
+
+ if ( arg[0] == undefined || jQuery(arg).is("form, select") )
r.push( arg );
else
r = jQuery.merge( r, arg );
r.push( arg );
else
r = jQuery.merge( r, arg );
@@
-1637,7
+1642,7
@@
jQuery.extend({
var r = [], num = jQuery.mergeNum++;
for ( var i = 0, fl = first.length; i < fl; i++ )
var r = [], num = jQuery.mergeNum++;
for ( var i = 0, fl = first.length; i < fl; i++ )
- if ( first[i].mergeNum != num ) {
+ if ( num != first[i].mergeNum ) {
first[i].mergeNum = num;
r.push(first[i]);
}
first[i].mergeNum = num;
r.push(first[i]);
}
@@
-1781,6
+1786,7
@@
new function() {
// Figure out what browser is being used
jQuery.browser = {
// Figure out what browser is being used
jQuery.browser = {
+ version: b.match(/.+[xiae][\/ ]([\d.]+)/)[1],
safari: /webkit/.test(b),
opera: /opera/.test(b),
msie: /msie/.test(b) && !/opera/.test(b),
safari: /webkit/.test(b),
opera: /opera/.test(b),
msie: /msie/.test(b) && !/opera/.test(b),