Compare commits
22 commits
1.7/enhanc
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
bb7d98f018 | ||
|
e6f8951983 | ||
|
e83fcdcb02 | ||
|
139135a98a | ||
|
5b92a5f5ec | ||
|
e2ab2ba1d5 | ||
|
aa6f8c8cd3 | ||
|
ab1504f14f | ||
|
96501d38a9 | ||
|
124817e668 | ||
|
d59b0f3e27 | ||
|
d269e426e0 | ||
|
138d5b7b81 | ||
|
d443e533aa | ||
|
8a532d1575 | ||
|
5eef5917fd | ||
|
13ceb0f56b | ||
|
6926247bf4 | ||
|
641ad80211 | ||
|
39a2f29c29 | ||
|
db437be6e3 | ||
|
0a80be67f4 |
17 changed files with 204 additions and 99 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.1 RC 1",
|
version: "1.6.2 RC 1",
|
||||||
short_version: "1.6rc1",
|
short_version: "1.6.2rc1",
|
||||||
final_version: "1.6.1",
|
final_version: "1.6.2",
|
||||||
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|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
rinput = /^(?:color|date|datetime|datetime-local|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|widget):$/,
|
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
|
||||||
rnoContent = /^(?:GET|HEAD)$/,
|
rnoContent = /^(?:GET|HEAD)$/,
|
||||||
rprotocol = /^\/\//,
|
rprotocol = /^\/\//,
|
||||||
rquery = /\?/,
|
rquery = /\?/,
|
||||||
|
@ -644,6 +644,8 @@ 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
|
||||||
|
@ -727,7 +729,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 ( status < 2 ) {
|
if ( state < 2 ) {
|
||||||
done( -1, e );
|
done( -1, e );
|
||||||
// Simply rethrow otherwise
|
// Simply rethrow otherwise
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -37,30 +37,31 @@ 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(i) {
|
return this.each(function( j ) {
|
||||||
var self = jQuery(this);
|
jQuery( this ).addClass( value.call(this, j, this.className) );
|
||||||
self.addClass( value.call(this, i, self.attr("class") || "") );
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value && typeof value === "string" ) {
|
if ( value && typeof value === "string" ) {
|
||||||
var classNames = (value || "").split( rspace );
|
classNames = value.split( rspace );
|
||||||
|
|
||||||
for ( var i = 0, l = this.length; i < l; i++ ) {
|
for ( i = 0, l = this.length; i < l; i++ ) {
|
||||||
var elem = this[i];
|
elem = this[ i ];
|
||||||
|
|
||||||
if ( elem.nodeType === 1 ) {
|
if ( elem.nodeType === 1 ) {
|
||||||
if ( !elem.className ) {
|
if ( !elem.className && classNames.length === 1 ) {
|
||||||
elem.className = value;
|
elem.className = value;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var className = " " + elem.className + " ",
|
setClass = " " + elem.className + " ";
|
||||||
setClass = elem.className;
|
|
||||||
|
|
||||||
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
|
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
||||||
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
|
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
|
||||||
setClass += " " + classNames[c];
|
setClass += classNames[ c ] + " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elem.className = jQuery.trim( setClass );
|
elem.className = jQuery.trim( setClass );
|
||||||
|
@ -73,23 +74,24 @@ 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(i) {
|
return this.each(function( j ) {
|
||||||
var self = jQuery(this);
|
jQuery( this ).removeClass( value.call(this, j, this.className) );
|
||||||
self.removeClass( value.call(this, i, self.attr("class")) );
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (value && typeof value === "string") || value === undefined ) {
|
if ( (value && typeof value === "string") || value === undefined ) {
|
||||||
var classNames = (value || "").split( rspace );
|
classNames = (value || "").split( rspace );
|
||||||
|
|
||||||
for ( var i = 0, l = this.length; i < l; i++ ) {
|
for ( i = 0, l = this.length; i < l; i++ ) {
|
||||||
var elem = this[i];
|
elem = this[ i ];
|
||||||
|
|
||||||
if ( elem.nodeType === 1 && elem.className ) {
|
if ( elem.nodeType === 1 && elem.className ) {
|
||||||
if ( value ) {
|
if ( value ) {
|
||||||
var className = (" " + elem.className + " ").replace(rclass, " ");
|
className = (" " + elem.className + " ").replace( rclass, " " );
|
||||||
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
|
for ( 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 );
|
||||||
|
@ -110,8 +112,7 @@ jQuery.fn.extend({
|
||||||
|
|
||||||
if ( jQuery.isFunction( value ) ) {
|
if ( jQuery.isFunction( value ) ) {
|
||||||
return this.each(function( i ) {
|
return this.each(function( i ) {
|
||||||
var self = jQuery(this);
|
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
||||||
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +318,8 @@ jQuery.extend({
|
||||||
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
||||||
|
|
||||||
// Normalize the name if needed
|
// Normalize the name if needed
|
||||||
name = notxml && jQuery.attrFix[ name ] || name;
|
if ( notxml ) {
|
||||||
|
name = jQuery.attrFix[ name ] || name;
|
||||||
|
|
||||||
hooks = jQuery.attrHooks[ name ];
|
hooks = jQuery.attrHooks[ name ];
|
||||||
|
|
||||||
|
@ -334,6 +336,7 @@ jQuery.extend({
|
||||||
hooks = formHook;
|
hooks = formHook;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( value !== undefined ) {
|
if ( value !== undefined ) {
|
||||||
|
|
||||||
|
@ -462,10 +465,11 @@ jQuery.extend({
|
||||||
var ret, hooks,
|
var ret, hooks,
|
||||||
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
||||||
|
|
||||||
// Try to normalize/fix the name
|
if ( notxml ) {
|
||||||
name = notxml && jQuery.propFix[ name ] || name;
|
// Fix name and attach hooks
|
||||||
|
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 be optionally by executed if its a function
|
// The value/s can optionally be executed if it's 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,7 +923,6 @@ function doScrollCheck() {
|
||||||
jQuery.ready();
|
jQuery.ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expose jQuery to the global object
|
|
||||||
return jQuery;
|
return jQuery;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
24
src/css.js
24
src/css.js
|
@ -50,13 +50,14 @@ jQuery.extend({
|
||||||
|
|
||||||
// Exclude the following css properties to add px
|
// Exclude the following css properties to add px
|
||||||
cssNumber: {
|
cssNumber: {
|
||||||
"zIndex": true,
|
"fillOpacity": true,
|
||||||
"fontWeight": true,
|
"fontWeight": true,
|
||||||
"opacity": true,
|
|
||||||
"zoom": true,
|
|
||||||
"lineHeight": true,
|
"lineHeight": true,
|
||||||
|
"opacity": true,
|
||||||
|
"orphans": true,
|
||||||
"widows": true,
|
"widows": true,
|
||||||
"orphans": true
|
"zIndex": true,
|
||||||
|
"zoom": true
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add in properties whose names you wish to fix before
|
// Add in properties whose names you wish to fix before
|
||||||
|
@ -314,21 +315,20 @@ 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 ( extra !== "margin" && extra !== "border" ) {
|
if ( val > 0 ) {
|
||||||
|
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 ]( returned );
|
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
2
src/effects.js
vendored
2
src/effects.js
vendored
|
@ -411,7 +411,7 @@ jQuery.fx.prototype = {
|
||||||
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 = 1;
|
timerId = true;
|
||||||
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 ) {
|
||||||
|
|
31
src/event.js
31
src/event.js
|
@ -650,34 +650,27 @@ 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
|
|
||||||
var parent = event.relatedTarget;
|
|
||||||
|
|
||||||
// set the correct event type
|
// Check if mouse(over|out) are still within the same parent element
|
||||||
|
var related = event.relatedTarget,
|
||||||
|
inside = false,
|
||||||
|
eventType = event.type;
|
||||||
|
|
||||||
event.type = event.data;
|
event.type = event.data;
|
||||||
|
|
||||||
// Firefox sometimes assigns relatedTarget a XUL element
|
if ( related !== this ) {
|
||||||
// which we cannot access the parentNode property of
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Chrome does something similar, the parentNode property
|
if ( related ) {
|
||||||
// can be accessed but is null.
|
inside = jQuery.contains( this, related );
|
||||||
if ( parent && parent !== document && !parent.parentNode ) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Traverse up the tree
|
if ( !inside ) {
|
||||||
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 );
|
||||||
}
|
|
||||||
|
|
||||||
// assuming we've left the element since we most likely mousedover a xul element
|
event.type = eventType;
|
||||||
} 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,2 +1,3 @@
|
||||||
|
// Expose jQuery to the global object
|
||||||
window.jQuery = window.$ = jQuery;
|
window.jQuery = window.$ = jQuery;
|
||||||
})(window);
|
})(window);
|
||||||
|
|
|
@ -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">
|
<location for="bar" checked="different">
|
||||||
<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://www.ctemploymentlawblog.com/test.jpg) no-repeat -1000px 0; }
|
body, div { background: url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; }
|
||||||
|
|
||||||
|
|
|
@ -321,25 +321,40 @@ test("jQuery.ajax() - responseText on error", function() {
|
||||||
|
|
||||||
test(".ajax() - retry with jQuery.ajax( this )", function() {
|
test(".ajax() - retry with jQuery.ajax( this )", function() {
|
||||||
|
|
||||||
expect( 1 );
|
expect( 2 );
|
||||||
|
|
||||||
stop();
|
stop();
|
||||||
|
|
||||||
var firstTime = 1;
|
var firstTime = true,
|
||||||
|
previousUrl;
|
||||||
|
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
url: url("data/errorWithText.php"),
|
url: url("data/errorWithText.php"),
|
||||||
error: function() {
|
error: function() {
|
||||||
if ( firstTime ) {
|
if ( firstTime ) {
|
||||||
firstTime = 0;
|
firstTime = false;
|
||||||
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,11 +132,12 @@ test("attr(String)", function() {
|
||||||
|
|
||||||
if ( !isLocal ) {
|
if ( !isLocal ) {
|
||||||
test("attr(String) in XML Files", function() {
|
test("attr(String) in XML Files", function() {
|
||||||
expect(2);
|
expect(3);
|
||||||
stop();
|
stop();
|
||||||
jQuery.get("data/dashboard.xml", function( xml ) {
|
jQuery.get("data/dashboard.xml", function( xml ) {
|
||||||
equals( jQuery( "locations", xml ).attr("class"), "foo", "Check class attribute in XML document" );
|
equal( jQuery( "locations", xml ).attr("class"), "foo", "Check class attribute in XML document" );
|
||||||
equals( jQuery( "location", xml ).attr("for"), "bar", "Check for attribute in XML document" );
|
equal( 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();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -761,12 +762,15 @@ test("val(select) after form.reset() (Bug #2551)", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
var testAddClass = function(valueObj) {
|
var testAddClass = function(valueObj) {
|
||||||
expect(5);
|
expect(9);
|
||||||
|
|
||||||
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") == -1 ) pass = false;
|
if ( !~div.get(i).className.indexOf("test") ) {
|
||||||
|
pass = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ok( pass, "Add Class" );
|
ok( pass, "Add Class" );
|
||||||
|
|
||||||
|
@ -787,6 +791,19 @@ 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() {
|
||||||
|
@ -949,7 +966,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,3 +475,13 @@ 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,6 +275,33 @@ 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 );
|
||||||
|
|
|
@ -780,6 +780,43 @@ 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.2pre
|
1.6.3pre
|
Loading…
Add table
Add a link
Reference in a new issue