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") { ... }

This commit is contained in:
Jörn Zaefferer 2006-09-15 14:51:55 +00:00
parent ea53a61a38
commit 770a92a594
5 changed files with 12 additions and 5 deletions

View File

@ -6,10 +6,12 @@ DOCS_DIR = ${PREFIX}/docs
TEST_DIR = ${PREFIX}/test TEST_DIR = ${PREFIX}/test
DIST_DIR = ${PREFIX}/dist DIST_DIR = ${PREFIX}/dist
MODULES = ${SRC_DIR}/jquery/*\ MODULES = ${SRC_DIR}/intro.js\
${SRC_DIR}/jquery/*\
${SRC_DIR}/event/*\ ${SRC_DIR}/event/*\
${SRC_DIR}/fx/*\ ${SRC_DIR}/fx/*\
${SRC_DIR}/ajax/* ${SRC_DIR}/ajax/*
${SRC_DIR}/outro.js\
JQ = ${DIST_DIR}/jquery.js JQ = ${DIST_DIR}/jquery.js
JQ_LITE = ${DIST_DIR}/jquery.lite.js JQ_LITE = ${DIST_DIR}/jquery.lite.js

View File

@ -17,11 +17,13 @@
<target name="jquery"> <target name="jquery">
<echo message="Building ${JQ}" /> <echo message="Building ${JQ}" />
<mkdir dir="${DIST_DIR}" /> <mkdir dir="${DIST_DIR}" />
<concat destfile="${JQ}"> <concat destfile="${JQ}">
<fileset dir="${SRC_DIR}" includes="intro.js" />
<fileset dir="${SRC_DIR}" includes="jquery/*.js" /> <fileset dir="${SRC_DIR}" includes="jquery/*.js" />
<fileset dir="${SRC_DIR}" includes="event/*.js" /> <fileset dir="${SRC_DIR}" includes="event/*.js" />
<fileset dir="${SRC_DIR}" includes="fx/*.js" /> <fileset dir="${SRC_DIR}" includes="fx/*.js" />
<fileset dir="${SRC_DIR}" includes="ajax/*.js" /> <fileset dir="${SRC_DIR}" includes="ajax/*.js" />
<fileset dir="${SRC_DIR}" includes="outro.js" />
</concat> </concat>
<echo message="${JQ} built." /> <echo message="${JQ} built." />
</target> </target>

2
src/intro.js Normal file
View File

@ -0,0 +1,2 @@
/* prevent execution of jQuery if included more then once */
if(typeof window.jQuery == "undefined") {

View File

@ -28,7 +28,7 @@ window.undefined = window.undefined;
* @name jQuery * @name jQuery
* @cat Core * @cat Core
*/ */
function jQuery(a,c) { jQuery = function(a,c) {
// Shortcut for document ready (because $(document).each() is silly) // Shortcut for document ready (because $(document).each() is silly)
if ( a && a.constructor == Function && jQuery.fn.ready ) if ( a && a.constructor == Function && jQuery.fn.ready )
@ -67,7 +67,7 @@ function jQuery(a,c) {
// If so, execute it in context // If so, execute it in context
if ( fn && fn.constructor == Function ) if ( fn && fn.constructor == Function )
this.each(fn); this.each(fn);
} };
// Map over the $ in case of overwrite // Map over the $ in case of overwrite
if ( typeof $ != "undefined" ) if ( typeof $ != "undefined" )

1
src/outro.js Normal file
View File

@ -0,0 +1 @@
} // close: if(typeof window.jQuery == "undefined") {