jquery_mobile_rails 1.0rc2 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/README.rdoc +1 -1
  2. data/lib/jquery_mobile_rails/version.rb +1 -1
  3. data/vendor/assets/images/jquery-mobile/ajax-loader.png +0 -0
  4. data/vendor/assets/images/jquery-mobile/icons-18-black.png +0 -0
  5. data/vendor/assets/images/jquery-mobile/icons-18-white.png +0 -0
  6. data/vendor/assets/images/jquery-mobile/icons-36-black.png +0 -0
  7. data/vendor/assets/images/jquery-mobile/icons-36-white.png +0 -0
  8. data/vendor/assets/javascripts/jquery.mobile.js +451 -358
  9. data/vendor/assets/javascripts/jquery.mobile.min.js +163 -167
  10. data/vendor/assets/stylesheets/jquery.mobile.css.erb +250 -295
  11. data/vendor/assets/stylesheets/jquery.mobile.min.css.erb +2 -12
  12. data/vendor/assets/stylesheets/jquery.mobile.structure.css +714 -0
  13. data/vendor/assets/stylesheets/jquery.mobile.structure.min.css +2 -0
  14. metadata +16 -55
  15. data/test/dummy/db/development.sqlite3 +0 -0
  16. data/test/dummy/log/development.log +0 -1190
  17. data/test/dummy/tmp/cache/assets/C60/CD0/sprockets%2F96395d25676c3e145f2c737f9b811253 +0 -0
  18. data/test/dummy/tmp/cache/assets/CBA/160/sprockets%2F77c904cba3582ef88315030f9a39d449 +0 -0
  19. data/test/dummy/tmp/cache/assets/CD8/2C0/sprockets%2F4505f85a8dc0311824ad596b46d0b1d8 +0 -0
  20. data/test/dummy/tmp/cache/assets/CDE/910/sprockets%2F8af59305547610b5be0e9e038bb58f21 +0 -0
  21. data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
  22. data/test/dummy/tmp/cache/assets/CF3/780/sprockets%2Fc2b4847962a06be1e379f195661ec98f +0 -0
  23. data/test/dummy/tmp/cache/assets/CF6/520/sprockets%2Fa68357de390392f99ff65d1864ecc053 +0 -0
  24. data/test/dummy/tmp/cache/assets/D06/130/sprockets%2F022e8fcf6020f9aed0922654e17df114 +0 -0
  25. data/test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4 +0 -0
  26. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  27. data/test/dummy/tmp/cache/assets/D38/020/sprockets%2F36d245d9ec1d3f0b6f16e493151cc72a +0 -0
  28. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  29. data/test/dummy/tmp/cache/assets/D72/4D0/sprockets%2Fe3eb326c1536a68947ef19c55baee1e2 +0 -0
  30. data/test/dummy/tmp/cache/assets/D81/6B0/sprockets%2Fcd078298b7a8b8507fdc38be4c95a7b6 +0 -0
  31. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  32. data/test/dummy/tmp/cache/assets/DD4/190/sprockets%2F6a00e5cca788babeb65b76d61f598dd4 +0 -0
  33. data/test/dummy/tmp/cache/assets/DDC/0B0/sprockets%2F63d8cfc5e184b372b7ec77cca69d4db7 +0 -0
  34. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  35. data/test/dummy/tmp/cache/assets/E26/080/sprockets%2F2bfebfc43c7345cc7c93d4cbc21eae63 +0 -0
  36. data/test/dummy/tmp/cache/assets/E5B/BE0/sprockets%2Fac9c282fedce5fe73313ade7e4cc0dc4 +0 -0
@@ -4,7 +4,7 @@ This gem adds the JQuery Mobile files to the rails assets pipeline.
4
4
 
5
5
  ==== Gem's JQuery Mobile Version
6
6
 
7
- 1.0 beta 3
7
+ 1.0
8
8
 
9
9
  === Instalation
10
10
 
@@ -1,3 +1,3 @@
1
1
  module JqueryMobileRails
2
- VERSION = "1.0rc2"
2
+ VERSION = "1.0"
3
3
  end
@@ -1,11 +1,12 @@
1
- /*!
2
- * jQuery Mobile v1.0rc2
3
- * http://jquerymobile.com/
4
- *
5
- * Copyright 2010, jQuery Project
6
- * Dual licensed under the MIT or GPL Version 2 licenses.
7
- * http://jquery.org/license
8
- */
1
+ /*
2
+ * jQuery Mobile Framework 1.0
3
+ * http://jquerymobile.com
4
+ *
5
+ * Copyright 2011 (c) jQuery Project
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ */
9
10
  /*!
10
11
  * jQuery UI Widget @VERSION
11
12
  *
@@ -15,6 +16,7 @@
15
16
  *
16
17
  * http://docs.jquery.com/UI/Widget
17
18
  */
19
+
18
20
  (function( $, undefined ) {
19
21
 
20
22
  // jQuery 1.4+
@@ -269,10 +271,7 @@ $.Widget.prototype = {
269
271
 
270
272
  })( jQuery );
271
273
  /*
272
- * jQuery Mobile Framework : widget factory extentions for mobile
273
- * Copyright (c) jQuery Project
274
- * Dual licensed under the MIT or GPL Version 2 licenses.
275
- * http://jquery.org/license
274
+ * widget factory extentions for mobile
276
275
  */
277
276
 
278
277
  (function( $, undefined ) {
@@ -312,20 +311,18 @@ $.widget( "mobile.widget", {
312
311
  // TODO remove dependency on the page widget for the keepNative.
313
312
  // Currently the keepNative value is defined on the page prototype so
314
313
  // the method is as well
315
- var page = $(target).data( "page" ),
316
- keepNative = page && page.keepNativeSelector();
314
+ var page = $(target).closest(":jqmData(role='page')").data( "page" ),
315
+ keepNative = (page && page.keepNativeSelector()) || "";
317
316
 
318
- $( this.options.initSelector, target ).not( keepNative || "" )[ this.widgetName ]();
317
+ $( this.options.initSelector, target ).not( keepNative )[ this.widgetName ]();
319
318
  }
320
319
  });
321
320
 
322
321
  })( jQuery );
323
322
  /*
324
- * jQuery Mobile Framework : a workaround for window.matchMedia
325
- * Copyright (c) jQuery Project
326
- * Dual licensed under the MIT or GPL Version 2 licenses.
327
- * http://jquery.org/license
323
+ * a workaround for window.matchMedia
328
324
  */
325
+
329
326
  (function( $, undefined ) {
330
327
 
331
328
  var $window = $( window ),
@@ -366,10 +363,9 @@ $.mobile.media = (function() {
366
363
  };
367
364
  })();
368
365
 
369
- })(jQuery);/*
370
- * jQuery Mobile Framework : support tests
371
- * Copyright (c) jQuery Project
372
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
366
+ })(jQuery);
367
+ /*
368
+ * support tests
373
369
  */
374
370
 
375
371
  (function( $, undefined ) {
@@ -378,6 +374,7 @@ var fakeBody = $( "<body>" ).prependTo( "html" ),
378
374
  fbCSS = fakeBody[ 0 ].style,
379
375
  vendors = [ "Webkit", "Moz", "O" ],
380
376
  webos = "palmGetResource" in window, //only used to rule out scrollTop
377
+ operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]",
381
378
  bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB
382
379
 
383
380
  // thx Modernizr
@@ -440,7 +437,7 @@ $.extend( $.support, {
440
437
  cssPseudoElement: !!propExists( "content" ),
441
438
  touchOverflow: !!propExists( "overflowScrolling" ),
442
439
  boxShadow: !!propExists( "boxShadow" ) && !bb,
443
- scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos,
440
+ scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini,
444
441
  dynamicBaseTag: baseTagTest()
445
442
  });
446
443
 
@@ -466,7 +463,7 @@ $.mobile.ajaxBlacklist =
466
463
  // BlackBerry browsers, pre-webkit
467
464
  window.blackberry && !window.WebKitPoint ||
468
465
  // Opera Mini
469
- window.operamini && Object.prototype.toString.call( window.operamini ) === "[object OperaMini]" ||
466
+ operamini ||
470
467
  // Symbian webkits pre 7.3
471
468
  nokiaLTE7_3;
472
469
 
@@ -486,10 +483,7 @@ if ( !$.support.boxShadow ) {
486
483
 
487
484
  })( jQuery );
488
485
  /*
489
- * jQuery Mobile Framework : "mouse" plugin
490
- * Copyright (c) jQuery Project
491
- * Dual licensed under the MIT or GPL Version 2 licenses.
492
- * http://jquery.org/license
486
+ * "mouse" plugin
493
487
  */
494
488
 
495
489
  // This plugin is an experiment for abstracting away the touch and mouse
@@ -983,12 +977,10 @@ if ( eventCaptureSupported ) {
983
977
  }, true);
984
978
  }
985
979
  })( jQuery, window, document );
986
- /*
987
- * jQuery Mobile Framework : events
988
- * Copyright (c) jQuery Project
989
- * Dual licensed under the MIT or GPL Version 2 licenses.
990
- * http://jquery.org/license
980
+ /*
981
+ * "events" plugin - Handles events
991
982
  */
983
+
992
984
  (function( $, window, undefined ) {
993
985
 
994
986
  // add new event shortcuts
@@ -1223,7 +1215,7 @@ $.event.special.swipe = {
1223
1215
  last_orientation = orientation;
1224
1216
  win.trigger( "orientationchange" );
1225
1217
  }
1226
- };
1218
+ }
1227
1219
 
1228
1220
  // Get the current page orientation. This method is exposed publicly, should it
1229
1221
  // be needed, as jQuery.event.special.orientationchange.orientation()
@@ -1303,17 +1295,8 @@ $.each({
1303
1295
  });
1304
1296
 
1305
1297
  })( jQuery, this );
1306
- /*!
1307
- * jQuery hashchange event - v1.3 - 7/21/2010
1308
- * http://benalman.com/projects/jquery-hashchange-plugin/
1309
- *
1310
- * Copyright (c) 2010 "Cowboy" Ben Alman
1311
- * Dual licensed under the MIT and GPL licenses.
1312
- * http://benalman.com/about/license/
1313
- */
1314
-
1315
1298
  // Script: jQuery hashchange event
1316
- //
1299
+ //
1317
1300
  // *Version: 1.3, Last updated: 7/21/2010*
1318
1301
  //
1319
1302
  // Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
@@ -1694,10 +1677,7 @@ $.each({
1694
1677
 
1695
1678
  })(jQuery,this);
1696
1679
  /*
1697
- * jQuery Mobile Framework : "page" plugin
1698
- * Copyright (c) jQuery Project
1699
- * Dual licensed under the MIT or GPL Version 2 licenses.
1700
- * http://jquery.org/license
1680
+ * "page" plugin
1701
1681
  */
1702
1682
 
1703
1683
  (function( $, undefined ) {
@@ -1730,17 +1710,14 @@ $.widget( "mobile.page", $.mobile.widget, {
1730
1710
  }
1731
1711
  });
1732
1712
  })( jQuery );
1733
- /*!
1734
- * jQuery Mobile v@VERSION
1735
- * http://jquerymobile.com/
1736
- *
1737
- * Copyright 2010, jQuery Project
1738
- * Dual licensed under the MIT or GPL Version 2 licenses.
1739
- * http://jquery.org/license
1740
- */
1713
+ /*
1714
+ * "core" - The base file for jQm
1715
+ */
1741
1716
 
1742
1717
  (function( $, window, undefined ) {
1743
1718
 
1719
+ var nsNormalizeDict = {};
1720
+
1744
1721
  // jQuery.mobile configurable options
1745
1722
  $.extend( $.mobile, {
1746
1723
 
@@ -1764,6 +1741,9 @@ $.widget( "mobile.page", $.mobile.widget, {
1764
1741
  // Automatically load and show pages based on location.hash
1765
1742
  hashListeningEnabled: true,
1766
1743
 
1744
+ // disable to prevent jquery from bothering with links
1745
+ linkBindingEnabled: true,
1746
+
1767
1747
  // Set default page transition - 'none' for no transitions
1768
1748
  defaultPageTransition: "slide",
1769
1749
 
@@ -1849,24 +1829,42 @@ $.widget( "mobile.page", $.mobile.widget, {
1849
1829
  }, 150 );
1850
1830
  },
1851
1831
 
1832
+ // Expose our cache for testing purposes.
1833
+ nsNormalizeDict: nsNormalizeDict,
1834
+
1852
1835
  // Take a data attribute property, prepend the namespace
1853
- // and then camel case the attribute string
1836
+ // and then camel case the attribute string. Add the result
1837
+ // to our nsNormalizeDict so we don't have to do this again.
1854
1838
  nsNormalize: function( prop ) {
1855
1839
  if ( !prop ) {
1856
1840
  return;
1857
1841
  }
1858
1842
 
1859
- return $.camelCase( $.mobile.ns + prop );
1843
+ return nsNormalizeDict[ prop ] || ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
1860
1844
  },
1861
1845
 
1862
1846
  getInheritedTheme: function( el, defaultTheme ) {
1863
- // Find the closest parent with a theme class on it.
1864
- var themedParent = el.closest( "[class*='ui-bar-'],[class*='ui-body-']" ),
1865
-
1866
- // If there's a themed parent, extract the theme letter
1867
- // from the theme class .
1868
- ltr = ( themedParent.length && /ui-(bar|body)-([a-z])\b/.exec( themedParent.attr( "class" ) )[ 2 ] || "" ) || "";
1869
1847
 
1848
+ // Find the closest parent with a theme class on it. Note that
1849
+ // we are not using $.fn.closest() on purpose here because this
1850
+ // method gets called quite a bit and we need it to be as fast
1851
+ // as possible.
1852
+
1853
+ var e = el[ 0 ],
1854
+ ltr = "",
1855
+ re = /ui-(bar|body)-([a-z])\b/,
1856
+ c, m;
1857
+
1858
+ while ( e ) {
1859
+ var c = e.className || "";
1860
+ if ( ( m = re.exec( c ) ) && ( ltr = m[ 2 ] ) ) {
1861
+ // We found a parent with a theme class
1862
+ // on it so bail from this loop.
1863
+ break;
1864
+ }
1865
+ e = e.parentNode;
1866
+ }
1867
+
1870
1868
  // Return the theme letter we found, if none, return the
1871
1869
  // specified default.
1872
1870
 
@@ -1929,10 +1927,11 @@ $.widget( "mobile.page", $.mobile.widget, {
1929
1927
  };
1930
1928
 
1931
1929
  // Monkey-patching Sizzle to filter the :jqmData selector
1932
- var oldFind = $.find;
1930
+ var oldFind = $.find,
1931
+ jqmDataRE = /:jqmData\(([^)]*)\)/g;
1933
1932
 
1934
1933
  $.find = function( selector, context, ret, extra ) {
1935
- selector = selector.replace(/:jqmData\(([^)]*)\)/g, "[data-" + ( $.mobile.ns || "" ) + "$1]");
1934
+ selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
1936
1935
 
1937
1936
  return oldFind.call( this, selector, context, ret, extra );
1938
1937
  };
@@ -1949,11 +1948,9 @@ $.widget( "mobile.page", $.mobile.widget, {
1949
1948
  })( jQuery, this );
1950
1949
 
1951
1950
  /*
1952
- * jQuery Mobile Framework : core utilities for auto ajax navigation, base tag mgmt,
1953
- * Copyright (c) jQuery Project
1954
- * Dual licensed under the MIT or GPL Version 2 licenses.
1955
- * http://jquery.org/license
1951
+ * core utilities for auto ajax navigation, base tag mgmt,
1956
1952
  */
1953
+
1957
1954
  ( function( $, undefined ) {
1958
1955
 
1959
1956
  //define vars for interal use
@@ -2515,7 +2512,7 @@ $.widget( "mobile.page", $.mobile.widget, {
2515
2512
 
2516
2513
  //simply set the active page's minimum height to screen height, depending on orientation
2517
2514
  function getScreenHeight(){
2518
- var orientation = jQuery.event.special.orientationchange.orientation(),
2515
+ var orientation = $.event.special.orientationchange.orientation(),
2519
2516
  port = orientation === "portrait",
2520
2517
  winMin = port ? 480 : 320,
2521
2518
  screenHeight = port ? screen.availHeight : screen.availWidth,
@@ -2689,13 +2686,29 @@ $.widget( "mobile.page", $.mobile.widget, {
2689
2686
  // attribute and in need of enhancement.
2690
2687
  if ( page.length === 0 && dataUrl && !path.isPath( dataUrl ) ) {
2691
2688
  page = settings.pageContainer.children( "#" + dataUrl )
2692
- .attr( "data-" + $.mobile.ns + "url", dataUrl )
2689
+ .attr( "data-" + $.mobile.ns + "url", dataUrl );
2693
2690
  }
2694
2691
 
2695
2692
  // If we failed to find a page in the DOM, check the URL to see if it
2696
- // refers to the first page in the application.
2697
- if ( page.length === 0 && $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
2698
- page = $( $.mobile.firstPage );
2693
+ // refers to the first page in the application. If it isn't a reference
2694
+ // to the first page and refers to non-existent embedded page, error out.
2695
+ if ( page.length === 0 ) {
2696
+ if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
2697
+ // Check to make sure our cached-first-page is actually
2698
+ // in the DOM. Some user deployed apps are pruning the first
2699
+ // page from the DOM for various reasons, we check for this
2700
+ // case here because we don't want a first-page with an id
2701
+ // falling through to the non-existent embedded page error
2702
+ // case. If the first-page is not in the DOM, then we let
2703
+ // things fall through to the ajax loading code below so
2704
+ // that it gets reloaded.
2705
+ if ( $.mobile.firstPage.parent().length ) {
2706
+ page = $( $.mobile.firstPage );
2707
+ }
2708
+ } else if ( path.isEmbeddedPage( fileUrl ) ) {
2709
+ deferred.reject( absUrl, options );
2710
+ return deferred.promise();
2711
+ }
2699
2712
  }
2700
2713
 
2701
2714
  // Reset base to the default document base.
@@ -2755,7 +2768,7 @@ $.widget( "mobile.page", $.mobile.widget, {
2755
2768
  type: settings.type,
2756
2769
  data: settings.data,
2757
2770
  dataType: "html",
2758
- success: function( html ) {
2771
+ success: function( html, textStatus, xhr ) {
2759
2772
  //pre-parse html to check for a data-url,
2760
2773
  //use it as the new fileUrl, base path, etc
2761
2774
  var all = $( "<div></div>" ),
@@ -2791,6 +2804,9 @@ $.widget( "mobile.page", $.mobile.widget, {
2791
2804
  }
2792
2805
 
2793
2806
  if ( newPageTitle && !page.jqmData( "title" ) ) {
2807
+ if ( ~newPageTitle.indexOf( "&" ) ) {
2808
+ newPageTitle = $( "<div>" + newPageTitle + "</div>" ).text();
2809
+ }
2794
2810
  page.jqmData( "title", newPageTitle );
2795
2811
  }
2796
2812
 
@@ -2841,7 +2857,9 @@ $.widget( "mobile.page", $.mobile.widget, {
2841
2857
  hideMsg();
2842
2858
  }
2843
2859
 
2844
- // Add the page reference to our triggerData.
2860
+ // Add the page reference and xhr to our triggerData.
2861
+ triggerData.xhr = xhr;
2862
+ triggerData.textStatus = textStatus;
2845
2863
  triggerData.page = page;
2846
2864
 
2847
2865
  // Let listeners know the page loaded successfully.
@@ -2849,12 +2867,17 @@ $.widget( "mobile.page", $.mobile.widget, {
2849
2867
 
2850
2868
  deferred.resolve( absUrl, options, page, dupCachedPage );
2851
2869
  },
2852
- error: function() {
2870
+ error: function( xhr, textStatus, errorThrown ) {
2853
2871
  //set base back to current path
2854
2872
  if( base ) {
2855
2873
  base.set( path.get() );
2856
2874
  }
2857
2875
 
2876
+ // Add error info to our triggerData.
2877
+ triggerData.xhr = xhr;
2878
+ triggerData.textStatus = textStatus;
2879
+ triggerData.errorThrown = errorThrown;
2880
+
2858
2881
  var plfEvent = new $.Event( "pageloadfailed" );
2859
2882
 
2860
2883
  // Let listeners know the page load failed.
@@ -3025,7 +3048,11 @@ $.widget( "mobile.page", $.mobile.widget, {
3025
3048
  // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
3026
3049
  // is undefined when we are in an IFrame.
3027
3050
  try {
3028
- $( document.activeElement || "" ).add( "input:focus, textarea:focus, select:focus" ).blur();
3051
+ if(document.activeElement && document.activeElement.nodeName.toLowerCase() != 'body') {
3052
+ $(document.activeElement).blur();
3053
+ } else {
3054
+ $( "input:focus, textarea:focus, select:focus" ).blur();
3055
+ }
3029
3056
  } catch(e) {}
3030
3057
 
3031
3058
  // If we're displaying the page as a dialog, we don't want the url
@@ -3047,11 +3074,15 @@ $.widget( "mobile.page", $.mobile.widget, {
3047
3074
  path.set( url );
3048
3075
  }
3049
3076
 
3050
- //if title element wasn't found, try the page div data attr too
3051
- var newPageTitle = toPage.jqmData( "title" ) || toPage.children(":jqmData(role='header')").find(".ui-title" ).getEncodedText();
3077
+ // if title element wasn't found, try the page div data attr too
3078
+ // If this is a deep-link or a reload ( active === undefined ) then just use pageTitle
3079
+ var newPageTitle = ( !active )? pageTitle : toPage.jqmData( "title" ) || toPage.children(":jqmData(role='header')").find(".ui-title" ).getEncodedText();
3052
3080
  if( !!newPageTitle && pageTitle == document.title ) {
3053
3081
  pageTitle = newPageTitle;
3054
3082
  }
3083
+ if ( !toPage.jqmData( "title" ) ) {
3084
+ toPage.jqmData( "title", pageTitle );
3085
+ }
3055
3086
 
3056
3087
  // Make sure we have a transition defined.
3057
3088
  settings.transition = settings.transition
@@ -3109,7 +3140,14 @@ $.widget( "mobile.page", $.mobile.widget, {
3109
3140
  function findClosestLink( ele )
3110
3141
  {
3111
3142
  while ( ele ) {
3112
- if ( ele.nodeName.toLowerCase() == "a" ) {
3143
+ // Look for the closest element with a nodeName of "a".
3144
+ // Note that we are checking if we have a valid nodeName
3145
+ // before attempting to access it. This is because the
3146
+ // node we get called with could have originated from within
3147
+ // an embedded SVG document where some symbol instance elements
3148
+ // don't have nodeName defined on them, or strings are of type
3149
+ // SVGAnimatedString.
3150
+ if ( ( typeof ele.nodeName === "string" ) && ele.nodeName.toLowerCase() == "a" ) {
3113
3151
  break;
3114
3152
  }
3115
3153
  ele = ele.parentNode;
@@ -3189,7 +3227,7 @@ $.widget( "mobile.page", $.mobile.widget, {
3189
3227
  $( document ).bind( "vclick", function( event ) {
3190
3228
  // if this isn't a left click we don't care. Its important to note
3191
3229
  // that when the virtual event is generated it will create
3192
- if ( event.which > 1 ){
3230
+ if ( event.which > 1 || !$.mobile.linkBindingEnabled ){
3193
3231
  return;
3194
3232
  }
3195
3233
 
@@ -3206,6 +3244,10 @@ $.widget( "mobile.page", $.mobile.widget, {
3206
3244
 
3207
3245
  // click routing - direct to HTTP or Ajax, accordingly
3208
3246
  $( document ).bind( "click", function( event ) {
3247
+ if( !$.mobile.linkBindingEnabled ){
3248
+ return;
3249
+ }
3250
+
3209
3251
  var link = findClosestLink( event.target );
3210
3252
 
3211
3253
  // If there is no link associated with the click or its not a left
@@ -3403,11 +3445,9 @@ $.widget( "mobile.page", $.mobile.widget, {
3403
3445
 
3404
3446
  })( jQuery );
3405
3447
  /*
3406
- * jQuery Mobile Framework : history.pushState support, layered on top of hashchange
3407
- * Copyright (c) jQuery Project
3408
- * Dual licensed under the MIT or GPL Version 2 licenses.
3409
- * http://jquery.org/license
3448
+ * history.pushState support, layered on top of hashchange
3410
3449
  */
3450
+
3411
3451
  ( function( $, window ) {
3412
3452
  // For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents
3413
3453
  // Scope self to pushStateHandler so we can reference it sanely within the
@@ -3537,14 +3577,10 @@ $.widget( "mobile.page", $.mobile.widget, {
3537
3577
  pushStateHandler.init();
3538
3578
  }
3539
3579
  });
3540
- })( jQuery, this );/*!
3541
- * jQuery Mobile v@VERSION
3542
- * http://jquerymobile.com/
3543
- *
3544
- * Copyright 2010, jQuery Project
3545
- * Dual licensed under the MIT or GPL Version 2 licenses.
3546
- * http://jquery.org/license
3547
- */
3580
+ })( jQuery, this );
3581
+ /*
3582
+ * "transitions" plugin - Page change tranistions
3583
+ */
3548
3584
 
3549
3585
  (function( $, window, undefined ) {
3550
3586
 
@@ -3588,10 +3624,7 @@ if ( $.mobile.defaultTransitionHandler === $.mobile.noneTransitionHandler ) {
3588
3624
 
3589
3625
  })( jQuery, this );
3590
3626
  /*
3591
- * jQuery Mobile Framework : "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made.
3592
- * Copyright (c) jQuery Project
3593
- * Dual licensed under the MIT or GPL Version 2 licenses.
3594
- * http://jquery.org/license
3627
+ * "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made.
3595
3628
  */
3596
3629
 
3597
3630
  (function( $, undefined ) {
@@ -3644,9 +3677,7 @@ $( document ).bind( "pagecreate create", function( e ){
3644
3677
  });
3645
3678
 
3646
3679
  })( jQuery );/*
3647
- * jQuery Mobile Framework : "dialog" plugin.
3648
- * Copyright (c) jQuery Project
3649
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
3680
+ * "dialog" plugin.
3650
3681
  */
3651
3682
 
3652
3683
  (function( $, window, undefined ) {
@@ -3654,20 +3685,15 @@ $( document ).bind( "pagecreate create", function( e ){
3654
3685
  $.widget( "mobile.dialog", $.mobile.widget, {
3655
3686
  options: {
3656
3687
  closeBtnText : "Close",
3657
- theme : "a",
3688
+ overlayTheme : "a",
3658
3689
  initSelector : ":jqmData(role='dialog')"
3659
3690
  },
3660
3691
  _create: function() {
3661
3692
  var self = this,
3662
3693
  $el = this.element,
3663
- pageTheme = $el.attr( "class" ).match( /ui-body-[a-z]/ ),
3664
3694
  headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" );
3665
3695
 
3666
- if( pageTheme.length ){
3667
- $el.removeClass( pageTheme[ 0 ] );
3668
- }
3669
-
3670
- $el.addClass( "ui-body-" + this.options.theme );
3696
+ $el.addClass( "ui-overlay-" + this.options.overlayTheme );
3671
3697
 
3672
3698
  // Class the markup for dialog styling
3673
3699
  // Set aria role
@@ -3678,8 +3704,9 @@ $.widget( "mobile.dialog", $.mobile.widget, {
3678
3704
  .prepend( headerCloseButton )
3679
3705
  .end()
3680
3706
  .find( ":jqmData(role='content'),:jqmData(role='footer')" )
3707
+ .addClass( "ui-overlay-shadow" )
3681
3708
  .last()
3682
- .addClass( "ui-corner-bottom ui-overlay-shadow" );
3709
+ .addClass( "ui-corner-bottom" );
3683
3710
 
3684
3711
  // this must be an anonymous function so that select menu dialogs can replace
3685
3712
  // the close method. This is a change from previously just defining data-rel=back
@@ -3723,10 +3750,7 @@ $( $.mobile.dialog.prototype.options.initSelector ).live( "pagecreate", function
3723
3750
 
3724
3751
  })( jQuery, this );
3725
3752
  /*
3726
- * jQuery Mobile Framework : This plugin handles theming and layout of headers, footers, and content areas
3727
- * Copyright (c) jQuery Project
3728
- * Dual licensed under the MIT or GPL Version 2 licenses.
3729
- * http://jquery.org/license
3753
+ * This plugin handles theming and layout of headers, footers, and content areas
3730
3754
  */
3731
3755
 
3732
3756
  (function( $, undefined ) {
@@ -3742,12 +3766,14 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
3742
3766
 
3743
3767
  var $page = $( this ),
3744
3768
  o = $page.data( "page" ).options,
3769
+ pageRole = $page.jqmData( "role" ),
3745
3770
  pageTheme = o.theme;
3746
3771
 
3747
3772
  $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", this ).each(function() {
3748
3773
  var $this = $( this ),
3749
3774
  role = $this.jqmData( "role" ),
3750
3775
  theme = $this.jqmData( "theme" ),
3776
+ contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
3751
3777
  $headeranchors,
3752
3778
  leftbtn,
3753
3779
  rightbtn,
@@ -3799,8 +3825,8 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
3799
3825
  });
3800
3826
 
3801
3827
  } else if ( role === "content" ) {
3802
- if (theme || o.contentTheme) {
3803
- $this.addClass( "ui-body-" + ( theme || o.contentTheme ) );
3828
+ if ( contentTheme ) {
3829
+ $this.addClass( "ui-body-" + ( contentTheme ) );
3804
3830
  }
3805
3831
 
3806
3832
  // Add ARIA role
@@ -3810,11 +3836,9 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
3810
3836
  });
3811
3837
 
3812
3838
  })( jQuery );/*
3813
- * jQuery Mobile Framework : "collapsible" plugin
3814
- * Copyright (c) jQuery Project
3815
- * Dual licensed under the MIT or GPL Version 2 licenses.
3816
- * http://jquery.org/license
3839
+ * "collapsible" plugin
3817
3840
  */
3841
+
3818
3842
  (function( $, undefined ) {
3819
3843
 
3820
3844
  $.widget( "mobile.collapsible", $.mobile.widget, {
@@ -3822,7 +3846,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3822
3846
  expandCueText: " click to expand contents",
3823
3847
  collapseCueText: " click to collapse contents",
3824
3848
  collapsed: true,
3825
- heading: ">:header,>legend",
3849
+ heading: "h1,h2,h3,h4,h5,h6,legend",
3826
3850
  theme: null,
3827
3851
  contentTheme: null,
3828
3852
  iconTheme: "d",
@@ -3833,10 +3857,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3833
3857
  var $el = this.element,
3834
3858
  o = this.options,
3835
3859
  collapsible = $el.addClass( "ui-collapsible" ),
3836
- collapsibleHeading = $el.find( o.heading ).eq( 0 ),
3860
+ collapsibleHeading = $el.children( o.heading ).first(),
3837
3861
  collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).find( ".ui-collapsible-content" ),
3838
- collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ),
3839
- colllapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" );
3862
+ collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );
3840
3863
 
3841
3864
  // Replace collapsibleHeading if it's a legend
3842
3865
  if ( collapsibleHeading.is( "legend" ) ) {
@@ -3865,57 +3888,17 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3865
3888
  .addClass( "ui-collapsible-heading" )
3866
3889
  .append( "<span class='ui-collapsible-heading-status'></span>" )
3867
3890
  .wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
3868
- .find( "a:eq(0)" )
3891
+ .find( "a" )
3892
+ .first()
3869
3893
  .buttonMarkup({
3870
3894
  shadow: false,
3871
3895
  corners: false,
3872
3896
  iconPos: "left",
3873
3897
  icon: "plus",
3874
3898
  theme: o.theme
3875
- });
3876
-
3877
- if ( !collapsibleSet.length ) {
3878
- collapsibleHeading
3879
- .find( "a:eq(0), .ui-btn-inner" )
3880
- .addClass( "ui-corner-top ui-corner-bottom" );
3881
- } else {
3882
- // If we are in a collapsible set
3883
-
3884
- // Initialize the collapsible set if it's not already initialized
3885
- if ( !collapsibleSet.jqmData( "collapsiblebound" ) ) {
3886
-
3887
- collapsibleSet
3888
- .jqmData( "collapsiblebound", true )
3889
- .bind( "expand", function( event ) {
3890
-
3891
- $( event.target )
3892
- .closest( ".ui-collapsible" )
3893
- .siblings( ".ui-collapsible" )
3894
- .trigger( "collapse" );
3895
-
3896
- });
3897
- }
3898
-
3899
- colllapsiblesInSet.first()
3900
- .find( "a:eq(0)" )
3901
- .addClass( "ui-corner-top" )
3902
- .find( ".ui-btn-inner" )
3903
- .addClass( "ui-corner-top" );
3904
-
3905
- colllapsiblesInSet.last()
3906
- .jqmData( "collapsible-last", true )
3907
- .find( "a:eq(0)" )
3908
- .addClass( "ui-corner-bottom" )
3909
- .find( ".ui-btn-inner" )
3910
- .addClass( "ui-corner-bottom" );
3911
-
3912
-
3913
- if ( collapsible.jqmData( "collapsible-last" ) ) {
3914
- collapsibleHeading
3915
- .find( "a:eq(0), .ui-btn-inner" )
3916
- .addClass( "ui-corner-bottom" );
3917
- }
3918
- }
3899
+ })
3900
+ .add( ".ui-btn-inner" )
3901
+ .addClass( "ui-corner-top ui-corner-bottom" );
3919
3902
 
3920
3903
  //events
3921
3904
  collapsible
@@ -3942,7 +3925,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3942
3925
 
3943
3926
  if ( contentTheme && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) {
3944
3927
  collapsibleHeading
3945
- .find( "a:eq(0), .ui-btn-inner" )
3928
+ .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
3946
3929
  .toggleClass( "ui-corner-bottom", isCollapse );
3947
3930
  collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse );
3948
3931
  }
@@ -3971,10 +3954,7 @@ $( document ).bind( "pagecreate create", function( e ){
3971
3954
 
3972
3955
  })( jQuery );
3973
3956
  /*
3974
- * jQuery Mobile Framework : "fieldcontain" plugin - simple class additions to make form row separators
3975
- * Copyright (c) jQuery Project
3976
- * Dual licensed under the MIT or GPL Version 2 licenses.
3977
- * http://jquery.org/license
3957
+ * "fieldcontain" plugin - simple class additions to make form row separators
3978
3958
  */
3979
3959
 
3980
3960
  (function( $, undefined ) {
@@ -3989,10 +3969,7 @@ $( document ).bind( "pagecreate create", function( e ){
3989
3969
  });
3990
3970
 
3991
3971
  })( jQuery );/*
3992
- * jQuery Mobile Framework : plugin for creating CSS grids
3993
- * Copyright (c) jQuery Project
3994
- * Dual licensed under the MIT or GPL Version 2 licenses.
3995
- * http://jquery.org/license
3972
+ * plugin for creating CSS grids
3996
3973
  */
3997
3974
 
3998
3975
  (function( $, undefined ) {
@@ -4041,10 +4018,7 @@ $.fn.grid = function( options ) {
4041
4018
  });
4042
4019
  };
4043
4020
  })( jQuery );/*
4044
- * jQuery Mobile Framework : "navbar" plugin
4045
- * Copyright (c) jQuery Project
4046
- * Dual licensed under the MIT or GPL Version 2 licenses.
4047
- * http://jquery.org/license
4021
+ * "navbar" plugin
4048
4022
  */
4049
4023
 
4050
4024
  (function( $, undefined ) {
@@ -4092,10 +4066,7 @@ $( document ).bind( "pagecreate create", function( e ){
4092
4066
 
4093
4067
  })( jQuery );
4094
4068
  /*
4095
- * jQuery Mobile Framework : "listview" plugin
4096
- * Copyright (c) jQuery Project
4097
- * Dual licensed under the MIT or GPL Version 2 licenses.
4098
- * http://jquery.org/license
4069
+ * "listview" plugin
4099
4070
  */
4100
4071
 
4101
4072
  (function( $, undefined ) {
@@ -4107,7 +4078,7 @@ var listCountPerPage = {};
4107
4078
 
4108
4079
  $.widget( "mobile.listview", $.mobile.widget, {
4109
4080
  options: {
4110
- theme: "c",
4081
+ theme: null,
4111
4082
  countTheme: "c",
4112
4083
  headerTheme: "b",
4113
4084
  dividerTheme: "b",
@@ -4128,25 +4099,6 @@ $.widget( "mobile.listview", $.mobile.widget, {
4128
4099
  t.refresh( true );
4129
4100
  },
4130
4101
 
4131
- _itemApply: function( $list, item ) {
4132
- var $countli = item.find( ".ui-li-count" );
4133
- if ( $countli.length ) {
4134
- item.addClass( "ui-li-has-count" );
4135
- }
4136
- $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
4137
-
4138
- // TODO class has to be defined in markup
4139
- item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
4140
- .find( "p, dl" ).addClass( "ui-li-desc" ).end()
4141
- .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
4142
- item.addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
4143
- }).end()
4144
- .find( ".ui-li-aside" ).each(function() {
4145
- var $this = $(this);
4146
- $this.prependTo( $this.parent() ); //shift aside to front for css float
4147
- });
4148
- },
4149
-
4150
4102
  _removeCorners: function( li, which ) {
4151
4103
  var top = "ui-corner-top ui-corner-tr ui-corner-tl",
4152
4104
  bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
@@ -4179,8 +4131,11 @@ $.widget( "mobile.listview", $.mobile.widget, {
4179
4131
  $topli = $visibleli.first()
4180
4132
  .addClass( "ui-corner-top" );
4181
4133
 
4182
- $topli.add( $topli.find( ".ui-btn-inner" ) )
4183
- .find( ".ui-li-link-alt" )
4134
+ $topli.add( $topli.find( ".ui-btn-inner" )
4135
+ .not( ".ui-li-link-alt span:first-child" ) )
4136
+ .addClass( "ui-corner-top" )
4137
+ .end()
4138
+ .find( ".ui-li-link-alt, .ui-li-link-alt span:first-child" )
4184
4139
  .addClass( "ui-corner-tr" )
4185
4140
  .end()
4186
4141
  .find( ".ui-li-thumb" )
@@ -4204,6 +4159,56 @@ $.widget( "mobile.listview", $.mobile.widget, {
4204
4159
  }
4205
4160
  },
4206
4161
 
4162
+ // This is a generic utility method for finding the first
4163
+ // node with a given nodeName. It uses basic DOM traversal
4164
+ // to be fast and is meant to be a substitute for simple
4165
+ // $.fn.closest() and $.fn.children() calls on a single
4166
+ // element. Note that callers must pass both the lowerCase
4167
+ // and upperCase version of the nodeName they are looking for.
4168
+ // The main reason for this is that this function will be
4169
+ // called many times and we want to avoid having to lowercase
4170
+ // the nodeName from the element every time to ensure we have
4171
+ // a match. Note that this function lives here for now, but may
4172
+ // be moved into $.mobile if other components need a similar method.
4173
+ _findFirstElementByTagName: function( ele, nextProp, lcName, ucName )
4174
+ {
4175
+ var dict = {};
4176
+ dict[ lcName ] = dict[ ucName ] = true;
4177
+ while ( ele ) {
4178
+ if ( dict[ ele.nodeName ] ) {
4179
+ return ele;
4180
+ }
4181
+ ele = ele[ nextProp ];
4182
+ }
4183
+ return null;
4184
+ },
4185
+ _getChildrenByTagName: function( ele, lcName, ucName )
4186
+ {
4187
+ var results = [],
4188
+ dict = {};
4189
+ dict[ lcName ] = dict[ ucName ] = true;
4190
+ ele = ele.firstChild;
4191
+ while ( ele ) {
4192
+ if ( dict[ ele.nodeName ] ) {
4193
+ results.push( ele );
4194
+ }
4195
+ ele = ele.nextSibling;
4196
+ }
4197
+ return $( results );
4198
+ },
4199
+
4200
+ _addThumbClasses: function( containers )
4201
+ {
4202
+ var i, img, len = containers.length;
4203
+ for ( i = 0; i < len; i++ ) {
4204
+ img = $( this._findFirstElementByTagName( containers[ i ].firstChild, "nextSibling", "img", "IMG" ) );
4205
+ if ( img.length ) {
4206
+ img.addClass( "ui-li-thumb" );
4207
+ $( this._findFirstElementByTagName( img[ 0 ].parentNode, "parentNode", "li", "LI" ) ).addClass( img.is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
4208
+ }
4209
+ }
4210
+ },
4211
+
4207
4212
  refresh: function( create ) {
4208
4213
  this.parentPage = this.element.closest( ".ui-page" );
4209
4214
  this._createSubPages();
@@ -4214,14 +4219,19 @@ $.widget( "mobile.listview", $.mobile.widget, {
4214
4219
  dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
4215
4220
  listsplittheme = $list.jqmData( "splittheme" ),
4216
4221
  listspliticon = $list.jqmData( "spliticon" ),
4217
- li = $list.children( "li" ),
4222
+ li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
4218
4223
  counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
4224
+ itemClassDict = {},
4219
4225
  item, itemClass, itemTheme,
4220
- a, last, splittheme, countParent, icon;
4226
+ a, last, splittheme, countParent, icon, imgParents, img;
4221
4227
 
4222
4228
  if ( counter ) {
4223
4229
  $list.find( ".ui-li-dec" ).remove();
4224
4230
  }
4231
+
4232
+ if ( !o.theme ) {
4233
+ o.theme = $.mobile.getInheritedTheme( this.element, "c" );
4234
+ }
4225
4235
 
4226
4236
  for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {
4227
4237
  item = li.eq( pos );
@@ -4230,7 +4240,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
4230
4240
  // If we're creating the element, we update it regardless
4231
4241
  if ( create || !item.hasClass( "ui-li" ) ) {
4232
4242
  itemTheme = item.jqmData("theme") || o.theme;
4233
- a = item.children( "a" );
4243
+ a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
4234
4244
 
4235
4245
  if ( a.length ) {
4236
4246
  icon = item.jqmData("icon");
@@ -4269,7 +4279,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
4269
4279
  })
4270
4280
  .find( ".ui-btn-inner" )
4271
4281
  .append(
4272
- $( "<span />" ).buttonMarkup({
4282
+ $( document.createElement( "span" ) ).buttonMarkup({
4273
4283
  shadow: true,
4274
4284
  corners: true,
4275
4285
  theme: splittheme,
@@ -4300,11 +4310,59 @@ $.widget( "mobile.listview", $.mobile.widget, {
4300
4310
  .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
4301
4311
  }
4302
4312
 
4303
- item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
4313
+ // Instead of setting item class directly on the list item and its
4314
+ // btn-inner at this point in time, push the item into a dictionary
4315
+ // that tells us what class to set on it so we can do this after this
4316
+ // processing loop is finished.
4317
+
4318
+ if ( !itemClassDict[ itemClass ] ) {
4319
+ itemClassDict[ itemClass ] = [];
4320
+ }
4321
+
4322
+ itemClassDict[ itemClass ].push( item[ 0 ] );
4323
+ }
4324
+
4325
+ // Set the appropriate listview item classes on each list item
4326
+ // and their btn-inner elements. The main reason we didn't do this
4327
+ // in the for-loop above is because we can eliminate per-item function overhead
4328
+ // by calling addClass() and children() once or twice afterwards. This
4329
+ // can give us a significant boost on platforms like WP7.5.
4304
4330
 
4305
- self._itemApply( $list, item );
4331
+ for ( itemClass in itemClassDict ) {
4332
+ $( itemClassDict[ itemClass ] ).addClass( itemClass ).children( ".ui-btn-inner" ).addClass( itemClass );
4306
4333
  }
4307
4334
 
4335
+ $list.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" )
4336
+ .end()
4337
+
4338
+ .find( "p, dl" ).addClass( "ui-li-desc" )
4339
+ .end()
4340
+
4341
+ .find( ".ui-li-aside" ).each(function() {
4342
+ var $this = $(this);
4343
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
4344
+ })
4345
+ .end()
4346
+
4347
+ .find( ".ui-li-count" ).each( function() {
4348
+ $( this ).closest( "li" ).addClass( "ui-li-has-count" );
4349
+ }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
4350
+
4351
+ // The idea here is to look at the first image in the list item
4352
+ // itself, and any .ui-link-inherit element it may contain, so we
4353
+ // can place the appropriate classes on the image and list item.
4354
+ // Note that we used to use something like:
4355
+ //
4356
+ // li.find(">img:eq(0), .ui-link-inherit>img:eq(0)").each( ... );
4357
+ //
4358
+ // But executing a find() like that on Windows Phone 7.5 took a
4359
+ // really long time. Walking things manually with the code below
4360
+ // allows the 400 listview item page to load in about 3 seconds as
4361
+ // opposed to 30 seconds.
4362
+
4363
+ this._addThumbClasses( li );
4364
+ this._addThumbClasses( $list.find( ".ui-link-inherit" ) );
4365
+
4308
4366
  this._refreshCorners( create );
4309
4367
  },
4310
4368
 
@@ -4407,10 +4465,7 @@ $( document ).bind( "pagecreate create", function( e ){
4407
4465
 
4408
4466
  })( jQuery );
4409
4467
  /*
4410
- * jQuery Mobile Framework : "listview" filter extension
4411
- * Copyright (c) jQuery Project
4412
- * Dual licensed under the MIT or GPL Version 2 licenses.
4413
- * http://jquery.org/license
4468
+ * "listview" filter extension
4414
4469
  */
4415
4470
 
4416
4471
  (function( $, undefined ) {
@@ -4452,12 +4507,11 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
4452
4507
 
4453
4508
  // Change val as lastval for next execution
4454
4509
  $this.jqmData( "lastval" , val );
4455
-
4456
- change = val.replace( new RegExp( "^" + lastval ) , "" );
4510
+ change = val.substr( 0 , lastval.length - 1 ).replace( lastval , "" );
4457
4511
 
4458
4512
  if ( val.length < lastval.length || change.length != ( val.length - lastval.length ) ) {
4459
4513
 
4460
- // Removed chars or pasted something totaly different, check all items
4514
+ // Removed chars or pasted something totally different, check all items
4461
4515
  listItems = list.children();
4462
4516
  } else {
4463
4517
 
@@ -4487,7 +4541,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
4487
4541
  item.toggleClass( "ui-filter-hidequeue" , true );
4488
4542
  } else {
4489
4543
 
4490
- // There"s a shown item in the bucket
4544
+ // There's a shown item in the bucket
4491
4545
  childItems = true;
4492
4546
  }
4493
4547
  }
@@ -4524,10 +4578,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
4524
4578
  });
4525
4579
 
4526
4580
  })( jQuery );/*
4527
- * jQuery Mobile Framework : "nojs" plugin - class to make elements hidden to A grade browsers
4528
- * Copyright (c) jQuery Project
4529
- * Dual licensed under the MIT or GPL Version 2 licenses.
4530
- * http://jquery.org/license
4581
+ * "nojs" plugin - class to make elements hidden to A grade browsers
4531
4582
  */
4532
4583
 
4533
4584
  (function( $, undefined ) {
@@ -4538,10 +4589,7 @@ $( document ).bind( "pagecreate create", function( e ){
4538
4589
  });
4539
4590
 
4540
4591
  })( jQuery );/*
4541
- * jQuery Mobile Framework : "checkboxradio" plugin
4542
- * Copyright (c) jQuery Project
4543
- * Dual licensed under the MIT or GPL Version 2 licenses.
4544
- * http://jquery.org/license
4592
+ * "checkboxradio" plugin
4545
4593
  */
4546
4594
 
4547
4595
  (function( $, undefined ) {
@@ -4556,7 +4604,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4556
4604
  input = this.element,
4557
4605
  // NOTE: Windows Phone could not find the label through a selector
4558
4606
  // filter works though.
4559
- label = input.closest( "form,fieldset,:jqmData(role='page')" ).find( "label" ).filter( "[for='" + input[ 0 ].id + "']"),
4607
+ label = input.closest( "form,fieldset,:jqmData(role='page')" ).find( "label[for='" + input[ 0 ].id + "']"),
4560
4608
  inputtype = input.attr( "type" ),
4561
4609
  checkedState = inputtype + "-on",
4562
4610
  uncheckedState = inputtype + "-off",
@@ -4613,6 +4661,13 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4613
4661
 
4614
4662
  input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) );
4615
4663
 
4664
+ // trigger click handler's bound directly to the input as a substitute for
4665
+ // how label clicks behave normally in the browsers
4666
+ // TODO: it would be nice to let the browser's handle the clicks and pass them
4667
+ // through to the associate input. we can swallow that click at the parent
4668
+ // wrapper element level
4669
+ input.triggerHandler( 'click' );
4670
+
4616
4671
  // Input set for common radio buttons will contain all the radio
4617
4672
  // buttons, but will not for checkboxes. clearing the checked status
4618
4673
  // of other radios ensures the active button state is applied properly
@@ -4627,11 +4682,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4627
4682
  input
4628
4683
  .bind({
4629
4684
  vmousedown: function() {
4630
- this._cacheVals();
4685
+ self._cacheVals();
4631
4686
  },
4632
4687
 
4633
4688
  vclick: function() {
4634
-
4635
4689
  var $this = $(this);
4636
4690
 
4637
4691
  // Adds checked attribute to checked input when keyboard is used
@@ -4731,10 +4785,7 @@ $( document ).bind( "pagecreate create", function( e ){
4731
4785
 
4732
4786
  })( jQuery );
4733
4787
  /*
4734
- * jQuery Mobile Framework : "button" plugin - links that proxy to native input/buttons
4735
- * Copyright (c) jQuery Project
4736
- * Dual licensed under the MIT or GPL Version 2 licenses.
4737
- * http://jquery.org/license
4788
+ * "button" plugin - links that proxy to native input/buttons
4738
4789
  */
4739
4790
 
4740
4791
  (function( $, undefined ) {
@@ -4781,15 +4832,18 @@ $.widget( "mobile.button", $.mobile.widget, {
4781
4832
  // Add hidden input if it doesn’t already exist.
4782
4833
  if( $buttonPlaceholder === undefined ) {
4783
4834
  $buttonPlaceholder = $( "<input>", {
4784
- type: "hidden",
4785
- name: $el.attr( "name" ),
4786
- value: $el.attr( "value" )
4787
- })
4788
- .insertBefore( $el );
4835
+ type: "hidden",
4836
+ name: $el.attr( "name" ),
4837
+ value: $el.attr( "value" )
4838
+ }).insertBefore( $el );
4789
4839
 
4790
4840
  // Bind to doc to remove after submit handling
4791
- $( document ).submit(function(){
4792
- $buttonPlaceholder.remove();
4841
+ $( document ).one("submit", function(){
4842
+ $buttonPlaceholder.remove();
4843
+
4844
+ // reset the local var so that the hidden input
4845
+ // will be re-added on subsequent clicks
4846
+ $buttonPlaceholder = undefined;
4793
4847
  });
4794
4848
  }
4795
4849
  });
@@ -4811,11 +4865,17 @@ $.widget( "mobile.button", $.mobile.widget, {
4811
4865
  },
4812
4866
 
4813
4867
  refresh: function() {
4814
- if ( this.element.attr( "disabled" ) ) {
4868
+ var $el = this.element;
4869
+
4870
+ if ( $el.prop("disabled") ) {
4815
4871
  this.disable();
4816
4872
  } else {
4817
4873
  this.enable();
4818
4874
  }
4875
+
4876
+ // the textWrapper is stored as a data element on the button object
4877
+ // to prevent referencing by it's implementation details (eg 'class')
4878
+ this.button.data( 'textWrapper' ).text( $el.text() || $el.val() );
4819
4879
  }
4820
4880
  });
4821
4881
 
@@ -4825,10 +4885,7 @@ $( document ).bind( "pagecreate create", function( e ){
4825
4885
  });
4826
4886
 
4827
4887
  })( jQuery );/*
4828
- * jQuery Mobile Framework : "slider" plugin
4829
- * Copyright (c) jQuery Project
4830
- * Dual licensed under the MIT or GPL Version 2 licenses.
4831
- * http://jquery.org/license
4888
+ * "slider" plugin
4832
4889
  */
4833
4890
 
4834
4891
  ( function( $, undefined ) {
@@ -4896,12 +4953,16 @@ $.widget( "mobile.slider", $.mobile.widget, {
4896
4953
  handle: handle,
4897
4954
  dragging: false,
4898
4955
  beforeStart: null,
4899
- userModified: false
4956
+ userModified: false,
4957
+ mouseMoved: false
4900
4958
  });
4901
4959
 
4902
4960
  if ( cType == "select" ) {
4903
4961
 
4904
4962
  slider.wrapInner( "<div class='ui-slider-inneroffset'></div>" );
4963
+
4964
+ // make the handle move with a smooth transition
4965
+ handle.addClass( "ui-slider-handle-snapping" );
4905
4966
 
4906
4967
  options = control.find( "option" );
4907
4968
 
@@ -4925,7 +4986,10 @@ $.widget( "mobile.slider", $.mobile.widget, {
4925
4986
  // monitor the input for updated values
4926
4987
  control.addClass( cType === "input" ? "ui-slider-input" : "ui-slider-switch" )
4927
4988
  .change( function() {
4928
- self.refresh( val(), true );
4989
+ // if the user dragged the handle, the "change" event was triggered from inside refresh(); don't call refresh() again
4990
+ if (!self.mouseMoved) {
4991
+ self.refresh( val(), true );
4992
+ }
4929
4993
  })
4930
4994
  .keyup( function() { // necessary?
4931
4995
  self.refresh( val(), true, true );
@@ -4937,8 +5001,18 @@ $.widget( "mobile.slider", $.mobile.widget, {
4937
5001
  // prevent screen drag when slider activated
4938
5002
  $( document ).bind( "vmousemove", function( event ) {
4939
5003
  if ( self.dragging ) {
5004
+ // self.mouseMoved must be updated before refresh() because it will be used in the control "change" event
5005
+ self.mouseMoved = true;
5006
+
5007
+ if ( cType === "select" ) {
5008
+ // make the handle move in sync with the mouse
5009
+ handle.removeClass( "ui-slider-handle-snapping" );
5010
+ }
5011
+
4940
5012
  self.refresh( event );
4941
- self.userModified = self.userModified || self.beforeStart !== control[0].selectedIndex;
5013
+
5014
+ // only after refresh() you can calculate self.userModified
5015
+ self.userModified = self.beforeStart !== control[0].selectedIndex;
4942
5016
  return false;
4943
5017
  }
4944
5018
  });
@@ -4946,10 +5020,12 @@ $.widget( "mobile.slider", $.mobile.widget, {
4946
5020
  slider.bind( "vmousedown", function( event ) {
4947
5021
  self.dragging = true;
4948
5022
  self.userModified = false;
5023
+ self.mouseMoved = false;
4949
5024
 
4950
5025
  if ( cType === "select" ) {
4951
5026
  self.beforeStart = control[0].selectedIndex;
4952
5027
  }
5028
+
4953
5029
  self.refresh( event );
4954
5030
  return false;
4955
5031
  });
@@ -4960,14 +5036,31 @@ $.widget( "mobile.slider", $.mobile.widget, {
4960
5036
 
4961
5037
  self.dragging = false;
4962
5038
 
4963
- if ( cType === "select" ) {
4964
-
4965
- if ( !self.userModified ) {
4966
- //tap occurred, but value didn't change. flip it!
4967
- handle.addClass( "ui-slider-handle-snapping" );
4968
- self.refresh( !self.beforeStart ? 1 : 0 );
5039
+ if ( cType === "select") {
5040
+
5041
+ // make the handle move with a smooth transition
5042
+ handle.addClass( "ui-slider-handle-snapping" );
5043
+
5044
+ if ( self.mouseMoved ) {
5045
+
5046
+ // this is a drag, change the value only if user dragged enough
5047
+ if ( self.userModified ) {
5048
+ self.refresh( self.beforeStart == 0 ? 1 : 0 );
5049
+ }
5050
+ else {
5051
+ self.refresh( self.beforeStart );
5052
+ }
5053
+
5054
+ }
5055
+ else {
5056
+ // this is just a click, change the value
5057
+ self.refresh( self.beforeStart == 0 ? 1 : 0 );
4969
5058
  }
5059
+
4970
5060
  }
5061
+
5062
+ self.mouseMoved = false;
5063
+
4971
5064
  return false;
4972
5065
  }
4973
5066
  });
@@ -5041,8 +5134,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
5041
5134
  refresh: function( val, isfromControl, preventInputUpdate ) {
5042
5135
 
5043
5136
  if ( this.options.disabled || this.element.attr('disabled')) {
5044
- this.slider.addClass('ui-disabled');
5045
- return;
5137
+ this.disable();
5046
5138
  }
5047
5139
 
5048
5140
  var control = this.element, percent,
@@ -5149,10 +5241,7 @@ $( document ).bind( "pagecreate create", function( e ){
5149
5241
 
5150
5242
  })( jQuery );
5151
5243
  /*
5152
- * jQuery Mobile Framework : "textinput" plugin for text inputs, textareas
5153
- * Copyright (c) jQuery Project
5154
- * Dual licensed under the MIT or GPL Version 2 licenses.
5155
- * http://jquery.org/license
5244
+ * "textinput" plugin for text inputs, textareas
5156
5245
  */
5157
5246
 
5158
5247
  (function( $, undefined ) {
@@ -5167,20 +5256,13 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5167
5256
 
5168
5257
  var input = this.element,
5169
5258
  o = this.options,
5170
- theme = o.theme,
5171
- themeclass, focusedEl, clearbtn;
5172
-
5173
- if ( !theme ) {
5174
- theme = $.mobile.getInheritedTheme( this.element, "c" );
5175
- }
5176
-
5177
- themeclass = " ui-body-" + theme;
5259
+ theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
5260
+ themeclass = " ui-body-" + theme,
5261
+ focusedEl, clearbtn;
5178
5262
 
5179
5263
  $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
5180
5264
 
5181
- input.addClass("ui-input-text ui-body-"+ theme );
5182
-
5183
- focusedEl = input;
5265
+ focusedEl = input.addClass("ui-input-text ui-body-"+ theme );
5184
5266
 
5185
5267
  // XXX: Temporary workaround for issue 785 (Apple bug 8910589).
5186
5268
  // Turn off autocorrect and autocomplete on non-iOS 5 devices
@@ -5217,17 +5299,14 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5217
5299
  });
5218
5300
 
5219
5301
  function toggleClear() {
5220
- if ( !input.val() ) {
5221
- clearbtn.addClass( "ui-input-clear-hidden" );
5222
- } else {
5223
- clearbtn.removeClass( "ui-input-clear-hidden" );
5224
- }
5302
+ setTimeout(function() {
5303
+ clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
5304
+ }, 0);
5225
5305
  }
5226
5306
 
5227
5307
  toggleClear();
5228
5308
 
5229
- input.keyup( toggleClear )
5230
- .focus( toggleClear );
5309
+ input.bind('paste cut keyup focus change blur', toggleClear);
5231
5310
 
5232
5311
  } else {
5233
5312
  input.addClass( "ui-corner-all ui-shadow-inset" + themeclass );
@@ -5249,9 +5328,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5249
5328
  clientHeight = input[ 0 ].clientHeight;
5250
5329
 
5251
5330
  if ( clientHeight < scrollHeight ) {
5252
- input.css({
5253
- height: (scrollHeight + extraLineHeight)
5254
- });
5331
+ input.height(scrollHeight + extraLineHeight);
5255
5332
  }
5256
5333
  },
5257
5334
  keyupTimeout;
@@ -5261,10 +5338,15 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5261
5338
  keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer );
5262
5339
  });
5263
5340
 
5264
- // Issue 509: the browser is not giving scrollHeight properly until after the document
5265
- // is ready.
5266
- if ($.trim(input.text())) {
5267
- $(keyup);
5341
+ // Issue 509: the browser is not providing scrollHeight properly until the styles load
5342
+ if ( $.trim( input.val() ) ) {
5343
+ // bind to the window load to make sure the height is calculated based on BOTH
5344
+ // the DOM and CSS
5345
+ $( window ).load( keyup );
5346
+
5347
+ // binding to pagechange here ensures that for pages loaded via
5348
+ // ajax the height is recalculated without user input
5349
+ $( document ).one( "pagechange", keyup );
5268
5350
  }
5269
5351
  }
5270
5352
  },
@@ -5287,10 +5369,7 @@ $( document ).bind( "pagecreate create", function( e ){
5287
5369
 
5288
5370
  })( jQuery );
5289
5371
  /*
5290
- * jQuery Mobile Framework : custom "selectmenu" plugin
5291
- * Copyright (c) jQuery Project
5292
- * Dual licensed under the MIT or GPL Version 2 licenses.
5293
- * http://jquery.org/license
5372
+ * custom "selectmenu" plugin
5294
5373
  */
5295
5374
 
5296
5375
  (function( $, undefined ) {
@@ -5305,7 +5384,7 @@ $( document ).bind( "pagecreate create", function( e ){
5305
5384
  isMultiple = widget.isMultiple = widget.select[ 0 ].multiple,
5306
5385
  buttonId = selectID + "-button",
5307
5386
  menuId = selectID + "-menu",
5308
- menuPage = $( "<div data-" + $.mobile.ns + "role='dialog' data-" +$.mobile.ns + "theme='"+ widget.options.menuPageTheme +"'>" +
5387
+ menuPage = $( "<div data-" + $.mobile.ns + "role='dialog' data-" +$.mobile.ns + "theme='"+ widget.options.theme +"' data-" +$.mobile.ns + "overlay-theme='"+ widget.options.overlayTheme +"'>" +
5309
5388
  "<div data-" + $.mobile.ns + "role='header'>" +
5310
5389
  "<div class='ui-title'>" + label.getEncodedText() + "</div>"+
5311
5390
  "</div>"+
@@ -5612,7 +5691,7 @@ $( document ).bind( "pagecreate create", function( e ){
5612
5691
  // fall into a black hole
5613
5692
  self.thisPage.unbind( "pagehide.remove" );
5614
5693
 
5615
- //for webos (set lastscroll using button offset)
5694
+ //for WebOS/Opera Mini (set lastscroll using button offset)
5616
5695
  if ( scrollTop == 0 && btnOffset > screenHeight ) {
5617
5696
  self.thisPage.one( "pagehide", function() {
5618
5697
  $( this ).jqmData( "lastScroll", btnOffset );
@@ -5783,10 +5862,7 @@ $( document ).bind( "pagecreate create", function( e ){
5783
5862
  });
5784
5863
  })( jQuery );
5785
5864
  /*
5786
- * jQuery Mobile Framework : "selectmenu" plugin
5787
- * Copyright (c) jQuery Project
5788
- * Dual licensed under the MIT or GPL Version 2 licenses.
5789
- * http://jquery.org/license
5865
+ * "selectmenu" plugin
5790
5866
  */
5791
5867
 
5792
5868
  (function( $, undefined ) {
@@ -5991,30 +6067,36 @@ $( document ).bind( "pagecreate create", function( e ){
5991
6067
  });
5992
6068
  })( jQuery );
5993
6069
  /*
5994
- * jQuery Mobile Framework : plugin for making button-like links
5995
- * Copyright (c) jQuery Project
5996
- * Dual licensed under the MIT or GPL Version 2 licenses.
5997
- * http://jquery.org/license
6070
+ * "buttons" plugin - for making button-like links
5998
6071
  */
6072
+
5999
6073
  ( function( $, undefined ) {
6000
6074
 
6001
6075
  $.fn.buttonMarkup = function( options ) {
6002
- return this.each( function() {
6003
- var el = $( this ),
6076
+ options = options || {};
6077
+
6078
+ for ( var i = 0; i < this.length; i++ ) {
6079
+ var el = this.eq( i ),
6080
+ e = el[ 0 ],
6004
6081
  o = $.extend( {}, $.fn.buttonMarkup.defaults, {
6005
- icon: el.jqmData( "icon" ),
6006
- iconpos: el.jqmData( "iconpos" ),
6007
- theme: el.jqmData( "theme" ),
6008
- inline: el.jqmData( "inline" ),
6009
- shadow: el.jqmData( "shadow" ),
6010
- corners: el.jqmData( "corners" ),
6011
- iconshadow: el.jqmData( "iconshadow" )
6082
+ icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
6083
+ iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
6084
+ theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ),
6085
+ inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
6086
+ shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
6087
+ corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
6088
+ iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" )
6012
6089
  }, options ),
6013
6090
 
6014
6091
  // Classes Defined
6015
6092
  innerClass = "ui-btn-inner",
6093
+ textClass = "ui-btn-text",
6016
6094
  buttonClass, iconClass,
6017
- wrap;
6095
+
6096
+ // Button inner markup
6097
+ buttonInner = document.createElement( o.wrapperEls ),
6098
+ buttonText = document.createElement( o.wrapperEls ),
6099
+ buttonIcon = o.icon ? document.createElement( "span" ) : null;
6018
6100
 
6019
6101
  if ( attachEvents ) {
6020
6102
  attachEvents();
@@ -6059,15 +6141,33 @@ $.fn.buttonMarkup = function( options ) {
6059
6141
  buttonClass += " ui-shadow";
6060
6142
  }
6061
6143
 
6062
- el.attr( "data-" + $.mobile.ns + "theme", o.theme )
6063
- .addClass( buttonClass );
6144
+ e.setAttribute( "data-" + $.mobile.ns + "theme", o.theme );
6145
+ el.addClass( buttonClass );
6064
6146
 
6065
- wrap = ( "<D class='" + innerClass + "' aria-hidden='true'><D class='ui-btn-text'></D>" +
6066
- ( o.icon ? "<span class='" + iconClass + "'></span>" : "" ) +
6067
- "</D>" ).replace( /D/g, o.wrapperEls );
6147
+ buttonInner.className = innerClass;
6148
+ buttonInner.setAttribute("aria-hidden", "true");
6068
6149
 
6069
- el.wrapInner( wrap );
6070
- });
6150
+ buttonText.className = textClass;
6151
+ buttonInner.appendChild( buttonText );
6152
+
6153
+ if ( buttonIcon ) {
6154
+ buttonIcon.className = iconClass;
6155
+ buttonInner.appendChild( buttonIcon );
6156
+ }
6157
+
6158
+ while ( e.firstChild ) {
6159
+ buttonText.appendChild( e.firstChild );
6160
+ }
6161
+
6162
+ e.appendChild( buttonInner );
6163
+
6164
+ // TODO obviously it would be nice to pull this element out instead of
6165
+ // retrieving it from the DOM again, but this change is much less obtrusive
6166
+ // and 1.0 draws nigh
6167
+ $.data( e, 'textWrapper', $( buttonText ) );
6168
+ }
6169
+
6170
+ return this;
6071
6171
  };
6072
6172
 
6073
6173
  $.fn.buttonMarkup.defaults = {
@@ -6079,14 +6179,23 @@ $.fn.buttonMarkup.defaults = {
6079
6179
  };
6080
6180
 
6081
6181
  function closestEnabledButton( element ) {
6082
- while ( element ) {
6083
- var $ele = $( element );
6084
- if ( $ele.hasClass( "ui-btn" ) && !$ele.hasClass( "ui-disabled" ) ) {
6085
- break;
6086
- }
6087
- element = element.parentNode;
6088
- }
6089
- return element;
6182
+ var cname;
6183
+
6184
+ while ( element ) {
6185
+ // Note that we check for typeof className below because the element we
6186
+ // handed could be in an SVG DOM where className on SVG elements is defined to
6187
+ // be of a different type (SVGAnimatedString). We only operate on HTML DOM
6188
+ // elements, so we look for plain "string".
6189
+
6190
+ cname = ( typeof element.className === 'string' ) && element.className.split(' ');
6191
+
6192
+ if ( cname && $.inArray( "ui-btn", cname ) > -1 && $.inArray( "ui-disabled", cname ) < 0 ) {
6193
+ break;
6194
+ }
6195
+ element = element.parentNode;
6196
+ }
6197
+
6198
+ return element;
6090
6199
  }
6091
6200
 
6092
6201
  var attachEvents = function() {
@@ -6128,7 +6237,7 @@ var attachEvents = function() {
6128
6237
  if ( btn ) {
6129
6238
  $btn = $( btn );
6130
6239
  theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
6131
- $btn.removeClass( "ui-btn-hover-" + theme ).addClass( "ui-btn-up-" + theme );
6240
+ $btn.removeClass( "ui-btn-hover-" + theme + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
6132
6241
  }
6133
6242
  }
6134
6243
  });
@@ -6146,12 +6255,10 @@ $( document ).bind( "pagecreate create", function( e ){
6146
6255
  });
6147
6256
 
6148
6257
  })( jQuery );
6149
- /*
6150
- * jQuery Mobile Framework: "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc
6151
- * Copyright (c) jQuery Project
6152
- * Dual licensed under the MIT or GPL Version 2 licenses.
6153
- * http://jquery.org/license
6258
+ /*
6259
+ * "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc
6154
6260
  */
6261
+
6155
6262
  (function( $, undefined ) {
6156
6263
 
6157
6264
  $.fn.controlgroup = function( options ) {
@@ -6164,9 +6271,9 @@ $.fn.controlgroup = function( options ) {
6164
6271
  shadow: false,
6165
6272
  excludeInvisible: true
6166
6273
  }, options ),
6167
- groupheading = $el.find( ">legend" ),
6274
+ groupheading = $el.children( "legend" ),
6168
6275
  flCorners = o.direction == "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
6169
- type = $el.find( "input:eq(0)" ).attr( "type" );
6276
+ type = $el.find( "input" ).first().attr( "type" );
6170
6277
 
6171
6278
  // Replace legend with more stylable replacement div
6172
6279
  if ( groupheading.length ) {
@@ -6183,7 +6290,7 @@ $.fn.controlgroup = function( options ) {
6183
6290
  els.removeClass( "ui-btn-corner-all ui-shadow" )
6184
6291
  .eq( 0 ).addClass( flCorners[ 0 ] )
6185
6292
  .end()
6186
- .filter( ":last" ).addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
6293
+ .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
6187
6294
  }
6188
6295
 
6189
6296
  flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ) );
@@ -6201,10 +6308,7 @@ $( document ).bind( "pagecreate create", function( e ){
6201
6308
  });
6202
6309
 
6203
6310
  })(jQuery);/*
6204
- * jQuery Mobile Framework : "links" plugin - simple class additions for links
6205
- * Copyright (c) jQuery Project
6206
- * Dual licensed under the MIT or GPL Version 2 licenses.
6207
- * http://jquery.org/license
6311
+ * "links" plugin - simple class additions for links
6208
6312
  */
6209
6313
 
6210
6314
  (function( $, undefined ) {
@@ -6220,10 +6324,7 @@ $( document ).bind( "pagecreate create", function( e ){
6220
6324
  });
6221
6325
 
6222
6326
  })( jQuery );/*
6223
- * jQuery Mobile Framework : "fixHeaderFooter" plugin - on-demand positioning for headers,footers
6224
- * Copyright (c) jQuery Project
6225
- * Dual licensed under the MIT or GPL Version 2 licenses.
6226
- * http://jquery.org/license
6327
+ * "fixHeaderFooter" plugin - on-demand positioning for headers,footers
6227
6328
  */
6228
6329
 
6229
6330
  (function( $, undefined ) {
@@ -6602,10 +6703,7 @@ $( document ).bind( "pagecreate create", function( event ) {
6602
6703
 
6603
6704
  })( jQuery );
6604
6705
  /*
6605
- * jQuery Mobile Framework : "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content
6606
- * Copyright (c) jQuery Project
6607
- * Dual licensed under the MIT or GPL Version 2 licenses.
6608
- * http://jquery.org/license
6706
+ * "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content
6609
6707
  */
6610
6708
 
6611
6709
  (function( $, undefined ) {
@@ -6664,14 +6762,9 @@ $( document ).bind( "pagecreate", function( event ) {
6664
6762
  });
6665
6763
 
6666
6764
  })( jQuery );
6667
- /*!
6668
- * jQuery Mobile v@VERSION
6669
- * http://jquerymobile.com/
6670
- *
6671
- * Copyright 2010, jQuery Project
6672
- * Dual licensed under the MIT or GPL Version 2 licenses.
6673
- * http://jquery.org/license
6674
- */
6765
+ /*
6766
+ * "init" - Initialize the framework
6767
+ */
6675
6768
 
6676
6769
  (function( $, window, undefined ) {
6677
6770
  var $html = $( "html" ),