diff --git a/css/structure/jquery.mobile.collapsible.css b/css/structure/jquery.mobile.collapsible.css index 2794e898624..e14b66205b5 100644 --- a/css/structure/jquery.mobile.collapsible.css +++ b/css/structure/jquery.mobile.collapsible.css @@ -13,10 +13,10 @@ .ui-collapsible-heading .ui-btn-icon-left.ui-mini .ui-btn-inner { padding-left: 30px; } .ui-collapsible-heading .ui-btn-icon-right.ui-mini .ui-btn-inner { padding-right: 30px; } -.ui-collapsible-heading .ui-btn span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0px 1px 2px; text-indent: -9999px; } +.ui-collapsible-heading .ui-btn span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0 1px 2px; text-indent: -9999px; } .ui-collapsible-heading .ui-btn span.ui-btn .ui-btn-inner { padding: 10px 0; } .ui-collapsible-heading .ui-btn span.ui-btn .ui-icon { left: 0; margin-top: -10px; } -.ui-collapsible-heading-status { position: absolute; top: -9999px; left:0px; } +.ui-collapsible-heading-status { position: absolute; top: -9999px; left: 0; } .ui-collapsible-content { display: block; margin: 0 -15px; diff --git a/css/structure/jquery.mobile.listview.css b/css/structure/jquery.mobile.listview.css index 521cf1934ff..474c633351f 100644 --- a/css/structure/jquery.mobile.listview.css +++ b/css/structure/jquery.mobile.listview.css @@ -78,7 +78,7 @@ ol.ui-listview .ui-li-jsnumbering:before { content: "" !important; } /* to avoid .ui-li-link-alt .ui-btn .ui-icon { right: 50%; margin-right: -9px; } .ui-li-link-alt .ui-btn-icon-notext .ui-btn-inner .ui-icon { position: absolute; top: 50%; margin-top: -9px; } -.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { border-top: 0px; } +.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { border-top: 0; } .ui-listview-filter { border-width: 0; overflow: hidden; margin: -15px -15px 15px -15px; } .ui-collapsible-content .ui-listview-filter { margin: -10px -15px 10px -15px; border-bottom: inherit; } diff --git a/css/structure/jquery.mobile.panel.css b/css/structure/jquery.mobile.panel.css index b5b0ddbaaa1..7b55fef9df1 100644 --- a/css/structure/jquery.mobile.panel.css +++ b/css/structure/jquery.mobile.panel.css @@ -182,15 +182,15 @@ -moz-box-shadow: inset 5px 0 5px rgba(0,0,0,.15); box-shadow: inset 5px 0 5px rgba(0,0,0,.15); } +.ui-panel-display-overlay { + -webkit-box-shadow: 5px 0 5px rgba(0,0,0,.15); + -moz-box-shadow: 5px 0 5px rgba(0,0,0,.15); + box-shadow: 5px 0 5px rgba(0,0,0,.15); +} .ui-panel-position-right.ui-panel-display-overlay { - -webkit-box-shadow: -5px 0px 5px rgba(0,0,0,.15); - -moz-box-shadow: -5px 0px 5px rgba(0,0,0,.15); - box-shadow: -5px 0px 5px rgba(0,0,0,.15); -} -.ui-panel-position-left.ui-panel-display-overlay { - -webkit-box-shadow: 5px 0px 5px rgba(0,0,0,.15); - -moz-box-shadow: 5px 0px 5px rgba(0,0,0,.15); - box-shadow: 5px 0px 5px rgba(0,0,0,.15); + -webkit-box-shadow: -5px 0 5px rgba(0,0,0,.15); + -moz-box-shadow: -5px 0 5px rgba(0,0,0,.15); + box-shadow: -5px 0 5px rgba(0,0,0,.15); } .ui-panel-display-push.ui-panel-open.ui-panel-position-left { border-right-width: 1px; diff --git a/css/structure/jquery.mobile.popup.css b/css/structure/jquery.mobile.popup.css index 46cfb459dd2..6ac4d0e7a8f 100644 --- a/css/structure/jquery.mobile.popup.css +++ b/css/structure/jquery.mobile.popup.css @@ -4,9 +4,9 @@ } .ui-popup-screen { background-image: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); /* Necessary to set some form of background to ensure element is clickable in IE6/7. While legacy IE won't understand the data-URI'd image, it ensures no additional requests occur in all other browsers with little overhead. */ - top: 0px; - left: 0px; - right: 0px; + top: 0; + left: 0; + right: 0; bottom: 1px; position: absolute; filter: Alpha(Opacity=0); diff --git a/css/themes/default/jquery.mobile.theme.css b/css/themes/default/jquery.mobile.theme.css index 2f07aa83ad1..f3226aae95d 100644 --- a/css/themes/default/jquery.mobile.theme.css +++ b/css/themes/default/jquery.mobile.theme.css @@ -555,7 +555,7 @@ } .ui-btn-up-d:visited, .ui-btn-up-d a.ui-link-inherit { - color: #333 /*{d-bup-color}*/; + color: #2f3e46 /*{d-bup-color}*/; } .ui-btn-hover-d { border: 1px solid #aaa /*{d-bhover-border}*/; @@ -767,7 +767,7 @@ a.ui-link-inherit { border: 1px solid #2373a5 /*{global-active-border}*/; background: #5393c5 /*{global-active-background-color}*/; font-weight: bold; - color: #fff /*{global-active-color}*/; + color: #754300 /*{global-active-color}*/; cursor: pointer; text-shadow: 0 /*{global-active-shadow-x}*/ 1px /*{global-active-shadow-y}*/ 0 /*{global-active-shadow-radius}*/ #3373a5 /*{global-active-shadow-color}*/; text-decoration: none; @@ -968,7 +968,7 @@ a.ui-link-inherit { } .ui-icon-plus { - background-position: 0px 50%; + background-position: 0 50%; } .ui-icon-minus { background-position: -36px 50%; @@ -1054,7 +1054,7 @@ a.ui-link-inherit { } .ui-checkbox-on .ui-icon, .ui-radio-on .ui-icon { - background-color: #4596ce /*{global-active-background-color}*/; /* NOTE: this hex should match the active state color. It's repeated here for cascade */ + background-color: #e49200 /*{global-active-background-color}*/; /* NOTE: this hex should match the active state color. It's repeated here for cascade */ } /* loading icon */ @@ -1089,31 +1089,31 @@ a.ui-link-inherit { height: 100%; } .ui-overlay-shadow { - -moz-box-shadow: 0px 0px 12px rgba(0,0,0,.6); - -webkit-box-shadow: 0px 0px 12px rgba(0,0,0,.6); - box-shadow: 0px 0px 12px rgba(0,0,0,.6); + -moz-box-shadow: 0 0 12px rgba(0,0,0,.6); + -webkit-box-shadow: 0 0 12px rgba(0,0,0,.6); + box-shadow: 0 0 12px rgba(0,0,0,.6); } .ui-shadow { - -moz-box-shadow: 0px 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/; - -webkit-box-shadow: 0px 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/; - box-shadow: 0px 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/; + -moz-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/; + -webkit-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/; + box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/ } .ui-bar-a .ui-shadow, .ui-bar-b .ui-shadow , .ui-bar-c .ui-shadow { - -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.3); - -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.3); - box-shadow: 0px 1px 0 rgba(255,255,255,.3); + -moz-box-shadow: 0 1px 0 rgba(255,255,255,.3); + -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.3); + box-shadow: 0 1px 0 rgba(255,255,255,.3); } .ui-shadow-inset { - -moz-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); - -webkit-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); - box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); + -moz-box-shadow: inset 0 1px 4px rgba(0,0,0,.2); + -webkit-box-shadow: inset 0 1px 4px rgba(0,0,0,.2); + box-shadow: inset 0 1px 4px rgba(0,0,0,.2); } .ui-icon-shadow { - -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; - -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; - box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; + -moz-box-shadow: 0 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; + -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; + box-shadow: 0 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; } /* Focus state - set here for specificity (note: these classes are added by JavaScript) @@ -1127,15 +1127,15 @@ a.ui-link-inherit { } .ui-focus, .ui-btn:focus { - -moz-box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/; - -webkit-box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/; - box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/; + -moz-box-shadow: inset 0 0 3px #387bbe /*{global-active-background-color}*/, 0 0 9px #387bbe /*{global-active-background-color}*/; + -webkit-box-shadow: inset 0 0 3px #387bbe /*{global-active-background-color}*/, 0 0 9px #387bbe /*{global-active-background-color}*/; + box-shadow: inset 0 0 3px #387bbe /*{global-active-background-color}*/, 0 0 9px #387bbe /*{global-active-background-color}*/; } .ui-input-text.ui-focus, .ui-input-search.ui-focus { - -moz-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; - -webkit-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; - box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; + -moz-box-shadow: 0 0 12px #387bbe /*{global-active-background-color}*/; + -webkit-box-shadow: 0 0 12px #387bbe /*{global-active-background-color}*/; + box-shadow: 0 0 12px #387bbe /*{global-active-background-color}*/; } /* unset box shadow in browsers that don't do it right diff --git a/docs/_assets/css/jqm-demos.css b/docs/_assets/css/jqm-demos.css index f8d143a06c9..44b0758cfde 100644 --- a/docs/_assets/css/jqm-demos.css +++ b/docs/_assets/css/jqm-demos.css @@ -5,6 +5,7 @@ /* Page */ body, .jqm-demos { background-color: #fefefe; + font-size: 1.05em; } /* Header */ @@ -271,7 +272,7 @@ body, .jqm-demos { font-family: 'Open Sans', sans-serif; font-weight: 300; font-size: 2.4em; - color: #555; + color: #333; clear:both; } .jqm-faq .jqm-content > h1 { @@ -285,7 +286,7 @@ body, .jqm-demos { font-family: 'Open Sans', sans-serif; font-weight: 300; font-size: 1.6em; - color: #74b042; + color: #60a725; padding-top: .6em; clear:both; } @@ -334,7 +335,7 @@ h2.jqm-home-widget { margin-top: -.5em; margin-bottom: .5em; padding-bottom: 2.6em; - color: #555; + color: #333; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e5e5e5; @@ -343,7 +344,7 @@ h2.jqm-home-widget { .jqm-demos-home .jqm-content .jqm-intro { font-family: 'Open Sans', sans-serif; font-weight: 300; - font-size: .9em; + line-height: 1.6; margin: .5em .8em 1em .8em; padding-bottom: .5em; border: none; @@ -383,6 +384,10 @@ h2.jqm-home-widget { .jqm-demos .jqm-content.jqm-fullwidth { padding: 15px; } + + .jqm-content p { + line-height: 1.5; + } .jqm-demos-home .jqm-content p.jqm-intro { font-size: 1.1em; } @@ -504,7 +509,7 @@ h2.jqm-home-widget { background-image: none; background-color: #f8f8f8; border-color: #e8e8e8; - color: #74b042; + color: #60a725; text-shadow: none; } /* List buttons */ @@ -523,15 +528,10 @@ h2.jqm-home-widget { } .jqm-list .ui-btn-up-d { background-color: #fff; + background-image: none; } .jqm-list .ui-btn-hover-d { background-color: #f8f8f8; -} -.jqm-list .ui-btn-up-d, -.jqm-list .ui-btn-hover-d { - -webkit-background-image: none; - -moz-background-image: none; - -o-background-image: none; background-image: none; } .jqm-list .ui-btn-up-d.ui-btn-active, @@ -542,9 +542,6 @@ h2.jqm-home-widget { .jqm-list .ui-btn-down-d.ui-focus { border-color: #34bae8; background-color: #34bae8; - -webkit-background-image: none; - -moz-background-image: none; - -o-background-image: none; background-image: none; color: #fff; text-shadow: 0 1px 0 #369; @@ -853,7 +850,7 @@ h2.jqm-home-widget { float: none; left: auto; height: auto; - line-height: 16px; + line-height: 18px; margin: 0; outline: 0; overflow: visible; @@ -868,7 +865,7 @@ h2.jqm-home-widget { font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: normal; font-style: normal; - font-size: 13px; + font-size: 14px; min-height: inherit; min-height: auto; } @@ -967,13 +964,13 @@ h2.jqm-home-widget { color: #5ba1cf; } .syntaxhighlighter .string { - color: #9a6; + color: #98da31; } .syntaxhighlighter .string a { color: #1dc116; } .syntaxhighlighter .keyword { - color: #c84; + color: #ffae00; } .syntaxhighlighter .preprocessor { color: #8aa6c1; diff --git a/docs/examples/controlgroups/dynamic-controlgroup.php b/docs/examples/controlgroups/dynamic-controlgroup.php index b988bd41064..40d1ea64256 100644 --- a/docs/examples/controlgroups/dynamic-controlgroup.php +++ b/docs/examples/controlgroups/dynamic-controlgroup.php @@ -19,31 +19,35 @@ counter++; var widgetType = $( "[name='radio-widget']:checked" ).attr( "id" ), - group = $( "#controlgroup" ), + group = $( "#my-controlgroup" ), $el, action = function() { - var option = $( "[name='radio-option']:checked" ).attr( "id" ); - $el[ option ](); group.controlgroup( "refresh" ); + var action = $( "[name='radio-action']:checked" ).attr( "id" ); + if ( $( $el[1] ).is( "select" ) && action === "hide" ) { + $el = $( $el[1] ).parents( ".ui-select" ); + } + $el[ action ](); + group.controlgroup( "refresh" ); }; if ( widgetType === "link" ) { $el = $( "Link " + counter + "" ).bind( "click", action ); - $( "#controlgroup" ).controlgroup( "container" )[ $( this ).attr( "id" ) ]( $el ); + $( "#my-controlgroup" ).controlgroup( "container" )[ $( this ).attr( "id" ) ]( $el ); $el.buttonMarkup(); } else if ( widgetType === "select" ) { - $el = $( "" ); + $el = $( "" ); $( $el[ 1 ] ).bind( "change", action); - $( "#controlgroup" ).controlgroup( "container" )[ $( this ).attr( "id" ) ]( $el ); + $( "#my-controlgroup" ).controlgroup( "container" )[ $( this ).attr( "id" ) ]( $el ); $( $el[ 1 ] ).selectmenu(); } else { $el = $( "" ); $( $el[ 1 ] ).bind( "change", action ); - $( "#controlgroup" ).controlgroup( "container" )[ $( this ).attr( "id" ) ]( $el ); + $( "#my-controlgroup" ).controlgroup( "container" )[ $( this ).attr( "id" ) ]( $el ); $( $el[ 1 ] ).checkboxradio(); } @@ -52,11 +56,14 @@ }); $( "[name='radio-orientation']" ).bind( "change", function( e ) { - $( "#controlgroup" ).controlgroup( "option", "type", ( $( "#isHorizontal" ).is( ":checked" ) ? "horizontal" : "vertical" ) ); + $( "#my-controlgroup" ).controlgroup( "option", "type", ( $( "#isHorizontal" ).is( ":checked" ) ? "horizontal" : "vertical" ) ); }); }); })( jQuery ); +
@@ -74,57 +81,67 @@

This demo shows how you can dynamically make changes to a controlgroup.

-
-
-
-
- Prepend - Append -
-
-
- Widget type - - - - - - - - - -
- -
- Operation
click on the controlgroup item to perform
- - - - - - - - - -
- -
- Orientation - - - - - - -
-
-
-
-
-
-
-
-
+
+ +
+
+

Controlgroup...

+
+
+
+ +
+ + + + +
+ +
+
+
+ Widget type + + + + + + + + + +
+
+ +
+
+ Action
on click/change
+ + + + + + + + + +
+
+ +
+
+ Switch orientation + + + + + + +
+
+ +
+
diff --git a/docs/examples/panels/panel-styling.php b/docs/examples/panels/panel-styling.php index 2c3ddc1a05b..092a846c77e 100644 --- a/docs/examples/panels/panel-styling.php +++ b/docs/examples/panels/panel-styling.php @@ -71,9 +71,9 @@ box-shadow: -5px 0px 5px rgba(0,0,0,.15); } - /* Use the ui-body class of your page theme to set a background image. - The page theme will be set for the content wrapper, - while the page get the panel them before opening the panel. */ + /* Use the ui-body class of your page theme (ui-body-d in this demo) to set a background image. + This class will be added to the content wrapper, while the page itself gets the same background + as the panel before opening the panel. */ #demo-page .ui-body-d { background-image: url(../../_assets/img/bg-pattern.png); background-repeat: repeat-x; @@ -148,6 +148,8 @@
  • Set a background image for a page that contains a panel.
  • Give the page a responsive layout with CSS columns.
  • + +

    Click the "view source" button to see the CSS and markup of this demo and open the demo to see the result.

    Open demo diff --git a/docs/nav-widgets.php b/docs/nav-widgets.php index 0adbe7a8bff..40c73cf8a73 100644 --- a/docs/nav-widgets.php +++ b/docs/nav-widgets.php @@ -26,7 +26,7 @@
  • Header toolbar
  • -
  • Icon
  • +
  • Icons
  • Links
  • diff --git a/docs/widgets/buttons/buttons-grids.php b/docs/widgets/buttons/buttons-grids.php deleted file mode 100644 index 1d16951acce..00000000000 --- a/docs/widgets/buttons/buttons-grids.php +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - Buttons in grids - jQuery Mobile Demos - - - - - - - - - -
    - -
    -

    jQuery Mobile Framework

    - Navigation - Search - -
    - -
    - -

    Grid D

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    Grid C

    - -

    Inline, centered

    - -
    -
    -
    -
    -
    -
    -
    -
    - -

    Grid B

    - -

    Mini sized

    - -
    -
    - -
    -
    -
    -
    - -

    Grid A

    - -
    -
    -
    - - -
    - -
    -
    - -

    Mini sized

    - -
    -
    -
    - - -
    - -
    -
    - -

    Without ui-block

    - -
    -
    - - -
    -
    - -

    Grid Solo

    - -
    -
    -
    - Button -
    - -
    -
    - -

    Without ui-block

    - -
    - -
    - -

    Alignment

    - -
    -
    - - - -
    -
    - - -
    -
    - Grid Solo -
    - Without grid -
    - -
    - - - - - -
    - - diff --git a/docs/widgets/forms/form-disabled.php b/docs/widgets/forms/form-disabled.php index 8acde75918e..45b5f00b85e 100644 --- a/docs/widgets/forms/form-disabled.php +++ b/docs/widgets/forms/form-disabled.php @@ -1,508 +1,512 @@ - - - Form disabled - jQuery Mobile Demos - - - - - - - - - -
    - -
    -

    jQuery Mobile Framework

    - Navigation - Search - -
    - -
    - -

    Disabled form elements

    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Single checkbox: - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    - -

    Mini sized

    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Single checkbox: - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    - -

    Class ui-disabled

    - -
    - Link button -
    - -
    - Link button -
    - -
    - - - - - -
    - - + + + Form disabled - jQuery Mobile Demos + + + + + + + + + +
    + +
    +

    jQuery Mobile Framework

    + Navigation + Search + +
    + +
    + +

    Disabled form elements

    + +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Single checkbox: + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    + +

    Mini sized

    + +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Single checkbox: + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    + +

    Class ui-disabled

    + +
    + Link button +
    + +
    + Link button +
    + + + Back to Forms + + +
    + + + + + +
    + + diff --git a/docs/widgets/forms/form-fieldcontain.php b/docs/widgets/forms/form-fieldcontain.php index 262eb6b3ecd..7c7b207c6c3 100644 --- a/docs/widgets/forms/form-fieldcontain.php +++ b/docs/widgets/forms/form-fieldcontain.php @@ -1,498 +1,501 @@ - - - Form field containers - jQuery Mobile Demos - - - - - - - - - -
    - -
    -

    jQuery Mobile Framework

    - Navigation - Search - -
    - -
    - -

    Field containers

    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Single checkbox: - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    - -

    Mini sized

    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Single checkbox: - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    - -
    - - - - - -
    - - + + + Form field containers - jQuery Mobile Demos + + + + + + + + + +
    + +
    +

    jQuery Mobile Framework

    + Navigation + Search + +
    + +
    + +

    Field containers

    + +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Single checkbox: + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    + +

    Mini sized

    + +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Single checkbox: + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    + + Back to Forms + + +
    + + + + + +
    + + diff --git a/docs/widgets/forms/form-gallery.php b/docs/widgets/forms/form-gallery.php new file mode 100644 index 00000000000..b864de3858f --- /dev/null +++ b/docs/widgets/forms/form-gallery.php @@ -0,0 +1,438 @@ + + + + + + Form gallery - jQuery Mobile Demos + + + + + + + + + +
    + +
    +

    jQuery Mobile Framework

    + Navigation + Search + +
    + +
    + +

    Form gallery

    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    + +
    + + +
    + +
    +
    + + + + +
    +
    + +
    + + +
    + +
    +
    + Single checkbox: + + +
    +
    + +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    + +
    + + +
    + +
    + +

    Mini sized

    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Single checkbox: + + +
    +
    + +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    + +
    + + +
    + +
    + + Back to Forms + + +
    + + + + + +
    + + diff --git a/docs/widgets/forms/form-hide-label.php b/docs/widgets/forms/form-hide-label.php index 4252b53cab0..06c5f3dadad 100644 --- a/docs/widgets/forms/form-hide-label.php +++ b/docs/widgets/forms/form-hide-label.php @@ -1,498 +1,501 @@ - - - Form field containers ui-hide-label - jQuery Mobile Demos - - - - - - - - - -
    - -
    -

    jQuery Mobile Framework

    - Navigation - Search - -
    - -
    - -

    Field containers, hide label/legend

    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Single checkbox: - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    - -

    Mini sized

    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    - Single checkbox: - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    -
    - -
    -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    - -
    - - - - - -
    - - + + + Form ui-hide-label - jQuery Mobile Demos + + + + + + + + + +
    + +
    +

    jQuery Mobile Framework

    + Navigation + Search + +
    + +
    + +

    Field containers, hide label/legend

    + +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Single checkbox: + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    + +

    Mini sized

    + +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    + Single checkbox: + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    +
    + +
    +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    +
    + +
    +
    + + +
    +
    + +
    + + Back to Forms + + +
    + + + + + +
    + + diff --git a/docs/widgets/forms/form-label-hidden.php b/docs/widgets/forms/form-label-hidden.php index b62206cfffb..3e36619aa5f 100644 --- a/docs/widgets/forms/form-label-hidden.php +++ b/docs/widgets/forms/form-label-hidden.php @@ -1,426 +1,429 @@ - - - Form label/legend ui-hidden-accessible - jQuery Mobile Demos - - - - - - - - - -
    - -
    -

    jQuery Mobile Framework

    - Navigation - Search - -
    - -
    - -

    Hide label/legend

    - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    - -
    - - -
    - -
    - - -
    - -
    -
    - Single checkbox: - - -
    -
    - -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    - -
    - - -
    - -
    - -

    Mini sized

    - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    - -
    - - -
    - -
    - - -
    - -
    -
    - Single checkbox: - - -
    -
    - -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    - -
    - - -
    - -
    - -
    - - - - - -
    - - + + + Form ui-hidden-accessible - jQuery Mobile Demos + + + + + + + + + +
    + +
    +

    jQuery Mobile Framework

    + Navigation + Search + +
    + +
    + +

    Hide label/legend

    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Single checkbox: + + +
    +
    + +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    + +
    + + +
    + +
    + +

    Mini sized

    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Vertical controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Horizontal controlgroup, buttons: + + + Three +
    +
    + +
    +
    + Vertical controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, select: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, mixed: + Link + + + +
    +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Single checkbox: + + +
    +
    + +
    +
    + Vertical controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Vertical controlgroup, radio: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, checkbox: + + + + + + +
    +
    + +
    +
    + Horizontal controlgroup, radio: + + + + + + +
    +
    + +
    + + +
    + +
    + + Back to Forms + + +
    + + + + + +
    + + diff --git a/docs/widgets/forms/form.php b/docs/widgets/forms/form.php deleted file mode 100644 index 650d78bbad3..00000000000 --- a/docs/widgets/forms/form.php +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - Form - jQuery Mobile Demos - - - - - - - - - -
    - -
    -

    Form

    - Search - -
    - -
    - -

    Basic form

    - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    - -
    - - -
    - -
    -
    - - - - -
    -
    - -
    - - -
    - -
    -
    - Single checkbox: - - -
    -
    - -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    - -
    - - -
    - -
    - -

    Mini sized

    - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    -
    - Vertical controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Horizontal controlgroup, buttons: - - - Three -
    -
    - -
    -
    - Vertical controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, select: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, mixed: - Link - - - -
    -
    - -
    - - -
    - -
    - - -
    - -
    -
    - Single checkbox: - - -
    -
    - -
    -
    - Vertical controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Vertical controlgroup, radio: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, checkbox: - - - - - - -
    -
    - -
    -
    - Horizontal controlgroup, radio: - - - - - - -
    -
    - -
    - - -
    - -
    - -
    - - - -
    - - diff --git a/docs/widgets/forms/index.php b/docs/widgets/forms/index.php index c9c1847b49c..3f0b521a518 100644 --- a/docs/widgets/forms/index.php +++ b/docs/widgets/forms/index.php @@ -3,7 +3,7 @@ - Form reference - jQuery Mobile Demos + Form elements - jQuery Mobile Demos @@ -24,7 +24,7 @@
    -

    Forms

    +

    Form elements

    All form widgets begin with native form elements with rich HTML semantics that are enhanced to make them more attractive and finger-friendly.

    @@ -291,9 +291,11 @@
    +

    See the form gallery for more form element examples.

    +

    Accessibly hidden labels

    -

    For the sake of accessibility, jQuery Mobile requires that all form elements be paired with a meaningful label. To hide labels in a way that leaves them visible to assistive technologies — for example, when letting an element's placeholder attribute serve as a label — apply the helper class ui-hidden-accessible to the label. View more examples of accessibly hidden labels.

    +

    For the sake of accessibility, jQuery Mobile requires that all form elements be paired with a meaningful label. To hide labels in a way that leaves them visible to assistive technologies — for example, when letting an element's placeholder attribute serve as a label — apply the helper class ui-hidden-accessible to the label. View more examples of accessibly hidden labels. In case you use a field container you can use class ui-hide-label on the element with data-role="fieldcontain" to hide the label or legend.

    @@ -315,7 +317,7 @@

    Fieldcontainer groupings

    -

    To improve the styling of labels and form elements on wider screens, wrap a div or fieldset with the data-role="fieldcontain" attribute around each label/form element. This framework aligns the input and associated label side-by-side, and breaks to stacked block-level elements below ~480px. The framework will also add a thin bottom border to act as a field separator. See more examples of fieldcontainer groupings.

    +

    To improve the styling of labels and form elements on wider screens, wrap a div or fieldset with the data-role="fieldcontain" attribute around each label/form element. This framework aligns the input and associated label side-by-side, and breaks to stacked block-level elements below ~448px. The framework will also add a thin bottom border to act as a field separator. See more examples of fieldcontainer groupings.

    @@ -343,60 +345,70 @@

    For example, if a block of HTML markup (say a login form) was loaded in through AJAX, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:

    - - $( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" ); - +
    
    +$( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );
    +

    Refreshing form elements

    In jQuery Mobile, some enhanced form controls are simply styled (inputs), but others are custom controls (selects, sliders) built from, and kept in sync with, the native control. To programmatically update a form control with JavaScript, first manipulate the native control, then use the refresh method to tell the enhanced control to update itself to match the new state. Here are some examples of how to update common form controls, then call the refresh method:

    +

    Checkboxes:

    - - $("input[type='checkbox']").prop("checked",true).checkboxradio("refresh"); - - -

    Radios:

    - - $("input[type='radio']").prop("checked",true).checkboxradio("refresh"); - +
    
    +$( "input[type='checkbox']" ).prop( "checked", true ).checkboxradio( "refresh" );
    +
    -

    Selects:

    -
    +		

    Radios:

    + +
    
    +$( "input[type='radio']" ).prop( "checked", true ).checkboxradio( "refresh" );
    +
    -var myselect = $("#selectfoo"); +

    Selects:

    + +
    
    +var myselect = $( "#selectfoo" );
     myselect[0].selectedIndex = 3;
    -myselect.selectmenu("refresh");
    - -

    Sliders:

    - - $("input[type='range']").val(60).slider("refresh"); - +myselect.selectmenu( "refresh" ); +
    -

    Flip switches (they use slider):

    +

    Sliders:

    + +
    
    +$( "input[type='range']" ).val( 60 ).slider( "refresh" );
    +
    -
    +		

    Flip switches:

    + +

    They use the slider widget.

    -var myswitch = $("#selectbar"); -myswitch[0].selectedIndex = 1; -myswitch.slider("refresh"); -
    +
    
    +var myswitch = $( "#selectbar" );
    +myswitch[ 0 ].selectedIndex = 1;
    +myswitch.slider( "refresh" );
    +

    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:

    -
    <label for="foo">
    +            
    +
    
    +<label for="foo">
     <select name="foo" id="foo" data-role="none">
     	<option value="a">A</option>
     	<option value="b">B</option>
     	<option value="c">C</option>
    -</select>
    +</select> +

    If you'd like to prevent auto-initialization without adding attributes to your markup, you can customize the selector that is used for preventing auto-initialization by setting the page plugin's keepNative option (which defaults to [data-role="none"]). Be sure to configure this option 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.

    -
    
    -$(document).bind('mobileinit',function(){
    +            
    +
    
    +$( document ).bind( "mobileinit", function() {
     	$.mobile.page.prototype.options.keepNative = "select, input.foo, textarea.bar";
     });
    -				
    +

    Alternately you can use the data-enhance="false" data attribute on a parent element with $.mobile.ignoreContentEnabled set to true. Beware though, this will incur a performance penalty for each and every element in the page that would otherwise be enhanced as jQuery Mobile must traverse the set of parents to look for those elements.

    diff --git a/docs/widgets/grids/grid-buttons.php b/docs/widgets/grids/grid-buttons.php new file mode 100644 index 00000000000..e05842edd56 --- /dev/null +++ b/docs/widgets/grids/grid-buttons.php @@ -0,0 +1,147 @@ + + + + + + Buttons in grids - jQuery Mobile Demos + + + + + + + + + + +
    + +
    +

    jQuery Mobile Framework

    + Navigation + Search + +
    + +
    + +

    Buttons in grids

    + +

    On this page you see examples of how you can use grids to layout buttons.

    + + +

    Basic

    + +

    Buttons in grids get a bit margin left and right.

    + +
    +
    +
    +
    +
    +
    + + +

    Icon only, centered

    + +

    Inline buttons can be centered by adding text-align: center; to your custom CSS.

    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +

    Mini sized

    + +
    +
    + +
    +
    +
    +
    + + +

    Select & Checkbox

    + +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +

    Responsive

    + +

    It's not recommended to have many buttons with text on one row at small screens, because the text might get truncated. You can use responsive grids to stack the buttons at small screens. Here we use the framework preset breakpoint by adding class ui-responsive to the container.

    + +
    +
    + +
    +
    +
    +
    + + +

    Alignment

    + +

    Use grid solo to align a single button with buttons in other grids.

    + +
    +
    + + + +
    +
    + + +
    +
    + Grid Solo +
    +
    + No grid class +
    + + + Back to Grids + +
    + + + + + +
    + + diff --git a/docs/widgets/grids/grid-custom.php b/docs/widgets/grids/grid-custom.php index 0435c80bd8e..6bc33fcfc33 100644 --- a/docs/widgets/grids/grid-custom.php +++ b/docs/widgets/grids/grid-custom.php @@ -14,76 +14,96 @@ @@ -98,53 +118,56 @@
    -

    Custom responsive grid

    - -

    It's easy to extend the basic grid styles into a custom responsive layout by using CSS media queries to adjust the layout and design across various screen width breakpoints.

    -

    This example is a typical news feature block that changes its layout across screen widths and illustrates how to change the grid ratios and overall layout with simple CSS. It starts as a simple set of stacked stories on phones, that goes to a layout with the lead story full width stacked over a 50/50 layout of the secondary stories. At wider widths, these secondary stories float next to the lead story in a 50/25/25 layout. When the screen gets very wide, the font size is bumped up to keep line lengths short.

    -

    Use the view source button below to see how the media queries work for each of these breakpoints.

    - - -
    - -
    - - -
    -
    -

    Apple schedules 'iPad Mini' event for October 23

    -

    One of the worst-kept secrets in tech has been confirmed: Apple will hold an event October 23 in San Jose, California, at which the company is widely expected to unveil a smaller, cheaper version of its popular iPad called "Mini".

    -
    -
    - - -
    -
    -

    Microsoft Surface tablet goes on sale for $499

    -

    The Microsoft Surface tablet picture has come into focus. The Redmond giant filled in the blanks on the new tablet's availability and specs.

    -
    -
    - - -
    -
    -

    AOL unveils Alto, an email service that syncs 5 accounts

    -

    AOL, struggling to shed its outdated image, is reimagining one of the most visibly aging parts of its platform: Its email service.

    -
    -
    - -
    - -
    - -
    - - - - +

    Custom responsive grid

    + +

    It's easy to extend the basic grid styles into a custom responsive layout by using CSS media queries to adjust the layout and design across various screen width breakpoints.

    + +

    This example is a typical news feature block that changes its layout across screen widths and illustrates how to change the grid ratios and overall layout with simple CSS. It starts as a simple set of stacked stories on phones, that goes to a layout with the lead story full width stacked over a 50/50 layout of the secondary stories. At wider widths, these secondary stories float next to the lead story in a 50/25/25 layout. When the screen gets very wide, the font size is bumped up to keep line lengths short.

    +

    Use the view source button below to see how the media queries work for each of these breakpoints.

    + + +
    + +
    + + +
    +
    +

    Apple schedules 'iPad Mini' event for October 23

    +

    One of the worst-kept secrets in tech has been confirmed: Apple will hold an event October 23 in San Jose, California, at which the company is widely expected to unveil a smaller, cheaper version of its popular iPad called "Mini".

    +
    +
    + + +
    +
    +

    Microsoft Surface tablet goes on sale for $499

    +

    The Microsoft Surface tablet picture has come into focus. The Redmond giant filled in the blanks on the new tablet's availability and specs.

    +
    +
    + + +
    +
    +

    AOL unveils Alto, an email service that syncs 5 accounts

    +

    AOL, struggling to shed its outdated image, is reimagining one of the most visibly aging parts of its platform: Its email service.

    +
    +
    + +
    + +
    + + Back to Grids + +
    + + + +
    diff --git a/docs/widgets/grids/index.php b/docs/widgets/grids/index.php index 66df18c4edf..4aaf24a5673 100644 --- a/docs/widgets/grids/index.php +++ b/docs/widgets/grids/index.php @@ -52,7 +52,9 @@
    +

    Three-column grids

    +

    The other grid layout configuration uses class=ui-grid-b on the parent, and 3 child container elements, each with its respective ui-block-a/b/c class, to create a three-column layout (33/33/33%).

    @@ -72,6 +74,9 @@
    + +

    View more examples of buttons in grids.

    +

    Four-column grids

    @@ -86,39 +91,44 @@
    +

    Five-column grids

    +

    A five-column, 20/20/20/20/20% grid is created by specifying class=ui-grid-d on the parent and adding a fifth block.

    -
    -
    A
    -
    B
    -
    C
    -
    D
    -
    E
    -
    +
    +
    A
    +
    B
    +
    C
    +
    D
    +
    E
    +
    +

    Multiple row grids

    Grids are designed to wrap to multiple rows of items. For example, if you specify a 3-column grid (ui-grid-b) on a container that has nine child blocks, it will wrap to 3 rows of 3 items each. There is a CSS rule to clear the floats and start a new line when the class=ui-block-a is seen so make sure to assign block classes in a repeating sequence (a, b, c, a, b, c, etc.) that maps to the grid type:

    -
    -
    A
    -
    B
    -
    C
    -
    A
    -
    B
    -
    C
    -
    A
    -
    B
    -
    C
    -
    +
    +
    A
    +
    B
    +
    C
    +
    A
    +
    B
    +
    C
    +
    A
    +
    B
    +
    C
    +
    +

    Grid solo class

    -

    Please note that the framework adds left and right margin to buttons in a grid. For a single button you can use a container with class ui-grid-solo and wrap the button in a div with class ui-block-a like the example below. This way the button will get the same margin.

    + +

    The framework adds left and right margin to buttons in a grid. For a single button you can use a container with class ui-grid-solo and wrap the button in a div with class ui-block-a like the example below. This way the button will get the same margin. View more examples of buttons in grids.

    @@ -130,14 +140,13 @@
    - - More buttons in grids examples +

    Responsive grids

    It's straightforward to take the standard grids and make them responsive by stacking the grid blocks at narrow widths. Since we just want to override the floats and widths of the standard grid styles below a single breakpoint, use a max-width breakpoint to only apply the stacked styling as an override.

    -

    We recommend adding a class (ex: my-breakpoint) to scope the styles for the media query so it can be applied selectively. From this basic start, you can customize the appearance further or even add additional breakpoints. See an example of a custom responsive grid.

    +

    We recommend adding a class (ex: my-breakpoint) to scope the styles for the media query so it can be applied selectively. From this basic start, you can customize the appearance further or even add additional breakpoints. See an example of a custom responsive grid.

    
     /* stack all grids below 40em (640px) */
    @@ -148,53 +157,55 @@
     	.my-breakpoint .ui-block-d,
     	.my-breakpoint .ui-block-e {
     		width: 100%;
    -		float:none;
    +		float: none;
     	}
     }
     
    -

    Breakpoint preset

    - -

    To apply a preset breakpoint to stack grids below 35em (560px), add the .ui-responsive class to the grid container.

    - - -
    - -

    Grid A (50/50)

    - -
    -
    Block A
    -
    Block B
    -
    - -

    Grid B (33/33/33)

    - -
    -
    Block A
    -
    Block B
    -
    Block C
    -
    - -

    Grid C (25/25/25/25)

    - -
    -
    A
    -
    B
    -
    C
    -
    D
    -
    - -

    Grid D (20/20/20/20/20)

    +

    Breakpoint preset

    + +

    To apply a preset breakpoint to stack grids below 35em (560px), add the .ui-responsive class to the grid container.

    + + +
    + +

    Grid A (50/50)

    + +
    +
    Block A
    +
    Block B
    +
    + +

    Grid B (33/33/33)

    + +
    +
    Block A
    +
    Block B
    +
    Block C
    +
    + +

    Grid C (25/25/25/25)

    + +
    +
    A
    +
    B
    +
    C
    +
    D
    +
    + +

    Grid D (20/20/20/20/20)

    + +
    +
    A
    +
    B
    +
    C
    +
    D
    +
    E
    +
    + +
    -
    -
    A
    -
    B
    -
    C
    -
    D
    -
    E
    -
    -
    diff --git a/docs/widgets/links/index.php b/docs/widgets/links/index.php index 7ebf8aea96a..dd94fe006be 100644 --- a/docs/widgets/links/index.php +++ b/docs/widgets/links/index.php @@ -24,38 +24,40 @@
    -

    Links API

    +

    Links API

    -

    jQuery Mobile is designed to work with standard page link conventions and layers the AJAX navigation on top for maximum compatibility. -

    +

    jQuery Mobile is designed to work with standard page link conventions and layers the AJAX navigation on top for maximum compatibility. +

    -

    Linking pages

    +

    Linking pages

    -

    You can link pages and assets as you normally would, and jQuery Mobile will automatically handle page requests in a single-page model, using AJAX when possible. When AJAX isn't possible (such as a non-same-domain url, or if specified using certain attributes on the link), a normal http request is used instead.

    +

    You can link pages and assets as you normally would, and jQuery Mobile will automatically handle page requests in a single-page model, using AJAX when possible. When AJAX isn't possible (such as a non-same-domain url, or if specified using certain attributes on the link), a normal http request is used instead.

    -

    The goal of this nav 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.

    +

    The goal of this nav 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.

    -

    Default link behavior: AJAX

    +

    Default link behavior: AJAX

    -

    To enable animated page transitions, all links that point to an external page (ex. products.html) will be loaded via AJAX. To do this unobtrusively, the framework parses the link's href to formulate an AJAX request (Hijax) and displays the loading spinner. All this is done automatically by jQuery Mobile.

    +

    To enable animated page transitions, all links that point to an external page (ex. products.html) will be loaded via AJAX. To do this unobtrusively, the framework parses the link's href to formulate an AJAX request (Hijax) and displays the loading spinner. All this is done automatically by jQuery Mobile.

    -

    If the AJAX request is successful, the new page content is added to the DOM, all mobile widgets are auto-initialized, then the new page is animated into view with a page transition.

    +

    If the AJAX request is successful, the new page content is added to the DOM, all mobile widgets are auto-initialized, then the new page is animated into view with a page transition.

    -

    If the AJAX request fails, the framework will display a small error message overlay (styled in the "e" swatch) that disappears after a brief time so this doesn't break the navigation flow. View an example of the error message.

    +

    If the AJAX request fails, the framework will display a small error message overlay (styled in the "e" swatch) that disappears after a brief time so this doesn't break the navigation flow. View an example of the error message.

    -

    Note: You cannot link to a multipage document with AJAX navigation active because the framework will only load the first page it finds, not the full set of internal pages. In these cases, you must link without AJAX (see next section) for a full page refresh to prevent potential hash collisions. There is currently a subpage plugin that makes it possible to load in multi-page documents.

    +

    Note: You cannot link to a multipage document with AJAX navigation active because the framework will only load the first page it finds, not the full set of internal pages. In these cases, you must link without AJAX (see next section) for a full page refresh to prevent potential hash collisions. There is currently a subpage plugin that makes it possible to load in multi-page documents.

    -
    - Demo home -
    +
    +

    Example:

    + To the homepage, with AJAX +
    -

    Linking without AJAX

    +

    Linking without AJAX

    Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with AJAX. Instead, these links will cause a full page refresh with no animated transition. Both attributes (rel="external" and data-ajax="false") have the same effect, but a different semantic meaning: rel="external" should be used when linking to another site or domain, while data-ajax="false" is useful for simply opting a page within your domain from being loaded via AJAX. Because of security restrictions, the framework always opts links to external domains out of the AJAX behavior.

    -

    Demo home, no AJAX

    -

    Google

    +

    Examples:

    +

    To the homepage, no AJAX

    +

    Google

    In version 1.1, we added support for using data-ajax="false" on a parent container which allows you to exclude a large number of links from the AJAX navigation system. This avoids the need to add this attribute to every link in a container. To activate this functionality, $.mobile.ignoreContentEnabled must be set to true because this feature adds overhead we don't want to enable by default.

    diff --git a/docs/widgets/panels/index.php b/docs/widgets/panels/index.php index 8afa7e8b4c3..ff00c93a202 100644 --- a/docs/widgets/panels/index.php +++ b/docs/widgets/panels/index.php @@ -116,9 +116,7 @@

    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. If not, it 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 absolute positioning.

    - - Panel fixed positioning example +

    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 make it inaccessible. 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. See an example of panels with fixed positioning.

    Styling panels

    @@ -168,9 +166,7 @@

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

    - - Panel responsive example +

    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). See an example of a responsive panel page.

    diff --git a/docs/widgets/panels/panel-fixed.php b/docs/widgets/panels/panel-fixed.php index d47a091903c..1cb0f25f763 100644 --- a/docs/widgets/panels/panel-fixed.php +++ b/docs/widgets/panels/panel-fixed.php @@ -13,8 +13,8 @@ .nav-search .ui-btn-up-a { - background-image:none; - background-color:#333333; + background-image: none; + background-color: #333; } .nav-search .ui-btn-inner { border-top: 1px solid #888; @@ -37,9 +37,6 @@ display: block; margin-top: 1.2em; } - .switch .ui-slider-switch { - width: 6.5em !important; - } .ui-grid-a { margin-top: 1em; padding-top: .8em; @@ -54,22 +51,22 @@

    Fixed header

    Menu - Add + Add
    -

    Panel

    +

    Panels

    Fixed positioning

    -

    This is a typical page that has two buttons in the header bar that open panels. The left button opens a left menu with the reveal display mode. The right button opens a form in a right overlay panel. We also set position fixed for the header and footer on this page.

    +

    This is a typical page that has two buttons in the header bar that open panels. The left panel has the reveal display mode. The right panel opens as overlay. For both panels we set data-position-fixed="true". We also set position fixed for the header and footer on this page.

    -

    The left panel contains a long menu to demonstrate that the framework will check the panel contents height and unfixes the panel so its content can be scrolled.

    +

    The left panel contains a long menu to demonstrate that the framework will check the panel contents height and unfixes the panel so its content can be scrolled. In the right panel there is a short form that shows the fixed positioning.

    Responsive

    -

    To make this responsive, the panel stays open and causes the page to re-flow at wider widths. This allows both the menu and page to be used together when more space is available. This behavior is controlled by CSS media queries. You can create a custom one for a specific breakpoint or use the breakpoint preset by adding the class="ui-responsive-panel" to the page container. We have added this class on this demo page.

    +

    To make this responsive, you can make the page re-flow at wider widths. This allows both the reveal panel menu and page to be used together when more space is available. This behavior is controlled by CSS media queries. You can create a custom one for a specific breakpoint or use the breakpoint preset by adding the class="ui-responsive-panel" to the page container. We have added this class on this demo page.

    Back to Panels @@ -85,35 +82,37 @@
    @@ -122,25 +121,14 @@
    -

    Create new user

    +

    Login

    - + - - - -
    - - -
    -
    diff --git a/js/events/navigate.js b/js/events/navigate.js index 0edf414c42a..a4c5b7508d9 100644 --- a/js/events/navigate.js +++ b/js/events/navigate.js @@ -47,9 +47,11 @@ define([ return; } - if( event.historyState ){ + // GrabOne Modified + // to avoid automatic navigation when page is loaded. + /*if( event.historyState ){ $.extend(state, event.historyState); - } + }*/ // Make sure the original event is tracked for the end // user to inspect incase they want to do something special diff --git a/js/events/touch.js b/js/events/touch.js index 512a492f186..75cf1369642 100644 --- a/js/events/touch.js +++ b/js/events/touch.js @@ -44,7 +44,9 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" enabled: true, setup: function() { - + // Grabone Modified + // to reduce response time. + if (!$.mobile.isiOSApp) { var thisObject = this, $this = $( thisObject ), scrolling, @@ -71,6 +73,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" trigger( event, false ); }, 50 ); }); + } } }; diff --git a/js/jquery.mobile.buttonMarkup.js b/js/jquery.mobile.buttonMarkup.js index 36e4fa2a662..a6195d40dc3 100644 --- a/js/jquery.mobile.buttonMarkup.js +++ b/js/jquery.mobile.buttonMarkup.js @@ -52,7 +52,11 @@ $.fn.buttonMarkup = function( options ) { buttonElements; for ( key in o ) { - e.setAttribute( nsKey + key, o[ key ] ); + if ( o[ key ] === undefined || o[ key ] === null ) { + el.removeAttr( nsKey + key ); + } else { + e.setAttribute( nsKey + key, o[ key ] ); + } } if ( getAttrFixed( e, nsKey + "rel" ) === "popup" && el.attr( "href" ) ) { @@ -124,10 +128,6 @@ $.fn.buttonMarkup = function( options ) { } } - if ( o.iconpos && o.iconpos === "notext" && !el.attr( "title" ) ) { - el.attr( "title", el.getEncodedText() ); - } - if ( buttonElements ) { el.removeClass( buttonElements.bcls || "" ); } @@ -228,15 +228,19 @@ var attachEvents = function() { isTouchEvent = event.originalEvent && /^touch/.test( event.originalEvent.type ), evt = event.type; - if ( $btn.length ) { + // Grabone Modified + // to reduce response time. + if ( !isTouchEvent && $btn.length ) { theme = $btn.attr( "data-" + $.mobile.ns + "theme" ); if ( evt === "vmousedown" ) { if ( isTouchEvent ) { + // Grabone Modified + // to disable touch highlight. // Use a short delay to determine if the user is scrolling before highlighting - hov = setTimeout( function() { + /*hov = setTimeout( function() { updateButtonClass( $btn, "ui-btn-up-" + theme, "ui-btn-down-" + theme, undefined, "down" ); - }, hoverDelay ); + }, hoverDelay );*/ } else { updateButtonClass( $btn, "ui-btn-up-" + theme, "ui-btn-down-" + theme, undefined, "down" ); } @@ -244,30 +248,38 @@ var attachEvents = function() { updateButtonClass( $btn, "ui-btn-down-" + theme, "ui-btn-up-" + theme, undefined, "up" ); } else if ( evt === "vmouseover" || evt === "focus" ) { if ( isTouchEvent ) { + // Grabone Modified + // to disable touch highlight. // Use a short delay to determine if the user is scrolling before highlighting - foc = setTimeout( function() { + /*foc = setTimeout( function() { updateButtonClass( $btn, "ui-btn-up-" + theme, "ui-btn-hover-" + theme, true, "" ); - }, hoverDelay ); + }, hoverDelay );*/ } else { updateButtonClass( $btn, "ui-btn-up-" + theme, "ui-btn-hover-" + theme, true, "" ); } } else if ( evt === "vmouseout" || evt === "blur" || evt === "scrollstart" ) { updateButtonClass( $btn, "ui-btn-hover-" + theme + " ui-btn-down-" + theme, "ui-btn-up-" + theme, false, "up" ); - if ( hov ) { + + // Grabone Modified + // to disable touch highlight. + /*if ( hov ) { clearTimeout( hov ); } if ( foc ) { clearTimeout( foc ); - } + }*/ } } - }, + } + // Grabone Modified + // to reduce response time. + /*, "focusin focus": function( event ) { $( closestEnabledButton( event.target ) ).addClass( $.mobile.focusClass ); }, "focusout blur": function( event ) { $( closestEnabledButton( event.target ) ).removeClass( $.mobile.focusClass ); - } + }*/ }); attachEvents = null; diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index 58554303802..0140f4f85d4 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -32,7 +32,7 @@ define( [ "jquery", "./jquery.mobile.ns", "text!../version.txt" ], function( jQu activeBtnClass: "ui-btn-active", // Class used for "focus" form element state, from CSS framework - focusClass: "ui-focus", + focusClass: "", // Automatically handle clicks and form submissions through Ajax, when same-domain ajaxEnabled: true, @@ -44,7 +44,7 @@ define( [ "jquery", "./jquery.mobile.ns", "text!../version.txt" ], function( jQu linkBindingEnabled: true, // Set default page transition - 'none' for no transitions - defaultPageTransition: "fade", + defaultPageTransition: "slide", // Set maximum window width for transitions to apply - 'false' for no limit maxTransitionWidth: false, diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 532a9077029..cf8329f0ea4 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -78,7 +78,16 @@ define( [ //urlHistory is purely here to make guesses at whether the back or forward button was clicked //and provide an appropriate transition urlHistory = $.mobile.navigate.history, - + + // Grabone Modified + // to detect ios and android app. + isiOSApp = (/scroller/i).test(navigator.userAgent), + isAndroidApp = (/grabone.*android/i).test(navigator.userAgent), + + // Grabone Modified + // to setup vclick event. + clickEvent = (isiOSApp) ? "click vclick" : "click", + //define first selector to receive focus when a page is shown focusable = "[tabindex],a,button:visible,select:visible,input", @@ -106,6 +115,42 @@ define( [ getScreenHeight = $.mobile.getScreenHeight; + // Grabone Modified + // to get ios app version. + var iOSAppVersion = 0; + var match = navigator.userAgent.match(/scroller\/(\d+)$/i); + if (match && match.length > 1) { + iOSAppVersion = match[1]; + } + + // Grabone Modified + // to get iphone os version. + var iPhoneOSVersion = 0; + match = navigator.userAgent.match(/iphone os (\d+)/i); + if (match && match.length > 1) { + iPhoneOSVersion = match[1]; + } + + // Grabone Modified + // to get ipad os version. + var iPadOSVersion = 0; + match = navigator.userAgent.match(/ipad; cpu os (\d+)/i); + if (match && match.length > 1) { + iPadOSVersion = match[1]; + } + + // Grabone Modified + // to get android app version. + var androidAppVersion = 0; + match = navigator.userAgent.match(/^grabone mobile (\d+) .*android/i); + if (match && match.length > 1) { + androidAppVersion = match[1]; + } + + // Grabone Modified + // to show loading dialogue on jelly bean. + var isExternalDelayed = (isAndroidApp && (/android 4\./i).test(navigator.userAgent)); + //base element management, defined depending on dynamic base tag support var base = $.support.dynamicBaseTag ? { @@ -186,6 +231,9 @@ define( [ } } + // Grabone Modified + // to reduce response time. + if (!$.mobile.isiOSApp) { // Save the last scroll distance per page, before it is hidden var setLastScrollEnabled = true, setLastScroll, delayedSetLastScroll; @@ -205,6 +253,11 @@ define( [ // Set active page's lastScroll prop. // If the location we're scrolling to is less than minScrollBack, let it go. active.lastScroll = lastScroll < $.mobile.minScrollBack ? $.mobile.defaultHomeScroll : lastScroll; + // Grabone Modified + // to remember the scroll position + if ($.mobile.activePage) { + $.mobile.activePage.data('lastScroll', lastScroll); + } } }; @@ -248,7 +301,8 @@ define( [ // bind to scrollstop for the first page as "pagechange" won't be fired in that case $window.bind( "scrollstop", delayedSetLastScroll ); - + } + // No-op implementation of transition degradation $.mobile._maybeDegradeTransition = $.mobile._maybeDegradeTransition || function( transition ) { return transition; @@ -340,9 +394,44 @@ define( [ //history stack $.mobile.urlHistory = urlHistory; - + + // Grabone Modified + // to detect ios and android app. + $.mobile.isiOSApp = isiOSApp; + $.mobile.isAndroidApp = isAndroidApp; + + // Grabone Modified + // to get ios app version. + $.mobile.iOSAppVersion = iOSAppVersion; + + // Grabone Modified + // to get iphone os version. + $.mobile.iPhoneOSVersion = iPhoneOSVersion; + + // Grabone Modified + // to get ipad os version. + $.mobile.iPadOSVersion = iPadOSVersion; + + // Grabone Modified + // to get ios version. + $.mobile.iOSVersion = iPhoneOSVersion || iPadOSVersion; + + // Grabone Modified + // to get android app version. + $.mobile.androidAppVersion = androidAppVersion; + + // Grabone Modified + // to setup vclick event. + $.mobile.clickEvent = clickEvent; + $.mobile.dialogHashKey = dialogHashKey; + // Grabone Modified + // to get whether pages are transitioning. + $.mobile.isPageTransitionLocked = function(){ + return isPageTransitioning; + }; + //enable cross-domain page support $.mobile.allowCrossDomainPages = false; @@ -503,149 +592,203 @@ define( [ if ( !( $.mobile.allowCrossDomainPages || path.isSameDomain( documentUrl, absUrl ) ) ) { deferred.reject( absUrl, options ); } else { + // GrabOne Modified + // to be able to trigger fail form ajax success. + var errorCallback = function( xhr, textStatus, errorThrown ) { + // GrabOne Modified + // to workaround error triggered when accessing offline content. + if (xhr.status == 0 && xhr.responseText) { + return successCallback(xhr.responseText, 'success', xhr); + } + + //set base back to current path + if( base ) { + base.set( path.get() ); + } + + // Add error info to our triggerData. + triggerData.xhr = xhr; + triggerData.textStatus = textStatus; + triggerData.errorThrown = errorThrown; + + var plfEvent = new $.Event( "pageloadfailed" ); + + // Let listeners know the page load failed. + settings.pageContainer.trigger( plfEvent, triggerData ); + + // If the default behavior is prevented, stop here! + // Note that it is the responsibility of the listener/handler + // that called preventDefault(), to resolve/reject the + // deferred object within the triggerData. + if( plfEvent.isDefaultPrevented() ){ + return; + } + + // Remove loading message. + if ( settings.showLoadMsg ) { + + // Remove loading message. + hideMsg(); + + // show error message + $.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true ); + + // hide after delay + setTimeout( $.mobile.hidePageLoadingMsg, 1500 ); + } + + deferred.reject( absUrl, options ); + }; + + // GrabOne Modified + // to be able to trigger success form ajax error. + var successCallback = function( html, textStatus, xhr ) { + // GrabOne Modified + // to workaround 304 with undefined html in mobile safari on ios 4.3. + if (!html) { + return errorCallback(xhr, 'error', 'Not Found'); + } + + // Grabone Modified + // to workaround the limitation on redirection with cross-domain ajax. + var matches = html.match(/^Location: (.*)/) + if (matches) { + delete options.type; + delete options.data; + releasePageTransitionLock(); + $.mobile.changePage(matches[1], options); + return; + } + + //pre-parse html to check for a data-url, + //use it as the new fileUrl, base path, etc + var all = $( "
    " ), + + //page title regexp + newPageTitle = html.match( /]*>([^<]*)/ ) && RegExp.$1, + + // TODO handle dialogs again + pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>)" ), + dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" ); + + // data-url must be provided for the base tag so resource requests can be directed to the + // correct url. loading into a temprorary element makes these requests immediately + if( pageElemRegex.test( html ) + && RegExp.$1 + && dataUrlRegex.test( RegExp.$1 ) + && RegExp.$1 ) { + url = fileUrl = path.getFilePath( $( "
    " + RegExp.$1 + "
    " ).text() ); + } + + //workaround to allow scripts to execute when included in page divs + all.get( 0 ).innerHTML = html; + page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first(); + + //if page elem couldn't be found, create one and insert the body element's contents + if( !page.length ){ + page = $( "
    " + ( html.split( /<\/?body[^>]*>/gmi )[1] || "" ) + "
    " ); + } + + if ( newPageTitle && !page.jqmData( "title" ) ) { + if ( ~newPageTitle.indexOf( "&" ) ) { + newPageTitle = $( "
    " + newPageTitle + "
    " ).text(); + } + page.jqmData( "title", newPageTitle ); + } + + //rewrite src and href attrs to use a base url + if( !$.support.dynamicBaseTag ) { + var newPath = path.get( fileUrl ); + page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() { + var thisAttr = $( this ).is( '[href]' ) ? 'href' : + $(this).is('[src]') ? 'src' : 'action', + thisUrl = $( this ).attr( thisAttr ); + + // XXX_jblas: We need to fix this so that it removes the document + // base URL, and then prepends with the new page URL. + //if full path exists and is same, chop it - helps IE out + thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' ); + + if( !/^(\w+:|#|\/)/.test( thisUrl ) ) { + $( this ).attr( thisAttr, newPath + thisUrl ); + } + }); + } + + // GrabOne Modified + // to mark the page after reloaded. + if (settings.reloadPageServer) { + page.attr('data-reloaded', true); + } + + //append to page and enhance + // TODO taging a page with external to make sure that embedded pages aren't removed + // by the various page handling code is bad. Having page handling code in many + // places is bad. Solutions post 1.0 + page + .attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) ) + .attr( "data-" + $.mobile.ns + "external-page", true ) + .appendTo( settings.pageContainer ); + + // wait for page creation to leverage options defined on widget + page.one( 'pagecreate', $.mobile._bindPageRemove ); + + enhancePage( page, settings.role ); + + // Enhancing the page may result in new dialogs/sub pages being inserted + // into the DOM. If the original absUrl refers to a sub-page, that is the + // real page we are interested in. + if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) { + page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" ); + } + + // Remove loading message. + if ( settings.showLoadMsg ) { + hideMsg(); + } + + // Add the page reference and xhr to our triggerData. + triggerData.xhr = xhr; + triggerData.textStatus = textStatus; + triggerData.page = page; + + // Let listeners know the page loaded successfully. + settings.pageContainer.trigger( "pageload", triggerData ); + + deferred.resolve( absUrl, options, page, dupCachedPage ); + }; + + // GrabOne Modified + // to ensure a fresh response from server. + var headers = {}; + if (settings.reloadPageServer) { + headers['If-None-Match'] = ''; + } + if (settings.reloadPageServerAt) { + headers['Invalidate-Before'] = settings.reloadPageServerAt; + } + // Load the new page. - $.ajax({ + // GrabOne Modified + // to be able to abort the ajax request. + var xhr = $.ajax({ url: fileUrl, type: settings.type, data: settings.data, dataType: "html", - success: function( html, textStatus, xhr ) { - //pre-parse html to check for a data-url, - //use it as the new fileUrl, base path, etc - var all = $( "
    " ), - - //page title regexp - newPageTitle = html.match( /]*>([^<]*)/ ) && RegExp.$1, - - // TODO handle dialogs again - pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>)" ), - dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" ); - - - // data-url must be provided for the base tag so resource requests can be directed to the - // correct url. loading into a temprorary element makes these requests immediately - if ( pageElemRegex.test( html ) && - RegExp.$1 && - dataUrlRegex.test( RegExp.$1 ) && - RegExp.$1 ) { - url = fileUrl = path.getFilePath( $( "
    " + RegExp.$1 + "
    " ).text() ); - } - - if ( base ) { - base.set( fileUrl ); - } - - //workaround to allow scripts to execute when included in page divs - all.get( 0 ).innerHTML = html; - page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first(); - - //if page elem couldn't be found, create one and insert the body element's contents - if ( !page.length ) { - page = $( "
    " + ( html.split( /<\/?body[^>]*>/gmi )[1] || "" ) + "
    " ); - } - - if ( newPageTitle && !page.jqmData( "title" ) ) { - if ( ~newPageTitle.indexOf( "&" ) ) { - newPageTitle = $( "
    " + newPageTitle + "
    " ).text(); - } - page.jqmData( "title", newPageTitle ); - } - - //rewrite src and href attrs to use a base url - if ( !$.support.dynamicBaseTag ) { - var newPath = path.get( fileUrl ); - page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() { - var thisAttr = $( this ).is( '[href]' ) ? 'href' : - $( this ).is( '[src]' ) ? 'src' : 'action', - thisUrl = $( this ).attr( thisAttr ); - - // XXX_jblas: We need to fix this so that it removes the document - // base URL, and then prepends with the new page URL. - //if full path exists and is same, chop it - helps IE out - thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' ); - - if ( !/^(\w+:|#|\/)/.test( thisUrl ) ) { - $( this ).attr( thisAttr, newPath + thisUrl ); - } - }); - } - - //append to page and enhance - // TODO taging a page with external to make sure that embedded pages aren't removed - // by the various page handling code is bad. Having page handling code in many - // places is bad. Solutions post 1.0 - page - .attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) ) - .attr( "data-" + $.mobile.ns + "external-page", true ) - .appendTo( settings.pageContainer ); - - // wait for page creation to leverage options defined on widget - page.one( 'pagecreate', $.mobile._bindPageRemove ); - - enhancePage( page, settings.role ); - - // Enhancing the page may result in new dialogs/sub pages being inserted - // into the DOM. If the original absUrl refers to a sub-page, that is the - // real page we are interested in. - if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) { - page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" ); - } - - // Remove loading message. - if ( settings.showLoadMsg ) { - hideMsg(); - } - - // Add the page reference and xhr to our triggerData. - triggerData.xhr = xhr; - triggerData.textStatus = textStatus; - triggerData.page = page; - - // Let listeners know the page loaded successfully. - settings.pageContainer.trigger( "pageload", triggerData ); - - deferred.resolve( absUrl, options, page, dupCachedPage ); - }, - error: function( xhr, textStatus, errorThrown ) { - //set base back to current path - if ( base ) { - base.set( path.get() ); - } - - // Add error info to our triggerData. - triggerData.xhr = xhr; - triggerData.textStatus = textStatus; - triggerData.errorThrown = errorThrown; - - var plfEvent = new $.Event( "pageloadfailed" ); - - // Let listeners know the page load failed. - settings.pageContainer.trigger( plfEvent, triggerData ); - - // If the default behavior is prevented, stop here! - // Note that it is the responsibility of the listener/handler - // that called preventDefault(), to resolve/reject the - // deferred object within the triggerData. - if ( plfEvent.isDefaultPrevented() ) { - return; - } - - // Remove loading message. - if ( settings.showLoadMsg ) { - - // Remove loading message. - hideMsg(); - - // show error message - $.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true ); - - // hide after delay - setTimeout( $.mobile.hidePageLoadingMsg, 1500 ); - } - - deferred.reject( absUrl, options ); - } + // GrabOne Modified + // to distinguish between requesting a full-page and a partial. + entirePage: true, + // GrabOne Modified + // to ensure a fresh response from server. + headers: headers, //{'X-Requested-With':'XMLHttpRequest'} + success: successCallback, + error: errorCallback }); + + if (settings.xhr) { + $.mobile.xhr = xhr; + } } return deferred.promise(); @@ -746,6 +889,12 @@ define( [ //clear out the active button state removeActiveLinkClass( true ); + + // Grabone Modified + // to avoid retrying a failed page. + if (pageTransitionQueue.length > 0 && toPage == pageTransitionQueue[0][0]) { + pageTransitionQueue.pop(); + } //release transition lock so navigation is free again releasePageTransitionLock(); @@ -753,6 +902,13 @@ define( [ }); return; } + + // Grabone Modified + // to skip intermediate pages and transition only to the last. + if (pageTransitionQueue.length > 0) { + releasePageTransitionLock(); + return; + } // If we are going to the first-page of the application, we need to make // sure settings.dataUrl is set to the application document url. This allows @@ -808,6 +964,9 @@ define( [ historyDir = options.direction === "back" ? -1 : 1; } + // Grabone Modified + // to reduce response time. + if (!isiOSApp) { // Kill the keyboard. // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead, // we should be tracking focus with a delegate() handler so we already have @@ -821,6 +980,7 @@ define( [ $( "input:focus, textarea:focus, select:focus" ).blur(); } } catch( e ) {} + } // Record whether we are at a place in history where a dialog used to be - if so, do not add a new history entry and do not change the hash either var alreadyThere = false; @@ -996,6 +1156,10 @@ define( [ var getAjaxFormData = function( $form, calculateOnly ) { var type, target, url, ret = true, formData, vclickedName; if ( !$.mobile.ajaxEnabled || + // Grabone Modified + // to enable cross-domain ajax. + // (!$.mobile.allowCrossDomainPages && $form.is( "[rel='external']" )) || + $form.is( "[rel='external']" ) || // test that the form is, itself, ajax false $form.is( ":jqmData(ajax='false')" ) || // test that $.mobile.ignoreContentEnabled is set and @@ -1026,7 +1190,17 @@ define( [ url = path.makeUrlAbsolute( url, getClosestBaseUrl( $form ) ); - if ( ( path.isExternal( url ) && !path.isPermittedCrossDomainRequest( documentUrl, url ) ) || target ) { + //external submits use regular HTTP + if( path.isExternal( url ) || target ) { + // GrabOne Modified + // to show loading message when submitting to a cross-domain url. + if (navigator.onLine) { + $.mobile.showPageLoadingMsg(); + $(window).one('pagehide unload', function(){ + $.mobile.hidePageLoadingMsg(); + }); + } + return false; } @@ -1074,6 +1248,24 @@ define( [ $.mobile.changePage( formData.url, formData.options ); event.preventDefault(); } + else { + // GrabOne Modified + // to show loading message when submitting to a cross-domain url. + if (navigator.onLine) { + $.mobile.showPageLoadingMsg(); + $(window).one('pagehide unload', function(){ + $.mobile.hidePageLoadingMsg(); + }); + + // Grabone Modified + // to show loading dialogue on jelly bean. + if (isExternalDelayed && event.originalEvent) { + var $this = $(this); + setTimeout(function() { $this.submit(); }, 100); + event.preventDefault(); + } + } + } }); //add active state on vclick @@ -1144,18 +1336,18 @@ define( [ }); // click routing - direct to HTTP or Ajax, accordingly - $.mobile.document.bind( "click", function( event ) { - if ( !$.mobile.linkBindingEnabled || event.isDefaultPrevented() ) { - return; - } + $( document ).bind( clickEvent, function( event ) { + if( !$.mobile.linkBindingEnabled ){ + return; + } var link = findClosestLink( event.target ), $link = $( link ), httpCleanup; - // If there is no link associated with the click or its not a left - // click we want to ignore the click - // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping - // can be avoided - if ( !link || event.which > 1 || !$link.jqmHijackable().length ) { + // If there is no link associated with the click or its not a left + // click we want to ignore the click + // Grabone Modified + // to include middle click. + if ( !link || event.which > 2) { return; } @@ -1166,11 +1358,42 @@ define( [ //if there's a data-rel=back attr, go back in history if ( $link.is( ":jqmData(rel='back')" ) ) { - $.mobile.back(); + // GrabOne Modified + // to show loading message when going back in history. + if (navigator.onLine) { + $.mobile.showPageLoadingMsg(); + $(window).one('pagehide unload', function(){ + $.mobile.hidePageLoadingMsg(); + }); + } + + // Grabone Modified + // to avoid going back in history twice becuase of enabling vclick. + if (isiOSApp) { + if (event.type == 'vclick') { + $link.data('triggered', true); + $.mobile.back(); + } + else { + if ($link.data('triggered')) { + $link.removeData('triggered'); + } + else { + $.mobile.back(); + } + } + } + else { + $.mobile.back(); + } return false; } - var baseUrl = getClosestBaseUrl( $link ), + // Grabone Modified + // to reduce response time + // assuming we always use absolute path not relative path. + // var baseUrl = getClosestBaseUrl( $link ), + var baseUrl = documentBase.hrefNoHash, //get href, if defined, otherwise default to empty hash href = path.makeUrlAbsolute( $link.attr( "href" ) || "#", baseUrl ); @@ -1182,6 +1405,8 @@ define( [ return; } + // GrabOne Modified + // to fix when there is hash in an external url. // XXX_jblas: Ideally links to application pages should be specified as // an url to the application document with a hash that is either // the site relative path or id to the page. But some of the @@ -1191,7 +1416,7 @@ define( [ // the current value of the base tag is at the time this code // is called. For now we are just assuming that any url with a // hash in it is an application page reference. - if ( href.search( "#" ) !== -1 ) { + if ( !path.isExternal(href) && href.search( "#" ) != -1 ) { href = href.replace( /[^#]*#/, "" ); if ( !href ) { //link was an empty hash meant purely @@ -1207,8 +1432,12 @@ define( [ } } + // GrabOne Modified + // to use jquery mobile to handle target links as there is no tab in our apps. + // to workaround navigation for example from /cacher#/ to /cacher#/auckland. // Should we handle this link, or let the browser deal with it? - var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || $link.is( "[target]" ), + var u = path.parseUrl($link.attr('href')), + useDefaultUrlHandling = ($link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" )) && (u.hash == '' || location.pathname != u.pathname),// || $link.is( "[target]" ), // Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR // requests if the document doing the request was loaded via the file:// protocol. @@ -1223,6 +1452,30 @@ define( [ isExternal = useDefaultUrlHandling || ( path.isExternal( href ) && !path.isPermittedCrossDomainRequest( documentUrl, href ) ); if ( isExternal ) { + // GrabOne Modified + // to show loading message when opening a grabone cross-domain page. + var u = path.parseUrl(href); + if (navigator.onLine + && (!u.protocol || u.protocol.indexOf('http') >= 0) + && (!u.hostname || u.hostname.indexOf('grabone') >= 0) + && (!u.search || u.search.indexOf('target_blank=') < 0)) { + + $.mobile.showPageLoadingMsg(); + $(window).one('pagehide unload', function(){ + $.mobile.hidePageLoadingMsg(); + }); + + // Grabone Modified + // to show loading dialogue on jelly bean. + if (isExternalDelayed) { + href = $link.attr('href'); + if (href) { + setTimeout(function() { window.location = href; }, 100); + event.preventDefault(); + } + } + } + httpCleanup(); //use default click handling return; @@ -1233,16 +1486,21 @@ define( [ reverse = $link.jqmData( "direction" ) === "reverse" || // deprecated - remove by 1.0 $link.jqmData( "back" ), - + // Grabone Modified + // to be able to explicitly reload a page. + reloadPage = ($link.jqmData( "cache" ) === 'reload'), + //this may need to be more specific as we use data-rel more role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined; - $.mobile.changePage( href, { transition: transition, reverse: reverse, role: role, link: $link } ); + $.mobile.changePage( href, { transition: transition, reverse: reverse, role: role, link: $link, reloadPage: reloadPage } ); event.preventDefault(); }); + // Grabone Modified + // to disable default prefetch mechanism. //prefetch pages when anchors with data-prefetch are encountered - $.mobile.document.delegate( ".ui-page", "pageshow.prefetch", function() { + /*$.mobile.document.delegate( ".ui-page", "pageshow.prefetch", function() { var urls = []; $( this ).find( "a:jqmData(prefetch)" ).each(function() { var $link = $( this ), @@ -1254,7 +1512,7 @@ define( [ $.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ) } ); } }); - }); + });*/ $.mobile._handleHashChange = function( url, data ) { //find first page via hash @@ -1272,7 +1530,10 @@ define( [ }; $.extend( changePageOptions, data, { - transition: (urlHistory.getLast() || {}).transition || transition + // GrabOne Modified + // to disable transition when navigating back and forth in history. + // transition: (urlHistory.getLast() || {}).transition || transition + transition: 'none' }); // special case for dialogs @@ -1348,8 +1609,17 @@ define( [ }); //set page min-heights to be device specific - $.mobile.document.bind( "pageshow", $.mobile.resetActivePageHeight ); - $.mobile.window.bind( "throttledresize", $.mobile.resetActivePageHeight ); + // Grabone modified + // to speed up response time. + if (!isiOSApp || iPadOSVersion) { + $.mobile.document.bind( "pageshow", $.mobile.resetActivePageHeight ); + $.mobile.window.bind( "throttledresize", $.mobile.resetActivePageHeight ); + } + else { + $.mobile.document.bind( "pagecreate", function(e) { + $(e.target).css( "min-height", getScreenHeight()); + }); + } };//navreadyDeferred done callback diff --git a/js/jquery.mobile.support.js b/js/jquery.mobile.support.js index 83795a53bca..301f5608c9f 100644 --- a/js/jquery.mobile.support.js +++ b/js/jquery.mobile.support.js @@ -18,7 +18,9 @@ function propExists( prop ) { } } -var fakeBody = $( "" ).prependTo( "html" ), +// GrabOne Modified +// to avoid a flash of blank screen. +var fakeBody = $( "" ),//.prependTo( "html" ), fbCSS = fakeBody[ 0 ].style, vendors = [ "Webkit", "Moz", "O" ], webos = "palmGetResource" in window, //only used to rule out scrollTop @@ -193,6 +195,8 @@ $.extend( $.support, { // https://developers.google.com/chrome/mobile/docs/user-agent#chrome_for_ios_user-agent pushState: "pushState" in history && "replaceState" in history && + // When running inside a FF iframe, calling replaceState causes an error + !( window.navigator.userAgent.indexOf( "Firefox" ) >= 0 && window.top !== window ) && ( window.navigator.userAgent.search(/CriOS/) === -1 ), mediaquery: $.mobile.media( "only all" ), diff --git a/js/jquery.mobile.transition.js b/js/jquery.mobile.transition.js index a7411e5e683..7eecee191f8 100644 --- a/js/jquery.mobile.transition.js +++ b/js/jquery.mobile.transition.js @@ -21,11 +21,15 @@ var createHandler = function( sequential ) { var deferred = new $.Deferred(), reverseClass = reverse ? " reverse" : "", active = $.mobile.urlHistory.getActive(), - toScroll = active.lastScroll || $.mobile.defaultHomeScroll, + // Grabone Modified + // to remember the scroll position + toScroll = $to.data('lastScroll') || $.mobile.defaultHomeScroll, screenHeight = $.mobile.getScreenHeight(), - maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $.mobile.window.width() > $.mobile.maxTransitionWidth, - none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $.mobile.window.scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(), - toPreClass = " ui-page-pre-in", + // Grabone Modified + // to reduce response time. + //maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $.mobile.window.width() > $.mobile.maxTransitionWidth, + none = !$.support.cssTransitions /*|| maxTransitionOverride*/ || !name || name === "none" /*|| Math.max( $.mobile.window.scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition()*/, + //toPreClass = " ui-page-pre-in", toggleViewportClass = function() { $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name ); }, @@ -44,7 +48,9 @@ var createHandler = function( sequential ) { cleanFrom = function() { $from .removeClass( $.mobile.activePageClass + " out in reverse " + name ) - .height( "" ); + // Grabone Modified + // to reduce response time. + ;//.height( "" ); }, startOut = function() { // if it's not sequential, call the doneOut transition to start the TO page animating in simultaneously @@ -57,8 +63,9 @@ var createHandler = function( sequential ) { // Set the from page's height and start it transitioning out // Note: setting an explicit height helps eliminate tiling in the transitions - $from - .height( screenHeight + $.mobile.window.scrollTop() ) + // Grabone Modified + // to reduce response time. + $from//.height( screenHeight + $.mobile.window.scrollTop() ) .addClass( name + " out" + reverseClass ); }, @@ -74,27 +81,40 @@ var createHandler = function( sequential ) { startIn = function() { // Prevent flickering in phonegap container: see comments at #4024 regarding iOS - $to.css( "z-index", -10 ); + // Grabone Modified + // to reduce response time. + //$to.css( "z-index", -10 ); - $to.addClass( $.mobile.activePageClass + toPreClass ); + // Set to page height + $to.height( screenHeight + toScroll ); + + // Grabone Modified + // to reduce response time. + $to.addClass( $.mobile.activePageClass /*+ toPreClass*/ ); // Send focus to page as it is now display: block - $.mobile.focusPage( $to ); + // Grabone Modified + // to reduce response time. + //$.mobile.focusPage( $to ); - // Set to page height - $to.height( screenHeight + toScroll ); - - scrollPage(); + // Grabone Modified + // to reduce response time. + if (!$.mobile.isiOSApp) { + scrollPage(); + } // Restores visibility of the new page: added together with $to.css( "z-index", -10 ); - $to.css( "z-index", "" ); + // Grabone Modified + // to reduce response time. + //$to.css( "z-index", "" ); if ( !none ) { $to.animationComplete( doneIn ); } - $to - .removeClass( toPreClass ) + // Grabone Modified + // to reduce response time. + $to//.removeClass( toPreClass ) .addClass( name + " in" + reverseClass ); if ( none ) { @@ -120,9 +140,11 @@ var createHandler = function( sequential ) { // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition // This ensures we jump to that spot after the fact, if we aren't there already. - if ( $.mobile.window.scrollTop() !== toScroll ) { + // Grabone Modified + // to reduce response time. + /*if ( $.mobile.window.scrollTop() !== toScroll ) { scrollPage(); - } + }*/ deferred.resolve( name, reverse, $to, $from, true ); }; diff --git a/js/jquery.mobile.vmouse.js b/js/jquery.mobile.vmouse.js index 3760c053860..c92d0d2c54e 100644 --- a/js/jquery.mobile.vmouse.js +++ b/js/jquery.mobile.vmouse.js @@ -42,7 +42,9 @@ var dataPropertyName = "virtualMouseBindings", lastTouchID = 0, threshold; $.vmouse = { - moveDistanceThreshold: 10, + // GrabOne Modified + // to reduce accidental hit. + moveDistanceThreshold: 5, clickDistanceThreshold: 10, resetTimerDuration: 1500 }; @@ -192,9 +194,19 @@ function triggerVirtualEvent( eventType, event, flags ) { } function mouseEventCallback( event ) { - var touchID = $.data( event.target, touchTargetPropertyName ); + // GrabOne Modified + // to avoid random clicks triggered by drag-and-hold on ios. + if (didScroll && $.mobile.isiOSApp && event.type == 'click') { + event.preventDefault(); + event.stopPropagation(); + event.stopImmediatePropagation(); + return; + } + + var touchID = $.data(event.target, touchTargetPropertyName); + + if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ){ - if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ) { var ve = triggerVirtualEvent( "v" + event.type, event ); if ( ve ) { if ( ve.isDefaultPrevented() ) { @@ -307,7 +319,10 @@ function handleTouchEnd( event ) { } } triggerVirtualEvent( "vmouseout", event, flags); - didScroll = false; + + // GrabOne Modified + // to avoid random clicks triggered by drag-and-hold on ios. + // didScroll = false; startResetTimer(); } @@ -367,8 +382,8 @@ function getSpecialEventObject( eventType ) { activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0) + 1; - if ( activeDocHandlers[ "touchstart" ] === 1 ) { - $document.bind( "touchstart", handleTouchStart ) + if (activeDocHandlers[ "touchstart" ] === 1) { + /*$document.bind( "touchstart", handleTouchStart ) .bind( "touchend", handleTouchEnd ) // On touch platforms, touching the screen and then dragging your finger @@ -382,7 +397,14 @@ function getSpecialEventObject( eventType ) { // or not a scroll happenens before the touchend event is fired. .bind( "touchmove", handleTouchMove ) - .bind( "scroll", handleScroll ); + .bind( "scroll", handleScroll );*/ + + // GrabOne Modified + // to improve response time. + document.addEventListener('touchstart', handleTouchStart, false); + document.addEventListener('touchend', handleTouchEnd, false); + document.addEventListener('touchmove', handleTouchMove, false); + document.addEventListener('scroll', handleScroll, false); } } }, diff --git a/js/navigation/navigator.js b/js/navigation/navigator.js index 2ce7d406073..31961c91fa7 100644 --- a/js/navigation/navigator.js +++ b/js/navigation/navigator.js @@ -158,7 +158,9 @@ define(["jquery", // // TODO grab the original event here and use it for the synthetic event in the // second half of the navigate execution that will follow this binding - popstate: function( event ) { + // GrabOne Modified + // to avoid automatic navigation when page is loaded. + /*popstate: function( event ) { var active, hash, state, closestIndex; // Partly to support our test suite which manually alters the support @@ -231,7 +233,7 @@ define(["jquery", event.historyState.direction = direction; } }); - }, + },*/ // NOTE must bind before `navigate` special event hashchange binding otherwise the // navigation data won't be attached to the hashchange event in time for those diff --git a/js/widgets/panel.js b/js/widgets/panel.js index e537284edc3..f697d30d195 100644 --- a/js/widgets/panel.js +++ b/js/widgets/panel.js @@ -43,7 +43,7 @@ $.widget( "mobile.panel", $.mobile.widget, { _closeLink: null, _page: null, _modal: null, - _pannelInner: null, + _panelInner: null, _wrapper: null, _fixedToolbar: null, @@ -57,11 +57,11 @@ $.widget( "mobile.panel", $.mobile.widget, { return $pageThemeClass; }, _getPanelInner = function() { - var $pannelInner = $el.find( "." + self.options.classes.panelInner ); - if ( $pannelInner.length === 0 ) { - $pannelInner = $el.children().wrapAll( '
    ' ).parent(); + var $panelInner = $el.find( "." + self.options.classes.panelInner ); + if ( $panelInner.length === 0 ) { + $panelInner = $el.children().wrapAll( '
    ' ).parent(); } - return $pannelInner; + return $panelInner; }, _getWrapper = function() { var $wrapper = page.find( "." + self.options.classes.contentWrap ); @@ -90,7 +90,7 @@ $.widget( "mobile.panel", $.mobile.widget, { _closeLink: $el.find( ":jqmData(rel='close')" ), _page: $el.closest( ":jqmData(role='page')" ), _pageTheme: _getPageTheme(), - _pannelInner: _getPanelInner(), + _panelInner: _getPanelInner(), _wrapper: _getWrapper(), _fixedToolbar: _getFixedToolbar() }); @@ -165,22 +165,22 @@ $.widget( "mobile.panel", $.mobile.widget, { _positionPanel: function() { var self = this, - pannelInnerHeight = self._pannelInner.outerHeight(), - expand = pannelInnerHeight > $.mobile.getScreenHeight(); + panelInnerHeight = self._panelInner.outerHeight(), + expand = panelInnerHeight > $.mobile.getScreenHeight(); if ( expand || !self.options.positionFixed ) { if ( expand ) { self._unfixPanel(); - $.mobile.resetActivePageHeight( pannelInnerHeight ); + $.mobile.resetActivePageHeight( panelInnerHeight ); } - self._scrollIntoView( pannelInnerHeight ); + self._scrollIntoView( panelInnerHeight ); } else { self._fixPanel(); } }, - _scrollIntoView: function( pannelInnerHeight ) { - if ( pannelInnerHeight < $( window ).scrollTop() ) { + _scrollIntoView: function( panelInnerHeight ) { + if ( panelInnerHeight < $( window ).scrollTop() ) { window.scrollTo( 0, 0 ); } }, @@ -437,7 +437,7 @@ $.widget( "mobile.panel", $.mobile.widget, { } } - this._pannelInner.children().unwrap(); + this._panelInner.children().unwrap(); this.element.removeClass( [ this._getPanelClasses(), classes.panelAnimate ].join( " " ) ) .off( "swipeleft.panel swiperight.panel" )