X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=9b5bf8d444600874d315a30b99266b95c081eac2;hb=770a92a594a803486a66603a67f559ff15915d8b;hp=041b262a2ba005f7be95c166bb447028d1627590;hpb=a4f25f9311c46c086eb6bb58b0afdcf66e4099d4;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 041b262..9b5bf8d 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -28,7 +28,7 @@ window.undefined = window.undefined; * @name jQuery * @cat Core */ -function jQuery(a,c) { +jQuery = function(a,c) { // Shortcut for document ready (because $(document).each() is silly) if ( a && a.constructor == Function && jQuery.fn.ready ) @@ -67,7 +67,7 @@ function jQuery(a,c) { // If so, execute it in context if ( fn && fn.constructor == Function ) this.each(fn); -} +}; // Map over the $ in case of overwrite if ( typeof $ != "undefined" ) @@ -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 @@ -1631,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 @@ -2124,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;