X Tutup
Skip to content

Commit bca5765

Browse files
committed
Make sure that jQuery works even when the individual modules are loaded separately AND jQuery.noConflict(true) is used. Fixes #7011.
1 parent 116f3b7 commit bca5765

File tree

13 files changed

+51
-2
lines changed

13 files changed

+51
-2
lines changed

src/ajax.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
var jsc = jQuery.now(),
24
rscript = /<script(.|\s)*?\/script>/gi,
35
rselectTextarea = /select|textarea/i,
@@ -686,3 +688,5 @@ jQuery.extend( jQuery.ajax, {
686688

687689
// For backwards compatibility
688690
jQuery.extend( jQuery.ajax );
691+
692+
})( jQuery );

src/attributes.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
var rclass = /[\n\t]/g,
24
rspace = /\s+/,
35
rreturn = /\r/g,
@@ -345,3 +347,5 @@ jQuery.extend({
345347
return jQuery.style( elem, name, value );
346348
}
347349
});
350+
351+
})( jQuery );

src/css.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
// exclude the following css properties to add px
24
var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
35
ralpha = /alpha\([^)]*\)/,
@@ -232,3 +234,5 @@ if ( jQuery.expr && jQuery.expr.filters ) {
232234
return !jQuery.expr.filters.hidden( elem );
233235
};
234236
}
237+
238+
})( jQuery );

src/data.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
var windowData = {};
24

35
jQuery.extend({
@@ -165,3 +167,5 @@ jQuery.fn.extend({
165167
});
166168
}
167169
});
170+
171+
})( jQuery );

src/dimensions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
24
jQuery.each([ "Height", "Width" ], function( i, name ) {
35

@@ -55,3 +57,5 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
5557
};
5658

5759
});
60+
61+
})( jQuery );

src/effects.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
var elemdisplay = {},
24
rfxtypes = /toggle|show|hide/,
35
rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
@@ -480,3 +482,5 @@ if ( jQuery.expr && jQuery.expr.filters ) {
480482
}).length;
481483
};
482484
}
485+
486+
})( jQuery );

src/event.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
var rnamespaces = /\.(.*)$/,
24
fcleanup = function( nm ) {
35
return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
@@ -1109,3 +1111,5 @@ if ( window.attachEvent && !window.addEventListener ) {
11091111
}
11101112
});
11111113
}
1114+
1115+
})( jQuery );

src/manipulation.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
24
rleadingWhitespace = /^\s+/,
35
rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
@@ -599,4 +601,6 @@ function evalScript( i, elem ) {
599601
if ( elem.parentNode ) {
600602
elem.parentNode.removeChild( elem );
601603
}
602-
}
604+
}
605+
606+
})( jQuery );

src/offset.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
if ( "getBoundingClientRect" in document.documentElement ) {
24
jQuery.fn.offset = function( options ) {
35
var elem = this[0];
@@ -281,3 +283,5 @@ function getWindow( elem ) {
281283
elem.defaultView || elem.parentWindow :
282284
false;
283285
}
286+
287+
})( jQuery );

src/queue.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(function( jQuery ) {
2+
13
jQuery.extend({
24
queue: function( elem, type, data ) {
35
if ( !elem ) {
@@ -88,3 +90,5 @@ jQuery.fn.extend({
8890
return this.queue( type || "fx", [] );
8991
}
9092
});
93+
94+
})( jQuery );

0 commit comments

Comments
 (0)
X Tutup