diff --git a/.gitignore b/.gitignore index ad8d0959..e2dec537 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,6 @@ cache/ combined/ combine/ compiled/ -gitstatus.log -refreshCDN *.swp .gitignore tests/speed/stats/stats.db diff --git a/GPL-LICENSE.txt b/GPL-LICENSE.txt new file mode 100644 index 00000000..11dddd00 --- /dev/null +++ b/GPL-LICENSE.txt @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/LICENSE-INFO.txt b/LICENSE-INFO.txt new file mode 100644 index 00000000..4b990893 --- /dev/null +++ b/LICENSE-INFO.txt @@ -0,0 +1,9 @@ +/* +* jQuery Mobile Framework v@VERSION +* http://jquerymobile.com +* +* Copyright 2011 (c) jQuery Project +* Dual licensed under the MIT or GPL Version 2 licenses. +* http://jquery.org/license +* +*/ diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt new file mode 100644 index 00000000..53270463 --- /dev/null +++ b/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2011 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile index 55f403e8..7c78838d 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,3 @@ -# The system generated date in YYYYMMDD format -DATE = $(shell date "+%Y%m%d") - -# The version according to the source file. If this is the nightly build, use a different version -VER = $(shell cat version.txt) - -# The command to replace the @VERSION in the files with the actual version -SED_VER = sed "s/@VERSION/$(shell git log -1 --format=format:" Git > Date: %cd Info SHA1: %H")/" -deploy: SED_VER = sed "s/@VERSION/${VER}/" -MIN_VER = "/*! jQuery Mobile v@VERSION jquerymobile.com | jquery.org/license */" - -# The version of jQuery core used -JQUERY = $(shell grep Library js/jquery.js | sed s'/ \* jQuery JavaScript Library v//') - -# The directory to create the zipped files in and also serves as the filenames -DIR = jquery.mobile-${VER} -STRUCTUREFILE = jquery.mobile.structure-${VER} -nightly: DIR = jquery.mobile - -# The output folder for the finished files -OUTPUT = compiled - -# Command to remove the latest directory from the CDN before uploading, only if using latest target -RMLATEST = echo "" - -# The output folder for the nightly files. -NIGHTLY_OUTPUT = nightlies/${DATE} -ifeq (${NIGHTLY_OUTPUT}, latest) - RMLATEST = ssh jqadmin@code.origin.jquery.com 'rm -rf /var/www/html/code.jquery.com/mobile/latest' -endif -NIGHTLY_WEBPATH = http://code.jquery.com/mobile/${NIGHTLY_OUTPUT} - -# The filenames -JS = ${DIR}.js -MIN = ${DIR}.min.js -CSS = ${DIR}.css -CSSMIN = ${DIR}.min.css -CSSSTRUCTURE = ${STRUCTUREFILE}.css -CSSSTRUCTUREMIN = ${STRUCTUREFILE}.min.css -CSSTHEME = default - # The files to include when compiling the JS files JSFILES = js/jquery.ui.widget.js \ js/jquery.mobile.widget.js \ @@ -75,8 +34,8 @@ JSFILES = js/jquery.ui.widget.js \ js/jquery.mobile.fixHeaderFooter.native.js \ js/jquery.mobile.init.js -CSSTHEMEFILES = css/themes/${CSSTHEME}/jquery.mobile.theme.css -CSSSTRUCTUREFILES = css/structure/jquery.mobile.core.css \ +# The files to include when compiling the CSS files +CSSFILES = css/structure/jquery.mobile.core.css \ css/structure/jquery.mobile.transitions.css \ css/structure/jquery.mobile.grids.css \ css/structure/jquery.mobile.headerfooter.css \ @@ -91,129 +50,154 @@ CSSSTRUCTUREFILES = css/structure/jquery.mobile.core.css \ css/structure/jquery.mobile.forms.textinput.css \ css/structure/jquery.mobile.listview.css \ css/structure/jquery.mobile.forms.slider.css +CSSTHEMEFILES = css/themes/${THEME}/jquery.mobile.theme.css -# The files to include when compiling the CSS files -CSSFILES = ${CSSTHEMEFILES} ${CSSSTRUCTUREFILES} -# By default, this is what get runs when make is called without any arguments. -# Min and un-min CSS and JS files are the only things built -all: init js min css cssmin notify -# Build the normal CSS file. +# Helper Variables +# The command to replace the @VERSION in the files with the actual version +VER = sed "s/v@VERSION/$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd")/" +VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} jquerymobile.com | jquery.org/license */" +VER_OFFICIAL = $(shell cat version.txt) + +# The output folder for the finished files +OUTPUT = compiled + +# The name of the files +NAME = jquery.mobile +STRUCTURE = jquery.mobile.structure +deploy: NAME = jquery.mobile-${VER_OFFICIAL} +deploy: STRUCTURE = jquery.mobile.structure-${VER_OFFICIAL} + +# The CSS theme being used +THEME = default + + + + + +# Build Targets + +# When no build target is specified, all gets ran +all: init css js zip notify + + +# Build and minify the CSS files css: init - # Build the CSS file - @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${CSS} - @@cat ${CSSFILES} >> ${OUTPUT}/${CSS} - @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${CSSSTRUCTURE} - @@cat ${CSSSTRUCTUREFILES} >> ${OUTPUT}/${CSSSTRUCTURE} + # Build the CSS file with the theme included + @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.css + @@cat ${CSSTHEMEFILES} ${CSSFILES} >> ${OUTPUT}/${NAME}.css + # ..... and then minify it + @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css + @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${NAME}.css >> ${OUTPUT}/${NAME}.min.css + # Build the CSS Structure-only file + @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${STRUCTURE}.css + @@cat ${CSSFILES} >> ${OUTPUT}/${STRUCTURE}.css + # ..... and then minify it + @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.structure.min.css + @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${STRUCTURE}.css >> ${OUTPUT}/${STRUCTURE}.min.css + # ..... and then copy in the images + @@cp -R css/themes/${THEME}/images ${OUTPUT}/ + # Css portion is complete. + # ------------------------------------------------- -# Build the minified CSS file -cssmin: init css - # Build the minified CSS file - @@echo ${MIN_VER} | ${SED_VER} > ${OUTPUT}/${CSSMIN} - @@echo ${MIN_VER} | ${SED_VER} > ${OUTPUT}/${CSSSTRUCTUREMIN} - @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${CSS} >> ${OUTPUT}/${CSSMIN} - @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${CSSSTRUCTURE} >> ${OUTPUT}/${CSSSTRUCTUREMIN} -# Build the normal JS file -js: init - # Build the JavaScript file - @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${JS} - @@cat ${JSFILES} >> ${OUTPUT}/${JS} +docs: init css js + # Create the Demos/Docs/Tests/Tools + @@mkdir -p tmp/${NAME} + @@cp -r index.html docs experiments external js/jquery.js tests tmp/${NAME}/ + @@cp ${OUTPUT}/${NAME}.min.css ${OUTPUT}/${NAME}.min.js tmp/${NAME}/ + # ... Update the JavaScript and CSS paths + @@find tmp/${NAME} -type f \ + \( -name '*.html' -o -name '*.php' \) \ + -exec perl -pi -e \ + 's|js/"|${NAME}.min.js"|g;s|css/themes/default/|${NAME}.min.css|g;s|js/jquery.js"|jquery.js"|g' {} \; + # ... Move and zip up the the whole folder + @@zip -rq ${OUTPUT}/${NAME}.docs.zip tmp/${NAME} + @@mv tmp/${NAME} ${OUTPUT}/demos + # Finish by removing the temporary files + @@rm -rf tmp + # ------------------------------------------------- + # Create the output directory. This is in a separate step so its not dependant on other targets init: + # ------------------------------------------------- # Building jQuery Mobile in the "${OUTPUT}" folder @@rm -rf ${OUTPUT} - @@mkdir ${OUTPUT} + @@rm -rf tmp + @@mkdir -p ${OUTPUT} + # ------------------------------------------------- -# Build the minified JS file -min: init js - # Build the minified JavaScript file - @@echo ${MIN_VER} | ${SED_VER} > ${OUTPUT}/${MIN} - @@java -jar build/google-compiler-20111003.jar --js ${OUTPUT}/${JS} --warning_level QUIET --js_output_file ${MIN}.tmp - @@cat ${MIN}.tmp >> ${OUTPUT}/${MIN} - @@rm -f ${MIN}.tmp -# Let the user know the files were built and where they are -notify: +# Build and minify the JS files +js: init + # Build the JavaScript file + @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.js + @@cat ${JSFILES} >> ${OUTPUT}/${NAME}.js + # ..... and then minify it + @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js + @@java -jar build/google-compiler-20111003.jar --js ${OUTPUT}/${NAME}.js --warning_level QUIET >> ${OUTPUT}/${NAME}.min.js + # ------------------------------------------------- + + +# Output a message saying the process is complete +notify: init @@echo "The files have been built and are in: " $$(pwd)/${OUTPUT} - -# Pull the latest commits. This is used for the nightly build but can be used to save some keystrokes -pull: - @@git pull --quiet - -# Zip the 4 files and the theme images into one convenient package -zip: init js min css cssmin - @@mkdir -p ${DIR} - @@cp ${OUTPUT}/*.js ${DIR}/ - @@cp ${OUTPUT}/*.css ${DIR}/ - @@cp -R css/themes/${CSSTHEME}/images ${DIR}/ - @@zip -rq ${OUTPUT}/${DIR}.zip ${DIR} - @@rm -fr ${DIR} + # ------------------------------------------------- -# Used by the jQuery team to make the nightly builds -nightly: pull zip - # Create the folder to hold the files for the demos - @@mkdir -p ${VER} +# Zip up the jQm files without docs +zip: init css js + # Packaging up the files into a zip archive + @@zip -rq ${NAME}.tmp.zip ${OUTPUT} + @@mv ${NAME}.tmp.zip ${OUTPUT}/${NAME}.zip + # ------------------------------------------------- + - # Copy in the base stuff for the demos - @@cp -r index.html css experiments docs tools ${VER}/ - # First change all the paths from super deep to the same level for JS files - @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="../../../js|src="js|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="../../js|src="js|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="../js|src="js|g' {} \; - # Then change all the paths from super deep to the same level for CSS files - @@find ${VER} -type f -name '*.html' -exec sed -i 's|media="only all"||g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i 's|rel="stylesheet" href="../../../|rel="stylesheet" href="|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i 's|rel="stylesheet" href="../../|rel="stylesheet" href="|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i 's|rel="stylesheet" href="../|rel="stylesheet" href="|g' {} \; +# ------------------------------------------------- +# ------------------------------------------------- +# ------------------------------------------------- +# +# For jQuery Team Use Only +# +# ------------------------------------------------- - # Change the empty paths to the location of this nightly file - @@find ${VER} -type f -name '*.html' -exec sed -i 's|href="css/themes/${CSSTHEME}/"|href="${NIGHTLY_WEBPATH}/${DIR}.min.css"|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="js/jquery.js"|src="http://code.jquery.com/jquery-${JQUERY}.min.js"|' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="js/"|src="${NIGHTLY_WEBPATH}/${DIR}.min.js"|g' {} \; - - # Move the demos into the output folder - @@mv ${VER} ${OUTPUT}/demos - - # Copy the images as well - @@cp -R css/themes/${CSSTHEME}/images ${OUTPUT} - - @@${RMLATEST} - @@scp -r ${OUTPUT} jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/${NIGHTLY_OUTPUT} +# Push the latest git version to the CDN. This is done on a post commit hook +latest: init js css zip + # Time to put these on the CDN + @@scp -r ${OUTPUT}/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/latest/ + # Do some cleanup to wrap it up @@rm -rf ${OUTPUT} + # ------------------------------------------------- -# Used by the jQuery team to deploy a build to the CDN -deploy: zip - # Deploy to CDN - @@mv ${OUTPUT} ${VER} - @@scp -r ${VER} jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/ - @@mv ${VER} ${OUTPUT} +# Build the nightly backups. This is done on a server cronjob +nightlies: init js css zip docs + # Time to put these on the CDN + @@mkdir -p tmp/nightlies + @@mv ${OUTPUT} tmp/nightlies/$$(date "+%Y%m%d") + @@scp -r tmp/nightlies/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/ + # Do some cleanup to wrap it up + @@rm -rf tmp + # ------------------------------------------------- - # Deploy Demos to the jQueryMobile.com site - @@mkdir -p ${VER} - @@cp -r index.html css experiments docs tools ${VER}/ - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="../../../js|src="js|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="../../js|src="js|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="../js|src="js|g' {} \; +# Deploy a finished release. This is manually done. +deploy: init js css docs zip + # Deploying all the files to the CDN + @@mkdir tmp + @@cp -r ${OUTPUT} tmp/${VER_OFFICIAL} + @@scp -r tmp/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/ + @@rm -rf tmp/${VER_OFFICIAL} + # Create the Demos/Docs/Tests/Tools for jQueryMobile.com + @@mv ${OUTPUT}/demos tmp/${VER_OFFICIAL} + # ... And copied to the CDN and the jquerymobile.com server + @@scp -r tmp/* jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/ + # Do some cleanup to wrap it up + @@rm -rf tmp + @@rm -rf ${OUTPUT} + # ------------------------------------------------- - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|media="only all"||g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|rel="stylesheet" href="../../../|rel="stylesheet" href="|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|rel="stylesheet" href="../../|rel="stylesheet" href="|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|rel="stylesheet" href="../|rel="stylesheet" href="|g' {} \; - - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|href="css/themes/${CSSTHEME}/"|href="http://code.jquery.com/mobile/${VER}/${DIR}.min.css"|g' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="js/jquery.js"|src="http://code.jquery.com/jquery-${JQUERY}.min.js"|' {} \; - @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="js/"|src="http://code.jquery.com/mobile/${VER}/${DIR}.min.js"|g' {} \; - - @@scp -r ${VER} jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/ - - # Clean up the local files - @@rm -rf ${VER} - @@echo "All Done" diff --git a/README.md b/README.md index abd45ef9..fb4c2b50 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,16 @@ 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. +How to build a self-contained version of the Docs/Demos +======================================================= +Once you have your own cloned repo on your computer: + + make docs + +The docs will be built and available in the compiled/demos folder. You can move this folder to your web server or +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: @@ -77,9 +87,8 @@ theme's name. For testing locally, make sure the index.php file is copied as wel 2. Edit the `jquery.mobile.theme.css` file so it contains your custom fonts and colors. 3. Once you are done editing your files and saving them, open a terminal. 4. Navigate to the jQuery-Mobile folder's root. -5. Run the following command to build jQuery-Mobile. The CSSTHEME specifies what theme to include. If you leave it off, -it will build using the "default" theme. +5. Run the following command to build jQuery-Mobile (THEME is the name of the folder for your theme from step 1.): - make CSSTHEME=YourThemeName + make THEME=YourThemeName -6. The compiled files will be located in the "compiled" folder in the root of jQuery-Mobile. \ No newline at end of file +6. The compiled files will be located in the "compiled" folder in the root of jQuery-Mobile. diff --git a/css/structure/index.php b/css/structure/index.php index a6971970..ab08918d 100644 --- a/css/structure/index.php +++ b/css/structure/index.php @@ -1,5 +1,6 @@
+

Data- attribute reference

+

The jQuery Mobile framework uses HTML5 data- attributes to allow for markup-based initialization and configuration of widgets. These attributes are completely optional; calling plugins manually and passing options directly is also supported. To avoid naming conflicts with other plugins or frameworks that also use data- attributes, set a custom namespace by modifying the ns global option.

- + diff --git a/experiments/scrollview/lists-divider.html b/experiments/scrollview/lists-divider.html index 08207ba6..9a9ea0b7 100644 --- a/experiments/scrollview/lists-divider.html +++ b/experiments/scrollview/lists-divider.html @@ -20,7 +20,7 @@ } - + diff --git a/experiments/scrollview/scrollview-direction.html b/experiments/scrollview/scrollview-direction.html index beb5113e..26859af0 100644 --- a/experiments/scrollview/scrollview-direction.html +++ b/experiments/scrollview/scrollview-direction.html @@ -59,7 +59,7 @@ } - + diff --git a/experiments/scrollview/scrollview-nested.html b/experiments/scrollview/scrollview-nested.html index bc0ecd72..35f82851 100644 --- a/experiments/scrollview/scrollview-nested.html +++ b/experiments/scrollview/scrollview-nested.html @@ -83,7 +83,7 @@ - + diff --git a/experiments/scrollview/scrollview.js b/experiments/scrollview/scrollview.js index f033c784..cac968ed 100644 --- a/experiments/scrollview/scrollview.js +++ b/experiments/scrollview/scrollview.js @@ -1,8 +1,8 @@ function ResizePageContentHeight(page) { var $page = $(page), $content = $page.children( ".ui-content" ), - hh = $page.children( ".ui-header" ).outerHeight() : 0, - fh = $page.children( ".ui-footer" ).outerHeight() : 0, + hh = $page.children( ".ui-header" ).outerHeight() || 0, + fh = $page.children( ".ui-footer" ).outerHeight() || 0, pt = parseFloat($content.css( "padding-top" )), pb = parseFloat($content.css( "padding-bottom" )), wh = window.innerHeight; diff --git a/experiments/scrollview/sv-test-01.html b/experiments/scrollview/sv-test-01.html index 69f63754..4c60b941 100644 --- a/experiments/scrollview/sv-test-01.html +++ b/experiments/scrollview/sv-test-01.html @@ -7,7 +7,7 @@ - + - + diff --git a/gitposthook.php b/gitposthook.php deleted file mode 100755 index ee0578a1..00000000 --- a/gitposthook.php +++ /dev/null @@ -1,5 +0,0 @@ -> /dev/null 2>&1'); - exec('./refreshCDN >> /dev/null 2>&1'); -} - diff --git a/js/index.php b/js/index.php index c0ade1d8..766c2b1c 100644 --- a/js/index.php +++ b/js/index.php @@ -1,6 +1,7 @@ :header,>legend", + heading: "h1,h2,h3,h4,h5,h6,legend", theme: null, contentTheme: null, iconTheme: "d", @@ -22,10 +20,10 @@ $.widget( "mobile.collapsible", $.mobile.widget, { var $el = this.element, o = this.options, collapsible = $el.addClass( "ui-collapsible" ), - collapsibleHeading = $el.find( o.heading ).eq( 0 ), + collapsibleHeading = $el.children( o.heading ).first(), collapsibleContent = collapsible.wrapInner( "

" ).find( ".ui-collapsible-content" ), collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ), - colllapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" ); + collapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" ); // Replace collapsibleHeading if it's a legend if ( collapsibleHeading.is( "legend" ) ) { @@ -54,7 +52,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, { .addClass( "ui-collapsible-heading" ) .append( "" ) .wrapInner( "" ) - .find( "a:eq(0)" ) + .find( "a" ) + .first() .buttonMarkup({ shadow: false, corners: false, @@ -65,7 +64,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { if ( !collapsibleSet.length ) { collapsibleHeading - .find( "a:eq(0), .ui-btn-inner" ) + .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) ) .addClass( "ui-corner-top ui-corner-bottom" ); } else { // If we are in a collapsible set @@ -85,15 +84,17 @@ $.widget( "mobile.collapsible", $.mobile.widget, { }); } - colllapsiblesInSet.first() - .find( "a:eq(0)" ) + collapsiblesInSet.first() + .find( "a" ) + .first() .addClass( "ui-corner-top" ) .find( ".ui-btn-inner" ) .addClass( "ui-corner-top" ); - colllapsiblesInSet.last() + collapsiblesInSet.last() .jqmData( "collapsible-last", true ) - .find( "a:eq(0)" ) + .find( "a" ) + .first() .addClass( "ui-corner-bottom" ) .find( ".ui-btn-inner" ) .addClass( "ui-corner-bottom" ); @@ -101,7 +102,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { if ( collapsible.jqmData( "collapsible-last" ) ) { collapsibleHeading - .find( "a:eq(0), .ui-btn-inner" ) + .find( "a" ).first().add ( collapsibleHeading.find( ".ui-btn-inner" ) ) .addClass( "ui-corner-bottom" ); } } @@ -131,7 +132,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { if ( contentTheme && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) { collapsibleHeading - .find( "a:eq(0), .ui-btn-inner" ) + .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) ) .toggleClass( "ui-corner-bottom", isCollapse ); collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse ); } diff --git a/js/jquery.mobile.controlGroup.js b/js/jquery.mobile.controlGroup.js index d2e47327..91c34729 100644 --- a/js/jquery.mobile.controlGroup.js +++ b/js/jquery.mobile.controlGroup.js @@ -1,9 +1,7 @@ -/* -* jQuery Mobile Framework: "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +/* +* "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc */ + (function( $, undefined ) { $.fn.controlgroup = function( options ) { diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index e8480381..191297d2 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -1,13 +1,11 @@ -/* -* jQuery Mobile Framework : "core" - The base file for jQm -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +/* +* "core" - The base file for jQm */ - (function( $, window, undefined ) { + var nsNormalizeDict = {}; + // jQuery.mobile configurable options $.extend( $.mobile, { @@ -119,14 +117,18 @@ }, 150 ); }, + // Expose our cache for testing purposes. + nsNormalizeDict: nsNormalizeDict, + // Take a data attribute property, prepend the namespace - // and then camel case the attribute string + // and then camel case the attribute string. Add the result + // to our nsNormalizeDict so we don't have to do this again. nsNormalize: function( prop ) { if ( !prop ) { return; } - return $.camelCase( $.mobile.ns + prop ); + return nsNormalizeDict[ prop ] || ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) ); }, getInheritedTheme: function( el, defaultTheme ) { @@ -213,10 +215,11 @@ }; // Monkey-patching Sizzle to filter the :jqmData selector - var oldFind = $.find; + var oldFind = $.find, + jqmDataRE = /:jqmData\(([^)]*)\)/g; $.find = function( selector, context, ret, extra ) { - selector = selector.replace(/:jqmData\(([^)]*)\)/g, "[data-" + ( $.mobile.ns || "" ) + "$1]"); + selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" ); return oldFind.call( this, selector, context, ret, extra ); }; diff --git a/js/jquery.mobile.degradeInputs.js b/js/jquery.mobile.degradeInputs.js index 729f901b..62f96d79 100644 --- a/js/jquery.mobile.degradeInputs.js +++ b/js/jquery.mobile.degradeInputs.js @@ -1,8 +1,5 @@ /* -* jQuery Mobile Framework : "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made. -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +* "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made. */ (function( $, undefined ) { diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 1d1ea560..1089c187 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -1,7 +1,5 @@ /* -* jQuery Mobile Framework : "dialog" plugin. -* Copyright (c) jQuery Project -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* "dialog" plugin. */ (function( $, window, undefined ) { diff --git a/js/jquery.mobile.event.js b/js/jquery.mobile.event.js index 5d92e3e6..7b79b79a 100644 --- a/js/jquery.mobile.event.js +++ b/js/jquery.mobile.event.js @@ -1,8 +1,5 @@ -/* -* jQuery Mobile Framework : "events" plugin - Handles events -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +/* +* "events" plugin - Handles events */ (function( $, window, undefined ) { diff --git a/js/jquery.mobile.fieldContain.js b/js/jquery.mobile.fieldContain.js index 1d9c7f75..905e4ec3 100644 --- a/js/jquery.mobile.fieldContain.js +++ b/js/jquery.mobile.fieldContain.js @@ -1,8 +1,5 @@ /* -* jQuery Mobile Framework : "fieldcontain" plugin - simple class additions to make form row separators -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +* "fieldcontain" plugin - simple class additions to make form row separators */ (function( $, undefined ) { diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index 0c114274..3bb56138 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -1,8 +1,5 @@ /* -* jQuery Mobile Framework : "fixHeaderFooter" plugin - on-demand positioning for headers,footers -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +* "fixHeaderFooter" plugin - on-demand positioning for headers,footers */ (function( $, undefined ) { diff --git a/js/jquery.mobile.fixHeaderFooter.native.js b/js/jquery.mobile.fixHeaderFooter.native.js index 7cc531fc..5ba2c0d9 100644 --- a/js/jquery.mobile.fixHeaderFooter.native.js +++ b/js/jquery.mobile.fixHeaderFooter.native.js @@ -1,8 +1,5 @@ /* -* jQuery Mobile Framework : "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +* "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content */ (function( $, undefined ) { diff --git a/js/jquery.mobile.forms.button.js b/js/jquery.mobile.forms.button.js index 4eb8ad56..a8bad655 100644 --- a/js/jquery.mobile.forms.button.js +++ b/js/jquery.mobile.forms.button.js @@ -1,8 +1,5 @@ /* -* jQuery Mobile Framework : "button" plugin - links that proxy to native input/buttons -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +* "button" plugin - links that proxy to native input/buttons */ (function( $, undefined ) { diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index d0a22eeb..4d233cb4 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -1,8 +1,5 @@ /* -* jQuery Mobile Framework : "checkboxradio" plugin -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +* "checkboxradio" plugin */ (function( $, undefined ) { diff --git a/js/jquery.mobile.forms.select.custom.js b/js/jquery.mobile.forms.select.custom.js index 2bccb6ab..cd8ada09 100644 --- a/js/jquery.mobile.forms.select.custom.js +++ b/js/jquery.mobile.forms.select.custom.js @@ -1,8 +1,5 @@ /* -* jQuery Mobile Framework : custom "selectmenu" plugin -* Copyright (c) jQuery Project -* Dual licensed under the MIT or GPL Version 2 licenses. -* http://jquery.org/license +* custom "selectmenu" plugin */ (function( $, undefined ) { @@ -24,7 +21,7 @@ "
"+ "
" ).appendTo( $.mobile.pageContainer ).page(), - listbox = $("
", { "class": "ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all ui-overlay-" + widget.options.overlayTheme + " " + $.mobile.defaultDialogTransition } ).insertAfter(screen), + listbox = $("
", { "class": "ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all ui-body-" + widget.options.overlayTheme + " " + $.mobile.defaultDialogTransition } ).insertAfter(screen), list = $( "