Compare commits
4 commits
master
...
1.7/enhanc
Author | SHA1 | Date | |
---|---|---|---|
|
3d646c5403 | ||
|
5293495a5f | ||
|
d729ef951c | ||
|
51aa9c5f32 |
19 changed files with 319 additions and 358 deletions
|
@ -9,9 +9,9 @@ var fs = require("fs"),
|
||||||
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g;
|
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g;
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
version: "1.6.2 RC 1",
|
version: "1.6.1 RC 1",
|
||||||
short_version: "1.6.2rc1",
|
short_version: "1.6rc1",
|
||||||
final_version: "1.6.2",
|
final_version: "1.6.1",
|
||||||
categories: []
|
categories: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ var r20 = /%20/g,
|
||||||
rCRLF = /\r?\n/g,
|
rCRLF = /\r?\n/g,
|
||||||
rhash = /#.*$/,
|
rhash = /#.*$/,
|
||||||
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
||||||
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
||||||
// #7653, #8125, #8152: local protocol detection
|
// #7653, #8125, #8152: local protocol detection
|
||||||
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
|
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
|
||||||
rnoContent = /^(?:GET|HEAD)$/,
|
rnoContent = /^(?:GET|HEAD)$/,
|
||||||
rprotocol = /^\/\//,
|
rprotocol = /^\/\//,
|
||||||
rquery = /\?/,
|
rquery = /\?/,
|
||||||
|
@ -644,8 +644,6 @@ jQuery.extend({
|
||||||
// If data is available, append data to url
|
// If data is available, append data to url
|
||||||
if ( s.data ) {
|
if ( s.data ) {
|
||||||
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
|
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
|
||||||
// #9682: remove data so that it's not used in an eventual retry
|
|
||||||
delete s.data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get ifModifiedKey before adding the anti-cache parameter
|
// Get ifModifiedKey before adding the anti-cache parameter
|
||||||
|
@ -729,7 +727,7 @@ jQuery.extend({
|
||||||
transport.send( requestHeaders, done );
|
transport.send( requestHeaders, done );
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Propagate exception as error if not done
|
// Propagate exception as error if not done
|
||||||
if ( state < 2 ) {
|
if ( status < 2 ) {
|
||||||
done( -1, e );
|
done( -1, e );
|
||||||
// Simply rethrow otherwise
|
// Simply rethrow otherwise
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -37,31 +37,30 @@ jQuery.fn.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
addClass: function( value ) {
|
addClass: function( value ) {
|
||||||
var classNames, i, l, elem,
|
|
||||||
setClass, c, cl;
|
|
||||||
|
|
||||||
if ( jQuery.isFunction( value ) ) {
|
if ( jQuery.isFunction( value ) ) {
|
||||||
return this.each(function( j ) {
|
return this.each(function(i) {
|
||||||
jQuery( this ).addClass( value.call(this, j, this.className) );
|
var self = jQuery(this);
|
||||||
|
self.addClass( value.call(this, i, self.attr("class") || "") );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value && typeof value === "string" ) {
|
if ( value && typeof value === "string" ) {
|
||||||
classNames = value.split( rspace );
|
var classNames = (value || "").split( rspace );
|
||||||
|
|
||||||
for ( i = 0, l = this.length; i < l; i++ ) {
|
for ( var i = 0, l = this.length; i < l; i++ ) {
|
||||||
elem = this[ i ];
|
var elem = this[i];
|
||||||
|
|
||||||
if ( elem.nodeType === 1 ) {
|
if ( elem.nodeType === 1 ) {
|
||||||
if ( !elem.className && classNames.length === 1 ) {
|
if ( !elem.className ) {
|
||||||
elem.className = value;
|
elem.className = value;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setClass = " " + elem.className + " ";
|
var className = " " + elem.className + " ",
|
||||||
|
setClass = elem.className;
|
||||||
|
|
||||||
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
|
||||||
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
|
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
|
||||||
setClass += classNames[ c ] + " ";
|
setClass += " " + classNames[c];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elem.className = jQuery.trim( setClass );
|
elem.className = jQuery.trim( setClass );
|
||||||
|
@ -74,24 +73,23 @@ jQuery.fn.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
removeClass: function( value ) {
|
removeClass: function( value ) {
|
||||||
var classNames, i, l, elem, className, c, cl;
|
|
||||||
|
|
||||||
if ( jQuery.isFunction(value) ) {
|
if ( jQuery.isFunction(value) ) {
|
||||||
return this.each(function( j ) {
|
return this.each(function(i) {
|
||||||
jQuery( this ).removeClass( value.call(this, j, this.className) );
|
var self = jQuery(this);
|
||||||
|
self.removeClass( value.call(this, i, self.attr("class")) );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (value && typeof value === "string") || value === undefined ) {
|
if ( (value && typeof value === "string") || value === undefined ) {
|
||||||
classNames = (value || "").split( rspace );
|
var classNames = (value || "").split( rspace );
|
||||||
|
|
||||||
for ( i = 0, l = this.length; i < l; i++ ) {
|
for ( var i = 0, l = this.length; i < l; i++ ) {
|
||||||
elem = this[ i ];
|
var elem = this[i];
|
||||||
|
|
||||||
if ( elem.nodeType === 1 && elem.className ) {
|
if ( elem.nodeType === 1 && elem.className ) {
|
||||||
if ( value ) {
|
if ( value ) {
|
||||||
className = (" " + elem.className + " ").replace( rclass, " " );
|
var className = (" " + elem.className + " ").replace(rclass, " ");
|
||||||
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
|
||||||
className = className.replace(" " + classNames[c] + " ", " ");
|
className = className.replace(" " + classNames[c] + " ", " ");
|
||||||
}
|
}
|
||||||
elem.className = jQuery.trim( className );
|
elem.className = jQuery.trim( className );
|
||||||
|
@ -112,7 +110,8 @@ jQuery.fn.extend({
|
||||||
|
|
||||||
if ( jQuery.isFunction( value ) ) {
|
if ( jQuery.isFunction( value ) ) {
|
||||||
return this.each(function(i) {
|
return this.each(function(i) {
|
||||||
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
var self = jQuery(this);
|
||||||
|
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,8 +317,7 @@ jQuery.extend({
|
||||||
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
||||||
|
|
||||||
// Normalize the name if needed
|
// Normalize the name if needed
|
||||||
if ( notxml ) {
|
name = notxml && jQuery.attrFix[ name ] || name;
|
||||||
name = jQuery.attrFix[ name ] || name;
|
|
||||||
|
|
||||||
hooks = jQuery.attrHooks[ name ];
|
hooks = jQuery.attrHooks[ name ];
|
||||||
|
|
||||||
|
@ -336,7 +334,6 @@ jQuery.extend({
|
||||||
hooks = formHook;
|
hooks = formHook;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( value !== undefined ) {
|
if ( value !== undefined ) {
|
||||||
|
|
||||||
|
@ -465,11 +462,10 @@ jQuery.extend({
|
||||||
var ret, hooks,
|
var ret, hooks,
|
||||||
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
||||||
|
|
||||||
if ( notxml ) {
|
// Try to normalize/fix the name
|
||||||
// Fix name and attach hooks
|
name = notxml && jQuery.propFix[ name ] || name;
|
||||||
name = jQuery.propFix[ name ] || name;
|
|
||||||
hooks = jQuery.propHooks[ name ];
|
hooks = jQuery.propHooks[ name ];
|
||||||
}
|
|
||||||
|
|
||||||
if ( value !== undefined ) {
|
if ( value !== undefined ) {
|
||||||
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
||||||
|
|
|
@ -792,7 +792,7 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
// Mutifunctional method to get and set values to a collection
|
// Mutifunctional method to get and set values to a collection
|
||||||
// The value/s can optionally be executed if it's a function
|
// The value/s can be optionally by executed if its a function
|
||||||
access: function( elems, key, value, exec, fn, pass ) {
|
access: function( elems, key, value, exec, fn, pass ) {
|
||||||
var length = elems.length;
|
var length = elems.length;
|
||||||
|
|
||||||
|
@ -923,6 +923,7 @@ function doScrollCheck() {
|
||||||
jQuery.ready();
|
jQuery.ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Expose jQuery to the global object
|
||||||
return jQuery;
|
return jQuery;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
28
src/css.js
28
src/css.js
|
@ -50,14 +50,13 @@ jQuery.extend({
|
||||||
|
|
||||||
// Exclude the following css properties to add px
|
// Exclude the following css properties to add px
|
||||||
cssNumber: {
|
cssNumber: {
|
||||||
"fillOpacity": true,
|
|
||||||
"fontWeight": true,
|
|
||||||
"lineHeight": true,
|
|
||||||
"opacity": true,
|
|
||||||
"orphans": true,
|
|
||||||
"widows": true,
|
|
||||||
"zIndex": true,
|
"zIndex": true,
|
||||||
"zoom": true
|
"fontWeight": true,
|
||||||
|
"opacity": true,
|
||||||
|
"zoom": true,
|
||||||
|
"lineHeight": true,
|
||||||
|
"widows": true,
|
||||||
|
"orphans": true
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add in properties whose names you wish to fix before
|
// Add in properties whose names you wish to fix before
|
||||||
|
@ -315,20 +314,21 @@ function getWH( elem, name, extra ) {
|
||||||
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
||||||
which = name === "width" ? cssWidth : cssHeight;
|
which = name === "width" ? cssWidth : cssHeight;
|
||||||
|
|
||||||
if ( val > 0 ) {
|
if ( extra !== "margin" && extra !== "border" ) {
|
||||||
if ( extra !== "border" ) {
|
|
||||||
jQuery.each( which, function() {
|
jQuery.each( which, function() {
|
||||||
|
val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
|
||||||
if ( !extra ) {
|
if ( !extra ) {
|
||||||
val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
|
val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
|
||||||
}
|
}
|
||||||
if ( extra === "margin" ) {
|
|
||||||
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
|
|
||||||
} else {
|
|
||||||
val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( val > 0 ) {
|
||||||
|
if ( extra === "margin" ) {
|
||||||
|
jQuery.each( which, function() {
|
||||||
|
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
return val + "px";
|
return val + "px";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ jQuery.extend({
|
||||||
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
||||||
returned.promise().then( newDefer.resolve, newDefer.reject );
|
returned.promise().then( newDefer.resolve, newDefer.reject );
|
||||||
} else {
|
} else {
|
||||||
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
|
newDefer[ action ]( returned );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
80
src/effects.js
vendored
80
src/effects.js
vendored
|
@ -140,9 +140,9 @@ jQuery.fn.extend({
|
||||||
var opt = jQuery.extend( {}, optall ),
|
var opt = jQuery.extend( {}, optall ),
|
||||||
isElement = this.nodeType === 1,
|
isElement = this.nodeType === 1,
|
||||||
hidden = isElement && jQuery(this).is(":hidden"),
|
hidden = isElement && jQuery(this).is(":hidden"),
|
||||||
name, val, p,
|
name, val, p, e,
|
||||||
display, e,
|
parts, start, end, unit,
|
||||||
parts, start, end, unit;
|
method;
|
||||||
|
|
||||||
// will store per property easing and be used to determine when an animation is complete
|
// will store per property easing and be used to determine when an animation is complete
|
||||||
opt.animatedProperties = {};
|
opt.animatedProperties = {};
|
||||||
|
@ -178,29 +178,21 @@ jQuery.fn.extend({
|
||||||
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
|
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
|
||||||
|
|
||||||
// Set display property to inline-block for height/width
|
// Set display property to inline-block for height/width
|
||||||
// animations on inline elements that are having width/height
|
// animations on inline elements that are having width/height animated
|
||||||
// animated
|
|
||||||
if ( jQuery.css( this, "display" ) === "inline" &&
|
if ( jQuery.css( this, "display" ) === "inline" &&
|
||||||
jQuery.css( this, "float" ) === "none" ) {
|
jQuery.css( this, "float" ) === "none" ) {
|
||||||
if ( !jQuery.support.inlineBlockNeedsLayout ) {
|
|
||||||
this.style.display = "inline-block";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
display = defaultDisplay( this.nodeName );
|
|
||||||
|
|
||||||
// inline-level elements accept inline-block;
|
// inline-level elements accept inline-block;
|
||||||
// block-level elements need to be inline with layout
|
// block-level elements need to be inline with layout
|
||||||
if ( display === "inline" ) {
|
if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
|
||||||
this.style.display = "inline-block";
|
this.style.display = "inline-block";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.style.display = "inline";
|
|
||||||
this.style.zoom = 1;
|
this.style.zoom = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( opt.overflow != null ) {
|
if ( opt.overflow != null ) {
|
||||||
this.style.overflow = "hidden";
|
this.style.overflow = "hidden";
|
||||||
|
@ -211,7 +203,15 @@ jQuery.fn.extend({
|
||||||
val = prop[ p ];
|
val = prop[ p ];
|
||||||
|
|
||||||
if ( rfxtypes.test( val ) ) {
|
if ( rfxtypes.test( val ) ) {
|
||||||
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
|
// Tracks whether to show or hide based on private
|
||||||
|
// data attached to the element
|
||||||
|
method = jQuery._data( this, "toggle" + p ) || (val === "toggle" ? hidden ? "show" : "hide" : 0);
|
||||||
|
if ( method ) {
|
||||||
|
jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
|
||||||
|
e[ method ]();
|
||||||
|
} else {
|
||||||
|
e[ val ]();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
parts = rfxnum.exec( val );
|
parts = rfxnum.exec( val );
|
||||||
|
@ -254,6 +254,7 @@ jQuery.fn.extend({
|
||||||
this.each(function() {
|
this.each(function() {
|
||||||
var timers = jQuery.timers,
|
var timers = jQuery.timers,
|
||||||
i = timers.length;
|
i = timers.length;
|
||||||
|
|
||||||
// clear marker counters if we know they won't be
|
// clear marker counters if we know they won't be
|
||||||
if ( !gotoEnd ) {
|
if ( !gotoEnd ) {
|
||||||
jQuery._unmark( true, this );
|
jQuery._unmark( true, this );
|
||||||
|
@ -263,6 +264,8 @@ jQuery.fn.extend({
|
||||||
if ( gotoEnd ) {
|
if ( gotoEnd ) {
|
||||||
// force the next step to be the last
|
// force the next step to be the last
|
||||||
timers[ i ]( true );
|
timers[ i ]( true );
|
||||||
|
} else {
|
||||||
|
timers[ i ].saveState();
|
||||||
}
|
}
|
||||||
|
|
||||||
timers.splice( i, 1 );
|
timers.splice( i, 1 );
|
||||||
|
@ -396,22 +399,26 @@ jQuery.fx.prototype = {
|
||||||
raf;
|
raf;
|
||||||
|
|
||||||
this.startTime = fxNow || createFxNow();
|
this.startTime = fxNow || createFxNow();
|
||||||
this.start = from;
|
|
||||||
this.end = to;
|
this.end = to;
|
||||||
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
|
this.now = this.start = from;
|
||||||
this.now = this.start;
|
|
||||||
this.pos = this.state = 0;
|
this.pos = this.state = 0;
|
||||||
|
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
|
||||||
|
|
||||||
function t( gotoEnd ) {
|
function t( gotoEnd ) {
|
||||||
return self.step( gotoEnd );
|
return self.step( gotoEnd );
|
||||||
}
|
}
|
||||||
|
|
||||||
t.elem = this.elem;
|
t.elem = this.elem;
|
||||||
|
t.saveState = function() {
|
||||||
|
if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
|
||||||
|
jQuery._data( self.elem, "fxshow" + self.prop, self.start );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if ( t() && jQuery.timers.push(t) && !timerId ) {
|
if ( t() && jQuery.timers.push(t) && !timerId ) {
|
||||||
// Use requestAnimationFrame instead of setInterval if available
|
// Use requestAnimationFrame instead of setInterval if available
|
||||||
if ( requestAnimationFrame ) {
|
if ( requestAnimationFrame ) {
|
||||||
timerId = true;
|
timerId = 1;
|
||||||
raf = function() {
|
raf = function() {
|
||||||
// When timerId gets set to null at any point, this stops
|
// When timerId gets set to null at any point, this stops
|
||||||
if ( timerId ) {
|
if ( timerId ) {
|
||||||
|
@ -428,14 +435,20 @@ jQuery.fx.prototype = {
|
||||||
|
|
||||||
// Simple 'show' function
|
// Simple 'show' function
|
||||||
show: function() {
|
show: function() {
|
||||||
|
var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
|
||||||
|
|
||||||
// Remember where we started, so that we can go back to it later
|
// Remember where we started, so that we can go back to it later
|
||||||
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
|
this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
|
||||||
this.options.show = true;
|
this.options.show = true;
|
||||||
|
|
||||||
// Begin the animation
|
// Begin the animation
|
||||||
// Make sure that we start at a small width/height to avoid any
|
// Make sure that we start at a small width/height to avoid any flash of content
|
||||||
// flash of content
|
if ( dataShow !== undefined ) {
|
||||||
|
// This show is picking up where a previous hide or show left off
|
||||||
|
this.custom( this.cur(), dataShow );
|
||||||
|
} else {
|
||||||
this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
|
this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
|
||||||
|
}
|
||||||
|
|
||||||
// Start by showing the element
|
// Start by showing the element
|
||||||
jQuery( this.elem ).show();
|
jQuery( this.elem ).show();
|
||||||
|
@ -444,7 +457,7 @@ jQuery.fx.prototype = {
|
||||||
// Simple 'hide' function
|
// Simple 'hide' function
|
||||||
hide: function() {
|
hide: function() {
|
||||||
// Remember where we started, so that we can go back to it later
|
// Remember where we started, so that we can go back to it later
|
||||||
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
|
this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
|
||||||
this.options.hide = true;
|
this.options.hide = true;
|
||||||
|
|
||||||
// Begin the animation
|
// Begin the animation
|
||||||
|
@ -457,7 +470,7 @@ jQuery.fx.prototype = {
|
||||||
done = true,
|
done = true,
|
||||||
elem = this.elem,
|
elem = this.elem,
|
||||||
options = this.options,
|
options = this.options,
|
||||||
i, n;
|
p, n;
|
||||||
|
|
||||||
if ( gotoEnd || t >= options.duration + this.startTime ) {
|
if ( gotoEnd || t >= options.duration + this.startTime ) {
|
||||||
this.now = this.end;
|
this.now = this.end;
|
||||||
|
@ -466,8 +479,8 @@ jQuery.fx.prototype = {
|
||||||
|
|
||||||
options.animatedProperties[ this.prop ] = true;
|
options.animatedProperties[ this.prop ] = true;
|
||||||
|
|
||||||
for ( i in options.animatedProperties ) {
|
for ( p in options.animatedProperties ) {
|
||||||
if ( options.animatedProperties[i] !== true ) {
|
if ( options.animatedProperties[ p ] !== true ) {
|
||||||
done = false;
|
done = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -488,8 +501,11 @@ jQuery.fx.prototype = {
|
||||||
|
|
||||||
// Reset the properties, if the item has been hidden or shown
|
// Reset the properties, if the item has been hidden or shown
|
||||||
if ( options.hide || options.show ) {
|
if ( options.hide || options.show ) {
|
||||||
for ( var p in options.animatedProperties ) {
|
for ( p in options.animatedProperties ) {
|
||||||
jQuery.style( elem, p, options.orig[ p ] );
|
jQuery.style( elem, p, options.orig[ p ] );
|
||||||
|
jQuery.removeData( elem, "fxshow" + p, true );
|
||||||
|
// Toggle data is no longer needed
|
||||||
|
jQuery.removeData( elem, "toggle" + p, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +537,7 @@ jQuery.fx.prototype = {
|
||||||
|
|
||||||
jQuery.extend( jQuery.fx, {
|
jQuery.extend( jQuery.fx, {
|
||||||
tick: function() {
|
tick: function() {
|
||||||
for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
|
for ( var timers = jQuery.timers, i = 0; i < timers.length; i++ ) {
|
||||||
if ( !timers[ i ]() ) {
|
if ( !timers[ i ]() ) {
|
||||||
timers.splice(i--, 1);
|
timers.splice(i--, 1);
|
||||||
}
|
}
|
||||||
|
@ -553,7 +569,7 @@ jQuery.extend( jQuery.fx, {
|
||||||
|
|
||||||
_default: function( fx ) {
|
_default: function( fx ) {
|
||||||
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
|
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
|
||||||
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
|
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
|
||||||
} else {
|
} else {
|
||||||
fx.elem[ fx.prop ] = fx.now;
|
fx.elem[ fx.prop ] = fx.now;
|
||||||
}
|
}
|
||||||
|
@ -561,6 +577,14 @@ jQuery.extend( jQuery.fx, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Adds width/height step functions
|
||||||
|
// Do not set anything below 0
|
||||||
|
jQuery.each([ "width", "height" ], function( i, prop ) {
|
||||||
|
jQuery.fx.step[ prop ] = function( fx ) {
|
||||||
|
jQuery.style( fx.elem, prop, Math.max(0, fx.now) );
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
if ( jQuery.expr && jQuery.expr.filters ) {
|
if ( jQuery.expr && jQuery.expr.filters ) {
|
||||||
jQuery.expr.filters.animated = function( elem ) {
|
jQuery.expr.filters.animated = function( elem ) {
|
||||||
return jQuery.grep(jQuery.timers, function( fn ) {
|
return jQuery.grep(jQuery.timers, function( fn ) {
|
||||||
|
|
29
src/event.js
29
src/event.js
|
@ -650,27 +650,34 @@ jQuery.Event.prototype = {
|
||||||
// Checks if an event happened on an element within another element
|
// Checks if an event happened on an element within another element
|
||||||
// Used in jQuery.event.special.mouseenter and mouseleave handlers
|
// Used in jQuery.event.special.mouseenter and mouseleave handlers
|
||||||
var withinElement = function( event ) {
|
var withinElement = function( event ) {
|
||||||
|
|
||||||
// Check if mouse(over|out) are still within the same parent element
|
// Check if mouse(over|out) are still within the same parent element
|
||||||
var related = event.relatedTarget,
|
var parent = event.relatedTarget;
|
||||||
inside = false,
|
|
||||||
eventType = event.type;
|
|
||||||
|
|
||||||
|
// set the correct event type
|
||||||
event.type = event.data;
|
event.type = event.data;
|
||||||
|
|
||||||
if ( related !== this ) {
|
// Firefox sometimes assigns relatedTarget a XUL element
|
||||||
|
// which we cannot access the parentNode property of
|
||||||
|
try {
|
||||||
|
|
||||||
if ( related ) {
|
// Chrome does something similar, the parentNode property
|
||||||
inside = jQuery.contains( this, related );
|
// can be accessed but is null.
|
||||||
|
if ( parent && parent !== document && !parent.parentNode ) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !inside ) {
|
// Traverse up the tree
|
||||||
|
while ( parent && parent !== this ) {
|
||||||
|
parent = parent.parentNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( parent !== this ) {
|
||||||
|
// handle event if we actually just moused on to a non sub-element
|
||||||
jQuery.event.handle.apply( this, arguments );
|
jQuery.event.handle.apply( this, arguments );
|
||||||
|
}
|
||||||
|
|
||||||
event.type = eventType;
|
// assuming we've left the element since we most likely mousedover a xul element
|
||||||
}
|
} catch(e) { }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// In case of event delegation, we only need to rename the event.type,
|
// In case of event delegation, we only need to rename the event.type,
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
// Expose jQuery to the global object
|
|
||||||
window.jQuery = window.$ = jQuery;
|
window.jQuery = window.$ = jQuery;
|
||||||
})(window);
|
})(window);
|
||||||
|
|
25
src/queue.js
25
src/queue.js
|
@ -4,15 +4,15 @@ function handleQueueMarkDefer( elem, type, src ) {
|
||||||
var deferDataKey = type + "defer",
|
var deferDataKey = type + "defer",
|
||||||
queueDataKey = type + "queue",
|
queueDataKey = type + "queue",
|
||||||
markDataKey = type + "mark",
|
markDataKey = type + "mark",
|
||||||
defer = jQuery.data( elem, deferDataKey, undefined, true );
|
defer = jQuery._data( elem, deferDataKey );
|
||||||
if ( defer &&
|
if ( defer &&
|
||||||
( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
|
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
|
||||||
( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
|
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
|
||||||
// Give room for hard-coded callbacks to fire first
|
// Give room for hard-coded callbacks to fire first
|
||||||
// and eventually mark/queue something else on the element
|
// and eventually mark/queue something else on the element
|
||||||
setTimeout( function() {
|
setTimeout( function() {
|
||||||
if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
|
if ( !jQuery._data( elem, queueDataKey ) &&
|
||||||
!jQuery.data( elem, markDataKey, undefined, true ) ) {
|
!jQuery._data( elem, markDataKey ) ) {
|
||||||
jQuery.removeData( elem, deferDataKey, true );
|
jQuery.removeData( elem, deferDataKey, true );
|
||||||
defer.resolve();
|
defer.resolve();
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ jQuery.extend({
|
||||||
_mark: function( elem, type ) {
|
_mark: function( elem, type ) {
|
||||||
if ( elem ) {
|
if ( elem ) {
|
||||||
type = (type || "fx") + "mark";
|
type = (type || "fx") + "mark";
|
||||||
jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
|
jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ jQuery.extend({
|
||||||
if ( elem ) {
|
if ( elem ) {
|
||||||
type = type || "fx";
|
type = type || "fx";
|
||||||
var key = type + "mark",
|
var key = type + "mark",
|
||||||
count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
|
count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
|
||||||
if ( count ) {
|
if ( count ) {
|
||||||
jQuery.data( elem, key, count, true );
|
jQuery._data( elem, key, count );
|
||||||
} else {
|
} else {
|
||||||
jQuery.removeData( elem, key, true );
|
jQuery.removeData( elem, key, true );
|
||||||
handleQueueMarkDefer( elem, type, "mark" );
|
handleQueueMarkDefer( elem, type, "mark" );
|
||||||
|
@ -49,13 +49,15 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
queue: function( elem, type, data ) {
|
queue: function( elem, type, data ) {
|
||||||
|
var q;
|
||||||
if ( elem ) {
|
if ( elem ) {
|
||||||
type = (type || "fx") + "queue";
|
type = (type || "fx") + "queue";
|
||||||
var q = jQuery.data( elem, type, undefined, true );
|
q = jQuery._data( elem, type );
|
||||||
|
|
||||||
// Speed up dequeue by getting out quickly if this is just a lookup
|
// Speed up dequeue by getting out quickly if this is just a lookup
|
||||||
if ( data ) {
|
if ( data ) {
|
||||||
if ( !q || jQuery.isArray(data) ) {
|
if ( !q || jQuery.isArray(data) ) {
|
||||||
q = jQuery.data( elem, type, jQuery.makeArray(data), true );
|
q = jQuery._data( elem, type, jQuery.makeArray(data) );
|
||||||
} else {
|
} else {
|
||||||
q.push( data );
|
q.push( data );
|
||||||
}
|
}
|
||||||
|
@ -68,8 +70,7 @@ jQuery.extend({
|
||||||
type = type || "fx";
|
type = type || "fx";
|
||||||
|
|
||||||
var queue = jQuery.queue( elem, type ),
|
var queue = jQuery.queue( elem, type ),
|
||||||
fn = queue.shift(),
|
fn = queue.shift();
|
||||||
defer;
|
|
||||||
|
|
||||||
// If the fx queue is dequeued, always remove the progress sentinel
|
// If the fx queue is dequeued, always remove the progress sentinel
|
||||||
if ( fn === "inprogress" ) {
|
if ( fn === "inprogress" ) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<dashboard>
|
<dashboard>
|
||||||
<locations class="foo">
|
<locations class="foo">
|
||||||
<location for="bar" checked="different">
|
<location for="bar">
|
||||||
<infowindowtab>
|
<infowindowtab>
|
||||||
<tab title="Location"><![CDATA[blabla]]></tab>
|
<tab title="Location"><![CDATA[blabla]]></tab>
|
||||||
<tab title="Users"><![CDATA[blublu]]></tab>
|
<tab title="Users"><![CDATA[blublu]]></tab>
|
||||||
|
|
|
@ -119,5 +119,5 @@ sup { display: none; }
|
||||||
dfn { display: none; }
|
dfn { display: none; }
|
||||||
|
|
||||||
/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */
|
/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */
|
||||||
body, div { background: url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; }
|
body, div { background: url(http://www.ctemploymentlawblog.com/test.jpg) no-repeat -1000px 0; }
|
||||||
|
|
||||||
|
|
|
@ -321,40 +321,25 @@ test("jQuery.ajax() - responseText on error", function() {
|
||||||
|
|
||||||
test(".ajax() - retry with jQuery.ajax( this )", function() {
|
test(".ajax() - retry with jQuery.ajax( this )", function() {
|
||||||
|
|
||||||
expect( 2 );
|
expect( 1 );
|
||||||
|
|
||||||
stop();
|
stop();
|
||||||
|
|
||||||
var firstTime = true,
|
var firstTime = 1;
|
||||||
previousUrl;
|
|
||||||
|
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
url: url("data/errorWithText.php"),
|
url: url("data/errorWithText.php"),
|
||||||
error: function() {
|
error: function() {
|
||||||
if ( firstTime ) {
|
if ( firstTime ) {
|
||||||
firstTime = false;
|
firstTime = 0;
|
||||||
jQuery.ajax( this );
|
jQuery.ajax( this );
|
||||||
} else {
|
} else {
|
||||||
ok( true , "Test retrying with jQuery.ajax(this) works" );
|
ok( true , "Test retrying with jQuery.ajax(this) works" );
|
||||||
jQuery.ajax({
|
|
||||||
url: url("data/errorWithText.php"),
|
|
||||||
data: { x: 1 },
|
|
||||||
beforeSend: function() {
|
|
||||||
if ( !previousUrl ) {
|
|
||||||
previousUrl = this.url;
|
|
||||||
} else {
|
|
||||||
strictEqual( this.url , previousUrl, "url parameters are not re-appended" );
|
|
||||||
start();
|
start();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function() {
|
|
||||||
jQuery.ajax( this );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test(".ajax() - headers" , function() {
|
test(".ajax() - headers" , function() {
|
||||||
|
|
|
@ -132,12 +132,11 @@ test("attr(String)", function() {
|
||||||
|
|
||||||
if ( !isLocal ) {
|
if ( !isLocal ) {
|
||||||
test("attr(String) in XML Files", function() {
|
test("attr(String) in XML Files", function() {
|
||||||
expect(3);
|
expect(2);
|
||||||
stop();
|
stop();
|
||||||
jQuery.get("data/dashboard.xml", function( xml ) {
|
jQuery.get("data/dashboard.xml", function( xml ) {
|
||||||
equal( jQuery( "locations", xml ).attr("class"), "foo", "Check class attribute in XML document" );
|
equals( jQuery( "locations", xml ).attr("class"), "foo", "Check class attribute in XML document" );
|
||||||
equal( jQuery( "location", xml ).attr("for"), "bar", "Check for attribute in XML document" );
|
equals( jQuery( "location", xml ).attr("for"), "bar", "Check for attribute in XML document" );
|
||||||
equal( jQuery( "location", xml ).attr("checked"), "different", "Check that hooks are not attached in XML document" );
|
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -762,15 +761,12 @@ test("val(select) after form.reset() (Bug #2551)", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
var testAddClass = function(valueObj) {
|
var testAddClass = function(valueObj) {
|
||||||
expect(9);
|
expect(5);
|
||||||
|
|
||||||
var div = jQuery("div");
|
var div = jQuery("div");
|
||||||
div.addClass( valueObj("test") );
|
div.addClass( valueObj("test") );
|
||||||
var pass = true;
|
var pass = true;
|
||||||
for ( var i = 0; i < div.size(); i++ ) {
|
for ( var i = 0; i < div.size(); i++ ) {
|
||||||
if ( !~div.get(i).className.indexOf("test") ) {
|
if ( div.get(i).className.indexOf("test") == -1 ) pass = false;
|
||||||
pass = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ok( pass, "Add Class" );
|
ok( pass, "Add Class" );
|
||||||
|
|
||||||
|
@ -791,19 +787,6 @@ var testAddClass = function(valueObj) {
|
||||||
div.attr("class", "foo");
|
div.attr("class", "foo");
|
||||||
div.addClass( valueObj("bar baz") );
|
div.addClass( valueObj("bar baz") );
|
||||||
equals( div.attr("class"), "foo bar baz", "Make sure there isn't too much trimming." );
|
equals( div.attr("class"), "foo bar baz", "Make sure there isn't too much trimming." );
|
||||||
|
|
||||||
div.removeClass();
|
|
||||||
div.addClass( valueObj("foo") ).addClass( valueObj("foo") )
|
|
||||||
equal( div.attr("class"), "foo", "Do not add the same class twice in separate calls." );
|
|
||||||
|
|
||||||
div.addClass( valueObj("fo") );
|
|
||||||
equal( div.attr("class"), "foo fo", "Adding a similar class does not get interrupted." );
|
|
||||||
div.removeClass().addClass("wrap2");
|
|
||||||
ok( div.addClass("wrap").hasClass("wrap"), "Can add similarly named classes");
|
|
||||||
|
|
||||||
div.removeClass();
|
|
||||||
div.addClass( valueObj("bar bar") );
|
|
||||||
equal( div.attr("class"), "bar", "Do not add the same class twice in the same call." );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
test("addClass(String)", function() {
|
test("addClass(String)", function() {
|
||||||
|
@ -966,7 +949,7 @@ test("toggleClass(Function[, boolean])", function() {
|
||||||
test("toggleClass(Fucntion[, boolean]) with incoming value", function() {
|
test("toggleClass(Fucntion[, boolean]) with incoming value", function() {
|
||||||
expect(14);
|
expect(14);
|
||||||
|
|
||||||
var e = jQuery("#firstp"), old = e.attr("class") || "";
|
var e = jQuery("#firstp"), old = e.attr("class");
|
||||||
ok( !e.is(".test"), "Assert class not present" );
|
ok( !e.is(".test"), "Assert class not present" );
|
||||||
|
|
||||||
e.toggleClass(function(i, val) {
|
e.toggleClass(function(i, val) {
|
||||||
|
|
|
@ -475,13 +475,3 @@ test("widows & orphans #8936", function () {
|
||||||
|
|
||||||
$p.remove();
|
$p.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Do not append px to 'fill-opacity' #9548", 1, function() {
|
|
||||||
|
|
||||||
var $div = jQuery("<div>").appendTo("#qunit-fixture");
|
|
||||||
|
|
||||||
$div.css("fill-opacity", 0).animate({ "fill-opacity": 1.0 }, 0, function () {
|
|
||||||
equal( jQuery(this).css("fill-opacity"), 1, "Do not append px to 'fill-opacity'");
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
|
@ -275,33 +275,6 @@ test( "jQuery.Deferred.pipe - deferred (fail)", function() {
|
||||||
strictEqual( value3, 6, "result of filter ok" );
|
strictEqual( value3, 6, "result of filter ok" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "jQuery.Deferred.pipe - context", function() {
|
|
||||||
|
|
||||||
expect(4);
|
|
||||||
|
|
||||||
var context = {};
|
|
||||||
|
|
||||||
jQuery.Deferred().resolveWith( context, [ 2 ] ).pipe(function( value ) {
|
|
||||||
return value * 3;
|
|
||||||
}).done(function( value ) {
|
|
||||||
strictEqual( this, context, "custom context correctly propagated" );
|
|
||||||
strictEqual( value, 6, "proper value received" );
|
|
||||||
});
|
|
||||||
|
|
||||||
var defer = jQuery.Deferred(),
|
|
||||||
piped = defer.pipe(function( value ) {
|
|
||||||
return value * 3;
|
|
||||||
});
|
|
||||||
|
|
||||||
defer.resolve( 2 );
|
|
||||||
|
|
||||||
piped.done(function( value ) {
|
|
||||||
strictEqual( this.promise(), piped, "default context gets updated to latest defer in the chain" );
|
|
||||||
strictEqual( value, 6, "proper value received" );
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
test( "jQuery.when" , function() {
|
test( "jQuery.when" , function() {
|
||||||
|
|
||||||
expect( 23 );
|
expect( 23 );
|
||||||
|
|
61
test/unit/effects.js
vendored
61
test/unit/effects.js
vendored
|
@ -676,23 +676,23 @@ jQuery.each( {
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
"JS 100": function( elem, prop ) {
|
"JS 100": function( elem, prop ) {
|
||||||
jQuery(elem).css(prop,prop == "opacity" ? 1 : "100px");
|
jQuery( elem ).css( prop, prop === "opacity" ? 1 : "100px" );
|
||||||
return prop == "opacity" ? 1 : 100;
|
return prop === "opacity" ? 1 : 100;
|
||||||
},
|
},
|
||||||
"CSS 50": function( elem, prop ) {
|
"CSS 50": function( elem, prop ) {
|
||||||
jQuery( elem ).addClass( "med" + prop );
|
jQuery( elem ).addClass( "med" + prop );
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
"JS 50": function( elem, prop ) {
|
"JS 50": function( elem, prop ) {
|
||||||
jQuery(elem).css(prop,prop == "opacity" ? 0.50 : "50px");
|
jQuery( elem ).css( prop, prop === "opacity" ? 0.50 : "50px" );
|
||||||
return prop == "opacity" ? 0.5 : 50;
|
return prop === "opacity" ? 0.5 : 50;
|
||||||
},
|
},
|
||||||
"CSS 0": function( elem, prop ) {
|
"CSS 0": function( elem, prop ) {
|
||||||
jQuery( elem ).addClass( "no" + prop );
|
jQuery( elem ).addClass( "no" + prop );
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
"JS 0": function( elem, prop ) {
|
"JS 0": function( elem, prop ) {
|
||||||
jQuery(elem).css(prop,prop == "opacity" ? 0 : "0px");
|
jQuery( elem ).css( prop, prop === "opacity" ? 0 : "0px" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}, function( fn, f ) {
|
}, function( fn, f ) {
|
||||||
|
@ -750,22 +750,27 @@ jQuery.each( {
|
||||||
|
|
||||||
elem = elem[ 0 ];
|
elem = elem[ 0 ];
|
||||||
|
|
||||||
if ( t_w == "show" )
|
if ( t_w == "show" ) {
|
||||||
equals( elem.style.display, "block", "Showing, display should block: " + elem.style.display );
|
equals( elem.style.display, "block", "Showing, display should block: " + elem.style.display );
|
||||||
|
}
|
||||||
|
|
||||||
if ( t_w == "hide"||t_w == "show" )
|
if ( t_w == "hide" || t_w == "show" ) {
|
||||||
ok( f_w === "" ? elem.style.width === f_w : elem.style.width.indexOf( f_w ) === 0, "Width must be reset to " + f_w + ": " + elem.style.width );
|
ok( f_w === "" ? elem.style.width === f_w : elem.style.width.indexOf( f_w ) === 0, "Width must be reset to " + f_w + ": " + elem.style.width );
|
||||||
|
}
|
||||||
|
|
||||||
if ( t_h == "hide"||t_h == "show" )
|
if ( t_h == "hide" || t_h == "show" ) {
|
||||||
ok( f_h === "" ? elem.style.height === f_h : elem.style.height.indexOf( f_h ) === 0, "Height must be reset to " + f_h + ": " + elem.style.height );
|
ok( f_h === "" ? elem.style.height === f_h : elem.style.height.indexOf( f_h ) === 0, "Height must be reset to " + f_h + ": " + elem.style.height );
|
||||||
|
}
|
||||||
|
|
||||||
var cur_o = jQuery.style(elem, "opacity");
|
var cur_o = jQuery.style(elem, "opacity");
|
||||||
|
|
||||||
if ( t_o == "hide" || t_o == "show" )
|
if ( t_o == "hide" || t_o == "show" ) {
|
||||||
equals( cur_o, f_o, "Opacity must be reset to " + f_o + ": " + cur_o );
|
equals( cur_o, f_o, "Opacity must be reset to " + f_o + ": " + cur_o );
|
||||||
|
}
|
||||||
|
|
||||||
if ( t_w == "hide" )
|
if ( t_w == "hide" ) {
|
||||||
equals( elem.style.display, "none", "Hiding, display should be none: " + elem.style.display );
|
equals( elem.style.display, "none", "Hiding, display should be none: " + elem.style.display );
|
||||||
|
}
|
||||||
|
|
||||||
if ( t_o.constructor == Number ) {
|
if ( t_o.constructor == Number ) {
|
||||||
equals( cur_o, t_o, "Final opacity should be " + t_o + ": " + cur_o );
|
equals( cur_o, t_o, "Final opacity should be " + t_o + ": " + cur_o );
|
||||||
|
@ -921,6 +926,42 @@ test("jQuery.show('fast') doesn't clear radio buttons (bug #1095)", function ()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
jQuery.each({
|
||||||
|
"slideToggle": function( $elem ) {
|
||||||
|
return $elem.height();
|
||||||
|
},
|
||||||
|
"fadeToggle": function( $elem ) {
|
||||||
|
return $elem.css("opacity");
|
||||||
|
},
|
||||||
|
"toggle": function( $elem ) {
|
||||||
|
return $elem.width();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function( method, defProp ) {
|
||||||
|
test( method + "().stop()." + method + "()", function() {
|
||||||
|
expect( 4 );
|
||||||
|
|
||||||
|
jQuery.each([ "in", "out" ], function( i, type ) {
|
||||||
|
var $elem = jQuery( "#" + method.toLowerCase() + type ),
|
||||||
|
startVal = defProp( $elem );
|
||||||
|
|
||||||
|
$elem[ method ]("fast");
|
||||||
|
stop();
|
||||||
|
|
||||||
|
setTimeout( function() {
|
||||||
|
$elem.stop();
|
||||||
|
|
||||||
|
notEqual( defProp( $elem ), startVal, ".stop() is called about halfway through animation." );
|
||||||
|
|
||||||
|
$elem[ method ]("fast", function() {
|
||||||
|
equal( defProp( jQuery(this) ), startVal, "After doing .stop() halfway, check that state has been saved for returning to original property value." );
|
||||||
|
start();
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test("animate with per-property easing", function(){
|
test("animate with per-property easing", function(){
|
||||||
|
|
||||||
expect(5);
|
expect(5);
|
||||||
|
|
|
@ -780,43 +780,6 @@ test("mouseover triggers mouseenter", function() {
|
||||||
elem.remove();
|
elem.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("withinElement implemented with jQuery.contains()", function() {
|
|
||||||
|
|
||||||
expect(1);
|
|
||||||
|
|
||||||
jQuery("#qunit-fixture").append('<div id="jc-outer"><div id="jc-inner"></div></div>');
|
|
||||||
|
|
||||||
jQuery("#jc-outer").bind("mouseenter mouseleave", function( event ) {
|
|
||||||
|
|
||||||
equal( this.id, "jc-outer", this.id + " " + event.type );
|
|
||||||
|
|
||||||
}).trigger("mouseenter");
|
|
||||||
|
|
||||||
jQuery("#jc-inner").trigger("mousenter");
|
|
||||||
|
|
||||||
jQuery("#jc-outer").unbind("mouseenter mouseleave").remove();
|
|
||||||
jQuery("#jc-inner").remove();
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
test("mouseenter, mouseleave don't catch exceptions", function() {
|
|
||||||
expect(2);
|
|
||||||
|
|
||||||
var elem = jQuery("#firstp").hover(function() { throw "an Exception"; });
|
|
||||||
|
|
||||||
try {
|
|
||||||
elem.mouseenter();
|
|
||||||
} catch (e) {
|
|
||||||
equals( e, "an Exception", "mouseenter doesn't catch exceptions" );
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
elem.mouseleave();
|
|
||||||
} catch (e) {
|
|
||||||
equals( e, "an Exception", "mouseleave doesn't catch exceptions" );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("trigger() shortcuts", function() {
|
test("trigger() shortcuts", function() {
|
||||||
expect(6);
|
expect(6);
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1.6.3pre
|
1.6.2pre
|
Loading…
Reference in a new issue