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("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()