rhodes 2.2.6 → 2.3.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (486) hide show
  1. data/CHANGELOG +20 -0
  2. data/README.md +46 -0
  3. data/Rakefile +85 -80
  4. data/bin/rhodes +2 -2
  5. data/bin/rhogen +1 -1
  6. data/doc/application.txt +277 -0
  7. data/doc/bb-css.txt +209 -0
  8. data/doc/build.txt +785 -0
  9. data/doc/configuration.txt +236 -0
  10. data/doc/connect-to-web-services.txt +282 -0
  11. data/doc/contributing.txt +64 -0
  12. data/doc/css-framework.txt +144 -0
  13. data/doc/device-caps.txt +1152 -0
  14. data/doc/extensions.txt +528 -0
  15. data/doc/files.txt +4 -0
  16. data/doc/generator.txt +141 -0
  17. data/doc/install.txt +35 -0
  18. data/doc/introduction.txt +88 -0
  19. data/doc/rhom.txt +826 -0
  20. data/doc/standard-css.txt +392 -0
  21. data/doc/synchronization.txt +542 -0
  22. data/doc/test-log-debug.txt +148 -0
  23. data/doc/tutorial.txt +136 -0
  24. data/doc/ui.txt +766 -0
  25. data/installer/EnvVarUpdate.nsh +328 -0
  26. data/installer/README.html +81 -0
  27. data/installer/RHOSYNC-LICENSE.txt +675 -0
  28. data/installer/icon.ico +0 -0
  29. data/installer/instant-rhodes.nsi +427 -0
  30. data/lib/build/jake.rb +15 -1
  31. data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/imageprovider.cpp +1 -1
  32. data/lib/extensions/barcode/ext/barcode/platform/bb/Barcode6.files +45 -0
  33. data/lib/extensions/barcode/ext/barcode/platform/bb/Rakefile +6 -0
  34. data/lib/extensions/barcode/ext/barcode/platform/bb/barcode6.jdp +92 -0
  35. data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +7 -4
  36. data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +2 -1
  37. data/lib/extensions/barcode/ext/barcode/platform/wm/src/wm_imageprovider.cpp +1 -1
  38. data/lib/extensions/digest-sha1/ext/build.bat +1 -0
  39. data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +335 -0
  40. data/lib/extensions/esri/ext/build +17 -0
  41. data/lib/extensions/esri/ext/build.bat +29 -0
  42. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.h +7 -0
  43. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.mm +58 -0
  44. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactoryRegister.mm +22 -0
  45. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.h +21 -0
  46. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.mm +32 -0
  47. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/InitESRI.c +5 -0
  48. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +143 -0
  49. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.m +919 -0
  50. data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +320 -0
  51. data/lib/extensions/esri/ext/esri/platform/iphone/ESRI_Prefix.pch +7 -0
  52. data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +76 -0
  53. data/lib/extensions/esri/ext.yml +3 -0
  54. data/lib/extensions/net-http/monitor.rb +265 -0
  55. data/lib/extensions/net-http/net/ftp.rb +981 -0
  56. data/lib/extensions/net-http/thread.rb +367 -0
  57. data/lib/extensions/rhocgi/cgi.rb +16 -0
  58. data/lib/extensions/rhospec/rhospec.rb +118 -0
  59. data/lib/framework/base64.rb +91 -0
  60. data/lib/framework/builtinME.rb +13 -10
  61. data/lib/framework/ostruct.rb +145 -0
  62. data/lib/framework/res/back_btn.wm.png +0 -0
  63. data/lib/framework/res/blue_pushpin.wm.png +0 -0
  64. data/lib/framework/res/blue_pushpin_small.wm.png +0 -0
  65. data/lib/framework/res/callout.wm.png +0 -0
  66. data/lib/framework/res/callout_link.wm.png +0 -0
  67. data/lib/framework/res/forward_btn.wm.png +0 -0
  68. data/lib/framework/res/home_btn.wm.png +0 -0
  69. data/lib/framework/res/options_btn.wm.png +0 -0
  70. data/lib/framework/res/refresh_btn.wm.png +0 -0
  71. data/lib/framework/rho/render.rb +5 -2
  72. data/lib/framework/rho/rho.rb +320 -50
  73. data/lib/framework/rho/rhoapplication.rb +48 -10
  74. data/lib/framework/rho/rhonativeviewmanager.rb +73 -0
  75. data/lib/framework/rho/rhosupport.rb +15 -1
  76. data/lib/framework/rho/rhotabbar.rb +29 -0
  77. data/lib/framework/rho/rhotoolbar.rb +17 -0
  78. data/lib/framework/rho/rhoutils.rb +22 -6
  79. data/lib/framework/rhodes.rb +1 -1
  80. data/lib/framework/rholang/rhomsg_de.rb +4 -3
  81. data/lib/framework/rholang/rhomsg_en.rb +1 -0
  82. data/lib/framework/rholang/rhomsg_es.rb +1 -0
  83. data/lib/framework/rholang/rhomsg_it.rb +1 -0
  84. data/lib/framework/rhom/rhom.rb +31 -10
  85. data/lib/framework/rhom/rhom_db_adapter.rb +33 -23
  86. data/lib/framework/rhom/rhom_object_factory.rb +465 -249
  87. data/lib/framework/rhom/rhom_source.rb +22 -7
  88. data/lib/framework/version.rb +1 -1
  89. data/lib/rhodes.rb +1 -1
  90. data/platform/android/Rhodes/AndroidManifest.xml +83 -20
  91. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +5 -0
  92. data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +2 -0
  93. data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +9 -5
  94. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesAppOptions.h +53 -0
  95. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +46 -56
  96. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_SplashScreen.h +10 -0
  97. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_mapview_MapView.h +93 -0
  98. data/platform/android/Rhodes/jni/include/rhodes/rhocryptimpl.h +38 -0
  99. data/platform/android/Rhodes/jni/include/rhodes.h +64 -8
  100. data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +6 -0
  101. data/platform/android/Rhodes/jni/src/alert.cpp +5 -11
  102. data/platform/android/Rhodes/jni/src/bluetooth.cpp +66 -29
  103. data/platform/android/Rhodes/jni/src/callbacks.cpp +24 -21
  104. data/platform/android/Rhodes/jni/src/camera.cpp +2 -6
  105. data/platform/android/Rhodes/jni/src/datetimepicker.cpp +13 -11
  106. data/platform/android/Rhodes/jni/src/event.cpp +9 -15
  107. data/platform/android/Rhodes/jni/src/fileapi.cpp +13 -27
  108. data/platform/android/Rhodes/jni/src/logconf.cpp +3 -3
  109. data/platform/android/Rhodes/jni/src/mapview.cpp +696 -16
  110. data/platform/android/Rhodes/jni/src/menu.cpp +3 -3
  111. data/platform/android/Rhodes/jni/src/nativebar.cpp +55 -4
  112. data/platform/android/Rhodes/jni/src/nativeview.cpp +33 -0
  113. data/platform/android/Rhodes/jni/src/phonebook.cpp +6 -11
  114. data/platform/android/Rhodes/jni/src/rhoconf.cpp +4 -4
  115. data/platform/android/Rhodes/jni/src/rhocryptimpl.cpp +87 -0
  116. data/platform/android/Rhodes/jni/src/rhodes.cpp +55 -34
  117. data/platform/android/Rhodes/jni/src/ringtones.cpp +2 -3
  118. data/platform/android/Rhodes/jni/src/signature.cpp +3 -5
  119. data/platform/android/Rhodes/jni/src/splashscreen.cpp +7 -0
  120. data/platform/android/Rhodes/jni/src/sslimpl.cpp +17 -20
  121. data/platform/android/Rhodes/jni/src/webview.cpp +13 -12
  122. data/platform/android/Rhodes/res/drawable/callout.png +0 -0
  123. data/platform/android/Rhodes/res/drawable/callout_link.png +0 -0
  124. data/platform/android/Rhodes/res/drawable/signature_cancel.png +0 -0
  125. data/platform/android/Rhodes/res/drawable/signature_clear.png +0 -0
  126. data/platform/android/Rhodes/res/drawable/signature_ok.png +0 -0
  127. data/platform/android/Rhodes/res/layout/datetime.xml +4 -0
  128. data/platform/android/Rhodes/res/layout/signature.xml +24 -17
  129. data/platform/android/Rhodes/res/layout/status_bar_ongoing_event_progress_bar.xml +102 -0
  130. data/platform/android/Rhodes/res/values/strings.xml +1 -1
  131. data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +6 -0
  132. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Base64.java +575 -0
  133. data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +83 -0
  134. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +21 -3
  135. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +23 -15
  136. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +2 -2
  137. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +151 -0
  138. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +2 -2
  139. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +372 -0
  140. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java +11 -0
  141. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +58 -0
  142. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +705 -523
  143. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java +1 -1
  144. data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +167 -85
  145. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +36 -1
  146. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +4 -2
  147. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +33 -20
  148. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +2 -6
  149. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +2 -24
  150. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +106 -36
  151. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +15 -58
  152. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +0 -7
  153. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +6 -4
  154. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/FileList.java +4 -3
  155. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +91 -27
  156. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +6 -3
  157. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +275 -42
  158. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -1
  159. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +1 -3
  160. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
  161. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +1 -0
  162. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +120 -43
  163. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +518 -28
  164. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +2 -2
  165. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +434 -0
  166. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapTouch.java +20 -0
  167. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +296 -336
  168. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MultiTouchHandler.java +111 -0
  169. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/OneTouchHandler.java +77 -0
  170. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/TouchHandler.java +10 -0
  171. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +0 -1
  172. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +5 -1
  173. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +1 -1
  174. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +1 -1
  175. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +6 -11
  176. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +6 -4
  177. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +0 -7
  178. data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java +9 -4
  179. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +8 -8
  180. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +5 -1
  181. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +11 -7
  182. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +3 -5
  183. data/platform/android/build/RhodesSRC_build.files +32 -23
  184. data/platform/android/build/android.rake +28 -11
  185. data/platform/android/build/androidcommon.rb +2 -0
  186. data/platform/android/build/librhocommon_build.files +9 -5
  187. data/platform/android/build/librhodes_build.files +1 -0
  188. data/platform/android/build/libruby_build.files +1 -0
  189. data/platform/bb/Hsqldb/Hsqldb.jdp +0 -2
  190. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +10 -2
  191. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +37 -5
  192. data/platform/bb/Hsqldb/src/org/hsqldb/Column.java +5 -5
  193. data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -1
  194. data/platform/bb/Hsqldb/src/org/hsqldb/Function.java +73 -78
  195. data/platform/bb/Hsqldb/src/org/hsqldb/Library.java +288 -8
  196. data/platform/bb/RubyVM/RubyVM.jdp +3 -0
  197. data/platform/bb/RubyVM/src/com/rho/FilePath.java +13 -1
  198. data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -2
  199. data/platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java +12 -0
  200. data/platform/bb/RubyVM/src/com/rho/RhoClassFactory.java +18 -1
  201. data/platform/bb/RubyVM/src/com/rho/RhoConf.java +128 -108
  202. data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +9 -10
  203. data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +16 -1
  204. data/platform/bb/RubyVM/src/com/rho/RhoProfiler.java +1 -1
  205. data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +20 -0
  206. data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +5 -2
  207. data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +65 -46
  208. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +192 -50
  209. data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +8 -114
  210. data/platform/bb/RubyVM/src/com/rho/db/DBException.java +1 -1
  211. data/platform/bb/RubyVM/src/com/rho/db/IDBCallback.java +1 -1
  212. data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +5 -3
  213. data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +5 -1
  214. data/platform/bb/RubyVM/src/com/rho/file/FileAccessBB.java +109 -0
  215. data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +85 -0
  216. data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +12 -4
  217. data/platform/bb/RubyVM/src/com/rho/net/NetResponse.java +5 -0
  218. data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +37 -23
  219. data/platform/bb/RubyVM/src/com/rho/net/URI.java +84 -0
  220. data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
  221. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +119 -61
  222. data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +61 -24
  223. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +108 -54
  224. data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +121 -163
  225. data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +23 -0
  226. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyMutex.java +1 -1
  227. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRange.java +3 -1
  228. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRegexp.java +3 -1
  229. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +208 -25
  230. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +3 -1
  231. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +5 -1
  232. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +12 -5
  233. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyID.java +1 -0
  234. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +16 -0
  235. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule_Methods.java +5 -0
  236. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyValue.java +1 -1
  237. data/platform/bb/RubyVM/src/com/xruby/runtime/stdlib/RubyStringIO.java +4 -1
  238. data/platform/bb/{Hsqldb → RubyVM}/src/j2me/math/Number.java +33 -0
  239. data/platform/bb/build/RubyVM_build.files +3 -0
  240. data/platform/bb/build/bb.rake +140 -62
  241. data/platform/bb/build/hsqldb_build.files +0 -2
  242. data/platform/bb/build/rhodes_build.files +5 -0
  243. data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +43 -7
  244. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +23 -2
  245. data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +5 -0
  246. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +143 -0
  247. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +269 -0
  248. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +446 -0
  249. data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +3 -0
  250. data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +12 -2
  251. data/platform/bb/rhodes/platform/common/com/rho/db/SqliteCopyResult.java +2 -0
  252. data/platform/bb/rhodes/platform/common/com/rho/db/SqliteResult.java +2 -0
  253. data/platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java +2 -0
  254. data/platform/bb/rhodes/resources/mappin.png +0 -0
  255. data/platform/bb/rhodes/rhodes.jdp +3 -0
  256. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +21 -18
  257. data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +150 -0
  258. data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +1 -0
  259. data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +63 -4
  260. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -5
  261. data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +242 -2
  262. data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +143 -0
  263. data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +269 -0
  264. data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +446 -0
  265. data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +1 -1
  266. data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +71 -14
  267. data/platform/bb/rhodes/src/com/rho/net/bb/BBHttpConnection.java +4 -2
  268. data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +28 -12
  269. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +100 -4
  270. data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +3 -2
  271. data/platform/bb/rhodes/src/com/rho/rubyext/XMLParser.java +1 -1
  272. data/platform/bb/rhodes/src/rhomobile/NativeBar.java +32 -0
  273. data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +9 -2
  274. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +174 -41
  275. data/platform/bb/rhodes/src/rhomobile/datetime/DateTimePicker.java +52 -3
  276. data/platform/bb/rhodes/src/rhomobile/datetime/DateTimeScreen.java +33 -1
  277. data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +2 -14
  278. data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +686 -0
  279. data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +14 -0
  280. data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +13 -0
  281. data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +174 -0
  282. data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +104 -330
  283. data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +79 -0
  284. data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +35 -12
  285. data/platform/bb/rhodes/src/rhomobile/mapview/MapViewParent.java +2 -1
  286. data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +336 -44
  287. data/platform/bb/rhodes/src/rhomobile/mapview/RhoMapField.java +3 -6
  288. data/platform/iphone/Classes/AppManager/AppManager.m +19 -4
  289. data/platform/iphone/Classes/DateTime.h +4 -0
  290. data/platform/iphone/Classes/DateTime.m +1 -1
  291. data/platform/iphone/Classes/DateTimePicker.m +8 -1
  292. data/platform/iphone/Classes/DateTimePickerDelegate.m +7 -1
  293. data/platform/iphone/Classes/Event/Event.m +2 -2
  294. data/platform/iphone/Classes/MapView/MapViewController.h +4 -1
  295. data/platform/iphone/Classes/MapView/MapViewController.m +6 -46
  296. data/platform/iphone/Classes/MapView/MapViewManager.h +26 -0
  297. data/platform/iphone/Classes/MapView/MapViewManager.m +172 -0
  298. data/platform/iphone/Classes/NativeBar.h +34 -0
  299. data/platform/iphone/Classes/NativeBar.m +131 -26
  300. data/platform/iphone/Classes/NativeView/NVDelegate.h +26 -0
  301. data/platform/iphone/Classes/NativeView/NVDelegate.m +40 -0
  302. data/platform/iphone/Classes/NativeView/NVViewController.h +24 -0
  303. data/platform/iphone/Classes/NativeView/NVViewController.m +90 -0
  304. data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +449 -0
  305. data/platform/iphone/Classes/{RhoNativeViewManagerOC.h → NativeView/RhoNativeViewManagerOC.h} +15 -0
  306. data/platform/iphone/Classes/RhoAlert.m +3 -3
  307. data/platform/iphone/Classes/RhoMainView.h +3 -0
  308. data/platform/iphone/Classes/Rhodes.h +6 -2
  309. data/platform/iphone/Classes/Rhodes.m +47 -79
  310. data/platform/iphone/Classes/Signature/SignatureViewController.m +1 -0
  311. data/platform/iphone/Classes/SimpleMainView.h +18 -1
  312. data/platform/iphone/Classes/SimpleMainView.m +180 -35
  313. data/platform/iphone/Classes/SplitView/LeftViewController.h +1 -1
  314. data/platform/iphone/Classes/SplitView/LeftViewController.m +13 -7
  315. data/platform/iphone/Classes/SplitView/RightViewController.h +1 -1
  316. data/platform/iphone/Classes/SplitView/RightViewController.m +26 -11
  317. data/platform/iphone/Classes/SplitView/SplittedMainView.h +1 -6
  318. data/platform/iphone/Classes/SplitView/SplittedMainView.m +14 -52
  319. data/platform/iphone/Classes/TabbedMainView.h +25 -3
  320. data/platform/iphone/Classes/TabbedMainView.m +340 -14
  321. data/platform/iphone/ESRI/BluePushpin.png +0 -0
  322. data/platform/iphone/ESRI/BluePushpin@2x.png +0 -0
  323. data/platform/iphone/ESRI/esri.png +0 -0
  324. data/platform/iphone/ESRI/esri@2x.png +0 -0
  325. data/platform/iphone/Info.plist +1 -1
  326. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +26 -3
  327. data/platform/iphone/rbuild/iphone.rake +100 -4
  328. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
  329. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +116 -12
  330. data/platform/shared/SyncClient/SyncClient.cpp +29 -3
  331. data/platform/shared/SyncClient/SyncClient.h +2 -1
  332. data/platform/shared/common/IRhoClassFactory.h +3 -0
  333. data/platform/shared/common/IRhoCrypt.h +16 -0
  334. data/platform/shared/common/IRhoThreadImpl.h +1 -0
  335. data/platform/shared/common/RhoAppAdapter.h +2 -0
  336. data/platform/shared/common/RhoConf.cpp +97 -46
  337. data/platform/shared/common/RhoConf.h +14 -13
  338. data/platform/shared/common/RhoFile.cpp +10 -0
  339. data/platform/shared/common/RhoFile.h +1 -0
  340. data/platform/shared/common/RhoMath.cpp +43 -0
  341. data/platform/shared/common/RhoMath.h +27 -0
  342. data/platform/shared/common/RhoNativeViewManager.h +27 -1
  343. data/platform/shared/common/RhoPort.h +11 -0
  344. data/platform/shared/common/RhoStd.h +5 -0
  345. data/platform/shared/common/RhoThread.cpp +1 -1
  346. data/platform/shared/common/RhoThread.h +1 -1
  347. data/platform/shared/common/RhodesApp.cpp +381 -139
  348. data/platform/shared/common/RhodesApp.h +24 -10
  349. data/platform/shared/common/RhodesAppBase.cpp +72 -1
  350. data/platform/shared/common/RhodesAppBase.h +5 -1
  351. data/platform/shared/common/SplashScreen.h +4 -4
  352. data/platform/shared/common/ThreadQueue.cpp +44 -17
  353. data/platform/shared/common/ThreadQueue.h +4 -0
  354. data/platform/shared/common/app_build_configs.c +0 -1
  355. data/platform/shared/common/iphone/RhoClassfactory.h +6 -0
  356. data/platform/shared/common/iphone/RhoCryptImpl.h +47 -0
  357. data/platform/shared/common/iphone/RhoCryptImpl.mm +286 -0
  358. data/platform/shared/common/map/ESRIMapEngine.cpp +921 -0
  359. data/platform/shared/common/map/ESRIMapEngine.h +255 -0
  360. data/platform/shared/common/map/GoogleMapEngine.cpp +160 -0
  361. data/platform/shared/common/map/GoogleMapEngine.h +52 -0
  362. data/platform/shared/common/map/MapEngine.cpp +304 -0
  363. data/platform/shared/common/map/MapEngine.h +214 -0
  364. data/platform/shared/db/DBAdapter.cpp +147 -18
  365. data/platform/shared/db/DBAdapter.h +38 -12
  366. data/platform/shared/db/DBAttrManager.cpp +4 -3
  367. data/platform/shared/db/DBAttrManager.h +7 -7
  368. data/platform/shared/db/res/db/syncdb.triggers +0 -5
  369. data/platform/shared/db/res/db/syncdb_java.triggers +21 -0
  370. data/platform/shared/json/JSONIterator.cpp +11 -1
  371. data/platform/shared/json/JSONIterator.h +1 -0
  372. data/platform/shared/logging/RhoLogConf.cpp +29 -12
  373. data/platform/shared/net/CURLNetRequest.cpp +80 -25
  374. data/platform/shared/net/CURLNetRequest.h +6 -2
  375. data/platform/shared/net/HttpServer.cpp +12 -6
  376. data/platform/shared/net/HttpServer.h +2 -1
  377. data/platform/shared/net/INetRequest.h +1 -0
  378. data/platform/shared/ruby/ext/alert/alert.i +5 -0
  379. data/platform/shared/ruby/ext/alert/alert_wrap.c +439 -108
  380. data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +42 -0
  381. data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +521 -120
  382. data/platform/shared/ruby/ext/nativebar/nativebar.i +16 -0
  383. data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +623 -128
  384. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +18 -0
  385. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +2321 -0
  386. data/platform/shared/ruby/ext/rho/extensions.c +0 -1
  387. data/platform/shared/ruby/ext/rho/rhoruby.c +53 -0
  388. data/platform/shared/ruby/ext/rho/rhoruby.h +6 -0
  389. data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +6 -3
  390. data/platform/shared/ruby/ext/syncengine/syncengine.i +9 -1
  391. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +61 -0
  392. data/platform/shared/ruby/ext/system/system.i +4 -0
  393. data/platform/shared/ruby/ext/system/system_wrap.c +33 -5
  394. data/platform/shared/rubyext/RhoAppAdapter.cpp +11 -1
  395. data/platform/shared/rubyext/System.cpp +9 -0
  396. data/platform/shared/rubyext/WebView.h +1 -0
  397. data/platform/shared/sqlite/crypto.c +907 -0
  398. data/platform/shared/sqlite/sqlite3.c +6 -0
  399. data/platform/shared/sync/SyncEngine.cpp +49 -19
  400. data/platform/shared/sync/SyncEngine.h +0 -1
  401. data/platform/shared/sync/SyncNotify.cpp +14 -5
  402. data/platform/shared/sync/SyncNotify.h +2 -2
  403. data/platform/shared/sync/SyncSource.cpp +79 -33
  404. data/platform/shared/sync/SyncSource.h +1 -0
  405. data/platform/shared/sync/SyncThread.cpp +26 -11
  406. data/platform/shared/xruby/src/com/xruby/compiler/codedom/StringExpression.java +4 -2
  407. data/platform/wm/RhoLib/RhoLib.vcproj +108 -72
  408. data/platform/wm/build/wm.rake +6 -0
  409. data/platform/wm/rhodes/Alert.cpp +4 -3
  410. data/platform/wm/rhodes/Alert.h +1 -1
  411. data/platform/wm/rhodes/DateTimePicker.cpp +30 -3
  412. data/platform/wm/rhodes/DateTimePicker.h +9 -1
  413. data/platform/wm/rhodes/MainWindow.cpp +121 -61
  414. data/platform/wm/rhodes/MainWindow.h +29 -4
  415. data/platform/wm/rhodes/MapView/Graphics.cpp +547 -0
  416. data/platform/wm/rhodes/MapView/Graphics.h +136 -0
  417. data/platform/wm/rhodes/MapView/MapViewManager.cpp +391 -0
  418. data/platform/wm/rhodes/MapView/MapViewManager.h +158 -0
  419. data/platform/wm/rhodes/RhoCryptImpl.cpp +248 -0
  420. data/platform/wm/rhodes/RhoCryptImpl.h +51 -0
  421. data/platform/wm/rhodes/RhoNativeViewManager.cpp +208 -0
  422. data/platform/wm/rhodes/Rhodes.cpp +94 -102
  423. data/platform/wm/rhodes/Rhodes.rc +27 -0
  424. data/platform/wm/rhodes/SyncStatusDlg.cpp +1 -0
  425. data/platform/wm/rhodes/SyncStatusDlg.h +2 -1
  426. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +7 -4
  427. data/platform/wm/rhodes/camera/Camera.cpp +36 -15
  428. data/platform/wm/rhodes/camera/Camera.h +0 -4
  429. data/platform/wm/rhodes/resource.h +10 -2
  430. data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -0
  431. data/platform/wm/rhodes/rho/common/RhoClassFactory.h +1 -0
  432. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +10 -2
  433. data/platform/wm/rhodes/rho/net/NetRequestImpl.h +10 -0
  434. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +513 -0
  435. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.h +74 -0
  436. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +22 -10
  437. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +5 -0
  438. data/platform/wm/rhodes/rhodes.vcproj +38 -2
  439. data/platform/wm/rhodes/stdafx.h +2 -1
  440. data/platform/wm/rubylib/rubylib.vcproj +12 -0
  441. data/rakefile.rb +85 -80
  442. data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +14 -3
  443. data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
  444. data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +2 -0
  445. data/res/build-tools/xruby-0.3.3.jar +0 -0
  446. data/res/generators/templates/application/app/application.rb +2 -2
  447. data/res/generators/templates/application/app/helpers/application_helper.rb +1 -1
  448. data/res/generators/templates/application/public/css/android.css +1 -0
  449. data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
  450. data/res/generators/templates/application/rhoconfig.txt +66 -14
  451. data/rhodes.gemspec +3 -3
  452. data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +7 -3
  453. data/spec/framework_spec/build.yml +1 -1
  454. data/spec/phone_spec/Rakefile +1 -0
  455. data/spec/phone_spec/app/Account/account.rb +2 -0
  456. data/spec/phone_spec/app/Account_s/account_s.rb +7 -0
  457. data/spec/phone_spec/app/spec/{fixtures → array/fixtures}/classes.rb +0 -0
  458. data/spec/phone_spec/app/spec/{array_pack_spec.rb → array/pack_spec.rb} +2 -1
  459. data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
  460. data/spec/phone_spec/app/spec/contacts_spec.rb +2 -0
  461. data/spec/phone_spec/app/spec/rho_spec.rb +34 -233
  462. data/spec/phone_spec/app/spec/rhom_object_spec.rb +396 -87
  463. data/spec/phone_spec/app/spec/string/element_set_spec.rb +251 -0
  464. data/spec/phone_spec/app/spec/string/end_with_spec.rb +49 -0
  465. data/spec/phone_spec/app/spec/string/fixtures/classes.rb +27 -0
  466. data/spec/phone_spec/app/spec/{lstrip_spec.rb → string/lstrip_spec.rb} +0 -0
  467. data/spec/phone_spec/app/spec/string/replace_spec.rb +52 -0
  468. data/spec/phone_spec/app/spec/{rstrip_spec.rb → string/rstrip_spec.rb} +0 -0
  469. data/spec/phone_spec/app/spec/string/slice_spec.rb +473 -0
  470. data/spec/phone_spec/app/spec/string/split_spec.rb +302 -0
  471. data/spec/phone_spec/app/spec/string/start_with_spec.rb +48 -0
  472. data/spec/phone_spec/app/spec/{strip_spec.rb → string/strip_spec.rb} +0 -0
  473. data/spec/phone_spec/app/spec/syncengine_spec.rb +30 -1
  474. data/spec/phone_spec/app/spec_runner.rb +15 -7
  475. data/spec/phone_spec/build.yml +2 -2
  476. metadata +154 -25
  477. data/README.textile +0 -45
  478. data/platform/android/Rhodes/AndroidManifest.full.xml +0 -62
  479. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/Manifest.java +0 -14
  480. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoActivity.java +0 -20
  481. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +0 -193
  482. data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -25
  483. data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +0 -22
  484. data/platform/bb/RubyVM/src/com/rho/Capabilities.java +0 -6
  485. data/platform/bb/RubyVM/src/com/rho/Extensions.java +0 -11
  486. data/platform/iphone/Classes/RhoNativeViewManager.mm +0 -226
data/doc/ui.txt ADDED
@@ -0,0 +1,766 @@
1
+ # Rhodes Application User Interface
2
+
3
+ ## View Layouts
4
+
5
+ Rhodes supports a layout mechanism based on ERB templates. The default layout template is called "layout.erb" and is located in the application root folder. Unless overridden, this layout is rendered on all non-Ajax requests.
6
+
7
+ You may use layout.erb to load CSS and favorite [JavaScript frameworks](#javascript-frameworks) and libraries. Generated layout.erb loads rhomobile [CSS framework](#css-framework) and modified JQTouch library.
8
+
9
+ :::html
10
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
11
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
12
+ <html xmlns="http://www.w3.org/1999/xhtml">
13
+
14
+ <head>
15
+
16
+ <title>Test</title>
17
+ <meta name="viewport" content="width=device-width;
18
+ height=device-height; initial-scale=1.0;
19
+ maximum-scale=1.0; user-scalable=0;"/>
20
+
21
+ <% is_bb6 = System::get_property('platform') == 'Blackberry' &&
22
+ (System::get_property('os_version') =~ /^6\.0/) %>
23
+
24
+ <% if System::get_property('platform') == 'APPLE' ||
25
+ System::get_property('platform') == 'ANDROID' || is_bb6 %>
26
+ <script src="/public/jqtouch/jquery.1.3.2.min.js"
27
+ type="text/javascript"></script>
28
+ <script src="/public/jqtouch/jqtouch.js"
29
+ type="text/javascript"></script>
30
+ <link href="/public/jqtouch/jqtouch.css"
31
+ type="text/css" rel="stylesheet"/>
32
+ <% if System::get_property('platform') == 'APPLE' %>
33
+ <link href="/public/jqtouch/jqtouch-iphone.css"
34
+ type="text/css" rel="stylesheet"/>
35
+ <% end %>
36
+ <script>$.jQTouch();</script>
37
+ <% end %>
38
+
39
+ <% if System::get_property('platform') == 'APPLE' %>
40
+ <link href="/public/css/iphone.css"
41
+ type="text/css" rel="stylesheet"/>
42
+ <% elsif System::get_property('platform') == 'ANDROID' %>
43
+ <link href="/public/css/android.css"
44
+ type="text/css" rel="stylesheet"/>
45
+ <% elsif is_bb6 %>
46
+ <link href="/public/css/android.css"
47
+ type="text/css" rel="stylesheet"/>
48
+ <% elsif System::get_property('platform') == 'Blackberry' %>
49
+ <link href="/public/css/blackberry.css"
50
+ type="text/css" rel="stylesheet"/>
51
+ <% else %>
52
+ <link href="/public/css/windows_mobile.css"
53
+ type="text/css" rel="stylesheet"/>
54
+ <% end %>
55
+ </head>
56
+
57
+ <body>
58
+ <%= @content %>
59
+ </body>
60
+
61
+ </html>
62
+
63
+ ### Customizing Layouts
64
+
65
+ If you would like to override or customize layout behavior, you can call the render function with the following parameters:
66
+
67
+ :::ruby
68
+ render :action => 'index',
69
+ :layout => 'mycustomlayout', :use_layout_on_ajax => false
70
+
71
+ The first argument is the action you would like to render. Next is the (optional) layout name, which assumes the application root as a base directory. In the above example, Rhodes would look for a file called "mycustomlayout.erb" in the application root directory (you also may use :layout => false to disable the use of a layout template). The use_layout_on_ajax argument tells Rhodes whether or not to use the layout on Ajax calls (default is false).
72
+
73
+ You can call the layout method on the controller to overwrite the default layout name:
74
+
75
+ :::ruby
76
+ layout :mycustomlayout
77
+
78
+ This will force the render call to use mycustomlayout.erb in place of the default layout file for all actions of this controller.
79
+
80
+ ## CSS Framework
81
+ Rhodes 2.0+ includes an improved [CSS Framework](css-framework) which takes advantage of powerful Webkit features on supporting platforms, while providing a clean, intuitive codebase across all platforms.
82
+
83
+ ## JavaScript frameworks
84
+
85
+ To implement advanced UI for your Rhodes View you may consider using such JavaScript UI frameworks as [Sencha](http://www.sencha.com/), [Jquery Mobile](http://jquerymobile.com/), or [JQtouch](http://www.jqtouch.com/). Place one of these libraries in public/js folder of your application, load it in your [layout.erb](#layout), and you are ready to go.
86
+
87
+ ### jQTouch modifications
88
+
89
+ By default, Rhodes framework uses a modified version of jQTouch version 1, beta 2. The following is a list of modifications to the jQTouch library:
90
+
91
+ * $.support.WebKitAnimationEvent is set to true if the device is Android 2.x. The default implementation sets this to false.
92
+ * A default timeout has been set for Ajax requests to 30 seconds.
93
+ * The default backSelector has been changed from ".back, .cancel, .goback" to ".backButton a".
94
+ * The default slideSelector has been changed from "body > * > ul li a" to "a". This makes every link animate with a slide transition by default.
95
+ * Every "a" invokes liveTap; every "[type=submit]" invokes submitParentForm.
96
+ * On document load, the Rhodes implementation of jQTouch wraps the children of the body with a DIV.
97
+ * Fixed slide animation for Android 2.x devices. Slide transitions are handled differently than other animated transitions.
98
+ * This implementation creates a global Rho object that contains two properties:
99
+ * Rho.insertAsyncPage(screenSnippet) - a function that inserts a page to the application. Screen snippet should be a string containing a DIV representing a page that in theory contains pageTitle, toolbar and content DIVs.
100
+ * Rho.jqt - a reference to the public jQTouch methods normally returned by instantiating jQTouch. For example, to programmatically go back a screen, you can invoke Rho.jqt.goBack().
101
+ * Ajax requests set a 'Transition-Enabled: true' request header. This informs the controller that the request was made by a jQTouch enabled application.
102
+ * Conversely, Ajax requests inspect for a 'Wait-Page' response header. This informs jQTouch that the page it received was returned after an asynchronous HTTP request was spawned by the controller. Wait pages are not added to the jQtouch history. The animation is then deferred until the expected page is returned to the user interface via the Rho.insertAsyncPage() call. This method is typically invoked after an async HTTP callback function has been triggered in the controller.
103
+ * You can override the slide animated transition for forms by setting an animation class on the form like '\<form class="pop"\>...\</form\>'.
104
+
105
+ ## Loading screen
106
+
107
+ Rhodes supports the display of a custom "Loading" screen while your application is launching. This screen's source is the file loading.html, located at <application-root>/app/loading.html.
108
+
109
+ Alternatively, you can replace loading.html with an image named loading.png if you just want a simple image to be displayed.
110
+
111
+ You can control how image presented by modifying splash_screen options in [rhoconfig.txt](configuration):
112
+
113
+ * delay - how long splash screen should be displayed (in seconds)
114
+ * center,vcenter,hcenter - picture alignment
115
+ * zoom,vzoom,hzoom - scaling options
116
+
117
+ Examples:
118
+
119
+ Place splash screen in the center and show it for 5 seconds:
120
+ :::ruby
121
+ splash_screen='delay=5;center'
122
+
123
+ Center splash screen horizontally, scale it vertically to file all available space, and show it for 5 seconds:
124
+ :::ruby
125
+ splash_screen='delay=5;hcenter;vzoom'
126
+
127
+ You can customize you loading image (showed on start of application) for each platform by platform suffix:
128
+
129
+ * Android `loading.android.png`
130
+ * iPhone `loading.iPhone.png`
131
+ * WM `loading.wm.png`
132
+ * BB `loading.bb.png`
133
+
134
+ If application doesn't have platform specific `loading.png`, then Rhodes'll try to load default `loading.png`.
135
+
136
+ For iPhone you may define a set of loading images. See Apple documentation about these images, [section Application Launch Images in Build-Time Configuration Details](http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html).
137
+
138
+ If you are building for iPhone using rake commands, place `loading.png` to your applications "app" folder. If you created an app called `testapp` then the folder would be `testapp/app`. Also you can add some additional images for so loading screen look better on different devices:
139
+
140
+ * loading.png; size 320x480 - for iPhone/iPod/iPhone4/iPad and other non iOS devices
141
+ * loading@2x.png; size 640x960 - for iPhone4/iPod4; if not defined then loading.png will be used
142
+ * loading-Portrait.png; size 768x1024 - for iPad in Portrait orientation on start; if not defined then loading@2x.png will be used
143
+ * loading-PortraitUpsideDown.png; size 768x1024 - for iPad in Portrait orientation on start, if not defined then loading-Portrait.png will be used
144
+ * loading-Landscape.png; size 1024x768 - for iPad in Landscape orientation on start, if not defined then use loading@2x.png
145
+ * loading-LandscapeLeft.png; size 1024x768 - for iPad in LandscapeLeft orientation on start; if not defined then loading-Landscape.png will be used
146
+ * loading-LandscapeRight.png; size 1024x768 - for iPad in LandscapeRight orientation on start; if not defined then loading-Landscape.png will be used
147
+
148
+ If you are using xCode to build for iPhone, you should add to your project Default.png image. You can also add some additional images for better work on different devices:
149
+
150
+ * Default.png; siz 320x480 - for iPhone/iPod/iPhone4/iPad
151
+ * Default@2x.png; size 640x960 - for iPhone4/iPod4, if not defined then use Default.png
152
+ * Default-Portrait.png; size 768x1024 - for iPad in Portrait orientation on start, if not defined then Default@2x.png will be used
153
+ * Default-PortraitUpsideDown.png; size 768x1024 - for iPad in Portrait orientation on start, if not defined then Default-Portrait.png will be used
154
+ * Default-Landscape.png; size 1024x768 - for iPad in Landscape orientation on start, if not defined then Default@2x.png will be used
155
+ * Default-LandscapeLeft.png; size 1024x768 - for iPad in LandscapeLeft orientation on start, if not defined then Default-Landscape.png will be used
156
+ * Default-LandscapeRight.png; size 1024x768 - for iPad in LandscapeRight orientation on start, if not defined then Default-Landscape.png will be used
157
+
158
+ **NOTE: Use rake command once and it will update xcode project. **
159
+
160
+ You can see examples of all these images in [Rhodes-System-Api-Samples](http://github.com/rhomobile/rhodes-system-api-samples) application.
161
+
162
+ ## Advanced Usage of Render
163
+
164
+ Render does not need to be called at the end of each controller action method. If render was not called, then it will default to rendering the action of the method you are in.
165
+
166
+ Rendering of views works with no method in controller. If the method does not exist for an action, but a view exists for that action, then the view will be rendered.
167
+
168
+ Rendering of files: render :file => "Settings/wait.erb" will render that file with the current controller's instance. By default, layout is false when rendering a file.
169
+
170
+ Rendering of partials, with collections or locals. Either collections or locals must be provided:
171
+
172
+ :::ruby
173
+ render :partial => "ad", :collection => ["foo1","foo2","foo3"]
174
+
175
+ or
176
+
177
+ :::ruby
178
+ render :partial =>"ad", :locals => { :ad => "foo_ad" }
179
+
180
+ Will render the partial "_ad.erb" and the local variable "ad" will be available. With a collection, the partial will be rendered once per element.
181
+
182
+ Load from 'partials' folder:
183
+
184
+ :::ruby
185
+ render :partial =>"partials/ad", :locals => { :ad => "foo_ad" }
186
+
187
+ ## Control WebView from controller actions
188
+ It is possible to call on the WebView (browser) directly from your controllers. This API is recommended for use from callbacks, such as sync callback or camera callbacks.
189
+
190
+ Force WebView refresh current page
191
+ :::ruby
192
+ WebView.refresh
193
+
194
+ Force WebView refresh current page on tab with specified index. If no tab bar present, index ignored
195
+ :::ruby
196
+ WebView.refresh(index)
197
+
198
+ Force WebView navigate to provided location (url)
199
+ :::ruby
200
+ WebView.navigate(url)
201
+
202
+ Since 1.2.2 WebView.navigate supports an optional index parameter (defaults to 0, useful for tabbed applications)
203
+ :::ruby
204
+ WebView.navigate(url, index)
205
+
206
+ Get location (url) of the currently displayed page
207
+ :::ruby
208
+ WebView.current_location
209
+
210
+ The same as above but for specified tab (if tab bar present)
211
+ :::ruby
212
+ WebView.current_location(index)
213
+
214
+ Execute javascript string in the context of the currently displayed page. Supported on iPhone, Android, Windows Mobile and Blackberry 5.0 in full browser mode.
215
+ Suppose that current page has js method:
216
+ :::html
217
+ function test() {
218
+ alert("Test");
219
+ }
220
+ Then to call test() function from controller, do this:
221
+ :::ruby
222
+ #call method test on the current page
223
+ WebView.execute_js("test();")
224
+
225
+ The same as above but for specified tab (if tab bar present)
226
+ :::ruby
227
+ #call method test on the tab page
228
+ WebView.execute_js("test();", index)
229
+
230
+
231
+ Returns index of @tabs array for currently selected tab
232
+ :::ruby
233
+ WebView.active_tab
234
+
235
+ Switch to/from full screen mode
236
+ :::ruby
237
+ WebView.full_screen_mode(enable)
238
+
239
+ Set cookie to be used by WebView for specified url. Each time when WebView load specified url (either by selecting link or in result of calling WebView.navigate), it will add this cookie to the HTTP request. Cookie should be in format "NAME=VALUE". Multiple name/value pairs allowed. In this case they need to be split by semicolon: "NAME1=VALUE1; NAME2=VALUE2".
240
+ :::ruby
241
+ WebView.set_cookie(url, cookie)
242
+
243
+ ### Sample
244
+ See controller and view in the /app/Image folder of the [system API sample application](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/Image/controller.rb#L30) for some of the examples of how to use WebView in the callbacks.
245
+
246
+ ## Application Menu
247
+ For platforms which support menus Rhodes framework provides ability to change the native application menu items through the following simple API:
248
+
249
+ :::ruby
250
+ @default_menu = {
251
+ "Item Label 1" => "/item1path",
252
+ "Item Label 2" => "/item2path",
253
+ ...
254
+ } #=> overrides the rhodes default menu
255
+
256
+ @menu = {
257
+ "Item Label 1" => "/item1path",
258
+ "Item Label 2" => "/item2path",
259
+ ...
260
+ } #=> overrides the default menu in a specific action
261
+
262
+ ### Default Menu
263
+ To change the default menu (in application.rb):
264
+
265
+ :::ruby
266
+ class AppApplication < Rho::RhoApplication
267
+ def initialize
268
+ super
269
+ @default_menu = {
270
+ "Go Home" => :home,
271
+ "View Accounts" => "/app/Account",
272
+ "Do Refresh" => :refresh,
273
+ "Perform Sync" => :sync,
274
+ "App Options" => :options,
275
+ "View Log" => :log
276
+ }
277
+ end
278
+ end
279
+
280
+ This will create a default menu with the following items (in top-down order):
281
+
282
+ * Go Home
283
+ * View Accounts
284
+ * Do Refresh
285
+ * Perform Sync
286
+ * App Options
287
+ * View Log
288
+
289
+ All of these menu items with the exception of "View Accounts" call a reserved menu item. The "View Accounts" item will navigate to the path specified by the hash value, in this case /app/Account.
290
+
291
+ ### Controller Action Menu
292
+ To change the menu for a specific action (in controller.rb):
293
+
294
+ :::ruby
295
+ def index
296
+ @accounts = Account.find(:all)
297
+ @menu = {
298
+ "Go Home" => :home,
299
+ "Refresh" => :refresh,
300
+ "Options" => :options,
301
+ :separator => nil,
302
+ "Log" => :log,
303
+ "New Account" => "/app/Account/new"
304
+ }
305
+ render
306
+ end
307
+
308
+ **NOTE: The menu will reset to the application default menu as soon as the user navigates to a different action. **
309
+
310
+ ### Reserved Menu Items
311
+
312
+ The following is the default Rhodes menu if none is provided in application.rb:
313
+
314
+ :::ruby
315
+ @default_menu = {
316
+ "Home" => :home,
317
+ "Refresh" => :refresh,
318
+ "Sync" => :sync,
319
+ "Options" => :options,
320
+ "Log" => :log,
321
+ :separator => nil,
322
+ "Close" => :close
323
+ }
324
+
325
+ ## User defined menu/toolbar/tabbar actions
326
+
327
+ Here is list of allowed values for actions for user defined menus, toolbars and tabbars:
328
+
329
+ * :back - do back navigation using web view history or application's back url
330
+ * :forward - do forward navigation
331
+ * :home - navigate to configured start_path
332
+ * :options - navigate to configured options_path
333
+ * :refresh - refresh current page
334
+ * :sync - trigger SyncEngine.dosync
335
+ * :log - load the native logging UI
336
+ * :separator - draw a separator line (if supported)
337
+ * :close - close or put Rhodes to background (depending on platform)
338
+ * :fullscreen - go to full screen mode
339
+
340
+ Action can be also URL of user-defined controller method. URL can be prefixed with 'callback:' meaning it should be loaded by rhodes core, not WebView. This will effectively load specified url but in background, not touching UI.
341
+
342
+ Some examples:
343
+
344
+ Calling of this action will be done by UI WebView component so result of the do_that method will be rendered in UI
345
+ :::ruby
346
+ :action => url_for(:action => :do_that)
347
+
348
+ The same as above but for another controller
349
+ :::ruby
350
+ :action => '/app/AnotherController/do_that'
351
+
352
+ Here url of :callback action will be loaded in background by the rhodes core. UI will not be touched
353
+ :::ruby
354
+ :action => 'callback:' + url_for(:action => :callback)
355
+
356
+ The same as above but for another controller
357
+ :::ruby
358
+ :action => 'callback:/app/AnotherController/callback'
359
+
360
+ ## Redefine back action
361
+
362
+ Use :back parameter in render:
363
+
364
+ :::ruby
365
+ render :action => :index, :back =>
366
+ url_for( :controller => :Settings, :action => :main_page )
367
+ render :back => '/app'
368
+
369
+ Use back with callback:
370
+
371
+ :::ruby
372
+ render :action => :page_alert, :back =>
373
+ 'callback:' + url_for(:action => :callback_alert)
374
+
375
+ You can also define back action in menu
376
+
377
+ :::ruby
378
+ @menu = { "Back" => :back,
379
+ "Main Menu" => :home
380
+ }
381
+ render :action => :page_back
382
+
383
+ Redefine back with close:
384
+
385
+ :::ruby
386
+ render :action => :page_close, :back => :close
387
+
388
+ ### Sample
389
+ Please find sample code of ["Dynamic Menu"](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/DynamicMenu/) in Rhodes System Api Samples
390
+
391
+
392
+ ## Native Toolbar Control
393
+ Rhodes supports displaying a native looking 'toolbar'.
394
+
395
+ The toolbar is a small space at the bottom of the screen, where the user can add buttons with associated actions. In Rhodes, these actions should be loading URLs. There are different methods for loading these URLs - you can either specify the 'callback:' prefix at the beginning of the URL (which will perform 'background' loading of the URL by the Rhodes core), or you can use url itself, without prefix (which will use the UI WebView element to load the URL - in this case pressing the toolbar button will cause the current page to reload and redraw).
396
+
397
+ The toolbar supported on iPhone, Android and Windows Mobile.
398
+
399
+ You can customize toolbar during runtime.
400
+
401
+ To use the toolbar, all you have to do is define the toolbar items in your application.rb:
402
+
403
+ :::ruby
404
+ class AppApplication < Rho::RhoApplication
405
+ def initialize
406
+ @@toolbar = [
407
+ {:action => :back,
408
+ :icon => '/public/images/back_btn.png'},
409
+ {:action => :forward,
410
+ :icon => '/public/images/forward_btn.png'},
411
+ {:action => :separator},
412
+ {:action => :home},
413
+ {:action => :refresh},
414
+ {:action => :options}
415
+ ]
416
+ # Important to call super _after_ you define @@toolbar!
417
+ super
418
+ end
419
+ end
420
+
421
+ Refer to the [User defined menu/toolbar/tabbar actions](#user-defined-menutoolbartabbar-actions) to see how :action can be defined.
422
+
423
+ Each toolbar item can define next elements :
424
+
425
+ * :label - Visible label to display instead of icon
426
+ * :action - Path to your rhodes action (i.e. '/app/Account' would load the Account index action)
427
+ * :icon - Relative path to toolbar item icon in your rhodes app (typically located in /public/images/)
428
+ * :colored_icon => false - Optional argument which tells rhodes to use color icon in toolbar on iPhone instead of standard monochrome white icon (prepared from image alpha).
429
+
430
+ Windows Mobile:
431
+
432
+ * :width - optional, define width in pixels for separator element
433
+
434
+ Predefined actions are drawn using predefined icons, but that icons can be overridden by the user by specifying an :icon as shown in the example above. Icons that are defined must be black with a transparent background.
435
+
436
+ iPhone and Android: Icons must be no more than 30x30 pixels and must be in .png format.
437
+ Windows Mobile: Icons can be any size, but all icons should have same size. By default - 48x48
438
+
439
+ In case of a user-defined action, either :icon or :label must be specified. If both are omitted, Rhodes will not add the button to the toolbar. If both are specified, the :icon will be drawn and the :label will be discarded.
440
+
441
+ Behind the scenes, Rho::RhoApplication will detect the @@toolbar array in its initialize method and build the native toolbar through the following function:
442
+
443
+ :::ruby
444
+ require 'rho/rhotoolbar'
445
+ Rho::NativeToolbar.create(bar_item_array)
446
+
447
+ To disable the toolbar entirely:
448
+
449
+ :::ruby
450
+ class AppApplication < Rho::RhoApplication
451
+ def initialize
452
+ @@toolbar = nil
453
+ super
454
+ end
455
+ end
456
+
457
+ ### Native Toolbar runtime API
458
+
459
+ As mentioned above, with recent versions of Rhodes you can create/remove toolbars/tabbars in runtime.
460
+
461
+ Toolbar elements :
462
+
463
+ * :background_color=>system_color - define custom background color
464
+
465
+ Windows Mobile:
466
+
467
+ * :mask_color=>0xFFFFFF - image mask color(transparent color)
468
+ * :view_height - optional, toolbar height. Must be bigger than image height
469
+
470
+ Examples of creating toolbar:
471
+
472
+ :::ruby
473
+ require 'rho/rhotoolbar'
474
+ Rho::NativeToolbar.create(toolbar)
475
+
476
+ The same as above
477
+ :::ruby
478
+ Rho::NativeToolbar.create(:buttons => toolbar)
479
+
480
+ Create toolbar the same as above but with custom background color
481
+ :::ruby
482
+ Rho::NativeToolbar.create( :buttons => toolbar,
483
+ :background_color => 0x0000FF)
484
+
485
+ Examples of removing toolbar:
486
+ :::ruby
487
+ require 'rho/rhotoolbar'
488
+ Rho::NativeToolbar.remove
489
+
490
+ Windows Mobile: Create toolbar with image mask color and toolbar height
491
+ :::ruby
492
+ Rho::NativeToolbar.create( :buttons => toolbar,
493
+ :background_color => 0x0000FF, :mask_color => 0xFFFFFF, :view_height => 80)
494
+
495
+ ### Sample
496
+ Please find sample code in "NativeToolbarTest" in [Rhodes-System-Api-Samples](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/NativeToolbarTest/)
497
+
498
+ ## Native Tabbar Control
499
+
500
+ Rhodes supports displaying a native looking 'tabbar'.
501
+
502
+ The tabbar is set of different UI views associated with each tab, so that selecting any tab will display the associated view. There is no ability to define custom actions for the tabbar like you can for the toolbar. The only action when a tab is selected is to switch to another UI view.
503
+
504
+ The tabbar are supported on iPhone and Android.
505
+
506
+ You can use VerticalTabBar control on iPad (specifically control for iPad). It like Tabbar, but tabs located on left side and each item have horizontal orientation. Like Tabs items can have Icon image and text. Functionality very similar Tabbar.
507
+
508
+ You can customize toolbars/tabbars during runtime.
509
+
510
+ For the tabbar:
511
+ :::ruby
512
+ class AppApplication < Rho::RhoApplication
513
+ def initialize
514
+ # Tab items are loaded left->right, @tabs[0] is leftmost tab in the tab-bar
515
+ @tabs = [
516
+ { :label => "Dashboard", :action => '/app',
517
+ :icon => "/public/images/tabs/dashboard.png", :reload => true, :web_bkg_color => 0x7F7F7F },
518
+ { :label => "Accounts", :action => '/app/Account',
519
+ :icon => "/public/images/tabs/accounts.png" },
520
+ { :label => "Contacts", :action => '/app/Contact',
521
+ :icon => "/public/images/tabs/contacts.png" },
522
+ { :label => "Options", :action => '/app/Settings',
523
+ :icon => "/public/images/tabs/options.png" }
524
+ ]
525
+ # Important to call super _after_ you define @tabs!
526
+ super
527
+ end
528
+ end
529
+
530
+ Each tabbar item defined in the above sample defines following tab elements:
531
+
532
+ * :label - Visible label to display on the tabbar (required)
533
+ * :action - Path to your rhodes action; i.e. '/app/Account' would load the Account index action (required)
534
+ * :icon - Relative path to tabbar item icon in your rhodes app; typically located in /public/images/ (required)
535
+ * :reload => true - Optional argument which tells rhodes to reload the tab's :action, defaults to false
536
+ * :selected_color => 0xFFFF00 - Optional parameter for change selected color of this tabs (if you use it on Android - you should defined it for all tabs! and also define :background_color for TabBar!)
537
+ * :disabled => true - Optional parameter for disable this tab
538
+ * :web_bkg_color = > int hex value (like HTML color) - background color for tab (use when your app bkg is not white for remove blink during switch tabs)
539
+
540
+
541
+ Behind the scenes, Rho::RhoApplication will detect the @tabs array in its initialize method and build the native bar through the following function:
542
+
543
+ :::ruby
544
+ require 'rho/rhotabbar'
545
+ Rho::NativeTabbar.create(bar_items_array)
546
+
547
+
548
+ To disable the tabbar entirely:
549
+ :::ruby
550
+ class AppApplication < Rho::RhoApplication
551
+ def initialize
552
+ @tab = nil
553
+ super
554
+ end
555
+ end
556
+
557
+ ### Native Tabbar runtime API
558
+
559
+ Require rhotabbar in your controller to use it
560
+ :::ruby
561
+ require 'rho/rhotabbar'
562
+
563
+ Remove existing tabbar (if exists) and create new one
564
+ :::ruby
565
+ Rho::NativeTabbar.create(tabs)
566
+
567
+ Same as above
568
+ :::ruby
569
+ Rho::NativeTabbar.create( :tabs => tabs)
570
+
571
+ Means the same as above and setup background color for tabbar.
572
+ :::ruby
573
+ Rho::NativeTabbar.create( :tabs => tabs,
574
+ :background_color => 0x0000FF)
575
+
576
+ **NOTE: If you setup :background_color on Android you should also setup :selected_color for each tab **
577
+
578
+ Remove current tabbar. Does nothing if there is no active bar
579
+ :::ruby
580
+ Rho::NativeTabbar.remove
581
+
582
+ Switch active tab to second (numeration is zero based i.e. 0 means first tab, 1 - second etc)
583
+ :::ruby
584
+ Rho::NativeTabbar.switch_tab(1)
585
+
586
+ Rho::NativeTabbar.create() create native tab bar UI element and activate its first tab. If you want to see another tab, call Rho::NativeTabbar.switch_tab explicitly just after NativeBar.create:
587
+
588
+ :::ruby
589
+ require 'rho/rhotabbar'
590
+ # Create tab bar
591
+ Rho::NativeTabbar.create(tabs)
592
+ # Switch to 3-rd tab (index is zero-based!)
593
+ Rho::NativeTabbar.switch_tab(2)
594
+ # Show 'app/Settings' on the 3-rd tab
595
+ WebView.navigate('app/Settings', 3)
596
+
597
+ For VerticalTabBar on iPad (if you run this code not on iPad, then regular tabbar will be created):
598
+
599
+ :::ruby
600
+ require 'rho/rhotabbar'
601
+
602
+ Rho::NativeTabbar.create_vertical(tabs)
603
+ Rho::NativeTabbar.switch_tab(3)
604
+ WebView.navigate('app/Settings', 3)
605
+
606
+ ### Sample
607
+ Please find sample code in "NativeTabbarTest" in [Rhodes-System-Api-Samples](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/NativeTabbarTest/)
608
+
609
+ ## Navigation bar
610
+
611
+ Rhodes supports a native navigation bar for iPhone. This is a native UI element with a title, 'back' button and optional 'right' button.
612
+
613
+ :::ruby
614
+ NavBar.create :title => "Navigation bar",
615
+ :left => {
616
+ :action => :back,
617
+ :label => "Back"},
618
+ :right => {
619
+ :action => url_for(:action => :help),
620
+ :label => "Help"}
621
+
622
+ __:right__ can be omitted. __:left__ and __:right__ described in [user defined menu/toolbar/tabbar actions](#user-defined-menutoolbartabbar-actions)
623
+
624
+ ## Date/Time picker
625
+
626
+ The Date/Time picker API allows the user to choose date or time:
627
+
628
+ * DateTimePicker.choose(callback, title, initial_time, fmt)
629
+ * DateTimePicker.choose(callback, title, initial_time, fmt, opaque)
630
+ * DateTimePicker.choose_with_range(callback, title, initial_time, fmt, user_data, mindatetime, maxdatetime)
631
+
632
+ The "fmt" parameter can have the following values (any other value throws an exception):
633
+
634
+ * 0 - full date and time input field
635
+ * 1 - date only input field
636
+ * 2 - time only input field
637
+
638
+ The "user_data" parameter is an optional string. It is non-interpreted and will be returned in the callback, unmodified.
639
+
640
+ Once user chooses a date/time and presses OK or Cancel, the callback URL you specified will be called. The callback is a POST message; the body of the message contains 'status', 'result' and, 'user_data' if provided.
641
+
642
+ * 'status' can be 'ok' or 'cancel'
643
+ * 'result' is a string representation of the selected date, as the number of seconds since Epoch. Ruby time can be created from it using the Time::at method.
644
+ * There is no 'result' if status is 'cancel'
645
+ * 'user_data' - if it exists, 'user_data' will be the same string that was passed into the choose method.
646
+ * mindatetime - minimum datetime for setup range. Setup to Time.at(0) for no limit.
647
+ * maxdatetime - maximum datetime for setup range. Setup to Time.at(0) for no limit.
648
+
649
+ Data/Time Picker also can executed via AJAX call for set date/time without leaving the page.
650
+ **NOTE: Currently implemented for Android, iPhone and Blackberry **
651
+
652
+ ### Sample
653
+ See controller.rb and index.erb view in the /app/DateTime folder of the [System API Samples application](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/DateTime) for more information. This example demonstrates each of the three date/time picker types.
654
+
655
+ See controller.rb and index.erb view in the /app/DateTimeAJ folder of the [System API Samples application](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/DateTimeAJ) for more information about execute Date/Time Picker via AJAX call. This example demonstrates set date/time without leave the page.
656
+
657
+ ## Animated transitions for Webkit platforms
658
+
659
+ Animated transitions are supported on the iPhone and Android. Rhodes uses a customized version of jQTouch to deliver transitions between screens. To enable animated transitions in your application, you must include this in your layout's head element:
660
+
661
+ :::html
662
+ <% if System::get_property('platform') == 'APPLE' ||
663
+ System::get_property('platform') == 'ANDROID' %>
664
+ <script src="/public/jqtouch/jquery.1.3.2.min.js"
665
+ type="text/javascript"></script>
666
+ <script src="/public/jqtouch/jqtouch.js"
667
+ type="text/javascript"></script>
668
+ <link href="/public/jqtouch/jqtouch.css"
669
+ type="text/css" rel="stylesheet"/>
670
+ <script>$.jQTouch();</script>
671
+ <% end %>
672
+
673
+ Also make sure to add jqtouch_mode=1 to your application's [rhoconfig.txt](configuration#run-time-configuration). Setting this property enables animation for the back button in the bottom toolbar and hides the forward button.
674
+
675
+ Once these lines are included, links in the application will run animated transitions between screens. Each link must be a full path; relative paths won't work with transitions. If you use [helper functions](application#application-helpers) like __url_for__ and __link_to__, you should be safe.
676
+
677
+ ## Adding transitions to older applications
678
+
679
+ If you have an older application that you'd like to add animated transitions to, all you should have to do is follow these steps:
680
+
681
+ * Follow the instructions as described in the previous section.
682
+ * Go through each view template and change all the id attributes to classes. For example:
683
+ ** &lt;div ''id="toolbar"''> should be &lt;div ''class="toolbar"''>
684
+ ** &lt;div ''id="leftItem"'' class="regularButton"> should be &lt;div ''class="leftItem regularButton"''>
685
+ * Copy the ''public/jqtouch'' directory from Rhodes latest to your application's ''public'' directory.
686
+ * Copy the ''public/css/*.css'' files from Rhodes latest to your application's ''public/css'' directory.
687
+ ** Alternatively, you can change all the id selectors to class selectors. You may want to go down this route if you have custom changes in your CSS file. For instance, a ''#toolbar'' selector should now be ''.toolbar''.
688
+
689
+ ### Transition styles
690
+
691
+ Transitions between screens are '''slide''' by default. You can override the animation on a link by setting a specific animation class. Valid animation classes are:
692
+
693
+ * slide (default)
694
+ * fade
695
+ * dissolve
696
+ * flip
697
+ * slideup
698
+ * swap
699
+ * cube
700
+ * pop
701
+
702
+ Note that animations other than slide may not work as well on Android devices as they do on the iPhone.
703
+
704
+ :::html
705
+ <div class="toolbar">
706
+ <div class="leftItem backButton">
707
+ <a class="swap" href="...">
708
+ Left back button that animates swap transition</a>
709
+ </div>
710
+ <div class="rightItem regularButton">
711
+ <a class="flip" href="...">
712
+ Right button that animates flip transition</a>
713
+ </div>
714
+ </div>
715
+ <div class="content">
716
+ <ul>
717
+ <li>
718
+ <a class="pop" href="...">
719
+ <span class="title">
720
+ Link that animates pop transition</span>
721
+ <span class="disclosure_indicator"></span>
722
+ </a>
723
+ </li>
724
+ <li>
725
+ <a class="cube" href="...">
726
+ <span class="title">
727
+ Link that animates cube transition</span>
728
+ <span class="disclosure_indicator"></span>
729
+ </a>
730
+ </li>
731
+ </ul>
732
+ </div>
733
+
734
+ ### Back button
735
+
736
+ Links marked with a ''backButton'' class reverse the navigation of the previous animated transition. Note that the href assigned to these links are ignored.
737
+
738
+ :::html
739
+ <div class="toolbar">
740
+ <div class="leftItem backButton">
741
+ <a href="...">Cancel</a>
742
+ </div>
743
+ <div class="rightItem regularButton">
744
+ <a href="...">Edit</a>
745
+ </div>
746
+ </div>
747
+
748
+ ### Navigating to another page
749
+
750
+ Setting a target="_webapp" will disable animation and navigate to the specified href on a link. Note that any animation classes (like slide, flip, etc) are ignored.
751
+
752
+ :::html
753
+ <div class="content">
754
+ <ul>
755
+ <li>
756
+ <a target="_webapp" href="http://rhomobile.com/">
757
+ <span class="title">Rhomobile home page</span>
758
+ <span class="disclosure_indicator"></span>
759
+ </a>
760
+ </li>
761
+ </ul>
762
+ </div>
763
+
764
+ ### Sample application
765
+
766
+ Check out the [store app](http://github.com/rhomobile/store) in github for a reference sample application that uses animated transitions.