Skip to content
Permalink
Browse files
Merge branch 'master' of git://github.com/jquery/jquery into bug_2773
  • Loading branch information
timmywil committed Feb 26, 2011
2 parents ed48787 + 71bd828 commit 9e5ec378e35a04f123e82cb1cb5b3eb45254f6f4
Showing 70 changed files with 1,738 additions and 15,277 deletions.
@@ -9,6 +9,7 @@ DIST_DIR = ${PREFIX}/dist

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

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

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

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

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

endef

init:
${QUNIT_DIR}:
$(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)

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

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

${JQ}: ${MODULES} | ${DIST_DIR}
@@echo "Building" ${JQ}
@@ -88,18 +93,26 @@ ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
@@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

lint: ${JQ}
@@echo "Checking jQuery against JSLint..."
@@${JS_ENGINE} build/jslint-check.js
lint: jquery
@@if test ! -z ${JS_ENGINE}; then \
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}

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


clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}
@@ -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;"));
@@ -524,11 +524,9 @@ jQuery.extend({
if ( data && rnotwhite.test(data) ) {
// Inspired by code by Andrea Giammarchi
// 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.type = "text/javascript";

if ( jQuery.support.scriptEval ) {
script.appendChild( document.createTextNode( data ) );
} else {
@@ -5060,7 +5058,7 @@ jQuery.extend({
// If we're requesting a remote document
// and trying to load JSON or Script with a GET
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");
script.src = s.url;
if ( s.scriptCharset ) {

0 comments on commit 9e5ec37

Please sign in to comment.