diff --git a/categories.xml b/categories.xml index 8e21d9a1..09dc2692 100644 --- a/categories.xml +++ b/categories.xml @@ -2,7 +2,22 @@ @@ -13,6 +28,11 @@ + + + + diff --git a/entries/button.xml b/entries/button.xml index 1462dde0..e6c693a8 100644 --- a/entries/button.xml +++ b/entries/button.xml @@ -1,340 +1,119 @@ - + Button Widget Creates a button widget -

Buttons are coded with standard HTML anchor and input elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. Use anchor links (a elements) to mark up navigation buttons, and input or button elements for form submission.

- -

Styling links as buttons

-

In the main content block of a page, you can style any anchor link as a button by adding the data-role="button" attribute. The framework will enhance the link with markup and classes to style the link as a button. For example, this markup:

+

Buttons

+

Buttons are coded with standard HTML input elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device.

-

-<a href="index.html" data-role="button">Link button</a>
-
- -

Produces this link-based button: -

- -

Note: Links styled like buttons have all the same visual options as true form-based buttons below, but there are a few important differences. Link-based buttons aren't part of the button plugin and only just use the underlying buttonMarkup plugin to generate the button styles so the form button methods (enable, disable, refresh) aren't supported. If you need to disable a link-based button (or any element), it's possible to apply the disabled class ui-disabled yourself with JavaScript to achieve the same effect.

- -

-<a href="index.html" data-role="button" class="ui-disabled">Link button</a>
-
+

Form buttons

-

Produces this disabled link-based button: - -

- -

Mini version

- -

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the button to create a mini version.

+

For ease of styling, the framework automatically converts any input element with a type of submit, reset, or button into a custom styled button - there is no need to add the data-role="button" attribute. However, if needed, you can directly call the plugin on any selector, just like any jQuery plugin:


-<a href="index.html" data-role="button" data-mini="true">Link button</a>
+$( "[type='submit']" ).button();
 
-

This will produce a button that is not as tall as the standard version and has a smaller text size. - -

- -

Form buttons

- -

For ease of styling, the framework automatically converts any button or input element with a type of submit, reset, or button into a custom styled button - there is no need to add the data-role="button" attribute. However, if needed, you can directly call the button plugin on any selector, just like any jQuery plugin:

- +

Input type="button" based :


-$( "[type="submit"]" ).button();
-
- -

Button based button:

- -
	
-<button>Button element</button>
-
- - - -

Input type="button" based button:

-
	
 <input type="button" value="Button" />
 
- -

Input type="submit" based button:

+ +

Input type="submit" based :


 <input type="submit" value="Submit Button" />
 
- -

Input type="reset" based button:

-

-<input type="reset" value="Reset Button" />
-
- - - -

Adding Icons to Buttons

-

The jQuery Mobile framework includes a selected set of icons most often needed for mobile apps. To minimize download size, jQuery Mobile includes a single white icon sprite, and automatically adds a semi-transparent black circle behind the icon to ensure that it has good contrast on any background color.

- - -

An icon can be added to a button by adding a data-icon attribute on the anchor specifying the icon to display. For example, the following markup:

- -

-<a href="index.html" data-role="button" data-icon="delete">Delete</a>
-
- - - -

Icon set

- -

The following data-icon attributes can be referenced to create the icons shown below: -

- -

Icon positioning

-

By default, all icons in buttons are placed to the left of the button text. -

- -

This default may be overridden using the data-iconpos attribute to set the icon to the right, above (top) or below (bottom) the text. For example, the markup:

-

-<a href="index.html" data-role="button" data-icon="delete" data-iconpos="right">Delete</a>
-
- - - -

You can also create an icon-only button, by setting the data-iconpos attribute to notext. The button plugin will hide the text on-screen, but add it as a title attribute on the link to provide context for screen readers and devices that support tooltips. For example, replacing data-iconpos="right" on the previous example with data-iconpos="notext":

+

Input type="reset" based :


-<a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext">Delete</a>
+<input type="reset" value="Reset Button" />
 
-

Creates this icon-only button: -

- -

Mini & Inline

-

The mini and inline attributes can be added to produce more compact buttons: -

- -

Custom Icons

-

To use custom icons, specify a data-icon value that has a unique name like myapp-email and the button plugin will generate a class by prefixing ui-icon- to the data-icon value and apply it to the button: ui-icon-myapp-email.

-

You can then write a CSS rule in your stylesheet that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency with the rest of the icons, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.

-

In this example, we're just pointing to a standalone icon image, but you could just as easily use an icon sprite and specify the positioning instead, just like the icon sprite we use in the framework.

- -
.ui-icon-myapp-email {
-	background-image: url( "app-icon-email.png" );
-}
- -

This will create the standard resolution icon, but many devices now have very high resolution displays, like the retina display on the iPhone 4. To add a HD icon, create an icon that is 36x36 pixels (exactly double the 18 pixel size), and add second a rule that uses the -webkit-min-device-pixel-ratio: 2 media query to target a rule only to high resolution displays. Specify the background image for the HD icon file and set the background size to 18x18 pixels which will fit the 36 pixel icon into the same 18 pixel space. The media query block can wrap multiple icon rules:

-

-@media only screen and (-webkit-min-device-pixel-ratio: 2) {
-	.ui-icon-myapp-email {
-		background-image: url( "app-icon-email-highres.png" );
-		background-size: 18px 18px;
-	}
-	...more HD icon rules go here...
-}
-
- -

Icons and themes

-

The semi-transparent black circle behind the white icon ensures good contrast on any background color so it works well with the jQuery Mobile theming system. Here are examples of the same icons sitting on top of a range of different color swatches with themed buttons.

- -

-

- -

Inline buttons

- -

By default, all buttons in the body content are styled as block-level elements so they fill the width of the screen: -

- - -

If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.

- -

-<a href="index.html" data-role="button" data-inline="true">Cancel</a>
-<a href="index.html" data-role="button" data-inline="true" data-theme="b">Save</a>
-
+ - - - -

If you want buttons to sit side-by-side but stretch to fill the width of the screen, you can use the content column grids to put normal full-width buttons into 2- or 3-columns.

+ +

The widget adds a wrapper div around the input.

+

In the example below, pre-rendered markup for a is provided. The attribute data-corners="false" is explicitly specified, since the absence of the ui-corner-all class on the wrapper element indicates that the "corners" widget option is to be false.

-

Icon example

- - - -

Grouped buttons

- -

Occasionally, you may want to visually group a set of buttons to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute - the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together.

-

-<div data-role="controlgroup">
-	<a href="index.html" data-role="button">Yes</a>
-	<a href="index.html" data-role="button">No</a>
-	<a href="index.html" data-role="button">Maybe</a>
+<div class="ui-btn ui-input-btn ui-shadow">
+	The Button
+	<input type="button" data-corners="false" data-enhanced="true" value="The Button"></input>
 </div>
 
-

By default, grouped buttons are presented as a vertical list: -

- -

By adding the data-type="horizontal" attribute to the controlgroup container, you can swap to a horizontal-style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. (Be aware that these will wrap to multiple lines if the number of buttons or the overall text length is too wide for the screen.)

- -

-

- -

Labels

-

Because the label element will be associated with each individual input or button and will be hidden for styling purposes, we recommend wrapping the buttons in a fieldset element that has a legend which acts as the combined label for the group. Using the label as a wrapper around an input prevents the framework from hiding it, so you have to use the for attribute to associate the label with the input.

- -

Theming buttons

- -

jQuery Mobile has a rich theming system that gives you full control of how buttons are styled. When a link is added to a container, it is automatically assigned a theme swatch letter that matches its parent bar or content box to visually integrate the button into the parent container, like a chameleon. So a button placed inside a content container with a theme of "a" (black in the default theme) will be automatically assigned the button theme of "a" (charcoal in the default theme). Here are examples of the button theme pairings in the default theme. All buttons have the same HTML markup: -

- -

Assigning theme swatches

-

Buttons can be manually assigned any of the button color swatches from the theme to add visual contrast with the container they sit inside by adding the data-theme attribute on the button markup and specifying a swatch letter.

+ -
			
-<a href="index.html" data-role="button" data-theme="a">Swatch a</a>			
-
- -

Here are 5 buttons with icons that have a different swatch letter assigned via the data-theme attribute. -

- -

Theme variations

- -

-
1.0 - + + - - - triggered when a form button is created - - - - - + - - enable a disabled form button. -

-$( "[type='submit']" ).button( "enable" );
-
-
-
- - disable a form button. -

-$( "[type='submit']" ).button( "disable" );
-
-
-
+ + + + - update the form button. -

If you manipulate a form button via JavaScript, you must call the refresh method on it to update the visual styling.

+ update the form . +

If you manipulate a form via JavaScript, you must call the refresh method on it to update the visual styling.


 $( "[type='submit']" ).button( "refresh" );
 
@@ -343,12 +122,14 @@ $( "[type='submit']" ).button( "refresh" );
- A basic example of a button + A basic example of a diff --git a/entries/buttonMarkup.xml b/entries/buttonMarkup.xml new file mode 100644 index 00000000..66859c76 --- /dev/null +++ b/entries/buttonMarkup.xml @@ -0,0 +1,290 @@ + + + + .buttonMarkup() + Adds button styling to an element + + Note: .buttonMarkup() is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. You can now assign the full range of button style options to your button or a elements by simply adding classes. +

+

Transition to class-based styling

+ Keeping in mind the followings will make it easy for you to transition from the button styling based on data attributes to the class-based process: +
    +
  • When using icons, you must always specify an icon position class along with the icon class, because placing the icon to the left of the button's label is no longer the default. In the example below the class ui-btn-icon-left is added to make sure the icon (ui-icon-arrow-r) will be displayed. +
    
    +<a href="http://example.com/" class="ui-btn ui-icon-arrow-r ui-btn-icon-left ui-corner-all ui-shadow ui-btn-inline">Example</a>
    +
    + +
  • +
  • Although the style-related data attributes are deprecated, the data attributes related to linking behavior remain unchanged. In the example below the button is styled using classes, but the data attributes related to linking are retained. +
    
    +<a href="/" data-rel="external" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-home ui-btn-icon-left">Home</a>
    +
    + +
  • +
  • We do not recommend mixing styling based on data attributes and class-based styling during the deprecation period.
  • +
+

Button markup

+

You can use .buttonMarkup() to style any element as a button that is attractive and useable on a mobile device. It is a convenience function that allows you to manipulate the classes related to button styling. For each element in the set of matched elements this function converts the options parameter to a list of classes to be applied to the element, while respecting the element's existing classes that are not related to button styling. You may also set the parameter overwriteClasses to true for performance reasons. When overwriteClasses is set to true the function discards existing classes and applies the classes corresponding to the options provided.

+ +

Autoinitialization

+

The framework will automatically apply button styling to anchors that have the attribute data-role="button" as well as button elements, anchors contained directly in bars and controlgroup widgets. You can specify button styling options via data attributes that you add to the anchor or button element. The data attribute corresponding to each .buttonMarkup() option is documented in the options of .buttonMarkup(). The example below shows the markup needed for an anchor-based button.

+ +

+<a href="index.html" data-role="button">Link button</a>
+
+ +

Produces this anchor-based button: +

+ +

Button based button:

+ +

.buttonMarkup() also automatically enhances button elements such as the one below:

+ +

+<button>Button element</button>
+
+ + + +

Disabled appearance

+

You can style an anchor as disabled by adding the class ui-state-disabled.

+

Note: It is not inherently possible to "disable" anchors. The class ui-state-disabled merely adds styling to make the anchor look disabled. It does not provide the same level of functionality as the disabled attribute of a form button. It may still be possible to follow the anchor using navigation methods that do not involve the pointing device.

+

+<a href="index.html" data-role="button" class="ui-state-disabled">Link button</a>
+
+ +

Produces an anchor-based button styled as disabled: + +

+ +

In the case of button elements, you should apply the ui-state-disabled class when you set the button element's disabled attribute:

+

+// Toggle the class ui-state-disabled in conjunction with modifying the value
+// of the button element's "disabled" property
+$( "button#myButton" )
+	.prop( "disabled", isDisabled )
+	.toggleClass( "ui-state-disabled", isDisabled );
+
+

Inline buttons

+ +

By default, all buttons in the body content are styled as block-level elements so they fill the width of the screen: +

+ +

If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.

+ +

+<a href="index.html" data-role="button" data-inline="true">Cancel</a>
+<a href="index.html" data-role="button" data-inline="true" data-theme="b">Save</a>
+
+ + + +

If you want buttons to sit side-by-side but stretch to fill the width of the screen, you can use the content column grids to put normal full-width buttons into 2- or 3-columns.

+ +

Mini version

+ +

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the button to create a mini version.

+ +

+<a href="index.html" data-role="button" data-mini="true">Link button</a>
+
+ +

This will produce a button that is not as tall as the standard version and has a smaller text size. + +

+ +

Adding Icons to Buttons

+

The jQuery Mobile framework includes a selected set of icons most often needed for mobile apps. To minimize download size, jQuery Mobile includes a single white icon sprite, and automatically adds a semi-transparent black circle behind the icon to ensure that it has good contrast on any background color.

+ +

An icon can be added to a button by adding a data-icon attribute on the anchor specifying the icon to display. For example:

+ +

+<a href="index.html" data-role="button" data-icon="delete">Delete</a>
+
+ + + +

Icon set

+ +

The following data-icon attributes can be referenced to create the icons shown below: +

+ +

Icon positioning

+

By default, all icons in buttons are placed to the left of the button text. +

+ +

This default may be overridden using the data-iconpos attribute to set the icon to the right, above (top) or below (bottom) the text. For example:

+

+<a href="index.html" data-role="button" data-icon="delete" data-iconpos="right">Delete</a>
+
+ + + +

You can also create an icon-only button, by setting the data-iconpos attribute to notext. The button plugin will hide the text on-screen, but add it as a title attribute on the link to provide context for screen readers and devices that support tooltips. For example, replacing data-iconpos="right" on the previous example with data-iconpos="notext":

+ +

+<a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext">Delete</a>
+
+ +

Creates this icon-only button: +

+ +

Mini & Inline

+

The mini and inline attributes can be added to produce more compact buttons: +

+ +

Custom Icons

+

To use custom icons, specify a data-icon value that has a unique name like myapp-email and the button plugin will generate a class by prefixing ui-icon- to the data-icon value and apply it to the button: ui-icon-myapp-email.

+

You can then write a CSS rule in your stylesheet that targets the ui-icon-myapp-email:after class to specify the icon background source. The framework contains an inline (data URI) SVG test and adds class ui-nosvg to the html element if this is not supported. If you are using SVG icons you can use this class to provide a fallback to external PNG icons.

+ +

+.ui-icon-myapp-email:after {
+	background-image: url('data:image/svg+xml;...');
+}
+.ui-nosvg .ui-icon-myapp-email:after {
+	background-image: url( "app-icon-email.png" );
+}
+
+ +

Icons and themes

+

The semi-transparent black circle behind the white icon ensures good contrast on any background color so it works well with the jQuery Mobile theming system. Here are examples of the same icons sitting on top of a range of different color swatches with themed buttons.

+ +

+

+ +

Icon example

+ + + +

Grouped buttons

+ +

Occasionally, you may want to visually group a set of buttons to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute - the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together.

+ +

+<div data-role="controlgroup">
+	<a href="index.html" data-role="button">Yes</a>
+	<a href="index.html" data-role="button">No</a>
+	<a href="index.html" data-role="button">Maybe</a>
+</div>
+
+ +

By default, grouped buttons are presented as a vertical list: +

+ +

By adding the data-type="horizontal" attribute to the controlgroup container, you can swap to a horizontal-style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. (Be aware that these will wrap to multiple lines if the number of buttons or the overall text length is too wide for the screen.)

+ +

+

+ +

Labels

+

Because the label element will be associated with each individual input or button and will be hidden for styling purposes, we recommend wrapping the buttons in a fieldset element that has a legend which acts as the combined label for the group. Using the label as a wrapper around an input prevents the framework from hiding it, so you have to use the for attribute to associate the label with the input.

+ +

Theming button-styled elements

+ +

jQuery Mobile has a rich theming system that gives you full control of how buttons are styled. When a link is added to a container, it is automatically assigned a theme swatch letter that matches its parent bar or content box to visually integrate the button into the parent container, like a chameleon. So a button placed inside a content container with a theme of "a" will be automatically assigned the button theme of "a". Here are examples of the button theme pairings in the default theme. All buttons have the same HTML markup: +

+ +

Assigning theme swatches

+

Buttons can be manually assigned any of the button color swatches from the theme to add visual contrast with the container they sit inside by adding the data-theme attribute on the button markup and specifying a swatch letter.

+ +

+<a href="index.html" data-role="button" data-theme="b">Swatch b</a>
+
+ +

Here are 2 buttons with icons that have a different swatch letter assigned via the data-theme attribute. +

+ +

Theme variations

+ +

+ +
+ + + + Adds the class ui-corner-all when true and removes it when false. This gives the button-styled element rounded corners. +

This option is also exposed as a data-attribute: data-corners="false"

+ +
+ +
+ + Adds an icon class by prefixing the value with the string "ui-icon-" and an icon position class based on the value of the iconpos option. +

For example, if the value is "arrow-r" and the value of the iconpos option is "left", then .buttonMarkup() will add the classes ui-icon-arrow-r and ui-btn-icon-left to each of the set of matched elements.

+

This option is also exposed as a data-attribute: data-icon="arrow-r"

+ +
+ +
+ + Adds an icon position class by prefixing the value with the string "ui-btn-icon-" when the button-styled element has an icon. +

For example, if the value is "right" and the button-styled element has an icon, then the class ui-btn-icon-right will be added to each of the set of matched elements.

+

This option is also exposed as a data-attribute: data-iconpos="right"

+ +
+ +
+ + + This option is deprecated in 1.4.0 and will be removed in 1.5.0. +

Adds the class ui-shadow-icon to each of the set of matched elements when set to true and the button-styled element has an icon.

+

This option is also exposed as a data-attribute: data-iconshadow="true"

+ +
+ +
+ + + Adds the class ui-btn-inline to each of the set of matched elements when set to true. +

This option is also exposed as a data-attribute: data-inline="true"

+ +
+ +
+ + + Adds the class ui-mini to each of the set of matched elements when set to true. +

This option is also exposed as a data-attribute: data-mini="true"

+ +
+ +
+ + + Adds the class ui-shadow to each of the set of matched elements when set to true. +

This option is also exposed as a data-attribute: data-shadow="false"

+ +
+ +
+ + + The value is a letter a-z identifying one of the color swatches in the current theme, or null. +

This option adds a class constructed by appending the string "ui-btn-" to the value to each of the set of matched elements. If set to null, no class is added, and the swatch is inherited from the element's parent.

+

For example, a value of "b" will cause the class ui-btn-b to be added to each of the set of matched elements.

+

This option is also exposed as a data-attribute: data-theme="b"

+ +
+ +
+
+ + + When set to true, .buttonMarkup() discards all classes on each of the set of matched elements and adds classes based on the values passed into the options argument. You can use this feature to increase performance in situations where the element you wish to enhance does not have any classes other than the button styling classes added by .buttonMarkup(). +

Conversely, when set to false, .buttonMarkup() first parses the existing classes found on each of the set of matched elements and computes a set of existing options based on the presence or absence of classes related to button styling already present. It separately records any classes unrelated to button styling. It then merges the options specified in the options parameter with the computed options such that the options passed in take precedence, and calculates a list of classes that must be present for those options to be expressed in the element's styling. It then re-applies the classes unrelated to button styling as well as the classes that reflect the new set of options. This means that calling .buttonMarkup() on the same element multiple times will have the expected effect:

+

+// Initially corners are turned off
+$( "#myAnchor" ).buttonMarkup({ corners: false });
+
+// Later on we turn off shadow - the lack of corners is retained
+$( "#myAnchor" ).buttonMarkup({ shadow: false });
+
+// Later still we turn corners back on - the lack of shadow is retained
+$( "#myAnchor" ).buttonMarkup({ corners: true });
+
+
+ +
+
+ +
diff --git a/entries/checkboxradio.xml b/entries/checkboxradio.xml index 480ac072..398d72ef 100644 --- a/entries/checkboxradio.xml +++ b/entries/checkboxradio.xml @@ -1,13 +1,13 @@ - + Checkboxradio Widget Creates a checkboxradio widget

Checkboxes

-

Checkboxes are used to provide a list of options where more than one can be selected. Traditional desktop checkboxes are not optimized for touch input so in jQuery Mobile, we style the label for the checkboxes so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

+

Checkboxes are used to provide a list of options where more than one can be selected. Traditional desktop checkboxes are not optimized for touch input so in jQuery Mobile, we style the label for the checkboxes so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

The checkbox controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible.

-

To create a single checkbox, add an input with a type="checkbox" attribute and a corresponding label. If the input isn’t wrapped in its corresponding label, be sure to set the for attribute of the label to match the id of the input so they are semantically associated.

+

To create a single checkbox, add an input with a type="checkbox" attribute and a corresponding label. If the input isn't wrapped in its corresponding label, be sure to set the for attribute of the label to match the id of the input so they are semantically associated.


 <label><input type="checkbox" name="checkbox-0" /> I agree </label>
@@ -20,7 +20,7 @@
 
 		

Mini version

-

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

+

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.


 <input type="checkbox" name="checkbox-mini" id="checkbox-mini-1" class="custom" data-mini="true" />
@@ -32,10 +32,13 @@
 
 		

Field containers & Legends

+

Optionally wrap the checkboxes in a container with class ui-field-contain to help visually group it in a longer form.

+

Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

+

Because checkboxes use the label element for the text displayed next to the checkbox form element, we recommend wrapping the checkbox in a fieldset element that has a legend which acts as the title for the question. Add the data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.


-<div data-role="fieldcontain">
+<div class="ui-field-contain">
 	<fieldset data-role="controlgroup">
 		<legend>Agree to the terms:</legend>
 		<input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" />
@@ -47,7 +50,7 @@
 
 		

Vertically grouped checkboxes

-

Checkboxes can also be used for grouped button sets where more than one button can be selected at once, such as the bold, italic and underline button group seen in word processors. To make a horizontal button set, add the data-type="horizontal" to the fieldset. +

Checkboxes can also be used for grouped button sets where more than one button can be selected at once, such as the bold, italic and underline button group seen in word processors. To make a horizontal button set, add the data-type="horizontal" to the fieldset.


@@ -57,11 +60,11 @@
 		

The framework will float the labels so they sit side-by-side on a line, hide the checkbox icons and only round the left and right edges of the group.

Radio buttons

-

Radio buttons are used to provide a list of options where only a single item can be selected. Traditional desktop radio buttons are not optimized for touch input so jQuery Mobile styles the label for the radio buttons so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

+

Radio buttons are used to provide a list of options where only a single item can be selected. Traditional desktop radio buttons are not optimized for touch input so jQuery Mobile styles the label for the radio buttons so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

The radio button controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible.

Vertically grouped radio buttons

- +

To create a set of radio buttons, add an input with a type="radio" attribute and a corresponding label. Set the for attribute of the label to match the id of the input so they are semantically associated.

The label element is displayed next to the radio form element. Wrap the radio buttons in a fieldset element that has a legend which acts as the title for the question.

To visually integrate multiple radio buttons into a vertically grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the container.

@@ -108,10 +111,11 @@

Field containers

-

Optionally wrap the radiobuttons in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

+

Optionally wrap the radio buttons in a container with class ui-field-contain to help visually group it in a longer form.

+

Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.


-<div data-role="fieldcontain">
+<div class="ui-field-contain">
 	<fieldset data-role="controlgroup">
 		<legend>Choose a pet:</legend>
 		<input type="radio" name="radio-choice-2" id="radio-choice-21" value="choice-1" checked="checked" />
@@ -142,46 +146,50 @@
 		
 
 		

The labels float so they sit side-by-side on a line. The radio button icons are hidden and only the left and right edges of the group are rounded.

- + + +

The checkboxradio widget wraps the input element in a div and prepends the label element to the div.

+

In the example below, pre-rendered markup for a checkbox is provided. The attribute data-corners="false" is explicitly specified, since the absence of the ui-corner-all class on the label element indicates that the value of the "corners" widget option is to be false.

+ +

+<div class="ui-checkbox">
+	<label for="my-checkbox" class="ui-btn ui-btn-inherit ui-btn-icon-left ui-checkbox-off">My Checkbox</label>
+	<input type="checkbox" id="my-checkbox" data-corners="false" data-enhanced="true"></input>
+</div>
+
+ + + 1.0 - - - triggered when a checkboxradio is created - - - - - + - - enable a disabled checkboxradio. - - - - disable a checkboxradio. - - + + + + $( ".selector" ).prop( "checked", true ).checkboxradio( "refresh" ); - + update the checkboxradio.

If you manipulate a checkboxradio via JavaScript, you must call the refresh method on it to update the visual styling.

@@ -193,14 +201,14 @@

jQuery Mobile Example

-
+
Agree to the terms:
-
+
]]> @@ -225,7 +233,7 @@ - +
]]> diff --git a/entries/classes.xml b/entries/classes.xml new file mode 100644 index 00000000..32402c65 --- /dev/null +++ b/entries/classes.xml @@ -0,0 +1,162 @@ + + + + Classes + CSS classes for common styles + +

Style Classes

+

jQuery Mobile uses the following style classes: + + + + + + + + + + + + + + + + + +
ui-corner-all
Adds rounded corners to the element.
ui-shadow
Adds an item shadow around the element.
ui-overlay-shadow
Adds an overlay shadow around the element. The intended effect is for the element to appear to float above other elements.
ui-mini
Reduces the font size and scales down paddings proportionally to produce a miniature version of the element for use in toolbars and tight spaces.
+ These classes can be applied any of the framework's widgets.

+

Widget-specific classes

+ + + + + + + + + +
ui-collapsible-inset
The collapsible widget has horizontal margins, borders, and rounded corners when this class is applied.
ui-listview-inset
The listview widget has horizontal margins, borders, and rounded corners when this class is applied.
+

Button-specific classes

+

In addition to the style classes, you can add the following classes to a (anchor) and button elements to render them touch-friendly: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Basic options
ui-btn
You must add this class to indicate that the element is to be styled as a button. This is a prerequisite for adding any other button-related classes.
ui-btn-inline
Displays the button inline. This means that it will only consume as much space as is needed for the label. This allows you to place buttons side by side, flowing with the text.
ui-shadow-icon
Draws a shadow around the icon. Note: This class is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0.
Icon positioning
ui-btn-icon-top
The icon appears above the text
ui-btn-icon-right
The icon appears to the right of the text
ui-btn-icon-bottom
The icon appears below the text
ui-btn-icon-left
The icon appears to the left of the text
ui-btn-icon-notext
The button text is suppressed, and only the icon is shown. The result is a circular button the size of the icon.
Icons
ui-icon-alert
An exclamation mark inside a triangle.
ui-icon-arrow-l
An arrow pointing left (←).
ui-icon-arrow-r
An arrow pointing right (→).
ui-icon-arrow-u
An arrow pointing up (↑).
ui-icon-arrow-d
An arrow pointing down (↓).
ui-icon-back
A curved arrow arcing counterclockwise upwards.
ui-icon-bars
Three horizontal bars one above the other.
ui-icon-check
A checkmark (✓).
ui-icon-delete
A diagonal cross similar to (✕).
ui-icon-edit
A pencil - similar to (✎) but pointing to the lower left.
ui-icon-forward
A curved arrow arcing clockwise upwards.
ui-icon-gear
A gear (⚙).
ui-icon-grid
A 3✕3 grid.
ui-icon-home
A house similar to (⌂).
ui-icon-minus
A "minus" sign (-).
ui-icon-plus
A "plus" sign (+).
ui-icon-refresh
A circular arrow similar to (⟳).
ui-icon-search
A magnifying glass.
ui-icon-star
A star similar to (✭).
Theme
ui-btn-[a-z]
Sets the color scheme (swatch) for the button. Use a single letter from a-z that maps to the swatches included in your theme. For example: ui-btn-b
+

+
+ +
diff --git a/entries/collapsible-set.xml b/entries/collapsible-set.xml deleted file mode 100644 index 80f63f01..00000000 --- a/entries/collapsible-set.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - Collapsible set Widget - Creates a collapsible set of collapsible blocks of content - -

Collapsible sets start with the exact same markup as individual collapsibles. - By adding a parent wrapper with a data-role="collapsible-set" attribute around a number of collapsibles, the framework will style these to looks like a visually grouped widget and make it behave like an accordion so only one section can be open at a time.

-

By default, all the sections will be collapsed. To set a section to be open when the page loads, add the data-collapsed="false" attribute to the heading of the section you want expanded.

- -

-<div data-role="collapsible-set">
-
-	<div data-role="collapsible" data-collapsed="false">
-		<h3>Section 1</h3>
-		<p>I'm the collapsible set content for section 1.</p>
-	</div>
-
-	<div data-role="collapsible">
-		<h3>Section 2</h3>
-		<p>I'm the collapsible set content for section 2.</p>
-	</div>
-
-</div>
-
- - -

Here is an example of a collapsible set with 5 sections. -

- -

Non-inset collapsible sets

- -

For full width collapsibles without corner styling add the data-inset="false" attribute to the set. -

- -

Mini collapsible sets

- -

For a more compact version that is useful in tight spaces, add the data-mini="true" attribute to the set to create a mini version. -

- -

Custom icons

- -

Collapsible headings’ default icons can be overridden by using the data-collapsed-icon and data-expanded-icon attributes, either at the collapsible-set level or on an individual collapsible basis. -

- -

Icon positioning

- -

Collapsible headings’ default icon positioning can be overridden by using the data-iconpos attribute, either at the collapsible-set level or on an individual collapsible basis. -

- -

Theming collapsible content

- -

The standard data-theme attribute can be used to set the color of each collapsible in a set. To provide a clearer visual grouping of the content with the headers, add the data-content-theme attribute with a swatch letter. This adds a themed background color and border to the content block. For consistent theming, add these attributes to the parent collapsible set. - -

<div data-role="collapsible-set" data-theme="c" data-content-theme="d">
-
- -

- -

Theming individual sections

- -

To have individual sections in a group styled differently, add data-theme and data-content-theme attributes to specific collapsibles. -

- -

Expanding or collapsing items in a set

- -

To expand or collapse items in a set, call the respective methods on individual collapsibles. The selector for the collapse method can include multiple items in a set: -

-

-$( "#myCollapsibleSet" ).children().trigger( "collapse" );
-
- -
- 1.0 - - - - - - - - - - - - - Triggered when a collapsible set is created - - - - - - - - - - Updates the collapsible set. -

If you manipulate a collapsible set via JavaScript (e.g. add new collapsible containers), you must call the refresh method on it to update the visual styling.

- -
-
-
- - A basic example of a collapsible set. - - - -
diff --git a/entries/collapsible.xml b/entries/collapsible.xml index 43809f2a..5e298a18 100644 --- a/entries/collapsible.xml +++ b/entries/collapsible.xml @@ -1,10 +1,11 @@ - + Collapsible Widget Creates a collapsible block of content -

To create a collapsible block of content, create a container and add the data-role="collapsible" attribute. Using data-content-theme attribute allows you to set a theme for the content of the collapsible.

+

Collapsible content

+

To create a collapsible block of content, create a container and add the data-role="collapsible" attribute. Using the data-content-theme attribute allows you to set a theme for the content of the collapsible.

Directly inside this container, add any header (H1-H6) or legend element. The framework will style the header to look like a clickable button and add a "+" icon to the left to indicate it's expandable.

After the header, add any HTML markup you want to be collapsible. The framework will wrap this markup in a container that will be hidden/shown when the heading is clicked.

By default, the content will be collapsed.

@@ -17,10 +18,10 @@

This code will create a collapsible widget like this:

- -

Expanding collapsibles on load

-

To expand the content when the page loads, add the data-collapsed="false" attribute to the wrapper.

+

Initially expanded collapsibles

+ +

When you add the data-collapsed="false" attribute to the wrapper the collapsible will initially be expanded.


 <div data-role="collapsible" data-collapsed="false">
@@ -28,7 +29,7 @@
 
 		

This code will create a collapsible widget like this:

- +

Non-inset collapsibles

By default collapsibles have an inset appearance. To make them full width without corner styling add the data-inset="false" attribute to the element.

@@ -39,7 +40,7 @@

This code will create a non-inset collapsible:

- +

Mini collapsibles

For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

@@ -47,30 +48,30 @@

 <div data-role="collapsible" data-mini="true">
 
- +

This code will create a mini collapsible widget:

- +

Custom icons

-

Collapsible headings’ default icons can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. In the below case, data-collapsed-icon="arrow-r" and data-expanded-icon="arrow-d". +

The default icon of collapsible headings can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. The example below uses data-collapsed-icon="arrow-r" and data-expanded-icon="arrow-d".

- +

Icon positioning

-

Collapsible headings’ default icon positioning can be overridden by using the data-iconpos attribute. In the below case, data-iconpos="right". +

The default icon positioning of collapsible headings can be overridden by using the data-iconpos attribute. The example below uses data-iconpos="right".

- +

Theming collapsible content

-

Collapsible content is minimally styled - we add only a bit of margin between the bar and content, and the header adopts the default theme styles of the container it sits within.

- -

To provide a stronger visual connection between the collapsible header and content, add the data-content-theme attribute to the wrapper and specify a theme swatch letter. This will apply the swatch's border and flat background color (not the gradient) to the content block and changes the corner rounding to square off the bottom of the header and round the bottom of the content block instead to visually group these elements.

- +

Collapsible content is minimally styled - we add only a bit of margin between the bar and content, and the header adopts the default theme styles of the container within which it sits.

+ +

To provide a stronger visual connection between the collapsible header and content, add the data-content-theme attribute to the wrapper and specify a theme swatch letter. This applies the border and background color of the swatch to the content block and changes the corner rounding to square off the bottom of the header and round the bottom of the content block instead to visually group these elements.

+

-<div data-role="collapsible" data-content-theme="c">
+<div data-role="collapsible" data-content-theme="b">
 	<h3>Header</h3>
-	<p>I'm the collapsible content with a themed content block set to "c".</p>
+	<p>I'm the collapsible content with a themed content block set to "b".</p>
 </div>
 
@@ -80,9 +81,9 @@

To set the theme on a collapsible header button, add the data-theme attribute to the wrapper and specify a swatch letter. Note that you can mix and match swatch letters between the header and content with these theme attributes.

-
<div data-role="collapsible" data-theme="a" data-content-theme="a">
-	<h3>Header swatch A</h3>
-	<p>I'm the collapsible content with a themed content block set to "a".</p>
+
<div data-role="collapsible" data-theme="b" data-content-theme="b">
+	<h3>Header swatch B</h3>
+	<p>I'm the collapsible content with a themed content block set to "b".</p>
 </div>
 
@@ -92,101 +93,123 @@

Collapsibles can be nested inside each other if needed. In this example, we're setting the content theme to provide clearer visual connection between the levels.

- +

Collapsible sets (accordions)

-

It's possible to combine multiple collapsibles into a grouped set that acts like an accordion widget.

+

It's possible to combine multiple collapsibles into a grouped set that acts like an accordion widget.

+ + +

The widget creates an anchor from the heading element and wraps the rest of the children of the outermost widget in a div that will serve as the container for the collapsible content.

+

In the example below, pre-rendered markup for a is provided. The attribute data-collapsed-icon="arrow-r" is explicitly specified, since the use of theui-icon-arrow-r class on the anchor element indicates that the value of the "collapsedIcon" widget option is to be "arrow-r".

+ +

+<div data-role="collapsible" data-enhanced="true" class="ui-collapsible ui-collapsible-inset ui-corner-all ui-collapsible-collapsed" data-collapsed-icon="arrow-r">
+	<h2 class="ui-collapsible-heading ui-collapsible-heading-collapsed">
+		<a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-arrow-d">
+			Pre-rendered collapsible
+			<span class="ui-collapsible-heading-status"> click to expand contents</span>
+		</a>
+	</h2>
+	<div class="ui-collapsible-content ui-collapsible-content-collapsed" aria-hidden="true">
+		<p>This is the collapsible-content</p>
+	</div>
+</div>
+
+ + 1.0 - - - Triggered when a collapsible is created - - - - - - - - + Triggered when a collapsible is collapsed @@ -209,6 +232,10 @@ $( document ).on( "mobileinit", function() { + + + + A basic example of a collapsible content block. diff --git a/entries/collapsibleset.xml b/entries/collapsibleset.xml new file mode 100644 index 00000000..391ecfdd --- /dev/null +++ b/entries/collapsibleset.xml @@ -0,0 +1,189 @@ + + + + Collapsible set Widget + Creates a collapsible set of collapsible blocks of content + +

Collapsible sets

+

Collapsible sets start with the exact same markup as individual collapsibles. + By adding a parent wrapper with a data-role="collapsibleset" attribute around a number of collapsibles, the framework will style these to looks like a visually grouped widget and make it behave like an accordion so only one section can be open at a time.

+

By default, all the sections will be collapsed. To set a section to be open when the page loads, add the data-collapsed="false" attribute to the heading of the section you want expanded.

+ +

+<div data-role="collapsibleset">
+
+	<div data-role="collapsible" data-collapsed="false">
+		<h3>Section 1</h3>
+		<p>I'm the collapsible set content for section 1.</p>
+	</div>
+
+	<div data-role="collapsible">
+		<h3>Section 2</h3>
+		<p>I'm the collapsible set content for section 2.</p>
+	</div>
+
+</div>
+
+ + +

Here is an example of a collapsible set with 5 sections. +

+ +

Non-inset collapsible sets

+ +

For full width collapsibles without corner styling add the data-inset="false" attribute to the set. +

+ +

Mini collapsible sets

+ +

For a more compact version that is useful in tight spaces, add the data-mini="true" attribute to the set to create a mini version. +

+ +

Custom icons

+ +

The icon displayed when a collapsible is shown or hidden can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. Both the collapsibleset widget and the collapsible widget accepts these attributes. When you set one or both of these attributes on the collapsibleset widget all collapsible widgets that are part of the collapsibleset display the icon specified by the chosen value. You can override the icon displayed by individual collapsible widgets by setting one or both of these attributes on the collapsible widget itself. +

+ +

Icon positioning

+ +

The default icon positioning for collapsible headings can be overridden by using the data-iconpos attribute. You can set the attribute either on the collapsibleset to affect all collapsibles in the set, or on an individual collapsible widget to affect only the one widget. +

+ +

Theming collapsible content

+ +

The standard data-theme attribute can be used to set the color of each collapsible in a set. To provide a clearer visual grouping of the content with the headers, add the data-content-theme attribute with a swatch letter. This adds a themed background color and border to the content block. For consistent theming, add these attributes to the parent collapsible set. + +

<div data-role="collapsibleset" data-theme="b" data-content-theme="a">
+
+ +

+ +

Theming individual sections

+ +

To have individual sections in a group styled differently, add data-theme and data-content-theme attributes to specific collapsibles. +

+ + +

The widget does not require that the collapsibles it contains also be pre-rendered.

+

In the example below, pre-rendered markup for a is provided. The attribute data-corners="false" is explicitly specified, since the absence of the ui-corner-all class on the container element indicates that the "corners" widget option is to be false. One of the child collapsibles is provided as-is, while the other is pre-rendered.

+ +

+<div data-role="collapsibleset" class="ui-collapsible-set" data-corners="false">
+	<div data-role="collapsible">
+		<h2>Child collapsible</h2>
+		<p>This is the collapsible content.</p>
+	</div>
+	<div data-role="collapsible" data-enhanced="true" class="ui-collapsible ui-collapsible-inset ui-corner-all" data-collapsed="false" data-corners="true">
+		<h2 class="ui-collapsible-heading">
+			<a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-icon-minus">
+				Pre-rendered child collapsible
+				<span class="ui-collapsible-heading-status">click to collapse contents</span>
+			</a>
+		</h2>
+		<div class="ui-collapsible-content" aria-hidden="false">
+			<p>This is the collapsible content.</p>
+		</div>
+	</div>
+</div>
+
+ + + +
+ 1.0 + + + + + + + + + + + + + + + + + + + + + + Updates the collapsible set. +

If you manipulate a collapsible set via JavaScript (e.g. by adding new collapsibles, removing old ones, or showing/hiding existing ones), you must call the refresh method on it to update the visual styling. This method will instantiate collapsibles on child elements which are marked data-role="collapsible", so there is no need to manually call .collapsible().

+ +
+
+
+ + A basic example of a collapsible set. + + + +
diff --git a/entries/controlgroup.xml b/entries/controlgroup.xml index 2c9fbe93..a9ebf281 100644 --- a/entries/controlgroup.xml +++ b/entries/controlgroup.xml @@ -1,16 +1,16 @@ - + Controlgroup Widget Groups buttons together. -

Occasionally, you may want to visually group a set of buttons to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute — the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together.

+

Occasionally, you may want to visually group a set of buttons to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute — the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together.


 <div data-role="controlgroup">
-  <a href="#" data-role="button">Yes</a>
-  <a href="#" data-role="button">No</a>
-  <a href="#" data-role="button">Maybe</a>
+  <a href="#" role="button" class="ui-btn ui-corner-all">Yes</a>
+  <a href="#" role="button" class="ui-btn ui-corner-all">No</a>
+  <a href="#" role="button" class="ui-btn ui-corner-all">Maybe</a>
 </div>
 
@@ -21,10 +21,10 @@

Horizontal grouped buttons:

- +

Labels

If you use a controlgroup for input, button or select buttons we recommend wrapping them in a fieldset element that has a legend which acts as the combined label for the group. The label elements of each individual button in the group will be hidden for styling purposes, and are only accessible by screen readers. Using the label as a wrapper around the form element prevents the framework from hiding it, so you have to use the for attribute to associate the label with the input.

- +
1.3 @@ -35,6 +35,7 @@ + - + + + - - - Triggered when a controlgroup is created. - - - - - + @@ -93,6 +80,10 @@ $( ".selector" ).controlgroup( "container" ); + + + + A basic example of a controlgroup. diff --git a/entries/dialog.xml b/entries/dialog.xml index 52daab0b..ee67cfa6 100644 --- a/entries/dialog.xml +++ b/entries/dialog.xml @@ -1,9 +1,10 @@ - + Dialog Widget Opens content in an interactive overlay. + Dialogs are deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. The dialog option provided by the page.dialog extension of the page widget allows you to style a page as a dialog, however, the special navigational handling will be removed. You may also consider implementing dialogs using popup widgets.

Any page can be presented as a modal dialog by adding the data-rel="dialog" attribute to the page anchor link. When the "dialog" attribute is applied, the framework adds styles to add rounded corners, margins around the page and a dark background to make the "dialog" appear to be suspended above the page.


 <a href="foo.html" data-rel="dialog">Open dialog</a>
@@ -33,11 +34,11 @@ $.mobile.changePage( "#myDialog", { role: "dialog" } );
 		

Closing dialogs

When any link is clicked within a dialog, the framework will automatically close the dialog and transition to the requested page, just as if the dialog were a normal page. Nevertheless, dialogs can also be chained, as explained below under "Chaining Dialogs". Similarly, a link that opens a popup will also leave the dialog in place.

- +

If the dialog has a header the framework will add a close button at the left side of the header. You can change the position by adding data-close-btn="right" to the dialog container. If you don't want a close button in the header or add a custom close button, you can use data-close-btn="none".

- + - +

To create a "cancel" button in a dialog, just link to the page that triggered the dialog to open and add the data-rel="back" attribute to your link. This pattern of linking to the previous page is also usable in non-JS devices as well.

For JavaScript-generated links, you can simply set the href attribute to "#" and use the data-rel="back" attribute. You can also call the dialog's close() method to programmatically close dialogs, for example: $( ".ui-dialog" ).dialog( "close" ).

@@ -59,9 +60,9 @@ $.mobile.changePage( "#myDialog", { role: "dialog" } );

Dialogs can be styled with different theme swatches, just like any page by adding data-theme attributes to the header, content, or footer containers.

- +

By default dialogs have rounded corners. The option corners can be set to false by adding data-corners="false" to the dialog container:

- +

Dialogs appear to be floating above an overlay layer. This overlay adopts the swatch 'a' content color by default, but the data-overlay-theme attribute can be added to the page wrapper to set the overlay to any swatch letter.

@@ -105,26 +106,17 @@ $.mobile.changePage( "#myDialog", { role: "dialog" } ); - -

iFrame source: example1.html diff --git a/entries/header.xml b/entries/header.xml index 4241e9c3..cca3a337 100644 --- a/entries/header.xml +++ b/entries/header.xml @@ -2,118 +2,10 @@ Header Widget - Creates a header widget + See Toolbar Widget -

The Header bar serves as the page title, is usually the first element inside each mobile page, and typically contains a page title and up to two buttons.

-

Header structure

-

The header is a toolbar at the top of the page that usually contains the page title text and optional buttons positioned to the left and/or right of the title for navigation or actions. Headers can optionally be positioned as fixed so they remain at the top of the screen at all times instead of scrolling with the page.

-

The title text is normally an H1 heading element but it's possible to use any heading level (H1-H6) to allow for semantic flexibility. For example, a page containing multiple mobile "pages" may use a H1 element on the home "page" and a H2 element on the secondary pages. All heading levels are styled identically by default to maintain visual consistency.

- -

-<div data-role="header">
-	<h1> Page Title </h1>
-</div>
-
- -

Default header features

- -

The header toolbar is themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color. -

- -

Adding buttons

- -

In the standard header configuration, there are slots for buttons on either side of the text heading. Each button is typically an anchor element, but can be a button element as well. To save space, buttons in toolbars are set to inline styling so the button is only as wide as the text and icons it contains.

- -

Default button positioning

-

The header plugin looks for immediate children of the header container, and automatically sets the first link in the left button slot and the second link in the right. In this example, the 'Cancel' button will appear in the left slot and 'Save' will appear in the right slot based on their sequence in the source order.

- -
	
-<div data-role="header">
-	<a href="index.html" data-icon="delete">Cancel</a>
-	<h1>Edit Contact</h1>
-	<a href="index.html" data-icon="check">Save</a>
-</div>
-
- - - -

Making buttons visually stand out

- -

Buttons automatically adopt the swatch color of the bar they sit in, so a link in a header bar with the "a" color will also be styled as "a" colored buttons. It's simple to make a button visually stand out. Here, we add the data-theme attribute and set the color swatch for the button to "b" to make the "Save" button pop.

- -

-<div data-role="header">
-	<a href="index.html" data-icon="delete">Cancel</a>
-	<h1>Edit Contact</h1>
-	<a href="index.html" data-icon="check" data-theme="b">Save</a>
-</div>
-
- - - -

Controlling button position with classes

-

The button position can also be controlled by adding classes to the button anchors, rather than relying on source order. This is especially useful if you only want a button in the right slot. To specify the button position, add the class of ui-btn-left or ui-btn-right to the anchor.

- -

-<div data-role="header">
-	<h1>Page Title</h1>
-	<a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
-</div>
-
- - - -

Adding buttons to toolbars without heading

-

The heading in the header bar has some margin that will give the bar its height. If you choose not to use a heading, you will need to add an element with class="ui-title" so that the bar can get the height and display correctly.

- -

-<div data-role="header">
-	<a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
-	<span class="ui-title" />
-</div>
-
- - - -

Adding Back buttons

- -

jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app webview. The framework automatically generates a "back" button on a header when the page plugin's addBackBtn option is true. This can also be set via markup if the page div has a data-add-back-btn="true" attribute.

-

If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page. This will allow the feature to work for users in C-Grade browsers.

-

If you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute.

- -

Customizing the back button text

-

If you'd like to configure the back button text, you can either use the data-back-btn-text="previous" attribute on your page element, or set it programmatically via the page plugin's options:
$.mobile.page.prototype.options.backBtnText = "previous";

- -

Default back button style

-

If you'd like to configure the back button role-theme, you can use:
$.mobile.page.prototype.options.backBtnTheme = "a";
-If you're doing this programmatically, set this option inside the mobileinit event handler.

- -

Custom header configurations

-

If you need to create a header that doesn't follow the default configuration, simply wrap your custom styled markup in any container, such as div. The plugin won't apply the automatic button logic to the wrapped content inside the header container so you can write custom styles for laying out the content in your header.

-

It's also possible to create custom bars without using the header data-role at all. For example, start with any container and add the ui-bar class to apply standard bar padding and add the ui-bar-b class to assign the bar swatch styles from your theme. (The "b" can be any swatch letter.)

- -

-<div class="ui-bar ui-bar-b">
-	<h3>I'm just a div with bar classes and a mini inline <a href="#" data-role="button" data-mini="true">Button</a></h3>
-</div>
-
- - - -

Note that .ui-bar 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 instead.

-

By writing some simple styles, it's easy to build message bars like this:

- - +

As of jQuery Mobile 1.4.0 the functionality of the header widget has been moved to the toolbar widget.

1.0 - - A basic example of a header - -
diff --git a/entries/jQuery.mobile.changePage.xml b/entries/jQuery.mobile.changePage.xml index 7834a0aa..cbe7cfad 100644 --- a/entries/jQuery.mobile.changePage.xml +++ b/entries/jQuery.mobile.changePage.xml @@ -1,7 +1,9 @@ - + jQuery.mobile.changePage() - Programmatically change from one page to another. + Programmatically change from one page to another. +

Note: is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Use the pagecontainer widget's change() method instead.

+
diff --git a/entries/jQuery.mobile.loadPage.xml b/entries/jQuery.mobile.loadPage.xml index 483efaf3..cdafae10 100644 --- a/entries/jQuery.mobile.loadPage.xml +++ b/entries/jQuery.mobile.loadPage.xml @@ -1,7 +1,9 @@ - + jQuery.mobile.loadPage() - Load an external page, enhance its content, and insert it into the DOM. + Load an external page, enhance its content, and insert it into the DOM. +

Note: is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Use the pagecontainer widget's load() method instead.

+
@@ -79,4 +81,4 @@ $.mobile.loadPage( "searchresults.php", {

-
\ No newline at end of file +
diff --git a/entries/jQuery.mobile.path.get.xml b/entries/jQuery.mobile.path.get.xml index e8b9bf07..ecb2559c 100644 --- a/entries/jQuery.mobile.path.get.xml +++ b/entries/jQuery.mobile.path.get.xml @@ -17,7 +17,7 @@ border-color: #108040; padding: 10px; } -]]> +]]>
diff --git a/entries/jQuery.mobile.path.isAbsoluteUrl.xml b/entries/jQuery.mobile.path.isAbsoluteUrl.xml index 7a09fbab..13391c97 100644 --- a/entries/jQuery.mobile.path.isAbsoluteUrl.xml +++ b/entries/jQuery.mobile.path.isAbsoluteUrl.xml @@ -17,7 +17,7 @@ border-color: #108040; padding: 10px; } -]]> +]]>
diff --git a/entries/jQuery.mobile.path.isRelativeUrl.xml b/entries/jQuery.mobile.path.isRelativeUrl.xml index 8ddb6281..b194c4a4 100644 --- a/entries/jQuery.mobile.path.isRelativeUrl.xml +++ b/entries/jQuery.mobile.path.isRelativeUrl.xml @@ -17,7 +17,7 @@ border-color: #108040; padding: 10px; } -]]> +]]> diff --git a/entries/jQuery.mobile.path.makeUrlAbsolute.xml b/entries/jQuery.mobile.path.makeUrlAbsolute.xml index 0f1d56ea..7ac1871d 100644 --- a/entries/jQuery.mobile.path.makeUrlAbsolute.xml +++ b/entries/jQuery.mobile.path.makeUrlAbsolute.xml @@ -22,7 +22,7 @@ border-color: #108040; padding: 10px; } -]]> +]]> diff --git a/entries/jQuery.mobile.silentScroll.xml b/entries/jQuery.mobile.silentScroll.xml index 63e62d64..c239d6dd 100644 --- a/entries/jQuery.mobile.silentScroll.xml +++ b/entries/jQuery.mobile.silentScroll.xml @@ -19,7 +19,7 @@ Go down 100 pixels



Here, we have some text so that we can have
some vertical space in order to demonstrate
- the silentScroll() method.

+ the silentScroll() method.

Back to Top
diff --git a/entries/listview.xml b/entries/listview.xml index 53dea944..aef90f8b 100644 --- a/entries/listview.xml +++ b/entries/listview.xml @@ -1,11 +1,11 @@ - + Listview Widget Creates a listview widget

Basic linked lists

-

A listview is coded as a simple unordered list containing linked list items with a data-role="listview" attribute. jQuery Mobile will apply all the necessary styles to transform the list into a mobile-friendly listview with right arrow indicator that fills the full width of the browser window. When you tap on the list item, the framework will trigger a click on the first link inside the list item, issue an Ajax request for the URL in the link, create the new page in the DOM, then kick off a page transition. View the data- attribute reference to see all the possible attributes you can add to listviews.

+

A listview is coded as a simple unordered list containing linked list items with a data-role="listview" attribute. jQuery Mobile will apply all the necessary styles to transform the list into a mobile-friendly listview with right arrow indicator that fills the full width of the browser window. When you tap on the list item, the framework will trigger a click on the first link inside the list item, issue an Ajax request for the URL in the link, create the new page in the DOM, then kick off a page transition. View the data- attribute reference to see all the possible attributes you can add to listviews.

Here is the HTML markup for a basic linked list.


@@ -18,13 +18,7 @@
 
 		

-

Style note on non-inset lists: all standard, non-inset lists have a -15px margin to negate the 15px of padding on the content area to make lists extend to the edges of the screen. If you add other widgets above or below a list, the negative margin may make these elements overlap so you'll need to add additional spacing in your custom CSS.

- -

Nested lists

-

By nesting child ul or ol inside list items, you can create nested lists. When a list item with a child list is clicked, the framework will show a new page populated with the title of the parent in the header and the list of child elements. These dynamic nested lists are styled with the "b" theme swatch (blue in the default theme) to indicate that you are in a secondary level of navigation. Lists can be nested multiple levels deep and all pages and linking will be automatically handled by the framework. Note that the page of each nested listview is created when the parent page loads and for each nested page the page-events will trigger. Please also note that the title of subpages will contain the text of the first element in the parent list item including its elements. So make sure to use a single element for the list item caption and put other elements like count bubbles behind that caption as shown in the demo below.

-

To set the swatch color of the child listviews, set the data-theme attribute on each list inside.

-
Note: Nested lists are deprecated in version 1.3.0
-

+

Style note on non-inset lists: all standard, non-inset lists have a -1em (16px) margin to negate the 1em padding on the content area to make lists extend to the edges of the screen. If you add other widgets above or below a list, the negative margin may make these elements overlap so you'll need to add additional spacing in your custom CSS.

Numbered lists

Lists can also be created from ordered lists (ol) which is useful when presenting items that are in a sequence such as search results or a movie queue. When the enhanced markup is applied to the listview, jQuery Mobile will try to first use CSS to add numbers to the list and, if not supported, will fall back to injecting numbers with JavaScript.

@@ -43,7 +37,7 @@

List dividers

-

List items can be turned into dividers to organize and group the list items. This is done by adding the data-role="list-divider" to any list item. These items are styled with the bar swatch "b" by default (blue in the default theme) but you can specify a theme for dividers by adding the data-divider-theme attribute to the list element (ul or ol) and specifying a theme swatch letter.

+

List items can be turned into dividers to organize and group the list items. This is done by adding the data-role="list-divider" to any list item. These items are styled with the bar swatch "b" by default (blue in the default theme) but you can specify a theme for dividers by adding the data-divider-theme attribute to the list element (ul or ol) and specifying a theme swatch letter.

@@ -68,7 +62,7 @@ $( "#mylistview" ).listview({

Note that if you are using formatted list items that contain a floating element (for example ui-li-aside), this element precedes its siblings regardless of the order in your HTML markup. This results in the first character of the floating element being used as divider text. Therefore it is recommended to specify the divider text in this case.

- +

If new list items are added to the list or removed from it, the dividers are not automatically updated: you should call refresh() on the listview to redraw the autodividers.

@@ -91,11 +85,11 @@ function( text, searchValue, item ) {

By default, the listview filter simply searches against the content in each list item. If you want the filter to search against different content, add the data-filtertext attribute to the item and populate it with one or many keywords and phrases that should be used to match against. Note that if this attribute is added, the contents of the list item are ignored.

This attribute is useful for dealing with allowing for ticker symbols and full company names to be searched, or for covering common spellings and abbreviations for countries.

- -
		
+
+

 <li data-filtertext="NASDAQ:AAPL Apple Inc."><a href="#">Apple</a></li>
 <li data-filtertext="USA U.S.A. United States of America"><a href="#">United States</a></li>
-
+

@@ -107,150 +101,91 @@ function( text, searchValue, item ) {
  • To add text hierarchy, use headings to increase font emphasis and use paragraphs to reduce emphasis.
  • Supplemental information can be added to the right of each list item by wrapping content in an element with a class of ui-li-aside
  • - +

    - +

    Thumbnails & icons

    To add thumbnails to the left of a list item, simply add an image inside a list item as the first child element. The framework will scale the image to 80 pixels square. To use standard 16x16 pixel icons in list items, add the class of ui-li-icon to the image element.

    - +

    -

    +

    Inset lists

    -

    If lists are embedded in a page with other types of content, an inset list packages the list into a block that sits inside the content area with a bit of margin and rounded corners (theme controlled). By adding the data-inset="true" attribute to the list (ul or ol), applies the inset appearance.

    +

    If lists are embedded in a page with other types of content, an inset list packages the list into a block that sits inside the content area with a bit of margin and rounded corners (theme controlled). By adding the data-inset="true" attribute to the list (ul or ol), applies the inset appearance.

    -

    +

    Filter reveal

    - +

    The filter reveal feature makes is easy to build a simple autocomplete with local data. When a filterable list has the data-filter-reveal="true" attribute, it will auto-hide all the list items when the search field is blank. The data-filter-placeholder attribute can be added to specify the placeholder text for the filter. If you need to search against a long list of values, we provide a way to create a filter with a remote data source.

    - +

    - +

    Remote autocomplete with listview filter

    To use the listview filter as an autocomplete that taps into remote data sources, you can use the listviewbeforefilter event to dynamically populate a listview as a user types a search query. This is useful when you have a very large data set like cities, zip codes, or products that can't be loaded up-front locally. Use the view source button to see the JavaScript that powers this demo.

    - +

    If you have a small list of items, you can use the listview filter reveal option to make an autocomplete with local listview data.

    - +

    - - + +

    Cities worldwide

    - -

    After you enter at least three characters the autocomplete function will show all possible matches.

    + +

    After you enter at least three characters the autocomplete function will show all possible matches.

    Calling the listview plugin

    - +

    You can directly call the listview plugin on any selector, just like any jQuery plugin:

    
     $( "#mylist" ).listview();
     

    Updating lists

    -

    If you add items to a listview, you'll need to call the refresh() method on it to update the styles and create any nested lists that are added. For example:

    +

    If you add items to a listview, you'll need to call the refresh() method on it to update the styles. For example:

    
     $( "#mylist" ).listview( "refresh" );
     

    Note that the refresh() method only affects new nodes appended to a list. This is done for performance reasons. Any list items already enhanced will be ignored by the refresh process. This means that if you change the contents or attributes on an already enhanced list item, these won't be reflected. If you want a list item to be updated, replace it with fresh markup before calling refresh.

    - +

    If you initially want to hide a list item you can do this by adding a class of ui-screen-hidden to the li element. Using this class ensures the corner styling is applied correctly as well as border-bottom on the last visible item.

    1.0 - - - - - - - - @@ -264,12 +199,6 @@ $( document ).on( "mobileinit", function() { - - retrieve the sub-pages. -

    This method returns a jQuery object containing all the immediate child pages of a nested list.

    -
    - 1.3 -
    update the listview.

    If you manipulate a listview via JavaScript (e.g. add new LI elements), you must call the refresh method on it to update the visual styling.

    diff --git a/entries/navbar.xml b/entries/navbar.xml index f947ced5..a2dc5e11 100644 --- a/entries/navbar.xml +++ b/entries/navbar.xml @@ -1,12 +1,12 @@ - + Navbar Widget Creates a navbar widget

    Simple navbar

    jQuery Mobile has a very basic navbar widget that is useful for providing up to 5 buttons with optional icons in a bar, typically within a header or footer. There is also a persistent navbar variation that works more like a tab bar that stays fixed as you navigate across pages.

    -

    A navbar is coded as an unordered list of links wrapped in a container element that has the data-role="navbar" attribute. This is an example of a two-button navbar:

    +

    A navbar is coded as an unordered list of links wrapped in a container element that has the data-role="navbar" attribute. This is an example of a two-button navbar:

    
     <div data-role="navbar">
    @@ -29,6 +29,8 @@
     </div><!-- /navbar -->
     
    +

    Note that this on applies to navbars that are inside a page. If you use a true persistent toolbar that lives outside the page and want to set current item to the active state, you have to add a script that adds the class="ui-btn-active" class.

    +

    The navbar items are set to divide the space evenly so in this case, each button is 1/2 the width of the browser window:

    @@ -38,34 +40,34 @@

    Adding a fourth more item will automatically make each button 1/4 the width of the browser window:

    - +

    The navbar maxes out with 5 items, each 1/5 the width of the browser window:

    - +

    If more than 5 items are added, the navbar will simply wrap to multiple lines:

    - +

    Navbars with 1 item will simply render as 100%.

    - +

    Navbars in headers

    If you want to add a navbar to the top of the page, you can still have a page title and buttons. Just add the navbar container inside the header block, right after the title and buttons in the source order.

    - +

    Navbars in footers

    If you want to add a navbar to the bottom of the page so it acts more like a tab bar, simply wrap the navbar in a container with a data-role="footer"

    - +
    
    -<div data-role="footer">		
    +<div data-role="footer">
     	<div data-role="navbar">
     		<ul>
     			<li><a href="#">One</a></li>
    @@ -79,11 +81,11 @@
     		
     
     		

    Icons in navbars

    -

    Icons can be added to navbar items by adding the data-icon attribute specifying a standard mobile icon to each anchor. By default, icons are added above the text (data-iconpos="top"). The following examples add icons to a navbar in a footer.

    +

    Icons can be added to navbar items by adding the data-icon attribute specifying a standard mobile icon to each anchor. By default, icons are added above the text (data-iconpos="top"). The following examples add icons to a navbar in a footer.

    -

    The icon position is set on the navbar container instead of for individual links within for visual consistency. For example, to place the icons below the labels, add the data-iconpos="bottom" attribute to the navbar container.

    +

    The icon position is set on the navbar container instead of for individual links within for visual consistency. For example, to place the icons below the labels, add the data-iconpos="bottom" attribute to the navbar container.

    
     <div data-role="navbar" data-iconpos="bottom">
    @@ -92,20 +94,20 @@
     		

    This will result in a bottom icon alignment:

    - +

    The icon position can be set to data-iconpos="left":

    - +

    Or the icon position can be set to data-iconpos="right":

    - +

    Using 3rd party icon sets

    - +

    You can add any of the popular icon libraries like Glyphish to achieve the iOS style tab that has large icons stacked on top of text labels. All that is required is a bit of custom styles to link to the icons and position them in the navbar. Here is an example using Glyphish icons and custom styles (view page source for styles) in our navbar:

    @@ -113,7 +115,7 @@

    Icons by Joseph Wain / glyphish.com. Licensed under the Creative Commons Attribution 3.0 United States License.

    Theming navbars

    - +

    Navbars inherit the theme swatch from their parent container, just like buttons. If a navbar is placed in the header or footer toolbar, it will inherit the default toolbar swatch "a" for bars unless you set this in the markup.

    Here are a few examples of navbars in various container swatches that automatically inherit their parent's swatch letter. Note that in these examples, instead of using a data-theme attribute, we're manually adding the swatch classes to apply the body swatch (ui-body-a) and the class to add the standard body padding (ui-body), but the inheritance works the same way:

    @@ -133,6 +135,7 @@ + @@ -152,13 +155,13 @@ $( "div" ).navbar({

    Some Content here

    -
    +
    -
    +
    ]]> diff --git a/entries/page-loading.xml b/entries/page-loading.xml index 4e928dfe..d6cfd257 100644 --- a/entries/page-loading.xml +++ b/entries/page-loading.xml @@ -2,11 +2,10 @@ Page Loading Widget - Handles the task of displaying the loading dialog when jQuery Mobile pulls in content via Ajax. + Handles the task of displaying the loading dialog when jQuery Mobile pulls in content via AJAX.

    The Page Loading Widget

    -

    The page loading widget handles the task of displaying the loading dialog when jQuery Mobile pulls in content via Ajax. The page loading dialog was previously configured globally with three settings $.mobile.loadingMessage, $.mobile.loadingMessageTextVisible, and $.mobile.loadingMessageTheme which are now deprecated. In addition to the methods for showing and hiding, $.mobile.showPageLoadingMsg and $.mobile.hidePageLoadingMsg are also deprecated.

    -

    The page loading widget handles the task of displaying the loading dialog when jQuery Mobile pulls in content via Ajax. It can also be displayed manually for custom loading actions using the $.mobile.loading helper method (See the global method docs).

    +

    The page loading widget handles the task of displaying the loading dialog when jQuery Mobile pulls in content via AJAX. It can also be displayed manually for custom loading actions using the $.mobile.loading helper method (See the global method docs).

    To configure the loading dialog globally the following settings can be defined on its prototype during the mobileinit event.

    Below are the defaults:
    @@ -20,7 +19,7 @@
     			
     		
    -

    These settings will be overridden by the deprecated settings to preserve backward compatibility. Once the deprecated settings are removed these defaults will only be superseded by the method params object described in the global method docs under $.mobile.loading.

    +

    These defaults will only be superseded by the method params object described in the global method docs under $.mobile.loading.

     			
    @@ -32,7 +31,7 @@
     				});
     			
     		
    - + 1.2 - + @@ -137,16 +133,13 @@ ]]>
    - \ No newline at end of file + diff --git a/entries/page.xml b/entries/page.xml index 0f09a3d7..acc3d129 100644 --- a/entries/page.xml +++ b/entries/page.xml @@ -1,6 +1,6 @@ - + Page Widget Primary unit of content. @@ -8,8 +8,6 @@

    The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.

    -

    Caveat: Documents containing multiple pages cause Internet Explorer 7 to exhibit incorrect behavior when its "Back" button is pressed. In particular, if the user navigates between several of the pages internal to the document that has been loaded and then clicks the "Back" button to return to the start page, there will be occasions when clicking the "Back" button does not cause a return to the previous page. However, clicking the "Back" button enough times will eventually return the user through the performed navigation sequence back to the start page.

    -

    Thus, if Internet Explorer 7 represents a significant proportion of the targeted user base, we recommended that pages be organized as individual HTML documents containing single page widgets, rather than as a single HTML document containing multiple internal pages.

    1.0 @@ -20,6 +18,15 @@ + + - diff --git a/entries/pagebeforechange.xml b/entries/pagebeforechange.xml index ec8a36e4..1bc450ed 100644 --- a/entries/pagebeforechange.xml +++ b/entries/pagebeforechange.xml @@ -23,7 +23,7 @@ 1.0 - +
    diff --git a/entries/pagebeforecreate.xml b/entries/pagebeforecreate.xml index 6ad488a4..a9de1cd9 100644 --- a/entries/pagebeforecreate.xml +++ b/entries/pagebeforecreate.xml @@ -19,7 +19,7 @@ $( "#aboutPage" ).on( "pagebeforecreate", function( event ) { 1.0 - +
    diff --git a/entries/pagebeforehide.xml b/entries/pagebeforehide.xml index 151f4647..d2002316 100644 --- a/entries/pagebeforehide.xml +++ b/entries/pagebeforehide.xml @@ -16,7 +16,7 @@ 1.0 - + diff --git a/entries/pagebeforeload.xml b/entries/pagebeforeload.xml index 7f9248e2..ea42afa9 100644 --- a/entries/pagebeforeload.xml +++ b/entries/pagebeforeload.xml @@ -1,75 +1,14 @@ - + pagebeforeload Triggered before any load request is made. -

    Callbacks bound to this event can call preventDefault() on the event to indicate that they are handling the load request. Callbacks that do this *MUST* make sure they call resolve() or reject() on the deferred object reference contained in the data object passed to the callback.

    -

    The data object, passed as the 2nd arg to the callback function contains the following properties:

    -
      -
    • url (string) -
        -
      • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
      • -
      -
    • -
    • absUrl (string) -
        -
      • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
      • -
      -
    • -
    • dataUrl (string) -
        -
      • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
      • -
      -
    • -
    • deferred (object) -
        -
      • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this: -
        
        -$( document ).on( "pagebeforeload", function( event, data ) {
        -
        -	// Let the framework know we're going to handle the load.
        -
        -	event.preventDefault();
        -
        -	// ... load the document then insert it into the DOM ...
        -	// at some point, either in this callback, or through
        -	// some other async means, call resolve, passing in
        -	// the following args, plus a jQuery collection object
        -	// containing the DOM element for the page.
        -
        -	data.deferred.resolve( data.absUrl, data.options, page );
        -
        -});
        -
        -

        or rejected like this:

        -
        
        -$( document ).on( "pagebeforeload", function( event, data ) {
        -
        -	// Let the framework know we're going to handle the load.
        -
        -	event.preventDefault();
        -
        -	// ... load the document then insert it into the DOM ...
        -	// at some point, if the load fails, either in this
        -	// callback, or through some other async means, call
        -	// reject like this:
        -
        -	data.deferred.reject( data.absUrl, data.options );
        -
        -});
        -
      • -
      -
    • -
    • options (object) -
        -
      • This object contains the options that were passed into $.mobile.loadPage().
      • -
      -
    • -
    + Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0. +

    The replacement for is pagecontainerbeforeload. In jQuery Mobile 1.4.0, the two events are identical except for their name.

    1.0 - +
    diff --git a/entries/pagebeforeshow.xml b/entries/pagebeforeshow.xml index f989fd56..fe657909 100644 --- a/entries/pagebeforeshow.xml +++ b/entries/pagebeforeshow.xml @@ -14,7 +14,7 @@ 1.0 - +
    diff --git a/entries/pagechange.xml b/entries/pagechange.xml index f8a93b1a..c9bb6a03 100644 --- a/entries/pagechange.xml +++ b/entries/pagechange.xml @@ -16,11 +16,11 @@ - + 1.0 - + diff --git a/entries/pagechangefailed.xml b/entries/pagechangefailed.xml index 4f0158d5..e6e7ec24 100644 --- a/entries/pagechangefailed.xml +++ b/entries/pagechangefailed.xml @@ -1,26 +1,14 @@ - + pagechangefailed - This event is triggered when the changePage() request fails to load the page. Callbacks for this particular event will be passed a data object as the 2nd arg. + Triggered when the changePage() request fails to load the page. -

    The properties for this object are as follows:

    -
      -
    • toPage (object or string) -
        -
      • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
      • -
      -
    • -
    • options (object) -
        -
      • This object contains the configuration options to be used for the current changePage() call.
      • -
      -
    • -
    - + Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0. +

    The replacement for is pagecontainerchangefailed. In jQuery Mobile 1.4.0, the two events are identical except for their name.

    1.0 - +
    diff --git a/entries/pagecontainer.xml b/entries/pagecontainer.xml new file mode 100644 index 00000000..e85afb34 --- /dev/null +++ b/entries/pagecontainer.xml @@ -0,0 +1,449 @@ + + + + Page Container Widget + Manages a collection of pages. + +

    Smooth Navigation Between Pages

    + Note: The page container widget is designed to be a singleton instantiated by the framework on the body element. This limitation will be removed in future versions of jQuery Mobile. +

    jQuery Mobile's central abstraction is the use of multiple pages inside a single HTML document. The children of the body are all div elements that have been enhanced into page widgets. These are jQuery Mobile pages.

    +

    Only one page is visible at a time. Upon navigation, the currently visible page is hidden, and another page is shown. Moving from one page to another is accomplished via a transition. This is not possible when navigating between HTML documents via HTTP, because the browser discards all state associated with the source page when navigating to the target page, making it impossible to perform this task via a smooth transition effect such as a fade or a slide.

    +

    Multipage Documents

    +

    In its simplest form, the HTML document retrieved by the browser has a body consisting of several div elements which are enhanced using the page widget. Each such page has an id attribute to distinguish it from other pages.

    +

    The pages can be interlinked using anchors. When the user clicks such an anchor, a new history entry is created, and the page to which the anchor refers is displayed by means of a smooth transition from the previous page. The example below illustrates a multipage setup. Note: If the example below animates using a fade transition instead of the slide transition requested in the anchor, it is because your browser does not support CSS 3D transforms.

    +
    
    +<!doctype html>
    +<html>
    +<head>
    +	<title>Multipage example</title>
    +	<meta name="viewport" content="width=device-width, initial-scale=1" />
    +	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" />
    +	<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    +	<script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
    +</head>
    +<body>
    +	<div data-role="page" id="page1">
    +		<div data-role="header">
    +			<h1>Page 1</h1>
    +		</div>
    +		<div data-role="content">
    +			<a href="#page2" data-transition="slide" class="ui-btn ui-corner-all ui-btn-inline">Go To Page 2</a>
    +		</div>
    +	</div>
    +	<div data-role="page" id="page2">
    +		<div data-role="header">
    +			<h1>Page 2</h1>
    +		</div>
    +		<div data-role="content">
    +			<a href="#page1" data-rel="back" data-transition="slide" class="ui-btn ui-corner-all ui-btn-inline">Go Back To Page 1</a>
    +		</div>
    +	</div>
    +</body>
    +</html>
    +
    + + +

    HTTP-analogous navigation via AJAX

    +

    jQuery Mobile allows you to replace the browser's standard HTTP navigation with AJAX-based navigation. It overrides the browser's default link handling behavior. It intercepts clicks on anchors containing links to other documents and upon each such click it checks whether the document can be retrieved via AJAX. A link has to meet the following criteria in order for the document to which it links to be retrieved via AJAX: +

      +
    1. The global configuration option $.mobile.linkBindingEnabled must be true.
    2. +
    3. The click event's default must not be prevented and it must be a left-click.
    4. +
    5. The link must not have any of the following attributes: +
        +
      • data-rel="back"
      • +
      • data-rel="external
      • +
      • data-ajax="false"
      • +
      • The target attribute must not be present
      • +
      +
    6. +
    7. The global configuration option $.mobile.ajaxEnabled must be true.
    8. +
    9. The link must be to the same domain or it must be to a permitted cross-domain-request destination.
    10. +
    +

    +

    If these criteria are met jQuery Mobile retrieves the document via AJAX. It is important to realize that, while the document is retrieved in its entirety, only the first jQuery Mobile page is displayed. The header and the rest of the body are discarded. Thus, it is not possible to retrieve a multi-page document via AJAX, nor is it possible to execute scripts located in the header.

    + +

    After AJAX retrieval, jQuery Mobile displays the page via a transition. The transition can be specified on the link that opens the page using the data-transition attribute. If no transition is specified, then $.mobile.defaultPageTransition is used or, if the incoming page is a dialog, then $.mobile.defaultDialogTransition is used. Note: The dialog widget is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0.

    +

    If the browser supports the replaceState API the location bar is updated such that it displays the URL of the document that was retrieved via AJAX. This latter step has the following implication for site/application design: Since the user can copy the URL of a page other than the start page, the application must be designed such that it can start from any of its pages. The best way to achieve this is to include jQuery Mobile and your application code in the header for all the pages of the site/application, and ensure initial state consistency during the pagecreate event.

    +
    + + 1.4 + + + + + + + + Triggered before any load request is made. +

    Callbacks bound to this event can call preventDefault() on the event to indicate that they are handling the load request. Callbacks that do this MUST make sure they call resolve() or reject() on the deferred object reference contained in the object passed to the callback via its ui parameter.

    +
    + + + + The absolute or relative URL that was passed into load() by the caller. + + + + The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page. + + + + The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active. + + + + Deferred to be resolved or rejected upon completion of content load. Callbacks that call preventDefault() on the event MUST call resolve() or reject() on this object so that change() requests resume processing. Deferred object observers expect the deferred object to be resolved like this: +
    
    +$( document ).on( "pagecontainerbeforeload", function( event, data ) {
    +
    +	// Let the framework know we're going to handle the load.
    +
    +	event.preventDefault();
    +
    +	// ... load the document then insert it into the DOM ...
    +	// at some point, either in this callback, or through
    +	// some other async means, call resolve, passing in
    +	// the following args, plus a jQuery collection object
    +	// containing the DOM element for the page.
    +
    +	data.deferred.resolve( data.absUrl, data.options, page );
    +
    +});
    +
    +

    or rejected like this:

    +
    
    +$( document ).on( "pagecontainerbeforeload", function( event, data ) {
    +
    +	// Let the framework know we're going to handle the load.
    +
    +	event.preventDefault();
    +
    +	// ... load the document then insert it into the DOM ...
    +	// at some point, if the load fails, either in this
    +	// callback, or through some other async means, call
    +	// reject like this:
    +
    +	data.deferred.reject( data.absUrl, data.options );
    +
    +});
    +
    + +
    + + This object contains the options that were passed into load(). + + +
    +
    + + Triggered before the transition between two pages starts. + + + + The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page. + + + + The configuration options to be used for the current change() call. + + + + The href from the link that started the page change process. + + + + This property represents the page to which the caller wishes to transition. It is a jQuery collection object containing the page DOM element. + + + + + + Triggered when the change() request fails to load the page. + + + + This property represents the page the caller wishes to make active. It may be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page, in which case the value exactly matches the first argument to the change() call that triggered the event. + + + + + The configuration options to be used for the current change() call. + + + + + + + Triggered after the transition animation has completed. Note: Unlike the deprecated pagehide event, this event is not triggered on the "fromPage" but the widget's element. +

    Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

    +

    You can access the nextPage properties via the second argument of a bound callback function. For example:

    +
    
    +$( ":mobile-pagecontainer" ).on( "pagecontainerhide", function( event, ui ) {
    +  alert( "This page was just shown: " + ui.nextPage );
    +});
    +
    +

    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 mobileinit handler, as described on the global config page.

    +
    + + + + A jQuery collection object that contains the page DOM element to which we just transitioned. + + + +
    + + Triggered after the page is successfully loaded and inserted into the DOM. + + + + The absolute or relative URL that was passed into load() by the caller. + + + + The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page. + + + + The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active. + + + + This object contains the options that were passed into load(). + + + + The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the 3rd argument to the framework's $.ajax() success callback. + + + + According to the jQuery Core documentation, this will be a string describing the status. This is what gets passed as the 2nd argument to the framework's $.ajax() error callback. It may also be null. + + + + + + Triggered if the page load request failed. +

    By default, after dispatching this event, the framework will display a page failed message and call reject() on the deferred object contained within the event's ui parameter. Callbacks can prevent this default behavior from executing by calling preventDefault() on the event.

    +
    + + + + The absolute or relative URL that was passed into load() by the caller. + + + + The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page. + + + + The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active. + + + + Callbacks that call preventDefault() on the event, MUST call resolve() or reject() on this object so that change() requests resume processing. Deferred object observers expect the deferred object to be resolved like this: +
    
    +$( document ).on( "pageloadfailed", function( event, data ) {
    +
    +	// Let the framework know we're going to handle things.
    +
    +	event.preventDefault();
    +
    +	// ... attempt to load some other page ...
    +	// at some point, either in this callback, or through
    +	// some other async means, call resolve, passing in
    +	// the following args, plus a jQuery collection object
    +	// containing the DOM element for the page.
    +
    +	data.deferred.resolve( data.absUrl, data.options, page );
    +
    +});
    +
    +

    or rejected like this:

    +
    
    +$( document ).on( "pageloadfailed", function( event, data ) {
    +
    +	// Let the framework know we're going to handle things.
    +
    +	event.preventDefault();
    +
    +	// ... attempt to load some other page ...
    +	// at some point, if the load fails, either in this
    +	// callback, or through some other async means, call
    +	// reject like this:
    +
    +	data.deferred.reject( data.absUrl, data.options );
    +
    +});
    +
    +
    + +
    + + This object contains the options that were passed into load(). + + + + The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the first argument to the framework's $.ajax() error callback. + + + (null or string) + According to the jQuery Core documentation, possible values for this property, aside from null, are "timeout", "error", "abort", and "parsererror". This is what gets passed as the 2nd argument to the framework's $.ajax() error callback. + + + + According to the jQuery Core documentation, this property may be an exception object if one occurred, or if an HTTP error occurred this will be set to the textual portion of the HTTP status. Otherwise it will be null. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback. + + + +
    +
    + + Triggered after the transition animation has completed.Note: Unlike the deprecated pageshow event, this event is not triggered on the "toPage" but the widget's element. +

    You can access the prevPage properties via the second argument of a bound callback function. For example:

    +
    
    +$( ":mobile-pagecontainer" ).on( "pagecontainershow", function( event, ui ) {
    +  alert( "This page was just hidden: " + ui.prevPage );
    +});
    +
    +

    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 mobileinit handler, as described on the global config page.

    +
    + + + + A jQuery collection object that contains the page DOM element that we just transitioned away from. Note that this collection is empty when the first page is transitioned in during application startup. + + + +
    + + Triggered after the page change transition completes. + + + + The absolute version of the url of the destination page. If url was relative, it is resolved against the url used to load the current active page. + + + + This object contains the options that were passed into load(). + + + + The href from the link that started the page change process. + + + + This property represents the page to which the caller has transitioned. It is a jQuery collection object containing the page DOM element. + + + + +
    + + + + $( ":mobile-pagecontainer" ).pagecontainer( "change", "confirm.html", { role: "dialog" } ); + Programmatically change from one page to another. + + The URL to which to navigate. This can be specified either as a string, or as a jQuery collection object containing the page DOM element. + + + + + + By default, change() ignores requests to change to the current active page. Setting this option to true allows the request to execute. Developers should note that some of the page transitions assume that the fromPage and toPage of a change() request are different, so they may not animate as expected. Developers are responsible for either providing a proper transition, or turning it off for this specific case. + + + + Whether to create a new browser history entry as part of the navigation sequence. Possible values: + + + +
    trueThe will create a browser history entry as part of moving to the desired page. Thus, the user can use the browser's "Back" and "Forward" buttons to navigate between the source page and the destination page.
    falseThe will navigate to the desired page without creating a new browser history entry. The desired page replaces the current page, and the browser's "Back" and "Forward" buttons cannot be used to navigate between the source page and the destination page.
    +
    +
    + + The URL to use when updating the browser location upon change() completion. If not specified, the value of the data-url attribute of the page element is used. + + + The number of milliseconds by which to delay the appearance of the loading message. If the load completes within this time, no loading message is displayed. + + + Note: This property is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Use property reload instead. +

    Whether to force a reload of the page even when it is already in the DOM. Used only when the 'url' argument is a URL.

    +
    +
    + + Whether to force a reload of the page even when it is already in the DOM. Used only when the 'url' argument is a URL. + + + Whether the transition shall be applied in reverse. By setting this value to true you can simulate returning to a previous page, even when the actual navigation sequence is in a forward direction. + + + The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element. + + + Whether to display a message indicating that the page is loading. + + + The transition that should be used for the page change. If the value is undefined, the value of $.mobile.defaultPageTransition (currently "fade") will be used for pages, and $.mobile.defaultDialogTransition (currently "pop") will be used for dialogs. +

    Default value: undefined

    +
    +
    + + The type of HTTP request to use ("get", "post", etc.). Used only when the 'to' argument is a URL. + +
    +
    + + $( ":mobile-pagecontainer" ).pagecontainer( "load", "confirm.html", { role: "dialog" } ); + Load an external page, enhance its content, and insert it into the DOM. + + The URL from which to load the page. This can be an absolute or a relative URL (e.g. "about/us.html"). You can also specify a jQuery collection object. + + + + + A hash containing options that affect the behavior of the method. + + The type of HTTP request to use ("get", "post", etc.). + + + + The data to send with an AJAX page request. + + + + + + + + + Note: This property is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Use property reload instead. +

    Whether to force a reload of the page even when it is already in the DOM. Used only when the 'url' argument is a URL.

    +
    +
    + + Whether to force a reload of the page even when it is already in the DOM. Used only when the 'url' argument is a URL. + + + The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element. + + + Whether to display a message indicating that the page is loading. + + + The number of milliseconds by which to delay the appearance of the loading message. If the load completes within this time, no loading message is displayed. + +
    +
    +
    + +
    diff --git a/entries/pagecreate.xml b/entries/pagecreate.xml index 6017a2c2..2be99226 100644 --- a/entries/pagecreate.xml +++ b/entries/pagecreate.xml @@ -11,7 +11,7 @@ $( "#aboutPage" ).on( "pagecreate", function( event ) { 1.0 - +
    diff --git a/entries/pagehide.xml b/entries/pagehide.xml index 4f5787cc..c7c4ed75 100644 --- a/entries/pagehide.xml +++ b/entries/pagehide.xml @@ -1,33 +1,14 @@ - + pagehide Triggered on the "fromPage" after the transition animation has completed. -

    Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:

    -
      -
    • nextPage (object) -
        -
      • A jQuery collection object that contains the page DOM element that we just transitioned to.
      • -
      -
    • -
    -

    Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

    -

    You can access the prevPage or nextPage properties via the second argument of a bound callback function. For example:

    -
    
    -$( "div" ).on( "pageshow", function( event, ui ) {
    -  alert( "This page was just hidden: " + ui.prevPage );
    -});
    -
    -$( "div" ).on( "pagehide", function( event, ui ) {
    -  alert( "This page was just shown: " + ui.nextPage );
    -});
    -
    -

    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 mobileinit handler, as described on the global config page.

    - + Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0. +

    The replacement for is pagecontainerhide. In jQuery Mobile 1.4.0, the two events are identical except for their name.

    1.0 - +
    diff --git a/entries/pageinit.xml b/entries/pageinit.xml index b5704593..d781a002 100644 --- a/entries/pageinit.xml +++ b/entries/pageinit.xml @@ -9,10 +9,13 @@ $( "#aboutPage" ).on( "pageinit", function( event ) { alert( "This page was just enhanced by jQuery Mobile!" ); });
    + +
    Note: This event has been deprecated in 1.4.0 in favor of pagecreate. Simply replace pageinit in the above example.
    1.0 - + + 1.4 diff --git a/entries/pageload.xml b/entries/pageload.xml index 9f553a8c..3d610726 100644 --- a/entries/pageload.xml +++ b/entries/pageload.xml @@ -1,45 +1,14 @@ - + pageload Triggered after the page is successfully loaded and inserted into the DOM. -

    Callbacks bound to this event will be passed a data object as its 2nd arg. This object contains the following information:

    -
      -
    • url (string) -
        -
      • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
      • -
      -
    • -
    • absUrl (string) -
        -
      • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
      • -
      -
    • -
    • dataUrl (string) -
        -
      • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
      • -
      -
    • -
    • options (object) -
        -
      • This object contains the options that were passed into $.mobile.loadPage().
      • -
      -
    • -
    • xhr (object) -
        -
      • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the 3rd argument to the framework's $.ajax() success callback.
      • -
      -
    • -
    • textStatus (null or string) -
        -
      • According to the jQuery Core documentation, this will be a string describing the status. This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
      • -
      -
    • -
    + Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0. +

    The replacement for is pagecontainerload. In jQuery Mobile 1.4.0, the two events are identical except for their name.

    1.0 - +
    diff --git a/entries/pageloadfailed.xml b/entries/pageloadfailed.xml index 36c5b1ed..85bfc607 100644 --- a/entries/pageloadfailed.xml +++ b/entries/pageloadfailed.xml @@ -1,91 +1,14 @@ - + pageloadfailed Triggered if the page load request failed. -

    By default, after dispatching this event, the framework will display a page failed message and call reject() on the deferred object contained within the event's data object. Callbacks can prevent this default behavior from executing by calling preventDefault() on the event.

    -

    The data object, passed as the 2nd arg to the callback function contains the following properties:

    -
      -
    • url (string) -
        -
      • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
      • -
      -
    • -
    • absUrl (string) -
        -
      • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
      • -
      -
    • -
    • dataUrl (string) -
        -
      • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
      • -
      -
    • -
    • deferred (object) -
        -
      • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this: -
        
        -$( document ).on( "pageloadfailed", function( event, data ) {
        -
        -	// Let the framework know we're going to handle things.
        -
        -	event.preventDefault();
        -
        -	// ... attempt to load some other page ...
        -	// at some point, either in this callback, or through
        -	// some other async means, call resolve, passing in
        -	// the following args, plus a jQuery collection object
        -	// containing the DOM element for the page.
        -
        -	data.deferred.resolve( data.absUrl, data.options, page );
        -
        -});
        -
        -

        or rejected like this:

        -
        
        -$( document ).on( "pageloadfailed", function( event, data ) {
        -
        -	// Let the framework know we're going to handle things.
        -
        -	event.preventDefault();
        -
        -	// ... attempt to load some other page ...
        -	// at some point, if the load fails, either in this
        -	// callback, or through some other async means, call
        -	// reject like this:
        -
        -	data.deferred.reject( data.absUrl, data.options );
        -
        -});
        -
        -
      • -
      -
    • -
    • options (object) -
        -
      • This object contains the options that were passed into $.mobile.loadPage().
      • -
      -
    • -
    • xhr (object) -
        -
      • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the first argument to the framework's $.ajax() error callback.
      • -
      -
    • -
    • textStatus (null or string) -
        -
      • According to the jQuery Core documentation, possible values for this property, aside from null, are "timeout", "error", "abort", and "parsererror". This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
      • -
      -
    • -
    • errorThrown (null, string, object) -
        -
      • According to the jQuery Core documentation, this property may be an exception object if one occurred, or if an HTTP error occurred this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.
      • -
      -
    • -
    + Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0. +

    The replacement for is pagecontainerloadfailed. In jQuery Mobile 1.4.0, the two events are identical except for their name.

    1.0 - +
    diff --git a/entries/pageremove.xml b/entries/pageremove.xml index a0a76e1f..6f2d5b94 100644 --- a/entries/pageremove.xml +++ b/entries/pageremove.xml @@ -9,7 +9,7 @@ 1.0 - +
    diff --git a/entries/pageshow.xml b/entries/pageshow.xml index 9e47c3d3..173d4f03 100644 --- a/entries/pageshow.xml +++ b/entries/pageshow.xml @@ -1,31 +1,14 @@ pageshow - Triggered on the "toPage" after the transition animation has completed. + Triggered on the "toPage" after the transition animation has completed. -

    Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it:

    -
      -
    • prevPage (object) -
        -
      • A jQuery collection object that contains the page DOM element that we just transitioned away from. Note that this collection is empty when the first page is transitioned in during application startup.
      • -
      -
    • -
    -

    You can access the prevPage or nextPage properties via the second argument of a bound callback function. For example:

    -
    
    -$( "div" ).on( "pageshow", function( event, ui ) {
    -  alert( "This page was just hidden: " + ui.prevPage );
    -});
    -
    -$( "div" ).on( "pagehide", function( event, ui ) {
    -  alert( "This page was just shown: " + ui.nextPage );
    -});
    -
    -

    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 mobileinit handler, as described on the global config page.

    + Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0. +

    The replacement for is pagecontainershow. In jQuery Mobile 1.4.0, the two events are identical except for their name.

    1.0 - +
    diff --git a/entries/panel.xml b/entries/panel.xml index 7bfa05e5..51ef784a 100644 --- a/entries/panel.xml +++ b/entries/panel.xml @@ -1,20 +1,20 @@ - + Panel Widget Creates a panel widget -

    Panels are designed to be as flexible as possible to make it easy to create menus, collapsible columns, drawers, inspectors panes and more. +

    Panels are designed to be as flexible as possible to make it easy to create menus, collapsible columns, drawers, inspectors panes and more.

    Where panel markup goes in a page

    - -

    A panel must be a sibling to the header, content and footer elements inside a jQuery Mobile page. You can add the panel markup either before or after these elements, but not in between. A panel cannot be placed outside a page, but this constraint will be removed in a future version.

    + +

    A panel must be a sibling to the header, content, and footer elements inside a jQuery Mobile page. You can add the panel markup either before or after these elements, but not in between.

    Here is an example of the panel before the header, content and footer in the source order:

    
    -<div data-role="page">			
    +<div data-role="page">
     
     	<div data-role="panel" id="mypanel">
     		<!-- panel content goes here -->
    @@ -32,7 +32,7 @@
     			

    If a page contains a panel the framework wraps the header, content and footer sections in a div. When opening a panel with display mode "reveal" or "push" the transition is applied to this wrapper. An exception is fixed headers and footers. Those are not included in the wrapper, but will transition in sync with it. Be aware of the fact that all your visible page content should live inside those page sections.

    CSS Multi-column Layout

    - +

    To avoid blinks when opening a panel, we force hardware acceleration on WebKit browsers. The CSS that is used to do this can cause issues with buttons and form elements on the page if their container has a CSS multi-column layout (column-count). To resolve this you have to set the following rule for the element or its container:

    
    @@ -40,7 +40,7 @@
     

    Panel markup conventions

    - +

    A panel consists of a container with a data-role="panel" attribute and a unique ID. This ID will be referenced by the link or button to open and close the panel. The most basic panel markup looks like this:

    
    @@ -49,10 +49,10 @@
     </div>
     
    -

    The position of the panel on the screen is set by the data-position attribute. The defaults to left, meaning it will appear from the left edge of the screen. Specify data-position="right" for it to appear from the right edge instead.

    +

    The position of the panel on the screen is set by the data-position attribute. The position defaults to left, meaning it will appear from the left edge of the screen. Specify data-position="right" for it to appear from the right edge instead.

    The display mode of the panel is set by the data-display attribute. The defaults to reveal, meaning the panel will sit under the page and reveal as the page slides away. Specify data-display="overlay" for the panel to appear on top of the page contents. A third mode, data-display="push" animates both the panel and page at the same time.

    - +

    Here is an example of a panel with a custom position and display option set:

    
    @@ -62,7 +62,7 @@
     

    Dynamic content

    - +

    When you dynamically add content to a panel or make hidden content visible while the panel is open, you have to trigger the updatelayout event on the panel.

    
    @@ -72,14 +72,14 @@ $( "#mypanel" ).trigger( "updatelayout" );
     			

    The framework will check the new height of the panel contents and, in case this exceeds the screen height, set the page min-height to this height and unfix panels with data-position-fixed="true". See also Panel positioning.

    Opening a panel

    - -

    A panel's visibility is toggled by a link somewhere on the page or by calling the panel's open method directly. The defaults place the panel on the left and it will be revealed. Open a panel programmatically like this:

    + +

    A panel's visibility is toggled by a link somewhere on the page or by calling the panel's open method directly. The defaults place the panel on the left in "reveal" mode. Open a panel programmatically like this:

    $( "#idofpanel" ).panel( "open" , optionsHash );
    -

    To control a panel from a link, point the href to references the ID of the panel you want to toggle (mypanel in the example above). This instructs the framework to bind the link to the panel. This link will toggle the visibility of the panel so tapping it will open the panel, and tapping it again will close it.

    - +

    To control a panel from a link, point the href to the ID of the panel you want to toggle (mypanel in the example below). This instructs the framework to bind the link to the panel. This link will toggle the visibility of the panel so tapping it will open the panel, and tapping it again will close it.

    +
    
     <a href="#mypanel">Open panel</a>
     
    @@ -89,16 +89,16 @@ $( "#mypanel" ).trigger( "updatelayout" );

    When using markup to control panels, you can only have a single panel open at once. Clicking a link to open a panel while one is already open will auto-close the first. This is done to keep the markup-only configuration simple.

    Closing a panel

    - -

    Clicking the link that opened the panel, swiping left or right, or tapping the Esc key will close the panel. To turn off the swipt o close behavior, add the data-swipe-close="false" attribute to the panel.

    -

    By default, panels can also be closed clicking outside the panel onto the page contents. To prevent this behavior, add the data-dismissible="false" attribute to the panel. It's possible to have the panel and page sit side-by-side at wider screen widths and prevent the click-out-to-close behavior only above a certain screen width by applying a media query. See the responsive section below for details.

    +

    Clicking the link that opened the panel, swiping left or right, or tapping the Esc key will close the panel. To turn off the swipe-to-close behavior, add the data-swipe-close="false" attribute to the panel.

    + +

    By default, panels can also be closed by clicking outside the panel onto the page contents. To prevent this behavior, add the data-dismissible="false" attribute to the panel. It's possible to have the panel and page sit side-by-side at wider screen widths and prevent the click-out-to-close behavior only above a certain screen width by applying a media query. See the responsive section below for details.

    A panel can also be closed by calling the panel's close method directly.

    $( "#idofpanel" ).panel( "close" );
    -

    It's common to also add a close button inside the panel. To add the link that will close the panel, add the data-rel="close" attribute to tell the framework to close that panel when clicked. It's important to ensure that this link also makes sense if JavaScript isn't available, so we recommend that the href points to the ID of the page where the user should jump to when closing. For example, if the button to open the panel is in the header bar that has and ID of my-header, the close link in the panel should be:

    +

    It's common to also add a close button inside the panel. To add the link that will close the panel, add the data-rel="close" attribute to tell the framework to close that panel when clicked. It's important to ensure that this link also makes sense if JavaScript isn't available, so we recommend that the href points to the ID of the page to which the user should jump when closing. For example, if the button to open the panel is in the header bar that has and ID of my-header, the close link in the panel should be:

    
     <a href="#my-header" data-rel="close">Close panel</a>
    @@ -106,63 +106,56 @@ $( "#mypanel" ).trigger( "updatelayout" );
     
     			

    Panel animations

    -

    Panels will animate if the browser supports 3D transforms, the same criteria for CSS animation support we use for page transitions. Panel animations use translateX CSS transforms to ensure they are hardware accelerated and smooth.

    +

    Panels will animate if the browser supports 3D transforms. The presence of such support is established by the same criteria for CSS animation support we use for page transitions. Panel animations use translateX CSS transforms to ensure they are hardware accelerated and smooth.

    The framework has a feature test to detect if the required CSS properties are supported and will fall back to a simple hide/show if not available. After thorough testing, we decided to not animate panels on less capable platforms because the choppier animations weren't a better experience than a simple hide/show.

    The animate option allows you to turn off panel animations for all devices. To turn off animations via markup, add the data-animate="false" attribute to the panel container.

    - -

    The use of hardware acceleration is triggered during initialization of the page to prevent blinks when opening a panel. Because this increases memory use you have to be aware of performance issues if you use long lists or scripts to dynamically inject content on a page with an animated panel.

    + +

    The use of hardware acceleration is triggered during initialization of the page to prevent blinks when opening a panel. Because this increases memory use you have to be aware of performance issues if you use long lists or scripts to dynamically inject content on a page with an animated panel.

    Panel positioning

    -

    The panel will be displayed with the position:absolute CSS property, meaning it will scroll with the page. When a panel is a opened the framework checks to see if the bottom of the panel contents is in view and, if not, scrolls to the top of the page.

    +

    The panel will be displayed with the position:absolute CSS property, meaning it will scroll with the page. When a panel is opened the framework checks to see if the bottom of the panel contents is in view and, if not, scrolls to the top of the page.

    You can set a panel to position:fixed, so its contents will appear no matter how far down the page you're scrolled, by adding the data-position-fixed="true" attribute to the panel. The framework also checks to see if the panel contents will fit within the viewport before applying the fixed positioning because this property would prevent the panel contents from scrolling and using overflow is not well supported enough to use at this time. If the panel contents are too long to fit within the viewport, the framework will simply display the panel without fixed positioning.

    In general, we recommend that you place the buttons that open the panel at the very top of the screen which is the most common UI pattern for panels. This will avoid the need to scroll and also makes the transitions a bit smoother.

    - -

    Note that there are issues with fixed positioning within Android WebView applications (not the browser) that can cause layout issues, especially when hardware acceleration isn't enabled. We recommend not to use the fixed position panel option if deploying to an Android app. Also, if have a fixed on a page with fixed toolbars, the toolbars might not transition together with the page content.

    + +

    Note that there are issues with fixed positioning within Android WebView applications (not the browser) that can cause layout issues, especially when hardware acceleration isn't enabled. We recommend not to use the fixed position panel option if deploying to an Android app. Also, if you have a fixed panel on a page with fixed toolbars, the toolbars might not transition together with the page content.

    Styling panels

    -

    By default, panels have very simple styles to let you customize them as needed. Panels are essentially just simple blocks with no margins that sit on either side of the page content. The framework wraps the panel content in a div with class ui-pannel-inner which has a padding of 15 pixels. If needed you can override this with custom CSS or use option classes.panelInner to set a different class name for the div

    - +

    By default, panels have very simple styles to let you customize them as needed. Panels are essentially just simple blocks with no margins that sit on either side of the page content. The framework wraps the panel content in a div with class ui-pannel-inner which has a padding of 1em. If needed you can override this with custom CSS or use option classes.panelInner to set a different class name for the div.

    +

    Panels have a fixed width of 17em (272 pixels) which is narrow enough to still show some of the page contents when open to make clicking out to close easy, and still looks good on wider tablet or desktop screens. The styles to set widths on panels are fairly complex but these can be overridden with CSS as needed.

    - -

    Note that adding padding, borders, or margins directly to the panel container will alter the overall dimensions and could cause the positioning and animation to be affected. To avoid this, apply styles to the panel content wrapper (.ui-pannel-inner).

    -

    Other than the theme background, width and 100% height styles, panels have very little styling on their own. The default theme for panels is "c". You can set a different theme for the panel by adding a data-theme to the panel container, or set data-theme="none" and add your own classes to style it as needed.

    - +

    Note that adding padding, borders, or margins directly to the panel container will alter its overall dimensions and could cause the positioning and animation to be affected. To avoid this, apply styles to the panel content wrapper (.ui-pannel-inner).

    + +

    Other than the theme background, width and 100% height styles, panels have very little styling of their own. The default theme for panels is "a". You can set a different theme for the panel by adding a data-theme to the panel container, or set data-theme="none" and add your own classes to style it as needed.

    +

    The framework applies the theme that is used for the page to the content wrapper. Before opening a panel that has display mode reveal or push, the page theme will be set to the same theme that is used for the panel. This is done to mask that most mobile browsers haven't finished painting the panel background when the animation to open it has already started. If you use a background image for a page, you have to set it for the ui-body-* class of the theme that you use for the page so it will be used as background of the content wrapper.

    - +

    Making the panel responsive

    -

    When the push or reveal display is used, a panel pushes the page aside when it opens. Since some of the page is pushed offscreen, the panel is modal and must be closed to interact with the page content again. On larger screens, you may want to have the panel work more like a collapsible column that can be opened and used alongside the page to take better use of the screen real estate.

    +

    When the push or reveal display is used, a panel pushes the page aside when it opens. Since some of the page is pushed offscreen, the panel is modal and must be closed to interact with the page content again. On larger screens, you may want to have the panel work more like a collapsible column that can be opened and used alongside the page to make better use of screen real estate.

    To make the page work alongside the open panel, it needs to re-flow to a narrower width so it will fit next to the panel. This can be done purely with CSS by adding a left or right margin equal to the panel width (17em) to the page contents to force a re-flow. Second, the invisible layer placed over the page for the click out to dismiss behavior is hidden with CSS so you can click on the page and not close the menu.

    Here is an example of these rules wrapped in a media query to only apply this behavior above 35em (560px):

    - +
    
     @media (min-width:35em) {
     
     	/* wrap on wide viewports once open */
     	
    -	.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-left,
    -	.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-left,
    -	.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-left,
    -	.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-left {
    +	.ui-panel-page-content-open.ui-panel-page-content-position-left {
     		margin-right: 17em;
     	}
    -	.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-right,
    -	.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-right,
    -	.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-right,
    -	.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-right {
    +	.ui-panel-page-content-open.ui-panel-page-content-position-right {
     		margin-left: 17em;
     	}
    -	.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push,
    -	.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal {
    +	.ui-panel-page-content-open {
     		width: auto;	
     	}
     	
    @@ -170,93 +163,65 @@ $( "#mypanel" ).trigger( "updatelayout" );
     	.ui-panel-dismiss {
     		display: none;
     	}
    +	
     	/* same as the above but for panels with display mode "push" only */
    +
    +	.ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-push {
    +		margin-right: 17em;
    +	}
    +	.ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-push {
    +		margin-left: 17em;
    +	}
    +	.ui-panel-page-content-open.ui-panel-page-content-display-push {
    +		width: auto;	
    +	}
    +
     	.ui-panel-dismiss-display-push {
     		display: none;
     	}
    -    	
    +
     }
     
    - +

    Applying a preset breakpoint

    - -

    Included in the widget styles is a breakpoint preset for this behavior that kicks in at 55em (880px). This breakpoint is not applied by default to make it easier for you to write custom breakpoints that work best for your content and design. To apply the breakpoint preset, add the ui-responsive-panel class to the page wrapper (not the panel).

    - + +

    Included in the widget styles is a breakpoint preset for this behavior that kicks in at 55em (880px). This breakpoint is not applied by default to make it easier for you to write custom breakpoints that work best for your content and design. To apply the breakpoint preset, add the ui-responsive-panel class to the page (not the panel).

    1.3 - - - - - - - - - - - - - - - - - - - + Triggered at the start of the process of closing a panel @@ -315,7 +317,7 @@ $( document ).on( "mobileinit", function() { - + Triggered at the start of the process of opening a panel @@ -325,7 +327,7 @@ $( document ).on( "mobileinit", function() { - + Triggered when a panel is created @@ -335,7 +337,7 @@ $( document ).on( "mobileinit", function() { - + Triggered when the process (and animation) of closing a panel is finished @@ -345,7 +347,7 @@ $( document ).on( "mobileinit", function() { - + Triggered when the process (and animation) of opening a panel is finished @@ -366,31 +368,31 @@ $( document ).on( "mobileinit", function() { - toggles the visibility the panel so it will open a closed panel or close and open panel. + toggles the visibility the panel so it will open a closed panel or close and open panel. A basic example of a panel. - - + + diff --git a/entries/popup.xml b/entries/popup.xml index 2469fe04..f4e22a56 100644 --- a/entries/popup.xml +++ b/entries/popup.xml @@ -1,9 +1,10 @@ - + Popup Widget - Opens content in a Popup. + Opens content in a popup. +

    Popups

    To create a popup, add the data-role="popup" attribute to a div with the popup contents. Then create a link with the href set to the id of the popup div, and add the attribute data-rel="popup" to tell the framework to open the popup when the link is tapped. This is a similar markup pattern to the dialog widget. A popup div has to be nested inside the same page as the link.

    
    @@ -18,7 +19,7 @@
     		

    The popup consists of two elements: the screen, which is a transparent or translucent element that covers the entire document, and the container, which is the popup itself. If your original element had an id attribute, the screen and the container will each receive an id attribute based on it. The screen's id will be suffixed with "-screen", and the container's id will be suffixed with "-popup" (in the above example, id="popupBasic-screen" and id="popupBasic-popup", respectively).

    - +

    The framework adds a small amount of margin to text elements, but it's really just a container with rounded corners and a shadow which serves as a blank slate for your designs (even these features can be disabled via options).

    This simple styling makes it easy to add in widgets to create a variety of different interactions. Here are a few real-world examples that combine the various settings and styles you can achieve out of the box with popups: @@ -26,14 +27,14 @@

    Scaling images: Lightbox examples

    - +

    The framework CSS contains rules that make images that are immediate children of the popup scale to fit the screen. Because of the absolute positioning of the popup container and screen, the height is not adjusted to screen height on all browsers. You can prevent vertical scrolling with a simple script that sets the max-height of the image.

    - -

    In the two examples below the divs with data-role="popup" have a class of photopopup. + +

    In the two examples below the divs with data-role="popup" have a class of photopopup.

    - -

    The handler is bound to the popupbeforeposition event, which ensures the image is not only scaled before it is shown but also when the window is resized (e.g. orientation change). In this code example the height is reduced by 60 to take a top and bottom tolerance of 30 pixels into account.

    + +

    The handler is bound to the popupbeforeposition event, which ensures the image is not only scaled before it is shown but also when the window is resized (e.g. orientation change). In this code example the height is reduced by 60 to take a top and bottom tolerance of 30 pixels into account.

    
     $( document ).on( "pageinit", function() {
    @@ -45,23 +46,23 @@ $( document ).on( "pageinit", function() {
         });
     });
     
    - +

    Working with iframes in popups

    - +

    You may need to embed an iframe into a popup to use a 3rd party widget. Here, we'll walk through a few real-world examples of working with iframes: videos and maps.

    Video example

    - +

    Here is an example of a 3rd party video player embedded in a popup:

    - -

    The markup is an iframe inside a popup container. The popup will have a 15 pixels padding because of class ui-content and a one pixel border because the framework will add class ui-body-d to the popup.

    - + +

    The markup is an iframe inside a popup container. The popup will have a 15 pixels padding because of class ui-content and a one pixel border because the framework will add class ui-body-a to the popup.

    +
    
    -<div data-role="popup" id="popupVideo" data-overlay-theme="a" data-theme="d" data-tolerance="15,15" class="ui-content">
    +<div data-role="popup" id="popupVideo" data-overlay-theme="b" data-theme="a" data-tolerance="15,15" class="ui-content">
     
         <iframe src="http://player.vimeo.com/video/41135183" width="497" height="298" seamless></iframe>
    -	 
    +
     </div>
     
    @@ -69,7 +70,7 @@ $( document ).on( "pageinit", function() {

    Next, bind to the popupbeforeposition event to set the desired size of the iframe when the popup is shown or when the window is resized (e.g. orientation change). For the iframe examples on this page a custom function scale() is used to scale down the iframe to fit smaller screens. Expand the section below to view the code of this function.

    -
    +

    scale()

    The window width and height are decreased by 30 to take the tolerance of 15 pixels at each side into account.

    
     

    Note: This function is not part of the framework. Copy the code into your script to use it.

    -
    - +
    +

    When the popup is closed the width and height should be set back to 0. You can do this by binding to the popupafterclose event.

    - +

    This is the complete script and the link to open the video popup:

    - +
    
     $( document ).on( "pageinit", function() {
         $( "#popupVideo iframe" )
             .attr( "width", 0 )
             .attr( "height", 0 );
    -		  
    +
         $( "#popupVideo" ).on({
             popupbeforeposition: function() {
                 var size = scale( 497, 298, 15, 1 ),
    @@ -125,32 +126,32 @@ $( document ).on( "pageinit", function() {
             popupafterclose: function() {
                 $( "#popupVideo iframe" )
                     .attr( "width", 0 )
    -                .attr( "height", 0 );    
    +                .attr( "height", 0 );
             }
         });
     });
     
    - +

    Note that the video will still be playing in the iframe when the popup is closed. If available you can use the 3rd party API to stop the video on the popupafterclose event. Another way is to create the iframe when the popup is opened and destroy it when the popup is closed, but this would drop support for browsers that have JavaScript disabled.

    - +

    Map example

    In the second example, an iframe is used to display Google Maps API. Using an iframe prevents issues with the controls of the map.

    - +

    This is the markup of the popup including a right close button:

    
    -<div data-role="popup" id="popupMap" data-overlay-theme="a" data-theme="a" data-corners="false" data-tolerance="15,15">
    +<div data-role="popup" id="popupMap" data-overlay-theme="b" data-theme="b" data-corners="false" data-tolerance="15,15">
    +
    +    <a href="#" data-rel="back" data-role="button" data-theme="b" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
     
    -    <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
    -	 
         <iframe src="map.html" width="480" height="320" seamless></iframe>
    -	 
    +
     </div>
     

    Expand the section below to view the source of the iframe.

    -
    +

    map.html

    
     <!DOCTYPE html>
    @@ -180,33 +181,33 @@ $( document ).on( "pageinit", function() {
                 padding: 0;
                 height: 100%;
             }
    -        #map_canvas { 
    +        #map_canvas {
                 height: 100%;
    -        }    
    +        }
         </style>
     </head>
     <body onload="initialize()">
     
         <div id="map_canvas"></div>
    -    
    +
     </body>
     </html>
     
    - -

    Setting the size of the iframe is done exactly the same as for the video example, with one exception. You should also set the width and height of the div that contains the map to prevent the page to break on platforms like Android 2.3. In this example the ID of this div is #map_canvas.

    - + +

    Setting the size of the iframe is done exactly the same as for the video example, with one exception. You should also set the width and height of the div that contains the map to prevent the page from breaking on platforms like Android 2.3. In this example the ID of this div is #map_canvas.

    +

    This is the complete script and the link to open the map popup:

    - +
    
     $( document ).on( "pageinit", function() {
         $( "#popupMap iframe" )
             .attr( "width", 0 )
             .attr( "height", 0 );
    -		  
    +
         $( "#popupMap iframe" ).contents().find( "#map_canvas" )
             .css( { "width" : 0, "height" : 0 } );
    -	 	     
    +
         $( "#popupMap" ).on({
             popupbeforeposition: function() {
                 var size = scale( 480, 320, 0, 1 ),
    @@ -216,7 +217,7 @@ $( document ).on( "pageinit", function() {
                 $( "#popupMap iframe" )
                     .attr( "width", w )
                     .attr( "height", h );
    -					 
    +
                 $( "#popupMap iframe" ).contents().find( "#map_canvas" )
                     .css( { "width": w, "height" : h } );
             },
    @@ -224,101 +225,54 @@ $( document ).on( "pageinit", function() {
                 $( "#popupMap iframe" )
                     .attr( "width", 0 )
                     .attr( "height", 0 );
    -					 
    +
                 $( "#popupMap iframe" ).contents().find( "#map_canvas" )
                     .css( { "width": 0, "height" : 0 } );
             }
         });
     });
    -
    - -

    Overlay panels

    - -

    Taking customization further, here is an example of a popup that has been customized to look like a vertical panel with three mini buttons: -

    - -

    Here is the HTML markup for the button and panel:

    -
    
    -<a href="#popupPanel" data-rel="popup" data-transition="slide" data-position-to="window" data-role="button">Open panel</a>
    -			
    -<div data-role="popup" id="popupPanel" data-corners="false" data-theme="none" data-shadow="false" data-tolerance="0,0">
    -
    -    <button data-theme="a" data-icon="back" data-mini="true">Back</button>
    -    <button data-theme="a" data-icon="grid" data-mini="true">Menu</button>
    -    <button data-theme="a" data-icon="search" data-mini="true">Search</button>
    -	 
    -</div>
    -
    - -

    To style the panel, and attach it to the right edge, the following CSS is used. Note that #popupPanel-popup is the ID of the container div generated by the framework.

    -
    
    -#popupPanel-popup {
    -    right: 0 !important;
    -    left: auto !important;
    -}
    -#popupPanel {
    -    width: 200px;
    -    border: 1px solid #000;
    -    border-right: none;
    -    background: rgba(0,0,0,.5);
    -    margin: -1px 0;
    -}
    -#popupPanel .ui-btn {
    -    margin: 2em 15px;
    -}
    -
    - -

    Because the popup container is positioned absolute, you can't make the panel full height with height:100%;. This small script sets the height of the popup to the actual screen height.

    -
    
    -$( "#popupPanel" ).on({
    -    popupbeforeposition: function() {
    -        var h = $( window ).height();
    -
    -        $( "#popupPanel" ).css( "height", h );
    -    }
    -});
     

    Calling the popup plugin

    This plugin will autoinitialize on any page that contains a div with the attribute data-role="popup". However, if needed you can directly call the popup plugin on any selector, just like any jQuery plugin and programmatically work with the popup options, methods, and events API:

    - +
    
     $( "#myPopupDiv" ).popup();
     

    Opening popups

    - +

    Using the markup-based configuration, when a link with the data-rel="popup" is tapped, the corresponding popup container with the id referenced in the href of the link will be shown. To open a popup programmatically, call popup with the open method on the popup container:

    - +
    
     $( "#myPopupDiv" ).popup( "open" )
     

    Closing popups

    By default popups can be closed either by clicking outside the popup widget or by pressing the Esc key. To prevent this, the data-dismissible="false" attribute can be added to the popup. Popups can also be closed via the close method:

    - +
    
     $( "#myPopupDiv" ).popup( "close" )
     
    - +

    To add an explicit close button to a popup, add a link with the role of button into the popup container with a data-rel="back" attribute which will close the popup when tapped. We have created helper classes to position buttons in the upper left (ui-btn-left) or upper right (ui-btn-right) of the popup but you may need to tweak these or add custom positioning styles depending on your design. We recommend adding standard content padding to the popup to make room for the buttons (see next section).

    - - + +
    
     <div data-role="popup">
     	<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
     	...popup contents go here...
     </div>
     
    - +

    - +

    Adding padding

    - -

    For popups with formatted text, padding is needed. We recommend adding the ui-content class to the popup container which adds the standard 15px of padding, just like the page content container. Write your own styles to create a more customized design if needed.

    - + +

    For popups with formatted text, padding is needed. We recommend adding the ui-content class to the popup container which adds the standard 1em (16px) of padding, just like the page content container. Write your own styles to create a more customized design if needed.

    +
    
     <a href="#popupPadded" data-rel="popup" data-role="button">Popup with padding</a>
     
    @@ -326,64 +280,89 @@ $( "#myPopupDiv" ).popup( "close" )
     	<p>This is a popup with the <code>ui-content</code> class added to the popup container.</p>
     </div>
     		
    - +

    This will result in the following popup with content padding:

    - +

    When padding is added, we apply a few style rules to negate the top margin for the first heading or paragraph in the popup and do the same for the last element's bottom margin. This keep the popups from having too much vertical space when the content padding and element margins combine.

    - - + +

    Positioning options

    By default, popups open centered vertically and horizontally over the thing you clicked (the origin) which is good for popups used as tooltips or menus. The framework also applies some basic collision detection rules to ensure that the popup will appear on-screen so the ultimate position may not always be centered over the origin.

    -

    For situations like a dialog or lightbox where the popup should appear centered within the window instead of over the origin, add the data-position-to attribute to the link and specify a value of window.

    -

    It's also possible to specify any valid selector as the value of position-to in addition to origin and window. For example, if you add data-position-to="#myElement" the popup will be positioned over the element with the id myElement.

    +

    For situations like a dialog or lightbox where the popup should appear centered within the window instead of over the origin, add the data-position-to attribute to the link and specify a value of window.

    +

    It's also possible to specify any valid selector as the value of position-to in addition to origin and window. For example, if you add data-position-to="#myElement" the popup will be positioned over the element with the id myElement.

    A few examples:

    - +

    The popup's placement constraints, which may cause the popup not to appear centered as desired, are as follow:

    1. The width of the popup will be limited using CSS max-width to the width of the window minus a tolerance of 15px on either side.
    2. -
    3. A tolerance from the edges of the window (15px from each of the sides and 30px from the top and the bottom) will be observed when the popup fits inside the window. Tall popups are allowed to overflow the top and bottom edges of the window. Those parts of the popup can be viewed by manually scrolling the document. This tolerance is a configurable option.
    4. +
    5. A tolerance from the edges of the window (15px from each of the sides and 30px from the top and the bottom) will be observed when the popup fits inside the window. Tall popups are allowed to overflow the top and bottom edges of the window. Those parts of the popup can be viewed by manually scrolling the document. This tolerance can be configured via the tolerance option.
    6. The top coordinate of the popup will never be negative. This ensures that the top of the popup will not be cut off.
    7. If centering the popup over an element would cause the overall height of the document to increase, the popup is shifted upwards at most until its top coordinate becomes 0.
    - +

    Also note that a popup is currently always placed at the center of the window after an orientation change or window resize event.

    -

    See methods for information about setting the popup position programmatically, including the option to specify x and y coordinates.

    +

    See methods for information about setting the popup position programmatically, including the option to specify x and y coordinates.

    Setting transitions

    By default, popups have no transition to make them open as quickly as possible. To set the transition used for a popup, add the data-transition attribute to the link that references the popup. The reverse version of the transition will be used when closing the popup.

    - +
    
     <a href="#transitionExample" data-transition="flip" data-rel="popup">
        Flip transition
     </a>
     
    - +

    For performance reasons on mobile devices, we recommend using simpler transitions like pop, fade or none for smooth and fast popup animations, especially with larger or complex widgets within a popup. To view all transition types, you must be on a browser that supports 3D transforms. By default, devices that lack 3D support (such as Android 2.x) will fallback to "fade" for all transition types. See the transitions page for detailed information on the transition system.

    - +

    When you launch the popup from any of the buttons, the data-transition set on the button will be used. However, if you launch the popup programmatically, such as via $( "#transitionExample" ).popup( "open" ), the data-transition attribute specified in the definition of the popup will be used if present.

    -

    Theming the popup and overlay

    - +

    The popup plugin provides two theme-related options: data-theme and data-overlay-theme. The data-theme option refers to the theme of the popup itself, whereas data-overlay-theme refers to the theme of the popup's background, which covers the entire window behind the popup.

    data-theme will be inherited from the page, and will always have a valid value when the popup opens, unless you explicitly specify data-theme="none", in which case the popup will have a transparent background.

    The data-overlay-theme will never be set, and the popup's background, although always present when the popup is shown, will be completely transparent, unless explicitly set using for example data-overlay-theme="a". In this case, the background will fade in, partially obscuring the rest of the window, to further direct attention to the popup. Here is an example of an explicitly themed popup:

    
    -<div id="both" data-role="popup" data-theme="e" data-overlay-theme="a" class="ui-content">
    +<div id="both" data-role="popup" data-theme="b" data-overlay-theme="a" class="ui-content">
       ...Popup contents...
     </div>
     
    - + - -

    Note: Chaining of popups not allowed

    + +

    Arrows

    +

    The extension widgets/popup.arrow provides the arrow option, which is also exposed as a data attribute. For example, data-arrow="t,b" will result in the popup being displayed with a top or a bottom arrow.

    +

    When an arrow is requested using the arrow option, the popup is positioned along one of the edges of the popup such that the arrow points at the center of the origin. The value of the arrow option is a comma-separated list of letters referring to the edges of the popup along which the framework should attempt to place the arrow: + + + + + +
    tThe framework should attempt to place the popup such that the arrow somewhere along the top edge of the popup points at the center of the origin.
    rThe framework should attempt to place the popup such that the arrow somewhere along the right edge of the popup points at the center of the origin.
    bThe framework should attempt to place the popup such that the arrow somewhere along the bottom edge of the popup points at the center of the origin.
    lThe framework should attempt to place the popup such that the arrow somewhere along the left edge of the popup points at the center of the origin.
    +

    +

    For each edge given in the list, the framework calculates +

      +
    1. the distance between the tip of the arrow and the center of the origin, and
    2. +
    3. whether minimizing the above distance would cause the arrow to appear too close to one of the corners of the popup along the given edge.
    4. +
    + If the second condition applies, the edge is discarded as a possible solution for placing the arrow. Otherwise, the calculated distance is examined. If it is 0, meaning that the popup can be placed exactly such that the tip of the arrow points at the center of the origin, no further edges are examined, and the popup is positioned along the last examined edge. Thus, the order in which the edges are given matters.

    +

    The example below shows a popup with an arrow either along its left edge or along its top edge.

    +
    
    +<div data-role="popup" data-arrow="l,t" class="ui-content">
    +	<h2>Popup with an arrow</h2>
    +	<p>A second paragraph.</p>
    +</div>
    +
    + + + +

    Note: Chaining of popups not allowed

    The framework does not currently support chaining of popups so it's not possible to embed a link from one popup to another popup. All links with a data-rel="popup" inside a popup will not do anything at all.

    This also means that custom select menus will not work inside popups, because they are themselves implemented using popups. If you place a select menu inside a popup, it will be rendered as a native select menu, even if you specify data-native-menu="false".

    A workaround to get chained popups working is the use of a timeout for example in the popupafterclose event bound to the invoking popup. In the following example, when the first popup is closed, the second will be opened by a delayed call to the open method:

    @@ -395,11 +374,48 @@ $( document ).on( "pageinit", function() { } }); }); -
    +
    + + +

    The widget moves the element on which it is instantiated such that it becomes the last child element of a page div or, if the element is not inside a page, it will become the last child element of the body. It then wraps the element in a container div, and prepends a newly created element that serves as the modal overlay screen to the parent of the container.

    +

    The example below includes an entire jQuery Mobile page rather than just the popup. This helps illustrate where you must place the markup for the pre-rendered popup widget in relation to the jQuery Mobile page on which it is to appears. In the example, the popup has the attribute data-overlay-theme="b" to reflect the fact that the modal overlay screen has an associated theme.

    + +
    
    +
    +
    +

    Example Page

    +
    + + <!-- the following two divs represent the pre-rendered popup widget --> +
    +
    +
    +

    Pre-rendered popup

    +
    +
    +
    +
    + + 1.2 + + - - -
    ]]> - + diff --git a/entries/scrollstart.xml b/entries/scrollstart.xml index 306c6469..1c1862c3 100644 --- a/entries/scrollstart.xml +++ b/entries/scrollstart.xml @@ -7,7 +7,7 @@ 1.0 - + diff --git a/entries/scrollstop.xml b/entries/scrollstop.xml index e02b2917..df038953 100644 --- a/entries/scrollstop.xml +++ b/entries/scrollstop.xml @@ -3,11 +3,11 @@ scrollstop Triggers when a scroll finishes. - + 1.0 - + diff --git a/entries/select.xml b/entries/selectmenu.xml similarity index 87% rename from entries/select.xml rename to entries/selectmenu.xml index 0505820a..96909bf7 100644 --- a/entries/select.xml +++ b/entries/selectmenu.xml @@ -1,15 +1,15 @@ - + Selectmenu Widget Creates a select menu widget

    The select menu is based on a native select element, which is hidden from view and replaced with a custom-styled select button that matches the look and feel of the jQuery Mobile framework. The select menu is ARIA-enabled and keyboard accessible on the desktop as well.

    By default, the framework leverages the native OS options menu to use with the custom button. When the button is clicked, the native OS menu will open. When a value is selected and the menu closes, the custom button's text is updated to match the selected value. Please note that the framework also offers the possibility of having custom (non-native) select menus.

    To add a select menu to your page, start with a standard select element populated with a set of option elements. Set the for attribute of the label to match the id of the select so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

    - +

    The framework will find all select elements and automatically enhance them into select menus, no need to apply a data-role attribute. To prevent the automatic enhancement of a select, add data-role="none" attribute to the select.

    - +
    
     <label for="select-choice-0" class="select">Shipping method:</label>
     <select name="select-choice-0" id="select-choice-0">
    @@ -22,30 +22,31 @@
     
     		

    This will produce a basic select menu. The default styles set the width of the input to 100% of the parent container and stacks the label on a separate line.

    - +

    Mini version

    - +

    For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

    -
    	
    +
    
     <label for="select-choice-min" class="select">Shipping method:</label>
     <select name="select-choice-min" id="select-choice-min" data-mini="true">
     	<option value="standard">Standard: 7 day</option>
     	<option value="rush">Rush: 3 days</option>
     	<option value="express">Express: next day</option>
     	<option value="overnight">Overnight</option>
    -</select> 
    +</select>
     
    - +

    This will produce a select that a not as tall as the standard version and has a smaller text size.

    - +

    Field containers

    - -

    Optionally wrap the selects in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

    - + +

    Optionally wrap the selects in a container with class ui-field-contain to help visually group it in a longer form.

    +

    Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

    +
    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="select-choice-1" class="select">Shipping method:</label>
     	<select name="select-choice-1" id="select-choice-1">
     		<option value="standard">Standard: 7 day</option>
    @@ -55,10 +56,10 @@
     	</select>
     </div>
     
    - +

    The select input is now displayed like this:

    - +

    An example of a select with a long list of options:

    @@ -66,7 +67,7 @@

    The following example organizes the options into optgroup elements. Support for this feature in mobile selects is a bit spotty, but is improving.

    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="select-choice-nc" class="select">Preferred delivery:</label>
     	<select name="select-choice-8" id="select-choice-nc">
         	<optgroup label="FedEx">
    @@ -97,10 +98,10 @@
     
     		

    Because the label element will be associated with each individual select input and will be hidden for styling purposes, we recommend wrapping the selects in a fieldset element that has a legend which acts as the combined label for the grouped inputs.

    -

    Lastly, one needs to wrap the fieldset in a div with data-role="controlgroup" attribute, so it can be styled as a group.

    - -
    	
    -<div data-role="fieldcontain">
    +		

    Lastly, one needs to wrap the fieldset in a div with data-role="controlgroup" attribute, so it can be styled as a group.

    + +
    
    +<div class="ui-field-contain">
     	<fieldset data-role="controlgroup">
     		<legend>Date of Birth:</legend>
     
    @@ -122,12 +123,12 @@
     		<select name="select-choice-year" id="select-choice-year">
     			<option>Year</option>
     			<option value="2011">2011</option>
    -			<!-- etc. -->	
    +			<!-- etc. -->
     		</select>
     	</fieldset>
     </div>
     
    - +

    Horizontally grouped select inputs

    @@ -137,9 +138,9 @@ <fieldset data-role="controlgroup" data-type="horizontal">
    - +

    Theming selects

    - +

    You can specify any jQuery Mobile button data- attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:

    @@ -150,9 +151,9 @@

    You can optionally use custom-styled select menus instead of the native OS menu. The custom menu supports disabled options and multiple selection (whereas native mobile OS support for both is inconsistent), adds an elegant way to handle placeholder values, and restores missing functionality on certain platforms such as optgroup support on Android (all explained below). In addition, the framework applies the custom button's theme to the menu to better match the look and feel and provide visual consistency across platforms. Lastly, custom menus often look better on desktop browsers because native desktop menus are smaller than their mobile counterparts and tend to look disproportionate.

    Keep in mind that there is overhead involved in parsing the native select to build a custom menu. If there are a lot of selects on a page, or a select has a long list of options, this can impact the performance of the page, so we recommend using custom menus sparingly.

    - +

    To use custom menus on a specific select, just add the data-native-menu="false" attribute. Alternately, this can also programmatically set the select menu's nativeMenu configuration option to false in a callback bound to the mobileinit event to achieve the same effect. This will globally make all selects use the custom menu by default. The following must be included in the page after jQuery is loaded but before jQuery Mobile is loaded.

    - +
    
     $(document).on( "mobileinit", function() {
    @@ -163,20 +164,21 @@ $(document).on( "mobileinit", function() {
     
     		

    When the select has a small number of options that will fit on the device's screen, the menu will appear as a small overlay with a pop transition:

    - +

    When it has too many options to show on the device's screen, the framework will automatically create a new "page" populated with a standard listview for the options. This allows us to use the native scrolling included on the device for moving through a long list. The text inside the label is used as the title for this page.

    - +

    Disabled options

    - +

    jQuery Mobile will automatically disable and style option tags with the disabled attribute. In the demo below, the second option "Rush: 3 days" has been set to disabled. - +

    - +

    Placeholder options

    It's common for developers to include a "null" option in their select element to force a user to choose an option. If a placeholder option is present in your markup, jQuery Mobile will hide them in the overlay menu, showing only valid choices to the user, and display the placeholder text inside the menu as a header. A placeholder option is added when the framework finds:

      -
    • An option with no value attribute (or an empty value attribute)
    • +
    • An option with no value attribute
    • +
    • An option with an empty value attribute (value=""). Indicating that an option should be used as a placeholder by providing the value attribute and setting it to "" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0.
    • An option with no text node
    • An option with a data-placeholder="true" attribute. (This allows you to use an option that has a value and a textnode as a placeholder option).
    @@ -190,8 +192,8 @@ $.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false;

    Examples of various placeholder options:

    -

    Multiple selects

    - +

    Multiple selects

    +

    If the multiple attribute is present in your markup, jQuery Mobile will enhance the element with a few extra considerations:

      @@ -205,18 +207,18 @@ $.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false;
    - +

    When a select is large enough to where the menu will open in a new page, the placeholder text is displayed in the button when no items are selected, and the label text is displayed in the menu's header. This differs from smaller overlay menus where the placeholder text is displayed in both the button and the header, and from full-page single selects where the placeholder text is not used at all. - +

    Optgroup support

    - +

    If a select menu contains optgroup elements, jQuery Mobile will create a divider & group items based on the label attribute's text:

    Theming selects

    - +

    You can specify any jQuery Mobile button data- attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:

    @@ -225,23 +227,24 @@ $.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false;

    Calling the select menu plugin

    - +

    The select menu plugin will auto initialize on any page that contains a select menu, without any need for a data-role attribute in the markup. However, you can directly call the select menu plugin on any selector, just like any normal jQuery plugin:

    
    -$( "select" ).selectmenu();			
    +$( "select" ).selectmenu();
     
    - + 1.0 + - - - triggered when a text input is created - - - - - - - + close an open select menu. - - enable a disabled text input. - - - - disable a text input. - - + + + open a closed select menu (custom menus only). + - + update the custom select.

    This is used to update the custom select to reflect the native select element's value. If the number of options in the select are different than the number of items in the custom menu, it'll rebuild the custom menu.

    diff --git a/entries/slider.xml b/entries/slider.xml index 0af63aad..0dc5dac7 100644 --- a/entries/slider.xml +++ b/entries/slider.xml @@ -1,14 +1,15 @@ - + Slider Widget Creates a slider widget

    Slider

    + Note: The widget is deprecated as of jQuery Mobile 1.4.0.

    To add a slider widget to your page, use a standard input with the type="range" attribute. The input's value is used to configure the starting position of the handle and the value is populated in the text input. Specify min and max attribute values to set the slider's range. If you want to constrain input to specific increments, add the step attribute. Set the value attribute to define the initial value. The framework will parse these attributes to configure the slider widget.

    As you drag the slider's handle, the framework will update the native input's value (and vice-versa) so they are always in sync; this ensures that the value is submitted with the form.

    Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

    -

    The framework will find all input elements with a type="range" and automatically enhance them into a slider with an accompanying input without any need to apply a data-role attribute. To prevent the automatic enhancement of this input into a slider, add data-role="none" attribute to the input and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    +

    The framework will find all input elements with a type="range" and automatically enhance them into a slider with an accompanying input without any need to apply a data-role attribute. To prevent the automatic enhancement of this input into a slider, add data-role="none" attribute to the input.

    In this example, the acceptable range is 0-100.

    
    @@ -18,7 +19,7 @@
     
     		

    The default slider with these settings is displayed like this:

    - +

    Step increment

    To force the slider to snap to a specific increment, add the step attribute to the input. By default, the step is 1, but in this example, the step is 50 and the maximum value is 500.

    In this example, the acceptable range is 0-100.

    @@ -34,14 +35,14 @@

    Fill highlight

    To have a highlight fill on the track up to the slider handle position, add the data-highlight="true" attribute to the input. The fill uses active state swatch.

    - +
    
     <label for="slider-fill">Input slider:</label>
     <input type="range" name="slider-fill" id="slider-fill" value="60" min="0" max="100" data-highlight="true" />
     
    - +

    Mini version

    For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

    @@ -56,10 +57,11 @@

    Field containers

    -

    Optionally wrap the slider markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form. In this example, the step attribute is omitted to allow any whole number value to be selected.

    +

    Optionally wrap the slider markup in a container with class ui-field-contain to help visually group it in a longer form. In this example, the step attribute is omitted to allow any whole number value to be selected.

    +

    Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="slider-2">Input slider:</label>
     	<input type="range" name="slider-2" id="slider-2" value="25" min="0" max="100" />
     </div>
    @@ -67,7 +69,7 @@
     
     		

    The slider is now displayed like this:

    - +

    Sliders also respond to key commands. Right Arrow, Up Arrow and Page Up keys increase the value; Left Arrow, Down Arrow and Page Down keys decrease it. To move the slider to its minimum or maximum value, use the Home or End key, respectively.

    Calling the slider plugin

    @@ -83,17 +85,17 @@ $( "input" ).slider();

    To set the theme swatch for the slider, add a data-theme attribute to the input which will apply the theme to both the input, handle and track. The track swatch can be set separately by adding the data-track-theme attribute to apply the down state version of the selected button swatch.

    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="slider-3">Input slider:</label>
    -	<input type="range" name="slider-3" id="slider-3" value="25" min="0" max="100" data-theme="a" data-track-theme="b" />
    +	<input type="range" name="slider-3" id="slider-3" value="25" min="0" max="100" data-theme="b" data-track-theme="a" />
     </div>
     

    This will produce a themed slider:

    - +

    Flip Toggle Switch

    - +

    A binary "flip" switch is a common UI element on mobile devices that is used for binary on/off or true/false data input. You can either drag the flip handle like a slider or tap one side of the switch.

    To create a flip toggle, start with a select with two options. The first option will be styled as the "off" state switch and the second will be styled as the "on" state so write your options accordingly.

    Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

    @@ -105,12 +107,12 @@ $( "input" ).slider(); <option value="on">On</option> </select>
    - +

    This will produce a basic flip toggle switch input. The default styles set the width of the switch to 100% of the parent container and stack the label on a separate line.

    - +

    Longer Labels

    - +

    The control is proportionally scaled, so to use longer labels one can just add a line of CSS setting the switch to the desired width. For example, given the following markup:

    
    @@ -145,10 +147,11 @@ $( "input" ).slider();
     
     		

    Field containers

    -

    Optionally wrap the switch markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form. In this example, the step attribute is omitted to allow any whole number value to be selected.

    +

    Optionally wrap the switch markup in a container with class ui-field-contain to help visually group it in a longer form. In this example, the step attribute is omitted to allow any whole number value to be selected.

    +

    Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="flip-2">Select slider:</label>
     	<select name="flip-2" id="flip-2" data-role="slider" data-mini="true">
     		<option value="off">Off</option>
    @@ -156,36 +159,36 @@ $( "input" ).slider();
     	</select>
     </div>
     
    - +

    The flip toggle switch is now displayed like this:

    - -

    Theming the flip switch

    - -

    Like all form elements, this widget will automatically inherit the theme from its parent container. To choose a specific theme color swatch, specify the data-theme attribute on the select and specify a swatch letter.

    - + +

    Theming the flip switch

    + +

    Like all form elements, this widget will automatically inherit the theme from its parent container. To choose a specific theme color swatch, specify the data-theme attribute on the select and specify a swatch letter.

    +
    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="flip-3">Flip switch:</label>
    -	<select name="flip-3" id="flip-3" data-role="slider" data-theme="a">
    +	<select name="flip-3" id="flip-3" data-role="slider" data-theme="b">
     		<option value="no">No</option>
     		<option value="yes">Yes</option>
    -	</select> 
    +	</select>
     </div>
    -
    - -

    This results in a switch with the swatch "a" colors for the handle. Note that the lefthand "on" state gets the active state color. +

    + +

    This results in a switch with the swatch "b" colors for the handle. Note that the lefthand "on" state gets the active state color.

    -

    Here is a swatch "e" variation: +

    Here is a swatch "a" variation:

    It is also possible to theme the track of the flip switch by adding the data-track-theme attribute and specifying the chosen swatch letter on the select.

    -

    Here's an example of a flip switch with the swatch "a" applied to the track and swatch "c" applied to the handle:

    +

    Here's an example of a flip switch with the swatch "a" applied to the track and swatch "c" applied to the handle:

    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="flip-5">Flip switch:</label>
    -	<select name="flip-5" id="flip-5" data-role="slider" data-theme="c" data-track-theme="a">
    +	<select name="flip-5" id="flip-5" data-role="slider" data-theme="a" data-track-theme="b">
     		<option value="no">No</option>
     		<option value="yes">Yes</option>
     	</select>
    @@ -193,7 +196,7 @@ $( "input" ).slider();
     
    - +

    Calling the switch plugin

    This plugin will auto initialize on any page that contains a text input with the type="slider" attribute. However, if needed you can directly call the slider plugin on any selector, just like any jQuery plugin:

    @@ -207,7 +210,7 @@ $( "input" ).slider();

    Like all form elements, this widget will automatically inherit the theme from its parent container. To choose a specific theme color swatch, specify the data-theme attribute on the select and specify a swatch letter.

    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="flip-3">Flip switch:</label>
     	<select name="flip-3" id="flip-3" data-role="slider" data-theme="a">
     		<option value="no">No</option>
    @@ -215,15 +218,15 @@ $( "input" ).slider();
     	</select>
     </div>
     
    - +

    This results in a switch with the swatch "a" colors for the handle. Note that the lefthand "on" state gets the active state color.

    It is also possible to theme the track of the flip switch by adding the data-track-theme attribute and specifying the chosen swatch letter on the select.

    Here's an example of a flip switch with the swatch "a" applied to the track and swatch "c" applied to the handle:

    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="flip-5">Flip switch:</label>
    -	<select name="flip-5" id="flip-5" data-role="slider" data-theme="c" data-track-theme="a">
    +	<select name="flip-5" id="flip-5" data-role="slider" data-theme="a" data-track-theme="b">
     		<option value="no">No</option>
     		<option value="yes">Yes</option>
     	</select>
    @@ -233,43 +236,16 @@ $( "input" ).slider();
     	
     	1.0
     	
    -		
    +		
     		
    -		
    -		
    -		
    +		
    +		
    +		
     		
     	
     	
    -		
    -			triggered when a slider is created	
    -			
    -			
    -			
    -			
    -		
    +		
     		
    -			triggered when there's an initial interaction with the slider. Includes drags and taps.	
    +			triggered when there's an initial interaction with the slider. Includes drags and taps.
     			
     				
     			
     		
     		
    -			triggered at the end of an interaction with the slider. Includes drags and taps.	
    +			triggered at the end of an interaction with the slider. Includes drags and taps.
     			
     				
     			
     		
     	
     	
    -		
    -			enable a disabled slider.
    -			
    -		
    -		
    -			disable a slider.
    -			
    -		
    +		
    +		
    +		
    +		
     		
     			update the slider.
     				

    If you manipulate a slider via JavaScript, you must call the refresh method on it to update the visual styling.

    diff --git a/entries/swipe.xml b/entries/swipe.xml index 9749d3be..1575715a 100644 --- a/entries/swipe.xml +++ b/entries/swipe.xml @@ -66,7 +66,7 @@ function( start, stop ) { $(function(){ // Bind the swipeleftHandler callback function to the swipe event on div.box $('div.box').on( 'swipe', swipeHandler ); - + // Callback function references the event target and adds the 'swipe' class to it function swipeHandler(event){ $(event.target).addClass( 'swipe' ); @@ -98,13 +98,13 @@ $(function(){ #nav a:hover { color: #999; border-color: #999; - background: #eee; + background: #eee; } #nav a.selected, #nav a.selected:hover { color: #0a0; border-color: #0a0; - background: #afa; + background: #afa; } div.box { width: 30em; @@ -119,6 +119,6 @@ $(function(){

    Swipe the green rectangle to change its color:

    ]]> - + diff --git a/entries/swipeleft.xml b/entries/swipeleft.xml index 9d9e8209..9fceae9d 100644 --- a/entries/swipeleft.xml +++ b/entries/swipeleft.xml @@ -15,7 +15,7 @@ $(function(){ // Bind the swipeleftHandler callback function to the swipe event on div.box $('div.box').on( 'swipeleft', swipeleftHandler ); - + // Callback function references the event target and adds the 'swipeleft' class to it function swipeleftHandler(event){ $(event.target).addClass( 'swipeleft' ); @@ -47,13 +47,13 @@ $(function(){ #nav a:hover { color: #999; border-color: #999; - background: #eee; + background: #eee; } #nav a.selected, #nav a.selected:hover { color: #0a0; border-color: #0a0; - background: #afa; + background: #afa; } div.box { width: 30em; @@ -68,6 +68,6 @@ $(function(){

    Swipe the green rectangle in the left direction to change its color:

    ]]> - + diff --git a/entries/swiperight.xml b/entries/swiperight.xml index 6f58f166..4bc9b68b 100644 --- a/entries/swiperight.xml +++ b/entries/swiperight.xml @@ -15,7 +15,7 @@ $(function(){ // Bind the swiperightHandler callback function to the swipe event on div.box $('div.box').on( 'swiperight', swiperightHandler ); - + // Callback function references the event target and adds the 'swiperight' class to it function swiperightHandler(event){ $(event.target).addClass( 'swiperight' ); @@ -47,13 +47,13 @@ $(function(){ #nav a:hover { color: #999; border-color: #999; - background: #eee; + background: #eee; } #nav a.selected, #nav a.selected:hover { color: #0a0; border-color: #0a0; - background: #afa; + background: #afa; } div.box { width: 30em; @@ -68,6 +68,6 @@ $(function(){

    Swipe the green rectangle in the right direction to change its color:

    ]]> - + diff --git a/entries/table-columntoggle.xml b/entries/table-columntoggle.xml index bad8549f..0def3423 100644 --- a/entries/table-columntoggle.xml +++ b/entries/table-columntoggle.xml @@ -5,25 +5,25 @@ Creates a responsive table in column toggle mode

    This table mode automatically hides less important columns at narrower widths and surfaces a button to open a menu that allows the user to choose what columns they want to see. In this mode, the author attempts to define which columns are most important to show across various widths by assigning a priority to each column.

    - -

    A user may choose to check as many columns as they want by tapping the "Columns..." button to open the column + +

    A user may choose to check as many columns as they want by tapping the "Columns..." button to open the column chooser popup. The popup contains a dynamically generated list of columns based on the table markup that can be checked and unchecked to adjust the visible columns.

    - +

    Applying column chooser mode to a table

    The column chooser mode requires a table element with two attributes: data-role="table" and data-mode="columntoggle". An ID attribute is also required on the table to associate it with the column chooser popup menu.

    <table data-role="table" data-mode="columntoggle" id="my-table">
    - +

    How column toggle mode works

    - +

    The plugin automates a few key things: it injects the column chooser button, and generates the popup with check list of columns that can be hidden or shown by the user. The list of columns in the chooser menu is populated by parsing the values (or abbr title) of the first row of header (TH) elements. Only headers that have a data-priority attribute are included in the column chooser; headers without this attribute won't made available in the chooser to allow developers to identify critical columns that shouldn't be hidden. If columns are hidden via responsive media queries, these will be unchecked in the chooser to reflect the current column visibility.

    The automatic column hiding behavior is accomplished by CSS media queries that hide or show columns based on priority levels at various screen widths. Since each site will have different content and column configurations, we provide a simple media query block that you can copy, paste and customize for each project. This is explained in detail below.

    The priorities assigned to headers and media queries used to hide columns act as a sensible default for showing the most important columns that will fit on a device. The column chooser menu gives users the ability to override these defaults and choose which columns they want to see. These user preferences take precedence over the priority mappings so if a column is manually checked, it will remain visible across all screen widths until the page is refreshed.

    - +

    Because of the flexibility this plugin provides, it's possible for users to introduce horizontal scrolling if the data in each column is long or if many columns are selected to be shown on a smaller screen.

    Setting column priority

    @@ -31,48 +31,48 @@

    The table works by hiding and showing columns based on two inputs: available screen width or by the user checking and unchecking which columns to display in a column picker popup. Add data-priority attributes to each of the table headers of columns you want to responsively display and assign a priority (1 = highest, 6 = lowest). Any table header given a priority will be available in the column picker menu.

    To make a column persistent so it's not available for hiding, omit the data-priority attribute. This will make the column visible at all widths and won't be available in the column chooser menu.

    -
    <th>I'm am critical and can't be removed</th>
    +
    <th>I'm critical and can't be removed</th>
     <th data-priority="1">I'm very important</th>
     <th data-priority="3">I'm somewhat</th>
     <th data-priority="5">I'm less important</th>
     
    - +

    Behind the scenes, the plugin will apply classes to each cell that map to the priority set in the data attribute on the header. For example, if a table heading has a data-priority="3" attribute, every cell in that column will assigned a ui-table-priority-3 class once enhanced. These classes are then used in media queries to hide and show columns based on screen width (see below).

    - +
    <td class="ui-table-priority-3">97%</td>
     
    - +

    You may use any priority naming convention and assign as many (or few) levels of priority for the columns. The plugin simply generates class names based on the values in the data-priority attribute so even though we default to using a numeric system of 1-6, any naming convention is possible.

    - -

    For example, if a priority of data-priority="critical" is added to the heading, a class of ui-table-priority-critial will be applied to each cell in that column. If a priority is assigned, the column will be made available for the toggling in the column menu and adds the classes to each cell, the rest of the styling and media query creation is up to you write in your custom stylesheet.

    - + +

    For example, if a priority of data-priority="critical" is added to the heading, a class of ui-table-priority-critial will be applied to each cell in that column. If a priority is assigned, the column will be made available for the toggling in the column menu and adds the classes to each cell, the rest of the styling and media query creation is up to you write in your custom stylesheet.

    +

    It is important to note that you are required to wrap your table headers in a <thead> ... </thead> block, and the table body in a <tbody> ... </tbody> block, as shown in the full demo Example.

    - +

    Making the table responsive

    - +

    The styles for the all priority columns (1-6) start as display:none in the structure stylesheet since we're taking a mobile-first approach to our styles. This means that only columns that should be persistent are visible in the styles to start.

    - +

    The framework does not automatically include the the media queries to progressively display columns at wider widths. We do this to make it easier for developers to customize the media query widths for each priority level.

    - +

    Media queries add the responsive behavior to show and hide columns by priority. Each media query is written using min-width widths so they build on top of each other. The widths are set in ems so they respond to font size changes. To calculate a pixel withs in em's, divide the target width by 16 (pixels) - it's that easy.

    - +

    Inside each media query, we override the display:none style properties set on all the priority columns in the basic styles to display:table-cell so they become visible again and act as a table.

    - +

    To customize the breakpoints, copy the following style block into your custom style overrides and adjust the min-width media query values for each priority level to specify where various priority columns should appear.

    - -

    In the example styles below for a my-custom-class class on the table, the priority 1 columns are shown first, at widths above 20em (320px), then priority 2 kicks in above 30em (480px) and so on up to wide desktop widths with priority 6. Feel free to change these breakpoints in your stylesheet and choose how many priority levels you'd like to use.

    + +

    In the example styles below for a my-custom-class class on the table, the priority 1 columns are shown first, at widths above 20em (320px), then priority 2 kicks in above 30em (480px) and so on up to wide desktop widths with priority 6. Feel free to change these breakpoints in your stylesheet and choose how many priority levels you'd like to use.

    
    -/* Show priority 1 at 320px (20em x 16px) */ 
    +/* Show priority 1 at 320px (20em x 16px) */
     @media screen and (min-width: 20em) {
        .my-custom-class th.ui-table-priority-1,
        .my-custom-class td.ui-table-priority-1 {
          display: table-cell;
        }
     }
    -/* Show priority 2 at 480px (30em x 16px) */ 
    +/* Show priority 2 at 480px (30em x 16px) */
     @media screen and (min-width: 30em) {
        .my-custom-class  th.ui-table-priority-2,
        .my-custom-class td.ui-table-priority-2 {
    @@ -83,7 +83,7 @@
     

    Due to CSS specificity, you will also need to include the class definitions for the hidden and visible states after the custom breakpoints in your custom stylesheet so be sure to include these as well:

    
    -/* Manually hidden */ 
    +/* Manually hidden */
     .my-custom-class th.ui-table-cell-hidden,
     .my-custom-class td.ui-table-cell-hidden {
       display: none;
    @@ -95,17 +95,17 @@
        display: table-cell;
     }
     
    - +

    Applying a preset breakpoint

    - +

    Even though we strongly encourage you to write custom breakpoints yourself, the framework includes a set of pre-configured breakpoints for each of the six priority levels that you can use if they happen work well for your content.

    - +

    These breakpoints can applied by adding a class="ui-responsive" to the table element. Here is an example of a table with this class added:

    <table data-role="table" class="ui-responsive" data-mode="columntoggle" id="my-table">

    The six preset breakpoints classes included in the column toggle stylesheet use regular increments of 10em (160 pixels). Here is a summary of the breakpoints assigned to each priority in the preset styles:

    - +
    data-priority="1"
    Displays the column at 320px (20em)
    data-priority="2"
    Displays the column at 480px (30em)
    @@ -122,23 +122,68 @@

    When the column chooser menu opens, the column checkboxes will be checked or unchecked based on the visibility of each column based on the media queries so it accurately reflects what is being seen. These media queries to hide or show columns act as sensible defaults for what columns should be shown based on the developer's understanding of the column importance and data values. The chooser menu allows the user to have control of the table presentation so this takes precedence over the default display.

    If an unchecked column checkbox is checked by the user, they now take control of the column. Until the page is refreshed, the visibility of that column will now always be visible, even if the screen is re-sized. Behind the scenes, a class of ui-table-cell-visible is added to all the cells in that column to ensure they override any visibility set via media queries.

    - +

    The same idea applies when a column is unchecked: from then on, the column won't be seen at any width because the class of ui-table-cell-hidden is added to each of the cells in that column.

    Styling the button and column chooser popup

    - +

    The column chooser popup is opened via a button that is generated by the framework. The button's text is "Columns..." by default but can be set by adding the data-column-btn-text attribute to the table to the text string you want in the button. The button will inherit the theme from the content area, just like all buttons, but the theme can be set manually by adding the data-column-btn-theme attribute to any swatch letter in your theme.

    - +

    This button is injected directly before the table element and has basic styles to align it to the right but you may want to further customize the appearance of this button. To style all these buttons across your site, key off the ui-table-columntoggle-btn structural class on this link.

    To target styles against only a specific button, use the unique href value that is generated to target a specific column chooser button. For example, a table with an ID of movie-table will generate a popup with an ID of movie-table-popup so a CSS selector of a[href="#movie-table-popup"] will target only the column popup button for this specific table.

    - +

    The theme for the column chooser popup can be set by adding the data-column-popup-theme attribute to the table and specifying any swatch letter in your theme. For custom styles or scripting, all the column chooser popups can be targeted by using the ui-table-columntoggle-popup structural class added to these popups. To customize a single popup, use the generated ID based on the table ID that added to each specific popup (such as #movie-table-popup) to target a specific popup.

    Working with grouped column headers

    It's fairly common to need to logically group multiple columns together under a heading group for financial or scientific data. The framework can support the most simple version of this by allowing for two rows of table headers (TH), with the first row containing simple colspan attributes to group the columns below. In this configuration, the framework will parse the first row only for the priority and expose these heading groups as the options in the column chooser popup. In this configuration, the second heading will not be exposed as columns that can be hidden or shown independently of the groupings in the chooser.

    - + + +

    The columntoggle table places an anchor before the table that invokes a popup listing the columns available for showing/hiding. The ID of the popup and thus the href of the anchor should be the ID of the table suffixed by the string -popup. You may separately pre-enhance the popup widget, or you may allow autoinitialization to enhance it.

    +

    The popup widget must contain a single controlgroup widget which in turn contains all the checkboxes representing the columns of the table.

    +

    In the example below the parameter data-column-btn-theme="b" is added to the table explicitly to indicate that the theme applied to the "Columns..." button is not the default (null).

    + +
    
    +<div data-role="popup" id="table-column-toggle-popup" class="ui-table-columntoggle-popup">
    +	<fieldset data-role="controlgroup">
    +		<label>Rank<input type="checkbox" checked data-cacheval="false" locked="true"></input></label>
    +		<label>Year<input type="checkbox" checked data-cacheval="false" locked="true"></input></label>
    +		<label>Rotten Tomato Rating<input type="checkbox" checked data-cacheval="false" locked="true"></input></label>
    +		<label>Reviews<input type="checkbox" checked data-cacheval="false" locked="true"></input></label>
    +	</fieldset>
    +</div>
    +<a href="#table-column-toggle-popup" class="ui-table-columntoggle-btn ui-btn ui-btn-b ui-corner-all ui-shadow ui-mini" data-rel="popup">Columns...</a>
    +<table data-role="table" id="table-column-toggle" data-mode="columntoggle" data-enhanced="true" class="ui-table ui-table-columntoggle" data-column-btn-theme="b">
    +	<thead>
    +		<tr>
    +			<th data-priority="2" data-colstart="1" class="ui-table-priority-2 ui-table-cell-visible">Rank</th>
    +			<th data-colstart="2">Movie Title</th>
    +			<th data-priority="3" data-colstart="3" class="ui-table-priority-3 ui-table-cell-visible">Year</th>
    +			<th data-priority="1" data-colstart="4" class="ui-table-priority-1 ui-table-cell-visible"><abbr title="Rotten Tomato Rating">Rating</abbr></th>
    +			<th data-priority="5" data-colstart="5" class="ui-table-priority-5 ui-table-cell-visible">Reviews</th>
    +		</tr>
    +	</thead>
    +	<tbody>
    +		<tr>
    +			<th class="ui-table-priority-2 ui-table-cell-visible">1</th>
    +			<td><a href="http://en.wikipedia.org/wiki/Citizen_Kane" data-rel="external">Citizen Kane</a></td>
    +			<td class="ui-table-priority-3 ui-table-cell-visible">1941</td>
    +			<td class="ui-table-priority-1 ui-table-cell-visible">100%</td>
    +			<td class="ui-table-priority-5 ui-table-cell-visible">74</td>
    +		</tr>
    +		<tr>
    +			<th class="ui-table-priority-2 ui-table-cell-visible">2</th>
    +			<td><a href="http://en.wikipedia.org/wiki/Casablanca_(film)" data-rel="external">Casablanca</a></td>
    +			<td class="ui-table-priority-3 ui-table-cell-visible">1942</td>
    +			<td class="ui-table-priority-1 ui-table-cell-visible">97%</td>
    +			<td class="ui-table-priority-5 ui-table-cell-visible">64</td>
    +		</tr>
    +	</tbody>
    +</table>
    +
    + + 1.3 @@ -158,7 +203,7 @@ + - + Since this plugin is written as an extension to the core table plugin, it binds to the tablecreate event but does not issue any additional events. @@ -289,7 +335,7 @@ - + ]]> diff --git a/entries/table-reflow.xml b/entries/table-reflow.xml index 7d39216f..a539c974 100644 --- a/entries/table-reflow.xml +++ b/entries/table-reflow.xml @@ -6,39 +6,39 @@

    The reflow table mode works by collapsing the table columns into a stacked presentation that looks like blocks of label/data pairs for each row. Since the HTML source order of a table prohibits styling a table to look like this, the plugin dynamically adds a bit of markup to make the display work (without affecting accessibility). Here is a demo of a basic table using reflow mode:

    - +

    Applying reflow mode to a table

    - +

    The reflow responsive table mode is the simplest in terms of markup requirements because it only requires a table with a data-role="table" on the table element. There is no need to set the data-mode attribute since reflow is the default.

    - +
    <table data-role="table" id="my-table">

    How reflow mode works

    - +

    The plugin works by parsing the values (or abbr title) of the first row of header (th) elements found in the table. For example, in the table above, the third table header is parsed to grab the contents ("Year"):

    <th>Year</th>

    The script then appends an element with the table header text before the contents of every cell in that column. For example, for every table cell in the year column:

    - +
    <td>1941</td>
    - +

    An element is added before the text of each cell with a class of ui-table-cell-label:

    <td><b class="ui-table-cell-label">Year</b>1941</td>
    - +

    With our mobile-first approach, the base styles for a reflow table stacks each row and presents each cell in the label/data style format. This is done by hiding the table header rows, making each table cell display:block so they are stacked. The the label element injected into each cell is styled as display:inline-block with a min-width:30% rule to place the labels on the same line as the content at a consistent width to form a two column presentation.

    - +

    It is important to note that you are required to wrap your table headers in a <thead> ... </thead> block, and the table body in a <tbody> ... </tbody> block, as shown in the full demo Example.

    Making the table responsive

    - +

    By default, a table with reflow mode will display the stacked presentation style on all screen widths. The styles to make the table responsive are added by applying a media query with rules to switch to the tabular style presentation above a specific screen width.

    This is done by wrapping a few simple CSS rules in and a media query that only applies the rules above a certain width breakpoint. The styles make the table header rows visible, display the cells in a tabular format, and hide the generated label elements within each. Here is an example media query that swaps the presentation at 40em (640 pixels):

    - - + +
    @media ( min-width: 40em ) {
    -	/* Show the table header rows and set all cells to display: table-cell */ 
    +	/* Show the table header rows and set all cells to display: table-cell */
     	.my-custom-breakpoint td,
     	.my-custom-breakpoint th,
     	.my-custom-breakpoint tbody th,
    @@ -48,18 +48,18 @@
     		display: table-cell;
     		margin: 0;
     	}
    -	/* Hide the labels in each cell */ 
    +	/* Hide the labels in each cell */
     	.my-custom-breakpoint td .ui-table-cell-label,
    -	.my-custom-breakpoint th .ui-table-cell-label { 
    +	.my-custom-breakpoint th .ui-table-cell-label {
     		display: none;
     	}
     }
     

    It's best to use a class on the table to apply the breakpoint. Add these rules to your custom stylesheet that is included in the head of the page. We recommend creating a set of custom breakpoint classes that can be used to apply standard table breakpoints in your project.

    - +

    In the example above, we're assuming there is a class of my-custom-breakpoint added to the table to apply the breakpoint. Each of the rules in the custom media query are scoped against that table class to target only tables that have the my-custom-breakpoint class.

    - +

    In order for this technique to work, a browser must support media queries and the ability to style table cells as block-level elements. In testing, most popular desktop and mobile browsers meet these criteria, but older versions of Internet Explorer (8 and older) fall back to a normal table presentation. IE 9 can support this technique but there are a few additional styles needed so we recommend applying these in a max-width media query to only apply them below the table presentation because they are hard to negate.

    Choosing a breakpoint

    @@ -69,12 +69,12 @@

    Applying a preset breakpoint

    Even though we strongly encourage you to write custom breakpoints yourself, the framework includes a single pre-configured breakpoint that targets the stacked style to smaller phones and swaps to a tabular prsentation on larger phones, tablet and desktop devices. To use this preset breakpoint, add the ui-responsive class to the table to convert from the stacked presentation to a tabular presentation at 560px (35em). If this breakpoint doesn't work for your content, we encourage you to write a custom breakpoint as descibed above.

    - +
    <table data-role="table" class="ui-responsive">
    - - + +

    Working with grouped column headers

    - +

    It's fairly common to need to logically group multiple columns together under a heading group for financial or scientific data. The framework can support the most simple version of this by allowing for two rows of table headers (TH), with the first row containing simple colspan attributes to group the columns below. In this configuration, the framework will add a class to the label of the first cell in each group to allow you to style these differently and provide aditional visual hierarchy.

    @@ -102,7 +102,7 @@ $( document ).on( "mobileinit", function() { - + Since this plugin is written as an extension to the core table plugin, it binds to the tablecreate event but does not issue any additional events. diff --git a/entries/table.xml b/entries/table.xml index e1143c13..4d6b3977 100644 --- a/entries/table.xml +++ b/entries/table.xml @@ -1,6 +1,6 @@ - + Table Widget Creates a responsive table @@ -52,25 +52,18 @@
  • The first row of the table must contain the table headers, be sure to use TH instead of TD tags
  • To display longer table header text in the column chooser or reflow labels, wrap the text in the TH with a abbr element and set the title. This string will be used in place.
  • - +

    Styling and theming tables

    - +

    The responsive table plugin is as minimally styled as possible to give you a clean slate for your designs. The plugin focuses primarily on the difficult scripting elements: generating the labels for the reflow table and creating the button and column chooser popup. Out of the box, the table just has a few basic style rules to add a bit of padding and set the vertical alignment of cells to be top left for visual consistency.

    The table will adapt to whatever content block it sits on, but there isn't an explicit theming attribute for this widget. We did this because it's simple enough to add theme classes like ui-body-a to individual cells if a more heavily themed look is wanted.

    - -

    Row strokes

    -

    To add horizontal lines between each row, add a custom style to your stylesheet that adds a border to the table headers and cells. In this example, RGBA is used to set a color (black) at an opacity of 5% so this will work on any background color:

    - -
    .table-stroke thead th {
    -  border-bottom: 1px solid rgba(0, 0, 0, .1);
    -}
    -.table-stroke tbody th,
    -.table-stroke tbody td {
    -  border-bottom: 1px solid rgba(0, 0, 0, .05);
    -}
    -
    -

    This standard table stroke style can be also applied by adding table-stroke class to the table element. If you prefer a custom stroke style, use the example above as a starting point. Note that adding styles that set a color for the stroke will override a theme class so do not use these together.

    - + +

    Row strokes and stripes

    + +

    The theme CSS contains a preset row strokes and alternating row stripes style which can be applied by adding table-stroke or table-stripe class to the table element.

    + + Note: the table-stroke and table-stripe classes are deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. The demos contain an example how to apply these styles with custom CSS. +
    1.3 @@ -79,19 +72,10 @@

    The classes option is only configurable via JavaScript because it expects an object literal value.

    - +
    - + Triggered when a table is created diff --git a/entries/tap.xml b/entries/tap.xml index 75224c21..07bcef2f 100644 --- a/entries/tap.xml +++ b/entries/tap.xml @@ -18,13 +18,13 @@ background-color: #BB6F04; } - + ...
    - + ... - + $(function() { // Bind the tapHandler callback function to the tap event on div.box $( "div.box" ).on( 'tap', tapHandler ); diff --git a/entries/taphold.xml b/entries/taphold.xml index 6aa8e499..b75ac150 100644 --- a/entries/taphold.xml +++ b/entries/taphold.xml @@ -3,7 +3,7 @@ taphold Triggered after a sustained complete touch event. -

    The jQuery Mobile taphold event triggers after a sustained, complete touch event (also known as a long press).

    +

    The jQuery Mobile taphold event triggers after a sustained, complete touch event (also known as a long press).

    $.event.special.tap.tapholdThreshold (default: 750) - This value dictates how long the user must hold their tap before the taphold event is fired on the target element.

    @@ -20,14 +20,14 @@ background-color: #BB6F04; } - + ...

    Long-press (taphold) the green square to change its color:

    - + ... - + $(function() { // Bind the tapholdHandler callback function to the taphold event on div.box $( "div.box" ).on( 'taphold', tapholdHandler ); diff --git a/entries/textinput.xml b/entries/textinput.xml index 83a6547d..3698c15e 100644 --- a/entries/textinput.xml +++ b/entries/textinput.xml @@ -1,13 +1,13 @@ - + Textinput Widget Creates a textinput widget for textinput, textarea or search input

    Text Input

    - -

    Text inputs and textareas are coded with standard HTML elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. View the data- attribute reference to see all the possible attributes you can add to text inputs.

    - + +

    Text inputs and textareas are coded with standard HTML elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device.

    +

    To collect standard alphanumeric text, use an input with a type="text" attribute. Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

    @@ -17,11 +17,11 @@

    This will produce a basic text input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.

    - +

    Mini version

    - +

    For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

    - +
    
     <label for="basic">Text Input:</label>
     <input type="text" name="name" id="basic" value="" data-mini="true" />
    @@ -29,80 +29,85 @@
     
     		

    This will produce an input that is not as tall as the standard version and has a smaller text size.

    - -

    Clear button option

    -

    To add a clear button to any input (like the search input), add the data-clear-btn="true" attribute. The text for this clear button can be customized via the data-clear-btn-text="clear input" attribute. Search buttons have the clear button by default and cannot be controlled by this option. Note that this is available for all the input types below except for textareas.

    +

    Clear button option

    +

    The clearButton extension provides the clearBtn option.

    +

    To add a clear button to any input (like the search input), add the data-clear-btn="true" attribute. The text for this clear button can be customized via the data-clear-btn-text="clear input" attribute. Search buttons have the clear button by default and cannot be controlled by this option. Note that this is available for all the input types below except for those coded via textarea elements.

    -
    	
    +
    
     <label for="clear-demo">Text Input:</label>
     <input type="text" name="clear" id="clear-demo" value="" data-clear-btn="true" />
     

    This markup creates a text input with a clear button that becomes visible as soon as a character has been entered.

    - - + +

    Field containers

    - -

    Optionally wrap the text input in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

    + +

    Optionally wrap the text input in a container with class ui-field-contain to help visually group it in a longer form.

    +

    Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

    +
    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="name">Text Input:</label>
     	<input type="text" name="name" id="name" value="" />
    -</div>	
    -
    +</div> +

    The text input is now displayed like this:

    - +

    More text input types

    In jQuery Mobile, you can use existing and new HTML5 input types such as password, email, tel, number, and more. Some type values are rendered differently across browsers. For example, Chrome renders the range input as a slider. jQuery Mobile standardizes the appearance of range and search by dynamically changing their type to text. You can configure which input types are degraded to text with the page plugin's options.

    - +

    One major advantage of using these more specific input types if that on mobile devices, specialized keyboards that speed data entry are offered in place of the standard text keyboard. Try the following inputs on a mobile device to see which display custom keyboards on various platforms.

    - +

    Textareas

    - -

    For multi-line text inputs, use a textarea element. The framework will auto-grow the height of the textarea to avoid the need for an internal scrollbar.

    -

    Set the for attribute of the label to match the id of the textarea so they are semantically associated, and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    -
    	
    +		

    For multi-line text inputs, use a textarea element. The autogrow extension provides functionality for auto-growing the height of the textarea to avoid the need for an internal scrollbar.

    +

    Set the for attribute of the label to match the id of the textarea so they are semantically associated, and wrap them in a div with class ui-field-contain to group them.

    +

    Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

    + +
    
     <label for="textarea-a">Textarea:</label>
     <textarea name="textarea" id="textarea-a">
     I'm a basic textarea. If this is pre-populated with content, the height will be automatically adjusted to fit without needing to scroll. That is a pretty handy usability feature.
     </textarea>
    -
    +

    This will produce a basic textarea with the width set to 100% of the parent container and the label stacked on a separate line. The textarea will grow to fit new lines as you type:

    - -
    	
    -<div data-role="fieldcontain">
    +
    +
    
    +<div class="ui-field-contain">
     <label for="textarea">Textarea:</label>
     	<textarea name="textarea" id="textarea"></textarea>
     </div>
    -
    - +
    +

    The textarea is displayed like this and will grow to fit new lines as you type:

    - +

    Calling the textinput plugin

    This plugin will auto initialize on any page that contains a textarea or any of the text input types listed above without any need for a data-role attribute in the markup. However, if needed, you can directly call the textinput plugin on any selector, just like any jQuery plugin:

    
    -$( "input" ).textinput();			
    +$( "input" ).textinput();
     
    - +

    Degraded input types

    - + + The location of the map of input type degradations in the page plugin is deprecated as of 1.4.0. As of 1.5.0 the input type degradation functionality will be implemented by the degradeInputs module. +

    jQuery Mobile degrades several HTML5 input types back to type=text or type=number after adding enhanced controls. For example, inputs with a type of range are enhanced with a custom slider control, and their type is set to number to offer a usable form input alongside that slider. Inputs with a type of search are degraded back to type=text after we add our own themable search input styling.

    -

    The page plugin contains a list of input types that are set to either true which means they'll degrade to type=text, false which means they'll be left alone, or a string such as "number", which means they'll be converted to that type (such as the case of type=range).

    - -

    You can configure which types are changed via the page plugin's degradeInputs option, which can be manipulated externally via $.mobile.page.prototype.options.degradeInputs, which has properties: color, date, datetime, "datetime-local", email, month, number, range, search, tel, time, url, and week. Be sure to configure this inside an event handler bound to the mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.

    +

    The degradeInputs module contains a list of input types that are set to either true which means they'll degrade to type=text, false which means they'll be left alone, or a string such as "number", which means they'll be converted to that type (such as the case of type=range).

    + +

    You can configure which types are changed via $.mobile.degradeInputs, which has properties: color, date, datetime, "datetime-local", email, month, number, range, search, tel, time, url, and week. Be sure to configure this inside an event handler bound to the mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.

    Search Input

    -

    Search inputs are a new HTML type that is styled with pill-shaped corners and adds an "x" icon to clear the field once you start typing. Start with an input with a type="search" attribute in your markup.

    +

    Search inputs are a new HTML type styled with pill-shaped corners and an "x" icon to clear the field once you start typing. Start with an input with a type="search" attribute in your markup.

    Set the for attribute of the label to match the id of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

    
    @@ -111,11 +116,11 @@ $( "input" ).textinput();
     

    This will produce a basic search input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.

    - +

    Mini version

    - +

    For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

    - +
    
     <label for="search-mini">Search Input:</label>
     <input type="search" name="search-mini" id="search-mini" value="" data-mini="true"/>
    @@ -123,110 +128,122 @@ $( "input" ).textinput();
     
     		

    This will produce a search input that is not as tall as the standard version and has a smaller text size.

    - +

    Field containers

    - -

    Optionally wrap the search input in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

    + +

    Optionally wrap the search input in a container with tlass ui-field-contain to help visually group it in a longer form.

    +

    Note: The data- attribute data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

    +
    
    -<div data-role="fieldcontain">
    +<div class="ui-field-contain">
     	<label for="search-2">Search Input:</label>
     	<input type="search" name="search-2" id="search-2" value="" />
     </div>
    -
    +

    The search input is now displayed like this:

    - +

    Theming

    The data-theme attribute can be added to the search input to set the theme to any swatch letter.

    - +

    Setting the clear button text

    - -

    The text for the button used to clear the search input of text can be configured for all search inputs by binding to the mobileinit event and setting the - $.mobile.textinput.prototype.options.clearSearchButtonText property to a string of your choosing.

    - + +

    The text for the button used to clear the search input of text can be configured for all search inputs by binding to the mobileinit event and setting the + $.mobile.textinput.prototype.options.clearBtnText property to a string of your choosing.

    +

    This option is provided by the clearButton extension.

    +

    Calling the textinput plugin

    This plugin will auto-initialize on any page that contains a text input with the type="search" attribute without any need for a data-role attribute in the markup. However, if needed, you can directly call the textinput plugin on a selector, just like any jQuery plugin:

    - + +
    
    +$( ".mySearchInput" ).textinput();
    +
    + + +

    The widget wraps input-based widgets in div used for creating the style. textarea elements are not wrapped in such a div.

    +

    In the example below, we add the attribute data-corners="false" to the input, because the class ui-corner-all is absent from the wrapper, indicating that the value of the "corners" option should be false.

    
    -$( ".mySearchInput" ).textinput();			
    -
    +
    + +
    +
    +
    1.0 - - - triggered when a text input is created - - - - - - - - + - - enable a disabled text input. - - - - disable a text input. + + + + + + Refresh a text input. +

    This method is provided by the autogrow extension, and it sets the height of the textarea element based on its contents. You should call this method when the textarea element becomes visible to make sure that its initial height matches its contents.

    diff --git a/entries/theme.xml b/entries/theme.xml new file mode 100644 index 00000000..02109a23 --- /dev/null +++ b/entries/theme.xml @@ -0,0 +1,20 @@ + + + + Theme + jQuery Mobile Theme + +

    Theming Concepts

    +

    The jQuery Mobile theme provides the CSS framework necessary for providing a consistent and touch-friendly look and feel for your widgets across platforms. It is built around the following essential concepts:

    +

    Swatches

    +

    A swatch is one of several colour schemes provided by your theme. We use single-letter designations for swatches. The default jQuery Mobile theme provides two swatches. The "a" swatch is a neutral, gray swatch, and the "b" swatch has a darker color scheme designed to contrast with the "a" swatch. You can use "b" to draw special attention to elements in a user interface styled with "a", and vice versa.

    +

    The ThemeRoller allows you to create any number of swatches for a custom theme.

    +

    Active state

    +

    The theme defines an "active" state separately from all the swatches. The intention is to give immediate feedback upon a user action if there should be a brief processing delay. For example, most mobile devices implement a 300ms delay between the time when the user lifts her finger from the touchscreen and the triggering of the "click" event. jQuery Mobile adds the "active" state to a button whenever the device is poised to emit a "click" event so the user receives immediate feedback that the application is committed to processing the "click" in the next 300ms.

    +

    Theme inheritance

    +

    You do not need to specify a swatch for every widget you create. Despite this, most widgets have a "theme" option set to null by default so you may override the swatch for an individual widget. The default value of null makes it sufficient to specify a swatch on the outermost container for your user interface. The swatch will then be inherited by all the widgets in the container.

    +

    You can override the swatch for portions of a container by specifying a theme swatch for one of its subcontainers. Note: Because of the nature of CSS, you cannot repeatedly alternate between two swatches.

    +

    If you use a widget outside a jQuery Mobile page (or you don't use pages at all) and there is no themed ancestor you have to set the theme option or add the applicable theme class in your markup if you want the widget to be styled. For example, if your panel markup is outside the page and it has a listview inside, you have to set a swatch on the panel for the panel to be styled properly. However, once you set the swatch for the panel, the listview will inherit the swatch from the panel.

    +
    + +
    diff --git a/entries/throttledresize.xml b/entries/throttledresize.xml index 4e8d4c65..3bc69378 100644 --- a/entries/throttledresize.xml +++ b/entries/throttledresize.xml @@ -7,7 +7,7 @@

    The throttleresize event is triggered if orientationchange is not natively supported.

    This event triggers when the browser window resizes from:

      -
    1. an orientation change (orientation-enabled device);
    2. +
    3. an orientation change (orientation-enabled device);
    4. changes in dimension ratio that replicates a landspace/portrait change (resizing a desktop browser).
    @@ -17,9 +17,9 @@ var count = 0; $(function() { /* - Bind an event handler to window's throttledresize event that, when triggered, + Bind an event handler to window's throttledresize event that, when triggered, passes a reference of itself that is accessible by the callback function. - */ + */ $(window).on( 'throttledresize', throttledresizeHandler ); function throttledresizeHandler( event ) { @@ -28,12 +28,12 @@ // You can also manually force this event to fire. $(window).trigger( "throttledresize" ); - }); + }); ]]>

    Visit this from your orientation-enabled device to see it in action!

    - + 1.0 diff --git a/entries/toolbar.xml b/entries/toolbar.xml new file mode 100644 index 00000000..beb8adb3 --- /dev/null +++ b/entries/toolbar.xml @@ -0,0 +1,429 @@ + + + + Toolbar Widget + Adds toolbars to the top and/or bottom of the page. + +

    Toolbars

    +

    Headers and footers are elements that precede resp. succeed the page content. The widget allows you to create headers and footers.

    +

    Headers

    +

    The header bar serves as the page title, is usually the first element inside each mobile page, and typically contains a page title and up to two buttons.

    +

    Header structure

    +

    The header is a at the top of the page that usually contains the page title text and optional buttons positioned to the left and/or right of the title for navigation or actions. Headers can optionally be positioned as fixed so they remain at the top of the screen at all times instead of scrolling with the page.

    +

    The title text is normally an H1 heading element but it's possible to use any heading level (H1-H6) to allow for semantic flexibility. For example, a page containing multiple mobile "pages" may use a H1 element on the home "page" and a H2 element on the secondary pages. All heading levels are styled identically by default to maintain visual consistency.

    + +
    
    +<div data-role="header">
    +	<h1> Page Title </h1>
    +</div>
    +
    + + +

    Default header features

    + +

    The header inherits its theme swatch from the page by default but you can easily set the theme swatch color by adding the data-theme attribute to the header. For example, data-theme="b". When you use external headers you must set a theme, because there is no parent page from which it can inherit a theme.

    + +

    Adding buttons

    + +

    The behavior whereby anchor elements are automatically enhanced as buttons is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Thereafter you must add button classes if you wish to style them as buttons.

    + +

    In the standard header configuration, there are slots for buttons on either side of the text heading. Each button is typically an a (anchor) element or a button element that has the attribute data-role="button" set. To save space, buttons in widgets are set to inline styling so the button is only as wide as the text and icons it contains.

    + +

    Default button positioning

    +

    The behavior whereby the first two buttons automatically get the ui-btn-left and ui-btn-right classes is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Thereafter you must add those classes in your markup if you wish to position the buttons left and/or right.

    +

    The plugin looks for immediate children of the header container, and automatically sets the first link in the left button slot and the second link in the right. In this example, the 'Cancel' button will appear in the left slot and 'Save' will appear in the right slot based on their sequence in the source order.

    + +
    
    +<div data-role="header">
    +	<a href="index.html" data-role="button" data-icon="delete">Cancel</a>
    +	<h1>Edit Contact</h1>
    +	<a href="index.html" data-role="button" data-icon="check">Save</a>
    +</div>
    +
    + + + +

    Making buttons visually stand out

    + +

    Buttons automatically adopt the swatch color of the bar they sit in, so a link in a header bar with the "a" color will also be styled as "a" colored buttons. It's simple to make a button visually stand out. Here, we add the data-theme attribute and set the color swatch for the button to "b" to make the "Save" button stand out.

    + +
    
    +<div data-role="header">
    +	<a href="index.html" data-role="button" data-icon="delete">Cancel</a>
    +	<h1>Edit Contact</h1>
    +	<a href="index.html" data-role="button" data-icon="check" data-theme="b">Save</a>
    +</div>
    +
    + + + +

    Controlling button position with classes

    +

    The button position can also be controlled by adding classes to the button anchors, rather than relying on source order. This is especially useful if you only want a button in the right slot. To specify the button position, add the class of ui-btn-left or ui-btn-right to the anchor.

    + +
    
    +<div data-role="header">
    +	<h1>Page Title</h1>
    +	<a href="index.html" data-role="button" data-icon="gear" class="ui-btn-right">Options</a>
    +</div>
    +
    + + + +

    Adding buttons to widgets without heading

    +

    The heading in the header bar has some margin that will give the bar its height. If you choose not to use a heading, you will need to add an element with class="ui-title" so that the bar can get the height and display correctly.

    + +
    
    +<div data-role="header">
    +	<a href="index.html" data-role="button" data-icon="gear" class="ui-btn-right">Options</a>
    +	<span class="ui-title" />
    +</div>
    +
    + + + +

    Adding Back buttons

    + + The options addBackBtn, backBtnTheme, and backBtnText have moved from the page widget to the widget as of jQuery Mobile 1.4.0. +

    jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app webview. The framework automatically generates a "back" button on a header when the plugin's addBackBtn option is true. This can also be set via markup if the header div has a data-add-back-btn="true" attribute.

    +

    If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page. This will allow the feature to work for users in C-Grade browsers.

    +

    If you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute.

    + +

    Customizing the back button text

    +

    If you'd like to configure the back button text, you can either use the data-back-btn-text="previous" attribute on your element, or set it programmatically via the plugin's options:
    $.mobile..prototype.options.backBtnText = "previous";

    + +

    Default back button style

    +

    If you'd like to configure the back button role-theme, you can use:
    $.mobile..prototype.options.backBtnTheme = "a";
    +If you're doing this programmatically, set this option inside the mobileinit event handler.

    + +

    Custom header configurations

    +

    If you need to create a header that doesn't follow the default configuration, simply wrap your custom styled markup in any container, such as div. The plugin won't apply the automatic button logic to the wrapped content inside the header container so you can write custom styles for laying out the content in your header.

    +

    It's also possible to create custom bars without using the header data-role at all. For example, start with any container and add the ui-bar class to apply standard bar padding and add the ui-bar-b class to assign the bar swatch styles from your theme. (The "b" can be any swatch letter.)

    + +
    
    +<div class="ui-bar ui-bar-b">
    +	<h3>I'm just a div with bar classes and a mini inline <a href="#" data-role="button" data-mini="true">Button</a></h3>
    +</div>
    +
    + + + +

    Note that .ui-bar 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 , wrap its contents in an element and apply the padding to that element instead.

    +

    By writing some simple styles, it's easy to build message bars like this:

    + + + +

    Footers

    + The footer bar 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. + +

    Footer bar structure

    +

    The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.

    + +
    
    +<div data-role="footer">
    +	<h4>Footer content</h4>
    +</div>
    +
    + + +

    The footer inherits its theme swatch from the page by default but you can easily set the theme swatch color by adding the data-theme attribute to the header. For example, data-theme="b". When you use external headers you must set a theme, because there is no parent page from which it can inherit a theme.

    + +

    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.

    +

    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.

    + +

    Adding buttons

    +

    The behavior whereby anchor elements are automatically enhanced as buttons is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Thereafter you must set the attribute data-role="button" on those anchors you wish the framework to enhance as buttons.

    + +

    Any link or valid button markup with a data-role="button" attribute added to the footer will automatically be turned into a button. To save space, buttons in widgets are automatically set to inline styling so the button is only as wide as the text and icons it contains.

    +

    By default, widgets don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a class="ui-bar" to the footer.

    + +
    
    +<div data-role="footer" class="ui-bar">
    +	<a href="index.html" data-role="button" data-icon="plus">Add</a>
    +	<a href="index.html" data-role="button" data-icon="arrow-u">Up</a>
    +	<a href="index.html" data-role="button" data-icon="arrow-d">Down</a>
    +</div>
    +
    + +

    This creates this with buttons sitting in a row +

    + +

    Note that .ui-bar 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 , wrap the contents of the widget in an element and apply the padding to that element.

    + +

    To group buttons together into a button set, wrap the links in a wrapper with data-role="controlgroup" and data-type="horizontal" attributes.

    + + <div data-role="controlgroup" data-type="horizontal"> + +

    This creates a grouped set of buttons: +

    + +

    Adding form elements

    +

    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 data-mini="true" attribute: +

    + + +

    Fixed & Persistent footers

    +

    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.

    +

    To make a footer persistent between transitions, add the data-id attribute to the footer of all relevant pages and use the same id value for each. For example, by adding data-id="myfooter" to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. This effect will only work correctly if the header and footer toolbars are set to data-position="fixed" so they are in view during the transition.

    + +

    Fixed toolbars

    +

    In browsers that support CSS position: fixed (most desktop browsers, iOS5+, Android 2.2+, BlackBerry 6, and others), widgets that use the "fixedtoolbar" plugin will be fixed to the top or bottom of the viewport, while the page content scrolls freely in between. In browsers that don't support fixed positioning, the toolbars will remain positioned in flow, at the top or bottom of the page.

    + +

    To enable this behavior on a header or footer, add the data-position="fixed" attribute to a jQuery Mobile element.

    + +

    Fixed header markup example:

    +
    
    +<div data-role="header" data-position="fixed">
    +	<h1>Fixed Header</h1>
    +</div>
    +		
    + +

    Fixed footer markup example:

    +
    
    +<div data-role="footer" data-position="fixed">
    +	<h1>Fixed Footer</h1>
    +</div>
    +		
    + + + +

    Note: When you dynamically inject a fixed toolbar into the active page, you must afterwards call $.mobile.resetActivePageHeight(); to ensure that the page height remains correct. An example illustrates this.

    + +

    Fullscreen Toolbars

    + +

    Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled. Instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions.

    + +

    To enable this option on a fixed header or footer, add the data-fullscreen attribute to the element.

    + +
    
    +<div data-role="header" data-position="fixed" data-fullscreen="true">
    +	<h1>Fixed Header!</h1>
    +</div>
    +				
    + + +

    Forms in toolbars

    + +

    While all form elements are now tested to work correctly within static toolbars as of jQuery Mobile 1.1, we recommend extensive testing when using form elements within fixed toolbars or within any position: fixed elements. This can potentially trigger a number of unpredictable issues in various mobile browsers, Android 2.2/2.3 in particular (detailed in Known issues in Android 2.2/2.3, below).

    + +

    Changes in jQuery Mobile 1.1

    + +

    Prior to version 1.1, jQuery Mobile used dynamically re-positioned toolbars for the fixed header effect because very few mobile browsers supported the position:fixed CSS property, and simulating fixed support through the use of "fake" JavaScript overflow-scrolling behavior would have reduced our browser support reach, in addition to feeling unnatural on certain platforms. This behavior was not ideal, and jQuery Mobile 1.1 took a new approach to fixed toolbars that allows much broader support. The framework now offers true fixed toolbars on many popular platforms, while gracefully degrading non-supporting platforms to static positioning.

    + +

    Polyfilling older platforms

    +

    The fixed toolbar plugin degrades gracefully on platforms that do not support CSS position:fixed properly, such as iOS4.3. If you still need to support fixed toolbars on that platform (with the show/hide behavior) included in previous releases, Filament Group has developed a polyfill that you can use.

    + + + +

    Just include the CSS and JS files after your references to jQuery Mobile and Fixed toolbars will work similarly to jQuery Mobile 1.0 on iOS4.3, with the inclusion of the new API for the 1.1 fixedtoolbar plugin.

    + +

    If you have any improvements to suggest, fork the gist on github and let us know!

    + +

    Known issue with form controls inside fixed toolbars, and programmatic scroll

    +

    An obscure issue exists in iOS5 and some Android platforms where form controls placed inside fixed-positioned containers can lose their hit area when the window is programatically scrolled (using window.scrollTo for example). This is not an issue specific to jQuery Mobile, but because of it, we recommend not programatically scrolling a document when using form controls inside jQuery Mobile fixed toolbars. This ticket from the Device Bugs project tracker explains this problem in more detail.

    + +

    Known issues in Android 2.2/2.3

    +

    Android 2.2/2.3's implementation of position: fixed; can, in conjunction with seemingly unrelated styles and markup patterns, cause a number of strange issues, particularly in the case of position: absolute elements inside of position: fixed elements. While we've done our best to work around a number of these unique bugs within the scope of the library, custom styles may cause a number of issues.

    +
      +
    • Form elements elsewhere on the page—select menus in particular—can fail to respond to user interaction when an empty absolute positioned element is placed within a fixed position element. In rare cases—and specific to Android 2.2—this can cause entire pages to fail to respond to user interaction. This can seemingly be solved by adding any character to the absolute positioned element, including a non-breaking space, and in some cases even whitespace.
    • +
    • The above-described issue can also be triggered by an absolute positioned image inside of a fixed position element, but only when that image is using something other than its inherent dimensions. If a height or width is specified on the image using CSS, or the image src is invalid (thus having no inherent height and width), this issue can occur. If an image that is inherently, say, 50x50 pixels is placed in a fixed element and left at its inherent dimensions, this issue does not seem to occur.
    • +
    • When a position: fixed element appears anywhere on a page, most 2D CSS transforms will fail. Oddly, only translate transforms seem unaffected by this. Even more oddly, this issue is solved by setting a CSS opacity of .9 or below on the parent of the fixed element.
    • +
    • Combinations of position: fixed and overflow properties are best avoided, as both have been known to cause unpredictable issues in older versions of Android OS.
    • +
    • Any element that triggers the on-screen keyboard, when placed inside a position: fixed element, will fail to respond to user input when using anything other than the default keyboard. This includes Swype, XT9 or, it seems, any input method apart from the standard non-predictive keyboard.
    • +
    + +

    While we will continue to try to find ways to mitigate these bugs as best we can, we currently advise against implementing fixed toolbars containing complicated user styles and form elements without extensive testing in all versions of Android's native browser.

    + + +

    No longer supported: touchOverflowEnabled

    + +

    Prior to jQuery Mobile 1.1, true fixed toolbar support was contingent on native browser support for the CSS property overflow-scrolling: touch, which is currently only supported in iOS5. As of version 1.1, jQuery Mobile no longer uses this CSS property at all. We've removed all internal usage of this property in the framework, but we've left it defined globally on the $.mobile object to reduce the risk that its removal will cause trouble with existing applications. This property is flagged for removal, so please update your code to no longer use it. The support test for this property, however, remains defined under $.support and we have no plans to remove that test at this time.

    + +
    + 1.4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Update the . +

    If you manipulate a via JavaScript, you must call the refresh method on it to update the visual styling.

    +
    +
    + + + Sets the top and bottom padding for the content element of the page to the height of the . + + + + Optional: The page containing the as a jQuery object. + + + + +
    + + A basic example of a header + + + + A basic example of a page with fixed toolbars. + + + + Injecting a fixed toolbar + + + + +
    diff --git a/entries/updatelayout.xml b/entries/updatelayout.xml index a6970062..718be1b7 100644 --- a/entries/updatelayout.xml +++ b/entries/updatelayout.xml @@ -7,11 +7,11 @@

    This event is triggered by components within the framework that dynamically show/hide content, and is meant as a generic mechanism to notify other components that they may need to update their size or position. Within the framework, this event is fired on the component element whose content was shown/hidden, and bubbles all the way up to the document element.

    $( "#foo" ).hide().trigger( "updatelayout" );
    - + 1.0 - + diff --git a/entries2html.xsl b/entries2html.xsl index 09a022a1..ea9c04e5 100644 --- a/entries2html.xsl +++ b/entries2html.xsl @@ -9,11 +9,9 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title> demo</title> - <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css"> - <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> - <!-- The script below can be omitted --> - <script src="/resources/turnOffPushState.js"></script> - <script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script> + <link rel="stylesheet" href="http://code.jquery.com/mobile/git/jquery.mobile-git.min.css"> + <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> + <script src="http://code.jquery.com/mobile/git/jquery.mobile-git.min.js"></script> <style> </style> </head> <body> diff --git a/grunt.js b/grunt.js index cd4af15f..30e82dc7 100644 --- a/grunt.js +++ b/grunt.js @@ -38,7 +38,7 @@ grunt.initConfig({ watch: { scripts: { files: 'entries/*.xml', - tasks: ['build'], + tasks: ['wordpress-deploy'], options: { interrupt: true } diff --git a/includes/core-extension-desc.xml b/includes/core-extension-desc.xml new file mode 100644 index 00000000..7eec109c --- /dev/null +++ b/includes/core-extension-desc.xml @@ -0,0 +1,2 @@ + +

    This plugin extends jQuery's built-in method. If jQuery UI is not loaded, calling the .() method may not fail directly, as the method still exists. However, the expected behavior will not occur.

    diff --git a/includes/pre-rendered-common.xml b/includes/pre-rendered-common.xml new file mode 100644 index 00000000..03fc3139 --- /dev/null +++ b/includes/pre-rendered-common.xml @@ -0,0 +1,7 @@ + + +

    Providing pre-rendered markup

    +

    You can improve the load time of your page by providing the markup that the widget would normally create during its initialization.

    +

    By providing this markup yourself, and by indicating that you have done so by setting the attribute data-enhanced="true", you instruct the widget to skip these DOM manipulations during instantiation and to assume that the required DOM structure is already present.

    +

    When you provide such pre-rendered markup you must also set all the classes that the framework would normally set, and you must also set all data attributes whose values differ from the default to indicate that the pre-rendered markup reflects the non-default value of the corresponding widget option.

    +
    diff --git a/includes/widget-event-create.xml b/includes/widget-event-create.xml new file mode 100644 index 00000000..9f3c08f2 --- /dev/null +++ b/includes/widget-event-create.xml @@ -0,0 +1,8 @@ + + + + Triggered when the is created. + + + + diff --git a/includes/widget-method-destroy.xml b/includes/widget-method-destroy.xml new file mode 100644 index 00000000..344a979d --- /dev/null +++ b/includes/widget-method-destroy.xml @@ -0,0 +1,6 @@ + + + + Removes the functionality completely. This will return the element back to its pre-init state. + + diff --git a/includes/widget-method-disable.xml b/includes/widget-method-disable.xml new file mode 100644 index 00000000..e2828b40 --- /dev/null +++ b/includes/widget-method-disable.xml @@ -0,0 +1,6 @@ + + + + Disables the . + + diff --git a/includes/widget-method-enable.xml b/includes/widget-method-enable.xml new file mode 100644 index 00000000..0b1b650a --- /dev/null +++ b/includes/widget-method-enable.xml @@ -0,0 +1,6 @@ + + + + Enables the . + + diff --git a/includes/widget-method-option.xml b/includes/widget-method-option.xml new file mode 100644 index 00000000..b9652f52 --- /dev/null +++ b/includes/widget-method-option.xml @@ -0,0 +1,30 @@ + + + + Sets one or more options for the . + + + Gets the value currently associated with the specified optionName. + + The name of the option to get. + + + + Gets an object containing key/value pairs representing the current options hash. + + + Sets the value of the option associated with the specified optionName. + + The name of the option to set. + + + A value to set for the option. + + + + Sets one or more options for the . + + A map of option-value pairs to set. + + + diff --git a/includes/widget-method-widget.xml b/includes/widget-method-widget.xml new file mode 100644 index 00000000..2a90c32c --- /dev/null +++ b/includes/widget-method-widget.xml @@ -0,0 +1,6 @@ + + + + Returns a jQuery object containing the . + + diff --git a/includes/widget-option-disabled.xml b/includes/widget-option-disabled.xml new file mode 100644 index 00000000..07b4e337 --- /dev/null +++ b/includes/widget-option-disabled.xml @@ -0,0 +1,8 @@ + + diff --git a/includes/widget-option-enhanced.xml b/includes/widget-option-enhanced.xml new file mode 100644 index 00000000..939e5754 --- /dev/null +++ b/includes/widget-option-enhanced.xml @@ -0,0 +1,7 @@ + + diff --git a/includes/widget-option-initSelector.xml b/includes/widget-option-initSelector.xml new file mode 100644 index 00000000..3b9b8e19 --- /dev/null +++ b/includes/widget-option-initSelector.xml @@ -0,0 +1,19 @@ + + diff --git a/includes/widget-option-mini.xml b/includes/widget-option-mini.xml new file mode 100644 index 00000000..6a9e1336 --- /dev/null +++ b/includes/widget-option-mini.xml @@ -0,0 +1,7 @@ + + diff --git a/includes/widget-option-theme.xml b/includes/widget-option-theme.xml new file mode 100644 index 00000000..45d048a4 --- /dev/null +++ b/includes/widget-option-theme.xml @@ -0,0 +1,9 @@ + + diff --git a/pages/data-attribute.html b/pages/data-attribute.html index 7c77747e..bf696046 100644 --- a/pages/data-attribute.html +++ b/pages/data-attribute.html @@ -45,7 +45,6 @@

    Button

    swatch letter (a-z) -

    Multiple buttons can be wrapped in a container with a data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the buttons to sit side-by-side. Add the data-mini="true" to get the mini/compact sized version for all the buttons that appear in the controlgroup.

    Checkbox

    Pairs of labels and inputs with type="checkbox" are auto-enhanced, no data-role required

    @@ -63,7 +62,6 @@

    Checkbox

    swatch letter (a-z) - Added to the form element -

    Multiple checkboxes can be wrapped in a container with a data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the checkboxes to sit side-by-side. Add the data-mini="true" to get the mini/compact sized version for all the checkboxes that appear in the controlgroup.

    Collapsible

    A heading and content wrapped in a container with the data-role="collapsible"

    @@ -74,7 +72,7 @@

    Collapsible

    data-collapsed-icon - home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search + home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search | false data-content-theme @@ -137,7 +135,7 @@

    Collapsible set

    -

    Content

    +

    Content

    Container with data-role="content"

    @@ -148,12 +146,20 @@

    Content

    Controlgroup

    -

    DIV or FIELDSET container with data-role="controlgroup". Visually integrate multiple button-styled inputs of a single type (checkboxes, link-based buttons, radio buttons, selects) into a group. For grouping form checkboxes and radio buttons, the fieldset container is recommended inside a div container with the data-role="fieldcontain", to improve label styling.

    +

    DIV or FIELDSET container with data-role="controlgroup". Visually integrate multiple button-styled elements.

    + + + + + + + + @@ -211,38 +217,9 @@

    Enhancement

    Any link or form element inside data-ajax="false" containers will be ignored by the framework's navigation functionality when $.mobile.ignoreContentEnabled is set to true.

    -

    Field container

    +

    Field container

    Container with data-role="fieldcontain" wrapped around label/form element pair

    - -

    Fixed Toolbar

    -

    Container with data-role="header" or data-role="footer" plus the attribute data-position="fixed"

    -
    data-exclude-invisibletrue | false - Sets whether to exclude invisible children in the assignment of rounded corners
    data-mini true | false - Compact sized version for all items in the controlgroup
    data-themeswatch letter (a-z)
    data-type horizontal | vertical - For horizontal or vertical item alignment
    - - - - - - - - - - - - - - - - - - - - - - - - -
    data-disable-page-zoomtrue | false - User-scaling-ability for pages with fixed toolbars
    data-fullscreentrue | false - Setting toolbars over the page-content
    data-tap-toggletrue | false - Ability to toggle toolbar-visibility on user tap/click
    data-transitionslide | fade | none - Show/hide-transition when a tap/click occurs
    data-update-page-paddingtrue | false - Have the page top and bottom padding updated on resize, transition, "updatelayout" events (the framework always updates the padding on the "pageshow" event).
    data-visible-on-page-showtrue | false - Toolbar-visibility when parent page is shown
    -

    +

    Note: data-role="fieldcontain" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class ui-field-contain instead.

    Flip toggle switch

    Select with data-role="slider" and two option element

    @@ -266,51 +243,7 @@

    Flip toggle switch

    -

    Footer

    -

    Container with data-role="footer"

    - - - - - - - - - - - - - - - - - -
    data-idstring - Unique ID. Required for persistent footers
    data-positionfixed
    data-fullscreentrue | false - Used in conjunction with fixed toolbars
    data-themeswatch letter (a-z)
    -

    - -

    Header

    -

    Container with data-role="header"

    - - - - - - - - - - - - - - - - - -
    data-idstring - Unique ID. Required for persistent headers
    data-positionfixed
    data-fullscreentrue | false - Used in conjunction with fixed toolbars
    data-themeswatch letter (a-z)
    -

    - -

    Link

    +

    Link

    Links, including those with a data-role="button", and form submit buttons share these attributes

    @@ -426,7 +359,7 @@

    Listview item

    The data-icon attribute is only applicable for a listview item if it contains a link.

    -

    Navbar

    +

    Navbar

    A number of LIs wrapped in a container with data-role="navbar"

    @@ -437,40 +370,20 @@

    Navbar

    To add icons to the navbar items, the data-icon attribute is used, specifying a standard mobile icon for each item.

    Navbars inherit the theme-swatch from their parent container. Setting the data-theme attribute to a navbar is not supported. The data-theme attribute can be set individually to the links inside a navbar.

    -

    Page

    +

    Page

    Container with data-role="page"

    - - - - - - - - - - - - - - - - - - - - - + - + @@ -547,9 +460,8 @@

    Radio button

    data-add-back-btntrue | false - Auto add back button, header only
    data-back-btn-textstring
    data-back-btn-themeswatch letter (a-z)
    data-close-btn-textstring - Text for the close button, dialog only
    data-dom-cache true | false
    data-fullscreentrue | false - Used in conjunction with fixed toolbars

    Deprecated in 1.1 - use on header and footer instead.

    data-overlay-themeswatch letter (a-z) - Overlay theme when the page is opened in a dialogswatch letter (a-z) - Overlay theme when the page is opened as a dialog
    data-themeswatch letter (a-z) - Default "c"swatch letter (a-z) - Default "a"
    data-title swatch letter (a-z) - Added to the form element
    -

    Multiple radion buttons can be wrapped in a container with a data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the radio buttons to sit side-by-side. Add the data-mini="true" to get the mini/compact sized version for all the radio buttons that appear in the controlgroup.

    -

    Select

    +

    Selectmenu

    All select form elements are auto-enhanced, no data-role required

    @@ -593,9 +505,8 @@

    Select

    swatch letter (a-z) - Added to the form element
    -

    Multiple selects can be wrapped in a fieldset with a data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the selects to sit side-by-side.

    -

    Slider

    +

    Slider

    Inputs with type="range" are auto-enhanced, no data-role required

    @@ -621,7 +532,7 @@

    Slider

    -

    Text input & Textarea

    +

    Textinput

    Input type="text|number|search|etc." or textarea elements are auto-enhanced, no data-role required

    @@ -645,3 +556,63 @@

    Text input & Textarea

    swatch letter (a-z) - Added to the form element
    +

    + +

    Toolbar

    +

    Container with data-role="header" or data-role="footer"

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    data-add-back-btntrue | false - Auto add back button, header only
    data-back-btn-textstring - Header only
    data-back-btn-themeswatch letter (a-z) - Header only
    data-idstring - Unique ID. Required for persistent footers
    data-positionfixed
    data-themeswatch letter (a-z)
    +

    + +

    Fixed toolbar

    +

    Container with data-role="header" or data-role="footer" plus the attribute data-position="fixed"

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    data-disable-page-zoomtrue | false - User-scaling-ability for pages with fixed toolbars
    data-fullscreentrue | false - Setting toolbars over the page-content
    data-tap-toggletrue | false - Ability to toggle toolbar-visibility on user tap/click
    data-transitionslide | fade | none - Show/hide-transition when a tap/click occurs
    data-update-page-paddingtrue | false - Have the page top and bottom padding updated on resize, transition, "updatelayout" events (the framework always updates the padding on the "pageshow" event).
    data-visible-on-page-showtrue | false - Toolbar-visibility when parent page is shown
    diff --git a/pages/global-config.html b/pages/global-config.html index 9f8c011a..212a65ec 100644 --- a/pages/global-config.html +++ b/pages/global-config.html @@ -57,73 +57,65 @@

    Configurable options

    The following defaults are configurable via the $.mobile object:

    -
    activeBtnClass string, default: "ui-btn-active"
    +
    activeBtnClass string, default: "ui-btn-active"
    The CSS class used for "active" button state.

    -
    activePageClass string, default: "ui-page-active"
    +
    activePageClass string, default: "ui-page-active"
    The CSS class used for the page currently in view or in a transition.

    -
    ajaxEnabled boolean, default: true
    +
    ajaxEnabled boolean, default: true
    jQuery Mobile will automatically handle link clicks and form submissions through Ajax, when possible. If false, URL hash listening will be disabled as well, and URLs will load as ordinary HTTP requests.

    -
    allowCrossDomainPages boolean, default: false
    +
    allowCrossDomainPages boolean, default: false
    When jQuery Mobile attempts to load an external page, the request runs through $.mobile.loadPage(). This will only allow cross-domain requests if $.mobile.allowCrossDomainPages is set to true. Because the jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for $.mobile.allowCrossDomainPages is set to false. In PhoneGap apps that must "phone home" by loading assets off a remote server, both the $.support.cors AND $.mobile.allowCrossDomainPages must be set to true.

    -
    autoInitializePage boolean, default: true
    +
    autoInitializePage boolean, default: true
    When the DOM is ready, the framework should automatically call $.mobile.initializePage. If false, the page will not initialize and will be visually hidden until $.mobile.initializePage is manually called.

    -
    buttonMarkup.hoverDelay integer, default: 200
    -
    Set the delay for touch devices to add the hover and down classes on touch interactions for buttons throughout the framework. Reducing the delay here results in a more responsive feeling ui, but will often result in the downstate being applied during page scrolling.
    +
    buttonMarkup.hoverDelay integer, default: 200
    +
    Set the delay for touch devices to add the hover and down classes on touch interactions for buttons throughout the framework. Reducing the delay here results in a more responsive feeling ui, but will often result in the downstate being applied during page scrolling. +
    Deprecated in 1.4 - use $.mobile.hoverDelay instead.

    -
    defaultDialogTransition string, default: 'pop'
    -
    Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions.
    +
    defaultDialogTransition string, default: 'pop'
    +
    Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions. +
    Deprecated in 1.4. +

    When using pages styled as dialogs (data-role="page" data-dialog="true"), if you wish for them to have a different transition than regular pages, you must specify the transition on the link that opens them by adding the attribute data-transition="pop" to the link. "pop" is just an example. You may specify any transition you wish, such as "slide", "flip", or "none".

    +

    Similarly, when calling the pagecontainer's change() method, you must also specify the transition explicitly, if you wish it to be different from the $.mobile.defaultPageTransition: +

    
    +$( ":mobile-pagecontainer" )
    +	.pagecontainer( "change", "dialog.html", { transition: "pop" } );
    +
    +

    +
    -
    defaultPageTransition string, default: 'fade'
    +
    defaultPageTransition string, default: 'fade'
    Set the default transition for page changes that use Ajax. Note: default changed from 'slide' to 'fade' in 1.1. Set to 'none' for no transitions.

    -
    dynamicBaseEnabled boolean, default: true
    +
    dynamicBaseEnabled boolean, default: true
    When this property is set to false the base tag value in browsers that support a dynamic base tag and URL prefixes in browsers that don't won't be updated to reflect where the page was loaded from. This means that resource references that are relative to the page on which they are defined may break. This option is available for web frameworks that operate under a universal base tag value where all links and assets are relative to a signal base.

    -
    getMaxScrollForTransition integer, default: 3
    +
    getMaxScrollForTransition integer, default: 3
    Set a scroll position breakpoint for transitions. If the scroll position is greater than the window height multiplied by the value that has been set, transition "none" will be used.

    -
    gradeA function that returns a boolean, default: a function returning the value of $.support.mediaquery
    +
    gradeA function that returns a boolean, default: a function returning the value of $.support.mediaquery
    Any support conditions that must be met in order to proceed.

    -
    hashListeningEnabled boolean, default: true
    +
    hashListeningEnabled boolean, default: true
    jQuery Mobile will automatically listen and handle changes to the location.hash. Disabling this will prevent jQuery Mobile from handling hash changes, which allows you to handle them yourself or use simple deep-links within a document that scroll to a particular id.

    -
    ignoreContentEnabled boolean, default: false
    +
    ignoreContentEnabled boolean, default: false
    Warning: Setting this property to true will cause performance degradation on enhancement. Once set, all automatic enhancements made by the framework to each enhanceable element of the user's markup will first check for a data-enhance=false parent node. If one is found the markup will be ignored. This setting and the accompanying data attribute provide a mechanism through which users can prevent enhancement over large sections of markup.

    -
    linkBindingEnabled boolean, default: true
    +
    linkBindingEnabled boolean, default: true
    jQuery Mobile will automatically bind the clicks on anchor tags in your document. Setting this option to false will prevent all anchor click handling including the addition of active button state and alternate link bluring. This should only be used when attempting to delegate the click management to another library or custom code.

    -
    loadingMessage string, default: "loading"
    -
    - Set the text that appears when a page is loading. If set to false, the message will not appear at all. -
    Deprecated in 1.2 - use $.mobile.loader.prototype.options.text instead. See the loader docs for more.
    -
    - -
    loadingMessageTextVisible boolean, default: false
    -
    - Whether the text should be visible when a loading message is shown. The text is always visible for loading errors. -
    Deprecated in 1.2 - use $.mobile.loader.prototype.options.textVisible instead. See the loader docs for more.
    -
    - -
    loadingMessageTheme string, default: "a"
    -
    - The theme that the loading message box uses when text is visible. -
    Deprecated in 1.2 - use $.mobile.loader.prototype.options.theme instead. See the loader docs for more.
    -
    - -
    maxTransitionWidth integer, boolean, default: false
    +
    maxTransitionWidth integer, boolean, default: false
    Set a max width for transitions. The option accepts any number representing a pixel width and its default value false. If a number value is set, transition "none" will be used if the window is wider than the specified value.

    -
    minScrollBack integer, default: 250
    -
    Minimum scroll distance that will be remembered when returning to a page.
    +
    minScrollBack integer, default: 250
    +
    Minimum scroll distance that will be remembered when returning to a page.
    Deprecated in 1.4 and will be removed in 1.5. Any and all scrolling will be remembered. This matches native behavior. The default value is 0 during the deprecation period.

    -
    ns string, default: ""
    +
    ns string, default: ""
    The namespace used in data attributes (e.g., data-role). Can be set to any string, including a blank string which is the default. When using, it's clearest if you include a trailing dash, such as "mynamespace-" which maps to data-mynamespace-foo="...".

    If you use data- namespacing, you will need to update/override one selector in the theme CSS. The following data selectors should incorporate the namespace you're using:

    
    @@ -132,28 +124,22 @@ 

    Configurable options


    -
    pageLoadErrorMessage string, default: "Error Loading Page"
    +
    pageLoadErrorMessage string, default: "Error Loading Page"
    Set the text that appears when a page fails to load through Ajax.

    -
    pageLoadErrorMessageTheme string, default: "e"
    +
    pageLoadErrorMessageTheme string, default: "e"
    Set the theme that the error message box uses.

    -
    phonegapNavigationEnabled boolean, default: false
    +
    phonegapNavigationEnabled boolean, default: false
    Replace calls to window.history.back with PhoneGap's navigation helper where it is available. This addresses navigation issues on page refresh in Android PhoneGap applications using jQuery Mobile.

    -
    pushStateEnabled boolean, default: true
    +
    pushStateEnabled boolean, default: true
    Enhancement to use history.replaceState in supported browsers, to convert the hash-based Ajax URL into the full document path. Note that we recommend disabling this feature if Ajax is disabled or if external links are used extensively.

    -
    subPageUrlKey string, default: "ui-page"
    -
    The url parameter used for referencing widget-generated sub-pages (such as those generated by nested listviews). Translates to example.html&ui-page=subpageIdentifier. The hash segment before &ui-page= is used by the framework for making an Ajax request to the URL where the sub-page exists.
    +
    subPageUrlKey string, default: "ui-page"
    +
    The url parameter used for referencing widget-generated sub-pages (such as those generated by nested listviews). Translates to example.html&ui-page=subpageIdentifier. The hash segment before &ui-page= is used by the framework for making an Ajax request to the URL where the sub-page exists. +
    Deprecated in 1.4 since this option only affects nested listviews, which have been removed.

    -
    touchOverflowEnabled boolean, default: false
    -
    - Enable smoother page transitions and true fixed toolbars in devices that support both the overflow: and overflow-scrolling: touch; CSS properties. -
    Deprecated in 1.1.0
    -
    - -
    transitionFallbacks.[transition] string, default: "fade"
    +
    transitionFallbacks.[transition] string, default: "fade"
    Set the fallback transition for browsers that don't support 3D transforms for a specific transition type.
    -
    diff --git a/pages/index.html b/pages/index.html index 254a449e..46f7a642 100644 --- a/pages/index.html +++ b/pages/index.html @@ -1,5 +1,5 @@

    jQuery Mobile is the easiest way to build sites and apps that are accessible on all popular smartphone, tablet and desktop devices.

    @@ -10,9 +10,9 @@ You can contribute to the project by reporting issues, suggesting new features, or submitting pull requests. Please read our Contributing Guidelines before submitting.

    -

    This site provides API documentation for jQuery Mobile 1.3.0 final.

    +

    This site provides API documentation for jQuery Mobile 1.4.

    -

    jQuery Mobile 1.3.0 supports jQuery 1.7.0 to 1.9.1

    +

    jQuery Mobile 1.4 supports jQuery 1.8 to 1.10 and 2.0

    @@ -21,8 +21,7 @@

    Can't find what you're looking for?

    Perhaps one of the following sites will help:

      -
    • jQuery Mobile Demo Center
    • -
    • jQuery Mobile 1.2.0 Documentation
    • +
    • jQuery Mobile 1.4 Demos
    • jQuery Core API Documentation
    • jQuery UI API Documentation
    • jQuery Learning Center
    • diff --git a/resources/button/example2.html b/resources/button/example2.html deleted file mode 100644 index 67e37e03..00000000 --- a/resources/button/example2.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - Page Title - - - - - - - - - - -
      - -
      - - - diff --git a/resources/button/example33.html b/resources/button/example33.html deleted file mode 100644 index e3b0dffe..00000000 --- a/resources/button/example33.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - Page Title - - - - - - - - - - -
      -
      -

      Swatch "a"

      Button
      -

      Swatch "b"

      Button
      -

      Swatch "c"

      Button
      -

      Swatch "d"

      Button
      -

      Swatch "e"

      Button
      -
      -
      - - - diff --git a/resources/button/example34.html b/resources/button/example34.html deleted file mode 100644 index 7fff65d2..00000000 --- a/resources/button/example34.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - Page Title - - - - - - - - - - - - - - diff --git a/resources/button/example35.html b/resources/button/example35.html deleted file mode 100644 index d42db0e3..00000000 --- a/resources/button/example35.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - Page Title - - - - - - - - - - -
      -
      -

      Swatch "a" on container with themed buttons inside -

      -

      Swatch "b" on container with themed buttons inside -

      -

      Swatch "c" on container with themed buttons inside -

      -

      Swatch "d" on container with themed buttons inside -

      -

      Swatch "e" on container with themed buttons inside -

      -
      -
      - - - diff --git a/resources/button/example47.html b/resources/button/example47.html deleted file mode 100644 index 5edc3e12..00000000 --- a/resources/button/example47.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - Page Title - - - - - - - - - - -
      -
      - Theme A -
      -
      - - - diff --git a/resources/button/example48.html b/resources/button/example48.html new file mode 100644 index 00000000..1e3573e7 --- /dev/null +++ b/resources/button/example48.html @@ -0,0 +1,38 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      + +
      +
      +
      + + diff --git a/resources/button/example49.html b/resources/button/example49.html new file mode 100644 index 00000000..5937bec8 --- /dev/null +++ b/resources/button/example49.html @@ -0,0 +1,41 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +
      + The Button + +
      +
      +
      +
      + + diff --git a/resources/button/example5.html b/resources/button/example5.html index 04fac0d9..b58119f0 100644 --- a/resources/button/example5.html +++ b/resources/button/example5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example6.html b/resources/button/example6.html index e74e1770..9d388e4d 100644 --- a/resources/button/example6.html +++ b/resources/button/example6.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example7.html b/resources/button/example7.html index fa73a04f..001b3eb9 100644 --- a/resources/button/example7.html +++ b/resources/button/example7.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example1.html b/resources/buttonMarkup/example1.html similarity index 54% rename from resources/button/example1.html rename to resources/buttonMarkup/example1.html index bb4cae15..ff0d61d0 100644 --- a/resources/button/example1.html +++ b/resources/buttonMarkup/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/button/example10.html b/resources/buttonMarkup/example10.html similarity index 89% rename from resources/button/example10.html rename to resources/buttonMarkup/example10.html index 2cb96617..195ac23c 100644 --- a/resources/button/example10.html +++ b/resources/buttonMarkup/example10.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Bars - data-icon="bars"

      My button Edit - data-icon="edit"

      @@ -69,4 +69,3 @@
      - diff --git a/resources/button/example11.html b/resources/buttonMarkup/example11.html similarity index 56% rename from resources/button/example11.html rename to resources/buttonMarkup/example11.html index 52d5da7b..ec8e26ab 100644 --- a/resources/button/example11.html +++ b/resources/buttonMarkup/example11.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example12.html b/resources/buttonMarkup/example12.html similarity index 72% rename from resources/button/example12.html rename to resources/buttonMarkup/example12.html index 3cb83710..8d57431d 100644 --- a/resources/button/example12.html +++ b/resources/buttonMarkup/example12.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Creates this button with right-aligned icon:

      Delete

      Icons can also be positioned above the text by specifying data-iconpos="top"

      @@ -35,4 +35,3 @@
      - diff --git a/resources/button/example15.html b/resources/buttonMarkup/example15.html similarity index 56% rename from resources/button/example15.html rename to resources/buttonMarkup/example15.html index 491d1028..f737f455 100644 --- a/resources/button/example15.html +++ b/resources/buttonMarkup/example15.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example16.html b/resources/buttonMarkup/example16.html similarity index 73% rename from resources/button/example16.html rename to resources/buttonMarkup/example16.html index 178fcd2e..f428a2de 100644 --- a/resources/button/example16.html +++ b/resources/buttonMarkup/example16.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      Delete Delete Delete @@ -34,4 +34,3 @@
      - diff --git a/resources/button/example17.html b/resources/buttonMarkup/example17.html similarity index 96% rename from resources/button/example17.html rename to resources/buttonMarkup/example17.html index b757fbd1..17b07282 100644 --- a/resources/button/example17.html +++ b/resources/buttonMarkup/example17.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Swatch "a" themed buttons

      My button diff --git a/resources/buttonMarkup/example2.html b/resources/buttonMarkup/example2.html new file mode 100644 index 00000000..07995968 --- /dev/null +++ b/resources/buttonMarkup/example2.html @@ -0,0 +1,32 @@ + + + + Page Title + + + + + + + + + + +
      + +
      + + diff --git a/resources/button/example20.html b/resources/buttonMarkup/example20.html similarity index 69% rename from resources/button/example20.html rename to resources/buttonMarkup/example20.html index d292b006..0b1a8e7f 100644 --- a/resources/button/example20.html +++ b/resources/buttonMarkup/example20.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      By default, all buttons in the body content are styled as block-level elements so they fill the width of the screen:

      Button

      However, if you want a more compact button that is only as wide as the text and icons inside, add the data-inline="true" attribute to the button:

      @@ -33,4 +33,3 @@
      - diff --git a/resources/button/example22.html b/resources/buttonMarkup/example22.html similarity index 70% rename from resources/button/example22.html rename to resources/buttonMarkup/example22.html index 9f118a28..16997199 100644 --- a/resources/button/example22.html +++ b/resources/buttonMarkup/example22.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      The result is this:

      Cancel Save @@ -35,4 +35,3 @@
      - diff --git a/resources/button/example24.html b/resources/buttonMarkup/example24.html similarity index 71% rename from resources/button/example24.html rename to resources/buttonMarkup/example24.html index b71170e7..810ff343 100644 --- a/resources/button/example24.html +++ b/resources/buttonMarkup/example24.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -

      When an icon is added to an inline button, the button will grow wider to accommodate the icon:

      +

      When an icon is added to an inline button, the button will grow wider to accommodate the icon:

      Cancel Save

      A mini version of the same:

      @@ -35,4 +35,3 @@
      - diff --git a/resources/button/example26.html b/resources/buttonMarkup/example26.html similarity index 61% rename from resources/button/example26.html rename to resources/buttonMarkup/example26.html index 02aa3a19..902caaf8 100644 --- a/resources/button/example26.html +++ b/resources/buttonMarkup/example26.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      Yes No diff --git a/resources/button/example27.html b/resources/buttonMarkup/example27.html similarity index 86% rename from resources/button/example27.html rename to resources/buttonMarkup/example27.html index a5acc5a8..5ff0d49c 100644 --- a/resources/button/example27.html +++ b/resources/buttonMarkup/example27.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Horizontal grouped buttons:

      Yes @@ -63,4 +63,3 @@
      - diff --git a/resources/button/example3.html b/resources/buttonMarkup/example3.html similarity index 55% rename from resources/button/example3.html rename to resources/buttonMarkup/example3.html index 8e86ff21..356ab090 100644 --- a/resources/button/example3.html +++ b/resources/buttonMarkup/example3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/buttonMarkup/example33.html b/resources/buttonMarkup/example33.html new file mode 100644 index 00000000..dc3acf6b --- /dev/null +++ b/resources/buttonMarkup/example33.html @@ -0,0 +1,33 @@ + + + + Page Title + + + + + + + + + + +
      +
      +

      Swatch "a"

      Button
      +

      Swatch "b"

      Button
      +
      +
      + + diff --git a/resources/buttonMarkup/example34.html b/resources/buttonMarkup/example34.html new file mode 100644 index 00000000..7873d6f6 --- /dev/null +++ b/resources/buttonMarkup/example34.html @@ -0,0 +1,33 @@ + + + + Page Title + + + + + + + + + + +
      + +
      + + diff --git a/resources/buttonMarkup/example35.html b/resources/buttonMarkup/example35.html new file mode 100644 index 00000000..c0bed1b1 --- /dev/null +++ b/resources/buttonMarkup/example35.html @@ -0,0 +1,41 @@ + + + + Page Title + + + + + + + + + + +
      +
      +

      Swatch "a" on container with themed buttons inside +

      +

      Swatch "b" on container with themed buttons inside +

      +
      +
      + + diff --git a/resources/button/example4.html b/resources/buttonMarkup/example4.html similarity index 53% rename from resources/button/example4.html rename to resources/buttonMarkup/example4.html index 76ecec22..a32ca3c5 100644 --- a/resources/button/example4.html +++ b/resources/buttonMarkup/example4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example40.html b/resources/buttonMarkup/example40.html similarity index 55% rename from resources/button/example40.html rename to resources/buttonMarkup/example40.html index 195862fe..b64146a1 100644 --- a/resources/button/example40.html +++ b/resources/buttonMarkup/example40.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/button/example41.html b/resources/buttonMarkup/example41.html similarity index 55% rename from resources/button/example41.html rename to resources/buttonMarkup/example41.html index 466429d5..5539b4d9 100644 --- a/resources/button/example41.html +++ b/resources/buttonMarkup/example41.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/button/example42.html b/resources/buttonMarkup/example42.html similarity index 56% rename from resources/button/example42.html rename to resources/buttonMarkup/example42.html index a01e3d16..b11ed78e 100644 --- a/resources/button/example42.html +++ b/resources/buttonMarkup/example42.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/button/example43.html b/resources/buttonMarkup/example43.html similarity index 53% rename from resources/button/example43.html rename to resources/buttonMarkup/example43.html index 26e5835d..aa4555c9 100644 --- a/resources/button/example43.html +++ b/resources/buttonMarkup/example43.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/button/example44.html b/resources/buttonMarkup/example44.html similarity index 55% rename from resources/button/example44.html rename to resources/buttonMarkup/example44.html index 60f5e5d3..17c3ab6a 100644 --- a/resources/button/example44.html +++ b/resources/buttonMarkup/example44.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example45.html b/resources/buttonMarkup/example45.html similarity index 54% rename from resources/button/example45.html rename to resources/buttonMarkup/example45.html index 52141fd7..9b39b0ab 100644 --- a/resources/button/example45.html +++ b/resources/buttonMarkup/example45.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/button/example46.html b/resources/buttonMarkup/example46.html similarity index 55% rename from resources/button/example46.html rename to resources/buttonMarkup/example46.html index 8221eb8b..74ac66cc 100644 --- a/resources/button/example46.html +++ b/resources/buttonMarkup/example46.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/buttonMarkup/example47.html b/resources/buttonMarkup/example47.html new file mode 100644 index 00000000..c5ec01c2 --- /dev/null +++ b/resources/buttonMarkup/example47.html @@ -0,0 +1,32 @@ + + + + Page Title + + + + + + + + + + +
      +
      + Theme B +
      +
      + + diff --git a/resources/buttonMarkup/example48.html b/resources/buttonMarkup/example48.html new file mode 100644 index 00000000..4d72eaed --- /dev/null +++ b/resources/buttonMarkup/example48.html @@ -0,0 +1,32 @@ + + + + Page Title + + + + + + + + + + +
      +
      + Example +
      +
      + + diff --git a/resources/buttonMarkup/example49.html b/resources/buttonMarkup/example49.html new file mode 100644 index 00000000..06dd1929 --- /dev/null +++ b/resources/buttonMarkup/example49.html @@ -0,0 +1,32 @@ + + + + Page Title + + + + + + + + + + +
      +
      + Home +
      +
      + + diff --git a/resources/button/example8.html b/resources/buttonMarkup/example8.html similarity index 65% rename from resources/button/example8.html rename to resources/buttonMarkup/example8.html index a9f078cd..aeb3aaa1 100644 --- a/resources/button/example8.html +++ b/resources/buttonMarkup/example8.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Creates this button with an icon:

      Delete

      A more compact button with the data-mini="true" attribute added to the button:

      @@ -33,4 +33,3 @@
      - diff --git a/resources/checkbox/example1.html b/resources/checkbox/example1.html index 47ff1591..8c13c32a 100644 --- a/resources/checkbox/example1.html +++ b/resources/checkbox/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - +
      diff --git a/resources/checkbox/example2.html b/resources/checkbox/example2.html index 5f6c4605..02887d21 100644 --- a/resources/checkbox/example2.html +++ b/resources/checkbox/example2.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      @@ -33,4 +33,3 @@
      - diff --git a/resources/checkbox/example3.html b/resources/checkbox/example3.html index 845cfb77..af073d1e 100644 --- a/resources/checkbox/example3.html +++ b/resources/checkbox/example3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      -
      +
      +
      Agree to the terms: @@ -38,4 +38,3 @@
      - diff --git a/resources/checkbox/example4.html b/resources/checkbox/example4.html index 257de8bc..1b8e9b77 100644 --- a/resources/checkbox/example4.html +++ b/resources/checkbox/example4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      -
      +
      +
      Choose as many snacks as you'd like: - + - + - +
      @@ -47,4 +47,3 @@
      - diff --git a/resources/checkbox/example5.html b/resources/checkbox/example5.html index 450059df..5dfca492 100644 --- a/resources/checkbox/example5.html +++ b/resources/checkbox/example5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      -
      +
      +
      Font styling: - + - +
      @@ -44,4 +44,3 @@
      - diff --git a/resources/checkbox/example6.html b/resources/checkbox/example6.html new file mode 100644 index 00000000..42a31dcd --- /dev/null +++ b/resources/checkbox/example6.html @@ -0,0 +1,41 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +
      + + +
      +
      +
      +
      + + diff --git a/resources/collapsible-set/example7.html b/resources/collapsible-set/example7.html deleted file mode 100644 index 9f43d97f..00000000 --- a/resources/collapsible-set/example7.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - Page Title - - - - - - - - - - -
      -
      -
      -
      -

      Section header, swatch B

      -

      Collapsible content, swatch "b"

      -
      -
      -

      Section header, swatch A

      -

      Collapsible content, swatch "a"

      -
      -
      -

      Section header, swatch E

      -

      Collapsible content, swatch "d"

      -
      -
      -
      -
      - - \ No newline at end of file diff --git a/resources/collapsible/example1.html b/resources/collapsible/example1.html index f90dc39f..994554da 100644 --- a/resources/collapsible/example1.html +++ b/resources/collapsible/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I'm a header

      I'm the collapsible content. By default I'm closed, but you can click the header to open me.

      @@ -33,4 +33,3 @@

      I'm a header

      - diff --git a/resources/collapsible/example10.html b/resources/collapsible/example10.html new file mode 100644 index 00000000..4441317e --- /dev/null +++ b/resources/collapsible/example10.html @@ -0,0 +1,36 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +

      + + Pre-rendered collapsible + click to expand contents + +

      + +
      +
      +
      + + diff --git a/resources/collapsible/example2.html b/resources/collapsible/example2.html index 4f4fa3d6..8990287a 100644 --- a/resources/collapsible/example2.html +++ b/resources/collapsible/example2.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I'm a header

      I'm the collapsible content. I'm expanded by default because I have the "collapsed" state set to false.

      @@ -33,4 +33,3 @@

      I'm a header

      - diff --git a/resources/collapsible/example3.html b/resources/collapsible/example3.html index 7ccbbf37..769f1fba 100644 --- a/resources/collapsible/example3.html +++ b/resources/collapsible/example3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I'm a header

      I'm the collapsible content.

      @@ -33,4 +33,3 @@

      I'm a header

      - diff --git a/resources/collapsible/example4.html b/resources/collapsible/example4.html index c8c199a4..01a3d777 100644 --- a/resources/collapsible/example4.html +++ b/resources/collapsible/example4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I'm a mini header

      I'm the collapsible content.

      @@ -33,4 +33,3 @@

      I'm a mini header

      - diff --git a/resources/collapsible/example5.html b/resources/collapsible/example5.html index 4fb12add..81f3d8ca 100644 --- a/resources/collapsible/example5.html +++ b/resources/collapsible/example5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I have custom icons

      data-collapsed-icon="arrow-r" and data-expanded-icon="arrow-d"

      @@ -33,4 +33,3 @@

      I have custom icons

      - diff --git a/resources/collapsible/example6.html b/resources/collapsible/example6.html index 2765fa1d..8cede10e 100644 --- a/resources/collapsible/example6.html +++ b/resources/collapsible/example6.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I'm a header

      data-iconpos="right"

      @@ -33,4 +33,3 @@

      I'm a header

      - diff --git a/resources/collapsible/example7.html b/resources/collapsible/example7.html index 95a53ae4..5bc08e88 100644 --- a/resources/collapsible/example7.html +++ b/resources/collapsible/example7.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      -
      +
      +

      Header

      -

      I'm the collapsible content with a themed content block set to "c".

      +

      I'm the collapsible content with a themed content block set to "b".

      - diff --git a/resources/collapsible/example8.html b/resources/collapsible/example8.html index 8222663a..a88dc9b1 100644 --- a/resources/collapsible/example8.html +++ b/resources/collapsible/example8.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      -
      -

      Header swatch A

      -

      I'm the collapsible content with a themed content block set to "a".

      -
      - -
      +
      +

      Header swatch B

      -

      I'm the collapsible content with a themed content block set to "d".

      +

      I'm the collapsible content with a themed content block set to "b".

      +
      + +
      +

      Header swatch a

      +

      I'm the collapsible content with a themed content block set to "b".

      - diff --git a/resources/collapsible/example9.html b/resources/collapsible/example9.html index fc10cff7..5286e6c8 100644 --- a/resources/collapsible/example9.html +++ b/resources/collapsible/example9.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I'm a header

      I'm the collapsible content. By default I'm open and displayed on the page, but you can click the header to hide me.

      - +

      I'm a nested collapsible with a child collapsible

      I'm a child collapsible.

      @@ -38,21 +38,21 @@

      Nested inside again.

      - +

      Section 3: Form elements

      -
      +
      -
      +
      -
      +
      @@ -76,4 +76,3 @@

      Section 4: Collapsed list

      - diff --git a/resources/collapsible-set/example1.html b/resources/collapsibleset/example1.html similarity index 82% rename from resources/collapsible-set/example1.html rename to resources/collapsibleset/example1.html index 9ef10d6b..6b8ef532 100644 --- a/resources/collapsible-set/example1.html +++ b/resources/collapsibleset/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Section 1

      diff --git a/resources/collapsible-set/example2.html b/resources/collapsibleset/example2.html similarity index 68% rename from resources/collapsible-set/example2.html rename to resources/collapsibleset/example2.html index 869af536..e0336619 100644 --- a/resources/collapsible-set/example2.html +++ b/resources/collapsibleset/example2.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      I'm a header

      diff --git a/resources/collapsible-set/example3.html b/resources/collapsibleset/example3.html similarity index 67% rename from resources/collapsible-set/example3.html rename to resources/collapsibleset/example3.html index 98ff215b..1bbfcb96 100644 --- a/resources/collapsible-set/example3.html +++ b/resources/collapsibleset/example3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Section 1

      diff --git a/resources/collapsible-set/example4.html b/resources/collapsibleset/example4.html similarity index 63% rename from resources/collapsible-set/example4.html rename to resources/collapsibleset/example4.html index 7bd87efa..9d99e7ff 100644 --- a/resources/collapsible-set/example4.html +++ b/resources/collapsibleset/example4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Section 1

      Collapsible content

      -
      +

      Section 2

      Collapsible content

      diff --git a/resources/collapsible-set/example5.html b/resources/collapsibleset/example5.html similarity index 72% rename from resources/collapsible-set/example5.html rename to resources/collapsibleset/example5.html index 6b0459f4..cfdf0878 100644 --- a/resources/collapsible-set/example5.html +++ b/resources/collapsibleset/example5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Section 1

      diff --git a/resources/collapsible-set/example6.html b/resources/collapsibleset/example6.html similarity index 60% rename from resources/collapsible-set/example6.html rename to resources/collapsibleset/example6.html index 6fd27d7f..24c28912 100644 --- a/resources/collapsible-set/example6.html +++ b/resources/collapsibleset/example6.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      -
      +
      +

      Section 1

      Collapsible content

      @@ -42,4 +42,4 @@

      Section 3

      - \ No newline at end of file + diff --git a/resources/collapsibleset/example7.html b/resources/collapsibleset/example7.html new file mode 100644 index 00000000..4363e666 --- /dev/null +++ b/resources/collapsibleset/example7.html @@ -0,0 +1,41 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +
      +

      Section header, swatch "a"

      +

      Collapsible content, swatch "a"

      +
      +
      +

      Section header, swatch "b"

      +

      Collapsible content, swatch "b"

      +
      +
      +
      +
      + + diff --git a/resources/collapsibleset/example8.html b/resources/collapsibleset/example8.html new file mode 100644 index 00000000..881e9809 --- /dev/null +++ b/resources/collapsibleset/example8.html @@ -0,0 +1,48 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +
      +

      Child collapsible

      +

      This is the collapsible content.

      +
      +
      +

      + + Pre-rendered child collapsible + click to collapse contents + +

      +
      +

      This is the collapsible content.

      +
      +
      +
      +
      +
      + + diff --git a/resources/controlgroup/example1.html b/resources/controlgroup/example1.html index 71eabca8..8f9c2867 100644 --- a/resources/controlgroup/example1.html +++ b/resources/controlgroup/example1.html @@ -1,13 +1,13 @@ - + Page Title - - - + + + - +
      - +

      Dialog

      @@ -33,12 +33,11 @@

      Dialog

      Delete page?

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      - Sounds good - Cancel + Sounds good + Cancel
      - + - diff --git a/resources/dialog/dialog1.html b/resources/dialog/dialog1.html index 26c9e64b..2370c699 100644 --- a/resources/dialog/dialog1.html +++ b/resources/dialog/dialog1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - +
      - +

      Dialog

      @@ -33,12 +33,11 @@

      Dialog

      Delete page?

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      - Sounds good - Cancel + Sounds good + Cancel
      - + - diff --git a/resources/dialog/dialog2.html b/resources/dialog/dialog2.html index 6b21022a..43e0517e 100644 --- a/resources/dialog/dialog2.html +++ b/resources/dialog/dialog2.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - +
      @@ -32,8 +32,8 @@

      Dialog

      I'm colorful

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      - Good for you - Don't care, really + Good for you + Don't care, really
      diff --git a/resources/dialog/dialog3.html b/resources/dialog/dialog3.html index e28921e8..ed85cec3 100644 --- a/resources/dialog/dialog3.html +++ b/resources/dialog/dialog3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      @@ -32,10 +32,10 @@

      Dialog

      Custom overlay

      This dialog adds data-overlay-theme="e" to the page container to set the overlay swatch color.

      - I like it + I like it
      - +
      - + diff --git a/resources/dialog/dialog4.html b/resources/dialog/dialog4.html index 2eb0620a..58b9463c 100644 --- a/resources/dialog/dialog4.html +++ b/resources/dialog/dialog4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + diff --git a/resources/dialog/dialog5.html b/resources/dialog/dialog5.html index b9a42c4f..9dc6bac4 100644 --- a/resources/dialog/dialog5.html +++ b/resources/dialog/dialog5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - +
      diff --git a/resources/dialog/dialog6.html b/resources/dialog/dialog6.html index 2bbb4d42..e5fa3f74 100644 --- a/resources/dialog/dialog6.html +++ b/resources/dialog/dialog6.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - +
      - +

      Dialog

      @@ -32,12 +32,11 @@

      Dialog

      Right close button

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      - Ok, I get it + Ok, I get it
      - + - diff --git a/resources/dialog/dialog7.html b/resources/dialog/dialog7.html index 7a65d9da..e286ea00 100644 --- a/resources/dialog/dialog7.html +++ b/resources/dialog/dialog7.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - +
      - +

      Dialog

      @@ -32,12 +32,11 @@

      Dialog

      No close button

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      - Ok, I get it + Ok, I get it
      - + - diff --git a/resources/dialog/dialog8.html b/resources/dialog/dialog8.html index 8b764cc5..ea61cb2f 100644 --- a/resources/dialog/dialog8.html +++ b/resources/dialog/dialog8.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - +
      - +

      Dialog

      @@ -32,12 +32,11 @@

      Dialog

      No rounded corners

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      - Ok, I get it + Ok, I get it
      - + - diff --git a/resources/dialog/example1.html b/resources/dialog/example1.html index 56fad725..fef5c8e7 100644 --- a/resources/dialog/example1.html +++ b/resources/dialog/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - diff --git a/resources/dialog/example2.html b/resources/dialog/example2.html index 686e8516..435791de 100644 --- a/resources/dialog/example2.html +++ b/resources/dialog/example2.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      data-transition="pop" data-transition="slidedown" data-transition="flip" diff --git a/resources/dialog/example3.html b/resources/dialog/example3.html index dce6e976..12098106 100644 --- a/resources/dialog/example3.html +++ b/resources/dialog/example3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - diff --git a/resources/dialog/example4.html b/resources/dialog/example4.html index 0fa61459..cf12f018 100644 --- a/resources/dialog/example4.html +++ b/resources/dialog/example4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - diff --git a/resources/dialog/example5.html b/resources/dialog/example5.html index 237d6452..86979191 100644 --- a/resources/dialog/example5.html +++ b/resources/dialog/example5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - diff --git a/resources/dialog/example6.html b/resources/dialog/example6.html index b73880f7..f64d71b4 100644 --- a/resources/dialog/example6.html +++ b/resources/dialog/example6.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - - diff --git a/resources/dialog/example7.html b/resources/dialog/example7.html index 03f599d4..41cd28e4 100644 --- a/resources/dialog/example7.html +++ b/resources/dialog/example7.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      - diff --git a/resources/filterable/example1.html b/resources/filterable/example1.html new file mode 100644 index 00000000..34048139 --- /dev/null +++ b/resources/filterable/example1.html @@ -0,0 +1,52 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + + diff --git a/resources/filterable/example2.html b/resources/filterable/example2.html new file mode 100644 index 00000000..e6fc3c61 --- /dev/null +++ b/resources/filterable/example2.html @@ -0,0 +1,52 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + + diff --git a/resources/filterable/example3.html b/resources/filterable/example3.html new file mode 100644 index 00000000..ee16fb47 --- /dev/null +++ b/resources/filterable/example3.html @@ -0,0 +1,79 @@ + + + + Page Title + + + + + + + + + + + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + + diff --git a/resources/filterable/example4.html b/resources/filterable/example4.html new file mode 100644 index 00000000..6ed56f8c --- /dev/null +++ b/resources/filterable/example4.html @@ -0,0 +1,48 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      + +
      + +
      +
      + + diff --git a/resources/flipswitch/example1.html b/resources/flipswitch/example1.html new file mode 100644 index 00000000..d846200c --- /dev/null +++ b/resources/flipswitch/example1.html @@ -0,0 +1,39 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +
      +
      + + +
      +
      +
      +
      +
      + + diff --git a/resources/flipswitch/example2.html b/resources/flipswitch/example2.html new file mode 100644 index 00000000..2ed513bf --- /dev/null +++ b/resources/flipswitch/example2.html @@ -0,0 +1,42 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +
      +
      + + +
      +
      +
      +
      +
      + + diff --git a/resources/flipswitch/example3.html b/resources/flipswitch/example3.html new file mode 100644 index 00000000..f3873f56 --- /dev/null +++ b/resources/flipswitch/example3.html @@ -0,0 +1,38 @@ + + + + Page Title + + + + + + + + + + +
      +
      +
      +
      + On + Off + +
      +
      +
      +
      + + diff --git a/resources/grid-layout/example1.html b/resources/grid-layout/example1.html index 667e8cd4..19d603f9 100644 --- a/resources/grid-layout/example1.html +++ b/resources/grid-layout/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      I'm Block A and text inside will wrap.
      I'm Block B and text inside will wrap.
      @@ -33,4 +33,3 @@
      - diff --git a/resources/grid-layout/example10.html b/resources/grid-layout/example10.html index b6a58627..0d17b658 100644 --- a/resources/grid-layout/example10.html +++ b/resources/grid-layout/example10.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +

      Settings

      -
      +
      - diff --git a/resources/grid-layout/example2.html b/resources/grid-layout/example2.html index 0549feb3..d2ad2ee4 100644 --- a/resources/grid-layout/example2.html +++ b/resources/grid-layout/example2.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      -
      -
      +
      +
      - diff --git a/resources/grid-layout/example3.html b/resources/grid-layout/example3.html index 18eae76d..3518aa72 100644 --- a/resources/grid-layout/example3.html +++ b/resources/grid-layout/example3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      -
      -
      +
      +
      @@ -37,4 +37,3 @@
      - diff --git a/resources/grid-layout/example4.html b/resources/grid-layout/example4.html index e93be04f..6a282aeb 100644 --- a/resources/grid-layout/example4.html +++ b/resources/grid-layout/example4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      Block A
      Block B
      @@ -33,4 +33,3 @@
      - diff --git a/resources/grid-layout/example5.html b/resources/grid-layout/example5.html index 5cd76e70..b0fcf23a 100644 --- a/resources/grid-layout/example5.html +++ b/resources/grid-layout/example5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      Block A
      Block B
      @@ -34,4 +34,3 @@
      - diff --git a/resources/grid-layout/example6.html b/resources/grid-layout/example6.html index d21ebbf7..b170aa4e 100644 --- a/resources/grid-layout/example6.html +++ b/resources/grid-layout/example6.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      -
      -
      +
      +
      - diff --git a/resources/grid-layout/example7.html b/resources/grid-layout/example7.html index c4cde471..0d2a6f03 100644 --- a/resources/grid-layout/example7.html +++ b/resources/grid-layout/example7.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      A
      @@ -33,4 +33,3 @@
      - diff --git a/resources/grid-layout/example8.html b/resources/grid-layout/example8.html index 92404dba..763e38a3 100644 --- a/resources/grid-layout/example8.html +++ b/resources/grid-layout/example8.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      @@ -36,4 +36,3 @@
      - diff --git a/resources/grid-layout/example9.html b/resources/grid-layout/example9.html index 36463616..55bb85d7 100644 --- a/resources/grid-layout/example9.html +++ b/resources/grid-layout/example9.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      @@ -40,4 +40,3 @@
      - diff --git a/resources/hashchange/example1.html b/resources/hashchange/example1.html index 99625f2e..79c90af8 100644 --- a/resources/hashchange/example1.html +++ b/resources/hashchange/example1.html @@ -4,9 +4,9 @@ hashtag demo - - - + + + @@ -70,11 +70,11 @@ $(window).hashchange(); // To change src attribute of parent iframe element - $('.hashExLink').on('click', function() { + $('.hashExLink').on('click', function() { window.parent.document.getElementById( "hashtagIframe" ).src = "/resources/hashchange/example1.html" + $(this).attr( "href" ); window.parent.document.getElementById( "hashtagIframeLink" ).innerHTML = "example1.html" + $(this).attr( "href" ); }); - }); + }); \ No newline at end of file diff --git a/resources/header/example2.html b/resources/header/example2.html deleted file mode 100644 index 6a7a5125..00000000 --- a/resources/header/example2.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - Page Title - - - - - - - - - - -
      -
      - Cancel -

      Edit Contact

      - Save -
      -
      - - diff --git a/resources/header/example3.html b/resources/header/example3.html deleted file mode 100644 index 8be8f6ae..00000000 --- a/resources/header/example3.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - Page Title - - - - - - - - - - -
      -
      - Cancel -

      Edit Contact

      - Save -
      -
      - - diff --git a/resources/listview/example1.html b/resources/listview/example1.html index 684e0c7b..7a10bd81 100644 --- a/resources/listview/example1.html +++ b/resources/listview/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/listview/example10.html b/resources/listview/example10.html index 36494924..ac9512ea 100644 --- a/resources/listview/example10.html +++ b/resources/listview/example10.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/listview/example11.html b/resources/listview/example11.html index 020e7518..6f5ef42d 100644 --- a/resources/listview/example11.html +++ b/resources/listview/example11.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      + - diff --git a/resources/listview/example12.html b/resources/listview/example12.html index dd1f4d9c..5885ffe7 100644 --- a/resources/listview/example12.html +++ b/resources/listview/example12.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      + - diff --git a/resources/listview/example13.html b/resources/listview/example13.html index 932e18a0..976f112e 100644 --- a/resources/listview/example13.html +++ b/resources/listview/example13.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      + - diff --git a/resources/listview/example14.html b/resources/listview/example14.html index 610ca7ef..050b7bc5 100644 --- a/resources/listview/example14.html +++ b/resources/listview/example14.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Simple list

      @@ -45,7 +45,7 @@

      Count bubbles

    • Sent 328
    • Trash 62
    - +

    Numbered list

    1. The Godfather
    2. @@ -54,7 +54,7 @@

      Numbered list

    3. Pulp Fiction
    4. Schindler's List
    - +

    Formatted content

    - - - + + +

    Icon list

    - +

    Thumbnail, split button list

    - +

    Divided, filterable list

    • A
    • @@ -124,4 +124,3 @@

      Divided, filterable list

      - diff --git a/resources/listview/example15.html b/resources/listview/example15.html index 2da90a9e..222ab128 100644 --- a/resources/listview/example15.html +++ b/resources/listview/example15.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/listview/example16.html b/resources/listview/example16.html index ca4dc58a..3071df62 100644 --- a/resources/listview/example16.html +++ b/resources/listview/example16.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + + + - + - +
      -
      +
      • Animals

        All your favorites from aarkvarks to zebras.

        - +
        • Pets
          6 @@ -86,7 +86,7 @@

          Animals

          Colors

          Fresh colors from the magic rainbow.

          - +
          • Blue
          • Green
          • @@ -100,7 +100,7 @@

            Colors

          • Vehicles

            Everything from cars to planes.

            - + -
          • +
        @@ -157,4 +157,3 @@

        Vehicles

      - diff --git a/resources/listview/example3.html b/resources/listview/example3.html index d6c2b8a7..248c12fc 100644 --- a/resources/listview/example3.html +++ b/resources/listview/example3.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      1. The Godfather
      2. Inception
      3. @@ -55,4 +55,3 @@
      - diff --git a/resources/listview/example4.html b/resources/listview/example4.html index 210b2b97..d630331d 100644 --- a/resources/listview/example4.html +++ b/resources/listview/example4.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +

      Simple list

        @@ -44,7 +44,7 @@

        Count bubbles

      • Sent 328
      • Trash 62
      - +

      Numbered list

      1. The Godfather
      2. @@ -53,7 +53,7 @@

        Numbered list

      3. Pulp Fiction
      4. Schindler's List
      - +

      Divided, formatted content

      • @@ -69,10 +69,10 @@

        jQuery Team

        9:18AM

      - - - + + +

      Icon list

      • FranceFrance 4
      • @@ -82,7 +82,7 @@

        Icon list

      • NorwayNorway 328
      • United StatesUnited States 62
      - +

      Thumbnail list

        @@ -102,7 +102,7 @@

        Wolfgang Amadeus Phoenix

        Phoenix

      - +

      Divided, filterable list

      • A
      • @@ -121,4 +121,3 @@

        Divided, filterable list

      - diff --git a/resources/listview/example5.html b/resources/listview/example5.html index 3061734c..3217dbd3 100644 --- a/resources/listview/example5.html +++ b/resources/listview/example5.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      + - diff --git a/resources/listview/example6.html b/resources/listview/example6.html index ee57c7c6..bcef76d1 100644 --- a/resources/listview/example6.html +++ b/resources/listview/example6.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/listview/example7.html b/resources/listview/example7.html index 5eebe05e..d991792a 100644 --- a/resources/listview/example7.html +++ b/resources/listview/example7.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/listview/example8.html b/resources/listview/example8.html index a4cad644..3e5f62a7 100644 --- a/resources/listview/example8.html +++ b/resources/listview/example8.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/listview/example9.html b/resources/listview/example9.html index 4562f70a..e90c333d 100644 --- a/resources/listview/example9.html +++ b/resources/listview/example9.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      - diff --git a/resources/navbar/example1.html b/resources/navbar/example1.html index 7c3eb6f2..5d0d2c53 100644 --- a/resources/navbar/example1.html +++ b/resources/navbar/example1.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
      -
      +
      • One
      • diff --git a/resources/navbar/example10.html b/resources/navbar/example10.html index 820ef048..7c216381 100644 --- a/resources/navbar/example10.html +++ b/resources/navbar/example10.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
        -
        +
          diff --git a/resources/navbar/example11.html b/resources/navbar/example11.html index 848590ed..60c7b3b0 100644 --- a/resources/navbar/example11.html +++ b/resources/navbar/example11.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
          -
          +
            diff --git a/resources/navbar/example12.html b/resources/navbar/example12.html index fb0dda8f..a46fc651 100644 --- a/resources/navbar/example12.html +++ b/resources/navbar/example12.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
            -
            +
              diff --git a/resources/navbar/example13.html b/resources/navbar/example13.html index 3b53556b..85b0e3cc 100644 --- a/resources/navbar/example13.html +++ b/resources/navbar/example13.html @@ -1,13 +1,13 @@ - - - - Page Title + + + + Page Title - + - - - + + + - + - +
              -
              +