Skip to content

Commit f50a555

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 70a1513 + 0810af3 commit f50a555

File tree

212 files changed

+2633
-425
lines changed

Some content is hidden

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

212 files changed

+2633
-425
lines changed

categories.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
<category name="Widgets" slug="widgets">
44
<desc></desc>
55
</category>
6+
<category name="Events" slug="events">
7+
<desc></desc>
8+
</category>
9+
<category name="Miscellaneous" slug="misc">
10+
<desc></desc>
11+
</category>
612
<category name="All" slug="all"/>
713
</categories>

entries/footer.xml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0"?>
2+
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?>
3+
<entry name="footer" namespace="fn" type="widget" widgetnamespace="mobile">
4+
<title>Footer Widget</title>
5+
<desc>The <strong>Footer bar</strong> is usually the last element inside each mobile page, and tends to be more freeform than the header in terms of content and functionality, but typically contains a combination of text and buttons.</desc>
6+
<longdesc>
7+
<h2>Footer bar structure</h2>
8+
<p>The <code>footer</code> bar has the same basic structure as the header except it uses the <code> data-role</code> attribute value of <code>footer</code>.</p>
9+
10+
<pre>
11+
<span class="nt">&lt;div</span> <strong><span class="na">data-role=</span><span class="s">"footer"</span></strong><span class="nt">&gt;</span>
12+
<span class="nt">&lt;h4&gt;</span>Footer content<span class="nt">&lt;/h4&gt;</span>
13+
<span class="nt">&lt;/div&gt;</span>
14+
</pre>
15+
16+
<p>The <code>footer</code> toolbar will be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
17+
<iframe src="/resources/footer/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>
18+
19+
<p>The page footer is very similar to the header in terms of options and configuration. The primary difference is that the footer is designed to be less structured than the header to allow more flexibility, so the framework doesn't automatically reserve slots for buttons to the left or right as it does in headers.</p>
20+
<p>Since footers do not have the same prescriptive markup conventions as headers, we recommend using layout grids or writing custom styles to achieve the design you want.</p>
21+
22+
<h2>Adding buttons</h2>
23+
<p>Any link or valid button markup added to the footer will automatically be turned into a button. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons it contains.</p>
24+
<p>By default, toolbars don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a <code>class="ui-bar"</code> to the footer.</p>
25+
26+
27+
<pre><code>
28+
&lt;div data-role=&quot;footer&quot; class=&quot;ui-bar&quot;&gt;
29+
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;plus&quot;&gt;Add&lt;/a&gt;
30+
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-u&quot;&gt;Up&lt;/a&gt;
31+
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-d&quot;&gt;Down&lt;/a&gt;
32+
&lt;/div&gt;
33+
</code></pre>
34+
35+
<p>This creates this toolbar with buttons sitting in a row
36+
<iframe src="/resources/footer/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>
37+
38+
<p>Note that <code>.ui-bar</code> should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element.</p>
39+
40+
<p>To group buttons together into a button set, wrap the links in a wrapper with <code> data-role=&quot;controlgroup&quot;</code> and <code>data-type=&quot;horizontal&quot;</code> attributes.</p>
41+
42+
<code>&lt;div data-role=&quot;controlgroup&quot; data-type=&quot;horizontal&quot;&gt;</code>
43+
44+
<p>This creates a grouped set of buttons:
45+
<iframe src="/resources/footer/example3.html" style="width:100%;height:90px;border:0px"></iframe></p>
46+
47+
<h2>Adding form elements</h2>
48+
<p>Form elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar. We recommend using mini-sized form elements in toolbars by adding the <code>data-mini="true"</code> attribute:
49+
<iframe src="/resources/footer/example4.html" style="width:100%;height:90px;border:0px"></iframe></p>
50+
51+
52+
53+
<h2>Fixed &amp; Persistent footers</h2>
54+
<p>In situations where the footer is a global navigation element, you may want it to appear fixed so it doesn't scroll out of view. It's also possible to make a fixed toolbar persistent so it appears to not move between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.</p>
55+
<p>To make a footer persistent between transitions, add the <code>data-id</code> attribute to the footer of all relevant pages and use the same <code>id</code> value for each. For example, by adding <code>data-id="myfooter"</code> to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. <strong>This effect will only work correctly if the header and footer toolbars are set to <code>data-position="fixed"</code> so they are in view during the transition.</strong></p>
56+
</longdesc>
57+
<added>1.0</added>
58+
<example>
59+
<desc>A basic example of a footer</desc>
60+
<code><![CDATA[]]></code>
61+
<html><![CDATA[
62+
<div data-role="footer">
63+
<h4>Footer content</h4>
64+
</div> ]]></html>
65+
</example>
66+
<category slug="widgets"/>
67+
</entry>

entries/grid-layout.xml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0"?>
2+
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?>
3+
<entry name="grid-layout" namespace="fn" type="misc" widgetnamespace="mobile">
4+
<title>Grid Layout</title>
5+
<desc>Multi-column layout grids</desc>
6+
<longdesc>
7+
<p>Using multiple column layouts isn't generally recommended on a mobile device because of the narrow screen width, but there are times where you may need to place small elements side-by-side (like buttons or navigation tabs, for example).</p>
8+
<p>The jQuery Mobile framework provides a simple way to build CSS-based columns through a block style class convention called <code>ui-grid</code>. </p>
9+
<p>There are four preset layouts that can be used in any situation that requires columns:</p>
10+
<ul>
11+
<li><strong>two</strong>-column (using the <code>ui-grid-a</code> class)</li>
12+
<li><strong>three</strong>-column (using the <code>ui-grid-b</code> class)</li>
13+
<li><strong>four</strong>-column (using the <code>ui-grid-c</code> class)</li>
14+
<li><strong>five</strong>-column (using the <code>ui-grid-d</code> class)</li>
15+
</ul>
16+
<p>Grids are 100% width, completely invisible (no borders or backgrounds) and don't have padding or margins, so they shouldn't interfere with the styles of elements placed inside them. </p>
17+
<p>Within the grid container, child elements are assigned <code>ui-block-a/b/c/d/e</code> in a sequential manner which makes each "block" element float side-by-side, forming the grid. The <code>ui-block-a</code> class essentially clears the floats which will start a new line (see multiple row grids, below).</p>
18+
19+
<h2>Two column grids</h2>
20+
21+
<p>To build a two-column (50/50%) layout, start with a container with a <code>class</code> of <code>ui-grid-a</code>, and add two child containers inside it classed with <code>ui-block-a</code> for the first column and <code>ui-block-b</code> for the second:</p>
22+
23+
<pre><code>
24+
&lt;div class="ui-grid-a"&gt;
25+
&lt;div class="ui-block-a"&gt;&lt;strong&gt;I'm Block A&lt;/strong&gt; and text inside will wrap&lt;/div&gt;
26+
&lt;div class="ui-block-b"&gt;&lt;strong&gt;I'm Block B&lt;/strong&gt; and text inside will wrap&lt;/div&gt;
27+
&lt;/div&gt;&lt;!-- /grid-a --&gt;
28+
</code></pre>
29+
30+
<p>The above markup produces the following content layout:</p>
31+
<iframe src="/resources/grid-layout/example1.html" style="width:100%;height:90px;border:0"></iframe>
32+
33+
<p>As you see above, by default grid blocks have no visual styling; they simply present content side-by-side.</p>
34+
<p>Grid classes can be applied to any container. In this next example, we add <code>ui-grid-a</code> to a <code>fieldset</code>, and apply the <code>ui-block</code> classes to the container of each of the two buttons inside to stretch them each to 50% of the screen width:</p>
35+
36+
<pre><code>
37+
&lt;fieldset class="ui-grid-a"&gt;
38+
&lt;div class="ui-block-a"&gt;&lt;button type="submit" data-theme="c"&gt;Cancel&lt;/button&gt;&lt;/div&gt;
39+
&lt;div class="ui-block-b"&gt;&lt;button type="submit" data-theme="b"&gt;Submit&lt;/button&gt;&lt;/div&gt;
40+
&lt;/fieldset&gt;
41+
</code></pre>
42+
43+
<iframe src="/resources/grid-layout/example2.html" style="width:100%;height:90px;border:0"></iframe>
44+
<p>Please note that the framework adds left and right margin to buttons in a grid. For a single button you can use a container with class <code>ui-grid-solo</code> and wrap the button in a div with class <code>ui-block-a</code> like the example below. This way the button will get the same margin.</p>
45+
46+
<pre><code>
47+
&lt;div class="ui-grid-a"&gt;
48+
&lt;div class="ui-block-a"&gt;&lt;button type="button" data-theme="c"&gt;Previous&lt;/button&gt;&lt;/div&gt;
49+
&lt;div class="ui-block-b"&gt;&lt;button type="button" data-theme="c"&gt;Next&lt;/button&gt;&lt;/div&gt;
50+
&lt;/div&gt;
51+
&lt;div class="ui-grid-solo"&gt;
52+
&lt;div class="ui-block-a"&gt;&lt;button type="v" data-theme="b"&gt;More&lt;/button&gt;&lt;/div&gt;
53+
&lt;/div&gt;
54+
</code></pre>
55+
56+
<iframe src="/resources/grid-layout/example3.html" style="width:100%;height:130px;border:0"></iframe>
57+
58+
<p>Theme classes (not data-theme attributes) from the <a href="../api/themes.html" class="ui-link">theming system</a> can be added to an element, including grids. On the blocks below, we're adding two classes: <code>ui-bar</code> to add the default bar padding and <code>ui-bar-e</code> to apply the background gradient and font styling for the "e" toolbar theme swatch. For illustration purposes, an inline <code>style="height:120px"</code> attribute is also added to each grid to set each to a standard height. </p>
59+
60+
<iframe src="/resources/grid-layout/example4.html" style="width:100%;height:150px;border:0"></iframe>
61+
62+
<h3>Three-column grids</h3>
63+
64+
<p>The other grid layout configuration uses <code>class=ui-grid-b</code> on the parent, and 3 child container elements, each with its respective <code>ui-block-a/b/c</code> class, to create a three-column layout (33/33/33%). Note: These blocks are also styled with theme classes so the grid layout is clearly visible.</p>
65+
66+
<pre><code>
67+
&lt;div class="ui-grid-b"&gt;
68+
&lt;div class="ui-block-a"&gt;Block A&lt;/div&gt;
69+
&lt;div class="ui-block-b"&gt;Block B&lt;/div&gt;
70+
&lt;div class="ui-block-c"&gt;Block C&lt;/div&gt;
71+
&lt;/div&gt;&lt;!-- /grid-b --&gt;
72+
</code></pre>
73+
74+
<p>This will produce a 33/33/33% grid for our content.</p>
75+
<iframe src="/resources/grid-layout/example5.html" style="width:100%;height:150px;border:0"></iframe>
76+
77+
<p>And an example of a 3 column grid with buttons inside:</p>
78+
<iframe src="/resources/grid-layout/example6.html" style="width:100%;height:90px;border:0"></iframe>
79+
80+
<h3>Four-column grids</h3>
81+
82+
<p>A four-column, 25/25/25/25% grid is created by specifying <code>class=ui-grid-c</code> on the parent and adding a fourth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.</p>
83+
84+
<iframe src="/resources/grid-layout/example7.html" style="width:100%;height:150px;border:0"></iframe>
85+
86+
<h2>Five-column grids</h2>
87+
88+
<p>A five-column, 20/20/20/20/20% grid is created by specifying <code>class=ui-grid-d</code> on the parent and adding a fifth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.</p>
89+
90+
<iframe src="/resources/grid-layout/example8.html" style="width:100%;height:150px;border:0"></iframe>
91+
92+
<h3>Multiple row grids</h3>
93+
94+
<p>Grids are designed to wrap to multiple rows of items. For example, if you specify a 3-column grid (ui-grid-b) on a container that has nine child blocks, it will wrap to 3 rows of 3 items each. There is a CSS rule to clear the floats and start a new line when the <code>class=ui-block-a</code> is seen so make sure to assign block classes in a repeating sequence (a, b, c, a, b, c, etc.) that maps to the grid type:</p>
95+
<iframe src="/resources/grid-layout/example9.html" style="width:100%;height:450px;border:0"></iframe>
96+
97+
<h3>Grids in toolbars</h3>
98+
99+
<p>Grids are helpful for creating layouts within a toolbar. Here's a footer with a 4 column grid.</p>
100+
<iframe src="/resources/grid-layout/example10.html" style="width:100%;height:90px;border:0"></iframe>
101+
102+
</longdesc>
103+
<added>1.0</added>
104+
<options>
105+
</options>
106+
<events>
107+
</events>
108+
<methods>
109+
</methods>
110+
<example>
111+
<desc>A basic example of grid layout</desc>
112+
<code><![CDATA[]]></code>
113+
<html><![CDATA[<fieldset class="ui-grid-a">
114+
<div class="ui-grid-a">
115+
<div class="ui-block-a"><strong>I'm Block A</strong> and text inside will wrap.</div>
116+
<div class="ui-block-b"><strong>I'm Block B</strong> and text inside will wrap.</div>
117+
</div><!-- /grid-a -->]]></html>
118+
</example>
119+
<category slug="misc"/>
120+
</entry>

entries/hashtag.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0"?>
2+
<entry name="hashchange" type="event" return="jQuery">
3+
<title>.hashchange()</title>
4+
<desc>Enables bookmarkable #hash history.</desc>
5+
<longdesc>
6+
<p>The jQuery Mobile <code>.hashchange()</code> event handler enables very basic bookmarkable #hash history by providing a callback function bound to the window.onhashchange event. The onhashchange event fires when a window's hash changes.</p>
7+
<p>In browsers that support it, the native HTML5 window.onhashchange event is used. In IE6/7 (and IE8 operating in "IE7 compatibility" mode), a hidden Iframe is created to allow the back button and hash-based history to work.</p>
8+
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
9+
<pre>
10+
<code><![CDATA[
11+
$(function(){
12+
// Bind an event to window.onhashchange that, when the hash changes, gets the
13+
// hash and adds the class "selected" to any matching nav link.
14+
$(window).hashchange( function(){
15+
var hash = location.hash;
16+
17+
// Set the page title based on the hash.
18+
document.title = 'The hash is ' + ( hash.replace( /^#/, '' ) || 'blank' ) + '.';
19+
20+
// Iterate over all nav links, setting the "selected" class as-appropriate.
21+
$('#nav a').each(function(){
22+
var that = $(this);
23+
that[ that.attr( 'href' ) === hash ? 'addClass' : 'removeClass' ]( 'selected' );
24+
});
25+
})
26+
// Since the event is only triggered when the hash changes, we need to trigger
27+
// the event now, to handle the hash the page may have loaded with.
28+
$(window).hashchange();
29+
});
30+
]]></code>
31+
</pre>
32+
<p>iFrame source: <span id="hashtagIframeLink">example1.html</span>
33+
<iframe id="hashtagIframe" src="/resources/hashchange/example1.html" style="width:100%;height:90px;border:0px"></iframe>
34+
</p>
35+
</longdesc>
36+
<added>1.0</added>
37+
<signature>
38+
<argument name="callback" type="Function" optional="true">
39+
<desc>A function to invoke after the onhashchange event is fired.</desc>
40+
</argument>
41+
</signature>
42+
<category slug="events"/>
43+
</entry>

0 commit comments

Comments
 (0)