rhodes 2.0.0.beta2 → 2.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. data/LICENSE +2 -0
  2. data/Manifest.txt +27 -148
  3. data/Rakefile +49 -3
  4. data/lib/framework/builtinME.rb +6 -0
  5. data/lib/framework/rho/render.rb +13 -8
  6. data/lib/framework/rho/rho.rb +97 -43
  7. data/lib/framework/rho/rhoapplication.rb +8 -3
  8. data/lib/framework/rho/rhocontroller.rb +1 -1
  9. data/lib/framework/rhodes-framework.rb +1 -1
  10. data/lib/framework/rhodes.rb +1 -1
  11. data/lib/framework/rhoframework.rb +7 -22
  12. data/lib/framework/rhofsconnector.rb +1 -1
  13. data/lib/framework/rholang/localization_simplified.rb +2 -2
  14. data/lib/framework/rhom/rhom.rb +1 -0
  15. data/lib/framework/rhom/rhom_db_adapter.rb +2 -2
  16. data/lib/framework/rhom/rhom_model.rb +98 -0
  17. data/lib/framework/rhom/rhom_object_factory.rb +13 -12
  18. data/lib/rhodes.rb +1 -1
  19. data/platform/android/Rhodes/jni/include/{JNIRhodes.h → rhodes/JNIRhodes.h} +3 -54
  20. data/platform/android/Rhodes/jni/include/{RhoClassFactory.h → rhodes/RhoClassFactory.h} +0 -0
  21. data/platform/android/Rhodes/jni/include/{SystemInfoImpl.h → rhodes/SystemInfoImpl.h} +0 -0
  22. data/platform/android/Rhodes/jni/include/{details → rhodes/details}/rhojava.inc +1 -0
  23. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_Logger.h +0 -0
  24. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoConf.h +0 -0
  25. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoLogConf.h +0 -0
  26. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoMenu.h +0 -0
  27. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_Rhodes.h +0 -0
  28. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_SplashScreen.h +0 -0
  29. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_alert_Alert.h +0 -0
  30. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_camera_Camera.h +0 -0
  31. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_datetime_DateTimePicker.h +0 -0
  32. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_geolocation_GeoLocationImpl.h +0 -0
  33. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_socket_RhoSocketImpl.h +0 -0
  34. data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_socket_SSLImpl.h +0 -0
  35. data/platform/android/Rhodes/jni/include/{sslimpl.h → rhodes/sslimpl.h} +0 -0
  36. data/platform/android/Rhodes/jni/include/rhodes.h +59 -0
  37. data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +3 -3
  38. data/platform/android/Rhodes/jni/src/alert.cpp +2 -2
  39. data/platform/android/Rhodes/jni/src/callbacks.cpp +4 -3
  40. data/platform/android/Rhodes/jni/src/camera.cpp +2 -2
  41. data/platform/android/Rhodes/jni/src/datetimepicker.cpp +2 -2
  42. data/platform/android/Rhodes/jni/src/geolocation.cpp +2 -2
  43. data/platform/android/Rhodes/jni/src/logconf.cpp +2 -2
  44. data/platform/android/Rhodes/jni/src/logger.cpp +2 -2
  45. data/platform/android/Rhodes/jni/src/mapview.cpp +1 -1
  46. data/platform/android/Rhodes/jni/src/menu.cpp +2 -2
  47. data/platform/android/Rhodes/jni/src/nativebar.cpp +1 -1
  48. data/platform/android/Rhodes/jni/src/navbar.cpp +17 -3
  49. data/platform/android/Rhodes/jni/src/phonebook.cpp +1 -1
  50. data/platform/android/Rhodes/jni/src/rhoconf.cpp +2 -2
  51. data/platform/android/Rhodes/jni/src/rhodes.cpp +3 -3
  52. data/platform/android/Rhodes/jni/src/ringtones.cpp +1 -1
  53. data/platform/android/Rhodes/jni/src/socketimpl.cpp +2 -2
  54. data/platform/android/Rhodes/jni/src/splashscreen.cpp +2 -2
  55. data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
  56. data/platform/android/Rhodes/jni/src/syncengine.cpp +2 -2
  57. data/platform/android/Rhodes/jni/src/webview.cpp +15 -12
  58. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +11 -0
  59. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +52 -0
  60. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +8 -2
  61. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +26 -28
  62. data/platform/android/build/RhodesSRC_build.files +21 -20
  63. data/platform/android/build/android.rake +69 -24
  64. data/platform/android/build/androidcommon.rb +17 -12
  65. data/platform/bb/build/bb.rake +23 -21
  66. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +5 -2
  67. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -1
  68. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +9 -1
  69. data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +31 -2
  70. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +17 -6
  71. data/platform/bb/rhodes/src/rhomobile/Utilities.java +6 -0
  72. data/platform/iphone/Classes/AppManager/AppManager.m +16 -4
  73. data/platform/iphone/Classes/DateTime.h +5 -6
  74. data/platform/iphone/Classes/DateTimePicker.m +4 -18
  75. data/platform/iphone/Classes/DateTimePickerDelegate.h +7 -9
  76. data/platform/iphone/Classes/DateTimePickerDelegate.m +141 -152
  77. data/platform/iphone/Classes/Rhodes.h +6 -1
  78. data/platform/iphone/Classes/Rhodes.m +17 -43
  79. data/platform/iphone/Classes/SimpleMainView.h +1 -1
  80. data/platform/iphone/Classes/SimpleMainView.m +54 -4
  81. data/platform/iphone/Classes/WebView.m +17 -0
  82. data/platform/iphone/rbuild/iphone.rake +1 -0
  83. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +0 -45
  84. data/platform/shared/common/PosixThreadImpl.cpp +8 -0
  85. data/platform/shared/common/PosixThreadImpl.h +1 -0
  86. data/platform/shared/common/RhoThread.cpp +1 -0
  87. data/platform/shared/common/RhoThread.h +4 -2
  88. data/platform/shared/curl/include/curl/curl.h +4 -0
  89. data/platform/shared/db/DBAdapter.cpp +47 -60
  90. data/platform/shared/db/DBAdapter.h +6 -2
  91. data/platform/shared/net/AsyncHttp.cpp +27 -11
  92. data/platform/shared/net/AsyncHttp.h +3 -1
  93. data/platform/shared/net/CURLNetRequest.cpp +11 -10
  94. data/platform/shared/net/CURLNetRequest.h +6 -4
  95. data/platform/shared/net/HttpServer.cpp +11 -6
  96. data/platform/shared/ruby/ext/asynchttp/asynchttp.i +2 -2
  97. data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +22 -11
  98. data/platform/shared/ruby/ext/rho/rhoruby.c +2 -2
  99. data/platform/shared/ruby/ext/rho/rhosupport.c +23 -3
  100. data/platform/shared/ruby/ext/webview/webview.i +4 -0
  101. data/platform/shared/ruby/ext/webview/webview_wrap.c +39 -0
  102. data/platform/shared/ruby/re.c +8 -0
  103. data/platform/shared/ruby/string.c +1 -1
  104. data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
  105. data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +6 -1
  106. data/platform/shared/rubyJVM/src/com/rho/RhoThread.java +3 -0
  107. data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +34 -0
  108. data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +40 -53
  109. data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +32 -15
  110. data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +31 -17
  111. data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +3 -0
  112. data/platform/shared/rubyJVM/src/com/rho/sync/JSONArrayIterator.java +17 -0
  113. data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +158 -137
  114. data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +18 -17
  115. data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +10 -2
  116. data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubyFile_Methods.java +6 -0
  117. data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyFile.java +18 -3
  118. data/platform/shared/rubyJVM/src/j2me/io/File.java +37 -9
  119. data/platform/shared/sqlite/sqlite3.c +14613 -13016
  120. data/platform/shared/sqlite/sqlite3.h +1461 -1499
  121. data/platform/shared/sqlite/sqlite3ext.h +0 -2
  122. data/platform/shared/sync/ClientRegister.cpp +3 -3
  123. data/platform/shared/sync/ClientRegister.h +2 -1
  124. data/platform/shared/sync/SyncEngine.cpp +20 -8
  125. data/platform/shared/sync/SyncSource.cpp +12 -12
  126. data/platform/shared/sync/SyncSource.h +4 -4
  127. data/platform/shared/sync/SyncThread.cpp +8 -1
  128. data/platform/shared/tcmalloc/rhomem.h +3 -0
  129. data/platform/shared/tcmalloc/tcmalloc_.cpp +11 -0
  130. data/platform/wm/rhodes/Alert.cpp +148 -101
  131. data/platform/wm/rhodes/Alert.h +4 -1
  132. data/platform/wm/rhodes/AppManager.cpp +212 -72
  133. data/platform/wm/rhodes/AppManager.h +24 -3
  134. data/platform/wm/rhodes/DateTimePicker.cpp +23 -11
  135. data/platform/wm/rhodes/DateTimePicker.h +16 -5
  136. data/platform/wm/rhodes/MainWindow.cpp +22 -7
  137. data/platform/wm/rhodes/OkCancelModalDialog.h +63 -0
  138. data/platform/wm/rhodes/Rhodes.cpp +29 -17
  139. data/platform/wm/rhodes/phonebook/NativeAddressBook.cpp +128 -4
  140. data/platform/wm/rhodes/phonebook/NativeAddressBook.h +33 -3
  141. data/platform/wm/rhodes/resource.h +1 -1
  142. data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +5 -0
  143. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +136 -102
  144. data/platform/wm/rhodes/rho/net/NetRequestImpl.h +12 -5
  145. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +24 -10
  146. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +6 -0
  147. data/platform/wm/rhodes/rhodes.vcproj +4 -0
  148. data/platform/wm/tools/detool/detool.cpp +17 -4
  149. data/rakefile.rb +49 -3
  150. data/res/build-tools/db/syncdb.schema +2 -2
  151. data/res/build-tools/detool.exe +0 -0
  152. data/res/generators/rhogen.rb +10 -10
  153. data/res/generators/templates/application/app/helpers/browser_helper.rb +9 -4
  154. data/res/generators/templates/application/app/index.bb.erb +5 -5
  155. data/res/generators/templates/application/build.yml +1 -0
  156. data/res/generators/templates/application/public/css/android.css +10 -8
  157. data/res/generators/templates/application/public/css/blackberry.css +40 -31
  158. data/res/generators/templates/application/public/css/iphone.css +4 -4
  159. data/res/generators/templates/application/public/css/webkit.css +7 -0
  160. data/res/generators/templates/application/public/css/windows_mobile.css +31 -27
  161. data/res/generators/templates/application/rhoconfig.txt +2 -2
  162. data/res/generators/templates/model/edit.bb.erb +2 -2
  163. data/res/generators/templates/model/index.bb.erb +6 -4
  164. data/res/generators/templates/model/model.rb +2 -1
  165. data/res/generators/templates/model/new.bb.erb +2 -2
  166. data/res/generators/templates/model/show.bb.erb +2 -2
  167. data/rhobuild.yml +37 -0
  168. data/rhodes.gemspec +1 -1
  169. data/spec/framework_spec/app/Account/account.rb +7 -0
  170. data/spec/framework_spec/app/Case/case.rb +6 -0
  171. data/spec/framework_spec/app/Customer/customer.rb +6 -0
  172. data/spec/framework_spec/app/Product/product.rb +9 -0
  173. data/spec/framework_spec/app/spec/rhom_object_spec.rb +1 -1
  174. data/spec/framework_spec/app/spec/syncengine_spec.rb +2 -1
  175. metadata +45 -151
  176. data/lib/build/manifest/createAppManifest.rb +0 -18
  177. data/lib/build/tasks/android.rake +0 -317
  178. data/lib/build/tasks/blackberry.rake +0 -355
  179. data/lib/build/tasks/common.rake +0 -62
  180. data/lib/build/tasks/iphone.rake +0 -108
  181. data/lib/build/tasks/linux.rake +0 -81
  182. data/lib/build/tasks/rhodes-build.rb +0 -11
  183. data/lib/build/tasks/rspec.rake +0 -20
  184. data/lib/build/tasks/symbian.rake +0 -202
  185. data/lib/build/tasks/wm.rake +0 -166
  186. data/lib/framework/ServeME.rb +0 -7
  187. data/platform/bb/build/MANIFEST.MF +0 -12
  188. data/platform/iphone/Classes/DateTimePicker.h +0 -17
  189. data/res/generators/templates/application/public/icons/Read me first - license.txt +0 -14
  190. data/res/generators/templates/application/public/icons/about.png +0 -0
  191. data/res/generators/templates/application/public/icons/airplane.png +0 -0
  192. data/res/generators/templates/application/public/icons/baby.png +0 -0
  193. data/res/generators/templates/application/public/icons/badge.png +0 -0
  194. data/res/generators/templates/application/public/icons/bandaid.png +0 -0
  195. data/res/generators/templates/application/public/icons/bar-chart.png +0 -0
  196. data/res/generators/templates/application/public/icons/battery.png +0 -0
  197. data/res/generators/templates/application/public/icons/beaker.png +0 -0
  198. data/res/generators/templates/application/public/icons/beaker2.png +0 -0
  199. data/res/generators/templates/application/public/icons/beermug.png +0 -0
  200. data/res/generators/templates/application/public/icons/bird.png +0 -0
  201. data/res/generators/templates/application/public/icons/book.png +0 -0
  202. data/res/generators/templates/application/public/icons/bookmark.png +0 -0
  203. data/res/generators/templates/application/public/icons/brightness.png +0 -0
  204. data/res/generators/templates/application/public/icons/bug.png +0 -0
  205. data/res/generators/templates/application/public/icons/cabinet.png +0 -0
  206. data/res/generators/templates/application/public/icons/calendar.png +0 -0
  207. data/res/generators/templates/application/public/icons/camera.png +0 -0
  208. data/res/generators/templates/application/public/icons/changeName.rb +0 -22
  209. data/res/generators/templates/application/public/icons/chat2.png +0 -0
  210. data/res/generators/templates/application/public/icons/chicken.png +0 -0
  211. data/res/generators/templates/application/public/icons/clock.png +0 -0
  212. data/res/generators/templates/application/public/icons/cloud.png +0 -0
  213. data/res/generators/templates/application/public/icons/coffee.png +0 -0
  214. data/res/generators/templates/application/public/icons/compass.png +0 -0
  215. data/res/generators/templates/application/public/icons/contrast.png +0 -0
  216. data/res/generators/templates/application/public/icons/dashboard.png +0 -0
  217. data/res/generators/templates/application/public/icons/display.png +0 -0
  218. data/res/generators/templates/application/public/icons/dogpaw.png +0 -0
  219. data/res/generators/templates/application/public/icons/download.png +0 -0
  220. data/res/generators/templates/application/public/icons/dumbbell.png +0 -0
  221. data/res/generators/templates/application/public/icons/ekg.png +0 -0
  222. data/res/generators/templates/application/public/icons/envelope.png +0 -0
  223. data/res/generators/templates/application/public/icons/equalizer.png +0 -0
  224. data/res/generators/templates/application/public/icons/eye.png +0 -0
  225. data/res/generators/templates/application/public/icons/film-roll.png +0 -0
  226. data/res/generators/templates/application/public/icons/flag.png +0 -0
  227. data/res/generators/templates/application/public/icons/fork-and-knife.png +0 -0
  228. data/res/generators/templates/application/public/icons/fuel.png +0 -0
  229. data/res/generators/templates/application/public/icons/gameplan.png +0 -0
  230. data/res/generators/templates/application/public/icons/gear.png +0 -0
  231. data/res/generators/templates/application/public/icons/gear2.png +0 -0
  232. data/res/generators/templates/application/public/icons/gift.png +0 -0
  233. data/res/generators/templates/application/public/icons/heart.png +0 -0
  234. data/res/generators/templates/application/public/icons/house.png +0 -0
  235. data/res/generators/templates/application/public/icons/inbox.png +0 -0
  236. data/res/generators/templates/application/public/icons/index-cards.png +0 -0
  237. data/res/generators/templates/application/public/icons/iphone.png +0 -0
  238. data/res/generators/templates/application/public/icons/ipod.png +0 -0
  239. data/res/generators/templates/application/public/icons/key.png +0 -0
  240. data/res/generators/templates/application/public/icons/lifebuoy.png +0 -0
  241. data/res/generators/templates/application/public/icons/lightbulb.png +0 -0
  242. data/res/generators/templates/application/public/icons/line-chart.png +0 -0
  243. data/res/generators/templates/application/public/icons/location.png +0 -0
  244. data/res/generators/templates/application/public/icons/lock.png +0 -0
  245. data/res/generators/templates/application/public/icons/loopback.png +0 -0
  246. data/res/generators/templates/application/public/icons/magnifying-glass.png +0 -0
  247. data/res/generators/templates/application/public/icons/map-marker.png +0 -0
  248. data/res/generators/templates/application/public/icons/map.png +0 -0
  249. data/res/generators/templates/application/public/icons/medical-bag.png +0 -0
  250. data/res/generators/templates/application/public/icons/medical.png +0 -0
  251. data/res/generators/templates/application/public/icons/microphone.png +0 -0
  252. data/res/generators/templates/application/public/icons/movie1.png +0 -0
  253. data/res/generators/templates/application/public/icons/movie2.png +0 -0
  254. data/res/generators/templates/application/public/icons/network.png +0 -0
  255. data/res/generators/templates/application/public/icons/note.png +0 -0
  256. data/res/generators/templates/application/public/icons/outlet.png +0 -0
  257. data/res/generators/templates/application/public/icons/palette.png +0 -0
  258. data/res/generators/templates/application/public/icons/paperclip.png +0 -0
  259. data/res/generators/templates/application/public/icons/phone.png +0 -0
  260. data/res/generators/templates/application/public/icons/photos.png +0 -0
  261. data/res/generators/templates/application/public/icons/piano.png +0 -0
  262. data/res/generators/templates/application/public/icons/picture-frame.png +0 -0
  263. data/res/generators/templates/application/public/icons/pill.png +0 -0
  264. data/res/generators/templates/application/public/icons/pin.png +0 -0
  265. data/res/generators/templates/application/public/icons/pinetree.png +0 -0
  266. data/res/generators/templates/application/public/icons/planet.png +0 -0
  267. data/res/generators/templates/application/public/icons/puzzle.png +0 -0
  268. data/res/generators/templates/application/public/icons/radar.png +0 -0
  269. data/res/generators/templates/application/public/icons/redo.png +0 -0
  270. data/res/generators/templates/application/public/icons/refresh.png +0 -0
  271. data/res/generators/templates/application/public/icons/runner.png +0 -0
  272. data/res/generators/templates/application/public/icons/shoebox.png +0 -0
  273. data/res/generators/templates/application/public/icons/shopping-bag.png +0 -0
  274. data/res/generators/templates/application/public/icons/shopping-cart.png +0 -0
  275. data/res/generators/templates/application/public/icons/shuffle.png +0 -0
  276. data/res/generators/templates/application/public/icons/signpost.png +0 -0
  277. data/res/generators/templates/application/public/icons/skull-n-crossbones.png +0 -0
  278. data/res/generators/templates/application/public/icons/skull.png +0 -0
  279. data/res/generators/templates/application/public/icons/sliders.png +0 -0
  280. data/res/generators/templates/application/public/icons/spraycan.png +0 -0
  281. data/res/generators/templates/application/public/icons/squiggle.png +0 -0
  282. data/res/generators/templates/application/public/icons/star.png +0 -0
  283. data/res/generators/templates/application/public/icons/stopwatch.png +0 -0
  284. data/res/generators/templates/application/public/icons/suitcase.png +0 -0
  285. data/res/generators/templates/application/public/icons/tag.png +0 -0
  286. data/res/generators/templates/application/public/icons/tags.png +0 -0
  287. data/res/generators/templates/application/public/icons/target.png +0 -0
  288. data/res/generators/templates/application/public/icons/testtube.png +0 -0
  289. data/res/generators/templates/application/public/icons/thermometer.png +0 -0
  290. data/res/generators/templates/application/public/icons/toolbox.png +0 -0
  291. data/res/generators/templates/application/public/icons/trophy.png +0 -0
  292. data/res/generators/templates/application/public/icons/tshirt.png +0 -0
  293. data/res/generators/templates/application/public/icons/tv.png +0 -0
  294. data/res/generators/templates/application/public/icons/umbrella.png +0 -0
  295. data/res/generators/templates/application/public/icons/walk.png +0 -0
  296. data/res/generators/templates/application/public/icons/weather.png +0 -0
  297. data/res/generators/templates/application/public/icons/widescreen.png +0 -0
  298. data/res/generators/templates/application/public/icons/wineglass.png +0 -0
  299. data/res/generators/templates/application/public/icons/zap.png +0 -0
  300. data/res/generators/templates/application/public/js/jquery-1.2.6.min.js +0 -32
  301. data/res/generators/templates/model/config.rb +0 -3
  302. data/res/generators/templates/spec/app/spec/webview_spec.rb +0 -5
  303. data/spec/framework_spec/app/Account/config.rb +0 -59
  304. data/spec/framework_spec/app/Case/config.rb +0 -3
  305. data/spec/framework_spec/app/Customer/config.rb +0 -3
  306. data/spec/framework_spec/app/Product/config.rb +0 -17
@@ -11,188 +11,177 @@
11
11
 
12
12
  @implementation DateTimePickerDelegate
13
13
 
14
- @synthesize dateTime, pickerView, mainWindow, toolbar, barLabel, dateFormatter;
14
+ @synthesize dateTime, pickerView, parentView, toolbar, barLabel;
15
15
 
16
16
  - (void)dealloc
17
17
  {
18
- [pickerView release];
19
- [toolbar release];
20
- [barLabel release];
21
- [dateTime release];
22
- [dateFormatter release];
23
- [super dealloc];
18
+ [pickerView release];
19
+ [toolbar release];
20
+ [barLabel release];
21
+ [dateTime release];
22
+ [super dealloc];
24
23
  }
25
24
 
26
- - (void)createPickerBar:(CGRect) frame
25
+ - (void)createPickerBar:(CGRect)pickerFrame
27
26
  {
28
- self.toolbar = [UIToolbar new];
29
- self.toolbar.barStyle = UIBarStyleBlackOpaque;
30
-
31
- // size up the toolbar and set its frame
32
- [self.toolbar sizeToFit];
33
- CGFloat toolbarHeight = [self.toolbar frame].size.height;
34
-
35
- // TODO: This is an approximate y-origin, figure out why it is off by 3.7
36
- CGRect toolbarFrame = CGRectMake(frame.origin.x,
37
- frame.origin.y + frame.size.height + 3.7,
38
- frame.size.width,
39
- toolbarHeight);
40
- [self.toolbar setFrame:toolbarFrame];
41
-
27
+ self.toolbar = [UIToolbar new];
28
+ self.toolbar.barStyle = UIBarStyleBlackOpaque;
29
+
30
+ // size up the toolbar and set its frame
31
+ [self.toolbar sizeToFit];
32
+ CGFloat toolbarHeight = [self.toolbar frame].size.height;
33
+
34
+ // TODO: This is an approximate y-origin, figure out why it is off by 3.7
35
+ CGRect toolbarFrame = CGRectMake(pickerFrame.origin.x,
36
+ pickerFrame.origin.y - toolbarHeight,
37
+ pickerFrame.size.width,
38
+ toolbarHeight);
39
+ [self.toolbar setFrame:toolbarFrame];
40
+
42
41
  UIBarButtonItem *cancelItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
43
- target:self
44
- action:@selector(cancelAction:)];
45
- cancelItem.style = UIBarButtonItemStylePlain;
46
-
47
- // Setup label for toolbar
48
- self.barLabel = [[UILabel alloc] initWithFrame:toolbarFrame];
49
- barLabel.text = self.dateTime.title;
50
- barLabel.textColor = [UIColor whiteColor];
51
- barLabel.backgroundColor = [UIColor clearColor];
52
- barLabel.textAlignment = UITextAlignmentCenter;
42
+ target:self
43
+ action:@selector(cancelAction:)];
44
+ cancelItem.style = UIBarButtonItemStylePlain;
45
+
46
+ // Setup label for toolbar
47
+ self.barLabel = [[UILabel alloc] initWithFrame:toolbarFrame];
48
+ barLabel.text = self.dateTime.title;
49
+ barLabel.textColor = [UIColor whiteColor];
50
+ barLabel.backgroundColor = [UIColor clearColor];
51
+ barLabel.textAlignment = UITextAlignmentCenter;
53
52
 
54
- UIBarButtonItem *flexItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
55
- target:self action:nil];
56
-
57
- UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
58
- target:self
59
- action:@selector(dateAction:)];
60
- doneItem.style = UIBarButtonItemStylePlain;
53
+ UIBarButtonItem *flexItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
54
+ target:self action:nil];
55
+
56
+ UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
57
+ target:self
58
+ action:@selector(dateAction:)];
59
+ doneItem.style = UIBarButtonItemStylePlain;
61
60
 
62
- [self.toolbar setItems:[NSArray arrayWithObjects: cancelItem, flexItem, doneItem, nil] animated:NO];
63
- [cancelItem release];
64
- [self.barLabel release];
65
- [flexItem release];
66
- [doneItem release];
61
+ [self.toolbar setItems:[NSArray arrayWithObjects: cancelItem, flexItem, doneItem, nil] animated:NO];
62
+ [cancelItem release];
63
+ [flexItem release];
64
+ [doneItem release];
67
65
  }
68
66
 
69
- - (void)createPicker:(UIWindow*)window {
70
- // Create the picker
71
- if (self.pickerView == nil) {
72
- self.pickerView = [[UIDatePicker alloc] initWithFrame:CGRectZero];
73
- self.mainWindow = window;
74
- }
75
-
76
- self.dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
77
-
78
- if (self.pickerView.superview == nil) {
79
- self.pickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
80
-
81
- // Determine picker type
82
- int mode = self.dateTime.format;
83
- switch (mode) {
84
- case 0:
85
- self.pickerView.datePickerMode = UIDatePickerModeDateAndTime;
86
- [self.dateFormatter setDateStyle:NSDateFormatterLongStyle];
87
- [self.dateFormatter setTimeStyle:NSDateFormatterLongStyle];
88
- break;
89
- case 1:
90
- self.pickerView.datePickerMode = UIDatePickerModeDate;
91
- [self.dateFormatter setDateStyle:NSDateFormatterLongStyle];
92
- [self.dateFormatter setTimeStyle:NSDateFormatterNoStyle];
93
- break;
94
- case 2:
95
- self.pickerView.datePickerMode = UIDatePickerModeTime;
96
- [self.dateFormatter setDateStyle:NSDateFormatterNoStyle];
97
- break;
98
- default:
99
- self.pickerView.datePickerMode = UIDatePickerModeDateAndTime;
100
- [self.dateFormatter setDateStyle:NSDateFormatterLongStyle];
101
- [self.dateFormatter setTimeStyle:NSDateFormatterLongStyle];
102
- break;
103
- }
104
-
105
- if (self.dateTime.initialTime) {
106
- self.pickerView.date = [NSDate dateWithTimeIntervalSince1970:self.dateTime.initialTime];
107
- }
108
-
109
- // Add toolbar to view
110
- CGRect mainViewBounds = self.pickerView.bounds;
111
- [self createPickerBar:mainViewBounds];
112
-
113
- // Add picker to view
114
- [window addSubview:self.pickerView];
115
- CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
116
- CGSize pickerSize = [self.pickerView sizeThatFits:CGSizeZero];
117
- CGRect startRect = CGRectMake(0.0,
118
- screenRect.origin.y + screenRect.size.height,
119
- pickerSize.width, pickerSize.height);
120
- self.pickerView.frame = startRect;
121
-
122
- // compute the end frame
123
- CGRect pickerRect = CGRectMake(0.0,
124
- screenRect.origin.y + screenRect.size.height - pickerSize.height,
125
- pickerSize.width,
126
- pickerSize.height);
67
+ - (void)createPicker:(UIView*)parent
68
+ {
69
+ self.parentView = parent;
70
+ CGRect parentFrame = parent.frame;
71
+
72
+ // Create the picker
73
+ if (self.pickerView == nil) {
74
+ self.pickerView = [[UIDatePicker alloc] initWithFrame:CGRectZero];
75
+ }
76
+
77
+ if (self.pickerView.superview == nil) {
78
+ self.pickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
79
+
80
+ // Determine picker type
81
+ int mode = self.dateTime.format;
82
+ switch (mode) {
83
+ case 1:
84
+ self.pickerView.datePickerMode = UIDatePickerModeDate;
85
+ break;
86
+ case 2:
87
+ self.pickerView.datePickerMode = UIDatePickerModeTime;
88
+ break;
89
+ case 0:
90
+ default:
91
+ self.pickerView.datePickerMode = UIDatePickerModeDateAndTime;
92
+ }
93
+
94
+ if (self.dateTime.initialTime) {
95
+ self.pickerView.date = [NSDate dateWithTimeIntervalSince1970:self.dateTime.initialTime];
96
+ }
127
97
 
128
- [UIView beginAnimations:nil context:NULL];
129
- [UIView setAnimationDuration:0.3];
130
-
131
- [UIView setAnimationDelegate:self];
132
- [UIView setAnimationDidStopSelector:@selector(slideUpDidStop)];
133
-
134
- self.pickerView.frame = pickerRect;
135
-
136
- [UIView commitAnimations];
137
- }
98
+ //CGSize pickerSize = CGSizeMake(parentFrame.size.width, parentFrame.size.height/2);
99
+ CGSize pickerSize = [pickerView sizeThatFits:pickerView.frame.size];
100
+ pickerSize.width = parentFrame.size.width;
101
+ if (pickerSize.height > parentFrame.size.height)
102
+ pickerSize.height = parentFrame.size.height;
103
+ CGRect pickerFrame = CGRectMake(parentFrame.origin.x,
104
+ parentFrame.origin.y + parentFrame.size.height - pickerSize.height,
105
+ pickerSize.width,
106
+ pickerSize.height);
107
+
108
+ // Add toolbar to view
109
+ [self createPickerBar:pickerFrame];
110
+
111
+ // Add picker to view
112
+ [parentView addSubview:self.pickerView];
113
+
114
+ CGRect startFrame = pickerFrame;
115
+ startFrame.origin.y = parentFrame.origin.y + parentFrame.size.height;
116
+ self.pickerView.frame = startFrame;
117
+ [UIView beginAnimations:nil context:NULL];
118
+ [UIView setAnimationDuration:0.3];
119
+
120
+ [UIView setAnimationDelegate:self];
121
+ [UIView setAnimationDidStopSelector:@selector(slideUpDidStop)];
122
+
123
+ self.pickerView.frame = pickerFrame;
124
+
125
+ [UIView commitAnimations];
126
+ }
138
127
  }
139
128
 
140
129
  - (void)slideUpDidStop
141
130
  {
142
- // the date picker has finished sliding upwards, so add toolbar
143
- [self.mainWindow addSubview:self.toolbar];
144
- [self.mainWindow addSubview:self.barLabel];
131
+ // the date picker has finished sliding upwards, so add toolbar
132
+ [self.parentView addSubview:self.toolbar];
133
+ [self.parentView addSubview:self.barLabel];
145
134
  }
146
135
 
147
136
  - (void)slideDownDidStop
148
137
  {
149
- // the date picker has finished sliding downwards, so remove it
150
- [self.pickerView removeFromSuperview];
151
- [self.barLabel removeFromSuperview];
138
+ // the date picker has finished sliding downwards, so remove it
139
+ [self.pickerView removeFromSuperview];
140
+ [self.barLabel removeFromSuperview];
152
141
  }
153
142
 
154
143
  - (void)animateDown
155
144
  {
156
- CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
157
- CGRect endFrame = self.pickerView.frame;
158
- endFrame.origin.y = screenRect.origin.y + screenRect.size.height;
159
- // start the slide down animation
160
- [UIView beginAnimations:nil context:NULL];
161
- [UIView setAnimationDuration:0.3];
162
-
163
- // we need to perform some post operations after the animation is complete
164
- [UIView setAnimationDelegate:self];
165
- [UIView setAnimationDidStopSelector:@selector(slideDownDidStop)];
166
-
167
- // Remove toolbar immediately
168
- [self.toolbar removeFromSuperview];
169
- self.pickerView.frame = endFrame;
170
- [UIView commitAnimations];
145
+ CGRect parentFrame = parentView.frame;
146
+ CGRect endFrame = pickerView.frame;
147
+ endFrame.origin.y = parentFrame.origin.y + parentFrame.size.height;
148
+ // start the slide down animation
149
+ [UIView beginAnimations:nil context:NULL];
150
+ [UIView setAnimationDuration:0.3];
151
+
152
+ // we need to perform some post operations after the animation is complete
153
+ [UIView setAnimationDelegate:self];
154
+ [UIView setAnimationDidStopSelector:@selector(slideDownDidStop)];
155
+
156
+ // Remove toolbar immediately
157
+ [self.toolbar removeFromSuperview];
158
+ self.pickerView.frame = endFrame;
159
+ [UIView commitAnimations];
171
160
  }
172
161
 
173
162
  - (IBAction)cancelAction:(id)sender
174
- {
175
- //NSString *message = @"status=cancel";
176
- //[self doCallback:message];
177
- rho_rhodesapp_callDateTimeCallback(
178
- [postUrl cStringUsingEncoding:[NSString defaultCStringEncoding]],
179
- 0, [self.dateTime.data cStringUsingEncoding:[NSString defaultCStringEncoding]], 1 );
180
- [self animateDown];
163
+ {
164
+ //NSString *message = @"status=cancel";
165
+ //[self doCallback:message];
166
+ rho_rhodesapp_callDateTimeCallback(
167
+ [postUrl cStringUsingEncoding:[NSString defaultCStringEncoding]],
168
+ 0, [self.dateTime.data cStringUsingEncoding:[NSString defaultCStringEncoding]], 1 );
169
+ [self animateDown];
181
170
  }
182
171
 
183
172
  - (IBAction)dateAction:(id)sender
184
- {
185
- long ldate = [self.pickerView.date timeIntervalSince1970];
186
- //NSMutableString *message = [[NSMutableString alloc] initWithFormat:@"status=ok&result=%@", [NSNumber numberWithLong:ldate]];
187
- //if (self.dateTime.data) {
188
- // [message appendFormat:@"&opaque=%@", self.dateTime.data];
189
- //}
190
- //[self doCallback:message];
191
- rho_rhodesapp_callDateTimeCallback(
192
- [postUrl cStringUsingEncoding:[NSString defaultCStringEncoding]],
193
- ldate, [self.dateTime.data cStringUsingEncoding:[NSString defaultCStringEncoding]], 0 );
194
-
195
- [self animateDown];
173
+ {
174
+ long ldate = [self.pickerView.date timeIntervalSince1970];
175
+ //NSMutableString *message = [[NSMutableString alloc] initWithFormat:@"status=ok&result=%@", [NSNumber numberWithLong:ldate]];
176
+ //if (self.dateTime.data) {
177
+ // [message appendFormat:@"&opaque=%@", self.dateTime.data];
178
+ //}
179
+ //[self doCallback:message];
180
+ rho_rhodesapp_callDateTimeCallback(
181
+ [postUrl cStringUsingEncoding:[NSString defaultCStringEncoding]],
182
+ ldate, [self.dateTime.data cStringUsingEncoding:[NSString defaultCStringEncoding]], 0 );
183
+
184
+ [self animateDown];
196
185
  }
197
186
 
198
187
  @end
@@ -18,13 +18,14 @@
18
18
  #import "DateTimePickerDelegate.h"
19
19
  #import "PickImageDelegate.h"
20
20
 
21
- @interface Rhodes : NSObject <UIApplicationDelegate, UIWebViewDelegate,
21
+ @interface Rhodes : NSObject <UIApplicationDelegate,
22
22
  UITabBarControllerDelegate, AVAudioPlayerDelegate>
23
23
  {
24
24
  AppManager *appManager;
25
25
  UIApplication *application;
26
26
  UIWindow *window;
27
27
  AVAudioPlayer *player;
28
+ NSMutableDictionary *cookies;
28
29
  // Controllers
29
30
  SplashViewController *splashViewController;
30
31
  LogOptionsController* logOptionsController;
@@ -38,6 +39,7 @@
38
39
  @property (nonatomic, retain) UIWindow *window;
39
40
  @property (nonatomic, retain) AVAudioPlayer *player;
40
41
  @property (nonatomic, retain) id<RhoMainView,NSObject> mainView;
42
+ @property (nonatomic, retain) NSMutableDictionary *cookies;
41
43
 
42
44
  + (Rhodes*)sharedInstance;
43
45
 
@@ -55,4 +57,7 @@
55
57
  - (void)playStart:(NSString*)fileName mediaType:(NSString*)type;
56
58
  - (void)playStop;
57
59
 
60
+ - (void)setCookie:(NSString*)cookie forUrl:(NSString*)url;
61
+ - (NSString*)cookie:(NSString*)url;
62
+
58
63
  @end
@@ -17,7 +17,7 @@ void rho_geoimpl_init();
17
17
 
18
18
  @implementation Rhodes
19
19
 
20
- @synthesize window, player, mainView;
20
+ @synthesize window, player, mainView, cookies;
21
21
 
22
22
  static Rhodes *instance = NULL;
23
23
 
@@ -38,7 +38,11 @@ static Rhodes *instance = NULL;
38
38
  }
39
39
 
40
40
  + (void)setStatusBarHidden:(BOOL)v {
41
+ #ifdef __IPHONE_3_2
42
+ [[Rhodes application] setStatusBarHidden:v withAnimation:UIStatusBarAnimationFade];
43
+ #else
41
44
  [[Rhodes application] setStatusBarHidden:v animated:YES];
45
+ #endif
42
46
  [[[[Rhodes sharedInstance] mainView] view] setFrame:[Rhodes applicationFrame]];
43
47
  }
44
48
 
@@ -132,12 +136,21 @@ static Rhodes *instance = NULL;
132
136
  [self performSelectorOnMainThread:@selector(doShowLog) withObject:nil waitUntilDone:NO];
133
137
  }
134
138
 
139
+ - (void)setCookie:(NSString*)cookie forUrl:(NSString*)url {
140
+ [cookies setObject:cookie forKey:url];
141
+ }
142
+
143
+ - (NSString*)cookie:(NSString*)url {
144
+ NSString *c = [cookies objectForKey:url];
145
+ return c;
146
+ }
147
+
135
148
  - (void)chooseDateTime:(DateTime*)dateTime {
136
149
  dateTimePickerDelegate.dateTime = dateTime;
137
150
  [dateTimePickerDelegate setPostUrl:dateTime.url];
138
151
  //[self normalizeUrl:dateTime.url]];
139
152
  @try {
140
- [dateTimePickerDelegate createPicker:window];
153
+ [dateTimePickerDelegate createPicker:[mainView view]];
141
154
  } @catch (NSException* theException) {
142
155
  RAWLOG_ERROR2("startDateTimePickerFromViewController failed(%s): %s", [[theException name] UTF8String], [[theException reason] UTF8String] );
143
156
  }
@@ -262,6 +275,8 @@ static Rhodes *instance = NULL;
262
275
  self.mainView = [[SimpleMainView alloc] initWithParentView:window frame:[Rhodes applicationFrame]];
263
276
  [self showLoadingPage];
264
277
 
278
+ cookies = [[NSMutableDictionary alloc] initWithCapacity:0];
279
+
265
280
  // Init controllers
266
281
  logOptionsController = [[LogOptionsController alloc] init];
267
282
  logViewController = [[LogViewController alloc] init];
@@ -463,47 +478,6 @@ static Rhodes *instance = NULL;
463
478
  rho_rhodesapp_destroy();
464
479
  }
465
480
 
466
- // UIWebViewDelegate imlementation
467
-
468
- - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
469
- navigationType:(UIWebViewNavigationType)navigationType {
470
- return YES;
471
- }
472
-
473
- - (void)webViewDidStartLoad:(UIWebView *)webview {
474
- // TODO
475
- //[self active];
476
- }
477
-
478
- - (void)webViewDidFinishLoad:(UIWebView *)webview {
479
- [webview stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout = \"none\";"];
480
- // TODO
481
- /*
482
- [self inactive];
483
-
484
- if ([webView canGoBack]) {
485
- backBtn.enabled = YES;
486
- } else {
487
- backBtn.enabled = NO;
488
- }
489
- if ([webView canGoForward]) {
490
- forwardBtn.enabled = YES;
491
- } else {
492
- forwardBtn.enabled = NO;
493
- }
494
-
495
- //NSString* location = [webview stringByEvaluatingJavaScriptFromString:@"location.href"];
496
- //rho_rhodesapp_keeplastvisitedurl( [location cStringUsingEncoding:[NSString defaultCStringEncoding]] );
497
-
498
- if ([actionTarget respondsToSelector:@selector(hideSplash)])
499
- [actionTarget performSelectorOnMainThread:@selector(hideSplash) withObject:nil waitUntilDone:NO];
500
- */
501
- }
502
-
503
- - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
504
- // TODO
505
- }
506
-
507
481
  // UITabBarControllerDelegate implementation
508
482
 
509
483
  - (void)tabBarController:(UITabBarController *)tabBarController
@@ -9,7 +9,7 @@
9
9
  #import <UIKit/UIKit.h>
10
10
  #import "RhoMainView.h"
11
11
 
12
- @interface SimpleMainView : UIViewController <RhoMainView> {
12
+ @interface SimpleMainView : UIViewController <RhoMainView, UIWebViewDelegate> {
13
13
  UIView *parent;
14
14
  UIView *root;
15
15
  UIWebView *webView;
@@ -203,7 +203,7 @@
203
203
  webView.multipleTouchEnabled = YES;
204
204
  webView.autoresizesSubviews = YES;
205
205
  webView.clipsToBounds = NO;
206
- webView.delegate = [Rhodes sharedInstance];
206
+ webView.delegate = self;
207
207
 
208
208
  [root addSubview:webView];
209
209
 
@@ -291,7 +291,7 @@
291
291
 
292
292
  - (void)navigate:(NSString *)url tab:(int)index {
293
293
  NSString *escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
294
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:escapedUrl]];
294
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:escapedUrl]];
295
295
  [webView loadRequest:request];
296
296
  }
297
297
 
@@ -327,8 +327,7 @@
327
327
  }
328
328
 
329
329
  - (void)setNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
330
- [navbar removeFromSuperview];
331
- self.navbar = nil;
330
+ [self removeNavBar];
332
331
 
333
332
  UINavigationBar *nb = [[UINavigationBar alloc] initWithFrame:CGRectZero];
334
333
  [nb sizeToFit];
@@ -338,6 +337,8 @@
338
337
  NSArray *btns[] = {left, right};
339
338
  for (int i = 0, lim = sizeof(btns)/sizeof(btns[0]); i < lim; ++i) {
340
339
  NSArray *btn = btns[i];
340
+ if ([btn count] < 3)
341
+ continue;
341
342
  NSString *action = [btn objectAtIndex:0];
342
343
  NSString *label = [btn objectAtIndex:1];
343
344
  NSString *icon = [btn objectAtIndex:2];
@@ -376,4 +377,53 @@
376
377
  self.navbar = nil;
377
378
  }
378
379
 
380
+ // UIWebViewDelegate imlementation
381
+
382
+ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
383
+ navigationType:(UIWebViewNavigationType)navigationType {
384
+ NSString *url = [[request URL] absoluteString];
385
+ if (url) {
386
+ NSString *c = [[Rhodes sharedInstance] cookie:url];
387
+ if (c) {
388
+ NSMutableURLRequest *r = (NSMutableURLRequest*)request;
389
+ [r addValue:c forHTTPHeaderField:@"Cookie"];
390
+ }
391
+ }
392
+ return YES;
393
+ }
394
+
395
+ - (void)webViewDidStartLoad:(UIWebView *)webview {
396
+ // TODO
397
+ //[self active];
398
+ }
399
+
400
+ - (void)webViewDidFinishLoad:(UIWebView *)webview {
401
+ [webview stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout = \"none\";"];
402
+ // TODO
403
+ /*
404
+ [self inactive];
405
+
406
+ if ([webView canGoBack]) {
407
+ backBtn.enabled = YES;
408
+ } else {
409
+ backBtn.enabled = NO;
410
+ }
411
+ if ([webView canGoForward]) {
412
+ forwardBtn.enabled = YES;
413
+ } else {
414
+ forwardBtn.enabled = NO;
415
+ }
416
+
417
+ //NSString* location = [webview stringByEvaluatingJavaScriptFromString:@"location.href"];
418
+ //rho_rhodesapp_keeplastvisitedurl( [location cStringUsingEncoding:[NSString defaultCStringEncoding]] );
419
+
420
+ if ([actionTarget respondsToSelector:@selector(hideSplash)])
421
+ [actionTarget performSelectorOnMainThread:@selector(hideSplash) withObject:nil waitUntilDone:NO];
422
+ */
423
+ }
424
+
425
+ - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
426
+ // TODO
427
+ }
428
+
379
429
  @end
@@ -72,6 +72,16 @@
72
72
  }
73
73
  @end
74
74
 
75
+ @interface RhoWebViewSetCookieTask : NSObject {}
76
+ + (void)run:(NSString*)url :(NSString*)cookie;
77
+ @end
78
+
79
+ @implementation RhoWebViewSetCookieTask
80
+ + (void)run:(NSString *)url :(NSString *)cookie {
81
+ [[Rhodes sharedInstance] setCookie:cookie forUrl:url];
82
+ }
83
+ @end
84
+
75
85
 
76
86
  void rho_webview_navigate(const char* url, int index) {
77
87
  id runnable = [RhoWebViewNavigateTask class];
@@ -121,3 +131,10 @@ void rho_webview_full_screen_mode(int enable)
121
131
  [Rhodes setStatusBarHidden:enable];
122
132
  }
123
133
 
134
+ void rho_webview_set_cookie(const char *u, const char *c)
135
+ {
136
+ id runnable = [RhoWebViewSetCookieTask class];
137
+ NSString *url = [NSString stringWithUTF8String:u];
138
+ NSString *cookie = [NSString stringWithUTF8String:c];
139
+ [Rhodes performOnUiThread:runnable arg:url arg:cookie wait:NO];
140
+ }
@@ -132,6 +132,7 @@ namespace "build" do
132
132
  ENV["TEMP_FILES_DIR"] ||= ENV["TARGET_TEMP_DIR"]
133
133
 
134
134
  ENV["ARCHS"] ||= simulator ? "i386" : "armv6"
135
+ ENV["RHO_ROOT"] = $startdir
135
136
 
136
137
  puts "extpaths: #{$app_config["extpaths"].inspect.to_s}"
137
138
  $stdout.flush