Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 171 lines (108 sloc) 10.259 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
706268b @gabrielschulhof [README.md] Removed comma
gabrielschulhof authored
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).
33c5a67 @johnbender start to the new readme
johnbender authored
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)
47e9bda @agcolom Readme: added info regarding what a commit message should include
agcolom authored
31 6. Add the appropriate commit message (see below)
fee9cde @agcolom Readme: added a necessary new line for formatting
agcolom authored
32
33c5a67 @johnbender start to the new readme
johnbender authored
33 Taken together, the above reduces the effort that's required of the contributor reviewing your pull request.
34
47e9bda @agcolom Readme: added info regarding what a commit message should include
agcolom authored
35 ### Commit messages
36
37 Commit messages should include four components:
38 * The WHERE - a single word that categorizes and provides context for the commit and its message, followed by a colon (:). This is typically the name of the plugin being worked on, but sometimes might be something like Build: or Docs:
39 * The WHAT - a sufficient summary of the fix or change made (example: modified the foo to no longer bar), followed by a period (.)
40 * The WHY #Num - the ticket number with a #sign so Trac creates a hyperlink (example: #1234), followed by a hyphen/dash (-)
41 * The WHY Name - the name of the ticket. Notice this is different than summary of the fix. This is a short description of the issue (example: dialog: IE6 crashed when foo is set to bar)
42
43 Combined into one, here's a full example:
517b3c4 @agcolom readme: trying again to fix indentation of commit message content
agcolom authored
44
f84a434 @agcolom Readme: trying to fix indentation of commit message content
agcolom authored
45 "Dialog: modified the foo to no longer bar. Fixed #1234 - dialog: IE6 crashed when foo is set to bar"
46 \WHERE/:\------------- WHAT -------------/.\ WHY #Num /-\---------------- WHY Name ----------------/
47e9bda @agcolom Readme: added info regarding what a commit message should include
agcolom authored
47
48
33c5a67 @johnbender start to the new readme
johnbender authored
49 ## Build/Customization
50
51 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:
52
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
53 * `js` - resolve dependencies, build, concat, and minify the JavaScript used for jQuery Mobile
54 * `css` - resolve dependencies, build, concat, and minify all the css, just the structure css, and just the theme css
55 * `docs` - build the js and css, and make the docs ready for static consumption
12a1ab1 @johnbender spelling
johnbender authored
56 * `zip` - package all the JavaScript and all the css into a zip archive
33c5a67 @johnbender start to the new readme
johnbender authored
57
58 ### Requirements
59
15666d5 @johnbender too many 'other's
johnbender authored
60 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
61
62 ### Commands
63
64 With node installed you can run the `js` and `css` targets by simply issuing the following from the project root:
65
66 npm install
f11bd34 Fixed typo on build command: .gin x .bin
Darío Javier Cravero authored
67 node node_modules/.bin/grunt js # or css
33c5a67 @johnbender start to the new readme
johnbender authored
68
f11bd34 Fixed typo on build command: .gin x .bin
Darío Javier Cravero authored
69 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
70
71 If you want to use the `docs` and `zip` targets you will need bash and they can be run with the following
72
1567656 @johnbender simplify to grunt docs and grunt zip
johnbender authored
73 grunt docs # or `grunt zip`
33c5a67 @johnbender start to the new readme
johnbender authored
74
75 ### JavaScript
76
77 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`.
78
79 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:
80
81 ```diff
82 diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js
83 index 6200fe6..3a4625c 100644
84 --- a/js/jquery.mobile.js
85 +++ b/js/jquery.mobile.js
86 @@ -19,12 +19,6 @@ define([
87 './jquery.mobile.listview.filter',
88 './jquery.mobile.listview.autodividers',
89 './jquery.mobile.nojs',
90 - './jquery.mobile.forms.checkboxradio',
91 - './jquery.mobile.forms.button',
92 - './jquery.mobile.forms.slider',
93 - './jquery.mobile.forms.textinput',
94 - './jquery.mobile.forms.select.custom',
95 - './jquery.mobile.forms.select',
96 './jquery.mobile.buttonMarkup',
97 './jquery.mobile.controlGroup',
98 './jquery.mobile.links',
99 ```
100
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
101 And then run the build:
33c5a67 @johnbender start to the new readme
johnbender authored
102
103 grunt js
104
105 ### CSS
106
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
107 To create a new theme:
33c5a67 @johnbender start to the new readme
johnbender authored
108
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
109 1. Copy the `default` folder from CSS/Themes to a new folder named after your new theme (eg, `my-theme`).
110 2. Add customizations to the `jquery.mobile.theme.css` file.
111 3. From the project root run the following `grunt` command:
33c5a67 @johnbender start to the new readme
johnbender authored
112
15ac8d6 @johnbender clarifying custom theme info
johnbender authored
113 THEME=my-theme grunt css
33c5a67 @johnbender start to the new readme
johnbender authored
114
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
115 4. The output will be available in the `$PROJECT_ROOT/compiled`
33c5a67 @johnbender start to the new readme
johnbender authored
116
15ac8d6 @johnbender clarifying custom theme info
johnbender authored
117 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
118
119 ## Development
120
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
121 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
122
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
123 ### Server
2b4a29c @jaspermdegroot Update README.md
jaspermdegroot authored
124
12a1ab1 @johnbender spelling
johnbender authored
125 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
126
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
127 * 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
128 * existing web server - eg, `~/Sites` directory on OSX.
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
129 * 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
130
12a1ab1 @johnbender spelling
johnbender authored
131 In addition to vanilla Apache the following modules are required:
a51adb9 updated the readme with more helpful information
scottjehl authored
132
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
133 * Rewrite (mod\_rewrite.so)
134 * Expire (mod\_expires.so)
135 * Header (mod\_headers.so)
00f86c8 update docs regarding running demos
Matt authored
136
12a1ab1 @johnbender spelling
johnbender authored
137 Once you have your web server setup you can point it at the project directory.
5c86ca6 @eddiemonge Readme changes
eddiemonge authored
138
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
139 ### Testing
5c86ca6 @eddiemonge Readme changes
eddiemonge authored
140
95a6dc8 @johnbender in for => for
johnbender authored
141 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
142
29705a1 @johnbender small snippet on rebasing
johnbender authored
143 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
144
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
145 grunt config:test:pages
6bc5c65 @eddiemonge Update to include instructions on how to build using a custom theme.
eddiemonge authored
146
bf74dfa @johnbender link to build requirements
johnbender authored
147 _NOTE_ See the [build requirements](#requirements) for node/grunt install information.
148
96c6179 @agcolom removed extra 'the'
agcolom authored
149 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
150
12a1ab1 @johnbender spelling
johnbender authored
151 JUNIT_OUTPUT=build/test-results/ ROOT_DOMAIN=$WEB_SERVER grunt test
e26d7de @johnbender added note about local server support for development
johnbender authored
152
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
153 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
154
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
155 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
156
e3c173e @agcolom replaced uppercase with lowercase
agcolom authored
157 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
158
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
159 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
160
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored
161 ### Rebasing
e26d7de @johnbender added note about local server support for development
johnbender authored
162
324d1e6 @MauriceG readme: tiny typo: requests := request
MauriceG authored
163 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
164
29705a1 @johnbender small snippet on rebasing
johnbender authored
165 git checkout new-feature
166 git fetch upstream
167 git rebase upstream/master
168 ## ... here you may have to resolve some conflicts ... ##
6bc5c65 @eddiemonge Update to include instructions on how to build using a custom theme.
eddiemonge authored
169
4f56b51 @agcolom removed another extra 'the'
agcolom authored
170 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.