Permalink
Browse files

Merge branch 'master' into popup-widget

  • Loading branch information...
gabrielschulhof committed May 17, 2012
2 parents f2b23eb + 4b401fe commit 5692aef938d72985abd12ce90b11d89415a4fd34
Showing with 976 additions and 310 deletions.
  1. +3 −0 .gitignore
  2. +24 −181 Makefile
  3. +8 −0 README.md
  4. +4 −0 build/bin/build_latest.sh
  5. +4 −0 build/bin/clean.sh
  6. +56 −0 build/bin/config.sh
  7. +35 −0 build/bin/css.sh
  8. +20 −0 build/bin/deploy.sh
  9. +4 −0 build/bin/deploy_latest.sh
  10. +3 −0 build/bin/deploy_nightlies.sh
  11. +29 −0 build/bin/docs.sh
  12. +3 −0 build/bin/init.sh
  13. +26 −0 build/bin/js.sh
  14. +12 −0 build/bin/zip.sh
  15. +103 −0 build/config.js
  16. +10 −0 build/tasks/clean.js
  17. +116 −0 build/tasks/css.js
  18. +11 −0 build/tasks/custom_init.js
  19. +63 −0 build/tasks/js.js
  20. +59 −0 build/tasks/legacy.js
  21. +1 −1 css/structure/jquery.mobile.button.css
  22. +1 −1 css/structure/jquery.mobile.forms.select.css
  23. +2 −2 css/structure/jquery.mobile.transition.css
  24. +1 −1 css/themes/default/jquery.mobile.theme.css
  25. +5 −1 docs/api/data-attributes.html
  26. +6 −5 docs/api/events.html
  27. +1 −1 docs/api/globalconfig.html
  28. +0 −3 docs/buttons/buttons-types.html
  29. +3 −3 docs/lists/docs-lists.html
  30. +1 −1 docs/pages/dialog.html
  31. +2 −0 docs/pages/page-anatomy.html
  32. +1 −0 docs/pages/page-navmodel.html
  33. +1 −1 docs/toolbars/docs-headers.html
  34. +56 −0 grunt.js
  35. +1 −1 js/jquery.mobile.controlGroup.js
  36. +6 −1 js/jquery.mobile.dialog.js
  37. +7 −4 js/jquery.mobile.forms.button.js
  38. +1 −1 js/jquery.mobile.forms.checkboxradio.js
  39. +13 −18 js/jquery.mobile.forms.select.custom.js
  40. +12 −7 js/jquery.mobile.listview.js
  41. +13 −13 js/jquery.mobile.loader.js
  42. +4 −3 js/jquery.mobile.navigation.js
  43. +9 −2 js/jquery.mobile.navigation.pushstate.js
  44. +8 −5 js/jquery.mobile.page.sections.js
  45. +26 −26 js/jquery.mobile.transition.js
  46. +24 −14 js/jquery.tag.inserter.js
  47. +21 −0 package.json
  48. +4 −4 tests/unit/checkboxradio/checkboxradio_core.js
  49. +15 −0 tests/unit/dialog/dialog-no-hash.html
  50. +43 −0 tests/unit/dialog/dialog_no_hash.js
  51. +54 −0 tests/unit/dialog/no-hash-tests.html
  52. +2 −2 tests/unit/jquery.setNameSpace.js
  53. +16 −1 tests/unit/listview/index.html
  54. +16 −0 tests/unit/listview/listview_core.js
  55. +4 −1 tests/unit/page-sections/index.html
  56. +3 −6 tests/unit/widget/widget_core.js
View
@@ -13,3 +13,6 @@ tmp/
# branch preview
branches
+
+# node build dependencies
+node_modules
View
205 Makefile
@@ -1,221 +1,64 @@
-# Helper Variables
-# The command to replace the @VERSION in the files with the actual version
-HEAD_SHA = $(shell git log -1 --format=format:"%H")
-VER = sed "s/v@VERSION/$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd")/"
-VER_MIN = "/*! jQuery Mobile v$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd") jquerymobile.com | jquery.org/license */"
-VER_OFFICIAL = $(shell cat version.txt)
-SED_VER_REPLACE = 's/__version__/"${VER_OFFICIAL}"/g'
-SED_VER_API = sed ${SED_VER_REPLACE}
-SED_INPLACE_EXT = "whyunowork"
-deploy: VER = sed "s/v@VERSION/${VER_OFFICIAL} ${HEAD_SHA}/"
-deploy: VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} ${HEAD_SHA} jquerymobile.com | jquery.org/license */"
+# in build/bin/config.sh this setting will alter the variable definitions to match
+# the changes for the deploy target in the makefile. temp solution
+ARGS = IS_DEPLOY_TARGET=false
+deploy: ARGS = IS_DEPLOY_TARGET=true
# The output folder for the finished files
OUTPUT = compiled
-# The name of the files
-NAME = jquery.mobile
-BASE_NAME = jquery.mobile
-THEME_FILENAME = jquery.mobile.theme
-STRUCTURE = jquery.mobile.structure
-deploy: NAME = jquery.mobile-${VER_OFFICIAL}
-deploy: THEME_FILENAME = jquery.mobile.theme-${VER_OFFICIAL}
-deploy: STRUCTURE = jquery.mobile.structure-${VER_OFFICIAL}
-
-# The CSS theme being used
-THEME = default
-
-# If node is available then use node to run r.js
-# otherwise use good old rhino/java
-NODE = /usr/local/bin/node
-HAS_NODE = $(shell if test -x ${NODE} ;then echo true; fi)
-
-ifeq ($(HAS_NODE), true)
- RUN_JS = @@${NODE}
-else
- RUN_JS = @@java -XX:ReservedCodeCacheSize=64m -classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main
-endif
-
# Build Targets
-
# When no build target is specified, all gets ran
all: css js zip notify
-clean:
- # -------------------------------------------------
- # Cleaning build output
- @@rm -rf ${OUTPUT}
- @@rm -rf tmp
+clean: init
+ @@node node_modules/.bin/grunt clean
# Create the output directory.
+# NOTE it doesn't appear as though you can override init from a task file
init:
- @@mkdir -p ${OUTPUT}
+ @@if ! (node -v | grep "\(v0.[6-9]\|v[1-9].[0-9]\)" > /dev/null); then echo "!!! node.js ~> 0.6.x required" && exit 1; fi
+ @@npm install
+ @@node node_modules/.bin/grunt custom_init
# Build and minify the CSS files
css: init
- # Build the CSS file with the theme included
- ${RUN_JS} \
- external/r.js/dist/r.js \
- -o cssIn=css/themes/default/jquery.mobile.css \
- optimizeCss=standard.keepComments.keepLines \
- out=${OUTPUT}/${NAME}.compiled.css
- @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.css
- @@cat ${OUTPUT}/${NAME}.compiled.css >> ${OUTPUT}/${NAME}.css
- @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css
- @@java -XX:ReservedCodeCacheSize=64m \
- -jar build/yuicompressor-2.4.6.jar \
- --type css ${OUTPUT}/${NAME}.compiled.css >> ${OUTPUT}/${NAME}.min.css
- @@rm ${OUTPUT}/${NAME}.compiled.css
- # Build the CSS Structure-only file
- ${RUN_JS} \
- external/r.js/dist/r.js \
- -o cssIn=css/structure/jquery.mobile.structure.css \
- out=${OUTPUT}/${STRUCTURE}.compiled.css
- @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${STRUCTURE}.css
- @@cat ${OUTPUT}/${STRUCTURE}.compiled.css >> ${OUTPUT}/${STRUCTURE}.css
- # ..... and then minify it
- @@echo ${VER_MIN} > ${OUTPUT}/${STRUCTURE}.min.css
- @@java -XX:ReservedCodeCacheSize=64m \
- -jar build/yuicompressor-2.4.6.jar \
- --type css ${OUTPUT}/${STRUCTURE}.compiled.css >> ${OUTPUT}/${STRUCTURE}.min.css
- @@rm ${OUTPUT}/${STRUCTURE}.compiled.css
- # Build the theme only file
- @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${THEME_FILENAME}.css
- @@cat css/themes/default/jquery.mobile.theme.css >> ${OUTPUT}/${THEME_FILENAME}.css
- # ..... and then minify it
- @@echo ${VER_MIN} > ${OUTPUT}/${THEME_FILENAME}.min.css
- @@java -XX:ReservedCodeCacheSize=64m \
- -jar build/yuicompressor-2.4.6.jar \
- --type css ${OUTPUT}/${THEME_FILENAME}.css >> ${OUTPUT}/${THEME_FILENAME}.min.css
- # Copy in the images
- @@cp -R css/themes/${THEME}/images ${OUTPUT}/
- # Css portion is complete.
- # -------------------------------------------------
-
-
-docs: init js css
- # Create the Demos/Docs/Tests/Tools
- # ... Create staging directories
- @@mkdir -p tmp/demos/js
- @@mkdir -p tmp/demos/css/themes/${THEME}
- # ... Copy script files
- @@cp compiled/*.js tmp/demos/js
- @@cp js/jquery.js tmp/demos/js
- # ... Copy html files
- @@cp index.html tmp/demos
- @@cp -r docs tmp/demos
- # ... Copy css and images
- @@cp compiled/*.css tmp/demos/css/themes/${THEME}
- @@cp -r compiled/images tmp/demos/css/themes/${THEME}
- # ... replace "js/" with "js/jquery.mobile.js"
- @@ # NOTE the deletion here is required by gnu/bsd sed differences
- @@find tmp/demos \( -name '*.html' -o -name '*.php' \) -exec sed -i${SED_INPLACE_EXT} -e 's@js/"@js/${NAME}.js"@' {} \;
- @@find tmp/demos -name "*${SED_INPLACE_EXT}" -exec rm {} \;
- @@ # make sure the docs reference the right css file names (for deploy)
- @@find tmp/demos \( -name '*.html' -o -name '*.php' \) -exec sed -i${SED_INPLACE_EXT} -e 's@${BASE_NAME}.css"@${NAME}.css"@' {} \;
- @@find tmp/demos -name "*${SED_INPLACE_EXT}" -exec rm {} \;
- # ... Move and zip up the the whole folder
- @@rm -f ${OUTPUT}/${BASE_NAME}.docs.zip
- @@cd tmp/demos && zip -rq ../../${OUTPUT}/${NAME}.docs.zip *
- @@rm -rf ${OUTPUT}/demos && mv -f tmp/demos ${OUTPUT}
- # Finish by removing the temporary files
- @@rm -rf tmp
- # -------------------------------------------------
+ @@node node_modules/.bin/grunt css
# Build and minify the JS files
js: init
- # Build the JavaScript file
- ${RUN_JS} \
- external/r.js/dist/r.js \
- -o baseUrl="js" \
- name=jquery.mobile \
- exclude=jquery,../external/requirejs/order,../external/requirejs/depend,../external/requirejs/text,../external/requirejs/text!../version.txt \
- out=${OUTPUT}/${NAME}.compiled.js \
- pragmasOnSave.jqmBuildExclude=true \
- wrap.startFile=build/wrap.start \
- wrap.endFile=build/wrap.end \
- findNestedDependencies=true \
- skipModuleInsertion=true \
- optimize=none
- @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.js
- @@cat ${OUTPUT}/${NAME}.compiled.js | ${SED_VER_API} >> ${OUTPUT}/${NAME}.js
- @@rm ${OUTPUT}/${NAME}.compiled.js
- # ..... and then minify it
- @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js
- @@java -XX:ReservedCodeCacheSize=64m \
- -jar build/google-compiler-20111003.jar \
- --js ${OUTPUT}/${NAME}.js \
- --js_output_file ${OUTPUT}/${NAME}.compiled.js
- @@cat ${OUTPUT}/${NAME}.compiled.js >> ${OUTPUT}/${NAME}.min.js
- @@rm ${OUTPUT}/${NAME}.compiled.js
- # -------------------------------------------------
+ @@node node_modules/.bin/grunt js
+# -------------------------------------------------
+#
+# For jQuery Team Use Only
+#
+# -------------------------------------------------
+docs: init js css
+ @@${ARGS} bash build/bin/docs.sh
# Output a message saying the process is complete
notify: init
@@echo "The files have been built and are in: " $$(pwd)/${OUTPUT}
- # -------------------------------------------------
# Zip up the jQm files without docs
zip: init css js
- # Packaging up the files into a zip archive
- @@mkdir tmp
- @@cp -R ${OUTPUT} tmp/${NAME}
- # ... And remove the Zipped docs so they aren't included twice (for deploy scripts)
- @@rm -rf tmp/${NAME}/*.zip
- @@cd tmp; zip -rq ../${OUTPUT}/${NAME}.zip ${NAME}
- @@rm -rf tmp
- # -------------------------------------------------
+ @@${ARGS} bash build/bin/zip.sh
-# -------------------------------------------------
-# -------------------------------------------------
-# -------------------------------------------------
-#
-# For jQuery Team Use Only
-#
-# -------------------------------------------------
-# NOTE the clean (which removes previous build output) has been removed to prevent a gap in service
build_latest: css docs js zip
- # ... Copy over the lib js, avoid the compiled stuff, to get the defines for tests/unit/*
- @@ # TODO centralize list of built files
- @@find js -name "*.js" -not -name "*.docs.js" -not -name "*.mobile.js" | xargs -L1 -I FILENAME cp FILENAME ${OUTPUT}/demos/js/
+ @@${ARGS} bash build/bin/build_latest.sh
# Push the latest git version to the CDN. This is done on a post commit hook
deploy_latest:
- # Time to put these on the CDN
- @@scp -qr ${OUTPUT}/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/latest/
- # -------------------------------------------------
+ @@${ARGS} bash build/bin/deploy_latest.sh
# TODO target name preserved to avoid issues during refactor, latest -> deploy_latest
latest: build_latest deploy_latest
# Push the nightly backups. This is done on a server cronjob
deploy_nightlies:
- # Time to put these on the CDN
- @@scp -qr ${OUTPUT} jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/$$(date "+%Y%m%d")
- # -------------------------------------------------
+ @@${ARGS} bash build/bin/deploy_nightlies.sh
# Deploy a finished release. This is manually done.
deploy: clean init css js docs zip
- # Deploying all the files to the CDN
- @@mkdir tmp
- @@cp -R ${OUTPUT} tmp/${VER_OFFICIAL}
- @@scp -qr tmp/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/
- @@rm -rf tmp/${VER_OFFICIAL}
- @@mv ${OUTPUT}/demos tmp/${VER_OFFICIAL}
- # Create the Demos/Docs/Tests/Tools for jQueryMobile.com
- # ... By first replacing the paths
- @@ # TODO update jQuery Version replacement on deploy
- @@find tmp/${VER_OFFICIAL} -type f \
- \( -name '*.html' -o -name '*.php' \) \
- -exec perl -pi -e \
- 's|src="(.*)${BASE_NAME}.js"|src="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.js"|g;s|href="(.*)${BASE_NAME}.css"|href="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.css"|g;s|src="(.*)jquery.js"|src="//code.jquery.com/jquery-1.7.1.min.js"|g' {} \;
- # ... So they can be copied to jquerymobile.com
- @@scp -qr tmp/* jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/
- # Do some cleanup to wrap it up
- @@rm -rf tmp
- @@rm -rf ${OUTPUT}
- # -------------------------------------------------
-
-
+ @@${ARGS} bash build/bin/deploy.sh
View
@@ -15,6 +15,13 @@ Clone this repo and build the js and css files (you'll need Git and Make install
A full version and a minified version of the jQuery Mobile JavaScript and CSS files will be created
in a folder named "compiled". There is also now a Structure only css file so you can add your own theme on top of it.
+Alternatively if you have node.js installed you can run
+
+ npm install
+ node node_modules/.bin/grunt <js|css>
+
+to build either the js or css. This is usefull especially if you're on Windows without support for the make tool and bash.
+
How to build a self-contained version of the Docs/Demos
=======================================================
Once you have your own cloned repo on your computer:
@@ -25,6 +32,7 @@ The docs will be built and available in the compiled/demos folder. You can move
other location. It has no dependencies on anything other than a basic HTML web server.
+
Submitting bugs
===============
If you think you've found a bug, please report it by following these instructions:
@@ -0,0 +1,4 @@
+source build/bin/config.sh
+
+# Copy over the lib js, avoid the compiled stuff, to get the defines for tests/unit/*
+find js -name "*.js" -not -name "*.docs.js" -not -name "*.mobile.js" | xargs -L1 -I FILENAME cp FILENAME $OUTPUT/demos/js/
View
@@ -0,0 +1,4 @@
+source build/bin/config.sh
+
+rm -rf $OUTPUT
+rm -rf tmp
View
@@ -0,0 +1,56 @@
+# fail on any subcommand failure
+set -e
+
+# Helper Variables
+# The command to replace the @VERSION in the files with the actual version
+HEAD_SHA=$(git log -1 --format=format:"%H")
+BUILD_SHA=$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd")
+VER_MIN="/*! jQuery Mobile v$BUILD_SHA jquerymobile.com | jquery.org/license !*/"
+VER_OFFICIAL=$(cat version.txt)
+SED_VER_REPLACE="s/__version__/\"$VER_OFFICIAL\"/g"
+SED_INPLACE_EXT="whyunowork"
+
+function sed_ver_api {
+ sed "$SED_VER_REPLACE"
+}
+
+function ver {
+ sed "s/v@VERSION/$BUILD_SHA/"
+}
+
+function clear_zip_files {
+ find $1 -name "*.zip" | xargs -L1 -I FILENAME rm FILENAME
+}
+
+# The output folder for the finished files
+OUTPUT="compiled"
+
+# The name of the files
+NAME="jquery.mobile"
+BASE_NAME="jquery.mobile"
+THEME_FILENAME="jquery.mobile.theme"
+STRUCTURE="jquery.mobile.structure"
+
+# The CSS theme being used
+THEME="default"
+
+# If node is available then use node to run r.js
+# otherwise use good old rhino/java
+NODE=/usr/local/bin/node
+
+RUN_JS='java -XX:ReservedCodeCacheSize=64m -classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main'
+
+if [ -x $NODE ]; then
+ RUN_JS=${NODE}
+fi
+
+if [ $IS_DEPLOY_TARGET = "true" ]; then
+ function ver {
+ sed "s/v@VERSION/${VER_OFFICIAL} ${HEAD_SHA}/"
+ }
+
+ VER_MIN="/*! jQuery Mobile v${VER_OFFICIAL} ${HEAD_SHA} jquerymobile.com | jquery.org/license !*/"
+ NAME="jquery.mobile-${VER_OFFICIAL}"
+ THEME_FILENAME="jquery.mobile.theme-${VER_OFFICIAL}"
+ STRUCTURE="jquery.mobile.structure-${VER_OFFICIAL}"
+fi
View
@@ -0,0 +1,35 @@
+source build/bin/config.sh
+
+# Build the CSS file with the theme included
+$RUN_JS \
+ external/r.js/dist/r.js \
+ -o cssIn=css/themes/default/jquery.mobile.css \
+ optimizeCss=standard.keepComments.keepLines \
+ out=$OUTPUT/$NAME.compiled.css
+cat LICENSE-INFO.txt | ver > $OUTPUT/$NAME.css
+cat $OUTPUT/$NAME.compiled.css >> $OUTPUT/$NAME.css
+echo $VER_MIN > $OUTPUT/$NAME.min.css
+java -XX:ReservedCodeCacheSize=64m -jar build/yuicompressor-2.4.6.jar --type css $OUTPUT/$NAME.compiled.css >> $OUTPUT/$NAME.min.css
+rm $OUTPUT/$NAME.compiled.css
+# Build the CSS Structure-only file
+$RUN_JS external/r.js/dist/r.js \
+ -o cssIn=css/structure/jquery.mobile.structure.css \
+ out=$OUTPUT/$STRUCTURE.compiled.css
+cat LICENSE-INFO.txt | ver > $OUTPUT/$STRUCTURE.css
+cat $OUTPUT/$STRUCTURE.compiled.css >> $OUTPUT/$STRUCTURE.css
+# ..... and then minify it
+echo $VER_MIN > $OUTPUT/$STRUCTURE.min.css
+java -XX:ReservedCodeCacheSize=64m \
+ -jar build/yuicompressor-2.4.6.jar \
+ --type css $OUTPUT/$STRUCTURE.compiled.css >> $OUTPUT/$STRUCTURE.min.css
+rm $OUTPUT/$STRUCTURE.compiled.css
+# Build the theme only file
+cat LICENSE-INFO.txt | ver > $OUTPUT/$THEME_FILENAME.css
+cat css/themes/default/jquery.mobile.theme.css >> $OUTPUT/$THEME_FILENAME.css
+# ..... and then minify it
+echo $VER_MIN > $OUTPUT/$THEME_FILENAME.min.css
+java -XX:ReservedCodeCacheSize=64m \
+ -jar build/yuicompressor-2.4.6.jar \
+ --type css $OUTPUT/$THEME_FILENAME.css >> $OUTPUT/$THEME_FILENAME.min.css
+# Copy in the images
+cp -R css/themes/$THEME/images $OUTPUT/
Oops, something went wrong.

0 comments on commit 5692aef

Please sign in to comment.