rhodes 3.2.3 → 3.3.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (368) hide show
  1. data/CHANGELOG +10 -0
  2. data/Rakefile +153 -46
  3. data/doc/build.txt +261 -102
  4. data/doc/configuration.txt +5 -2
  5. data/doc/device-caps.txt +134 -23
  6. data/doc/extensions.txt +922 -69
  7. data/doc/generator.txt +96 -39
  8. data/doc/install.txt +35 -19
  9. data/doc/jqt-jqm-transition.txt +17 -1
  10. data/doc/rhom.txt +23 -2
  11. data/doc/rhostudio-eclipse.txt +49 -0
  12. data/doc/rhostudio-test-plan.txt +440 -0
  13. data/doc/simulator.txt +1 -1
  14. data/doc/synchronization.txt +40 -1
  15. data/lib/build/jake.rb +108 -7
  16. data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +0 -35
  17. data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +8 -2
  18. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.mm +195 -195
  19. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.m +6 -0
  20. data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +5 -0
  21. data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode_wrap.c +64 -20
  22. data/lib/extensions/debugger/CHANGELOG +3 -0
  23. data/lib/extensions/debugger/debugger.rb +26 -21
  24. data/lib/extensions/digest-md5/ext/Rakefile +5 -5
  25. data/lib/extensions/digest-md5/ext/build +10 -1
  26. data/lib/extensions/digest-md5/ext/defs.h +19 -0
  27. data/lib/extensions/digest-md5/ext/digest-md5.vcproj +317 -9
  28. data/lib/extensions/digest-md5/ext/iphone/Dmd5.xcodeproj/project.pbxproj +290 -0
  29. data/lib/extensions/digest-md5/ext/iphone/Dmd5_Prefix.pch +7 -0
  30. data/lib/extensions/digest-md5/ext/iphone/Rakefile +79 -0
  31. data/lib/extensions/digest-sha1/ext/Rakefile +5 -5
  32. data/lib/extensions/digest-sha1/ext/build +10 -1
  33. data/lib/extensions/digest-sha1/ext/defs.h +19 -0
  34. data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +317 -9
  35. data/lib/extensions/digest-sha1/ext/iphone/Dsha1.xcodeproj/project.pbxproj +278 -0
  36. data/lib/extensions/digest-sha1/ext/iphone/Dsha1_Prefix.pch +7 -0
  37. data/lib/extensions/digest-sha1/ext/iphone/Rakefile +79 -0
  38. data/lib/extensions/digest/ext/Rakefile +5 -5
  39. data/lib/extensions/digest/ext/build +10 -1
  40. data/lib/extensions/digest/ext/digest.vcproj +317 -9
  41. data/lib/extensions/digest/ext/iphone/Digest.xcodeproj/project.pbxproj +270 -0
  42. data/lib/extensions/digest/ext/iphone/Digest_Prefix.pch +7 -0
  43. data/lib/extensions/digest/ext/iphone/Rakefile +79 -0
  44. data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +10 -2
  45. data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +6 -0
  46. data/lib/extensions/fcntl/ext/Rakefile +5 -5
  47. data/lib/extensions/fcntl/ext/build +9 -1
  48. data/lib/extensions/fcntl/ext/iphone/Fcntl.xcodeproj/project.pbxproj +262 -0
  49. data/lib/extensions/fcntl/ext/iphone/Fcntl_Prefix.pch +7 -0
  50. data/lib/extensions/fcntl/ext/iphone/Rakefile +79 -0
  51. data/lib/extensions/net-http/net/http.rb +9 -7
  52. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +64 -20
  53. data/lib/extensions/rhoxml/rexml/document.rb +3 -2
  54. data/lib/extensions/rhoxml/rexml/instruction.rb +70 -0
  55. data/lib/framework/builtinME.rb +9 -0
  56. data/lib/framework/date/format.rb +1 -1
  57. data/lib/framework/dateME.rb +19 -2
  58. data/lib/framework/rho/rho.rb +15 -4
  59. data/lib/framework/rho/rhoapplication.rb +1 -0
  60. data/lib/framework/rho/rhocontact.rb +10 -27
  61. data/lib/framework/rho/rhoevent_c.rb +8 -2
  62. data/lib/framework/rho/rhosupport.rb +25 -0
  63. data/lib/framework/rhodes.rb +1 -1
  64. data/lib/framework/rhoframework.rb +15 -0
  65. data/lib/framework/rholang/localization_simplified.rb +8 -10
  66. data/lib/framework/rhom/rhom_object_factory.rb +8 -2
  67. data/lib/framework/version.rb +1 -1
  68. data/lib/rhodes.rb +1 -1
  69. data/platform/android/Rhodes/jni/Application.mk +2 -1
  70. data/platform/android/Rhodes/jni/include/rhodes.h +9 -0
  71. data/platform/android/Rhodes/jni/src/callbacks.cpp +31 -1
  72. data/platform/android/Rhodes/jni/src/event.cpp +75 -31
  73. data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
  74. data/platform/android/Rhodes/jni/src/phonebook.cpp +73 -9
  75. data/platform/android/Rhodes/jni/src/rhodes.cpp +21 -0
  76. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +16 -24
  77. data/platform/android/Rhodes/jni/src/signature.cpp +27 -1
  78. data/platform/android/Rhodes/{default.properties → project.properties} +2 -2
  79. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +14 -12
  80. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +14 -12
  81. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +38 -115
  82. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +69 -52
  83. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +9 -0
  84. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraNewService.java +21 -1
  85. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraOldService.java +1 -1
  86. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSemiService.java +1 -1
  87. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraService.java +1 -1
  88. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +38 -6
  89. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java +212 -1
  90. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +82 -125
  91. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
  92. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +2 -1
  93. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +39 -19
  94. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +106 -136
  95. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +26 -25
  96. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +1 -1
  97. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +40 -0
  98. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +47 -0
  99. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality02.java +33 -0
  100. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality03.java +33 -0
  101. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality04.java +34 -0
  102. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality05.java +75 -0
  103. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality06.java +34 -0
  104. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality07.java +34 -0
  105. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +44 -0
  106. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality09.java +34 -0
  107. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality10.java +34 -0
  108. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +73 -0
  109. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +57 -6
  110. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessor.java +2 -2
  111. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +322 -76
  112. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +11 -6
  113. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +5 -5
  114. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +2 -1
  115. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +125 -0
  116. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +2 -3
  117. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebView.java +16 -0
  118. data/platform/android/build/RhodesSRC_build.files +14 -0
  119. data/platform/android/build/android.rake +149 -147
  120. data/platform/android/build/android_tools.rb +58 -0
  121. data/platform/android/build/librhocommon_build.files +1 -0
  122. data/platform/android/build/libruby_build.files +3 -0
  123. data/platform/bb/RubyVM/src/com/rho/RhoConf.java +11 -1
  124. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +11 -5
  125. data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +3 -2
  126. data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +2 -0
  127. data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +20 -8
  128. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +9 -6
  129. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +45 -18
  130. data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +1 -2
  131. data/platform/bb/build/bb.rake +84 -70
  132. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +106 -14
  133. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -1
  134. data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +108 -16
  135. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +10 -5
  136. data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +21 -4
  137. data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +17 -0
  138. data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +8 -5
  139. data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +3 -1
  140. data/platform/iphone/Classes/AppManager/AppManager.m +15 -3
  141. data/platform/iphone/Classes/Event/Event.m +45 -2
  142. data/platform/iphone/Classes/MapView/MapViewController.m +8 -4
  143. data/platform/iphone/Classes/Phonebook/phonebook.m +30 -7
  144. data/platform/iphone/Classes/Rhodes.h +11 -1
  145. data/platform/iphone/Classes/Rhodes.m +141 -9
  146. data/platform/iphone/Classes/Signature/SignatureDelegate.m +27 -1
  147. data/platform/iphone/Classes/SimpleMainView.h +1 -0
  148. data/platform/iphone/Classes/SimpleMainView.m +4 -0
  149. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +31 -1
  150. data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +10 -0
  151. data/platform/iphone/rbuild/iphone.rake +33 -6
  152. data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +10 -2
  153. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +22 -2
  154. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +14 -0
  155. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +10 -0
  156. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
  157. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  158. data/platform/osx/build/osx.rake +58 -7
  159. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +427 -69
  160. data/platform/shared/RhoConnectClient/RhoConnectClient.h +21 -2
  161. data/platform/shared/common/Android.mk +2 -1
  162. data/platform/shared/common/AutoPointer.h +23 -0
  163. data/platform/shared/common/BundleManager.cpp +333 -0
  164. data/platform/shared/common/RhoFile.cpp +206 -23
  165. data/platform/shared/common/RhoFile.h +14 -4
  166. data/platform/shared/common/RhoFilePath.h +18 -0
  167. data/platform/shared/common/RhoStd.h +11 -1
  168. data/platform/shared/common/RhoThread.h +4 -1
  169. data/platform/shared/common/RhodesApp.cpp +31 -8
  170. data/platform/shared/common/RhodesApp.h +14 -0
  171. data/platform/shared/common/RhodesAppBase.cpp +6 -6
  172. data/platform/shared/common/RhodesAppBase.h +1 -1
  173. data/platform/shared/common/emml.h +34 -0
  174. data/platform/shared/common/iphone/RhoFileImpl.m +30 -2
  175. data/platform/shared/common/map/BaseMapEngine.cpp +3 -3
  176. data/platform/shared/common/map/GeocodingMapEngine.cpp +205 -14
  177. data/platform/shared/common/map/GeocodingMapEngine.h +25 -2
  178. data/platform/shared/common/map/MapEngine.cpp +24 -2
  179. data/platform/shared/common/map/MapEngine.h +23 -12
  180. data/platform/shared/common/phonebook/PhonebookParams.cpp +99 -0
  181. data/platform/shared/common/phonebook/PhonebookParams.h +52 -0
  182. data/platform/shared/common/rhoparams.cpp +14 -0
  183. data/platform/shared/common/rhoparams.h +1 -0
  184. data/platform/shared/db/DBAdapter.cpp +43 -24
  185. data/platform/shared/db/DBAdapter.h +6 -1
  186. data/platform/shared/db/DBAttrManager.cpp +50 -1
  187. data/platform/shared/logging/RhoLog.h +3 -0
  188. data/platform/shared/logging/RhoLogSink.cpp +5 -1
  189. data/platform/shared/net/CURLNetRequest.cpp +2 -0
  190. data/platform/shared/qt/rhodes/QtMainWindow.cpp +14 -1
  191. data/platform/shared/qt/rhodes/impl/PhonebookImpl.cpp +2 -2
  192. data/platform/shared/qt/rhodes/impl/RhoFileImpl.cpp +1 -1
  193. data/platform/shared/qt/rhodes/impl/SignatureImpl.cpp +14 -2
  194. data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +16 -2
  195. data/platform/shared/qt/rhodes/main.cpp +28 -0
  196. data/platform/shared/qt/rhodes/rhodes.pro +3 -0
  197. data/platform/shared/qt/rholib/rholib.pro +2 -1
  198. data/platform/shared/qt/rubylib/rubylib.pro +2 -1
  199. data/platform/shared/ruby/Android.mk +3 -0
  200. data/platform/shared/ruby/class.c +7 -0
  201. data/platform/shared/ruby/compile.c +18 -10
  202. data/platform/shared/ruby/encdb.h +18 -8
  203. data/platform/shared/ruby/eval.c +108 -2
  204. data/platform/shared/ruby/ext/alert/alert_wrap.c +64 -20
  205. data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +64 -20
  206. data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +67 -23
  207. data/platform/shared/ruby/ext/calendar/calendar_wrap.c +64 -20
  208. data/platform/shared/ruby/ext/calendar/event_wrap.c +64 -20
  209. data/platform/shared/ruby/ext/camera/camera_wrap.c +64 -20
  210. data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +64 -20
  211. data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -0
  212. data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +127 -26
  213. data/platform/shared/ruby/ext/mapview/mapview_wrap.c +64 -20
  214. data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +65 -21
  215. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +64 -20
  216. data/platform/shared/ruby/ext/navbar/navbar_wrap.c +64 -20
  217. data/platform/shared/ruby/ext/phonebook/phonebook.i +7 -7
  218. data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +95 -120
  219. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -4
  220. data/platform/shared/ruby/ext/rho/rhoruby.h +2 -0
  221. data/platform/shared/ruby/ext/rho/rhosupport.c +39 -6
  222. data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +65 -21
  223. data/platform/shared/ruby/ext/ringtones/ringtones_wrap.c +64 -20
  224. data/platform/shared/ruby/ext/signature/signature.i +37 -5
  225. data/platform/shared/ruby/ext/signature/signature_wrap.c +274 -45
  226. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +65 -21
  227. data/platform/shared/ruby/ext/system/system.i +14 -2
  228. data/platform/shared/ruby/ext/system/system_wrap.c +146 -25
  229. data/platform/shared/ruby/ext/webview/webview_wrap.c +65 -21
  230. data/platform/shared/ruby/include/ruby/ruby.h +15 -4
  231. data/platform/shared/ruby/inits.c +1 -0
  232. data/platform/shared/ruby/io.c +13 -3
  233. data/platform/shared/ruby/win32/win32.c +3 -3
  234. data/platform/shared/ruby/wince/io_wce.c +2 -2
  235. data/platform/shared/rubyext/System.cpp +9 -5
  236. data/platform/shared/sync/ClientRegister.cpp +18 -8
  237. data/platform/shared/sync/SyncEngine.cpp +25 -11
  238. data/platform/shared/sync/SyncEngine.h +2 -0
  239. data/platform/shared/sync/SyncSource.cpp +40 -15
  240. data/platform/shared/sync/SyncSource.h +3 -2
  241. data/platform/shared/sync/SyncThread.cpp +9 -4
  242. data/platform/shared/sync/SyncThread.h +3 -1
  243. data/platform/symbian/build/symbian.rake +14 -9
  244. data/platform/symbian/rhodes/rhodes.pro +11 -8
  245. data/platform/symbian/rhodes/src/phonebook/ruby_phonebook.cpp +2 -2
  246. data/platform/symbian/rubylib/rubylib.pro +3 -0
  247. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  248. data/platform/wm/RhoLib/RhoLib.vcproj +315 -2
  249. data/platform/wm/build/build_inf.js +235 -187
  250. data/platform/wm/build/wm.rake +388 -233
  251. data/platform/wm/rhodes.sln +56 -0
  252. data/platform/wm/rhodes/MainWindow.cpp +139 -77
  253. data/platform/wm/rhodes/MainWindow.h +27 -22
  254. data/platform/wm/rhodes/MapView/{Graphics.cpp → Bitmap.cpp} +15 -253
  255. data/platform/wm/rhodes/MapView/Bitmap.h +86 -0
  256. data/platform/wm/rhodes/MapView/MapViewManager.cpp +7 -2
  257. data/platform/wm/rhodes/MapView/MapViewManager.h +1 -1
  258. data/platform/wm/rhodes/MapView/Win32Graphics.cpp +263 -0
  259. data/platform/wm/rhodes/MapView/Win32Graphics.h +133 -0
  260. data/platform/wm/rhodes/MapView/WmGraphics.cpp +291 -0
  261. data/platform/wm/rhodes/MapView/{Graphics.h → WmGraphics.h} +14 -56
  262. data/platform/wm/rhodes/Rhodes.cpp +128 -32
  263. data/platform/wm/rhodes/Rhodes.rc +6 -2
  264. data/platform/wm/rhodes/camera/Camera.cpp +1 -0
  265. data/platform/wm/rhodes/phonebook/phonebook.cpp +2 -2
  266. data/platform/wm/rhodes/phonebook/phonebook.h +2 -2
  267. data/platform/wm/rhodes/resource.h +3 -2
  268. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +6 -0
  269. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +4 -0
  270. data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +675 -0
  271. data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +123 -0
  272. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +12 -2
  273. data/platform/wm/rhodes/rhodes.vcproj +2732 -1113
  274. data/platform/wm/rhodes/simulator/MainWindowQt.h +1 -1
  275. data/platform/wm/rhodes/stdafx.h +1 -0
  276. data/platform/wm/rhoelements.sln +118 -62
  277. data/platform/wm/rubylib/rubylib.vcproj +345 -16
  278. data/platform/wm/sqlite3/sqlite3.vcproj +305 -0
  279. data/platform/wm/syncengine/syncengine.vcproj +309 -0
  280. data/platform/wm/tools/detool/LogServer.cpp +19 -2
  281. data/platform/wm/tools/detool/detool.cpp +131 -6
  282. data/platform/wm/tools/detool/detool.vcproj +3 -1
  283. data/platform/wm/tools/detool/stdafx.h +1 -0
  284. data/platform/wp7/IronRuby/Languages/Ruby/Libraries/Builtins/RangeOps.cs +589 -0
  285. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Builtins/RubyEncoding.cs +678 -0
  286. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs +271 -0
  287. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyUtils.cs +31 -1
  288. data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.Libraries.dll +0 -0
  289. data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.dll +0 -0
  290. data/platform/wp7/RhoRubyLib/common/RhoStd.cs +6 -0
  291. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +16 -2
  292. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +2 -0
  293. data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +1 -2
  294. data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +13 -10
  295. data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +30 -8
  296. data/platform/wp7/build/wp.rake +5 -0
  297. data/rakefile.rb +153 -46
  298. data/res/build-tools/detool.exe +0 -0
  299. data/res/build-tools/swig_patch/Lib/ruby/rubyerrors.swg +155 -0
  300. data/res/build-tools/swig_patch/Lib/ruby/rubyhead.swg +158 -0
  301. data/res/build-tools/swig_patch/Lib/ruby/rubyiterators.swg +932 -0
  302. data/res/build-tools/swig_patch/Lib/ruby/rubyrun.swg +448 -0
  303. data/res/build-tools/swig_patch/Lib/ruby/rubystdfunctors.swg +162 -0
  304. data/res/build-tools/swig_patch/Lib/ruby/rubytracking.swg +159 -0
  305. data/res/build-tools/swig_patch/Lib/ruby/std_basic_string.i +97 -0
  306. data/res/build-tools/swig_patch/Lib/ruby/std_map.i +418 -0
  307. data/res/build-tools/swig_patch/Lib/ruby/std_multimap.i +227 -0
  308. data/res/build-tools/swig_patch/Lib/swiginit.swg +269 -0
  309. data/res/build-tools/swig_patch/README +7 -0
  310. data/res/generators/templates/application/app/Settings/controller.rb +42 -1
  311. data/res/generators/templates/application/app/Settings/wait.erb +1 -1
  312. data/res/generators/templates/application/app/application.rb +1 -1
  313. data/res/generators/templates/application/app/layout.erb +8 -8
  314. data/res/generators/templates/application/build.yml +0 -1
  315. data/res/generators/templates/application/public/css/android.css +6 -0
  316. data/res/generators/templates/application/public/css/blackberry.css +6 -0
  317. data/res/generators/templates/application/public/css/iphone.css +6 -0
  318. data/res/generators/templates/application/public/css/jqmobile-patch.css +14 -0
  319. data/res/generators/templates/application/public/jqmobile/images/ajax-loader.png +0 -0
  320. data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
  321. data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
  322. data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
  323. data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
  324. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0rc1.css → jquery.mobile-1.0.css} +452 -354
  325. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0rc1.js → jquery.mobile-1.0.js} +629 -442
  326. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.css +2 -0
  327. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.js +172 -0
  328. data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.css +714 -0
  329. data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.min.css +2 -0
  330. data/res/generators/templates/application/public/js/jqmobile-patch.js +136 -7
  331. data/res/generators/templates/extension/app/MontanaTest/controller.rb +20 -20
  332. data/res/generators/templates/extension/app/MontanaTest/index.erb +17 -17
  333. data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Montana.xcodeproj/project.pbxproj +8 -2
  334. data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Rakefile +5 -0
  335. data/res/generators/templates/extension/extensions/montana/ext/montana/shared/ruby/montana_wrap.c +64 -20
  336. data/rhomobile-debug.gemspec +1 -1
  337. data/spec/framework_spec/app/layout.erb +1 -1
  338. data/spec/framework_spec/app/spec/core/rational/Rational_spec.rb +1 -1
  339. data/spec/framework_spec/app/spec/library/stringio/shared/each_char.rb +6 -2
  340. data/spec/framework_spec/app/spec/shared/rational/{Rational.rb → rational_main.rb} +0 -0
  341. data/spec/framework_spec/build.yml +0 -3
  342. data/spec/perfomance_spec/app/Benchmark/controller.rb +1 -1
  343. data/spec/perfomance_spec/app/layout.erb +1 -1
  344. data/spec/phone_spec/app/BlobTest_s/blob_test_s.rb +13 -0
  345. data/spec/phone_spec/app/BlobTest_s/test.png +0 -0
  346. data/spec/phone_spec/app/BlobTest_s/test2.png +0 -0
  347. data/spec/phone_spec/app/spec/blobsync_spec.rb +27 -15
  348. data/spec/phone_spec/app/spec/date_spec.rb +27 -1
  349. data/spec/phone_spec/app/spec/rho_spec.rb +6 -0
  350. data/spec/phone_spec/app/spec/rhom_object_spec.rb +64 -26
  351. data/spec/phone_spec/app/spec/syncengine_spec.rb +28 -7
  352. data/spec/phone_spec/app/spec/uri_spec.rb +4 -4
  353. data/spec/phone_spec/app/spec_runner.rb +4 -2
  354. data/spec/phone_spec/build.yml +7 -9
  355. data/spec/phone_spec/rhoconfig.txt +1 -0
  356. data/version +1 -1
  357. metadata +75 -22
  358. data/Manifest.txt +0 -7853
  359. data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.cpp +0 -384
  360. data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.h +0 -41
  361. data/platform/wm/rhodes/signature/Signature.cpp +0 -396
  362. data/platform/wm/rhodes/signature/Signature.h +0 -84
  363. data/platform/wm/rubylib/rubylib.vcproj.VLAD.Vladimir.user +0 -429
  364. data/platform/wm/sqlite3/sqlite3.vcproj.VLAD.Vladimir.user +0 -429
  365. data/platform/wm/syncengine/syncengine.vcproj.VLAD.Vladimir.user +0 -429
  366. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.css +0 -12
  367. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.js +0 -170
  368. data/rhomobile-debug-1.0.5.gem +0 -0
@@ -1,11 +1,12 @@
1
- /*!
2
- * jQuery Mobile v1.0rc1
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 ) {
@@ -306,16 +305,24 @@ $.widget( "mobile.widget", {
306
305
  });
307
306
 
308
307
  return options;
308
+ },
309
+
310
+ enhanceWithin: function( target ) {
311
+ // TODO remove dependency on the page widget for the keepNative.
312
+ // Currently the keepNative value is defined on the page prototype so
313
+ // the method is as well
314
+ var page = $(target).closest(":jqmData(role='page')").data( "page" ),
315
+ keepNative = (page && page.keepNativeSelector()) || "";
316
+
317
+ $( this.options.initSelector, target ).not( keepNative )[ this.widgetName ]();
309
318
  }
310
319
  });
311
320
 
312
321
  })( jQuery );
313
322
  /*
314
- * jQuery Mobile Framework : a workaround for window.matchMedia
315
- * Copyright (c) jQuery Project
316
- * Dual licensed under the MIT or GPL Version 2 licenses.
317
- * http://jquery.org/license
323
+ * a workaround for window.matchMedia
318
324
  */
325
+
319
326
  (function( $, undefined ) {
320
327
 
321
328
  var $window = $( window ),
@@ -356,10 +363,9 @@ $.mobile.media = (function() {
356
363
  };
357
364
  })();
358
365
 
359
- })(jQuery);/*
360
- * jQuery Mobile Framework : support tests
361
- * Copyright (c) jQuery Project
362
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
366
+ })(jQuery);
367
+ /*
368
+ * support tests
363
369
  */
364
370
 
365
371
  (function( $, undefined ) {
@@ -368,6 +374,7 @@ var fakeBody = $( "<body>" ).prependTo( "html" ),
368
374
  fbCSS = fakeBody[ 0 ].style,
369
375
  vendors = [ "Webkit", "Moz", "O" ],
370
376
  webos = "palmGetResource" in window, //only used to rule out scrollTop
377
+ operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]",
371
378
  bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB
372
379
 
373
380
  // thx Modernizr
@@ -396,9 +403,9 @@ function baseTagTest() {
396
403
  href = base.attr( "href" );
397
404
  }
398
405
 
399
- link = $( "<a href='testurl'></a>" ).prependTo( fakeBody );
406
+ link = $( "<a href='testurl' />" ).prependTo( fakeBody );
400
407
  rebase = link[ 0 ].href;
401
- base[ 0 ].href = href ? href : location.pathname;
408
+ base[ 0 ].href = href || location.pathname;
402
409
 
403
410
  if ( fauxEle ) {
404
411
  fauxEle.remove();
@@ -422,7 +429,7 @@ $.mobile.browser.ie = (function() {
422
429
 
423
430
 
424
431
  $.extend( $.support, {
425
- orientation: "orientation" in window,
432
+ orientation: "orientation" in window && "onorientationchange" in window,
426
433
  touch: "ontouchend" in document,
427
434
  cssTransitions: "WebKitTransitionEvent" in window,
428
435
  pushState: "pushState" in history && "replaceState" in history,
@@ -430,7 +437,7 @@ $.extend( $.support, {
430
437
  cssPseudoElement: !!propExists( "content" ),
431
438
  touchOverflow: !!propExists( "overflowScrolling" ),
432
439
  boxShadow: !!propExists( "boxShadow" ) && !bb,
433
- 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,
434
441
  dynamicBaseTag: baseTagTest()
435
442
  });
436
443
 
@@ -456,7 +463,7 @@ $.mobile.ajaxBlacklist =
456
463
  // BlackBerry browsers, pre-webkit
457
464
  window.blackberry && !window.WebKitPoint ||
458
465
  // Opera Mini
459
- window.operamini && Object.prototype.toString.call( window.operamini ) === "[object OperaMini]" ||
466
+ operamini ||
460
467
  // Symbian webkits pre 7.3
461
468
  nokiaLTE7_3;
462
469
 
@@ -465,7 +472,7 @@ $.mobile.ajaxBlacklist =
465
472
  // This simply reappends the CSS in place, which for some reason makes it apply
466
473
  if ( nokiaLTE7_3 ) {
467
474
  $(function() {
468
- $( "head link[rel=stylesheet]" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" );
475
+ $( "head link[rel='stylesheet']" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" );
469
476
  });
470
477
  }
471
478
 
@@ -474,11 +481,9 @@ if ( !$.support.boxShadow ) {
474
481
  $( "html" ).addClass( "ui-mobile-nosupport-boxshadow" );
475
482
  }
476
483
 
477
- })( jQuery );/*
478
- * jQuery Mobile Framework : "mouse" plugin
479
- * Copyright (c) jQuery Project
480
- * Dual licensed under the MIT or GPL Version 2 licenses.
481
- * http://jquery.org/license
484
+ })( jQuery );
485
+ /*
486
+ * "mouse" plugin
482
487
  */
483
488
 
484
489
  // This plugin is an experiment for abstracting away the touch and mouse
@@ -972,12 +977,10 @@ if ( eventCaptureSupported ) {
972
977
  }, true);
973
978
  }
974
979
  })( jQuery, window, document );
975
- /*
976
- * jQuery Mobile Framework : events
977
- * Copyright (c) jQuery Project
978
- * Dual licensed under the MIT or GPL Version 2 licenses.
979
- * http://jquery.org/license
980
+ /*
981
+ * "events" plugin - Handles events
980
982
  */
983
+
981
984
  (function( $, window, undefined ) {
982
985
 
983
986
  // add new event shortcuts
@@ -1092,11 +1095,11 @@ $.event.special.tap = {
1092
1095
  // also handles swipeleft, swiperight
1093
1096
  $.event.special.swipe = {
1094
1097
  scrollSupressionThreshold: 10, // More than this horizontal displacement, and we will suppress scrolling.
1095
-
1098
+
1096
1099
  durationThreshold: 1000, // More time than this, and it isn't a swipe.
1097
-
1100
+
1098
1101
  horizontalDistanceThreshold: 30, // Swipe horizontal displacement must be more than this.
1099
-
1102
+
1100
1103
  verticalDistanceThreshold: 75, // Swipe vertical displacement must be less than this.
1101
1104
 
1102
1105
  setup: function() {
@@ -1164,7 +1167,7 @@ $.event.special.swipe = {
1164
1167
  setup: function() {
1165
1168
  // If the event is supported natively, return false so that jQuery
1166
1169
  // will bind to the event using DOM methods.
1167
- if ( $.support.orientation ) {
1170
+ if ( $.support.orientation && $.mobile.orientationChangeEnabled ) {
1168
1171
  return false;
1169
1172
  }
1170
1173
 
@@ -1178,7 +1181,7 @@ $.event.special.swipe = {
1178
1181
  teardown: function(){
1179
1182
  // If the event is not supported natively, return false so that
1180
1183
  // jQuery will unbind the event using DOM methods.
1181
- if ( $.support.orientation ) {
1184
+ if ( $.support.orientation && $.mobile.orientationChangeEnabled ) {
1182
1185
  return false;
1183
1186
  }
1184
1187
 
@@ -1190,6 +1193,7 @@ $.event.special.swipe = {
1190
1193
  // Save a reference to the bound event handler.
1191
1194
  var old_handler = handleObj.handler;
1192
1195
 
1196
+
1193
1197
  handleObj.handler = function( event ) {
1194
1198
  // Modify event object, adding the .orientation property.
1195
1199
  event.orientation = get_orientation();
@@ -1211,13 +1215,27 @@ $.event.special.swipe = {
1211
1215
  last_orientation = orientation;
1212
1216
  win.trigger( "orientationchange" );
1213
1217
  }
1214
- };
1218
+ }
1215
1219
 
1216
1220
  // Get the current page orientation. This method is exposed publicly, should it
1217
1221
  // be needed, as jQuery.event.special.orientationchange.orientation()
1218
1222
  $.event.special.orientationchange.orientation = get_orientation = function() {
1219
- var elem = document.documentElement;
1220
- return elem && elem.clientWidth / elem.clientHeight < 1.1 ? "portrait" : "landscape";
1223
+ var isPortrait = true, elem = document.documentElement;
1224
+
1225
+ // prefer window orientation to the calculation based on screensize as
1226
+ // the actual screen resize takes place before or after the orientation change event
1227
+ // has been fired depending on implementation (eg android 2.3 is before, iphone after).
1228
+ // More testing is required to determine if a more reliable method of determining the new screensize
1229
+ // is possible when orientationchange is fired. (eg, use media queries + element + opacity)
1230
+ if ( $.support.orientation ) {
1231
+ // if the window orientation registers as 0 or 180 degrees report
1232
+ // portrait, otherwise landscape
1233
+ isPortrait = window.orientation % 180 == 0;
1234
+ } else {
1235
+ isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1;
1236
+ }
1237
+
1238
+ return isPortrait ? "portrait" : "landscape";
1221
1239
  };
1222
1240
 
1223
1241
  })( jQuery, window );
@@ -1277,17 +1295,8 @@ $.each({
1277
1295
  });
1278
1296
 
1279
1297
  })( jQuery, this );
1280
- /*!
1281
- * jQuery hashchange event - v1.3 - 7/21/2010
1282
- * http://benalman.com/projects/jquery-hashchange-plugin/
1283
- *
1284
- * Copyright (c) 2010 "Cowboy" Ben Alman
1285
- * Dual licensed under the MIT and GPL licenses.
1286
- * http://benalman.com/about/license/
1287
- */
1288
-
1289
1298
  // Script: jQuery hashchange event
1290
- //
1299
+ //
1291
1300
  // *Version: 1.3, Last updated: 7/21/2010*
1292
1301
  //
1293
1302
  // Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
@@ -1668,10 +1677,7 @@ $.each({
1668
1677
 
1669
1678
  })(jQuery,this);
1670
1679
  /*
1671
- * jQuery Mobile Framework : "page" plugin
1672
- * Copyright (c) jQuery Project
1673
- * Dual licensed under the MIT or GPL Version 2 licenses.
1674
- * http://jquery.org/license
1680
+ * "page" plugin
1675
1681
  */
1676
1682
 
1677
1683
  (function( $, undefined ) {
@@ -1679,7 +1685,8 @@ $.each({
1679
1685
  $.widget( "mobile.page", $.mobile.widget, {
1680
1686
  options: {
1681
1687
  theme: "c",
1682
- domCache: false
1688
+ domCache: false,
1689
+ keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')"
1683
1690
  },
1684
1691
 
1685
1692
  _create: function() {
@@ -1689,21 +1696,28 @@ $.widget( "mobile.page", $.mobile.widget, {
1689
1696
  this.element
1690
1697
  .attr( "tabindex", "0" )
1691
1698
  .addClass( "ui-page ui-body-" + this.options.theme );
1699
+ },
1700
+
1701
+ keepNativeSelector: function() {
1702
+ var options = this.options,
1703
+ keepNativeDefined = options.keepNative && $.trim(options.keepNative);
1704
+
1705
+ if( keepNativeDefined && options.keepNative !== options.keepNativeDefault ){
1706
+ return [options.keepNative, options.keepNativeDefault].join(", ");
1707
+ }
1708
+
1709
+ return options.keepNativeDefault;
1692
1710
  }
1693
1711
  });
1694
-
1695
1712
  })( jQuery );
1696
- /*!
1697
- * jQuery Mobile v@VERSION
1698
- * http://jquerymobile.com/
1699
- *
1700
- * Copyright 2010, jQuery Project
1701
- * Dual licensed under the MIT or GPL Version 2 licenses.
1702
- * http://jquery.org/license
1703
- */
1713
+ /*
1714
+ * "core" - The base file for jQm
1715
+ */
1704
1716
 
1705
1717
  (function( $, window, undefined ) {
1706
1718
 
1719
+ var nsNormalizeDict = {};
1720
+
1707
1721
  // jQuery.mobile configurable options
1708
1722
  $.extend( $.mobile, {
1709
1723
 
@@ -1727,6 +1741,9 @@ $.widget( "mobile.page", $.mobile.widget, {
1727
1741
  // Automatically load and show pages based on location.hash
1728
1742
  hashListeningEnabled: true,
1729
1743
 
1744
+ // disable to prevent jquery from bothering with links
1745
+ linkBindingEnabled: true,
1746
+
1730
1747
  // Set default page transition - 'none' for no transitions
1731
1748
  defaultPageTransition: "slide",
1732
1749
 
@@ -1748,6 +1765,9 @@ $.widget( "mobile.page", $.mobile.widget, {
1748
1765
 
1749
1766
  pushStateEnabled: true,
1750
1767
 
1768
+ // turn of binding to the native orientationchange due to android orientation behavior
1769
+ orientationChangeEnabled: true,
1770
+
1751
1771
  // Support conditions that must be met in order to proceed
1752
1772
  // default enhanced qualifications are media query support OR IE 7+
1753
1773
  gradeA: function(){
@@ -1809,14 +1829,46 @@ $.widget( "mobile.page", $.mobile.widget, {
1809
1829
  }, 150 );
1810
1830
  },
1811
1831
 
1832
+ // Expose our cache for testing purposes.
1833
+ nsNormalizeDict: nsNormalizeDict,
1834
+
1812
1835
  // Take a data attribute property, prepend the namespace
1813
- // 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.
1814
1838
  nsNormalize: function( prop ) {
1815
1839
  if ( !prop ) {
1816
1840
  return;
1817
1841
  }
1818
1842
 
1819
- return $.camelCase( $.mobile.ns + prop );
1843
+ return nsNormalizeDict[ prop ] || ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
1844
+ },
1845
+
1846
+ getInheritedTheme: function( el, defaultTheme ) {
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
+
1868
+ // Return the theme letter we found, if none, return the
1869
+ // specified default.
1870
+
1871
+ return ltr || defaultTheme || "a";
1820
1872
  }
1821
1873
  });
1822
1874
 
@@ -1875,10 +1927,11 @@ $.widget( "mobile.page", $.mobile.widget, {
1875
1927
  };
1876
1928
 
1877
1929
  // Monkey-patching Sizzle to filter the :jqmData selector
1878
- var oldFind = $.find;
1930
+ var oldFind = $.find,
1931
+ jqmDataRE = /:jqmData\(([^)]*)\)/g;
1879
1932
 
1880
1933
  $.find = function( selector, context, ret, extra ) {
1881
- selector = selector.replace(/:jqmData\(([^)]*)\)/g, "[data-" + ( $.mobile.ns || "" ) + "$1]");
1934
+ selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
1882
1935
 
1883
1936
  return oldFind.call( this, selector, context, ret, extra );
1884
1937
  };
@@ -1895,11 +1948,9 @@ $.widget( "mobile.page", $.mobile.widget, {
1895
1948
  })( jQuery, this );
1896
1949
 
1897
1950
  /*
1898
- * jQuery Mobile Framework : core utilities for auto ajax navigation, base tag mgmt,
1899
- * Copyright (c) jQuery Project
1900
- * Dual licensed under the MIT or GPL Version 2 licenses.
1901
- * http://jquery.org/license
1951
+ * core utilities for auto ajax navigation, base tag mgmt,
1902
1952
  */
1953
+
1903
1954
  ( function( $, undefined ) {
1904
1955
 
1905
1956
  //define vars for interal use
@@ -2030,7 +2081,7 @@ $.widget( "mobile.page", $.mobile.widget, {
2030
2081
  var relObj = path.parseUrl( relUrl ),
2031
2082
  absObj = path.parseUrl( absUrl ),
2032
2083
  protocol = relObj.protocol || absObj.protocol,
2033
- doubleSlash = relObj.protocol ? relObj.doubleSlash : ( relObj.doubleSlash || absObj.doubleSlash );
2084
+ doubleSlash = relObj.protocol ? relObj.doubleSlash : ( relObj.doubleSlash || absObj.doubleSlash ),
2034
2085
  authority = relObj.authority || absObj.authority,
2035
2086
  hasPath = relObj.pathname !== "",
2036
2087
  pathname = path.makePathAbsolute( relObj.pathname || absObj.filename, absObj.pathname ),
@@ -2461,7 +2512,7 @@ $.widget( "mobile.page", $.mobile.widget, {
2461
2512
 
2462
2513
  //simply set the active page's minimum height to screen height, depending on orientation
2463
2514
  function getScreenHeight(){
2464
- var orientation = jQuery.event.special.orientationchange.orientation(),
2515
+ var orientation = $.event.special.orientationchange.orientation(),
2465
2516
  port = orientation === "portrait",
2466
2517
  winMin = port ? 480 : 320,
2467
2518
  screenHeight = port ? screen.availHeight : screen.availWidth,
@@ -2633,15 +2684,31 @@ $.widget( "mobile.page", $.mobile.widget, {
2633
2684
  // reference to an embedded page. If so, it may have been dynamically
2634
2685
  // injected by a developer, in which case it would be lacking a data-url
2635
2686
  // attribute and in need of enhancement.
2636
- if ( page.length === 0 && !path.isPath( dataUrl ) ) {
2687
+ if ( page.length === 0 && dataUrl && !path.isPath( dataUrl ) ) {
2637
2688
  page = settings.pageContainer.children( "#" + dataUrl )
2638
- .attr( "data-" + $.mobile.ns + "url", dataUrl )
2689
+ .attr( "data-" + $.mobile.ns + "url", dataUrl );
2639
2690
  }
2640
2691
 
2641
2692
  // If we failed to find a page in the DOM, check the URL to see if it
2642
- // refers to the first page in the application.
2643
- if ( page.length === 0 && $.mobile.firstPage && path.isFirstPageUrl( absUrl ) ) {
2644
- 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
+ }
2645
2712
  }
2646
2713
 
2647
2714
  // Reset base to the default document base.
@@ -2701,7 +2768,7 @@ $.widget( "mobile.page", $.mobile.widget, {
2701
2768
  type: settings.type,
2702
2769
  data: settings.data,
2703
2770
  dataType: "html",
2704
- success: function( html ) {
2771
+ success: function( html, textStatus, xhr ) {
2705
2772
  //pre-parse html to check for a data-url,
2706
2773
  //use it as the new fileUrl, base path, etc
2707
2774
  var all = $( "<div></div>" ),
@@ -2737,6 +2804,9 @@ $.widget( "mobile.page", $.mobile.widget, {
2737
2804
  }
2738
2805
 
2739
2806
  if ( newPageTitle && !page.jqmData( "title" ) ) {
2807
+ if ( ~newPageTitle.indexOf( "&" ) ) {
2808
+ newPageTitle = $( "<div>" + newPageTitle + "</div>" ).text();
2809
+ }
2740
2810
  page.jqmData( "title", newPageTitle );
2741
2811
  }
2742
2812
 
@@ -2787,7 +2857,9 @@ $.widget( "mobile.page", $.mobile.widget, {
2787
2857
  hideMsg();
2788
2858
  }
2789
2859
 
2790
- // 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;
2791
2863
  triggerData.page = page;
2792
2864
 
2793
2865
  // Let listeners know the page loaded successfully.
@@ -2795,12 +2867,17 @@ $.widget( "mobile.page", $.mobile.widget, {
2795
2867
 
2796
2868
  deferred.resolve( absUrl, options, page, dupCachedPage );
2797
2869
  },
2798
- error: function() {
2870
+ error: function( xhr, textStatus, errorThrown ) {
2799
2871
  //set base back to current path
2800
2872
  if( base ) {
2801
2873
  base.set( path.get() );
2802
2874
  }
2803
2875
 
2876
+ // Add error info to our triggerData.
2877
+ triggerData.xhr = xhr;
2878
+ triggerData.textStatus = textStatus;
2879
+ triggerData.errorThrown = errorThrown;
2880
+
2804
2881
  var plfEvent = new $.Event( "pageloadfailed" );
2805
2882
 
2806
2883
  // Let listeners know the page load failed.
@@ -2913,6 +2990,14 @@ $.widget( "mobile.page", $.mobile.widget, {
2913
2990
  return;
2914
2991
  }
2915
2992
 
2993
+ // If we are going to the first-page of the application, we need to make
2994
+ // sure settings.dataUrl is set to the application document url. This allows
2995
+ // us to avoid generating a document url with an id hash in the case where the
2996
+ // first-page of the document has an id attribute specified.
2997
+ if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) {
2998
+ settings.dataUrl = documentUrl.hrefNoHash;
2999
+ }
3000
+
2916
3001
  // The caller passed us a real page DOM element. Update our
2917
3002
  // internal state and then trigger a transition to the page.
2918
3003
  var fromPage = settings.fromPage,
@@ -2963,7 +3048,11 @@ $.widget( "mobile.page", $.mobile.widget, {
2963
3048
  // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
2964
3049
  // is undefined when we are in an IFrame.
2965
3050
  try {
2966
- $( 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
+ }
2967
3056
  } catch(e) {}
2968
3057
 
2969
3058
  // If we're displaying the page as a dialog, we don't want the url
@@ -2985,11 +3074,20 @@ $.widget( "mobile.page", $.mobile.widget, {
2985
3074
  path.set( url );
2986
3075
  }
2987
3076
 
2988
- //if title element wasn't found, try the page div data attr too
2989
- var newPageTitle = toPage.jqmData( "title" ) || toPage.children(":jqmData(role='header')").find(".ui-title" ).text();
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();
2990
3080
  if( !!newPageTitle && pageTitle == document.title ) {
2991
3081
  pageTitle = newPageTitle;
2992
3082
  }
3083
+ if ( !toPage.jqmData( "title" ) ) {
3084
+ toPage.jqmData( "title", pageTitle );
3085
+ }
3086
+
3087
+ // Make sure we have a transition defined.
3088
+ settings.transition = settings.transition
3089
+ || ( ( historyDir && !activeIsInitialPage ) ? active.transition : undefined )
3090
+ || ( isDialog ? $.mobile.defaultDialogTransition : $.mobile.defaultPageTransition );
2993
3091
 
2994
3092
  //add page to history stack if it's not back or forward
2995
3093
  if( !historyDir ) {
@@ -3002,11 +3100,6 @@ $.widget( "mobile.page", $.mobile.widget, {
3002
3100
  //set "toPage" as activePage
3003
3101
  $.mobile.activePage = toPage;
3004
3102
 
3005
- // Make sure we have a transition defined.
3006
- settings.transition = settings.transition
3007
- || ( ( historyDir && !activeIsInitialPage ) ? active.transition : undefined )
3008
- || ( isDialog ? $.mobile.defaultDialogTransition : $.mobile.defaultPageTransition );
3009
-
3010
3103
  // If we're navigating back in the URL history, set reverse accordingly.
3011
3104
  settings.reverse = settings.reverse || historyDir < 0;
3012
3105
 
@@ -3047,7 +3140,14 @@ $.widget( "mobile.page", $.mobile.widget, {
3047
3140
  function findClosestLink( ele )
3048
3141
  {
3049
3142
  while ( ele ) {
3050
- 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" ) {
3051
3151
  break;
3052
3152
  }
3053
3153
  ele = ele.parentNode;
@@ -3127,7 +3227,7 @@ $.widget( "mobile.page", $.mobile.widget, {
3127
3227
  $( document ).bind( "vclick", function( event ) {
3128
3228
  // if this isn't a left click we don't care. Its important to note
3129
3229
  // that when the virtual event is generated it will create
3130
- if ( event.which > 1 ){
3230
+ if ( event.which > 1 || !$.mobile.linkBindingEnabled ){
3131
3231
  return;
3132
3232
  }
3133
3233
 
@@ -3144,6 +3244,10 @@ $.widget( "mobile.page", $.mobile.widget, {
3144
3244
 
3145
3245
  // click routing - direct to HTTP or Ajax, accordingly
3146
3246
  $( document ).bind( "click", function( event ) {
3247
+ if( !$.mobile.linkBindingEnabled ){
3248
+ return;
3249
+ }
3250
+
3147
3251
  var link = findClosestLink( event.target );
3148
3252
 
3149
3253
  // If there is no link associated with the click or its not a left
@@ -3238,16 +3342,19 @@ $.widget( "mobile.page", $.mobile.widget, {
3238
3342
  });
3239
3343
 
3240
3344
  //prefetch pages when anchors with data-prefetch are encountered
3241
- $( ".ui-page" ).live( "pageshow.prefetch", function(){
3345
+ $( ".ui-page" ).live( "pageshow.prefetch", function() {
3242
3346
  var urls = [];
3243
3347
  $( this ).find( "a:jqmData(prefetch)" ).each(function(){
3244
- var url = $( this ).attr( "href" );
3348
+ var $link = $(this),
3349
+ url = $link.attr( "href" );
3350
+
3245
3351
  if ( url && $.inArray( url, urls ) === -1 ) {
3246
3352
  urls.push( url );
3247
- $.mobile.loadPage( url );
3353
+
3354
+ $.mobile.loadPage( url, {role: $link.attr("data-" + $.mobile.ns + "rel")} );
3248
3355
  }
3249
3356
  });
3250
- } );
3357
+ });
3251
3358
 
3252
3359
  $.mobile._handleHashChange = function( hash ) {
3253
3360
  //find first page via hash
@@ -3338,11 +3445,9 @@ $.widget( "mobile.page", $.mobile.widget, {
3338
3445
 
3339
3446
  })( jQuery );
3340
3447
  /*
3341
- * jQuery Mobile Framework : history.pushState support, layered on top of hashchange
3342
- * Copyright (c) jQuery Project
3343
- * Dual licensed under the MIT or GPL Version 2 licenses.
3344
- * http://jquery.org/license
3448
+ * history.pushState support, layered on top of hashchange
3345
3449
  */
3450
+
3346
3451
  ( function( $, window ) {
3347
3452
  // For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents
3348
3453
  // Scope self to pushStateHandler so we can reference it sanely within the
@@ -3404,14 +3509,15 @@ $.widget( "mobile.page", $.mobile.widget, {
3404
3509
 
3405
3510
  var href, state,
3406
3511
  hash = location.hash,
3407
- isPath = $.mobile.path.isPath( hash );
3512
+ isPath = $.mobile.path.isPath( hash ),
3513
+ resolutionUrl = isPath ? location.href : $.mobile.getDocumentUrl();
3408
3514
  hash = isPath ? hash.replace( "#", "" ) : hash;
3409
3515
 
3410
3516
  // propulate the hash when its not available
3411
3517
  state = self.state();
3412
3518
 
3413
3519
  // make the hash abolute with the current href
3414
- href = $.mobile.path.makeUrlAbsolute( hash, location.href );
3520
+ href = $.mobile.path.makeUrlAbsolute( hash, resolutionUrl );
3415
3521
 
3416
3522
  if ( isPath ) {
3417
3523
  href = self.resetUIKeys( href );
@@ -3471,14 +3577,10 @@ $.widget( "mobile.page", $.mobile.widget, {
3471
3577
  pushStateHandler.init();
3472
3578
  }
3473
3579
  });
3474
- })( jQuery, this );/*!
3475
- * jQuery Mobile v@VERSION
3476
- * http://jquerymobile.com/
3477
- *
3478
- * Copyright 2010, jQuery Project
3479
- * Dual licensed under the MIT or GPL Version 2 licenses.
3480
- * http://jquery.org/license
3481
- */
3580
+ })( jQuery, this );
3581
+ /*
3582
+ * "transitions" plugin - Page change tranistions
3583
+ */
3482
3584
 
3483
3585
  (function( $, window, undefined ) {
3484
3586
 
@@ -3522,10 +3624,7 @@ if ( $.mobile.defaultTransitionHandler === $.mobile.noneTransitionHandler ) {
3522
3624
 
3523
3625
  })( jQuery, this );
3524
3626
  /*
3525
- * jQuery Mobile Framework : "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made.
3526
- * Copyright (c) jQuery Project
3527
- * Dual licensed under the MIT or GPL Version 2 licenses.
3528
- * http://jquery.org/license
3627
+ * "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made.
3529
3628
  */
3530
3629
 
3531
3630
  (function( $, undefined ) {
@@ -3546,22 +3645,25 @@ $.mobile.page.prototype.options.degradeInputs = {
3546
3645
  week: false
3547
3646
  };
3548
3647
 
3549
- $.mobile.page.prototype.options.keepNative = ":jqmData(role='none'), :jqmData(role='nojs')";
3550
-
3551
3648
 
3552
3649
  //auto self-init widgets
3553
- $( document ).bind( "pagecreate enhance", function( e ){
3554
-
3555
- var page = $( e.target ).data( "page" ),
3556
- o = page.options;
3557
-
3650
+ $( document ).bind( "pagecreate create", function( e ){
3651
+
3652
+ var page = $(e.target).closest(':jqmData(role="page")').data("page"), options;
3653
+
3654
+ if( !page ) {
3655
+ return;
3656
+ }
3657
+
3658
+ options = page.options;
3659
+
3558
3660
  // degrade inputs to avoid poorly implemented native functionality
3559
- $( e.target ).find( "input" ).not( o.keepNative ).each(function() {
3661
+ $( e.target ).find( "input" ).not( page.keepNativeSelector() ).each(function() {
3560
3662
  var $this = $( this ),
3561
3663
  type = this.getAttribute( "type" ),
3562
- optType = o.degradeInputs[ type ] || "text";
3664
+ optType = options.degradeInputs[ type ] || "text";
3563
3665
 
3564
- if ( o.degradeInputs[ type ] ) {
3666
+ if ( options.degradeInputs[ type ] ) {
3565
3667
  var html = $( "<div>" ).html( $this.clone() ).html(),
3566
3668
  // In IE browsers, the type sometimes doesn't exist in the cloned markup, so we replace the closing tag instead
3567
3669
  hasType = html.indexOf( " type=" ) > -1,
@@ -3571,13 +3673,11 @@ $( document ).bind( "pagecreate enhance", function( e ){
3571
3673
  $this.replaceWith( html.replace( findstr, repstr ) );
3572
3674
  }
3573
3675
  });
3574
-
3676
+
3575
3677
  });
3576
3678
 
3577
3679
  })( jQuery );/*
3578
- * jQuery Mobile Framework : "dialog" plugin.
3579
- * Copyright (c) jQuery Project
3580
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
3680
+ * "dialog" plugin.
3581
3681
  */
3582
3682
 
3583
3683
  (function( $, window, undefined ) {
@@ -3585,20 +3685,15 @@ $( document ).bind( "pagecreate enhance", function( e ){
3585
3685
  $.widget( "mobile.dialog", $.mobile.widget, {
3586
3686
  options: {
3587
3687
  closeBtnText : "Close",
3588
- theme : "a",
3688
+ overlayTheme : "a",
3589
3689
  initSelector : ":jqmData(role='dialog')"
3590
3690
  },
3591
3691
  _create: function() {
3592
3692
  var self = this,
3593
3693
  $el = this.element,
3594
- pageTheme = $el.attr( "class" ).match( /ui-body-[a-z]/ ),
3595
3694
  headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" );
3596
3695
 
3597
- if( pageTheme.length ){
3598
- $el.removeClass( pageTheme[ 0 ] );
3599
- }
3600
-
3601
- $el.addClass( "ui-body-" + this.options.theme );
3696
+ $el.addClass( "ui-overlay-" + this.options.overlayTheme );
3602
3697
 
3603
3698
  // Class the markup for dialog styling
3604
3699
  // Set aria role
@@ -3609,8 +3704,9 @@ $.widget( "mobile.dialog", $.mobile.widget, {
3609
3704
  .prepend( headerCloseButton )
3610
3705
  .end()
3611
3706
  .find( ":jqmData(role='content'),:jqmData(role='footer')" )
3707
+ .addClass( "ui-overlay-shadow" )
3612
3708
  .last()
3613
- .addClass( "ui-corner-bottom ui-overlay-shadow" );
3709
+ .addClass( "ui-corner-bottom" );
3614
3710
 
3615
3711
  // this must be an anonymous function so that select menu dialogs can replace
3616
3712
  // the close method. This is a change from previously just defining data-rel=back
@@ -3654,31 +3750,30 @@ $( $.mobile.dialog.prototype.options.initSelector ).live( "pagecreate", function
3654
3750
 
3655
3751
  })( jQuery, this );
3656
3752
  /*
3657
- * jQuery Mobile Framework : This plugin handles theming and layout of headers, footers, and content areas
3658
- * Copyright (c) jQuery Project
3659
- * Dual licensed under the MIT or GPL Version 2 licenses.
3660
- * http://jquery.org/license
3753
+ * This plugin handles theming and layout of headers, footers, and content areas
3661
3754
  */
3662
3755
 
3663
3756
  (function( $, undefined ) {
3664
3757
 
3665
- $.mobile.page.prototype.options.backBtnText = "Back";
3666
- $.mobile.page.prototype.options.addBackBtn = false;
3667
- $.mobile.page.prototype.options.backBtnTheme = null;
3668
- $.mobile.page.prototype.options.headerTheme = "a";
3669
- $.mobile.page.prototype.options.footerTheme = "a";
3670
- $.mobile.page.prototype.options.contentTheme = null;
3758
+ $.mobile.page.prototype.options.backBtnText = "Back";
3759
+ $.mobile.page.prototype.options.addBackBtn = false;
3760
+ $.mobile.page.prototype.options.backBtnTheme = null;
3761
+ $.mobile.page.prototype.options.headerTheme = "a";
3762
+ $.mobile.page.prototype.options.footerTheme = "a";
3763
+ $.mobile.page.prototype.options.contentTheme = null;
3671
3764
 
3672
3765
  $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", function( e ) {
3673
3766
 
3674
- var $page = $( this ),
3675
- o = $page.data( "page" ).options,
3676
- pageTheme = o.theme;
3767
+ var $page = $( this ),
3768
+ o = $page.data( "page" ).options,
3769
+ pageRole = $page.jqmData( "role" ),
3770
+ pageTheme = o.theme;
3677
3771
 
3678
3772
  $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", this ).each(function() {
3679
- var $this = $( this ),
3680
- role = $this.jqmData( "role" ),
3681
- theme = $this.jqmData( "theme" ),
3773
+ var $this = $( this ),
3774
+ role = $this.jqmData( "role" ),
3775
+ theme = $this.jqmData( "theme" ),
3776
+ contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
3682
3777
  $headeranchors,
3683
3778
  leftbtn,
3684
3779
  rightbtn,
@@ -3691,35 +3786,32 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
3691
3786
 
3692
3787
  var thisTheme = theme || ( role === "header" ? o.headerTheme : o.footerTheme ) || pageTheme;
3693
3788
 
3694
- //add theme class
3695
- $this.addClass( "ui-bar-" + thisTheme );
3696
-
3697
- // Add ARIA role
3698
- $this.attr( "role", role === "header" ? "banner" : "contentinfo" );
3789
+ $this
3790
+ //add theme class
3791
+ .addClass( "ui-bar-" + thisTheme )
3792
+ // Add ARIA role
3793
+ .attr( "role", role === "header" ? "banner" : "contentinfo" );
3699
3794
 
3700
3795
  // Right,left buttons
3701
3796
  $headeranchors = $this.children( "a" );
3702
- leftbtn = $headeranchors.hasClass( "ui-btn-left" );
3703
- rightbtn = $headeranchors.hasClass( "ui-btn-right" );
3704
-
3705
- if ( !leftbtn ) {
3706
- leftbtn = $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
3707
- }
3708
-
3709
- if ( !rightbtn ) {
3710
- rightbtn = $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
3711
- }
3797
+ leftbtn = $headeranchors.hasClass( "ui-btn-left" );
3798
+ rightbtn = $headeranchors.hasClass( "ui-btn-right" );
3712
3799
 
3800
+ leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
3801
+
3802
+ rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
3803
+
3713
3804
  // Auto-add back btn on pages beyond first view
3714
- if ( o.addBackBtn && role === "header" &&
3715
- $( ".ui-page" ).length > 1 &&
3716
- $this.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
3717
- !leftbtn ) {
3718
-
3719
- backBtn = $( "<a href='#' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" ).prependTo( $this );
3720
-
3721
- // If theme is provided, override default inheritance
3722
- backBtn.attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme );
3805
+ if ( o.addBackBtn &&
3806
+ role === "header" &&
3807
+ $( ".ui-page" ).length > 1 &&
3808
+ $this.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
3809
+ !leftbtn ) {
3810
+
3811
+ backBtn = $( "<a href='#' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" )
3812
+ // If theme is provided, override default inheritance
3813
+ .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme )
3814
+ .prependTo( $this );
3723
3815
  }
3724
3816
 
3725
3817
  // Page title
@@ -3733,24 +3825,20 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
3733
3825
  });
3734
3826
 
3735
3827
  } else if ( role === "content" ) {
3736
-
3737
- if (theme || o.contentTheme) {
3738
- $this.addClass( "ui-body-" + ( theme || o.contentTheme ) );
3828
+ if ( contentTheme ) {
3829
+ $this.addClass( "ui-body-" + ( contentTheme ) );
3739
3830
  }
3740
3831
 
3741
3832
  // Add ARIA role
3742
3833
  $this.attr( "role", "main" );
3743
-
3744
3834
  }
3745
3835
  });
3746
3836
  });
3747
3837
 
3748
3838
  })( jQuery );/*
3749
- * jQuery Mobile Framework : "collapsible" plugin
3750
- * Copyright (c) jQuery Project
3751
- * Dual licensed under the MIT or GPL Version 2 licenses.
3752
- * http://jquery.org/license
3839
+ * "collapsible" plugin
3753
3840
  */
3841
+
3754
3842
  (function( $, undefined ) {
3755
3843
 
3756
3844
  $.widget( "mobile.collapsible", $.mobile.widget, {
@@ -3758,7 +3846,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3758
3846
  expandCueText: " click to expand contents",
3759
3847
  collapseCueText: " click to collapse contents",
3760
3848
  collapsed: true,
3761
- heading: ">:header,>legend",
3849
+ heading: "h1,h2,h3,h4,h5,h6,legend",
3762
3850
  theme: null,
3763
3851
  contentTheme: null,
3764
3852
  iconTheme: "d",
@@ -3769,10 +3857,10 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3769
3857
  var $el = this.element,
3770
3858
  o = this.options,
3771
3859
  collapsible = $el.addClass( "ui-collapsible" ),
3772
- collapsibleHeading = $el.find( o.heading ).eq( 0 ),
3860
+ collapsibleHeading = $el.children( o.heading ).first(),
3773
3861
  collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).find( ".ui-collapsible-content" ),
3774
3862
  collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ),
3775
- colllapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" );
3863
+ collapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" );
3776
3864
 
3777
3865
  // Replace collapsibleHeading if it's a legend
3778
3866
  if ( collapsibleHeading.is( "legend" ) ) {
@@ -3801,7 +3889,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3801
3889
  .addClass( "ui-collapsible-heading" )
3802
3890
  .append( "<span class='ui-collapsible-heading-status'></span>" )
3803
3891
  .wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
3804
- .find( "a:eq(0)" )
3892
+ .find( "a" )
3893
+ .first()
3805
3894
  .buttonMarkup({
3806
3895
  shadow: false,
3807
3896
  corners: false,
@@ -3812,7 +3901,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3812
3901
 
3813
3902
  if ( !collapsibleSet.length ) {
3814
3903
  collapsibleHeading
3815
- .find( "a:eq(0), .ui-btn-inner" )
3904
+ .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
3816
3905
  .addClass( "ui-corner-top ui-corner-bottom" );
3817
3906
  } else {
3818
3907
  // If we are in a collapsible set
@@ -3832,15 +3921,17 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3832
3921
  });
3833
3922
  }
3834
3923
 
3835
- colllapsiblesInSet.first()
3836
- .find( "a:eq(0)" )
3924
+ collapsiblesInSet.first()
3925
+ .find( "a" )
3926
+ .first()
3837
3927
  .addClass( "ui-corner-top" )
3838
3928
  .find( ".ui-btn-inner" )
3839
3929
  .addClass( "ui-corner-top" );
3840
3930
 
3841
- colllapsiblesInSet.last()
3931
+ collapsiblesInSet.last()
3842
3932
  .jqmData( "collapsible-last", true )
3843
- .find( "a:eq(0)" )
3933
+ .find( "a" )
3934
+ .first()
3844
3935
  .addClass( "ui-corner-bottom" )
3845
3936
  .find( ".ui-btn-inner" )
3846
3937
  .addClass( "ui-corner-bottom" );
@@ -3848,7 +3939,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3848
3939
 
3849
3940
  if ( collapsible.jqmData( "collapsible-last" ) ) {
3850
3941
  collapsibleHeading
3851
- .find( "a:eq(0), .ui-btn-inner" )
3942
+ .find( "a" ).first().add ( collapsibleHeading.find( ".ui-btn-inner" ) )
3852
3943
  .addClass( "ui-corner-bottom" );
3853
3944
  }
3854
3945
  }
@@ -3867,7 +3958,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3867
3958
  collapsibleHeading
3868
3959
  .toggleClass( "ui-collapsible-heading-collapsed", isCollapse)
3869
3960
  .find( ".ui-collapsible-heading-status" )
3870
- .text( o.expandCueText )
3961
+ .text( isCollapse ? o.expandCueText : o.collapseCueText )
3871
3962
  .end()
3872
3963
  .find( ".ui-icon" )
3873
3964
  .toggleClass( "ui-icon-minus", !isCollapse )
@@ -3878,10 +3969,11 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
3878
3969
 
3879
3970
  if ( contentTheme && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) {
3880
3971
  collapsibleHeading
3881
- .find( "a:eq(0), .ui-btn-inner" )
3972
+ .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
3882
3973
  .toggleClass( "ui-corner-bottom", isCollapse );
3883
3974
  collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse );
3884
3975
  }
3976
+ collapsibleContent.trigger( "updatelayout" );
3885
3977
  }
3886
3978
  })
3887
3979
  .trigger( o.collapsed ? "collapse" : "expand" );
@@ -3906,10 +3998,7 @@ $( document ).bind( "pagecreate create", function( e ){
3906
3998
 
3907
3999
  })( jQuery );
3908
4000
  /*
3909
- * jQuery Mobile Framework : "fieldcontain" plugin - simple class additions to make form row separators
3910
- * Copyright (c) jQuery Project
3911
- * Dual licensed under the MIT or GPL Version 2 licenses.
3912
- * http://jquery.org/license
4001
+ * "fieldcontain" plugin - simple class additions to make form row separators
3913
4002
  */
3914
4003
 
3915
4004
  (function( $, undefined ) {
@@ -3924,10 +4013,7 @@ $( document ).bind( "pagecreate create", function( e ){
3924
4013
  });
3925
4014
 
3926
4015
  })( jQuery );/*
3927
- * jQuery Mobile Framework : plugin for creating CSS grids
3928
- * Copyright (c) jQuery Project
3929
- * Dual licensed under the MIT or GPL Version 2 licenses.
3930
- * http://jquery.org/license
4016
+ * plugin for creating CSS grids
3931
4017
  */
3932
4018
 
3933
4019
  (function( $, undefined ) {
@@ -3976,10 +4062,7 @@ $.fn.grid = function( options ) {
3976
4062
  });
3977
4063
  };
3978
4064
  })( jQuery );/*
3979
- * jQuery Mobile Framework : "navbar" plugin
3980
- * Copyright (c) jQuery Project
3981
- * Dual licensed under the MIT or GPL Version 2 licenses.
3982
- * http://jquery.org/license
4065
+ * "navbar" plugin
3983
4066
  */
3984
4067
 
3985
4068
  (function( $, undefined ) {
@@ -4027,10 +4110,7 @@ $( document ).bind( "pagecreate create", function( e ){
4027
4110
 
4028
4111
  })( jQuery );
4029
4112
  /*
4030
- * jQuery Mobile Framework : "listview" plugin
4031
- * Copyright (c) jQuery Project
4032
- * Dual licensed under the MIT or GPL Version 2 licenses.
4033
- * http://jquery.org/license
4113
+ * "listview" plugin
4034
4114
  */
4035
4115
 
4036
4116
  (function( $, undefined ) {
@@ -4042,7 +4122,7 @@ var listCountPerPage = {};
4042
4122
 
4043
4123
  $.widget( "mobile.listview", $.mobile.widget, {
4044
4124
  options: {
4045
- theme: "c",
4125
+ theme: null,
4046
4126
  countTheme: "c",
4047
4127
  headerTheme: "b",
4048
4128
  dividerTheme: "b",
@@ -4063,25 +4143,6 @@ $.widget( "mobile.listview", $.mobile.widget, {
4063
4143
  t.refresh( true );
4064
4144
  },
4065
4145
 
4066
- _itemApply: function( $list, item ) {
4067
- var $countli = item.find( ".ui-li-count" );
4068
- if ( $countli.length ) {
4069
- item.addClass( "ui-li-has-count" );
4070
- }
4071
- $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
4072
-
4073
- // TODO class has to be defined in markup
4074
- item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
4075
- .find( "p, dl" ).addClass( "ui-li-desc" ).end()
4076
- .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
4077
- item.addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
4078
- }).end()
4079
- .find( ".ui-li-aside" ).each(function() {
4080
- var $this = $(this);
4081
- $this.prependTo( $this.parent() ); //shift aside to front for css float
4082
- });
4083
- },
4084
-
4085
4146
  _removeCorners: function( li, which ) {
4086
4147
  var top = "ui-corner-top ui-corner-tr ui-corner-tl",
4087
4148
  bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
@@ -4114,11 +4175,15 @@ $.widget( "mobile.listview", $.mobile.widget, {
4114
4175
  $topli = $visibleli.first()
4115
4176
  .addClass( "ui-corner-top" );
4116
4177
 
4117
- $topli.add( $topli.find( ".ui-btn-inner" ) )
4118
- .find( ".ui-li-link-alt" )
4178
+ $topli.add( $topli.find( ".ui-btn-inner" )
4179
+ .not( ".ui-li-link-alt span:first-child" ) )
4180
+ .addClass( "ui-corner-top" )
4181
+ .end()
4182
+ .find( ".ui-li-link-alt, .ui-li-link-alt span:first-child" )
4119
4183
  .addClass( "ui-corner-tr" )
4120
4184
  .end()
4121
4185
  .find( ".ui-li-thumb" )
4186
+ .not(".ui-li-icon")
4122
4187
  .addClass( "ui-corner-tl" );
4123
4188
 
4124
4189
  // Select the last visible li element
@@ -4130,8 +4195,62 @@ $.widget( "mobile.listview", $.mobile.widget, {
4130
4195
  .addClass( "ui-corner-br" )
4131
4196
  .end()
4132
4197
  .find( ".ui-li-thumb" )
4198
+ .not(".ui-li-icon")
4133
4199
  .addClass( "ui-corner-bl" );
4134
4200
  }
4201
+ if ( !create ) {
4202
+ this.element.trigger( "updatelayout" );
4203
+ }
4204
+ },
4205
+
4206
+ // This is a generic utility method for finding the first
4207
+ // node with a given nodeName. It uses basic DOM traversal
4208
+ // to be fast and is meant to be a substitute for simple
4209
+ // $.fn.closest() and $.fn.children() calls on a single
4210
+ // element. Note that callers must pass both the lowerCase
4211
+ // and upperCase version of the nodeName they are looking for.
4212
+ // The main reason for this is that this function will be
4213
+ // called many times and we want to avoid having to lowercase
4214
+ // the nodeName from the element every time to ensure we have
4215
+ // a match. Note that this function lives here for now, but may
4216
+ // be moved into $.mobile if other components need a similar method.
4217
+ _findFirstElementByTagName: function( ele, nextProp, lcName, ucName )
4218
+ {
4219
+ var dict = {};
4220
+ dict[ lcName ] = dict[ ucName ] = true;
4221
+ while ( ele ) {
4222
+ if ( dict[ ele.nodeName ] ) {
4223
+ return ele;
4224
+ }
4225
+ ele = ele[ nextProp ];
4226
+ }
4227
+ return null;
4228
+ },
4229
+ _getChildrenByTagName: function( ele, lcName, ucName )
4230
+ {
4231
+ var results = [],
4232
+ dict = {};
4233
+ dict[ lcName ] = dict[ ucName ] = true;
4234
+ ele = ele.firstChild;
4235
+ while ( ele ) {
4236
+ if ( dict[ ele.nodeName ] ) {
4237
+ results.push( ele );
4238
+ }
4239
+ ele = ele.nextSibling;
4240
+ }
4241
+ return $( results );
4242
+ },
4243
+
4244
+ _addThumbClasses: function( containers )
4245
+ {
4246
+ var i, img, len = containers.length;
4247
+ for ( i = 0; i < len; i++ ) {
4248
+ img = $( this._findFirstElementByTagName( containers[ i ].firstChild, "nextSibling", "img", "IMG" ) );
4249
+ if ( img.length ) {
4250
+ img.addClass( "ui-li-thumb" );
4251
+ $( this._findFirstElementByTagName( img[ 0 ].parentNode, "parentNode", "li", "LI" ) ).addClass( img.is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
4252
+ }
4253
+ }
4135
4254
  },
4136
4255
 
4137
4256
  refresh: function( create ) {
@@ -4144,14 +4263,19 @@ $.widget( "mobile.listview", $.mobile.widget, {
4144
4263
  dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
4145
4264
  listsplittheme = $list.jqmData( "splittheme" ),
4146
4265
  listspliticon = $list.jqmData( "spliticon" ),
4147
- li = $list.children( "li" ),
4266
+ li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
4148
4267
  counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
4268
+ itemClassDict = {},
4149
4269
  item, itemClass, itemTheme,
4150
- a, last, splittheme, countParent, icon;
4270
+ a, last, splittheme, countParent, icon, imgParents, img;
4151
4271
 
4152
4272
  if ( counter ) {
4153
4273
  $list.find( ".ui-li-dec" ).remove();
4154
4274
  }
4275
+
4276
+ if ( !o.theme ) {
4277
+ o.theme = $.mobile.getInheritedTheme( this.element, "c" );
4278
+ }
4155
4279
 
4156
4280
  for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {
4157
4281
  item = li.eq( pos );
@@ -4160,7 +4284,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
4160
4284
  // If we're creating the element, we update it regardless
4161
4285
  if ( create || !item.hasClass( "ui-li" ) ) {
4162
4286
  itemTheme = item.jqmData("theme") || o.theme;
4163
- a = item.children( "a" );
4287
+ a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
4164
4288
 
4165
4289
  if ( a.length ) {
4166
4290
  icon = item.jqmData("icon");
@@ -4187,7 +4311,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
4187
4311
  splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
4188
4312
 
4189
4313
  last.appendTo(item)
4190
- .attr( "title", last.text() )
4314
+ .attr( "title", last.getEncodedText() )
4191
4315
  .addClass( "ui-li-link-alt" )
4192
4316
  .empty()
4193
4317
  .buttonMarkup({
@@ -4199,7 +4323,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
4199
4323
  })
4200
4324
  .find( ".ui-btn-inner" )
4201
4325
  .append(
4202
- $( "<span />" ).buttonMarkup({
4326
+ $( document.createElement( "span" ) ).buttonMarkup({
4203
4327
  shadow: true,
4204
4328
  corners: true,
4205
4329
  theme: splittheme,
@@ -4230,11 +4354,59 @@ $.widget( "mobile.listview", $.mobile.widget, {
4230
4354
  .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
4231
4355
  }
4232
4356
 
4233
- item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
4357
+ // Instead of setting item class directly on the list item and its
4358
+ // btn-inner at this point in time, push the item into a dictionary
4359
+ // that tells us what class to set on it so we can do this after this
4360
+ // processing loop is finished.
4361
+
4362
+ if ( !itemClassDict[ itemClass ] ) {
4363
+ itemClassDict[ itemClass ] = [];
4364
+ }
4365
+
4366
+ itemClassDict[ itemClass ].push( item[ 0 ] );
4367
+ }
4368
+
4369
+ // Set the appropriate listview item classes on each list item
4370
+ // and their btn-inner elements. The main reason we didn't do this
4371
+ // in the for-loop above is because we can eliminate per-item function overhead
4372
+ // by calling addClass() and children() once or twice afterwards. This
4373
+ // can give us a significant boost on platforms like WP7.5.
4234
4374
 
4235
- self._itemApply( $list, item );
4375
+ for ( itemClass in itemClassDict ) {
4376
+ $( itemClassDict[ itemClass ] ).addClass( itemClass ).children( ".ui-btn-inner" ).addClass( itemClass );
4236
4377
  }
4237
4378
 
4379
+ $list.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" )
4380
+ .end()
4381
+
4382
+ .find( "p, dl" ).addClass( "ui-li-desc" )
4383
+ .end()
4384
+
4385
+ .find( ".ui-li-aside" ).each(function() {
4386
+ var $this = $(this);
4387
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
4388
+ })
4389
+ .end()
4390
+
4391
+ .find( ".ui-li-count" ).each( function() {
4392
+ $( this ).closest( "li" ).addClass( "ui-li-has-count" );
4393
+ }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
4394
+
4395
+ // The idea here is to look at the first image in the list item
4396
+ // itself, and any .ui-link-inherit element it may contain, so we
4397
+ // can place the appropriate classes on the image and list item.
4398
+ // Note that we used to use something like:
4399
+ //
4400
+ // li.find(">img:eq(0), .ui-link-inherit>img:eq(0)").each( ... );
4401
+ //
4402
+ // But executing a find() like that on Windows Phone 7.5 took a
4403
+ // really long time. Walking things manually with the code below
4404
+ // allows the 400 listview item page to load in about 3 seconds as
4405
+ // opposed to 30 seconds.
4406
+
4407
+ this._addThumbClasses( li );
4408
+ this._addThumbClasses( $list.find( ".ui-link-inherit" ) );
4409
+
4238
4410
  this._refreshCorners( create );
4239
4411
  },
4240
4412
 
@@ -4268,7 +4440,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
4268
4440
  parent = list.parent(),
4269
4441
  nodeEls = $( list.prevAll().toArray().reverse() ),
4270
4442
  nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
4271
- title = nodeEls.first().text(),//url limits to first 30 chars of text
4443
+ title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
4272
4444
  id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
4273
4445
  theme = list.jqmData( "theme" ) || o.theme,
4274
4446
  countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
@@ -4337,10 +4509,7 @@ $( document ).bind( "pagecreate create", function( e ){
4337
4509
 
4338
4510
  })( jQuery );
4339
4511
  /*
4340
- * jQuery Mobile Framework : "listview" filter extension
4341
- * Copyright (c) jQuery Project
4342
- * Dual licensed under the MIT or GPL Version 2 licenses.
4343
- * http://jquery.org/license
4512
+ * "listview" filter extension
4344
4513
  */
4345
4514
 
4346
4515
  (function( $, undefined ) {
@@ -4382,12 +4551,11 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
4382
4551
 
4383
4552
  // Change val as lastval for next execution
4384
4553
  $this.jqmData( "lastval" , val );
4385
-
4386
- change = val.replace( new RegExp( "^" + lastval ) , "" );
4554
+ change = val.substr( 0 , lastval.length - 1 ).replace( lastval , "" );
4387
4555
 
4388
4556
  if ( val.length < lastval.length || change.length != ( val.length - lastval.length ) ) {
4389
4557
 
4390
- // Removed chars or pasted something totaly different, check all items
4558
+ // Removed chars or pasted something totally different, check all items
4391
4559
  listItems = list.children();
4392
4560
  } else {
4393
4561
 
@@ -4417,7 +4585,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
4417
4585
  item.toggleClass( "ui-filter-hidequeue" , true );
4418
4586
  } else {
4419
4587
 
4420
- // There"s a shown item in the bucket
4588
+ // There's a shown item in the bucket
4421
4589
  childItems = true;
4422
4590
  }
4423
4591
  }
@@ -4454,10 +4622,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
4454
4622
  });
4455
4623
 
4456
4624
  })( jQuery );/*
4457
- * jQuery Mobile Framework : "nojs" plugin - class to make elements hidden to A grade browsers
4458
- * Copyright (c) jQuery Project
4459
- * Dual licensed under the MIT or GPL Version 2 licenses.
4460
- * http://jquery.org/license
4625
+ * "nojs" plugin - class to make elements hidden to A grade browsers
4461
4626
  */
4462
4627
 
4463
4628
  (function( $, undefined ) {
@@ -4468,10 +4633,7 @@ $( document ).bind( "pagecreate create", function( e ){
4468
4633
  });
4469
4634
 
4470
4635
  })( jQuery );/*
4471
- * jQuery Mobile Framework : "checkboxradio" plugin
4472
- * Copyright (c) jQuery Project
4473
- * Dual licensed under the MIT or GPL Version 2 licenses.
4474
- * http://jquery.org/license
4636
+ * "checkboxradio" plugin
4475
4637
  */
4476
4638
 
4477
4639
  (function( $, undefined ) {
@@ -4486,7 +4648,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4486
4648
  input = this.element,
4487
4649
  // NOTE: Windows Phone could not find the label through a selector
4488
4650
  // filter works though.
4489
- label = input.closest( "form,fieldset,:jqmData(role='page')" ).find( "label" ).filter( "[for='" + input[ 0 ].id + "']"),
4651
+ label = input.closest( "form,fieldset,:jqmData(role='page')" ).find( "label[for='" + input[ 0 ].id + "']"),
4490
4652
  inputtype = input.attr( "type" ),
4491
4653
  checkedState = inputtype + "-on",
4492
4654
  uncheckedState = inputtype + "-off",
@@ -4527,9 +4689,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4527
4689
  .wrapAll( "<div class='ui-" + inputtype + "'></div>" );
4528
4690
 
4529
4691
  label.bind({
4530
- vmouseover: function() {
4692
+ vmouseover: function( event ) {
4531
4693
  if ( $( this ).parent().is( ".ui-disabled" ) ) {
4532
- return false;
4694
+ event.stopPropagation();
4533
4695
  }
4534
4696
  },
4535
4697
 
@@ -4543,6 +4705,13 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4543
4705
 
4544
4706
  input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) );
4545
4707
 
4708
+ // trigger click handler's bound directly to the input as a substitute for
4709
+ // how label clicks behave normally in the browsers
4710
+ // TODO: it would be nice to let the browser's handle the clicks and pass them
4711
+ // through to the associate input. we can swallow that click at the parent
4712
+ // wrapper element level
4713
+ input.triggerHandler( 'click' );
4714
+
4546
4715
  // Input set for common radio buttons will contain all the radio
4547
4716
  // buttons, but will not for checkboxes. clearing the checked status
4548
4717
  // of other radios ensures the active button state is applied properly
@@ -4557,11 +4726,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4557
4726
  input
4558
4727
  .bind({
4559
4728
  vmousedown: function() {
4560
- this._cacheVals();
4729
+ self._cacheVals();
4561
4730
  },
4562
4731
 
4563
4732
  vclick: function() {
4564
-
4565
4733
  var $this = $(this);
4566
4734
 
4567
4735
  // Adds checked attribute to checked input when keyboard is used
@@ -4599,11 +4767,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4599
4767
 
4600
4768
  //returns either a set of radios with the same name attribute, or a single checkbox
4601
4769
  _getInputSet: function(){
4602
- if(this.inputtype == "checkbox") {
4603
- return this.element;
4604
- }
4605
- return this.element.closest( "form,fieldset,:jqmData(role='page')" )
4606
- .find( "input[name='"+ this.element.attr( "name" ) +"'][type='"+ this.inputtype +"']" );
4770
+ if(this.inputtype == "checkbox") {
4771
+ return this.element;
4772
+ }
4773
+
4774
+ return this.element.closest( "form,fieldset,:jqmData(role='page')" )
4775
+ .find( "input[name='"+ this.element.attr( "name" ) +"'][type='"+ this.inputtype +"']" );
4607
4776
  },
4608
4777
 
4609
4778
  _updateAll: function() {
@@ -4655,17 +4824,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4655
4824
 
4656
4825
  //auto self-init widgets
4657
4826
  $( document ).bind( "pagecreate create", function( e ){
4658
- $( $.mobile.checkboxradio.prototype.options.initSelector, e.target )
4659
- .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
4660
- .checkboxradio();
4827
+ $.mobile.checkboxradio.prototype.enhanceWithin( e.target );
4661
4828
  });
4662
4829
 
4663
4830
  })( jQuery );
4664
4831
  /*
4665
- * jQuery Mobile Framework : "button" plugin - links that proxy to native input/buttons
4666
- * Copyright (c) jQuery Project
4667
- * Dual licensed under the MIT or GPL Version 2 licenses.
4668
- * http://jquery.org/license
4832
+ * "button" plugin - links that proxy to native input/buttons
4669
4833
  */
4670
4834
 
4671
4835
  (function( $, undefined ) {
@@ -4691,6 +4855,7 @@ $.widget( "mobile.button", $.mobile.widget, {
4691
4855
  // Add ARIA role
4692
4856
  this.button = $( "<div></div>" )
4693
4857
  .text( $el.text() || $el.val() )
4858
+ .insertBefore( $el )
4694
4859
  .buttonMarkup({
4695
4860
  theme: o.theme,
4696
4861
  icon: o.icon,
@@ -4700,7 +4865,6 @@ $.widget( "mobile.button", $.mobile.widget, {
4700
4865
  shadow: o.shadow,
4701
4866
  iconshadow: o.iconshadow
4702
4867
  })
4703
- .insertBefore( $el )
4704
4868
  .append( $el.addClass( "ui-btn-hidden" ) );
4705
4869
 
4706
4870
  type = $el.attr( "type" );
@@ -4712,15 +4876,18 @@ $.widget( "mobile.button", $.mobile.widget, {
4712
4876
  // Add hidden input if it doesn’t already exist.
4713
4877
  if( $buttonPlaceholder === undefined ) {
4714
4878
  $buttonPlaceholder = $( "<input>", {
4715
- type: "hidden",
4716
- name: $el.attr( "name" ),
4717
- value: $el.attr( "value" )
4718
- })
4719
- .insertBefore( $el );
4879
+ type: "hidden",
4880
+ name: $el.attr( "name" ),
4881
+ value: $el.attr( "value" )
4882
+ }).insertBefore( $el );
4720
4883
 
4721
4884
  // Bind to doc to remove after submit handling
4722
- $( document ).submit(function(){
4723
- $buttonPlaceholder.remove();
4885
+ $( document ).one("submit", function(){
4886
+ $buttonPlaceholder.remove();
4887
+
4888
+ // reset the local var so that the hidden input
4889
+ // will be re-added on subsequent clicks
4890
+ $buttonPlaceholder = undefined;
4724
4891
  });
4725
4892
  }
4726
4893
  });
@@ -4742,26 +4909,27 @@ $.widget( "mobile.button", $.mobile.widget, {
4742
4909
  },
4743
4910
 
4744
4911
  refresh: function() {
4745
- if ( this.element.attr( "disabled" ) ) {
4912
+ var $el = this.element;
4913
+
4914
+ if ( $el.prop("disabled") ) {
4746
4915
  this.disable();
4747
4916
  } else {
4748
4917
  this.enable();
4749
4918
  }
4919
+
4920
+ // the textWrapper is stored as a data element on the button object
4921
+ // to prevent referencing by it's implementation details (eg 'class')
4922
+ this.button.data( 'textWrapper' ).text( $el.text() || $el.val() );
4750
4923
  }
4751
4924
  });
4752
4925
 
4753
4926
  //auto self-init widgets
4754
4927
  $( document ).bind( "pagecreate create", function( e ){
4755
- $( $.mobile.button.prototype.options.initSelector, e.target )
4756
- .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
4757
- .button();
4928
+ $.mobile.button.prototype.enhanceWithin( e.target );
4758
4929
  });
4759
4930
 
4760
4931
  })( jQuery );/*
4761
- * jQuery Mobile Framework : "slider" plugin
4762
- * Copyright (c) jQuery Project
4763
- * Dual licensed under the MIT or GPL Version 2 licenses.
4764
- * http://jquery.org/license
4932
+ * "slider" plugin
4765
4933
  */
4766
4934
 
4767
4935
  ( function( $, undefined ) {
@@ -4781,13 +4949,11 @@ $.widget( "mobile.slider", $.mobile.widget, {
4781
4949
 
4782
4950
  control = this.element,
4783
4951
 
4784
- parentTheme = control.parents( "[class*='ui-bar-'],[class*='ui-body-']" ).eq( 0 ),
4952
+ parentTheme = $.mobile.getInheritedTheme( control, "c" ),
4785
4953
 
4786
- parentTheme = parentTheme.length ? parentTheme.attr( "class" ).match( /ui-(bar|body)-([a-z])/ )[ 2 ] : "c",
4954
+ theme = this.options.theme || parentTheme,
4787
4955
 
4788
- theme = this.options.theme ? this.options.theme : parentTheme,
4789
-
4790
- trackTheme = this.options.trackTheme ? this.options.trackTheme : parentTheme,
4956
+ trackTheme = this.options.trackTheme || parentTheme,
4791
4957
 
4792
4958
  cType = control[ 0 ].nodeName.toLowerCase(),
4793
4959
 
@@ -4831,12 +4997,16 @@ $.widget( "mobile.slider", $.mobile.widget, {
4831
4997
  handle: handle,
4832
4998
  dragging: false,
4833
4999
  beforeStart: null,
4834
- userModified: false
5000
+ userModified: false,
5001
+ mouseMoved: false
4835
5002
  });
4836
5003
 
4837
5004
  if ( cType == "select" ) {
4838
5005
 
4839
5006
  slider.wrapInner( "<div class='ui-slider-inneroffset'></div>" );
5007
+
5008
+ // make the handle move with a smooth transition
5009
+ handle.addClass( "ui-slider-handle-snapping" );
4840
5010
 
4841
5011
  options = control.find( "option" );
4842
5012
 
@@ -4849,7 +5019,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
4849
5019
  $( "<div class='ui-slider-labelbg ui-slider-labelbg-" + side + theme + " ui-btn-corner-" + corners + "'></div>" )
4850
5020
  .prependTo( slider );
4851
5021
 
4852
- $( "<span class='ui-slider-label ui-slider-label-" + side + theme + " ui-btn-corner-" + corners + "' role='img'>" + $( this ).text() + "</span>" )
5022
+ $( "<span class='ui-slider-label ui-slider-label-" + side + theme + " ui-btn-corner-" + corners + "' role='img'>" + $( this ).getEncodedText() + "</span>" )
4853
5023
  .prependTo( handle );
4854
5024
  });
4855
5025
 
@@ -4860,7 +5030,10 @@ $.widget( "mobile.slider", $.mobile.widget, {
4860
5030
  // monitor the input for updated values
4861
5031
  control.addClass( cType === "input" ? "ui-slider-input" : "ui-slider-switch" )
4862
5032
  .change( function() {
4863
- self.refresh( val(), true );
5033
+ // if the user dragged the handle, the "change" event was triggered from inside refresh(); don't call refresh() again
5034
+ if (!self.mouseMoved) {
5035
+ self.refresh( val(), true );
5036
+ }
4864
5037
  })
4865
5038
  .keyup( function() { // necessary?
4866
5039
  self.refresh( val(), true, true );
@@ -4872,8 +5045,18 @@ $.widget( "mobile.slider", $.mobile.widget, {
4872
5045
  // prevent screen drag when slider activated
4873
5046
  $( document ).bind( "vmousemove", function( event ) {
4874
5047
  if ( self.dragging ) {
5048
+ // self.mouseMoved must be updated before refresh() because it will be used in the control "change" event
5049
+ self.mouseMoved = true;
5050
+
5051
+ if ( cType === "select" ) {
5052
+ // make the handle move in sync with the mouse
5053
+ handle.removeClass( "ui-slider-handle-snapping" );
5054
+ }
5055
+
4875
5056
  self.refresh( event );
4876
- self.userModified = self.userModified || self.beforeStart !== control[0].selectedIndex;
5057
+
5058
+ // only after refresh() you can calculate self.userModified
5059
+ self.userModified = self.beforeStart !== control[0].selectedIndex;
4877
5060
  return false;
4878
5061
  }
4879
5062
  });
@@ -4881,10 +5064,12 @@ $.widget( "mobile.slider", $.mobile.widget, {
4881
5064
  slider.bind( "vmousedown", function( event ) {
4882
5065
  self.dragging = true;
4883
5066
  self.userModified = false;
5067
+ self.mouseMoved = false;
4884
5068
 
4885
5069
  if ( cType === "select" ) {
4886
5070
  self.beforeStart = control[0].selectedIndex;
4887
5071
  }
5072
+
4888
5073
  self.refresh( event );
4889
5074
  return false;
4890
5075
  });
@@ -4895,14 +5080,31 @@ $.widget( "mobile.slider", $.mobile.widget, {
4895
5080
 
4896
5081
  self.dragging = false;
4897
5082
 
4898
- if ( cType === "select" ) {
4899
-
4900
- if ( !self.userModified ) {
4901
- //tap occurred, but value didn't change. flip it!
4902
- handle.addClass( "ui-slider-handle-snapping" );
4903
- self.refresh( !self.beforeStart ? 1 : 0 );
5083
+ if ( cType === "select") {
5084
+
5085
+ // make the handle move with a smooth transition
5086
+ handle.addClass( "ui-slider-handle-snapping" );
5087
+
5088
+ if ( self.mouseMoved ) {
5089
+
5090
+ // this is a drag, change the value only if user dragged enough
5091
+ if ( self.userModified ) {
5092
+ self.refresh( self.beforeStart == 0 ? 1 : 0 );
5093
+ }
5094
+ else {
5095
+ self.refresh( self.beforeStart );
5096
+ }
5097
+
4904
5098
  }
5099
+ else {
5100
+ // this is just a click, change the value
5101
+ self.refresh( self.beforeStart == 0 ? 1 : 0 );
5102
+ }
5103
+
4905
5104
  }
5105
+
5106
+ self.mouseMoved = false;
5107
+
4906
5108
  return false;
4907
5109
  }
4908
5110
  });
@@ -4974,7 +5176,10 @@ $.widget( "mobile.slider", $.mobile.widget, {
4974
5176
  },
4975
5177
 
4976
5178
  refresh: function( val, isfromControl, preventInputUpdate ) {
4977
- if ( this.options.disabled ) { return; }
5179
+
5180
+ if ( this.options.disabled || this.element.attr('disabled')) {
5181
+ this.disable();
5182
+ }
4978
5183
 
4979
5184
  var control = this.element, percent,
4980
5185
  cType = control[0].nodeName.toLowerCase(),
@@ -5027,7 +5232,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
5027
5232
  this.handle.css( "left", percent + "%" );
5028
5233
  this.handle.attr( {
5029
5234
  "aria-valuenow": cType === "input" ? newval : control.find( "option" ).eq( newval ).attr( "value" ),
5030
- "aria-valuetext": cType === "input" ? newval : control.find( "option" ).eq( newval ).text(),
5235
+ "aria-valuetext": cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText(),
5031
5236
  title: newval
5032
5237
  });
5033
5238
 
@@ -5075,19 +5280,12 @@ $.widget( "mobile.slider", $.mobile.widget, {
5075
5280
 
5076
5281
  //auto self-init widgets
5077
5282
  $( document ).bind( "pagecreate create", function( e ){
5078
-
5079
- $( $.mobile.slider.prototype.options.initSelector, e.target )
5080
- .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
5081
- .slider();
5082
-
5283
+ $.mobile.slider.prototype.enhanceWithin( e.target );
5083
5284
  });
5084
5285
 
5085
5286
  })( jQuery );
5086
5287
  /*
5087
- * jQuery Mobile Framework : "textinput" plugin for text inputs, textareas
5088
- * Copyright (c) jQuery Project
5089
- * Dual licensed under the MIT or GPL Version 2 licenses.
5090
- * http://jquery.org/license
5288
+ * "textinput" plugin for text inputs, textareas
5091
5289
  */
5092
5290
 
5093
5291
  (function( $, undefined ) {
@@ -5095,29 +5293,20 @@ $( document ).bind( "pagecreate create", function( e ){
5095
5293
  $.widget( "mobile.textinput", $.mobile.widget, {
5096
5294
  options: {
5097
5295
  theme: null,
5098
- initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input:not([type])"
5296
+ initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])"
5099
5297
  },
5100
5298
 
5101
5299
  _create: function() {
5102
5300
 
5103
5301
  var input = this.element,
5104
5302
  o = this.options,
5105
- theme = o.theme,
5106
- themedParent, themeclass, themeLetter, focusedEl, clearbtn;
5107
-
5108
- if ( !theme ) {
5109
- themedParent = this.element.closest( "[class*='ui-bar-'],[class*='ui-body-']" );
5110
- themeLetter = themedParent.length && /ui-(bar|body)-([a-z])/.exec( themedParent.attr( "class" ) );
5111
- theme = themeLetter && themeLetter[2] || "c";
5112
- }
5113
-
5114
- themeclass = " ui-body-" + theme;
5303
+ theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
5304
+ themeclass = " ui-body-" + theme,
5305
+ focusedEl, clearbtn;
5115
5306
 
5116
5307
  $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
5117
5308
 
5118
- input.addClass("ui-input-text ui-body-"+ o.theme );
5119
-
5120
- focusedEl = input;
5309
+ focusedEl = input.addClass("ui-input-text ui-body-"+ theme );
5121
5310
 
5122
5311
  // XXX: Temporary workaround for issue 785 (Apple bug 8910589).
5123
5312
  // Turn off autocorrect and autocomplete on non-iOS 5 devices
@@ -5154,17 +5343,14 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5154
5343
  });
5155
5344
 
5156
5345
  function toggleClear() {
5157
- if ( !input.val() ) {
5158
- clearbtn.addClass( "ui-input-clear-hidden" );
5159
- } else {
5160
- clearbtn.removeClass( "ui-input-clear-hidden" );
5161
- }
5346
+ setTimeout(function() {
5347
+ clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
5348
+ }, 0);
5162
5349
  }
5163
5350
 
5164
5351
  toggleClear();
5165
5352
 
5166
- input.keyup( toggleClear )
5167
- .focus( toggleClear );
5353
+ input.bind('paste cut keyup focus change blur', toggleClear);
5168
5354
 
5169
5355
  } else {
5170
5356
  input.addClass( "ui-corner-all ui-shadow-inset" + themeclass );
@@ -5186,9 +5372,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5186
5372
  clientHeight = input[ 0 ].clientHeight;
5187
5373
 
5188
5374
  if ( clientHeight < scrollHeight ) {
5189
- input.css({
5190
- height: (scrollHeight + extraLineHeight)
5191
- });
5375
+ input.height(scrollHeight + extraLineHeight);
5192
5376
  }
5193
5377
  },
5194
5378
  keyupTimeout;
@@ -5197,6 +5381,17 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5197
5381
  clearTimeout( keyupTimeout );
5198
5382
  keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer );
5199
5383
  });
5384
+
5385
+ // Issue 509: the browser is not providing scrollHeight properly until the styles load
5386
+ if ( $.trim( input.val() ) ) {
5387
+ // bind to the window load to make sure the height is calculated based on BOTH
5388
+ // the DOM and CSS
5389
+ $( window ).load( keyup );
5390
+
5391
+ // binding to pagechange here ensures that for pages loaded via
5392
+ // ajax the height is recalculated without user input
5393
+ $( document ).one( "pagechange", keyup );
5394
+ }
5200
5395
  }
5201
5396
  },
5202
5397
 
@@ -5213,19 +5408,12 @@ $.widget( "mobile.textinput", $.mobile.widget, {
5213
5408
 
5214
5409
  //auto self-init widgets
5215
5410
  $( document ).bind( "pagecreate create", function( e ){
5216
-
5217
- $( $.mobile.textinput.prototype.options.initSelector, e.target )
5218
- .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
5219
- .textinput();
5220
-
5411
+ $.mobile.textinput.prototype.enhanceWithin( e.target );
5221
5412
  });
5222
5413
 
5223
5414
  })( jQuery );
5224
5415
  /*
5225
- * jQuery Mobile Framework : custom "selectmenu" plugin
5226
- * Copyright (c) jQuery Project
5227
- * Dual licensed under the MIT or GPL Version 2 licenses.
5228
- * http://jquery.org/license
5416
+ * custom "selectmenu" plugin
5229
5417
  */
5230
5418
 
5231
5419
  (function( $, undefined ) {
@@ -5240,7 +5428,7 @@ $( document ).bind( "pagecreate create", function( e ){
5240
5428
  isMultiple = widget.isMultiple = widget.select[ 0 ].multiple,
5241
5429
  buttonId = selectID + "-button",
5242
5430
  menuId = selectID + "-menu",
5243
- menuPage = $( "<div data-" + $.mobile.ns + "role='dialog' data-" +$.mobile.ns + "theme='"+ widget.options.menuPageTheme +"'>" +
5431
+ menuPage = $( "<div data-" + $.mobile.ns + "role='dialog' data-" +$.mobile.ns + "theme='"+ widget.options.theme +"' data-" +$.mobile.ns + "overlay-theme='"+ widget.options.overlayTheme +"'>" +
5244
5432
  "<div data-" + $.mobile.ns + "role='header'>" +
5245
5433
  "<div class='ui-title'>" + label.getEncodedText() + "</div>"+
5246
5434
  "</div>"+
@@ -5547,7 +5735,7 @@ $( document ).bind( "pagecreate create", function( e ){
5547
5735
  // fall into a black hole
5548
5736
  self.thisPage.unbind( "pagehide.remove" );
5549
5737
 
5550
- //for webos (set lastscroll using button offset)
5738
+ //for WebOS/Opera Mini (set lastscroll using button offset)
5551
5739
  if ( scrollTop == 0 && btnOffset > screenHeight ) {
5552
5740
  self.thisPage.one( "pagehide", function() {
5553
5741
  $( this ).jqmData( "lastScroll", btnOffset );
@@ -5569,6 +5757,7 @@ $( document ).bind( "pagecreate create", function( e ){
5569
5757
 
5570
5758
  self.menuType = "page";
5571
5759
  self.menuPageContent.append( self.list );
5760
+ self.menuPage.find("div .ui-title").text(self.label.text());
5572
5761
  $.mobile.changePage( self.menuPage, {
5573
5762
  transition: $.mobile.defaultDialogTransition
5574
5763
  });
@@ -5717,10 +5906,7 @@ $( document ).bind( "pagecreate create", function( e ){
5717
5906
  });
5718
5907
  })( jQuery );
5719
5908
  /*
5720
- * jQuery Mobile Framework : "selectmenu" plugin
5721
- * Copyright (c) jQuery Project
5722
- * Dual licensed under the MIT or GPL Version 2 licenses.
5723
- * http://jquery.org/license
5909
+ * "selectmenu" plugin
5724
5910
  */
5725
5911
 
5726
5912
  (function( $, undefined ) {
@@ -5747,22 +5933,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
5747
5933
  return $( "<div/>" );
5748
5934
  },
5749
5935
 
5750
- _theme: function(){
5751
- if ( this.options.theme ){
5752
- return this.options.theme;
5753
- }
5754
-
5755
- var themedParent, theme;
5756
- // if no theme is defined, try to find closest theme container
5757
- // TODO move to core as something like findCurrentTheme
5758
- themedParent = this.select.closest( "[class*='ui-bar-'], [class*='ui-body-']" );
5759
- theme = themedParent.length ?
5760
- /ui-(bar|body)-([a-z])/.exec( themedParent.attr( "class" ) )[2] :
5761
- "c";
5762
-
5763
- return theme;
5764
- },
5765
-
5766
5936
  _setDisabled: function( value ) {
5767
5937
  this.element.attr( "disabled", value );
5768
5938
  this.button.attr( "aria-disabled", value );
@@ -5787,7 +5957,9 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
5787
5957
  this.selectID = this.select.attr( "id" );
5788
5958
  this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" );
5789
5959
  this.isMultiple = this.select[ 0 ].multiple;
5790
- this.options.theme = this._theme();
5960
+ if ( !this.options.theme ) {
5961
+ this.options.theme = $.mobile.getInheritedTheme( this.select, "c" );
5962
+ }
5791
5963
  },
5792
5964
 
5793
5965
  _create: function() {
@@ -5840,7 +6012,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
5840
6012
  }
5841
6013
 
5842
6014
  // Disable if specified
5843
- if ( options.disabled ) {
6015
+ if ( options.disabled || this.element.attr('disabled')) {
5844
6016
  this.disable();
5845
6017
  }
5846
6018
 
@@ -5935,33 +6107,40 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
5935
6107
 
5936
6108
  //auto self-init widgets
5937
6109
  $( document ).bind( "pagecreate create", function( e ){
5938
- $( $.mobile.selectmenu.prototype.options.initSelector, e.target )
5939
- .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
5940
- .selectmenu();
6110
+ $.mobile.selectmenu.prototype.enhanceWithin( e.target );
5941
6111
  });
5942
6112
  })( jQuery );
5943
6113
  /*
5944
- * jQuery Mobile Framework : plugin for making button-like links
5945
- * Copyright (c) jQuery Project
5946
- * Dual licensed under the MIT or GPL Version 2 licenses.
5947
- * http://jquery.org/license
6114
+ * "buttons" plugin - for making button-like links
5948
6115
  */
6116
+
5949
6117
  ( function( $, undefined ) {
5950
6118
 
5951
6119
  $.fn.buttonMarkup = function( options ) {
5952
- return this.each( function() {
5953
- var el = $( this ),
6120
+ options = options || {};
6121
+
6122
+ for ( var i = 0; i < this.length; i++ ) {
6123
+ var el = this.eq( i ),
6124
+ e = el[ 0 ],
5954
6125
  o = $.extend( {}, $.fn.buttonMarkup.defaults, {
5955
- icon: el.jqmData( "icon" ),
5956
- iconpos: el.jqmData( "iconpos" ),
5957
- theme: el.jqmData( "theme" ),
5958
- inline: el.jqmData( "inline" )
6126
+ icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
6127
+ iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
6128
+ theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ),
6129
+ inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
6130
+ shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
6131
+ corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
6132
+ iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" )
5959
6133
  }, options ),
5960
6134
 
5961
6135
  // Classes Defined
5962
6136
  innerClass = "ui-btn-inner",
6137
+ textClass = "ui-btn-text",
5963
6138
  buttonClass, iconClass,
5964
- themedParent, wrap;
6139
+
6140
+ // Button inner markup
6141
+ buttonInner = document.createElement( o.wrapperEls ),
6142
+ buttonText = document.createElement( o.wrapperEls ),
6143
+ buttonIcon = o.icon ? document.createElement( "span" ) : null;
5965
6144
 
5966
6145
  if ( attachEvents ) {
5967
6146
  attachEvents();
@@ -5969,10 +6148,7 @@ $.fn.buttonMarkup = function( options ) {
5969
6148
 
5970
6149
  // if not, try to find closest theme container
5971
6150
  if ( !o.theme ) {
5972
- themedParent = el.closest( "[class*='ui-bar-'],[class*='ui-body-']" );
5973
- o.theme = themedParent.length ?
5974
- /ui-(bar|body)-([a-z])/.exec( themedParent.attr( "class" ) )[2] :
5975
- "c";
6151
+ o.theme = $.mobile.getInheritedTheme( el, "c" );
5976
6152
  }
5977
6153
 
5978
6154
  buttonClass = "ui-btn ui-btn-up-" + o.theme;
@@ -5996,7 +6172,7 @@ $.fn.buttonMarkup = function( options ) {
5996
6172
  buttonClass += " ui-btn-icon-" + o.iconpos;
5997
6173
 
5998
6174
  if ( o.iconpos == "notext" && !el.attr( "title" ) ) {
5999
- el.attr( "title", el.text() );
6175
+ el.attr( "title", el.getEncodedText() );
6000
6176
  }
6001
6177
  }
6002
6178
 
@@ -6009,15 +6185,33 @@ $.fn.buttonMarkup = function( options ) {
6009
6185
  buttonClass += " ui-shadow";
6010
6186
  }
6011
6187
 
6012
- el.attr( "data-" + $.mobile.ns + "theme", o.theme )
6013
- .addClass( buttonClass );
6188
+ e.setAttribute( "data-" + $.mobile.ns + "theme", o.theme );
6189
+ el.addClass( buttonClass );
6014
6190
 
6015
- wrap = ( "<D class='" + innerClass + "'><D class='ui-btn-text'></D>" +
6016
- ( o.icon ? "<span class='" + iconClass + "'></span>" : "" ) +
6017
- "</D>" ).replace( /D/g, o.wrapperEls );
6191
+ buttonInner.className = innerClass;
6192
+ buttonInner.setAttribute("aria-hidden", "true");
6018
6193
 
6019
- el.wrapInner( wrap );
6020
- });
6194
+ buttonText.className = textClass;
6195
+ buttonInner.appendChild( buttonText );
6196
+
6197
+ if ( buttonIcon ) {
6198
+ buttonIcon.className = iconClass;
6199
+ buttonInner.appendChild( buttonIcon );
6200
+ }
6201
+
6202
+ while ( e.firstChild ) {
6203
+ buttonText.appendChild( e.firstChild );
6204
+ }
6205
+
6206
+ e.appendChild( buttonInner );
6207
+
6208
+ // TODO obviously it would be nice to pull this element out instead of
6209
+ // retrieving it from the DOM again, but this change is much less obtrusive
6210
+ // and 1.0 draws nigh
6211
+ $.data( e, 'textWrapper', $( buttonText ) );
6212
+ }
6213
+
6214
+ return this;
6021
6215
  };
6022
6216
 
6023
6217
  $.fn.buttonMarkup.defaults = {
@@ -6029,14 +6223,23 @@ $.fn.buttonMarkup.defaults = {
6029
6223
  };
6030
6224
 
6031
6225
  function closestEnabledButton( element ) {
6032
- while ( element ) {
6033
- var $ele = $( element );
6034
- if ( $ele.hasClass( "ui-btn" ) && !$ele.hasClass( "ui-disabled" ) ) {
6035
- break;
6036
- }
6037
- element = element.parentNode;
6038
- }
6039
- return element;
6226
+ var cname;
6227
+
6228
+ while ( element ) {
6229
+ // Note that we check for typeof className below because the element we
6230
+ // handed could be in an SVG DOM where className on SVG elements is defined to
6231
+ // be of a different type (SVGAnimatedString). We only operate on HTML DOM
6232
+ // elements, so we look for plain "string".
6233
+
6234
+ cname = ( typeof element.className === 'string' ) && element.className.split(' ');
6235
+
6236
+ if ( cname && $.inArray( "ui-btn", cname ) > -1 && $.inArray( "ui-disabled", cname ) < 0 ) {
6237
+ break;
6238
+ }
6239
+ element = element.parentNode;
6240
+ }
6241
+
6242
+ return element;
6040
6243
  }
6041
6244
 
6042
6245
  var attachEvents = function() {
@@ -6078,7 +6281,7 @@ var attachEvents = function() {
6078
6281
  if ( btn ) {
6079
6282
  $btn = $( btn );
6080
6283
  theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
6081
- $btn.removeClass( "ui-btn-hover-" + theme ).addClass( "ui-btn-up-" + theme );
6284
+ $btn.removeClass( "ui-btn-hover-" + theme + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
6082
6285
  }
6083
6286
  }
6084
6287
  });
@@ -6096,12 +6299,10 @@ $( document ).bind( "pagecreate create", function( e ){
6096
6299
  });
6097
6300
 
6098
6301
  })( jQuery );
6099
- /*
6100
- * jQuery Mobile Framework: "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc
6101
- * Copyright (c) jQuery Project
6102
- * Dual licensed under the MIT or GPL Version 2 licenses.
6103
- * http://jquery.org/license
6302
+ /*
6303
+ * "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc
6104
6304
  */
6305
+
6105
6306
  (function( $, undefined ) {
6106
6307
 
6107
6308
  $.fn.controlgroup = function( options ) {
@@ -6114,9 +6315,9 @@ $.fn.controlgroup = function( options ) {
6114
6315
  shadow: false,
6115
6316
  excludeInvisible: true
6116
6317
  }, options ),
6117
- groupheading = $el.find( ">legend" ),
6318
+ groupheading = $el.children( "legend" ),
6118
6319
  flCorners = o.direction == "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
6119
- type = $el.find( "input:eq(0)" ).attr( "type" );
6320
+ type = $el.find( "input" ).first().attr( "type" );
6120
6321
 
6121
6322
  // Replace legend with more stylable replacement div
6122
6323
  if ( groupheading.length ) {
@@ -6133,7 +6334,7 @@ $.fn.controlgroup = function( options ) {
6133
6334
  els.removeClass( "ui-btn-corner-all ui-shadow" )
6134
6335
  .eq( 0 ).addClass( flCorners[ 0 ] )
6135
6336
  .end()
6136
- .filter( ":last" ).addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
6337
+ .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
6137
6338
  }
6138
6339
 
6139
6340
  flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ) );
@@ -6151,10 +6352,7 @@ $( document ).bind( "pagecreate create", function( e ){
6151
6352
  });
6152
6353
 
6153
6354
  })(jQuery);/*
6154
- * jQuery Mobile Framework : "links" plugin - simple class additions for links
6155
- * Copyright (c) jQuery Project
6156
- * Dual licensed under the MIT or GPL Version 2 licenses.
6157
- * http://jquery.org/license
6355
+ * "links" plugin - simple class additions for links
6158
6356
  */
6159
6357
 
6160
6358
  (function( $, undefined ) {
@@ -6170,10 +6368,7 @@ $( document ).bind( "pagecreate create", function( e ){
6170
6368
  });
6171
6369
 
6172
6370
  })( jQuery );/*
6173
- * jQuery Mobile Framework : "fixHeaderFooter" plugin - on-demand positioning for headers,footers
6174
- * Copyright (c) jQuery Project
6175
- * Dual licensed under the MIT or GPL Version 2 licenses.
6176
- * http://jquery.org/license
6371
+ * "fixHeaderFooter" plugin - on-demand positioning for headers,footers
6177
6372
  */
6178
6373
 
6179
6374
  (function( $, undefined ) {
@@ -6319,7 +6514,7 @@ $.mobile.fixedToolbars = (function() {
6319
6514
  stateBefore = null;
6320
6515
  });
6321
6516
 
6322
- $window.bind( "resize", showEventCallback );
6517
+ $window.bind( "resize updatelayout", showEventCallback );
6323
6518
  });
6324
6519
 
6325
6520
  // 1. Before page is shown, check for duplicate footer
@@ -6552,10 +6747,7 @@ $( document ).bind( "pagecreate create", function( event ) {
6552
6747
 
6553
6748
  })( jQuery );
6554
6749
  /*
6555
- * jQuery Mobile Framework : "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content
6556
- * Copyright (c) jQuery Project
6557
- * Dual licensed under the MIT or GPL Version 2 licenses.
6558
- * http://jquery.org/license
6750
+ * "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content
6559
6751
  */
6560
6752
 
6561
6753
  (function( $, undefined ) {
@@ -6614,14 +6806,9 @@ $( document ).bind( "pagecreate", function( event ) {
6614
6806
  });
6615
6807
 
6616
6808
  })( jQuery );
6617
- /*!
6618
- * jQuery Mobile v@VERSION
6619
- * http://jquerymobile.com/
6620
- *
6621
- * Copyright 2010, jQuery Project
6622
- * Dual licensed under the MIT or GPL Version 2 licenses.
6623
- * http://jquery.org/license
6624
- */
6809
+ /*
6810
+ * "init" - Initialize the framework
6811
+ */
6625
6812
 
6626
6813
  (function( $, window, undefined ) {
6627
6814
  var $html = $( "html" ),