Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 156 lines (98 sloc) 9.194 kb
33c5a67 @johnbender start to the new readme
johnbender authored
1 # jQuery Mobile
2
3 This is the main repository for the jQuery Mobile project. From the [official website](http://jquerymobile.com):
4
5 > 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.
6
7 You can find more information about how the library works, and what it is capable of, by reading the [documentation](http://jquerymobile.com/demos/).
8
9 ## Issues
10
11 When [submitting issues on github](https://github.com/jquery/jquery-mobile/issues/new) please include the following:
12
13 1. Issue description
7fdde08 @jaspermdegroot Minor change. Thanks for the feedback @agcolom
jaspermdegroot authored
14 2. Sample page using our [jsbin template](http://jsbin.com/awoluv/edit#html) which uses latest code
33c5a67 @johnbender start to the new readme
johnbender authored
15 3. Steps to reproduce
16 4. Expected outcome
17 5. Actual outcome
9913124 @johnbender corrections coutesy of @uGoMobi
johnbender authored
18 6. Browsers/platforms tested
33c5a67 @johnbender start to the new readme
johnbender authored
19
20 Also, in the interest of creating more readable issues please include code snippets inside a triple backtick box appropriate for the JavaScript/HTML/CSS snippet you wish to discuss. More information is available at the [introduction page](http://github.github.com/github-flavored-markdown/) for github flavored markdown (see, Syntax Highlighting).
21
22 ## Pull Requests
23
7c8e8e6 @MauriceG readme: few := a few
MauriceG authored
24 When submitting a pull request for review there are a few important steps you can take to ensure that it gets reviewed quickly and increase the chances that it will be merged (in order of descending importance):
33c5a67 @johnbender start to the new readme
johnbender authored
25
a0e897d @johnbender wording and spelling corrections
johnbender authored
26 1. Include tests (see [Testing](#testing))
33c5a67 @johnbender start to the new readme
johnbender authored
27 2. Follow the [jQuery Core style guide](http://docs.jquery.com/JQuery_Core_Style_Guidelines)
28 3. Limit the scope to one Issue/Feature
29 4. Small focused commits, ideally less than 10 to 20 lines
9913124 @johnbender corrections coutesy of @uGoMobi
johnbender authored
30 5. Avoid merge commits (see Pro Git's [chapter on rebasing](http://git-scm.com/book/ch3-6.html), section [Rebasing](#rebasing) below)
33c5a67 @johnbender start to the new readme
johnbender authored
31
32 Taken together, the above reduces the effort that's required of the contributor reviewing your pull request.
33
34 ## Build/Customization
35
36 Currently the library is shipped on the jQuery CDN/download as a single monolithic JavaScript file that depends on jQuery Core (not included) and a similarly bundled CSS file. For users we support the following build targets:
37
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
38 * `js` - resolve dependencies, build, concat, and minify the JavaScript used for jQuery Mobile
39 * `css` - resolve dependencies, build, concat, and minify all the css, just the structure css, and just the theme css
40 * `docs` - build the js and css, and make the docs ready for static consumption
12a1ab1 @johnbender spelling
johnbender authored
41 * `zip` - package all the JavaScript and all the css into a zip archive
33c5a67 @johnbender start to the new readme
johnbender authored
42
43 ### Requirements
44
15666d5 @johnbender too many 'other's
johnbender authored
45 The `js` and `css` build targets require [node.js](http://nodejs.org/) and its packaged NPM package manager. For the other build targets, `docs` and `zip`, bash is also required. For more information on installing node please see its [documentation](http://nodejs.org/#download). As for bash it's generally installed as the default shell in many POSIX compliant environments (OSX, Linux, BSD, etc).
33c5a67 @johnbender start to the new readme
johnbender authored
46
47 ### Commands
48
49 With node installed you can run the `js` and `css` targets by simply issuing the following from the project root:
50
51 npm install
f11bd34 Fixed typo on build command: .gin x .bin
Darío Javier Cravero authored
52 node node_modules/.bin/grunt js # or css
33c5a67 @johnbender start to the new readme
johnbender authored
53
f11bd34 Fixed typo on build command: .gin x .bin
Darío Javier Cravero authored
54 Note that if you have the appropriate version of [grunt](https://github.com/cowboy/grunt), our build tool, installed globally you can substitute `grunt` wherever you see `node node_modules/.bin/grunt`. For the remainder of the build documentation we will prefer the more concise `grunt`.
33c5a67 @johnbender start to the new readme
johnbender authored
55
56 If you want to use the `docs` and `zip` targets you will need bash and they can be run with the following
57
1567656 @johnbender simplify to grunt docs and grunt zip
johnbender authored
58 grunt docs # or `grunt zip`
33c5a67 @johnbender start to the new readme
johnbender authored
59
60 ### JavaScript
61
62 As of version 1.1 the library uses dependency management in the JavaScript build by providing [AMD modules](https://github.com/amdjs/amdjs-api/wiki/AMD) which can be added or removed from the core mobile meta module `js/jquery.mobile.js`.
63
64 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:
65
66 ```diff
67 diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js
68 index 6200fe6..3a4625c 100644
69 --- a/js/jquery.mobile.js
70 +++ b/js/jquery.mobile.js
71 @@ -19,12 +19,6 @@ define([
72 './jquery.mobile.listview.filter',
73 './jquery.mobile.listview.autodividers',
74 './jquery.mobile.nojs',
75 - './jquery.mobile.forms.checkboxradio',
76 - './jquery.mobile.forms.button',
77 - './jquery.mobile.forms.slider',
78 - './jquery.mobile.forms.textinput',
79 - './jquery.mobile.forms.select.custom',
80 - './jquery.mobile.forms.select',
81 './jquery.mobile.buttonMarkup',
82 './jquery.mobile.controlGroup',
83 './jquery.mobile.links',
84 ```
85
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
86 And then run the build:
33c5a67 @johnbender start to the new readme
johnbender authored
87
88 grunt js
89
90 ### CSS
91
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
92 To create a new theme:
33c5a67 @johnbender start to the new readme
johnbender authored
93
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
94 1. Copy the `default` folder from CSS/Themes to a new folder named after your new theme (eg, `my-theme`).
95 2. Add customizations to the `jquery.mobile.theme.css` file.
96 3. From the project root run the following `grunt` command:
33c5a67 @johnbender start to the new readme
johnbender authored
97
15ac8d6 @johnbender clarifying custom theme info
johnbender authored
98 THEME=my-theme grunt css
33c5a67 @johnbender start to the new readme
johnbender authored
99
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
100 4. The output will be available in the `$PROJECT_ROOT/compiled`
33c5a67 @johnbender start to the new readme
johnbender authored
101
15ac8d6 @johnbender clarifying custom theme info
johnbender authored
102 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.
33c5a67 @johnbender start to the new readme
johnbender authored
103
104 ## Development
105
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
106 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.
11dbc57 @toddparker Added link to JS Bin template
toddparker authored
107
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
108 ### Server
2b4a29c @jaspermdegroot Update README.md
jaspermdegroot authored
109
12a1ab1 @johnbender spelling
johnbender authored
110 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:
a51adb9 updated the readme with more helpful information
scottjehl authored
111
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
112 * one-click - [MAMP](http://www.mamp.info/en/downloads/index.html) for OSX, [XAMP](http://www.apachefriends.org/en/xampp.html) for OSX/Windows
12a1ab1 @johnbender spelling
johnbender authored
113 * existing web server - eg, `~/Sites` directory on OSX.
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
114 * virtual machine - If [Vagrant](http://vagrantup.com) is installed you can add [this remote/branch](https://github.com/johnbender/jquery-mobile/tree/vagrant) and `vagrant up`
a51adb9 updated the readme with more helpful information
scottjehl authored
115
12a1ab1 @johnbender spelling
johnbender authored
116 In addition to vanilla Apache the following modules are required:
a51adb9 updated the readme with more helpful information
scottjehl authored
117
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
118 * Rewrite (mod\_rewrite.so)
119 * Expire (mod\_expires.so)
120 * Header (mod\_headers.so)
00f86c8 update docs regarding running demos
Matt authored
121
12a1ab1 @johnbender spelling
johnbender authored
122 Once you have your web server setup you can point it at the project directory.
5c86ca6 @eddiemonge Readme changes
eddiemonge authored
123
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
124 ### Testing
5c86ca6 @eddiemonge Readme changes
eddiemonge authored
125
95a6dc8 @johnbender in for => for
johnbender authored
126 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.
a51adb9 updated the readme with more helpful information
scottjehl authored
127
29705a1 @johnbender small snippet on rebasing
johnbender authored
128 There are two primary ways to run the test suite. First, you can run the tests individually by directing your browser to the different test pages associated with the area in which you are working. For example, to run the tests for `js/jquery.mobile.forms.slider.js` visit `$WEB_SERVER/tests/unit/slider/`. To find out which test pages are available you can list them with:
a51adb9 updated the readme with more helpful information
scottjehl authored
129
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
130 grunt config:test:pages
6bc5c65 @eddiemonge Update to include instructions on how to build using a custom theme.
eddiemonge authored
131
bf74dfa @johnbender link to build requirements
johnbender authored
132 _NOTE_ See the [build requirements](#requirements) for node/grunt install information.
133
96c6179 @agcolom removed extra 'the'
agcolom authored
134 Second you can run the tests using the [PhantomJS](http://phantomjs.org/) headless Webkit browser which must be [installed](http://code.google.com/p/phantomjs/wiki/Installation). Once `phantomjs` is in your `PATH` the following will execute the whole test suite:
e26d7de @johnbender added note about local server support for development
johnbender authored
135
12a1ab1 @johnbender spelling
johnbender authored
136 JUNIT_OUTPUT=build/test-results/ ROOT_DOMAIN=$WEB_SERVER grunt test
e26d7de @johnbender added note about local server support for development
johnbender authored
137
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
138 You can confine the headless run to a single test page or set of test pages using the `TEST_PATH` environment variable. For example:
c97e4d1 @johnbender corrected docs to reflect revert to /js/
johnbender authored
139
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
140 TEST_PATH=slider JUNIT_OUTPUT=build/test-results/ ROOT_DOMAIN=$WEB_SERVER grunt test
c97e4d1 @johnbender corrected docs to reflect revert to /js/
johnbender authored
141
46b8527 @agcolom bringing back conditional tense (as original)
agcolom authored
142 will only run the tests where the path contains the string `slider`, eg `tests/unit/slider/`. *NOTE* That the phantom tests currently require that the web server be running to access and run the tests properly because of the PHP dependency that many of them share. Additionally the test suite is run against many versions of jQuery using the `JQUERY` environment variable. For example if you wanted to run the test suite against both of the currently supported versions 1.6.4, and 1.7.1 the command would take the following form:
e26d7de @johnbender added note about local server support for development
johnbender authored
143
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
144 JQUERY=1.6.4,1.7.1 JUNIT_OUTPUT=build/test-results/ ROOT_DOMAIN=$WEB_SERVER grunt test
db42f18 @johnbender note about fouc
johnbender authored
145
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
146 ### Rebasing
e26d7de @johnbender added note about local server support for development
johnbender authored
147
324d1e6 @MauriceG readme: tiny typo: requests := request
MauriceG authored
148 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://github.com/jquery/jquery-mobile.git`:
16ea3fa @eddiemonge Update README.md
eddiemonge authored
149
29705a1 @johnbender small snippet on rebasing
johnbender authored
150 git checkout new-feature
151 git fetch upstream
152 git rebase upstream/master
153 ## ... here you may have to resolve some conflicts ... ##
6bc5c65 @eddiemonge Update to include instructions on how to build using a custom theme.
eddiemonge authored
154
4f56b51 @agcolom removed another extra 'the'
agcolom authored
155 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](http://git-scm.com/book/ch3-6.html) in Pro Git on rebasing if you're new to it.
Something went wrong with that request. Please try again.