Skip to content

Commit ba99290

Browse files
committed
Merge branch 'master' of git://github.com/jquery/jquery-mobile
2 parents d435979 + 5a7377d commit ba99290

File tree

91 files changed

+7475
-1102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+7475
-1102
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.DS_Store
66
cache/
77
combined/
8+
combine/

Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ CSSMIN = ${DIR}.min.css
1010

1111
FILES = js/jquery.ui.widget.js \
1212
js/jquery.mobile.widget.js \
13+
js/jquery.mobile.media.js \
1314
js/jquery.mobile.support.js \
1415
js/jquery.mobile.event.js \
1516
js/jquery.mobile.hashchange.js \
17+
js/jquery.mobile.core.js \
18+
js/jquery.mobile.navigation.js \
1619
js/jquery.mobile.page.js \
20+
js/jquery.ui.position.js \
1721
js/jquery.mobile.fixHeaderFooter.js \
1822
js/jquery.mobile.forms.checkboxradio.js \
1923
js/jquery.mobile.forms.textinput.js \
@@ -28,8 +32,7 @@ FILES = js/jquery.ui.widget.js \
2832
js/jquery.mobile.listview.filter.js \
2933
js/jquery.mobile.dialog.js \
3034
js/jquery.mobile.navbar.js \
31-
js/jquery.mobile.grid.js \
32-
js/jquery.mobile.js
35+
js/jquery.mobile.grid.js
3336

3437
CSSFILES = themes/default/jquery.mobile.theme.css \
3538
themes/default/jquery.mobile.core.css \
@@ -54,19 +57,19 @@ clean:
5457
@@rm -rf ${DIR}*
5558

5659
css:
57-
@@head -8 js/jquery.mobile.js | ${SED_VER} > ${CSS}
60+
@@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${CSS}
5861
@@cat ${CSSFILES} >> ${CSS}
5962

6063
cssmin: css
61-
@@head -8 js/jquery.mobile.js | ${SED_VER} > ${CSSMIN}
64+
@@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${CSSMIN}
6265
@@java -jar build/yuicompressor-2.4.2.jar --type css ${CSS} >> ${CSSMIN}
6366

6467
mobile:
65-
@@head -8 js/jquery.mobile.js | ${SED_VER} > ${MAX}
68+
@@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${MAX}
6669
@@cat ${FILES} >> ${MAX}
6770

6871
min: mobile
69-
@@head -8 js/jquery.mobile.js | ${SED_VER} > ${MIN}
72+
@@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${MIN}
7073
@@java -jar build/google-compiler-20100917.jar --js ${MAX} --warning_level QUIET --js_output_file ${MIN}.tmp
7174
@@cat ${MIN}.tmp >> ${MIN}
7275
@@rm -f ${MIN}.tmp

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ You need the Rewrite (mod_rewrite.so), Expire (mod_expires.so) and Header (mod_h
1616
Whenever this configuration becomes inconvenient, we can remove it, obviously it's not meant to stay!
1717

1818
- when adding a js or css file, add it to the manifest in its directory and it'll be included in the request
19-
- As far as JS files go, jQuery.mobile.js is the starting point.
19+
- As far as JS files go, jQuery.mobile.core.js is the starting point.

build.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,32 @@
2020
jquery.mobile.theme.css,
2121
jquery.mobile.transitions.css"/>
2222
<property name="js-sources" value="jquery.js,
23+
jquery.ui.position.js,
24+
jquery.ui.widget.js,
25+
jquery.mobile.widget.js,
26+
jquery.mobile.media.js,
27+
jquery.mobile.support.js,
28+
jquery.mobile.event.js,
29+
jquery.mobile.hashchange.js,
30+
jquery.mobile.core.js,
31+
jquery.mobile.navigation.js,
32+
jquery.mobile.page.js,
2333
jquery.mobile.buttonMarkup.js,
2434
jquery.mobile.collapsible.js,
2535
jquery.mobile.controlGroup.js,
2636
jquery.mobile.dialog.js,
27-
jquery.mobile.event.js,
2837
jquery.mobile.fieldContain.js,
2938
jquery.mobile.fixHeaderFooter.js,
30-
jquery.mobile.forms.ajaxform.js,
3139
jquery.mobile.forms.button.js,
3240
jquery.mobile.forms.checkboxradio.js,
3341
jquery.mobile.forms.select.js,
3442
jquery.mobile.forms.slider.js,
3543
jquery.mobile.forms.textinput.js,
3644
jquery.mobile.grid.js,
37-
jquery.mobile.hashchange.js,
38-
jquery.mobile.js,
39-
jquery.mobile.listview.filter.js,
4045
jquery.mobile.listview.js,
41-
jquery.mobile.navbar.js,
42-
jquery.mobile.page.js,
43-
jquery.mobile.support.js,
44-
jquery.mobile.widget.js,
45-
jquery.ui.widget.js"/>
46+
jquery.mobile.listview.filter.js,
47+
jquery.mobile.navbar.js"
48+
/>
4649

4750
<target name="merge">
4851
<antcall target="merge_css" />

docs/_assets/js/jqm-docs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//set up the theme switcher on the homepage
22
$('div').live('pagecreate',function(event){
33
if( !$(this).is('.ui-dialog')){
4-
$('<a href="#">Switch theme</a>')
4+
$('<a href="#themeswitcher" data-rel="dialog" data-transition="pop">Switch theme</a>')
55
.buttonMarkup({
66
'icon':'gear',
77
'inline': true,
@@ -12,7 +12,6 @@ $('div').live('pagecreate',function(event){
1212
.wrap('<div class="jqm-themeswitcher">')
1313
.click(function(){
1414
$.themeswitcher();
15-
return false;
1615
});
1716
}
1817
event.stopPropagation();

docs/api/events.html

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ <h2>Page show/hide events</h2>
8282
});
8383
</code>
8484
</pre>
85+
<p>Also, for these handlers to be invoked during the initial page load, you must bind them before jQuery Mobile executes. This can be done in the <code>mobileinit</code> handler, as described on the <a href="globalconfig.html">global config</a> page.
8586
<h2>Page initialization events</h2>
8687

8788
<p>Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an <code>input</code> element with a <code>type</code> of <code>range</code> will automatically generate a custom slider control.</p>
@@ -95,10 +96,33 @@ <h2>Page initialization events</h2>
9596
<dd>Triggered on the page being initialized, after initialization occurs.</dd>
9697
</dl>
9798

99+
100+
<pre>
101+
<code>
102+
$('#aboutPage').live('pagebeforecreate',function(event){
103+
alert('This page was just inserted into the dom!');
104+
});
105+
106+
$('#aboutPage').live('pagecreate',function(event){
107+
alert('This page was just enhanced by jQuery Mobile!');
108+
});
109+
</code>
110+
</pre>
111+
98112
<p>Note that by binding to <code>pagebeforecreate</code> and returning <code>false</code>, you can prevent the page plugin from making its manipulations.</p>
99113

114+
<pre>
115+
<code>
116+
$('#aboutPage').live('pagebeforecreate',function(event){
117+
//run your own enhancement scripting here...
118+
return false;
119+
});
120+
121+
</code>
122+
</pre>
123+
100124
<div class="ui-body ui-body-e">
101-
<p><strong>Note on Page IDs: </strong> Page elements in jQuery Mobile utilize the <code>ID</code> attribute for storing the location from which they came. When you place an <code>ID</code> attribute on a page that is brought into jQuery Mobile's single-page environment through Ajax, jQuery Mobile wraps that page with a new "page" <code>div</code> element, preserving any CSS references to your <code>ID</code>. However, this means that your <code>ID</code> attribute is no longer on the "page" element, so you must keep this in mind when binding to page events (<code>pagebeforecreate</code>, <code>pagecreate</code>, etc). To avoid issues, try using a class if possible. </p>
125+
<p><strong>Note on Page IDs in Alpha 2 release (<em>no longer an issue</em>): </strong> In jQuery Mobile Alpha 2 and older, page elements utilized the <code>ID</code> attribute for storing the location from which they came. When you place an <code>ID</code> attribute on a page that is brought into jQuery Mobile's single-page environment through Ajax, jQuery Mobile wraps that page with a new "page" <code>div</code> element, preserving any CSS references to your <code>ID</code>. However, this means that your <code>ID</code> attribute is no longer on the "page" element, so you must keep this in mind when binding to page events (<code>pagebeforecreate</code>, <code>pagecreate</code>, etc). To avoid issues, try using a class if possible. </p>
102126
</div>
103127

104128

docs/api/globalconfig.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ <h2>Configurable options</h2>
8686
<dt>ajaxFormsEnabled (<em>boolean</em>, default: true):</dt>
8787
<dd>jQuery Mobile will automatically handle form submissions through Ajax, when possible.</dd>
8888

89-
90-
<dt>transitions (<em>array</em>, default: ['slide', 'slideup', 'slidedown', 'pop', 'flip', 'fade']):</dt>
91-
<dd>Available CSS transitions in the CSS.</dd>
92-
93-
9489
<dt>defaultTransition (<em>string</em>, default: 'slide'):</dt>
9590
<dd>Set the default transition for page changes that use Ajax. Set to 'none' for no transitions by default.</dd>
9691

docs/api/methods.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ <h1>Methods</h1>
120120
<dd>Examples:
121121
<pre>
122122
<code>
123-
<strong>//scroll to Y 100px</strong>
124-
$.mobile.silentScroll(100);
123+
<strong>//add a 400px breakpoint</strong>
124+
$.mobile.addResolutionBreakpoints(400);
125+
<strong>//add 2 more breakpoints</strong>
126+
$.mobile.addResolutionBreakpoints([600,800]);
125127
</code>
126128
</pre>
127129

docs/forms/docs-forms.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,28 @@ <h2>Form structure</h2>
3434
<h2>Markup Conventions</h2>
3535
<p>When constructing forms to be used in jQuery Mobile, most of the standard guidelines used to create forms that submit via normal HTTP post or get still apply. However, one thing to keep in mind is that the <code>id</code> attributes of form controls need to be not only unique on a given page, but also unique across the pages in a site. This is because jQuery Mobile's single-page navigation model allows many different "pages" to be present in the DOM at the same time, so you must be careful to use unique <code>id</code> attributes so there will be only one of each in the DOM (and of course, be sure to pair them properly with <code>label</code> elements via the <code>for</code> attribute).</p>
3636

37+
<h2>Auto-initialization of form elements</h2>
38+
<p>By default, jQuery Mobile will automatically enhance certain native form controls into rich touch-friendly components. This is handled internally by finding form elements by tag name and running a plugin method on them, so for instance, a <code>select</code> element will be found and initialized with the "selectmenu" plugin, while an <code>input</code> element with a <code>type="checkbox"</code> will be enhanced with the "checkboxradio" plugin. Once initialized, you can address these enhanced components programmatically through their jQuery UI widget API methods (see documentation on available methods here: <a href="plugin-eventsmethods.html">Form Plugin Methods</a>). </p>
39+
40+
<h2>Preventing auto-initialization of form elements</h2>
41+
<p>If you'd prefer that a particular form control be left untouched by jQuery Mobile, simply give that element the attribute <code>data-role="none"</code>. For example:</p>
42+
<pre><code>
43+
&lt;label for=&quot;foo&quot;&gt;
44+
&lt;select name=&quot;foo&quot; id=&quot;foo&quot; <strong>data-role=&quot;none&quot;</strong>&gt;
45+
&lt;option value="a" &gt;A&lt;/option&gt;
46+
&lt;option value="b" &gt;B&lt;/option&gt;
47+
&lt;option value="c" &gt;C&lt;/option&gt;
48+
&lt;/select&gt;
49+
</code></pre>
50+
51+
52+
<p>Or, if you'd like to prevent auto-initialization without adding attributes to your markup, you can customize the selector that is used for preventing auto-initialization by setting the page plugin's <code>keepNative</code> option (which defaults to <code>"[data-role="none"]</code>. Be sure to configure this option inside an event handler bound to the <code>mobileinit</code> event, so that it applies to the first page as well as subsequent pages that are loaded.</p>
53+
<pre><code>
54+
$(document).bind('mobileinit',function(){
55+
<strong>$.mobile.page.prototype.options.keepNative = "select, input.foo, textarea.bar";</strong>
56+
});
57+
</pre></code>
58+
3759
<h2>Dynamic form layout</h2>
3860

3961
<p>In jQuery Mobile, all form elements are designed to be a flexible width so they will comfortably fit the width of any mobile device. One optimization built into the framework is that we present labels and form elements differently based on screen width. </p>

docs/forms/forms-sample.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ <h2>Form submission</h2>
3232
<option value="Overnight shipping">Overnight</option>
3333
</select>
3434
</div>
35-
36-
<button type="submit" data-theme="a">Submit</button>
35+
<button type="submit" data-theme="a" name="submit" value="submit-value">Submit</button>
3736
</fieldset>
3837
</form>
3938

0 commit comments

Comments
 (0)