From 770a92a594a803486a66603a67f559ff15915d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Fri, 15 Sep 2006 14:51:55 +0000 Subject: [PATCH] Fixed bug #147, required some (ugly) modifications: changed function jQuery(...){} to jQuery = function(...){}, necessary because IE parses all function name(){} declarations before executing inline code; added intro.js and outro.js to both build.xml (tested) and Makefile (not tested) to include "if(typeof window.jQuery == "undefined") { ... } --- Makefile | 4 +++- build.xml | 6 ++++-- src/intro.js | 2 ++ src/jquery/jquery.js | 4 ++-- src/outro.js | 1 + 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 src/intro.js create mode 100644 src/outro.js diff --git a/Makefile b/Makefile index 4f7538669..31f31825a 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,12 @@ DOCS_DIR = ${PREFIX}/docs TEST_DIR = ${PREFIX}/test DIST_DIR = ${PREFIX}/dist -MODULES = ${SRC_DIR}/jquery/*\ +MODULES = ${SRC_DIR}/intro.js\ + ${SRC_DIR}/jquery/*\ ${SRC_DIR}/event/*\ ${SRC_DIR}/fx/*\ ${SRC_DIR}/ajax/* + ${SRC_DIR}/outro.js\ JQ = ${DIST_DIR}/jquery.js JQ_LITE = ${DIST_DIR}/jquery.lite.js diff --git a/build.xml b/build.xml index 1c85a8cdc..7cf2ab93d 100644 --- a/build.xml +++ b/build.xml @@ -17,11 +17,13 @@ - + + - + + diff --git a/src/intro.js b/src/intro.js new file mode 100644 index 000000000..c26ac36cf --- /dev/null +++ b/src/intro.js @@ -0,0 +1,2 @@ +/* prevent execution of jQuery if included more then once */ +if(typeof window.jQuery == "undefined") { diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index b094acf08..9b5bf8d44 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -28,7 +28,7 @@ window.undefined = window.undefined; * @name jQuery * @cat Core */ -function jQuery(a,c) { +jQuery = function(a,c) { // Shortcut for document ready (because $(document).each() is silly) if ( a && a.constructor == Function && jQuery.fn.ready ) @@ -67,7 +67,7 @@ function jQuery(a,c) { // If so, execute it in context if ( fn && fn.constructor == Function ) this.each(fn); -} +}; // Map over the $ in case of overwrite if ( typeof $ != "undefined" ) diff --git a/src/outro.js b/src/outro.js new file mode 100644 index 000000000..deda25d3e --- /dev/null +++ b/src/outro.js @@ -0,0 +1 @@ +} // close: if(typeof window.jQuery == "undefined") { \ No newline at end of file