diff --git a/src/ajax.js b/src/ajax.js index 2c4f13cb..52a5a22c 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var jsc = jQuery.now(), rscript = //gi, rselectTextarea = /select|textarea/i, @@ -686,3 +688,5 @@ jQuery.extend( jQuery.ajax, { // For backwards compatibility jQuery.extend( jQuery.ajax ); + +})( jQuery ); diff --git a/src/attributes.js b/src/attributes.js index fecba661..4fa49b91 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var rclass = /[\n\t]/g, rspace = /\s+/, rreturn = /\r/g, @@ -341,3 +343,5 @@ jQuery.extend({ } } }); + +})( jQuery ); diff --git a/src/css.js b/src/css.js index 2da19b9c..56249598 100644 --- a/src/css.js +++ b/src/css.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var ralpha = /alpha\([^)]*\)/, ropacity = /opacity=([^)]*)/, rdashAlpha = /-([a-z])/ig, @@ -238,3 +240,5 @@ if ( jQuery.expr && jQuery.expr.filters ) { return !jQuery.expr.filters.hidden( elem ); }; } + +})( jQuery ); diff --git a/src/data.js b/src/data.js index d38d47d3..5404c936 100644 --- a/src/data.js +++ b/src/data.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var windowData = {}; jQuery.extend({ @@ -165,3 +167,5 @@ jQuery.fn.extend({ }); } }); + +})( jQuery ); diff --git a/src/dimensions.js b/src/dimensions.js index 52fd0f86..58c16af8 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + // Create innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each([ "Height", "Width" ], function( i, name ) { @@ -55,3 +57,5 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { }; }); + +})( jQuery ); diff --git a/src/effects.js b/src/effects.js index d31e2e35..130b676f 100644 --- a/src/effects.js +++ b/src/effects.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var elemdisplay = {}, rfxtypes = /toggle|show|hide/, rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/, @@ -480,3 +482,5 @@ if ( jQuery.expr && jQuery.expr.filters ) { }).length; }; } + +})( jQuery ); diff --git a/src/event.js b/src/event.js index 45f2202c..f0b27de4 100644 --- a/src/event.js +++ b/src/event.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var rnamespaces = /\.(.*)$/, fcleanup = function( nm ) { return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { @@ -1109,3 +1111,5 @@ if ( window.attachEvent && !window.addEventListener ) { } }); } + +})( jQuery ); diff --git a/src/manipulation.js b/src/manipulation.js index cb898cc3..3054eea1 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, @@ -599,4 +601,6 @@ function evalScript( i, elem ) { if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } -} \ No newline at end of file +} + +})( jQuery ); diff --git a/src/offset.js b/src/offset.js index bab253ba..5d283aac 100644 --- a/src/offset.js +++ b/src/offset.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0]; @@ -281,3 +283,5 @@ function getWindow( elem ) { elem.defaultView || elem.parentWindow : false; } + +})( jQuery ); diff --git a/src/queue.js b/src/queue.js index e52f37b8..11c658f5 100644 --- a/src/queue.js +++ b/src/queue.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + jQuery.extend({ queue: function( elem, type, data ) { if ( !elem ) { @@ -88,3 +90,5 @@ jQuery.fn.extend({ return this.queue( type || "fx", [] ); } }); + +})( jQuery ); diff --git a/src/support.js b/src/support.js index cddd3dc3..febff159 100644 --- a/src/support.js +++ b/src/support.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + (function() { jQuery.support = {}; @@ -132,7 +134,7 @@ // release memory in IE root = script = div = all = a = null; -})(); +})( jQuery ); jQuery.props = { "for": "htmlFor", @@ -146,3 +148,5 @@ jQuery.props = { usemap: "useMap", frameborder: "frameBorder" }; + +})( jQuery ); diff --git a/src/traversing.js b/src/traversing.js index fde7219b..59110b09 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle @@ -271,3 +273,5 @@ function winnow( elements, qualifier, keep ) { return (jQuery.inArray( elem, qualifier ) >= 0) === keep; }); } + +})( jQuery ); diff --git a/test/unit/core.js b/test/unit/core.js index 3ba16a48..811d13fb 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -183,7 +183,7 @@ test("browser", function() { } test("noConflict", function() { - expect(6); + expect(7); var $$ = jQuery; @@ -196,6 +196,7 @@ test("noConflict", function() { equals( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" ); equals( jQuery, originaljQuery, "Make sure jQuery was reverted." ); equals( $, original$, "Make sure $ was reverted." ); + ok( $$("#main").html("test"), "Make sure that jQuery still works." ); jQuery = $$; });