This is the main repository for the jQuery Mobile project. From the official website:
A unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.
jQuery Mobile 1.3 (1.3.0) works with versions of jQuery core from 1.7.0 to 1.9.0. You can find more information about how the library works, and what it is capable of, by reading the documentation.
You can contribute to the project by reporting issues, suggesting new features, or submitting pull requests. Please read our Contributing Guidelines before submitting.
css- resolve dependencies, build, concat, and minify all the css, just the structure css, and just the theme css
demos- build the js and css, and make the docs ready for static consumption
dist(default target) - all of the above
With node and grunt installed you can run the default target by simply issuing the following from the project root:
npm install grunt
For example, if a user wished to exclude the form widgets to reduce the wire weight of their jQuery Mobile include they would first remove them from the meta module:
diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js index 6200fe6..3a4625c 100644 --- a/js/jquery.mobile.js +++ b/js/jquery.mobile.js @@ -19,12 +19,6 @@ define([ './jquery.mobile.listview.filter', './jquery.mobile.listview.autodividers', './jquery.mobile.nojs', - './jquery.mobile.forms.checkboxradio', - './jquery.mobile.forms.button', - './jquery.mobile.forms.slider', - './jquery.mobile.forms.textinput', - './jquery.mobile.forms.select.custom', - './jquery.mobile.forms.select', './jquery.mobile.buttonMarkup', './jquery.mobile.controlGroup', './jquery.mobile.links',
And then run the build:
To create a new theme:
- Copy the
defaultfolder from CSS/Themes to a new folder named after your new theme (eg,
- Add customizations to the
From the project root run the following
THEME=my-theme grunt css
The output will be available in the
Again this assumes the theme css files are available in the
css/themes/$THEME/ directory relative to the project root,
css/themes/my-theme/ in the example.
The root of the repository is also the root of the documentation and, along with the test suite, acts as the test bed for bug fixes and features. You'll need to set up a server and get the test suite running before you can contribute patches.
Most of the documentation and testing pages rely on PHP 5+, and as a result Apache and PHP are required for development. You can install them using one of the following methods:
- one-click - MAMP for OSX, XAMP for OSX/Windows
- existing web server - eg,
~/Sitesdirectory on OSX.
- virtual machine - If Vagrant is installed you can add this remote/branch and
In addition to vanilla Apache the following modules are required:
- Rewrite (mod_rewrite.so)
- Expire (mod_expires.so)
- Header (mod_headers.so)
Once you have your web server setup you can point it at the project directory.
Automated testing forms the backbone of the jQuery Mobile project's QA activities. As a contributor or patch submitter you will be expected to run the test suite for the code your patches affect. Our continuous integration server will address the remainder of the test suite.
You can run all the test suites by running the following command:
You can choose to run only a subset of the tests by adding the
--suites option like:
grunt test --suites=button,slider
will only run the tests under
You can also specify which versions of jQuery you want to test jQuery Mobile with by using the
grunt test --jqueries=1.8.2,git
Additionally, jQuery Mobile's test suite is split between integration and unit tests. Where the unit tests are meant to focus on a single piece of the library (eg, a widget) and the integration tests require multiple pieces of the library to function. You can target either type by including the
--types option when testing:
grunt test --types=unit grunt test --types=integration grunt test --types=unit,integration # default, equivalent to 'grunt test'
Often times when working on a feature or bug fix branch it's useful to pull in the latest from the parent branch. If you're doing this before submitting a pull request it's best to use git's rebase to apply your commits onto the latest from the parent branch. For example, working on
new-feature branch where
upstream is the remote at
git checkout new-feature git fetch upstream git rebase upstream/master ## ... here you may have to resolve some conflicts ... ##
You can now push to your own fork and submit the pull request. Keep in mind that it's only a good idea to do this if you haven't already submitted a pull request unless you want to create a new one because your origin remote (your fork) will report a discrepancy. Again, please refer to the chapter in Pro Git on rebasing if you're new to it.