Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/jquery/jquery into bug_2773
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Feb 26, 2011
2 parents ed48787 + 71bd828 commit 9e5ec37
Show file tree
Hide file tree
Showing 70 changed files with 1,738 additions and 15,277 deletions.
39 changes: 26 additions & 13 deletions Makefile
Expand Up @@ -9,6 +9,7 @@ DIST_DIR = ${PREFIX}/dist


JS_ENGINE ?= `which node nodejs` JS_ENGINE ?= `which node nodejs`
COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js


BASE_FILES = ${SRC_DIR}/core.js\ BASE_FILES = ${SRC_DIR}/core.js\
${SRC_DIR}/support.js\ ${SRC_DIR}/support.js\
Expand Down Expand Up @@ -43,7 +44,7 @@ VER = sed "s/@VERSION/${JQ_VER}/"


DATE=$(shell git log -1 --pretty=format:%ad) DATE=$(shell git log -1 --pretty=format:%ad)


all: init jquery min lint all: jquery min lint
@@echo "jQuery build complete." @@echo "jQuery build complete."


${DIST_DIR}: ${DIST_DIR}:
Expand All @@ -68,12 +69,16 @@ define clone_or_pull


endef endef


init: ${QUNIT_DIR}:
$(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git) $(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git)

${SIZZLE_DIR}:
$(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git) $(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git)


jquery: ${JQ} init: ${QUNIT_DIR} ${SIZZLE_DIR}
jq: ${JQ}
jquery: init ${JQ}
jq: init ${JQ}


${JQ}: ${MODULES} | ${DIST_DIR} ${JQ}: ${MODULES} | ${DIST_DIR}
@@echo "Building" ${JQ} @@echo "Building" ${JQ}
Expand All @@ -88,18 +93,26 @@ ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
@@echo "Building selector code from Sizzle" @@echo "Building selector code from Sizzle"
@@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js @@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js


lint: ${JQ} lint: jquery
@@echo "Checking jQuery against JSLint..." @@if test ! -z ${JS_ENGINE}; then \
@@${JS_ENGINE} build/jslint-check.js echo "Checking jQuery against JSLint..."; \
${JS_ENGINE} build/jslint-check.js; \
else \
echo "You must have NodeJS installed in order to test jQuery against JSLint."; \
fi


min: ${JQ_MIN} min: ${JQ_MIN}


${JQ_MIN}: ${JQ} ${JQ_MIN}: jquery
@@echo "Building" ${JQ_MIN} @@if test ! -z ${JS_ENGINE}; then \
@@${COMPILER} ${JQ} > ${JQ_MIN}.tmp echo "Minifying jQuery" ${JQ_MIN}; \
@@echo ";" >> ${JQ_MIN}.tmp ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
@@sed 's/\*\/(/*\/ʩ(/' ${JQ_MIN}.tmp | tr "ʩ" "\n" > ${JQ_MIN} ${POST_COMPILER} ${JQ_MIN}.tmp > ${JQ_MIN}; \
@@rm -rf ${JQ_MIN}.tmp rm -f ${JQ_MIN}.tmp; \
else \
echo "You must have NodeJS installed in order to minify jQuery."; \
fi



clean: clean:
@@echo "Removing Distribution directory:" ${DIST_DIR} @@echo "Removing Distribution directory:" ${DIST_DIR}
Expand Down
7 changes: 7 additions & 0 deletions build/post-compile.js
@@ -0,0 +1,7 @@
#!/usr/bin/env node

var print = require("sys").print,
src = require("fs").readFileSync(process.argv[2], "utf8");

// Previously done in sed but reimplemented here due to portability issues
print(src.replace(/^(\s*\*\/)(.+)/m, "$1\n$2;"));
6 changes: 2 additions & 4 deletions speed/jquery-basis.js
Expand Up @@ -524,11 +524,9 @@ jQuery.extend({
if ( data && rnotwhite.test(data) ) { if ( data && rnotwhite.test(data) ) {
// Inspired by code by Andrea Giammarchi // Inspired by code by Andrea Giammarchi
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
var head = document.getElementsByTagName("head")[0] || document.documentElement, var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement,
script = document.createElement("script"); script = document.createElement("script");


script.type = "text/javascript";

if ( jQuery.support.scriptEval ) { if ( jQuery.support.scriptEval ) {
script.appendChild( document.createTextNode( data ) ); script.appendChild( document.createTextNode( data ) );
} else { } else {
Expand Down Expand Up @@ -5060,7 +5058,7 @@ jQuery.extend({
// If we're requesting a remote document // If we're requesting a remote document
// and trying to load JSON or Script with a GET // and trying to load JSON or Script with a GET
if ( s.dataType === "script" && type === "GET" && remote ) { if ( s.dataType === "script" && type === "GET" && remote ) {
var head = document.getElementsByTagName("head")[0] || document.documentElement; var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
var script = document.createElement("script"); var script = document.createElement("script");
script.src = s.url; script.src = s.url;
if ( s.scriptCharset ) { if ( s.scriptCharset ) {
Expand Down

0 comments on commit 9e5ec37

Please sign in to comment.