Skip to content

Commit 39e855a

Browse files
committed
Removed the global logic from the jQuery libs.
1 parent 34c683f commit 39e855a

5 files changed

Lines changed: 4 additions & 57 deletions

File tree

src/snippetjs/lib/jquery-1.12.4.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10975,33 +10975,9 @@ if ( typeof define === "function" && define.amd ) {
1097510975
} );
1097610976
}
1097710977

10978-
10979-
10980-
var
10981-
10982-
// Map over jQuery in case of overwrite
10983-
_jQuery = window.jQuery,
10984-
10985-
// Map over the $ in case of overwrite
10986-
_$ = window.$;
10987-
10978+
// Removed global logic
1098810979
jQuery.noConflict = function( deep ) {
10989-
if ( window.$ === jQuery ) {
10990-
window.$ = _$;
10991-
}
10992-
10993-
if ( deep && window.jQuery === jQuery ) {
10994-
window.jQuery = _jQuery;
10995-
}
10996-
1099710980
return jQuery;
10998-
};
10999-
11000-
// Expose jQuery and $ identifiers, even in
11001-
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
11002-
// and CommonJS for browser emulators (#13566)
11003-
if ( !noGlobal ) {
11004-
window.jQuery = window.$ = jQuery;
1100510981
}
1100610982

1100710983
return jQuery;

src/snippetjs/lib/jquery-3.1.1.js

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10182,39 +10182,10 @@ if ( typeof define === "function" && define.amd ) {
1018210182
} );
1018310183
}
1018410184

10185-
10186-
10187-
10188-
var
10189-
10190-
// Map over jQuery in case of overwrite
10191-
_jQuery = window.jQuery,
10192-
10193-
// Map over the $ in case of overwrite
10194-
_$ = window.$;
10195-
10185+
// Removed global logic
1019610186
jQuery.noConflict = function( deep ) {
10197-
if ( window.$ === jQuery ) {
10198-
window.$ = _$;
10199-
}
10200-
10201-
if ( deep && window.jQuery === jQuery ) {
10202-
window.jQuery = _jQuery;
10203-
}
10204-
1020510187
return jQuery;
10206-
};
10207-
10208-
// Expose jQuery and $ identifiers, even in AMD
10209-
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10210-
// and CommonJS for browser emulators (#13566)
10211-
if ( !noGlobal ) {
10212-
window.jQuery = window.$ = jQuery;
1021310188
}
1021410189

10215-
10216-
10217-
10218-
1021910190
return jQuery;
1022010191
} );

src/snippetjs/widget/snippetjs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ define([
265265
if (self.usejQuery === "jQuery1") {
266266
define.amd.jQuery = true;
267267
require(["snippetjs/lib/jquery-1.12.4"], function (jquery1124) {
268-
self._jQuery1 = jquery1124.noConflict(true);
268+
self._jQuery1 = jquery1124;
269269
str = "var jQuery, $; jQuery = $ = self._jQuery1; " + str;
270270
self._evalJS(str);
271271
});
272272
} else if (self.usejQuery === "jQuery3") {
273273
define.amd.jQuery = true;
274274
require(["snippetjs/lib/jquery-3.1.1"], function (jquery311) {
275-
self._jQuery3 = jquery311.noConflict(true);
275+
self._jQuery3 = jquery311;
276276
str = "var jQuery, $; jQuery = $ = self._jQuery3; " + str;
277277
self._evalJS(str);
278278
});

test/FormatString.mpr

0 Bytes
Binary file not shown.

test/widgets/snippetjs.mpk

-337 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)