From c50b74372c398b0c85164ad01977c5118b55d418 Mon Sep 17 00:00:00 2001
From: Alex Sexton <AlexSexton@gmail.com>
Date: Sun, 23 Jan 2011 21:19:33 -0600
Subject: [PATCH] Moved jQuery global leak to end of file so accidental gEBCN
 overrides in prototype don't get caught up in confusion.
 Fixed tests to reference jQuery variable instead of $ (best
 practice). Fixes #8033

---
 src/core.js                    |    2 +-
 src/outro.js                   |    1 +
 test/data/offset/absolute.html |    2 +-
 test/data/offset/body.html     |    4 ++--
 test/data/offset/fixed.html    |    4 ++--
 test/data/offset/relative.html |    4 ++--
 test/data/offset/scroll.html   |    4 ++--
 test/data/offset/static.html   |    4 ++--
 test/data/offset/table.html    |    4 ++--
 9 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/core.js b/src/core.js
index 520db45..92ebb13 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1054,6 +1054,6 @@ function doScrollCheck() {
 }
 
 // Expose jQuery to the global object
-return (window.jQuery = window.$ = jQuery);
+return jQuery;
 
 })();
diff --git a/src/outro.js b/src/outro.js
index 7773a74..32b0d08 100644
--- a/src/outro.js
+++ b/src/outro.js
@@ -1 +1,2 @@
+window.jQuery = window.$ = jQuery;
 })(window);
diff --git a/test/data/offset/absolute.html b/test/data/offset/absolute.html
index dc0ba22..b4db30a 100644
--- a/test/data/offset/absolute.html
+++ b/test/data/offset/absolute.html
@@ -26,7 +26,7 @@
 		<script src="../../../src/offset.js"></script>
 		<script type="text/javascript" src="../../../dist/jquery.js"></script>
 		<script type="text/javascript" charset="utf-8">
-			$(function() {
+			jQuery(function($) {
 				$('.absolute').click(function() {
 					$('#marker').css( $(this).offset() );
 					var pos = $(this).position();
diff --git a/test/data/offset/body.html b/test/data/offset/body.html
index 9a692e8..e3eb4f8 100644
--- a/test/data/offset/body.html
+++ b/test/data/offset/body.html
@@ -18,7 +18,7 @@
 		<script src="../../../src/css.js"></script>
 		<script src="../../../src/offset.js"></script>
 		<script type="text/javascript" charset="utf-8">
-			$(function() {
+			jQuery(function($) {
 				$('body').click(function() {
 					$('#marker').css( $(this).offset() );
 					return false;
@@ -29,4 +29,4 @@
 	<body>
 		<div id="marker"></div>
 	</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/test/data/offset/fixed.html b/test/data/offset/fixed.html
index f795e5c..f93c20f 100644
--- a/test/data/offset/fixed.html
+++ b/test/data/offset/fixed.html
@@ -22,7 +22,7 @@
 		<script src="../../../src/css.js"></script>
 		<script src="../../../src/offset.js"></script>
 		<script type="text/javascript" charset="utf-8">
-			$(function() {
+			jQuery(function($) {
 				window.scrollTo(1000,1000);
 				$('.fixed').click(function() {
 					$('#marker').css( $(this).offset() );
@@ -38,4 +38,4 @@
 		<div id="marker"></div>
 		<p class="instructions">Click the white box to move the marker to it.</p>
 	</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/test/data/offset/relative.html b/test/data/offset/relative.html
index bfcd147..3586476 100644
--- a/test/data/offset/relative.html
+++ b/test/data/offset/relative.html
@@ -20,7 +20,7 @@
 		<script src="../../../src/css.js"></script>
 		<script src="../../../src/offset.js"></script>
 		<script type="text/javascript" charset="utf-8">
-			$(function() {
+			jQuery(function($) {
 				$('.relative').click(function() {
 					$('#marker').css( $(this).offset() );
 					var pos = $(this).position();
@@ -36,4 +36,4 @@
 		<div id="marker"></div>
 		<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
 	</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/test/data/offset/scroll.html b/test/data/offset/scroll.html
index e6980b4..50de95e 100644
--- a/test/data/offset/scroll.html
+++ b/test/data/offset/scroll.html
@@ -23,7 +23,7 @@
 		<script src="../../../src/css.js"></script>
 		<script src="../../../src/offset.js"></script>
 		<script type="text/javascript" charset="utf-8">
-			$(function() {
+			jQuery(function($) {
 				window.scrollTo(1000,1000);
 				$('#scroll-1')[0].scrollLeft = 5;
 				$('#scroll-1')[0].scrollTop = 5;
@@ -44,4 +44,4 @@
 		<div id="marker"></div>
 		<p class="instructions">Click the white box to move the marker to it.</p>
 	</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/test/data/offset/static.html b/test/data/offset/static.html
index f47a79b..b1fb9f1 100644
--- a/test/data/offset/static.html
+++ b/test/data/offset/static.html
@@ -20,7 +20,7 @@
 		<script src="../../../src/css.js"></script>
 		<script src="../../../src/offset.js"></script>
 		<script type="text/javascript" charset="utf-8">
-			$(function() {
+			jQuery(function($) {
 				$('.static').click(function() {
 					$('#marker').css( $(this).offset() );
 					var pos = $(this).position();
@@ -36,4 +36,4 @@
 		<div id="marker"></div>
 		<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
 	</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/test/data/offset/table.html b/test/data/offset/table.html
index 83fb559..528e530 100644
--- a/test/data/offset/table.html
+++ b/test/data/offset/table.html
@@ -20,7 +20,7 @@
 		<script src="../../../src/css.js"></script>
 		<script src="../../../src/offset.js"></script>
 		<script type="text/javascript" charset="utf-8">
-			$(function() {
+			jQuery(function($) {
 				$('table, th, td').click(function() {
 					$('#marker').css( $(this).offset() );
 					return false;
@@ -48,4 +48,4 @@
 		<div id="marker"></div>
 		<p class="instructions">Click the white box to move the marker to it.</p>
 	</body>
-</html>
\ No newline at end of file
+</html>
-- 
1.7.10.4