X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=b094acf0866b78f8f8e54576c30daf7a4da59d5a;hb=ea53a61a38ecdddaea6f344fcaf74bfe1d37397c;hp=f997aafa48e413109076eb081283824b5e4a21a9;hpb=998d1d8839813b957a32465fdc7ef7d27d858eea;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index f997aaf..b094acf 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -390,6 +390,8 @@ jQuery.fn = jQuery.prototype = { * @test ok( $('#en').attr('lang') == "en", 'Check for lang attribute' ); * @test ok( $('#simon').attr('class') == "blog link", 'Check for class attribute' ); * @test ok( $('#name').attr('name') == "name", 'Check for name attribute' ); + * @test ok( $('#text1').attr('name') == "action", 'Check for name attribute' ); + * @test ok( $('#form').attr('action') == "formaction", 'Check for action attribute' ); * * @name attr * @type Object @@ -435,6 +437,10 @@ jQuery.fn = jQuery.prototype = { * * @test $("#name").attr('name', 'something'); * ok( $("#name").name() == 'something', 'Set name attribute' ); + * @test $("#check2").attr('checked', true); + * ok( document.getElementById('check2').checked == true, 'Set checked attribute' ); + * $("#check2").attr('checked', false); + * ok( document.getElementById('check2').checked == false, 'Set checked attribute' ); * * @name attr * @type jQuery @@ -1627,6 +1633,11 @@ jQuery.extend({ * @test t( "Is Visible", "input:visible", ["text1","text2","radio1","radio2","check1","check2","name"] ); * @test t( "Is Hidden", "input:hidden", ["hidden1","hidden2"] ); * + * @test t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); + * + * @test t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); + * @test t( "All Children of ID with no children", "#firstUL/*", [] ); + * * @name $.find * @type Array * @private @@ -2120,8 +2131,11 @@ jQuery.extend({ var c = this.events[event.type]; + var args = [].slice.call( arguments, 1 ); + args.unshift( event ); + for ( var j in c ) { - if ( c[j].apply( this, [event] ) === false ) { + if ( c[j].apply( this, args ) === false ) { event.preventDefault(); event.stopPropagation(); returnValue = false; @@ -2912,6 +2926,8 @@ jQuery.macros = { * @before

Hello

Hello Again

And Again

* @result [

Hello

,

And Again

] * + * @test isSet( $("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" ); + * * @name siblings * @type jQuery * @cat DOM/Traversing @@ -2925,6 +2941,9 @@ jQuery.macros = { * @before
Hello

Hello Again

And Again

* @result [

Hello Again

] * + * @test isSet( $("#sndp").siblings("[code]").get(), q("sap"), "Check for filtered siblings (has code child element)" ); + * @test isSet( $("#sndp").siblings("[a]").get(), q("en", "sap"), "Check for filtered siblings (has anchor child element)" ); + * * @name siblings * @type jQuery * @param String expr An expression to filter the sibling Elements with @@ -3167,7 +3186,7 @@ jQuery.macros = { * alert( $(this).text() ); * } ) * @before

Hello

- * @result Hello + * @result alert("Hello") * * @example $("form").bind( "submit", function() { return false; } ) * @desc Cancel a default action and prevent it from bubbling by returning false