diff --git a/docs/_assets/js/_viewsource.js b/docs/_assets/js/_viewsource.js index bb5925e6..32b53e7b 100644 --- a/docs/_assets/js/_viewsource.js +++ b/docs/_assets/js/_viewsource.js @@ -2,14 +2,14 @@ $.fn.addSourceLink = function(style){ return $(this).each(function(){ - var link = $('View Source'), + var link = $('View Source'), src = src = $('
').append( $(this).clone() ).html(), - page = $( "
" + - "
" + - "Close"+ + page = $( "
" + + "
" + + "Close"+ "
jQuery Mobile Source Excerpt
"+ "
"+ - "
"+ + "
"+ "
" ) .appendTo( "body" ) .page(); @@ -21,7 +21,7 @@ $.fn.addSourceLink = function(style){ }) .click(function(){ var codeblock = $('
'); - src = src.replace(/&/gmi, '&').replace(/"/gmi, '"').replace(/>/gmi, '>').replace(//gmi, '>').replace(/Switch theme') + $('Switch theme') .buttonMarkup({ 'icon':'gear', 'inline': true, diff --git a/docs/about/features.html b/docs/about/features.html index a20603c7..80084232 100755 --- a/docs/about/features.html +++ b/docs/about/features.html @@ -27,7 +27,7 @@
  • Lightweight size (12k compressed for all mobile functionality) and minimal image dependencies for speed.
  • HTML5 Markup-driven configuration of pages and behavior for fast development and minimal required scripting.
  • Progressive enhancement approach brings core content and functionality to all mobile, tablet and desktop platforms and a rich, installed application-like experience on newer mobile platforms.
  • -
  • Automatic initialization by using HTML5 data-role attributes in the HTML markup to act as the trigger to automatically initialize all jQuery Mobile widgets found on a page.
  • +
  • Automatic initialization by using HTML5 data-role attributes in the HTML markup to act as the trigger to automatically initialize all jQuery Mobile widgets found on a page.
  • Accessibility features such as WAI-ARIA are also included to ensure that the pages work for screen readers (e.g. VoiceOver in iOS) and other assistive technologies.
  • New events streamline the process of supporting touch, mouse, and cursor focus-based user input methods with a simple API.
  • New plugins enhance native controls with touch-optimized, themable controls.
  • diff --git a/docs/api/globalconfig.html b/docs/api/globalconfig.html index 384baaac..3dcec879 100755 --- a/docs/api/globalconfig.html +++ b/docs/api/globalconfig.html @@ -69,6 +69,9 @@ $(document).bind("mobileinit", function(){

    The following defaults are configurable via the $.mobile object:

    +
    ns (string, default: "jq-"):
    +
    The namespaced used in data- attributes, for example, data-role. Can be set to anything, including a blank string.
    +
    subPageUrlKey (string, default: "ui-page"):
    The url parameter used for referencing widget-generated sub-pages (such as those generated by nested listviews). Translates to 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.
    diff --git a/docs/api/themes.html b/docs/api/themes.html index 6daf9e3e..b2b9feb6 100755 --- a/docs/api/themes.html +++ b/docs/api/themes.html @@ -55,7 +55,7 @@
    Bar E
    -

    By default, the framework assigns the "a" swatch to all headers and footers, because these are typically given high visual priority in an application. To set the color of a bar to a different swatch color, simply add the data-theme attribute to your header or footer and specify an alternate swatch letter ('b' or 'd', for example) and the specified theme swatch color will be applied. Learn more about toolbar theming.

    +

    By default, the framework assigns the "a" swatch to all headers and footers, because these are typically given high visual priority in an application. To set the color of a bar to a different swatch color, simply add the data-theme attribute to your header or footer and specify an alternate swatch letter ('b' or 'd', for example) and the specified theme swatch color will be applied. Learn more about toolbar theming.

    @@ -151,7 +151,7 @@

    This default behavior makes it easy to ripple a theme change through a page by setting a theme swatch on a parent because you know the buttons will maintain the same relative visual weight across themes. Since form elements use the button styles, they will also adapt to their parent container too.

    -

    If you want to add visual emphasis to a button and help it stand out visually from its parent toolbar, an alternate swatch color can be set by adding a data-theme="a" to the anchor. Once an alternate swatch color is set on a button in the markup, the framework won't override that color if the parent theme is changed, because you made a conscious decision to set it.

    +

    If you want to add visual emphasis to a button and help it stand out visually from its parent toolbar, an alternate swatch color can be set by adding a data-theme="a" to the anchor. Once an alternate swatch color is set on a button in the markup, the framework won't override that color if the parent theme is changed, because you made a conscious decision to set it.

    diff --git a/docs/buttons/buttons-grouped.html b/docs/buttons/buttons-grouped.html index 98599498..79f72b99 100755 --- a/docs/buttons/buttons-grouped.html +++ b/docs/buttons/buttons-grouped.html @@ -20,7 +20,7 @@
    -

    Occasionally, you may want to visually group a set of buttons together 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 together 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>
    diff --git a/docs/buttons/buttons-icons.html b/docs/buttons/buttons-icons.html
    index 492ab8b3..7b30d460 100755
    --- a/docs/buttons/buttons-icons.html
    +++ b/docs/buttons/buttons-icons.html
    @@ -25,10 +25,10 @@
     		

    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:

    +

    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> + <a href="index.html" data-role="button" data-icon="delete">Delete</a>

    Creates this button with an icon:

    @@ -36,7 +36,7 @@

    Icon set

    -

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

    +

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

    Left arrow - data-icon="arrow-l"

    My button @@ -80,7 +80,7 @@

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

    Delete -

    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:

    +

    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> @@ -89,13 +89,13 @@

    Creates this button with right-aligned icon:

    Delete -

    Icons can also be positioned above the text by specifying data-iconpos="top"

    +

    Icons can also be positioned above the text by specifying data-iconpos="top"

    Delete -

    Or icons can also be positioned below the text by specifying data-iconpos="bottom"

    +

    Or icons can also be positioned below the text by specifying data-iconpos="bottom"

    Delete -

    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":

    +

    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> @@ -105,7 +105,7 @@ Delete

    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. You can then write a CSS rule that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.

    +

    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. You can then write a CSS rule that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.

    Icons and themes

    diff --git a/docs/buttons/buttons-inline.html b/docs/buttons/buttons-inline.html index 4ea75ac0..0d0f76fc 100755 --- a/docs/buttons/buttons-inline.html +++ b/docs/buttons/buttons-inline.html @@ -26,12 +26,12 @@ 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:

    +

    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:

    Button -

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

    +

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

    
     <div data-inline="true">
    diff --git a/docs/buttons/buttons-themes.html b/docs/buttons/buttons-themes.html
    index 270c3c63..ff874b2e 100755
    --- a/docs/buttons/buttons-themes.html
    +++ b/docs/buttons/buttons-themes.html
    @@ -32,13 +32,13 @@
     			

    E swatch

    Button

    Assigning theme swatches

    -

    Button 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.

    +

    Button 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">Theme a</a>			
     
    -

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

    +

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

    Theme a Theme b diff --git a/docs/buttons/buttons-types.html b/docs/buttons/buttons-types.html index 2f032dc1..4a369ddf 100755 --- a/docs/buttons/buttons-types.html +++ b/docs/buttons/buttons-types.html @@ -25,7 +25,7 @@

    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" to the link. The framework will add all necessary classes to style the link as a button. For example, this markup:

    +

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

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

    Form buttons

    -

    For ease of styling, the framework automatically converts any button element or input with a type of submit, reset, button, or image into a custom styled link-based button — there is no need to add the data-role="button" attribute.

    +

    For ease of styling, the framework automatically converts any button element or input with a type of submit, reset, button, or image into a custom styled link-based button — there is no need to add the data-role="button" attribute.

    The original form-based button is hidden, but remains in the markup. When a click event fires on a link button, it triggers a click on the original form button.

    diff --git a/docs/content/content-collapsible.html b/docs/content/content-collapsible.html index 3358deb0..d68cf14d 100755 --- a/docs/content/content-collapsible.html +++ b/docs/content/content-collapsible.html @@ -23,7 +23,7 @@

    Collapsible content markup

    -

    To create a collapsible blocks of content, create a container and add the data-role="collapsible" attribute.

    +

    To create a collapsible blocks of content, create a container and add the data-role="collapsible" attribute.

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

    diff --git a/docs/content/content-themes.html b/docs/content/content-themes.html index 519177c9..76e9f38e 100755 --- a/docs/content/content-themes.html +++ b/docs/content/content-themes.html @@ -23,16 +23,16 @@

    Theming the content area

    -

    The main content area of a page (container with the data-role="content" attribute) should be themed by adding the data-theme attribute to the data-role="page" container to ensure that the background colors are applied to the full page, regardless of the content length. (If you add to the data-theme to the content container, the background color will stop after the content so there may be a gap in color between the content and fixed footer.)

    +

    The main content area of a page (container with the data-role="content" attribute) should be themed by adding the data-theme attribute to the data-role="page" container to ensure that the background colors are applied to the full page, regardless of the content length. (If you add to the data-theme to the content container, the background color will stop after the content so there may be a gap in color between the content and fixed footer.)

    -<div data-role="page" data-theme="a"> +<div data-role="page" data-theme="a">

    Theming collapsible blocks

    -

    To set the color of the collapsible header, add the data-theme attribute to the collapsible container. The icon and body are not currently themable through data attributes, but can be styled directly with custom css.

    +

    To set the color of the collapsible header, add the data-theme attribute to the collapsible container. The icon and body are not currently themable through data attributes, but can be styled directly with custom css.

    -<div data-role="collapsible" data-collapsed="true" data-theme="a"> +<div data-role="collapsible" data-collapsed="true" data-theme="a">

    Themed examples

    @@ -41,8 +41,8 @@

    H1 Heading

    This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

    -

    I'm a themed collapsible

    -

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    +

    I'm an themed collapsible

    +

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    @@ -51,8 +51,8 @@

    H1 Heading

    This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

    -

    I'm a themed collapsible

    -

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    +

    I'm an themed collapsible

    +

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    @@ -61,8 +61,8 @@

    H1 Heading

    This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

    -

    I'm a themed collapsible

    -

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    +

    I'm an themed collapsible

    +

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    @@ -71,8 +71,8 @@

    H1 Heading

    This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

    -

    I'm a themed collapsible

    -

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    +

    I'm an themed collapsible

    +

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    @@ -81,8 +81,8 @@

    H1 Heading

    This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

    -

    I'm a themed collapsible

    -

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    +

    I'm an themed collapsible

    +

    I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

    diff --git a/docs/forms/docs-forms.html b/docs/forms/docs-forms.html index 69bcd761..9ee09e87 100755 --- a/docs/forms/docs-forms.html +++ b/docs/forms/docs-forms.html @@ -41,10 +41,10 @@

    By default, jQuery Mobile will automatically enhance certain native form controls into rich touch-friendly components. This is handled internally by finding form elements by tag name and running a plugin method on them, so for instance, a select element will be found and initialized with the "selectmenu" plugin, while an input element with a type="checkbox" will be enhanced with the "checkboxradio" plugin. Once initialized, you can address these enhanced components programmatically through their jQuery UI widget API methods (see documentation on available methods here: Form Plugin Methods).

    Preventing auto-initialization of form elements

    -

    If you'd prefer that a particular form control be left untouched by jQuery Mobile, simply give that element the attribute data-role="none". For example:

    +

    If you'd prefer that a particular form control be left untouched by jQuery Mobile, simply give that element the attribute data-role="none". For example:

    
     <label for="foo">
    -<select name="foo" id="foo" data-role="none">
    +<select name="foo" id="foo"  data-role="none">
     	<option value="a" >A</option>
     	<option value="b" >B</option>
     	<option value="c" >C</option>
    @@ -69,7 +69,7 @@ $(document).bind('mobileinit',function(){
     
     			

    Field containers

    -

    To improve the styling to labels and form elements on wider screens, we recommend wrapping a div or fieldset with the data-role="fieldcontain" attribute around each label/form element. The framework will add a thin vertical bottom border on this container to act as a field separator and visually align the label and form elements for quick scanning.

    +

    To improve the styling to labels and form elements on wider screens, we recommend wrapping a div or fieldset with the data-role="fieldcontain" attribute around each label/form element. The framework will add a thin vertical bottom border on this container to act as a field separator and visually align the label and form elements for quick scanning.

    
     <div data-role="fieldcontain">
    @@ -78,7 +78,7 @@ $(document).bind('mobileinit',function(){
     

    Refreshing form elements

    - +

    Every form control -- where applicable -- has a refresh method. Here are some examples:

    Checkboxes:

    @@ -113,7 +113,7 @@ myswitch .slider("refresh");

    We're considering adding a refresh method to forms to let the framework refresh all the individual elemnts withing but that is a future enhancement.

    - + diff --git a/docs/forms/forms-checkboxes.html b/docs/forms/forms-checkboxes.html index b1ad8409..6bef6605 100755 --- a/docs/forms/forms-checkboxes.html +++ b/docs/forms/forms-checkboxes.html @@ -30,9 +30,9 @@

    To create a single checkbox, add an input with a type="checkbox" attribute and a corresponding label. Set the for attribute of the label to match the ID of the input so they are semantically associated.

    -

    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.

    +

    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.

    -

    Lastly, need to wrap the fieldset in a div with data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

    +

    Lastly, need to wrap the fieldset in a div with data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

    	
    @@ -55,7 +55,7 @@
     		
     		

    Vertically grouped checkboxes

    -

    Typically, there are multiple checkboxes listed under a question title. To visually integrate multiple checkboxes into a 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 fie.

    +

    Typically, there are multiple checkboxes listed under a question title. To visually integrate multiple checkboxes into a 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 fie.

    diff --git a/docs/forms/forms-radiobuttons.html b/docs/forms/forms-radiobuttons.html index f6412595..889f6c82 100755 --- a/docs/forms/forms-radiobuttons.html +++ b/docs/forms/forms-radiobuttons.html @@ -34,7 +34,7 @@

    Because radio buttons use the label element for the text displayed next to the checkbox form element, we recommend wrapping the radio buttons in a fieldset element that has a legend which acts as the title for the question.

    -

    Lastly, need to wrap the fieldset in a div with data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

    +

    Lastly, need to wrap the fieldset in a div with 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">
    @@ -55,7 +55,7 @@
     </div>
     
    -

    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 fie.

    +

    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 fie.

    diff --git a/docs/forms/forms-search.html b/docs/forms/forms-search.html index a1fdb472..4806c525 100755 --- a/docs/forms/forms-search.html +++ b/docs/forms/forms-search.html @@ -25,7 +25,7 @@

    Search inputs

    Search inputs are a new HTML type that is styled with pill-shaped corners and adds a "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 and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    +

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

    	
     <div data-role="fieldcontain">
    diff --git a/docs/forms/forms-selects.html b/docs/forms/forms-selects.html
    index 448d31e5..d4c74539 100644
    --- a/docs/forms/forms-selects.html
    +++ b/docs/forms/forms-selects.html
    @@ -29,7 +29,7 @@
     			
     			

    When the select button is clicked, the native select menu picker for the OS will open. When a value is selected in the menu, the custom select button is updated to match the new selection.

    -

    To add a select widget 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. Wrap them in a div with the data-role="fieldcontain" attribute to help visually group it in a longer form.

    +

    To add a select widget 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. Wrap them in a div with the data-role="fieldcontain" attribute to help visually group it in a longer form.

    The framework will find all select elements and automatically enhance them into the custom select menus.

    diff --git a/docs/forms/forms-slider.html b/docs/forms/forms-slider.html index 9fb00f14..867af6f4 100755 --- a/docs/forms/forms-slider.html +++ b/docs/forms/forms-slider.html @@ -25,7 +25,7 @@

    Sliders

    To add a slider widget to your page, start with an input with a new HTML5 type="range" attribute. Specify the value (current value), min and max attribute values to configure the slider. The framework will parse these attributes to configure the slider.

    -

    As you drag the slider, the input will update and vice-versa so they are always in sync so you can submit the slider value with form in a simple way. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    +

    As you drag the slider, the input will update and vice-versa so they are always in sync so you can submit the slider value with form in a simple way. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    
     <div data-role="fieldcontain">
    diff --git a/docs/forms/forms-switch.html b/docs/forms/forms-switch.html
    index aaab20cf..0aa25e2f 100755
    --- a/docs/forms/forms-switch.html
    +++ b/docs/forms/forms-switch.html
    @@ -24,7 +24,7 @@
     
     				

    Flip toggle switches

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

    -

    To create a flip toggle, To add a slider widget to your page, start with an select with two options. The first option will be styled as the "on" state switch and the second will be styled as the "off" state so write your options in the correct order. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    +

    To create a flip toggle, To add a slider widget to your page, start with an select with two options. The first option will be styled as the "on" state switch and the second will be styled as the "off" state so write your options in the correct order. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    	
     <div data-role="fieldcontain">
    diff --git a/docs/forms/forms-text.html b/docs/forms/forms-text.html
    index eef99272..acad3837 100755
    --- a/docs/forms/forms-text.html
    +++ b/docs/forms/forms-text.html
    @@ -27,7 +27,7 @@
     			

    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.

    Text inputs

    -

    To collect standard alphanmeric text, use an input with a type="text" attribute. It's important to set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    +

    To collect standard alphanmeric text, use an input with a type="text" attribute. It's important to set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    	
     <div data-role="fieldcontain">
    @@ -45,7 +45,7 @@
     			
     			
     			

    Password inputs

    -

    For password fields, use an input with a type="password" attribute. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    +

    For password fields, use an input with a type="password" attribute. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

    	
     <div data-role="fieldcontain">
    @@ -87,7 +87,7 @@
     
     			

    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 which is very hard to use on a mobile device.

    -

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

    +

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

    	
     <div data-role="fieldcontain">
    diff --git a/docs/forms/forms-themes.html b/docs/forms/forms-themes.html
    index 42992d4d..daf29b8f 100755
    --- a/docs/forms/forms-themes.html
    +++ b/docs/forms/forms-themes.html
    @@ -22,9 +22,9 @@
     	

    Form themes

    -

    jQuery Mobile has a rich theming system that gives you full control of how pages and forms are styled. By default all form elements inside a container will automaticlaly adopt the same theme color swatch as their parent. This allows form elements to blend into their layouts with minimal work. The data-theme attribute can be applied any individual form element to apply any of the lettered theme color swatches to create contrast and emphasis in your designs.

    +

    jQuery Mobile has a rich theming system that gives you full control of how pages and forms are styled. By default all form elements inside a container will automaticlaly adopt the same theme color swatch as their parent. This allows form elements to blend into their layouts with minimal work. The data-theme attribute can be applied any individual form element to apply any of the lettered theme color swatches to create contrast and emphasis in your designs.

    -

    All the form elements in the examples below use the same HTML code with no theme swatch specified on the individual form elements. The only difference between each example block code is a data-theme swatch color assigned to each parent container. This illustrates the way form elements automatically adopt the theme swatch of their parent.

    +

    All the form elements in the examples below use the same HTML code with no theme swatch specified on the individual form elements. The only difference between each example block code is a data-theme swatch color assigned to each parent container. This illustrates the way form elements automatically adopt the theme swatch of their parent.

    Body swatch A

    diff --git a/docs/lists/docs-lists.html b/docs/lists/docs-lists.html index 69eefef5..b9c048ea 100755 --- a/docs/lists/docs-lists.html +++ b/docs/lists/docs-lists.html @@ -21,7 +21,7 @@

    Basic linked lists

    -

    A list view 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 list view 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. Here is the HTML markup for a basic linked list.

    +

    A list view 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 list view 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. Here is the HTML markup for a basic linked list.

    
     <ul data-role="listview" data-theme="g">
    @@ -35,7 +35,7 @@
     			
     			

    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 generate a new ui-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 level deep and all pages and linking will be automatically handled by the framework.

    -

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

    +

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

    Nested list example

    Numbered lists

    @@ -56,7 +56,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 body swatch "b" by default (light gray in the default theme) but you can specify a theme for dividers by adding the data-dividertheme 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 body swatch "b" by default (light gray in the default theme) but you can specify a theme for dividers by adding the data-dividertheme attribute to the list element (ul or ol) and specifying a theme swatch letter.

    List divider example @@ -84,7 +84,7 @@ List with icon images

    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.

    Inset list example diff --git a/docs/lists/lists-themes.html b/docs/lists/lists-themes.html index c896193b..396e9d5e 100755 --- a/docs/lists/lists-themes.html +++ b/docs/lists/lists-themes.html @@ -35,7 +35,7 @@

    Theming list items

    -

    The list item color scheme can be changed to any button color theme swatch by adding the data-theme attribute to the list, and setting the letter theme swatch. Here is the same list above with the "a" swatch applied.

    +

    The list item color scheme can be changed to any button color theme swatch by adding the data-theme attribute to the list, and setting the letter theme swatch. Here is the same list above with the "a" swatch applied.

    <ul data-role="listview" data-inset="true" data-theme="d"> @@ -48,7 +48,7 @@
  • Sent 328
  • -

    Data-theme attributes also work at the LI-level, for styling a single item.

    +

    data-theme attributes also work at the LI-level, for styling a single item.

    • Divider
    • @@ -90,7 +90,7 @@

      Theming icons

      -

      The default icon for each list item is arrow-r. To override this, set the data-icon attribute on the desired list item to the name of a standard icon. To prevent icons from appearing altogether, set the data-icon attribute to "false".

      +

      The default icon for each list item is arrow-r. To override this, set the data-icon attribute on the desired list item to the name of a standard icon. To prevent icons from appearing altogether, set the data-icon attribute to "false".

       
       <li data-icon="info"><a href="#">Notices</a></li>
      @@ -127,7 +127,7 @@
       
       <ul data-role="listview" data-inset="true" data-splittheme="a">
       
      -		

      To specify the color swatch for the icon button on the right, add the data-splittheme to the list and specify a swatch letter. This attribute can also be added to individual split inside list items by adding a data-theme attribute to specific links (see second list item).

      +

      To specify the color swatch for the icon button on the right, add the data-splittheme to the list and specify a swatch letter. This attribute can also be added to individual split inside list items by adding a data-theme attribute to specific links (see second list item).

      • @@ -143,7 +143,7 @@
      -

      The icon for the split theme can set at the list level by adding the data-spliticon to the list and specifying a standard icon. This attribute can also be added to individual split inside list items by adding a data-icon attribute to specific links (see second list item).

      +

      The icon for the split theme can set at the list level by adding the data-spliticon to the list and specifying a standard icon. This attribute can also be added to individual split inside list items by adding a data-icon attribute to specific links (see second list item).

      <ul data-role="listview" data-inset="true" data-splittheme="a" data-spliticon="plus"> diff --git a/docs/pages/docs-link-scenarios.html b/docs/pages/docs-link-scenarios.html index 6603c9cb..1fe79308 100755 --- a/docs/pages/docs-link-scenarios.html +++ b/docs/pages/docs-link-scenarios.html @@ -27,7 +27,7 @@
    • [href="docs/pages/index.html"]
    • [href="/docs/toolbars/index.html"]
    • [href="#somelocalID"]
    • -
    • Note: a full URL to the same-domain will also work
    • +
    • Note: an full URL to the same-domain will also work
    • Examples of links that trigger a refresh
    • [data-ajax="false"]
    • [rel="external"]
    • diff --git a/docs/pages/docs-links.html b/docs/pages/docs-links.html index ed33044e..3a2047b5 100755 --- a/docs/pages/docs-links.html +++ b/docs/pages/docs-links.html @@ -36,7 +36,7 @@

      Local, internal linked "pages"

      -

      A single HTML document can contain either a single 'page' or multiple 'pages' can be assembled and loaded together by stacking multiple divs with a data-role of "page". This allows you to build a small site or application within a single HTML document; jQuery Mobile will simply display the first 'page' it finds in the source order when the page loads.

      +

      A single HTML document can contain either a single 'page' or multiple 'pages' can be assembled and loaded together by stacking multiple divs with a data-role of "page". This allows you to build a small site or application within a single HTML document; jQuery Mobile will simply display the first 'page' it finds in the source order when the page loads.

      If a link points to an anchor (#foo), the framework will looks for a page with that ID. If it finds a page in the HTML document, it will transition the new page into view.

      @@ -44,16 +44,16 @@
       
      -<div data-role="page" id="foo"> - <div data-role="content"> +<div data-role="page" id="foo"> + <div data-role="content"> I'm the "foo" page. Since I'm the first page in the source order, I will be displayed onLoad. <a href="#bar">Visit the bar "page"</a> </div><!-- /content --> </div><!-- /foo page --> -<div data-role="page" id="bar"> - <div data-role="content"> +<div data-role="page" id="bar"> + <div data-role="content"> I'm the "bar" page. I will be shown only if the anchor link on the <a href="#foo">foo</a> page is clicked. diff --git a/docs/pages/docs-navmodel.html b/docs/pages/docs-navmodel.html index 64027322..1eb3a683 100644 --- a/docs/pages/docs-navmodel.html +++ b/docs/pages/docs-navmodel.html @@ -22,7 +22,7 @@

      jQuery Mobile's navigation model

      -

      A "page" in jQuery Mobile consists of an element (usually a div) with a data-role attribute set to "page", which generally contains div elements with roles of "header", "content", and "footer", each containing common markup, forms, and custom jQuery Mobile widgets.

      +

      A "page" in jQuery Mobile consists of an element (usually a div) with a data-role attribute set to "page", which generally contains div elements with roles of "header", "content", and "footer", each containing common markup, forms, and custom jQuery Mobile widgets.

      The basic workflow with page loading is as follows: first, a page is requested with a normal HTTP request, and subsequent "pages" are then requested and injected into that page's DOM. Because of this, the DOM may have a number of "pages" in it at a time, each of which can be re-visited by linking to its data-url attribute.

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

      Some plugins may choose to dynamically break a page's content into separate navigable pages, which can then be reached via deep links. One example of this would be the Listview plugin, which will break a nested UL (or OL) into separate pages, which are each given a data-url attribute so they can be linked to like any normal "page" in jQuery Mobile. However, in order to link to these pages, the page that generates them must first be requested from the server. To make this work, pages that are auto-generated by plugins use the following special data-url structure: <div data-url="page.html&subpageidentifier">

      -

      So, for example, a page generated by the listview plugin may have a data-url attribute like this: data-url="artists.html&ui-page=listview-1"

      +

      So, for example, a page generated by the listview plugin may have an data-url attribute like this: data-url="artists.html&ui-page=listview-1"

      When a page is requested, jQuery Mobile knows to split the URL at "&ui-page" and make an HTTP request to the portion of the URL before that key. In the case of the listview example mentioned above, the URL would look like this: http://example.com/artists.html&ui-page=listview-1 ...and jQuery Mobile would request artists.html, which would then generate its sub-pages, creating the div with data-url="artists.html&ui-page=listview-1", which it will then display as the active page.

      diff --git a/docs/pages/docs-pages.html b/docs/pages/docs-pages.html index 28498e80..393973d6 100755 --- a/docs/pages/docs-pages.html +++ b/docs/pages/docs-pages.html @@ -45,10 +45,10 @@ </html>
      -

      Inside the <body> tag, each view or "page" on the mobile device is identified with an element (usually a div) with the data-role="page" attribute:

      +

      Inside the <body> tag, each view or "page" on the mobile device is identified with an element (usually a div) with the data-role="page" attribute:

      -
      <div data-role="page"> 
      +
      <div  data-role="page"> 
       	...
       </div> 
       
      @@ -57,10 +57,10 @@

      Within the "page" container, any valid HTML markup can be used, but for typical pages in jQuery Mobile, the immediate children of a "page" are divs with data-roles of "header", "content", and "footer".

      -
      <div data-role="page"> 
      -	<div data-role="header">...</div> 
      -	<div data-role="content">...</div> 
      -	<div data-role="footer">...</div> 
      +
      <div  data-role="page"> 
      +	<div  data-role="header">...</div> 
      +	<div  data-role="content">...</div> 
      +	<div  data-role="footer">...</div> 
       </div> 
       
      @@ -114,7 +114,7 @@

      Local, internal linked "pages"

      -

      A single HTML document can contain multiple 'pages' that are loaded together by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID (id="foo") that will be used to link internally between 'pages' (href="#foo"). When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view.

      +

      A single HTML document can contain multiple 'pages' that are loaded together by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID (id="foo") that will be used to link internally between 'pages' (href="#foo"). When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view.

      It's important to note if you are linking from a mobile page that was loaded via Ajax to a page with multiple internal pages, you need to add a rel="external" or data-ajax="false" to the link. This tells the framework to do a full page reload to clear out the Ajax hash in the URL. This is critical because Ajax pages use the hash (#) to track the Ajax history, while multiple internal pages use the hash to indicate internal pages so there will be a conflicts.

      For example, a link to a page containing multiple internal pages would look like this:

      diff --git a/docs/pages/pages-themes.html b/docs/pages/pages-themes.html index 9fbe063e..eaebff07 100755 --- a/docs/pages/pages-themes.html +++ b/docs/pages/pages-themes.html @@ -25,7 +25,7 @@

      jQuery Mobile has a rich theming system that gives you full control of how pages are styled. There is detailed theming documentation within each page widget, but let's look at a few high-level examples of how theming is applied.

      -

      The data-theme attribute can be applied to the header and footer containers to apply any of the lettered theme color swatches. While the data-theme attribute could be added to the content container, we recommend adding it instead to div or container that has been assigned the data-role="page" attribute to ensure that the background color is applied to the full page.

      +

      The data-theme attribute can be applied to the header and footer containers to apply any of the lettered theme color swatches. While the data-theme attribute could be added to the content container, we recommend adding it instead to div or container that has been assigned the data-role="page" attribute to ensure that the background color is applied to the full page.

      The default Theme mixes styles from multiple swatches to create visual texture and present the various elements in optimal contrast to one another:

      diff --git a/docs/toolbars/bars-fullscreen.html b/docs/toolbars/bars-fullscreen.html index cf3ecb3b..da802532 100755 --- a/docs/toolbars/bars-fullscreen.html +++ b/docs/toolbars/bars-fullscreen.html @@ -23,7 +23,7 @@

      This page demonstrates the "fullscreen" toolbar mode. This toolbar treatment is used in special cases where you want the content to fill the whole screen, and you want the header and footer toolbars to appear and disappear when the page is clicked responsively — a common scenario for photo, image or video viewers.

      -

      To enable this toolbar feature type, you apply a data-fullscreen="true" attribute to the div contain that has the attribute data-role="page", and the data-position="fixed" attribute to both the header and footer div elements.

      +

      To enable this toolbar feature type, you apply a data-fullscreen="true" attribute to the div contain that has the attribute data-role="page", and the data-position="fixed" attribute to both the header and footer div elements.

      Keep in mind that the toolbars in this mode will sit over page content, so not all content will be accessible with the toolbars open, just as shown in this demo.

      diff --git a/docs/toolbars/bars-themes.html b/docs/toolbars/bars-themes.html index e489b7f2..0fd78a11 100755 --- a/docs/toolbars/bars-themes.html +++ b/docs/toolbars/bars-themes.html @@ -25,11 +25,11 @@

      Theming headers and footers

      -

      To set the header or footer bars to a different color in your theme, add the data-theme attribute and specify the letter of the theme swatch (a, b, c, etc.). For example, this will set the bar to swatch "b" (blue in the default theme):

      +

      To set the header or footer bars to a different color in your theme, add the data-theme attribute and specify the letter of the theme swatch (a, b, c, etc.). For example, this will set the bar to swatch "b" (blue in the default theme):

      -<div data-role="header" data-theme="b"> 
      +<div  data-role="header"  data-theme="b"> 
       	<h1>Page Title</h1> 
       </div> 
       
      @@ -38,11 +38,11 @@

      Theming buttons in toolbars

      -

      Any link added inside the header block will be automatically styled as a button that matches the color of the bar's theme swatch. To make a button stand out as a primary call to action, the data-theme attribute can be used to specify a contrasting button color from a different theme swatch. For example, if we set the header to theme "c" (light gray), both buttons would be styled as the "c" button by default. If we wanted the Save button to visually pop, we can override the color by setting the data-theme attribute to "b" (blue in our default theme) on the Save button's anchor.

      +

      Any link added inside the header block will be automatically styled as a button that matches the color of the bar's theme swatch. To make a button stand out as a primary call to action, the data-theme attribute can be used to specify a contrasting button color from a different theme swatch. For example, if we set the header to theme "c" (light gray), both buttons would be styled as the "c" button by default. If we wanted the Save button to visually pop, we can override the color by setting the data-theme attribute to "b" (blue in our default theme) on the Save button's anchor.

      -<a href="add-user.php" data-theme="b">Save</a> 
      +<a href="add-user.php"  data-theme="b">Save</a> 
       
      diff --git a/docs/toolbars/docs-footers.html b/docs/toolbars/docs-footers.html index b25a74fd..d46a151b 100755 --- a/docs/toolbars/docs-footers.html +++ b/docs/toolbars/docs-footers.html @@ -22,11 +22,11 @@

      Footer bar structure

      -

      The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.

      +

      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"> 
      +<div  data-role="footer"> 
       	<h4>Footer content</h4> 
       </div> 
       
      @@ -69,7 +69,7 @@ Down
      -

      To group buttons together into a button set, wrap the links in a wrapper with data-role="controlgroup" and data-type="horizontal" attributes.

      +

      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"> diff --git a/docs/toolbars/docs-headers.html b/docs/toolbars/docs-headers.html index c3e96a48..494d34d8 100755 --- a/docs/toolbars/docs-headers.html +++ b/docs/toolbars/docs-headers.html @@ -27,7 +27,7 @@
      -<div data-role="header"> 
      +<div  data-role="header"> 
       	<h1>Page Title</h1> 
       </div> 
       
      @@ -71,7 +71,7 @@

      Edit Contact

      Save
      -

      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.

      +

      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" data-position="inline">
      diff --git a/docs/toolbars/docs-navbar.html b/docs/toolbars/docs-navbar.html
      index 11dda5a1..fe115a09 100755
      --- a/docs/toolbars/docs-navbar.html
      +++ b/docs/toolbars/docs-navbar.html
      @@ -24,7 +24,7 @@
       	
       	

      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.

      -

      A navbar is coded as an unordered list of links wrapped in a container element that has the data-role="navbar" attribute. To set one of links to the active (selected) state, add class="ui-btn-active" to the anchor. In this example, we have a two-button navbar in the footer with the "One" item set to active:

      +

      A navbar is coded as an unordered list of links wrapped in a container element that has the data-role="navbar" attribute. To set one of links to the active (selected) state, add class="ui-btn-active" to the anchor. In this example, we have a two-button navbar in the footer with the "One" item set to active:

      
       <div data-role="footer">
      @@ -135,7 +135,7 @@
       	
       	

      Icons in navbars

      -

      Icons can be added to navbar items by adding the data-icon attribute specifying a standard mobile icon to each anchor.

      +

      Icons can be added to navbar items by adding the data-icon attribute specifying a standard mobile icon to each anchor.

      @@ -147,7 +147,7 @@
      -

      Icons can be stacked above the labels by adding the data-iconpos="top" attribute to each anchor.

      +

      Icons can be stacked above the labels by adding the data-iconpos="top" attribute to each anchor.

      @@ -192,7 +192,7 @@

      Theming navbars

      -

      Navbars can be set to any theme color by data-theme attribute to the links and specifying any theme swatch.

      +

      Navbars can be set to any theme color by data-theme attribute to the links and specifying any theme swatch.

      diff --git a/experiments/scrollview/jquery.mobile.scrollview.js b/experiments/scrollview/jquery.mobile.scrollview.js index 15b17668..b29b1d25 100644 --- a/experiments/scrollview/jquery.mobile.scrollview.js +++ b/experiments/scrollview/jquery.mobile.scrollview.js @@ -741,7 +741,7 @@ jQuery.widget( "mobile.scrolllistview", jQuery.mobile.scrollview, { // XXX: Note that we need to update this cache if we ever support lists // that can dynamically update their content. - this._$dividers = this._$view.find("[data-role=list-divider]"); + this._$dividers = this._$view.find("[data-"+ $.mobile.ns +"role=list-divider]"); this._lastDivider = null; }, diff --git a/experiments/scrollview/scrollview.js b/experiments/scrollview/scrollview.js index f14c03c1..013dd56c 100644 --- a/experiments/scrollview/scrollview.js +++ b/experiments/scrollview/scrollview.js @@ -10,19 +10,19 @@ function ResizePageContentHeight(page) $content.height(wh - (hh + fh) - (pt + pb)); } -$("[data-role=page]").live("pageshow", function(event) { +$("[data-"+ $.mobile.ns +"role=page]").live("pageshow", function(event) { var $page = $(this); // For the demos that use this script, we want the content area of each // page to be scrollable in the 'y' direction. - $page.find(".ui-content").attr("data-scroll", "y"); + $page.find(".ui-content").attr("data-"+ $.mobile.ns +"scroll", "y"); // This code that looks for [data-scroll] will eventually be folded // into the jqm page processing code when scrollview support is "official" // instead of "experimental". - $page.find("[data-scroll]:not(.ui-scrollview-clip)").each(function(){ + $page.find("[data-"+ $.mobile.ns +"scroll]:not(.ui-scrollview-clip)").each(function(){ var $this = $(this); // XXX: Remove this check for ui-scrolllistview once we've // integrated list divider support into the main scrollview class. diff --git a/experiments/scrollview/sv-test-02.html b/experiments/scrollview/sv-test-02.html index f4c65d06..e2f9d355 100644 --- a/experiments/scrollview/sv-test-02.html +++ b/experiments/scrollview/sv-test-02.html @@ -25,7 +25,7 @@ -
      -
      +
      +

      Event Logger

      -
      +

      Touch events on this page will log out below, prepending to the top as they arrive.

      -
        +
        diff --git a/tests/speed/basic-page.html b/tests/speed/basic-page.html index 3a8846d3..a143cc0e 100644 --- a/tests/speed/basic-page.html +++ b/tests/speed/basic-page.html @@ -31,11 +31,11 @@ -
        -
        +
        +

        Basic Page

        -
        +

        Cras justo odio, dapibus ac facilisis in, egestas eget quam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Vestibulum id ligula porta felis euismod semper. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam.

        Aenean lacinia bibendum nulla sed consectetur. Sed posuere consectetur est at lobortis. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.

        diff --git a/tests/speed/lists-ul.html b/tests/speed/lists-ul.html index d4b27b69..052c7228 100755 --- a/tests/speed/lists-ul.html +++ b/tests/speed/lists-ul.html @@ -10,15 +10,15 @@ -
        +
        -
        +

        400 item list

        -
        +
        -
          +
          • Acura
          • Audi
          • BMW
          • diff --git a/tests/unit/checkboxradio/index.html b/tests/unit/checkboxradio/index.html index 3117aa6e..b62c6996 100644 --- a/tests/unit/checkboxradio/index.html +++ b/tests/unit/checkboxradio/index.html @@ -5,9 +5,11 @@ jQuery Mobile Page Test Suite + + @@ -22,14 +24,14 @@
            -
            -
            -
            -
            +
            +
            +
            +
            Agree to the terms: -
            +
            diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 1602cbc1..93b6a993 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -4,13 +4,20 @@ (function($){ var libName = "jquery.mobile.core.js", - setGradeA = function(value, version) { \ + setGradeA = function(value, version) { $.support.mediaquery = value; $.mobile.browser.ie = version; }, extendFn = $.extend; module(libName, { + setup: function(){ + // NOTE reset for gradeA tests + $('html').removeClass('ui-mobile'); + + // NOTE reset for pageLoading tests + $('.ui-loader').remove(); + }, teardown: function(){ $.extend = extendFn; } diff --git a/tests/unit/core/index.html b/tests/unit/core/index.html index d1456396..016ca35a 100644 --- a/tests/unit/core/index.html +++ b/tests/unit/core/index.html @@ -6,10 +6,10 @@ jQuery Mobile Core Test Suite + - @@ -25,7 +25,7 @@
            -
            +
            diff --git a/tests/unit/dialog/index.html b/tests/unit/dialog/index.html index cfa3cf6c..b53f510a 100644 --- a/tests/unit/dialog/index.html +++ b/tests/unit/dialog/index.html @@ -6,6 +6,7 @@ jQuery Mobile Dialog Test Suite + @@ -24,12 +25,12 @@
            -
            - +
            +
            -
            -
            +
            +

            Dialog

            foo diff --git a/tests/unit/event/event_core.js b/tests/unit/event/event_core.js index 1f48366e..07ab00a6 100644 --- a/tests/unit/event/event_core.js +++ b/tests/unit/event/event_core.js @@ -12,14 +12,17 @@ module(libName, { teardown: function(){ - $.each(events, function(i, name){ - $("#qunit-fixture").unbind(name); - }); - $($.event.special.scrollstart).unbind("scrollstart"); - $($.event.special.tap).unbind("tap"); - $($.event.special.tap).unbind("taphold"); - $($.event.special.swipe).unbind("swipe"); + // ensure bindings are removed + $.each(events, function(i, name){ + $.each([$("#qunit-fixture"), + $($.event.special.scrollstart), + $($.event.special.tap), + $($.event.special.tap), + $($.event.special.swipe)], function(j, obj){ + obj.unbind(name); + }); + }); //NOTE unmock Math.abs = absFn; @@ -43,24 +46,28 @@ }); }); - test( "defined event functions bind a closure when passed", function(){ + asyncTest( "defined event functions bind a closure when passed", function(){ expect( 1 ); - $('#qunit-fixture')[events[0]](function(){ + $('#qunit-fixture').bind(events[0], function(){ ok(true, "event fired"); + start(); }); $('#qunit-fixture').trigger(events[0]); + stop(); }); - test( "defined event functions trigger the event with no arguments", function(){ + asyncTest( "defined event functions trigger the event with no arguments", function(){ expect( 1 ); - $('#qunit-fixture')[events[0]](function(){ + $('#qunit-fixture').bind('touchstart', function(){ ok(true, "event fired"); + start(); }); - $('#qunit-fixture')[events[0]](); + $('#qunit-fixture').touchstart(); + stop(); }); test( "defining event functions sets the attrFn to true", function(){ @@ -75,7 +82,7 @@ ok($.event.special.scrollstart.enabled, "scrollstart enabled"); }); - test( "scrollstart setup binds a function that returns when its disabled", function(){ + asyncTest( "scrollstart setup binds a function that returns when its disabled", function(){ expect( 1 ); $.event.special.scrollstart.enabled = false; @@ -85,22 +92,24 @@ $($.event.special.scrollstart).bind("touchmove", function(){ ok(true, "touchmove fired"); + start(); }); $($.event.special.scrollstart).trigger("touchmove"); }); - test( "scrollstart setup binds a function that triggers scroll start when enabled", function(){ + asyncTest( "scrollstart setup binds a function that triggers scroll start when enabled", function(){ $.event.special.scrollstart.enabled = true; $($.event.special.scrollstart).bind("scrollstart", function(){ ok(true, "scrollstart fired"); + start(); }); $($.event.special.scrollstart).trigger("touchmove"); }); - test( "scrollstart setup binds a function that triggers scroll stop after 50 ms", function(){ + asyncTest( "scrollstart setup binds a function that triggers scroll stop after 50 ms", function(){ var triggered = false; $.event.special.scrollstart.enabled = true; @@ -112,7 +121,6 @@ $($.event.special.scrollstart).trigger("touchmove"); - stop(); setTimeout(function(){ ok(triggered, "triggered"); start(); @@ -123,13 +131,13 @@ $.support.touch = true; $.testHelper.reloadLib(libName); - // mock originalEvent information + //mock originalEvent information $.Event.prototype.originalEvent = { touches: [{ 'pageX' : 0 }, { 'pageY' : 0 }] }; }; - test( "long press fires tap hold after 750 ms", function(){ + asyncTest( "long press fires tap hold after 750 ms", function(){ var taphold = false; forceTouchSupport(); @@ -140,7 +148,6 @@ $($.event.special.tap).trigger("touchstart"); - stop(); setTimeout(function(){ ok(taphold); start(); @@ -155,15 +162,16 @@ }; }; - test( "touchmove prevents taphold", function(){ + asyncTest( "touchmove prevents taphold", function(){ + expect( 1 ); var taphold = false; forceTouchSupport(); mockAbs(100); //NOTE record taphold event - stop(); $($.event.special.tap).bind("taphold", function(){ + ok(false, "taphold fired"); taphold = true; }); @@ -183,30 +191,34 @@ }, 751); }); - test( "tap event fired without movement", function(){ - var tap = false; + asyncTest( "tap event fired without movement", function(){ + expect( 1 ); + var tap = false, + checkTap = function(){ + ok(true, "tap fired"); + }; forceTouchSupport(); //NOTE record the tap event - $($.event.special.tap).bind("tap", function(){ - start(); - tap = true; - }); + $($.event.special.tap).bind("tap", checkTap); - stop(); $($.event.special.tap).trigger("touchstart"); $($.event.special.tap).trigger("touchend"); - ok(tap, "tapped"); + setTimeout(function(){ + start(); + }, 400); }); - test( "tap event not fired when there is movement", function(){ + asyncTest( "tap event not fired when there is movement", function(){ + expect( 1 ); var tap = false; forceTouchSupport(); //NOTE record tap event $($.event.special.tap).bind("tap", function(){ + ok(false, "tap fired"); tap = true; }); @@ -218,13 +230,14 @@ $($.event.special.tap).trigger("touchmove"); //NOTE end touch sequence after 20 ms - stop(); setTimeout(function(){ $($.event.special.tap).trigger("touchend"); - start(); }, 20); - ok(!tap, "not tapped"); + setTimeout(function(){ + ok(!tap, "not tapped"); + start(); + }, 40); }); var swipeTimedTest = function(opts){ @@ -253,13 +266,14 @@ $($.event.special.swipe).trigger("touchend"); }, opts.timeout); - stop(); setTimeout(function(){ same(swipe, opts.expected, "swipe expected"); //NOTE the start in the event closure won't be fired, fire it here if(!opts.expected) { start(); } }, opts.timeout + 10); + + stop(); }; test( "swipe fired when coordinate change in less than a second", function(){ @@ -278,9 +292,14 @@ swipeTimedTest({ timeout: 1000, coordChange: 75, expected: false }); }); - test( "scrolling prevented when coordinate change > 10", function(){ + asyncTest( "scrolling prevented when coordinate change > 10", function(){ expect( 1 ); + forceTouchSupport(); + + // ensure the swipe custome event is setup + $($.event.special.swipe).bind('swipe', function(){}); + //NOTE bypass the trigger source check $.Event.prototype.originalEvent = { touches: false @@ -288,6 +307,7 @@ $.Event.prototype.preventDefault = function(){ ok(true, "prevent default called"); + start(); }; mockAbs(11); @@ -296,18 +316,25 @@ $($.event.special.swipe).trigger("touchmove"); }); - test( "move handler returns when touchstart has been fired since touchstop", function(){ + asyncTest( "move handler returns when touchstart has been fired since touchstop", function(){ expect( 1 ); + // bypass triggered event check $.Event.prototype.originalEvent = { touches: false }; + forceTouchSupport(); + + // ensure the swipe custome event is setup + $($.event.special.swipe).bind('swipe', function(){}); + $($.event.special.swipe).trigger("touchstart"); $($.event.special.swipe).trigger("touchend"); $($.event.special.swipe).bind("touchmove", function(){ ok(true, "touchmove bound functions are fired"); + start(); }); Math.abs = function(){ diff --git a/tests/unit/event/index.html b/tests/unit/event/index.html index 38595c55..de2ec6e5 100644 --- a/tests/unit/event/index.html +++ b/tests/unit/event/index.html @@ -7,11 +7,9 @@ - - - - + + diff --git a/tests/unit/init/index.html b/tests/unit/init/index.html index cbb6248f..d59eea85 100644 --- a/tests/unit/init/index.html +++ b/tests/unit/init/index.html @@ -5,13 +5,14 @@ jQuery Mobile Init Test Suite + - + @@ -23,10 +24,10 @@
            -
            +
            -
            +
            diff --git a/tests/unit/init/init_core.js b/tests/unit/init/init_core.js index 9c88acde..2f3ec3fe 100644 --- a/tests/unit/init/init_core.js +++ b/tests/unit/init/init_core.js @@ -6,8 +6,15 @@ mobileSelect = undefined, metaViewportContentDefault = $.mobile.metaViewportContent, libName = 'jquery.mobile.init.js', + coreLib = 'jquery.mobile.core.js', + extendFn = $.extend, setGradeA = function(value) { $.mobile.gradeA = function(){ return value; }; }, - extendFn = $.extend; + reloadCoreNSandInit = function(){ + $.testHelper.reloadLib(coreLib); + $.testHelper.reloadLib("jquery.setNamespace.js"); + $.testHelper.reloadLib(libName); + }; + module(libName, { setup: function(){ @@ -35,6 +42,7 @@ mobileSelect = $.mobile.selectmenu; }); + // NOTE for the following two tests see index html for the binding test( "mobile.page is available when mobile init is fired", function(){ ok(mobilePage !== undefined, "$.mobile.page is defined"); }); @@ -44,14 +52,20 @@ }); $.testHelper.excludeFileProtocol(function(){ - test( "loading the init library triggers mobilinit on the document", function(){ + asyncTest( "loading the init library triggers mobilinit on the document", function(){ + var initFired = false; expect( 1 ); $(window.document).bind('mobileinit', function(event){ - ok(true); + initFired = true; }); $.testHelper.reloadLib(libName); + + setTimeout(function(){ + ok(initFired, "init fired"); + start(); + }, 1000); }); test( "enhancments are skipped when the browser is not grade A", function(){ @@ -97,29 +111,32 @@ }); var findFirstPage = function() { - return $("[data-role='page']").first(); + return $("[data-"+ $.mobile.ns +"role='page']").first(); }; test( "active page and start page should be set to the fist page in the selected set", function(){ - var firstPage = findFirstPage(); + expect( 2 ); $.testHelper.reloadLib(libName); + var firstPage = findFirstPage(); - same($.mobile.firstPage, firstPage); - same($.mobile.activePage, firstPage); + same($.mobile.firstPage[0], firstPage[0]); + same($.mobile.activePage[0], firstPage[0]); }); test( "mobile viewport class is defined on the first page's parent", function(){ - var firstPage = findFirstPage(); + expect( 1 ); $.testHelper.reloadLib(libName); + var firstPage = findFirstPage(); ok(firstPage.parent().hasClass('ui-mobile-viewport')); }); test( "mobile page container is the first page's parent", function(){ - var firstPage = findFirstPage(); + expect( 1 ); $.testHelper.reloadLib(libName); + var firstPage = findFirstPage(); - same($.mobile.pageContainer, firstPage.parent()); + same($.mobile.pageContainer[0], firstPage.parent()[0]); }); test( "page loading is called on document ready", function(){ @@ -143,14 +160,13 @@ }); test( "pages without a data-url attribute have it set to their id", function(){ - same($("#foo").data('url'), "foo"); + same($("#foo").jqmData('url'), "foo"); }); test( "pages with a data-url attribute are left with the original value", function(){ - same($("#bar").data('url'), "bak"); + same($("#bar").jqmData('url'), "bak"); }); - //TODO lots of duplication asyncTest( "pageLoading doesn't add the dialog to the page when loading message is false", function(){ $.mobile.loadingMessage = false; $.mobile.pageLoading(false); @@ -166,7 +182,7 @@ $.mobile.pageLoading(true); setTimeout(function(){ - ok(!$(".ui-loader").length); + same($(".ui-loading").length, 0, "page should not be in the loading state"); start(); }, 500); }); @@ -176,14 +192,13 @@ $.mobile.pageLoading(false); setTimeout(function(){ - ok($(".ui-loader").length); + same($(".ui-loading").length, 1, "page should be in the loading state"); start(); }, 500); }); asyncTest( "page loading should contain default loading message", function(){ - $.testHelper.reloadLib('jquery.mobile.core.js'); - $.testHelper.reloadLib(libName); + reloadCoreNSandInit(); $.mobile.pageLoading(false); setTimeout(function(){ @@ -193,10 +208,7 @@ }); asyncTest( "page loading should contain custom loading message", function(){ - $(document).bind('mobileinit', function(){ - $.mobile.loadingMessage = "foo"; - }); - + $.mobile.loadingMessage = "foo"; $.testHelper.reloadLib(libName); $.mobile.pageLoading(false); diff --git a/tests/unit/jquery.setNameSpace.js b/tests/unit/jquery.setNameSpace.js new file mode 100644 index 00000000..c4c9f223 --- /dev/null +++ b/tests/unit/jquery.setNameSpace.js @@ -0,0 +1,4 @@ +//set namespace for unit test markp +$( document ).bind( "mobileinit", function(){ + $.mobile.ns = "nstest-"; +}); \ No newline at end of file diff --git a/tests/unit/listview/index.html b/tests/unit/listview/index.html index 8ed2893f..bc432b35 100644 --- a/tests/unit/listview/index.html +++ b/tests/unit/listview/index.html @@ -6,6 +6,7 @@ jQuery Mobile Listview Integration Test + @@ -23,12 +24,12 @@ -
            -
            +
            +

            Basic List View

            -
            -
            -