diff --git a/dom/animate/animate.js b/dom/animate/animate.js index 148e4216..1fe257a7 100644 --- a/dom/animate/animate.js +++ b/dom/animate/animate.js @@ -212,7 +212,7 @@ steal('jquery', 'jquery/dom/styles', function ($) { return oldanimate.apply(this, arguments); } - var optall = jQuery.speed(speed, easing, callback); + var optall = $.speed(speed, easing, callback); // Add everything to the animation queue this.queue(optall.queue, function(done) { diff --git a/dom/animate/animate_test.js b/dom/animate/animate_test.js index c8294360..58628c17 100644 --- a/dom/animate/animate_test.js +++ b/dom/animate/animate_test.js @@ -2,7 +2,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ module("jquery/dom/animate"); - if ( jQuery.fx ) { + if ( $.fx ) { test("sanity check", function() { expect(1); ok( jQuery("#dl:visible, #qunit-fixture:visible, #foo:visible").length === 3, "QUnit state is correct for testing effects" ); @@ -25,13 +25,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ hiddendiv = jQuery("div.hidden"); - equal(jQuery.css( hiddendiv[0], "display"), "none", "hiddendiv is display: none"); + equal($.css( hiddendiv[0], "display"), "none", "hiddendiv is display: none"); hiddendiv.css("display", "block"); - equal(jQuery.css( hiddendiv[0], "display"), "block", "hiddendiv is display: block"); + equal($.css( hiddendiv[0], "display"), "block", "hiddendiv is display: block"); hiddendiv.show(); - equal(jQuery.css( hiddendiv[0], "display"), "block", "hiddendiv is display: block"); + equal($.css( hiddendiv[0], "display"), "block", "hiddendiv is display: block"); hiddendiv.css("display",""); @@ -50,7 +50,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ "false speed": false }; - jQuery.each(speeds, function(name, speed) { + $.each(speeds, function(name, speed) { pass = true; div.hide().show(speed).each(function() { if ( this.style.display == "none" ) { @@ -60,7 +60,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ ok( pass, "Show with " + name); }); - jQuery.each(speeds, function(name, speed) { + $.each(speeds, function(name, speed) { pass = true; div.hide().show(speed, function() { pass = false; @@ -91,7 +91,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ "li" : old ? "block" : "list-item" }; - jQuery.each(test, function(selector, expected) { + $.each(test, function(selector, expected) { var elem = jQuery(selector, "#show-tests").show(); equal( elem.css("display"), expected, "Show using correct display type for " + selector ); }); @@ -132,7 +132,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ "li" : old ? "block" : "list-item" }; - jQuery.each(test, function(selector, expected) { + $.each(test, function(selector, expected) { var elem = jQuery(selector, "#show-tests").show(1, function() { equal( elem.css("display"), expected, "Show using correct display type for " + selector ); if ( ++num === 15 ) { @@ -181,7 +181,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ expect(1); stop(); var hash = {opacity: "show"}; - var hashCopy = jQuery.extend({}, hash); + var hashCopy = $.extend({}, hash); jQuery("#foo").animate(hash, 0, function() { equal( hash.opacity, hashCopy.opacity, "Check if animate changed the hash parameter" ); start(); @@ -232,11 +232,11 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ span.remove(); - if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) { + if ( $.support.inlineBlockNeedsLayout || expected === "inline-block" ) { stop(); jQuery("#foo").css({ display: "inline", width: "", height: "" }).animate({ width: 42, height: 42 }, 100, function() { - equal( jQuery(this).css("display"), jQuery.support.inlineBlockNeedsLayout ? "inline" : "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); + equal( jQuery(this).css("display"), $.support.inlineBlockNeedsLayout ? "inline" : "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); equal( this.offsetWidth, 42, "width was animated" ); equal( this.offsetHeight, 42, "height was animated" ); start(); @@ -258,7 +258,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ span.remove(); - if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) { + if ( $.support.inlineBlockNeedsLayout || expected === "inline-block" ) { stop(); jQuery("#foo").css({ display: "", width: "", height: "" }) .append("text") @@ -486,7 +486,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ var $elems = jQuery([{ a:0 },{ a:0 }]), counter = 0; - equal( jQuery.timers.length, 0, "Make sure no animation was running from another test" ); + equal( $.timers.length, 0, "Make sure no animation was running from another test" ); $elems.eq(0).animate( {a:1}, 0, function(){ ok( true, "Animate a simple property." ); @@ -494,7 +494,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ }); // Failed until [6115] - equal( jQuery.timers.length, 0, "Make sure synchronic animations are not left on jQuery.timers" ); + equal( $.timers.length, 0, "Make sure synchronic animations are not left on $.timers" ); equal( counter, 1, "One synchronic animations" ); @@ -731,17 +731,17 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ ok( x.is(":visible"), "is visible again" ); }); - jQuery.checkOverflowDisplay = function(){ - var o = jQuery.css( this, "overflow" ); + $.checkOverflowDisplay = function(){ + var o = $.css( this, "overflow" ); equal(o, "visible", "Overflow should be visible: " + o); - equal(jQuery.css( this, "display" ), "inline", "Display shouldn't be tampered with."); + equal($.css( this, "display" ), "inline", "Display shouldn't be tampered with."); jQuery(this).remove(); start(); }; - test( "jQuery.fx.prototype.cur() - <1.8 Back Compat", 7, function() { + test( "$.fx.prototype.cur() - <1.8 Back Compat", 7, function() { var div = jQuery( "
" ).appendTo( "#qunit-fixture" ).css({ color: "#ABC", border: "5px solid black", @@ -750,13 +750,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ })[0]; equal( - ( new jQuery.fx( div, {}, "color" ) ).cur(), - jQuery.css( div, "color" ), - "Return the same value as jQuery.css for complex properties (bug #7912)" + ( new $.fx( div, {}, "color" ) ).cur(), + $.css( div, "color" ), + "Return the same value as $.css for complex properties (bug #7912)" ); strictEqual( - ( new jQuery.fx( div, {}, "borderLeftWidth" ) ).cur(), + ( new $.fx( div, {}, "borderLeftWidth" ) ).cur(), 5, "Return simple values parsed as Float" ); @@ -765,7 +765,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ // this fakes a "" return // hook now gets called twice because Tween will grab the current // value as it is being newed - jQuery.cssHooks.backgroundPosition = { + $.cssHooks.backgroundPosition = { get: function() { ok( true, "hook used" ); return ""; @@ -773,21 +773,21 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ }; strictEqual( - ( new jQuery.fx( div, {}, "backgroundPosition" ) ).cur(), + ( new $.fx( div, {}, "backgroundPosition" ) ).cur(), 0, - "Return 0 when jQuery.css returns an empty string" + "Return 0 when $.css returns an empty string" ); - delete jQuery.cssHooks.backgroundPosition; + delete $.cssHooks.backgroundPosition; strictEqual( - ( new jQuery.fx( div, {}, "left" ) ).cur(), + ( new $.fx( div, {}, "left" ) ).cur(), 0, - "Return 0 when jQuery.css returns 'auto'" + "Return 0 when $.css returns 'auto'" ); equal( - ( new jQuery.fx( div, {}, "marginBottom" ) ).cur(), + ( new $.fx( div, {}, "marginBottom" ) ).cur(), -11000, "support negative values < -10000 (bug #7193)" ); @@ -798,29 +798,29 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ test("JS Overflow and Display", function() { expect(2); stop(); - jQuery.makeTest( "JS Overflow and Display" ) + $.makeTest( "JS Overflow and Display" ) .addClass("widewidth") .css({ overflow: "visible", display: "inline" }) .addClass("widewidth") .text("Some sample text.") .before("text before") .after("text after") - .animate({ opacity: 0.5 }, "slow", jQuery.checkOverflowDisplay); + .animate({ opacity: 0.5 }, "slow", $.checkOverflowDisplay); }); test("CSS Overflow and Display", function() { expect(2); stop(); - jQuery.makeTest( "CSS Overflow and Display" ) + $.makeTest( "CSS Overflow and Display" ) .addClass("overflow inline") .addClass("widewidth") .text("Some sample text.") .before("text before") .after("text after") - .animate({ opacity: 0.5 }, "slow", jQuery.checkOverflowDisplay); + .animate({ opacity: 0.5 }, "slow", $.checkOverflowDisplay); }); - jQuery.each({ + $.each({ "CSS Auto": function( elem, prop ) { jQuery( elem ).addClass( "auto" + prop ) .text( "This is a long string of text." ); @@ -856,7 +856,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ return 0; } }, function( fn, f ) { - jQuery.each({ + $.each({ "show": function( elem, prop ) { jQuery( elem ).hide( ).addClass( "wide" + prop ); return "show"; @@ -878,7 +878,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ } }, function( tn, t ) { test(fn + " to " + tn, function() { - var elem = jQuery.makeTest( fn + " to " + tn ); + var elem = $.makeTest( fn + " to " + tn ); var t_w = t( elem, "width" ); var f_w = f( elem, "width" ); @@ -910,7 +910,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ elem.animate(anim, 50); - jQuery.when( elem ).done(function( elem ) { + $.when( elem ).done(function( elem ) { elem = elem[ 0 ]; @@ -926,9 +926,9 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ 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 = $.style(elem, "opacity"); - if ( f_o !== jQuery.css(elem, "opacity") ) { + if ( f_o !== $.css(elem, "opacity") ) { f_o = f( elem, "opacity" ); } @@ -953,13 +953,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ if ( t_o.constructor == Number ) { equal( cur_o, t_o, "Final opacity should be " + t_o + ": " + cur_o ); - ok( jQuery.css(elem, "opacity") !== "" || cur_o == t_o, "Opacity should be explicitly set to " + t_o + ", is instead: " + cur_o ); + ok( $.css(elem, "opacity") !== "" || cur_o == t_o, "Opacity should be explicitly set to " + t_o + ", is instead: " + cur_o ); } if ( t_w.constructor == Number ) { equal( elem.style.width, t_w + "px", "Final width should be " + t_w + ": " + elem.style.width ); - var cur_w = jQuery.css( elem,"width" ); + var cur_w = $.css( elem,"width" ); ok( elem.style.width !== "" || cur_w == t_w, "Width should be explicitly set to " + t_w + ", is instead: " + cur_w ); } @@ -967,19 +967,19 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ if ( t_h.constructor == Number ) { equal( elem.style.height, t_h + "px", "Final height should be " + t_h + ": " + elem.style.height ); - var cur_h = jQuery.css( elem,"height" ); + var cur_h = $.css( elem,"height" ); ok( elem.style.height !== "" || cur_h == t_h, "Height should be explicitly set to " + t_h + ", is instead: " + cur_h ); } if ( t_h == "show" ) { - var old_h = jQuery.css( elem, "height" ); + var old_h = $.css( elem, "height" ); jQuery( elem ).append("
Some more text
and some more..."); if ( /Auto/.test( fn ) ) { - notEqual( jQuery.css( elem, "height" ), old_h, "Make sure height is auto." ); + notEqual( $.css( elem, "height" ), old_h, "Make sure height is auto." ); } else { - equal( jQuery.css( elem, "height" ), old_h, "Make sure height is not auto." ); + equal( $.css( elem, "height" ), old_h, "Make sure height is not auto." ); } } @@ -992,7 +992,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ }); }); - jQuery.fn.saveState = function( hiddenOverflow ) { + $.fn.saveState = function( hiddenOverflow ) { var check = ["opacity", "height", "width", "display", "overflow"]; expect(check.length); @@ -1000,84 +1000,84 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ return this.each(function(){ var self = this; self.save = {}; - jQuery.each(check, function( i, c ) { - self.save[ c ] = c === "overflow" && hiddenOverflow ? "hidden" : self.style[ c ] || jQuery.css( self, c ); + $.each(check, function( i, c ) { + self.save[ c ] = c === "overflow" && hiddenOverflow ? "hidden" : self.style[ c ] || $.css( self, c ); }); }); }; /** @expose */ - jQuery.checkState = function() { + $.checkState = function() { var self = this; - jQuery.each(this.save, function( c, v ) { - var cur = self.style[ c ] || jQuery.css( self, c ); + $.each(this.save, function( c, v ) { + var cur = self.style[ c ] || $.css( self, c ); equal( cur, v, "Make sure that " + c + " is reset (Old: " + v + " Cur: " + cur + ")"); }); // manually clean data on modified element - jQuery.removeData( this, "olddisplay", true ); + $.removeData( this, "olddisplay", true ); start(); }; // Chaining Tests test("Chain fadeOut fadeIn", function() { - jQuery("#fadein div").saveState().fadeOut("fast").fadeIn("fast", jQuery.checkState ); + jQuery("#fadein div").saveState().fadeOut("fast").fadeIn("fast", $.checkState ); }); test("Chain fadeIn fadeOut", function() { - jQuery("#fadeout div").saveState().fadeIn("fast").fadeOut("fast", jQuery.checkState ); + jQuery("#fadeout div").saveState().fadeIn("fast").fadeOut("fast", $.checkState ); }); test("Chain hide show", function() { - jQuery("#show div").saveState( jQuery.support.shrinkWrapBlocks ).hide("fast").show("fast", jQuery.checkState ); + jQuery("#show div").saveState( $.support.shrinkWrapBlocks ).hide("fast").show("fast", $.checkState ); }); test("Chain show hide", function() { - jQuery("#hide div").saveState( jQuery.support.shrinkWrapBlocks ).show("fast").hide("fast", jQuery.checkState ); + jQuery("#hide div").saveState( $.support.shrinkWrapBlocks ).show("fast").hide("fast", $.checkState ); }); test("Chain show hide with easing and callback", function() { - jQuery("#hide div").saveState().show("fast").hide("fast","linear", jQuery.checkState ); + jQuery("#hide div").saveState().show("fast").hide("fast","linear", $.checkState ); }); test("Chain toggle in", function() { - jQuery("#togglein div").saveState( jQuery.support.shrinkWrapBlocks ).toggle("fast").toggle("fast", jQuery.checkState ); + jQuery("#togglein div").saveState( $.support.shrinkWrapBlocks ).toggle("fast").toggle("fast", $.checkState ); }); test("Chain toggle out", function() { - jQuery("#toggleout div").saveState( jQuery.support.shrinkWrapBlocks ).toggle("fast").toggle("fast", jQuery.checkState ); + jQuery("#toggleout div").saveState( $.support.shrinkWrapBlocks ).toggle("fast").toggle("fast", $.checkState ); }); test("Chain toggle out with easing and callback", function() { - jQuery("#toggleout div").saveState( jQuery.support.shrinkWrapBlocks ).toggle("fast").toggle("fast","linear", jQuery.checkState ); + jQuery("#toggleout div").saveState( $.support.shrinkWrapBlocks ).toggle("fast").toggle("fast","linear", $.checkState ); }); test("Chain slideDown slideUp", function() { - jQuery("#slidedown div").saveState( jQuery.support.shrinkWrapBlocks ).slideDown("fast").slideUp("fast", jQuery.checkState ); + jQuery("#slidedown div").saveState( $.support.shrinkWrapBlocks ).slideDown("fast").slideUp("fast", $.checkState ); }); test("Chain slideUp slideDown", function() { - jQuery("#slideup div").saveState( jQuery.support.shrinkWrapBlocks ).slideUp("fast").slideDown("fast", jQuery.checkState ); + jQuery("#slideup div").saveState( $.support.shrinkWrapBlocks ).slideUp("fast").slideDown("fast", $.checkState ); }); test("Chain slideUp slideDown with easing and callback", function() { - jQuery("#slideup div").saveState( jQuery.support.shrinkWrapBlocks ).slideUp("fast").slideDown("fast","linear", jQuery.checkState ); + jQuery("#slideup div").saveState( $.support.shrinkWrapBlocks ).slideUp("fast").slideDown("fast","linear", $.checkState ); }); test("Chain slideToggle in", function() { - jQuery("#slidetogglein div").saveState( jQuery.support.shrinkWrapBlocks ).slideToggle("fast").slideToggle("fast", jQuery.checkState ); + jQuery("#slidetogglein div").saveState( $.support.shrinkWrapBlocks ).slideToggle("fast").slideToggle("fast", $.checkState ); }); test("Chain slideToggle out", function() { - jQuery("#slidetoggleout div").saveState( jQuery.support.shrinkWrapBlocks ).slideToggle("fast").slideToggle("fast", jQuery.checkState ); + jQuery("#slidetoggleout div").saveState( $.support.shrinkWrapBlocks ).slideToggle("fast").slideToggle("fast", $.checkState ); }); test("Chain fadeToggle in", function() { - jQuery("#fadetogglein div").saveState().fadeToggle("fast").fadeToggle("fast", jQuery.checkState ); + jQuery("#fadetogglein div").saveState().fadeToggle("fast").fadeToggle("fast", $.checkState ); }); test("Chain fadeToggle out", function() { - jQuery("#fadetoggleout div").saveState().fadeToggle("fast").fadeToggle("fast", jQuery.checkState ); + jQuery("#fadetoggleout div").saveState().fadeToggle("fast").fadeToggle("fast", $.checkState ); }); test("Chain fadeTo 0.5 1.0 with easing and callback)", function() { - jQuery("#fadeto div").saveState().fadeTo("fast",0.5).fadeTo("fast",1.0,"linear", jQuery.checkState ); + jQuery("#fadeto div").saveState().fadeTo("fast",0.5).fadeTo("fast",1.0,"linear", $.checkState ); }); - jQuery.makeTest = function( text ){ + $.makeTest = function( text ){ var elem = jQuery("
") - .attr( "id", "test" + jQuery.makeTest.id++ ) + .attr( "id", "test" + $.makeTest.id++ ) .addClass("box"); jQuery("

") @@ -1088,9 +1088,9 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ return elem; }; - jQuery.makeTest.id = 1; + $.makeTest.id = 1; - test("jQuery.show('fast') doesn't clear radio buttons (bug #1095)", function () { + test("$.show('fast') doesn't clear radio buttons (bug #1095)", function () { expect(4); stop(); @@ -1105,8 +1105,8 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ }); }); - jQuery.expandedEach = jQuery.each; - jQuery.expandedEach({ + $.expandedEach = $.each; + $.expandedEach({ "slideToggle": function( $elem ) { return parseFloat( $elem.css("height") ); }, @@ -1123,7 +1123,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ var animTime = 2000; - jQuery.each([ "in", "out" ], function( i, type ) { + $.each([ "in", "out" ], function( i, type ) { var $elem = jQuery( "#" + method.toLowerCase() + type ), startVal = defProp( $elem ); @@ -1149,7 +1149,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ equal( defProp( $elem ), startVal, "After doing .stop() halfway through show, check that state has been saved for returning to original property value." ); // Remove olddisplay data from .hide() call - jQuery.removeData( this, "olddisplay", true ); + $.removeData( this, "olddisplay", true ); start(); }); }, animTime / 2); @@ -1174,17 +1174,17 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ c: 100 }; - jQuery.easing["_test1"] = function(p) { + $.easing["_test1"] = function(p) { _test1_called = true; return p; }; - jQuery.easing["_test2"] = function(p) { + $.easing["_test2"] = function(p) { _test2_called = true; return p; }; - jQuery.easing["_default_test"] = function(p) { + $.easing["_default_test"] = function(p) { _default_test_called = true; return p; }; @@ -1210,14 +1210,14 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ propsBasic = { "padding": "10 20 30" }, propsSpecial = { "padding": [ "1 2 3", "_special" ] }; - jQuery.easing._default = function(p) { + $.easing._default = function(p) { if ( p >= 1 ) { _default_count++; } return p; }; - jQuery.easing._special = function(p) { + $.easing._special = function(p) { if ( p >= 1 ) { _special_count++; } @@ -1242,8 +1242,8 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ equal( _special_count, 4, "special easing called for each property" ); jQuery(this).css("padding", "0"); - delete jQuery.easing._default; - delete jQuery.easing._special; + delete $.easing._default; + delete $.easing._special; start(); }); }); @@ -1256,7 +1256,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ var div = jQuery("
").appendTo("#qunit-fixture"); equal( div.css("display"), "none", "Element is hidden by default" ); div.hide(1, function () { - ok( !jQuery._data(div, "olddisplay"), "olddisplay is undefined after hiding an already-hidden element" ); + ok( !$._data(div, "olddisplay"), "olddisplay is undefined after hiding an already-hidden element" ); div.show(1, function () { equal( div.css("display"), "block", "Show a double-hidden element" ); start(); @@ -1333,15 +1333,15 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ // with any changes internally to these functions. // make sure that the standard timer loop will NOT run. - jQuery.fx.stop(); + $.fx.stop(); setTimeout(function() { // the first call to fx.tick should raise the callback exception - raises( jQuery.fx.tick, testException, "Exception was thrown" ); + raises( $.fx.tick, testException, "Exception was thrown" ); // the second call shouldn't - jQuery.fx.tick(); + $.fx.tick(); ok( true, "Test completed without throwing a second exception" ); @@ -1386,7 +1386,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ }); // Start 1.8 Animation tests - asyncTest( "jQuery.Animation( object, props, opts )", 4, function() { + asyncTest( "$.Animation( object, props, opts )", 4, function() { var testObject = { "foo": 0, "bar": 1, @@ -1398,7 +1398,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ "width": 200 }; - var animation = jQuery.Animation( testObject, testDest, { "duration": 1 }); + var animation = $.Animation( testObject, testDest, { "duration": 1 }); animation.done(function() { for ( var prop in testDest ) { equal( testObject[ prop ], testDest[ prop ], "Animated: " + prop ); @@ -1452,13 +1452,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ asyncTest( "User supplied callback called after show when fx off (#8892)", 2, function() { var foo = jQuery( "#foo" ); - jQuery.fx.off = true; + $.fx.off = true; foo.hide(); foo.fadeIn( 500, function() { ok( jQuery( this ).is( ":visible" ), "Element is visible in callback" ); foo.fadeOut( 500, function() { ok( jQuery( this ).is( ":hidden" ), "Element is hidden in callback" ); - jQuery.fx.off = false; + $.fx.off = false; start(); }); }); @@ -1496,13 +1496,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ strictEqual( elems[ 3 ].show()[ 0 ].style.display, "block", "show() should change display if it already set to none" ); // cleanup - jQuery.each( elems, function() { - jQuery.removeData( this[ 0 ], "olddisplay", true ); + $.each( elems, function() { + $.removeData( this[ 0 ], "olddisplay", true ); }); stop(); - jQuery.each( methods, function( name, opt ) { - jQuery.each([ + $.each( methods, function( name, opt ) { + $.each([ // parentNode = document fragment jQuery("
test
"), @@ -1514,13 +1514,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ var callback = [function () { strictEqual( this.style.display, "block", "set display to block with " + name ); - jQuery.removeData( this, "olddisplay", true ); + $.removeData( this, "olddisplay", true ); if ( ++i === 14 ) { start(); } }]; - jQuery.fn[ name ].apply( this, opt.concat( callback ) ); + $.fn[ name ].apply( this, opt.concat( callback ) ); }); }); }); @@ -1542,7 +1542,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ hidden.append( elems ); - jQuery.when( + $.when( elems.eq( 0 ).hide(), elems.eq( 1 ).hide( 0 ), elems.eq( 2 ).hide( 1 ) @@ -1567,16 +1567,16 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ foo.append( elems ); - jQuery.when( + $.when( elems.eq( 0 ).hide(), - elems.eq( 1 ).hide( jQuery.noop ), + elems.eq( 1 ).hide( $.noop ), elems.eq( 2 ).hide( 1 ), elems.eq( 3 ).fadeOut(), elems.eq( 4 ).slideUp() ).done(function() { strictEqual( elems.get( 0 ).style.display, "none", "hide() called on element width height and width = 0 should set display to none" ); strictEqual( elems.get( 1 ).style.display, "none", - "hide( jQuery.noop ) called on element width height and width = 0 should set display to none" ); + "hide( $.noop ) called on element width height and width = 0 should set display to none" ); strictEqual( elems.get( 2 ).style.display, "none", "hide( 1 ) called on element width height and width = 0 should set display to none" ); strictEqual( elems.get( 3 ).style.display, "none", "fadeOut() called on element width height and width = 0 should set display to none" ); strictEqual( elems.get( 4 ).style.display, "none", "slideUp() called on element width height and width = 0 should set display to none" ); @@ -1705,13 +1705,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ } if ( parseFloat( initial ) ) { - equal( jQuery.style( this, "backgroundPositionX" ), initial, "Numeric start preserved" ); + equal( $.style( this, "backgroundPositionX" ), initial, "Numeric start preserved" ); } else { - equal( jQuery.style( this, "backgroundPositionX" ), "0%", "Non-numeric start zeroed" ); + equal( $.style( this, "backgroundPositionX" ), "0%", "Non-numeric start zeroed" ); } }, done: function() { - equal( jQuery.style( this, "backgroundPositionX" ), "42%", "End reached" ); + equal( $.style( this, "backgroundPositionX" ), "42%", "End reached" ); start(); } }); @@ -1799,8 +1799,8 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ }); test( "Animate properly sets overflow hidden when animating width/height (#12117)", 4, function() { - jQuery.each( [ "height", "width" ], function( _, prop ) { - jQuery.each( [ 100, 0 ], function( _, value ) { + $.each( [ "height", "width" ], function( _, prop ) { + $.each( [ 100, 0 ], function( _, value ) { var div = jQuery("
"), props = {}; props[ prop ] = value; @@ -1813,7 +1813,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ }); test( "Animations with 0 duration don't ease (#12273)", 1, function() { - jQuery.easing.test = function() { + $.easing.test = function() { ok( false, "Called easing" ); }; @@ -1827,8 +1827,8 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($ } }); - delete jQuery.easing.test; + delete $.easing.test; }); - } // if ( jQuery.fx ) + } // if ( $.fx ) }); \ No newline at end of file diff --git a/dom/closest/closest.js b/dom/closest/closest.js index 4460647b..237fd0bc 100644 --- a/dom/closest/closest.js +++ b/dom/closest/closest.js @@ -11,8 +11,8 @@ steal('jquery', function($) { * * ">li click" : function( el, ev ) { ... } */ - var oldClosest = jQuery.fn.closest; - jQuery.fn.closest = function(selectors, context){ + var oldClosest = $.fn.closest; + $.fn.closest = function(selectors, context){ var rooted = {}, res, result, thing, i, j, selector, rootedIsEmpty = true, selector, selectorsArr = selectors; if(typeof selectors == "string") selectorsArr = [selectors]; diff --git a/dom/compare/compare.js b/dom/compare/compare.js index ee81f442..21539523 100644 --- a/dom/compare/compare.js +++ b/dom/compare/compare.js @@ -24,7 +24,7 @@ steal('jquery', function($) { */ // See http://ejohn.org/blog/comparing-document-position/ -jQuery.fn.compare = function(element){ //usually +$.fn.compare = function(element){ //usually try{ // Firefox 3 throws an error with XUL - we can't use compare then element = element.jquery ? element[0] : element; diff --git a/dom/cookie/cookie.js b/dom/cookie/cookie.js index c4b0035b..9416d120 100644 --- a/dom/cookie/cookie.js +++ b/dom/cookie/cookie.js @@ -49,7 +49,7 @@ steal('jquery', 'jquery/lang/json', function($) { * * @return {String} the value of the cookie or {undefined} when setting the cookie. */ - jQuery.cookie = function(name, value, options) { + $.cookie = function(name, value, options) { if (typeof value != 'undefined') { // name and value given, set cookie options = options || @@ -59,8 +59,8 @@ steal('jquery', 'jquery/lang/json', function($) { options.expires = -1; } // convert value to JSON string - if (typeof value == 'object' && jQuery.toJSON) { - value = jQuery.toJSON(value); + if (typeof value == 'object' && $.toJSON) { + value = $.toJSON(value); } var expires = ''; // Set expiry @@ -89,7 +89,7 @@ steal('jquery', 'jquery/lang/json', function($) { if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); + var cookie = $.trim(cookies[i]); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=')) { // Get the cookie value @@ -99,9 +99,9 @@ steal('jquery', 'jquery/lang/json', function($) { } } // Parse JSON from the cookie into an object - if (jQuery.evalJSON && cookieValue && cookieValue.match(/^\s*\{/)) { + if ($.evalJSON && cookieValue && cookieValue.match(/^\s*\{/)) { try { - cookieValue = jQuery.evalJSON(cookieValue); + cookieValue = $.evalJSON(cookieValue); } catch (e) { } diff --git a/dom/styles/styles.js b/dom/styles/styles.js index babfe151..1de61dde 100644 --- a/dom/styles/styles.js +++ b/dom/styles/styles.js @@ -38,7 +38,7 @@ steal('jquery', function( $ ) { oldName = name.replace(rdashAlpha, fcamelCase); if ( rfloat.test(name) ) { - name = jQuery.support.cssFloat ? "float" : "styleFloat"; + name = $.support.cssFloat ? "float" : "styleFloat"; oldName = "cssFloat"; } diff --git a/dom/within/within.js b/dom/within/within.js index 22e39a11..a3555e1c 100644 --- a/dom/within/within.js +++ b/dom/within/within.js @@ -33,7 +33,7 @@ $.fn.within= function(left, top, useOffsetCache) { // uses either the cached offset or .offset() var offset = useOffsetCache ? - jQuery.data(this,"offsetCache") || jQuery.data(this,"offsetCache", q.offset()) : + $.data(this,"offsetCache") || $.data(this,"offsetCache", q.offset()) : q.offset(); // Check if the given coordinates are within the area of the current element @@ -46,7 +46,7 @@ $.fn.within= function(left, top, useOffsetCache) { } }); - return this.pushStack( jQuery.unique( ret ), "within", left+","+top ); + return this.pushStack( $.unique( ret ), "within", left+","+top ); } @@ -75,8 +75,8 @@ $.fn.withinBox = function(left, top, width, height, useOffsetCache){ // use cached offset or .offset() var offset = useOffsetCache ? - jQuery.data(this,"offset") || - jQuery.data(this,"offset", q.offset()) : + $.data(this,"offset") || + $.data(this,"offset", q.offset()) : q.offset(); @@ -87,7 +87,7 @@ $.fn.withinBox = function(left, top, width, height, useOffsetCache){ if(res) ret.push(this); }); - return this.pushStack( jQuery.unique( ret ), "withinBox", jQuery.makeArray(arguments).join(",") ); + return this.pushStack( $.unique( ret ), "withinBox", $.makeArray(arguments).join(",") ); } return $; diff --git a/event/default/default.js b/event/default/default.js index f3d26ae2..6c3f39d6 100644 --- a/event/default/default.js +++ b/event/default/default.js @@ -82,11 +82,11 @@ $event.trigger = function defaultTriggerer( event, data, elem, onlyHandlers){ // Caller can pass in an Event, Object, or just an event type string event = typeof event === "object" ? // jQuery.Event object - event[ jQuery.expando ] ? event : + event[ $.expando ] ? event : // Object literal - new jQuery.Event( type, event ) : + new $.Event( type, event ) : // Just the event type (string) - new jQuery.Event( type), + new $.Event( type), res=oldTrigger.call($.event,event, data, elem, onlyHandlers), paused=event.isPaused && event.isPaused(); diff --git a/event/destroyed/destroyed.js b/event/destroyed/destroyed.js index cb00616d..d98bdfc5 100644 --- a/event/destroyed/destroyed.js +++ b/event/destroyed/destroyed.js @@ -6,7 +6,7 @@ steal('jquery', function( $ ) { */ // Store the old jQuery.cleanData - var oldClean = jQuery.cleanData; + var oldClean = $.cleanData; // Overwrites cleanData which is called by jQuery on manipulation methods $.cleanData = function( elems ) { diff --git a/event/drop/drop.js b/event/drop/drop.js index eaa0d9b7..3e689e37 100644 --- a/event/drop/drop.js +++ b/event/drop/drop.js @@ -110,7 +110,7 @@ steal('jquery', 'jquery/event/drag', 'jquery/dom/within', 'jquery/dom/compare', * }); */ $.Drop = function(callbacks, element){ - jQuery.extend(this,callbacks); + $.extend(this,callbacks); this.element = $(element); } // add the elements ... diff --git a/event/fastfix/fastfix.js b/event/fastfix/fastfix.js index 3707b497..fde6ed06 100644 --- a/event/fastfix/fastfix.js +++ b/event/fastfix/fastfix.js @@ -61,10 +61,10 @@ steal('jquery', function ($) { }; // Get all properties that should be mapped - jQuery.each(jQuery.event.keyHooks.props.concat(jQuery.event.mouseHooks.props).concat(jQuery.event.props), function (i, prop) { + $.each($.event.keyHooks.props.concat($.event.mouseHooks.props).concat($.event.props), function (i, prop) { if (prop !== "target") { (function () { - Object.defineProperty(jQuery.Event.prototype, prop, { + Object.defineProperty($.Event.prototype, prop, { get : function () { // get the original value, undefined when there is no original event var originalValue = this.originalEvent && this.originalEvent[prop]; @@ -86,13 +86,13 @@ steal('jquery', function ($) { } }); - jQuery.event.fix = function (event) { - if (event[ jQuery.expando ]) { + $.event.fix = function (event) { + if (event[ $.expando ]) { return event; } // Create a jQuery event with at minimum a target and type set var originalEvent = event, - event = jQuery.Event(originalEvent); + event = $.Event(originalEvent); event.target = originalEvent.target; // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) if (!event.target) { diff --git a/event/fastfix/fastfix_test.js b/event/fastfix/fastfix_test.js index 540ec581..df6dd42a 100644 --- a/event/fastfix/fastfix_test.js +++ b/event/fastfix/fastfix_test.js @@ -73,7 +73,7 @@ steal("jquery/event/fastfix", }; jQuery("#firstp").bind("click", {"foo" : "bar"}, handler).click().unbind("click", handler); - ok(!jQuery._data(jQuery("#firstp")[0], "events"), "Event handler unbound when using data."); + ok(!$._data(jQuery("#firstp")[0], "events"), "Event handler unbound when using data."); var test = function () { }; @@ -91,7 +91,7 @@ steal("jquery/event/fastfix", }; jQuery("#firstp").click({"foo" : "bar"}, handler).click().unbind("click", handler); - ok(!jQuery._data(jQuery("#firstp")[0], "events"), "Event handler unbound when using data."); + ok(!$._data(jQuery("#firstp")[0], "events"), "Event handler unbound when using data."); }); test("bind(), with data, trigger with data", function () { @@ -193,7 +193,7 @@ steal("jquery/event/fastfix", var i = 0; - jQuery.event.special["test"] = { + $.event.special["test"] = { _default : function (e, data) { equal(this, document, "Make sure we're at the top of the chain."); equal(e.type, "test", "And that we're still dealing with a test event."); @@ -246,7 +246,7 @@ steal("jquery/event/fastfix", // Should trigger 2 div.appendTo("#qunit-fixture").remove(); - delete jQuery.event.special["test"]; + delete $.event.special["test"]; }); test("bind(), no data", function () { @@ -586,7 +586,7 @@ steal("jquery/event/fastfix", var elem = jQuery("#firstp"), log = [], check = []; - jQuery.each(new Array(100), function (i) { + $.each(new Array(100), function (i) { elem.bind("click", function () { log.push(i); }); @@ -615,10 +615,10 @@ steal("jquery/event/fastfix", }; jQuery("#firstp") - .bind("click", jQuery.proxy(handler1, thisObject)).click().unbind("click", handler1) - .bind("click", data, jQuery.proxy(handler2, thisObject)).click().unbind("click", handler2); + .bind("click", $.proxy(handler1, thisObject)).click().unbind("click", handler1) + .bind("click", data, $.proxy(handler2, thisObject)).click().unbind("click", handler2); - ok(!jQuery._data(jQuery("#firstp")[0], "events"), "Event handler unbound when using different this object and data."); + ok(!$._data(jQuery("#firstp")[0], "events"), "Event handler unbound when using different this object and data."); }); test("bind(name, false), unbind(name, false)", function () { @@ -710,7 +710,7 @@ steal("jquery/event/fastfix", } }); - var events = jQuery._data(obj, "events"); + var events = $._data(obj, "events"); ok(events, "Object has events bound."); equal(obj["events"], undefined, "Events object on plain objects is not events"); equal(obj["test"], undefined, "Make sure that test event is not on the plain object."); @@ -729,9 +729,9 @@ steal("jquery/event/fastfix", // Make sure it doesn't complain when no events are found jQuery(obj).unbind("test"); - equal(obj && obj[ jQuery.expando ] && - obj[ jQuery.expando ][ jQuery.expando ] && - obj[ jQuery.expando ][ jQuery.expando ]["events"], undefined, "Make sure events object is removed"); + equal(obj && obj[ $.expando ] && + obj[ $.expando ][ $.expando ] && + obj[ $.expando ][ $.expando ]["events"], undefined, "Make sure events object is removed"); }); test("unbind(type)", function () { @@ -880,7 +880,7 @@ steal("jquery/event/fastfix", elem.remove(); }); - test("withinElement implemented with jQuery.contains()", function () { + test("withinElement implemented with $.contains()", function () { expect(1); @@ -1194,8 +1194,8 @@ steal("jquery/event/fastfix", $parent.get(0).style.display = "none"; - var event = jQuery.Event("noNew"); - ok(event != window, "Instantiate jQuery.Event without the 'new' keyword"); + var event = $.Event("noNew"); + ok(event != window, "Instantiate $.Event without the 'new' keyword"); equal(event.type, "noNew", "Verify its type"); equal(event.isDefaultPrevented(), false, "Verify isDefaultPrevented"); @@ -1223,7 +1223,7 @@ steal("jquery/event/fastfix", }); // test with an event object - event = new jQuery.Event("foo"); + event = new $.Event("foo"); event.secret = "boo!"; $child.trigger(event); @@ -1258,7 +1258,7 @@ steal("jquery/event/fastfix", // in which event handlers are iterated. //$child.bind("foo", error ); - event = new jQuery.Event("foo"); + event = new $.Event("foo"); $child.trigger(event, [1, 2, 3]).unbind(); equal(event.result, "result", "Check event.result attribute"); @@ -1269,7 +1269,7 @@ steal("jquery/event/fastfix", $parent.unbind().remove(); // Ensure triggerHandler doesn't molest its event object (#xxx) - event = jQuery.Event("zowie"); + event = $.Event("zowie"); jQuery(document).triggerHandler(event); equal(event.type, "zowie", "Verify its type"); equal(event.isPropagationStopped(), false, "propagation not stopped"); @@ -1455,21 +1455,21 @@ steal("jquery/event/fastfix", equal(window.onbeforeunload, null, "window property has been unset to null/undefined"); }); - test("jQuery.Event( type, props )", function () { + test("$.Event( type, props )", function () { expect(5); - var event = jQuery.Event("keydown", { keyCode : 64 }), + var event = $.Event("keydown", { keyCode : 64 }), handler = function (event) { ok("keyCode" in event, "Special property 'keyCode' exists"); equal(event.keyCode, 64, "event.keyCode has explicit value '64'"); }; - // Supports jQuery.Event implementation + // Supports $.Event implementation equal(event.type, "keydown", "Verify type"); // ensure "type" in props won't clobber the one set by constructor - equal(jQuery.inArray("type", jQuery.event.props), -1, "'type' property not in props (#10375)"); + equal($.inArray("type", $.event.props), -1, "'type' property not in props (#10375)"); ok("keyCode" in event, "Special 'keyCode' property exists"); @@ -1479,7 +1479,7 @@ steal("jquery/event/fastfix", }); - test("jQuery.Event.currentTarget", function () { + test("$.Event.currentTarget", function () { expect(2); jQuery("

") @@ -1555,7 +1555,7 @@ steal("jquery/event/fastfix", equal(turn, 2, "Trying toggle with 3 functions, attempt 5 yields 2"); $div.unbind("click", fns[0]); - var data = jQuery._data($div[0], "events"); + var data = $._data($div[0], "events"); ok(!data, "Unbinding one function from toggle unbinds them all"); // manually clean up detached elements @@ -1702,7 +1702,7 @@ steal("jquery/event/fastfix", div = 0; livea = 0; liveb = 0; - var event = jQuery.Event("click"); + var event = $.Event("click"); event.button = 1; jQuery("div#nothiddendiv").trigger(event); @@ -1742,13 +1742,13 @@ steal("jquery/event/fastfix", jQuery("#foo").trigger("click", true).die("click"); // Test binding with different this object - jQuery("#foo").live("click", jQuery.proxy(function (e) { + jQuery("#foo").live("click", $.proxy(function (e) { equal(this.foo, "bar", "live with event scope"); }, { foo : "bar" })); jQuery("#foo").trigger("click").die("click"); // Test binding with different this object, event data, and trigger data - jQuery("#foo").live("click", true, jQuery.proxy(function (e, data) { + jQuery("#foo").live("click", true, $.proxy(function (e, data) { equal(e.data, true, "live with with different this object, event data, and trigger data"); equal(this["foo"], "bar", "live with with different this object, event data, and trigger data"); equal(data, true, "live with with different this object, event data, and trigger data"); @@ -2156,7 +2156,7 @@ steal("jquery/event/fastfix", test("live with special events", function () { expect(13); - jQuery.event.special["foo"] = { + $.event.special["foo"] = { setup : function (data, namespaces, handler) { ok(true, "Setup run."); }, @@ -2199,7 +2199,7 @@ steal("jquery/event/fastfix", // Run: remove, teardown jQuery("#liveSpan1").die("foo"); - delete jQuery.event.special["foo"]; + delete $.event.special["foo"]; }); test(".delegate()/.undelegate()", function () { @@ -2315,7 +2315,7 @@ steal("jquery/event/fastfix", div = 0; livea = 0; liveb = 0; - var event = jQuery.Event("click"); + var event = $.Event("click"); event.button = 1; jQuery("div#nothiddendiv").trigger(event); @@ -2357,14 +2357,14 @@ steal("jquery/event/fastfix", jQuery("#body").undelegate("#foo", "click"); // Test binding with different this object - jQuery("#body").delegate("#foo", "click", jQuery.proxy(function (e) { + jQuery("#body").delegate("#foo", "click", $.proxy(function (e) { equal(this["foo"], "bar", "delegate with event scope"); }, { "foo" : "bar" })); jQuery("#foo").trigger("click"); jQuery("#body").undelegate("#foo", "click"); // Test binding with different this object, event data, and trigger data - jQuery("#body").delegate("#foo", "click", true, jQuery.proxy(function (e, data) { + jQuery("#body").delegate("#foo", "click", true, $.proxy(function (e, data) { equal(e.data, true, "delegate with with different this object, event data, and trigger data"); equal(this.foo, "bar", "delegate with with different this object, event data, and trigger data"); equal(data, true, "delegate with with different this object, event data, and trigger data"); @@ -2548,7 +2548,7 @@ steal("jquery/event/fastfix", jQuery("#body").undelegate("#nothiddendiv div", "click"); }); - test("jQuery.off using dispatched jQuery.Event", function () { + test("$.off using dispatched $.Event", function () { expect(1); var markup = jQuery('

target

'), @@ -2811,7 +2811,7 @@ steal("jquery/event/fastfix", ok(true, "Resize event fired."); }).resize().unbind("resize"); - ok(!jQuery._data(window, "__events__"), "Make sure all the events are gone."); + ok(!$._data(window, "__events__"), "Make sure all the events are gone."); }); test("focusin bubbles", function () { @@ -2956,7 +2956,7 @@ steal("jquery/event/fastfix", .off("click cluck"); // We should have removed all the event handlers ... kinda hacky way to check this - var data = jQuery.data[ jQuery("#onandoff")[0].expando ] || {}; + var data = $.data[ jQuery("#onandoff")[0].expando ] || {}; equal(data["events"], undefined, "no events left"); $onandoff.remove(); @@ -2965,7 +2965,7 @@ steal("jquery/event/fastfix", test("special bind/delegate name mapping", function () { expect(7); - jQuery.event.special["slap"] = { + $.event.special["slap"] = { bindType : "click", delegateType : "swing", handle : function (event) { @@ -2978,10 +2978,10 @@ steal("jquery/event/fastfix", }; jQuery("
") - .on("slap", "button", jQuery.noop) + .on("slap", "button", $.noop) .on("swing", "button", comeback) .find("button") - .on("slap", jQuery.noop) + .on("slap", $.noop) .on("click", comeback) .trigger("click")// bindType-slap and click .off("slap") @@ -2996,9 +2996,9 @@ steal("jquery/event/fastfix", .trigger("swing") .end() .remove(); - delete jQuery.event.special["slap"]; + delete $.event.special["slap"]; - jQuery.event.special["gutfeeling"] = { + $.event.special["gutfeeling"] = { bindType : "click", delegateType : "click", handle : function (event) { @@ -3010,27 +3010,27 @@ steal("jquery/event/fastfix", // Ensure a special event isn't removed by its mapped type jQuery('

Gut Feeling

') - .on("click", jQuery.noop) - .on("gutfeeling", jQuery.noop) + .on("click", $.noop) + .on("gutfeeling", $.noop) .off("click") .trigger("gutfeeling") .remove(); // Ensure special events are removed when only a namespace is provided jQuery('

Gut Feeling

') - .on("gutfeeling.Devo", jQuery.noop) + .on("gutfeeling.Devo", $.noop) .off(".Devo") .trigger("gutfeeling") .remove(); // Ensure .one() events are removed after their maiden voyage jQuery('

Gut Feeling

') - .one("gutfeeling", jQuery.noop) + .one("gutfeeling", $.noop) .trigger("gutfeeling")// This one should .trigger("gutfeeling")// This one should not .remove(); - delete jQuery.event.special["gutfeeling"]; + delete $.event.special["gutfeeling"]; }); test(".on and .off, selective mixed removal (#10705)", function () { @@ -3101,13 +3101,13 @@ steal("jquery/event/fastfix", order = [], args = {}; - notYetReady = !jQuery.isReady; + notYetReady = !$.isReady; - test("jQuery.isReady", function () { + test("$.isReady", function () { expect(2); - equal(notYetReady, true, "jQuery.isReady should not be true before DOM ready"); - equal(jQuery.isReady, true, "jQuery.isReady should be true once DOM is ready"); + equal(notYetReady, true, "$.isReady should not be true before DOM ready"); + equal($.isReady, true, "$.isReady should be true once DOM is ready"); }); // Create an event handler. @@ -3145,7 +3145,7 @@ steal("jquery/event/fastfix", // Ensure handler argument is correct. equal(args["a"], jQuery, "Argument passed to fn in jQuery( fn ) should be jQuery"); equal(args["b"], jQuery, "Argument passed to fn in jQuery(document).ready( fn ) should be jQuery"); - ok(args["c"] instanceof jQuery.Event, "Argument passed to fn in jQuery(document).bind( 'ready', fn ) should be an event object"); + ok(args["c"] instanceof $.Event, "Argument passed to fn in jQuery(document).bind( 'ready', fn ) should be an event object"); order = []; @@ -3173,7 +3173,7 @@ steal("jquery/event/fastfix", var $fixture = jQuery("").appendTo("body"); - var originRemoveEvent = jQuery.removeEvent; + var originRemoveEvent = $.removeEvent; var wrapperRemoveEvent = function (elem, type, handle) { equal("change", type, "Event handler for 'change' event should be removed"); @@ -3181,7 +3181,7 @@ steal("jquery/event/fastfix", originRemoveEvent(elem, type, handle); }; - jQuery.removeEvent = wrapperRemoveEvent; + $.removeEvent = wrapperRemoveEvent; $fixture.bind("change", function (event) { }); @@ -3189,7 +3189,7 @@ steal("jquery/event/fastfix", $fixture.remove(); - jQuery.removeEvent = originRemoveEvent; + $.removeEvent = originRemoveEvent; }); asyncTest("trigger click on checkbox, fires change event", function () { diff --git a/event/handle/handle.js b/event/handle/handle.js index 42961301..4fb8fdc7 100644 --- a/event/handle/handle.js +++ b/event/handle/handle.js @@ -27,19 +27,19 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ namespaces.sort(); } - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + if ( (!elem || $.event.customEvent[ type ]) && !$.event.global[ type ] ) { // No jQuery handlers for this event type, and it can't have inline handlers return; } // Caller can pass in an Event, Object, or just an event type string event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : + // $.Event object + event[ $.expando ] ? event : // Object literal - new jQuery.Event( type, event ) : + new $.Event( type, event ) : // Just the event type (string) - new jQuery.Event( type ); + new $.Event( type ); event.type = type; event.exclusive = exclusive; @@ -55,14 +55,14 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ // Handle a global trigger if ( !elem ) { // TODO: Stop taunting the data cache; remove global events and always attach to document - jQuery.each( jQuery.cache, function() { + $.each( $.cache, function() { // internalKey variable is just used to make it easier to find // and potentially change this stuff later; currently it just - // points to jQuery.expando - var internalKey = jQuery.expando, + // points to $.expando + var internalKey = $.expando, internalCache = this[ internalKey ]; if ( internalCache && internalCache.events && internalCache.events[ type ] ) { - jQuery.event.trigger( event, data, internalCache.handle.elem ); + $.event.trigger( event, data, internalCache.handle.elem ); } }); return; @@ -78,7 +78,7 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ event.target = elem; // Clone any incoming data and prepend the event, creating the handler arg list - data = data ? jQuery.makeArray( data ) : []; + data = data ? $.makeArray( data ) : []; data.unshift( event ); var cur = elem, @@ -87,7 +87,7 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ // Fire event on the current element, then bubble up the DOM tree do { - var handle = jQuery._data( cur, "handle" ); + var handle = $._data( cur, "handle" ); event.currentTarget = cur; if ( handle ) { @@ -95,7 +95,7 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ } // Trigger an inline bound script - if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { + if ( ontype && $.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { event.result = false; event.preventDefault(); } @@ -107,10 +107,10 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ // If nobody prevented the default action, do it now if ( !event.isDefaultPrevented() ) { var old, - special = jQuery.event.special[ type ] || {}; + special = $.event.special[ type ] || {}; if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + !(type === "click" && $.nodeName( elem, "a" )) && $.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction)() check here because IE6/7 fails that test. @@ -124,7 +124,7 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ elem[ ontype ] = null; } - jQuery.event.triggered = type; + $.event.triggered = type; elem[ type ](); } } catch ( ieError ) {} @@ -133,7 +133,7 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ elem[ ontype ] = old; } - jQuery.event.triggered = undefined; + $.event.triggered = undefined; } } @@ -142,9 +142,9 @@ $.event.trigger = function(event, data, elem, onlyHandlers){ // a copy of $'s handle function that goes until it finds $.event.handle = function( event ) { - event = jQuery.event.fix( event || window.event ); + event = $.event.fix( event || window.event ); // Snapshot the handlers list since a called handler may add/remove events. - var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), + var handlers = (($._data( this, "events" ) || {})[ event.type ] || []).slice(0), run_all = !event.exclusive && !event.namespace, args = Array.prototype.slice.call( arguments, 0 ); diff --git a/event/key/key.js b/event/key/key.js index 3f4d6db8..6a908f8d 100644 --- a/event/key/key.js +++ b/event/key/key.js @@ -128,7 +128,7 @@ steal('jquery', function($){ * * @return {String} The string representation of of the key pressed. */ - jQuery.Event.prototype.keyName = function(){ + $.Event.prototype.keyName = function(){ var event = this, test = /\w/, // It can be either keyCode or charCode. diff --git a/event/livehack/livehack.js b/event/livehack/livehack.js index d1397adc..9038c6de 100644 --- a/event/livehack/livehack.js +++ b/event/livehack/livehack.js @@ -1,6 +1,6 @@ steal('jquery', function($) { - var event = jQuery.event, + var event = $.event, //helper that finds handlers by type and calls back a function, this is basically handle // events - the events object diff --git a/event/pause/pause.js b/event/pause/pause.js index a8b87e7e..947c39e8 100644 --- a/event/pause/pause.js +++ b/event/pause/pause.js @@ -56,19 +56,19 @@ $.Event.prototype.resume = function(){ var handleObj = this.handleObj, currentTarget = this.currentTarget; // temporarily overwrite special handle - var origType = jQuery.event.special[ handleObj.origType ], + var origType = $.event.special[ handleObj.origType ], origHandle = origType && origType.handle; if(!origType){ - jQuery.event.special[ handleObj.origType ] = {}; + $.event.special[ handleObj.origType ] = {}; } - jQuery.event.special[ handleObj.origType ].handle = function(ev){ + $.event.special[ handleObj.origType ].handle = function(ev){ // remove this once we have passed the handleObj if(ev.handleObj === handleObj && ev.currentTarget === currentTarget){ if(!origType){ - delete jQuery.event.special[ handleObj.origType ]; + delete $.event.special[ handleObj.origType ]; } else { - jQuery.event.special[ handleObj.origType ].handle = origHandle; + $.event.special[ handleObj.origType ].handle = origHandle; } } } diff --git a/model/list/list_test.js b/model/list/list_test.js index 1318fc9e..04ec9bd9 100644 --- a/model/list/list_test.js +++ b/model/list/list_test.js @@ -173,7 +173,7 @@ test("events - add", 3, function(){ // events are hooked internally now // ok( $(person).data("events"), "person has events" ); - ok(jQuery._data(person, 'events'), "person has events" ); + ok($._data(person, 'events'), "person has events" ); list.pop()