Skip to content
Newer
Older
100644 176 lines (111 sloc) 10.6 KB
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
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 Jun 17, 2012
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 Jun 11, 2012
15 3. Steps to reproduce
16 4. Expected outcome
17 5. Actual outcome
672d4ee @jaspermdegroot Readme: Added a line about checking existing tickets before opening a…
jaspermdegroot authored Jul 8, 2012
18 6. jQuery Mobile version
19 7. Browsers/platforms tested
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
20
706268b @gabrielschulhof [README.md] Removed comma
gabrielschulhof authored Jun 21, 2012
21 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 Jun 11, 2012
22
672d4ee @jaspermdegroot Readme: Added a line about checking existing tickets before opening a…
jaspermdegroot authored Jul 8, 2012
23 Before opening a new ticket check if the same or a similar issue already has been reported. Tip: Besides the search tool of the issue tracker you can filter issues by label.
24
383cc1a @jaspermdegroot Readme: Added note about reporting ThemeRoller and Download Builder i…
jaspermdegroot authored Jul 11, 2012
25 The jQuery Mobile [ThemeRoller](https://github.com/jquery/web-jquery-mobile-theme-roller) and [Download Builder](https://github.com/jquery/jquery-mobile-builder) have their own repo where you can report issues.
26
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
27 ## Pull Requests
28
7c8e8e6 @MauriceG readme: few := a few
MauriceG authored Jun 16, 2012
29 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 Jun 11, 2012
30
a0e897d @johnbender wording and spelling corrections
johnbender authored Jun 11, 2012
31 1. Include tests (see [Testing](#testing))
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
32 2. Follow the [jQuery Core style guide](http://docs.jquery.com/JQuery_Core_Style_Guidelines)
33 3. Limit the scope to one Issue/Feature
34 4. Small focused commits, ideally less than 10 to 20 lines
9913124 @johnbender corrections coutesy of @uGoMobi
johnbender authored Jun 12, 2012
35 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 Jun 30, 2012
36 6. Add the appropriate commit message (see below)
fee9cde @agcolom Readme: added a necessary new line for formatting
agcolom authored Jun 30, 2012
37
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
38 Taken together, the above reduces the effort that's required of the contributor reviewing your pull request.
39
a33ff15 @johnbender clarify web server ref in README
johnbender authored Jul 11, 2012
40 ### Commit messages
47e9bda @agcolom Readme: added info regarding what a commit message should include
agcolom authored Jun 30, 2012
41
42 Commit messages should include four components:
43 * 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:
44 * The WHAT - a sufficient summary of the fix or change made (example: modified the foo to no longer bar), followed by a period (.)
45 * The WHY #Num - the ticket number with a #sign so Trac creates a hyperlink (example: #1234), followed by a hyphen/dash (-)
46 * 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)
47
48 Combined into one, here's a full example:
517b3c4 @agcolom readme: trying again to fix indentation of commit message content
agcolom authored Jun 30, 2012
49
f84a434 @agcolom Readme: trying to fix indentation of commit message content
agcolom authored Jun 30, 2012
50 "Dialog: modified the foo to no longer bar. Fixed #1234 - dialog: IE6 crashed when foo is set to bar"
51 \WHERE/:\------------- WHAT -------------/.\ WHY #Num /-\---------------- WHY Name ----------------/
a33ff15 @johnbender clarify web server ref in README
johnbender authored Jul 11, 2012
52
47e9bda @agcolom Readme: added info regarding what a commit message should include
agcolom authored Jun 30, 2012
53
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
54 ## Build/Customization
55
56 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:
57
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 11, 2012
58 * `js` - resolve dependencies, build, concat, and minify the JavaScript used for jQuery Mobile
59 * `css` - resolve dependencies, build, concat, and minify all the css, just the structure css, and just the theme css
60 * `docs` - build the js and css, and make the docs ready for static consumption
12a1ab1 @johnbender spelling
johnbender authored Jun 11, 2012
61 * `zip` - package all the JavaScript and all the css into a zip archive
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
62
63 ### Requirements
64
15666d5 @johnbender too many 'other's
johnbender authored Jun 12, 2012
65 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 Jun 11, 2012
66
67 ### Commands
68
69 With node installed you can run the `js` and `css` targets by simply issuing the following from the project root:
70
71 npm install
f11bd34 Fixed typo on build command: .gin x .bin
Darío Javier Cravero authored Jun 17, 2012
72 node node_modules/.bin/grunt js # or css
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
73
f11bd34 Fixed typo on build command: .gin x .bin
Darío Javier Cravero authored Jun 17, 2012
74 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 Jun 11, 2012
75
76 If you want to use the `docs` and `zip` targets you will need bash and they can be run with the following
77
a4d1c96 @jaspermdegroot Readme: added missing backticks.
jaspermdegroot authored Jul 10, 2012
78 `grunt docs #` or `grunt zip`
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
79
80 ### JavaScript
81
82 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`.
83
84 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:
85
86 ```diff
87 diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js
88 index 6200fe6..3a4625c 100644
89 --- a/js/jquery.mobile.js
90 +++ b/js/jquery.mobile.js
91 @@ -19,12 +19,6 @@ define([
92 './jquery.mobile.listview.filter',
93 './jquery.mobile.listview.autodividers',
94 './jquery.mobile.nojs',
95 - './jquery.mobile.forms.checkboxradio',
96 - './jquery.mobile.forms.button',
97 - './jquery.mobile.forms.slider',
98 - './jquery.mobile.forms.textinput',
99 - './jquery.mobile.forms.select.custom',
100 - './jquery.mobile.forms.select',
101 './jquery.mobile.buttonMarkup',
102 './jquery.mobile.controlGroup',
103 './jquery.mobile.links',
104 ```
105
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
106 And then run the build:
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
107
108 grunt js
109
110 ### CSS
111
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
112 To create a new theme:
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
113
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
114 1. Copy the `default` folder from CSS/Themes to a new folder named after your new theme (eg, `my-theme`).
115 2. Add customizations to the `jquery.mobile.theme.css` file.
116 3. From the project root run the following `grunt` command:
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
117
15ac8d6 @johnbender clarifying custom theme info
johnbender authored Jun 12, 2012
118 THEME=my-theme grunt css
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
119
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
120 4. The output will be available in the `$PROJECT_ROOT/compiled`
33c5a67 @johnbender start to the new readme
johnbender authored Jun 11, 2012
121
15ac8d6 @johnbender clarifying custom theme info
johnbender authored Jun 12, 2012
122 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 Jun 11, 2012
123
124 ## Development
125
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
126 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 Nov 1, 2011
127
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
128 ### Server
2b4a29c @jaspermdegroot Update README.md
jaspermdegroot authored Apr 16, 2012
129
12a1ab1 @johnbender spelling
johnbender authored Jun 12, 2012
130 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 Jan 31, 2011
131
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
132 * 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 Jun 12, 2012
133 * existing web server - eg, `~/Sites` directory on OSX.
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
134 * 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 Feb 1, 2011
135
12a1ab1 @johnbender spelling
johnbender authored Jun 12, 2012
136 In addition to vanilla Apache the following modules are required:
a51adb9 updated the readme with more helpful information
scottjehl authored Feb 1, 2011
137
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
138 * Rewrite (mod\_rewrite.so)
139 * Expire (mod\_expires.so)
140 * Header (mod\_headers.so)
00f86c8 update docs regarding running demos
Matt authored Jul 14, 2011
141
12a1ab1 @johnbender spelling
johnbender authored Jun 12, 2012
142 Once you have your web server setup you can point it at the project directory.
5c86ca6 @eddiemonge Readme changes
eddiemonge authored Oct 17, 2011
143
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
144 ### Testing
5c86ca6 @eddiemonge Readme changes
eddiemonge authored Oct 17, 2011
145
95a6dc8 @johnbender in for => for
johnbender authored Jun 12, 2012
146 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 Feb 1, 2011
147
ddec464 @johnbender add protocol requirement to webserver reference
johnbender authored Jul 11, 2012
148 There are two primary ways to run the test suite. Both of them require a server configured in the previously prescribed manner. The location of which will hereafter be referred to as `$WEB_SERVER` and should include the protocol. 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 Feb 1, 2011
149
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
150 grunt config:test:pages
6bc5c65 @eddiemonge Update to include instructions on how to build using a custom theme.
eddiemonge authored Oct 18, 2011
151
bf74dfa @johnbender link to build requirements
johnbender authored Jun 12, 2012
152 _NOTE_ See the [build requirements](#requirements) for node/grunt install information.
153
96c6179 @agcolom removed extra 'the'
agcolom authored Jun 12, 2012
154 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 Jan 4, 2012
155
12a1ab1 @johnbender spelling
johnbender authored Jun 12, 2012
156 JUNIT_OUTPUT=build/test-results/ ROOT_DOMAIN=$WEB_SERVER grunt test
e26d7de @johnbender added note about local server support for development
johnbender authored Jan 4, 2012
157
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
158 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 Feb 21, 2012
159
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
160 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 Feb 21, 2012
161
e3c173e @agcolom replaced uppercase with lowercase
agcolom authored Jun 30, 2012
162 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 Jan 4, 2012
163
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
164 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 Jan 4, 2012
165
2719b18 @johnbender added page listing for testers, removed old readme content, expanded …
johnbender authored Jun 12, 2012
166 ### Rebasing
e26d7de @johnbender added note about local server support for development
johnbender authored Jan 4, 2012
167
324d1e6 @MauriceG readme: tiny typo: requests := request
MauriceG authored Jun 16, 2012
168 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 Oct 18, 2011
169
29705a1 @johnbender small snippet on rebasing
johnbender authored Jun 12, 2012
170 git checkout new-feature
171 git fetch upstream
172 git rebase upstream/master
173 ## ... here you may have to resolve some conflicts ... ##
6bc5c65 @eddiemonge Update to include instructions on how to build using a custom theme.
eddiemonge authored Oct 19, 2011
174
4f56b51 @agcolom removed another extra 'the'
agcolom authored Jun 12, 2012
175 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.