Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add android push, salesforce code

  • Loading branch information...
commit c3be17e1fe4e419717c3bb07f5e98c91d4bd37d8 1 parent 4519866
Brian Moore authored
Showing with 181,226 additions and 0 deletions.
  1. +28 −0 SalesForce-rhodes/Rakefile
  2. +34 −0 SalesForce-rhodes/app/Saccount/edit.bb.erb
  3. +37 −0 SalesForce-rhodes/app/Saccount/edit.erb
  4. +21 −0 SalesForce-rhodes/app/Saccount/index.bb.erb
  5. +26 −0 SalesForce-rhodes/app/Saccount/index.erb
  6. +34 −0 SalesForce-rhodes/app/Saccount/new.bb.erb
  7. +37 −0 SalesForce-rhodes/app/Saccount/new.erb
  8. +10 −0 SalesForce-rhodes/app/Saccount/saccount.rb
  9. +58 −0 SalesForce-rhodes/app/Saccount/saccount_controller.rb
  10. +31 −0 SalesForce-rhodes/app/Saccount/show.bb.erb
  11. +39 −0 SalesForce-rhodes/app/Saccount/show.erb
  12. +39 −0 SalesForce-rhodes/app/Scontact/edit.bb.erb
  13. +42 −0 SalesForce-rhodes/app/Scontact/edit.erb
  14. +21 −0 SalesForce-rhodes/app/Scontact/index.bb.erb
  15. +26 −0 SalesForce-rhodes/app/Scontact/index.erb
  16. +39 −0 SalesForce-rhodes/app/Scontact/new.bb.erb
  17. +43 −0 SalesForce-rhodes/app/Scontact/new.erb
  18. +10 −0 SalesForce-rhodes/app/Scontact/scontact.rb
  19. +63 −0 SalesForce-rhodes/app/Scontact/scontact_controller.rb
  20. +36 −0 SalesForce-rhodes/app/Scontact/show.bb.erb
  21. +42 −0 SalesForce-rhodes/app/Scontact/show.erb
  22. +75 −0 SalesForce-rhodes/app/Settings/controller.rb
  23. +17 −0 SalesForce-rhodes/app/Settings/home.bb.erb
  24. +20 −0 SalesForce-rhodes/app/Settings/home.erb
  25. +32 −0 SalesForce-rhodes/app/Settings/index.bb.erb
  26. +30 −0 SalesForce-rhodes/app/Settings/index.erb
  27. +35 −0 SalesForce-rhodes/app/Settings/login.bb.erb
  28. +27 −0 SalesForce-rhodes/app/Settings/login.erb
  29. +15 −0 SalesForce-rhodes/app/Settings/reset.bb.erb
  30. +17 −0 SalesForce-rhodes/app/Settings/reset.erb
  31. +3 −0  SalesForce-rhodes/app/Settings/wait.bb.erb
  32. +5 −0 SalesForce-rhodes/app/Settings/wait.erb
  33. +16 −0 SalesForce-rhodes/app/application.rb
  34. +126 −0 SalesForce-rhodes/app/helpers/application_helper.rb
  35. +18 −0 SalesForce-rhodes/app/helpers/browser_helper.rb
  36. +26 −0 SalesForce-rhodes/app/index.bb.erb
  37. +29 −0 SalesForce-rhodes/app/index.erb
  38. +45 −0 SalesForce-rhodes/app/layout.erb
  39. +11 −0 SalesForce-rhodes/app/loading.html
  40. +7 −0 SalesForce-rhodes/app/test/saccount_spec.rb
  41. +7 −0 SalesForce-rhodes/app/test/scontact_spec.rb
  42. +19 −0 SalesForce-rhodes/build.yml
  43. BIN  SalesForce-rhodes/icon/icon.ico
  44. BIN  SalesForce-rhodes/icon/icon.png
  45. +330 −0 SalesForce-rhodes/public/css/android.css
  46. +115 −0 SalesForce-rhodes/public/css/blackberry.css
  47. +410 −0 SalesForce-rhodes/public/css/iphone.css
  48. +222 −0 SalesForce-rhodes/public/css/windows_mobile.css
  49. +21 −0 SalesForce-rhodes/public/images/IUI_LICENSE.txt
  50. BIN  SalesForce-rhodes/public/images/android/btn_check_off.png
  51. BIN  SalesForce-rhodes/public/images/android/btn_check_on.png
  52. BIN  SalesForce-rhodes/public/images/android/btn_radio_off.png
  53. BIN  SalesForce-rhodes/public/images/android/btn_radio_on.png
  54. BIN  SalesForce-rhodes/public/images/android/disclosure.png
  55. BIN  SalesForce-rhodes/public/images/android/ic_menu_more.png
  56. BIN  SalesForce-rhodes/public/images/backButton.png
  57. BIN  SalesForce-rhodes/public/images/blueButton.png
  58. BIN  SalesForce-rhodes/public/images/cancel.png
  59. BIN  SalesForce-rhodes/public/images/grayButton.png
  60. BIN  SalesForce-rhodes/public/images/iphone/disclosure.png
  61. BIN  SalesForce-rhodes/public/images/iphone/disclosure_detail.png
  62. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/backButton.png
  63. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/blueButton.png
  64. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/cancel.png
  65. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/chevron.png
  66. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/grayButton.png
  67. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/listArrowSel.png
  68. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/listGroup.png
  69. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/loading.gif
  70. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/on_off.png
  71. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/pinstripes.png
  72. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/selection.png
  73. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/thumb.png
  74. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/toggle.png
  75. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/toggleOn.png
  76. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/toolButton.png
  77. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/toolbar.png
  78. BIN  SalesForce-rhodes/public/images/iphone/jqtouch/whiteButton.png
  79. BIN  SalesForce-rhodes/public/images/iphone/radiobutton.png
  80. BIN  SalesForce-rhodes/public/images/iphone/select.png
  81. BIN  SalesForce-rhodes/public/images/iphone/switch.png
  82. BIN  SalesForce-rhodes/public/images/iui-logo-touch-icon.png
  83. BIN  SalesForce-rhodes/public/images/listArrow.png
  84. BIN  SalesForce-rhodes/public/images/listArrowDown.png
  85. BIN  SalesForce-rhodes/public/images/listArrowSel.png
  86. BIN  SalesForce-rhodes/public/images/listGroup.png
  87. BIN  SalesForce-rhodes/public/images/loading.gif
  88. BIN  SalesForce-rhodes/public/images/pinstripes.png
  89. BIN  SalesForce-rhodes/public/images/right_button.png
  90. BIN  SalesForce-rhodes/public/images/selection.png
  91. BIN  SalesForce-rhodes/public/images/thumb.png
  92. BIN  SalesForce-rhodes/public/images/toggle.png
  93. BIN  SalesForce-rhodes/public/images/toggleOn.png
  94. BIN  SalesForce-rhodes/public/images/toolButton.png
  95. BIN  SalesForce-rhodes/public/images/toolButton_new.png
  96. BIN  SalesForce-rhodes/public/images/toolbar.png
  97. BIN  SalesForce-rhodes/public/images/whiteButton.png
  98. +9 −0 SalesForce-rhodes/public/jqtouch/jqtouch-iphone.css
  99. +374 −0 SalesForce-rhodes/public/jqtouch/jqtouch.css
  100. +742 −0 SalesForce-rhodes/public/jqtouch/jqtouch.js
  101. +60 −0 SalesForce-rhodes/public/jqtouch/jqtouch.transitions.js
  102. +19 −0 SalesForce-rhodes/public/jqtouch/jquery.1.3.2.min.js
  103. +1 −0  SalesForce-rhodes/public/js/application.js
  104. +4 −0 SalesForce-rhodes/public/js/rho.js
  105. +59 −0 SalesForce-rhodes/public/js/rhogeolocation-wm.js
  106. +11 −0 SalesForce-rhodes/public/js/rhogeolocation.js
  107. +33 −0 SalesForce-rhodes/rhoconfig.txt
  108. +1 −0  SalesForce-rhosync/.gems
  109. +19 −0 SalesForce-rhosync/Rakefile
  110. +50 −0 SalesForce-rhosync/application.rb
  111. +33 −0 SalesForce-rhosync/config.ru
  112. +363 −0 SalesForce-rhosync/coverage/application_rb.html
  113. +186 −0 SalesForce-rhosync/coverage/index.html
  114. +19 −0 SalesForce-rhosync/coverage/jquery-1.3.2.min.js
  115. +15 −0 SalesForce-rhosync/coverage/jquery.tablesorter.min.js
  116. +12 −0 SalesForce-rhosync/coverage/print.css
  117. +42 −0 SalesForce-rhosync/coverage/rcov.js
  118. +270 −0 SalesForce-rhosync/coverage/screen.css
  119. +1,833 −0 SalesForce-rhosync/coverage/sources-defaultDriver_rb.html
  120. +64,815 −0 SalesForce-rhosync/coverage/sources-defaultMappingRegistry_rb.html
  121. +74,649 −0 SalesForce-rhosync/coverage/sources-default_rb.html
  122. +459 −0 SalesForce-rhosync/coverage/sources-saccount_rb.html
  123. +417 −0 SalesForce-rhosync/coverage/sources-scontact_rb.html
  124. +1 −0  SalesForce-rhosync/settings/license.key
  125. +19 −0 SalesForce-rhosync/settings/settings.yml
  126. +12,431 −0 SalesForce-rhosync/sources/default.rb
  127. +295 −0 SalesForce-rhosync/sources/defaultDriver.rb
  128. +10,792 −0 SalesForce-rhosync/sources/defaultMappingRegistry.rb
  129. +66 −0 SalesForce-rhosync/sources/saccount.rb
  130. +7,004 −0 SalesForce-rhosync/sources/salesforce.wsdl
  131. +59 −0 SalesForce-rhosync/sources/scontact.rb
  132. +29 −0 SalesForce-rhosync/spec/sources/saccount_spec.rb
  133. +28 −0 SalesForce-rhosync/spec/sources/scontact_spec.rb
  134. +27 −0 SalesForce-rhosync/spec/spec_helper.rb
  135. +28 −0 androidpush-rhodes/Rakefile
  136. +44 −0 androidpush-rhodes/app/Product/edit.bb.erb
  137. +47 −0 androidpush-rhodes/app/Product/edit.erb
  138. +21 −0 androidpush-rhodes/app/Product/index.bb.erb
  139. +26 −0 androidpush-rhodes/app/Product/index.erb
  140. +44 −0 androidpush-rhodes/app/Product/new.bb.erb
  141. +49 −0 androidpush-rhodes/app/Product/new.erb
  142. +10 −0 androidpush-rhodes/app/Product/product.rb
  143. +58 −0 androidpush-rhodes/app/Product/product_controller.rb
  144. +41 −0 androidpush-rhodes/app/Product/show.bb.erb
  145. +43 −0 androidpush-rhodes/app/Product/show.erb
  146. +75 −0 androidpush-rhodes/app/Settings/controller.rb
  147. +17 −0 androidpush-rhodes/app/Settings/home.bb.erb
  148. +20 −0 androidpush-rhodes/app/Settings/home.erb
  149. +32 −0 androidpush-rhodes/app/Settings/index.bb.erb
  150. +30 −0 androidpush-rhodes/app/Settings/index.erb
  151. +35 −0 androidpush-rhodes/app/Settings/login.bb.erb
  152. +27 −0 androidpush-rhodes/app/Settings/login.erb
  153. +15 −0 androidpush-rhodes/app/Settings/reset.bb.erb
  154. +17 −0 androidpush-rhodes/app/Settings/reset.erb
  155. +3 −0  androidpush-rhodes/app/Settings/wait.bb.erb
  156. +5 −0 androidpush-rhodes/app/Settings/wait.erb
  157. +16 −0 androidpush-rhodes/app/application.rb
  158. +126 −0 androidpush-rhodes/app/helpers/application_helper.rb
  159. +18 −0 androidpush-rhodes/app/helpers/browser_helper.rb
  160. +26 −0 androidpush-rhodes/app/index.bb.erb
  161. +26 −0 androidpush-rhodes/app/index.erb
  162. +45 −0 androidpush-rhodes/app/layout.erb
  163. +11 −0 androidpush-rhodes/app/loading.html
  164. +7 −0 androidpush-rhodes/app/test/product_spec.rb
  165. +25 −0 androidpush-rhodes/build.yml
  166. BIN  androidpush-rhodes/icon/icon.ico
  167. BIN  androidpush-rhodes/icon/icon.png
  168. +330 −0 androidpush-rhodes/public/css/android.css
  169. +115 −0 androidpush-rhodes/public/css/blackberry.css
  170. +410 −0 androidpush-rhodes/public/css/iphone.css
  171. +222 −0 androidpush-rhodes/public/css/windows_mobile.css
  172. +21 −0 androidpush-rhodes/public/images/IUI_LICENSE.txt
  173. BIN  androidpush-rhodes/public/images/android/btn_check_off.png
  174. BIN  androidpush-rhodes/public/images/android/btn_check_on.png
  175. BIN  androidpush-rhodes/public/images/android/btn_radio_off.png
  176. BIN  androidpush-rhodes/public/images/android/btn_radio_on.png
  177. BIN  androidpush-rhodes/public/images/android/disclosure.png
  178. BIN  androidpush-rhodes/public/images/android/ic_menu_more.png
  179. BIN  androidpush-rhodes/public/images/backButton.png
  180. BIN  androidpush-rhodes/public/images/blueButton.png
  181. BIN  androidpush-rhodes/public/images/cancel.png
  182. BIN  androidpush-rhodes/public/images/grayButton.png
  183. BIN  androidpush-rhodes/public/images/iphone/disclosure.png
  184. BIN  androidpush-rhodes/public/images/iphone/disclosure_detail.png
  185. BIN  androidpush-rhodes/public/images/iphone/jqtouch/backButton.png
  186. BIN  androidpush-rhodes/public/images/iphone/jqtouch/blueButton.png
  187. BIN  androidpush-rhodes/public/images/iphone/jqtouch/cancel.png
  188. BIN  androidpush-rhodes/public/images/iphone/jqtouch/chevron.png
  189. BIN  androidpush-rhodes/public/images/iphone/jqtouch/grayButton.png
  190. BIN  androidpush-rhodes/public/images/iphone/jqtouch/listArrowSel.png
  191. BIN  androidpush-rhodes/public/images/iphone/jqtouch/listGroup.png
  192. BIN  androidpush-rhodes/public/images/iphone/jqtouch/loading.gif
  193. BIN  androidpush-rhodes/public/images/iphone/jqtouch/on_off.png
  194. BIN  androidpush-rhodes/public/images/iphone/jqtouch/pinstripes.png
  195. BIN  androidpush-rhodes/public/images/iphone/jqtouch/selection.png
  196. BIN  androidpush-rhodes/public/images/iphone/jqtouch/thumb.png
  197. BIN  androidpush-rhodes/public/images/iphone/jqtouch/toggle.png
  198. BIN  androidpush-rhodes/public/images/iphone/jqtouch/toggleOn.png
  199. BIN  androidpush-rhodes/public/images/iphone/jqtouch/toolButton.png
  200. BIN  androidpush-rhodes/public/images/iphone/jqtouch/toolbar.png
  201. BIN  androidpush-rhodes/public/images/iphone/jqtouch/whiteButton.png
  202. BIN  androidpush-rhodes/public/images/iphone/radiobutton.png
  203. BIN  androidpush-rhodes/public/images/iphone/select.png
  204. BIN  androidpush-rhodes/public/images/iphone/switch.png
  205. BIN  androidpush-rhodes/public/images/iui-logo-touch-icon.png
  206. BIN  androidpush-rhodes/public/images/listArrow.png
  207. BIN  androidpush-rhodes/public/images/listArrowDown.png
  208. BIN  androidpush-rhodes/public/images/listArrowSel.png
  209. BIN  androidpush-rhodes/public/images/listGroup.png
  210. BIN  androidpush-rhodes/public/images/loading.gif
  211. BIN  androidpush-rhodes/public/images/pinstripes.png
  212. BIN  androidpush-rhodes/public/images/right_button.png
  213. BIN  androidpush-rhodes/public/images/selection.png
  214. BIN  androidpush-rhodes/public/images/thumb.png
  215. BIN  androidpush-rhodes/public/images/toggle.png
  216. BIN  androidpush-rhodes/public/images/toggleOn.png
  217. BIN  androidpush-rhodes/public/images/toolButton.png
  218. BIN  androidpush-rhodes/public/images/toolButton_new.png
  219. BIN  androidpush-rhodes/public/images/toolbar.png
  220. BIN  androidpush-rhodes/public/images/whiteButton.png
  221. +9 −0 androidpush-rhodes/public/jqtouch/jqtouch-iphone.css
  222. +374 −0 androidpush-rhodes/public/jqtouch/jqtouch.css
  223. +742 −0 androidpush-rhodes/public/jqtouch/jqtouch.js
  224. +60 −0 androidpush-rhodes/public/jqtouch/jqtouch.transitions.js
  225. +19 −0 androidpush-rhodes/public/jqtouch/jquery.1.3.2.min.js
  226. +1 −0  androidpush-rhodes/public/js/application.js
  227. +4 −0 androidpush-rhodes/public/js/rho.js
  228. +59 −0 androidpush-rhodes/public/js/rhogeolocation-wm.js
  229. +11 −0 androidpush-rhodes/public/js/rhogeolocation.js
  230. +33 −0 androidpush-rhodes/rhoconfig.txt
  231. +1 −0  androidpush-rhosync/.gems
  232. +19 −0 androidpush-rhosync/Rakefile
  233. +27 −0 androidpush-rhosync/application.rb
  234. +33 −0 androidpush-rhosync/config.ru
  235. +1 −0  androidpush-rhosync/settings/license.key
  236. +18 −0 androidpush-rhosync/settings/settings.yml
  237. +38 −0 androidpush-rhosync/sources/product.rb
  238. +25 −0 androidpush-rhosync/spec/sources/product_spec.rb
  239. +27 −0 androidpush-rhosync/spec/spec_helper.rb
View
28 SalesForce-rhodes/Rakefile
@@ -0,0 +1,28 @@
+require 'yaml'
+
+unless File.exists? "build.yml"
+ puts "Cannot find build.yml"
+ exit 1
+end
+
+
+$app_config = YAML::load_file("build.yml")
+$app_path = File.expand_path(File.dirname(__FILE__))
+
+if ENV["RHO_HOME"].nil?
+ rakefilepath = "#{$app_config["sdk"]}/Rakefile"
+else
+ rakefilepath = "#{ENV["RHO_HOME"]}/Rakefile"
+end
+
+unless File.exists? rakefilepath
+ puts "\nCannot find your Rhodes gem or source path: #{rakefilepath}"
+ puts "\nIf you have the sdk on your path or have installed the gem this"
+ puts "can be resolved by running 'set-rhodes-sdk'"
+ puts "\nYou can also set this manually by modifying your build.yml or"
+ puts "setting the environment variable RHO_HOME"
+ exit 1
+end
+
+load rakefilepath
+
View
34 SalesForce-rhodes/app/Saccount/edit.bb.erb
@@ -0,0 +1,34 @@
+<div id="pageTitle">
+ <h1>Edit <%= @saccount.name%></h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Back", :action => :show, :id => @saccount.object %>
+ <%= link_to "Delete", :action => :delete, :id => @saccount.object %>
+</div>
+
+
+<div id="content">
+ <form method="POST" action="<%= url_for :action => :update %>">
+ <input type="hidden" name="id" value="<%= @saccount.object %>"/>
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name: </td>
+ <td class="itemValue"><input type="text" name="saccount[name]" value="<%= @saccount.name %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Phone: </td>
+ <td class="itemValue"><input type="text" name="saccount[phone]" value="<%= @saccount.phone %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Website: </td>
+ <td class="itemValue"><input type="text" name="saccount[website]" value="<%= @saccount.website %>"/></td>
+ </tr>
+
+ </table>
+ <input type="submit" class="standardButton" value="Update" />
+ </form>
+</div>
View
37 SalesForce-rhodes/app/Saccount/edit.erb
@@ -0,0 +1,37 @@
+<div class="pageTitle">
+ <h1>Edit <%= @saccount.name %></h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem backButton">
+ <a href="<%= url_for :action => :show, :id => @saccount.object %>">Cancel</a>
+ </div>
+ <div class="rightItem regularButton">
+ <a class="button" href="<%= url_for :action => :delete, :id => @saccount.object %>">Delete</a>
+ </div>
+</div>
+
+<div class="content">
+ <form method="POST" action="<%= url_for :action => :update %>">
+ <input type="hidden" name="id" value="<%= @saccount.object %>"/>
+ <ul>
+
+ <li>
+ <label for="saccount[name]" class="fieldLabel">Name</label>
+ <input type="text" name="saccount[name]" value="<%= @saccount.name %>" <%= placeholder( "Name" ) %> />
+ </li>
+
+ <li>
+ <label for="saccount[phone]" class="fieldLabel">Phone</label>
+ <input type="text" name="saccount[phone]" value="<%= @saccount.phone %>" <%= placeholder( "Phone" ) %> />
+ </li>
+
+ <li>
+ <label for="saccount[website]" class="fieldLabel">Website</label>
+ <input type="text" name="saccount[website]" value="<%= @saccount.website %>" <%= placeholder( "Website" ) %> />
+ </li>
+
+ </ul>
+ <input type="submit" class="standardButton" value="Update"/>
+ </form>
+</div>
View
21 SalesForce-rhodes/app/Saccount/index.bb.erb
@@ -0,0 +1,21 @@
+<div id="pageTitle">
+ <h1>Saccounts</h1>
+</div>
+
+
+<div id="toolbar">
+ <%= link_to "New", :action => :new %>
+ <%= link_to "Home", RhoConfig::start_path %>
+</div>
+
+<div id="content">
+ <table>
+ <tr>
+ <% @saccounts.each do |obj| %>
+
+ <td class="recordLabel"><%= link_to "#{obj.name}", :action => :show, :id => obj.object %></td>
+
+ <% end %>
+ </tr>
+ </table>
+</div>
View
26 SalesForce-rhodes/app/Saccount/index.erb
@@ -0,0 +1,26 @@
+<div class="pageTitle">
+ <h1>Saccounts</h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem regularButton">
+ <a href="<%= Rho::RhoConfig.start_path %>">Home</a>
+ </div>
+ <div class="rightItem regularButton">
+ <a class="button" href="<%= url_for :action => :new %>">New</a>
+ </div>
+</div>
+
+<div class="content">
+ <ul>
+ <% @saccounts.each do |saccount| %>
+
+ <li>
+ <a href="<%= url_for :action => :show, :id => saccount.object %>">
+ <span class="title"><%= saccount.name %></span><span class="disclosure_indicator"></span>
+ </a>
+ </li>
+
+ <% end %>
+ </ul>
+</div>
View
34 SalesForce-rhodes/app/Saccount/new.bb.erb
@@ -0,0 +1,34 @@
+<div id="pageTitle">
+ <h1>New Saccount</h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Back", :action => :index %>
+</div>
+
+
+<div id="content">
+
+ <form method="POST" action="<%= url_for :action => :create %>">
+ <input type="hidden" name="id" value="<%= @saccount.object %>"/>
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name: </td>
+ <td class="itemValue"><input type="text" name="saccount[name]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Phone: </td>
+ <td class="itemValue"><input type="text" name="saccount[phone]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Website: </td>
+ <td class="itemValue"><input type="text" name="saccount[website]"/></td>
+ </tr>
+
+ </table>
+ <input type="submit" class="standardButton" value="Create" />
+ </form>
+</div>
View
37 SalesForce-rhodes/app/Saccount/new.erb
@@ -0,0 +1,37 @@
+<div class="pageTitle">
+ <h1>New <%= @saccount.title %></h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem backButton">
+ <a class="cancel" href="<%= url_for :action => :index %>">Cancel</a>
+ </div>
+</div>
+
+<div class="content">
+ <form method="POST" action="<%= url_for :action => :create %>">
+ <input type="hidden" name="id" value="<%= @saccount.object %>"/>
+ <ul>
+
+ <li>
+ <label for="saccount[name]" class="fieldLabel">Name</label>
+ <input type="text" name="saccount[name]" <%=
+ placeholder("Name") %> />
+ </li>
+
+ <li>
+ <label for="saccount[phone]" class="fieldLabel">Phone</label>
+ <input type="text" name="saccount[phone]" <%=
+ placeholder("Phone") %> />
+ </li>
+
+ <li>
+ <label for="saccount[website]" class="fieldLabel">Website</label>
+ <input type="text" name="saccount[website]" <%=
+ placeholder("Website") %> />
+ </li>
+
+ </ul>
+ <input type="submit" class="standardButton" value="Create"/>
+ </form>
+</div>
View
10 SalesForce-rhodes/app/Saccount/saccount.rb
@@ -0,0 +1,10 @@
+# The model has already been created by the framework, and extends Rhom::RhomObject
+# You can add more methods here
+class Saccount
+ include Rhom::PropertyBag
+
+ # Uncomment the following line to enable sync with Saccount.
+ enable :sync
+
+ #add model specifc code here
+end
View
58 SalesForce-rhodes/app/Saccount/saccount_controller.rb
@@ -0,0 +1,58 @@
+require 'rho/rhocontroller'
+require 'helpers/browser_helper'
+
+class SaccountController < Rho::RhoController
+ include BrowserHelper
+
+ #GET /Saccount
+ def index
+ @saccounts = Saccount.find(:all)
+ render
+ end
+
+ # GET /Saccount/{1}
+ def show
+ @saccount = Saccount.find(@params['id'])
+ if @saccount
+ render :action => :show
+ else
+ redirect :action => :index
+ end
+ end
+
+ # GET /Saccount/new
+ def new
+ @saccount = Saccount.new
+ render :action => :new
+ end
+
+ # GET /Saccount/{1}/edit
+ def edit
+ @saccount = Saccount.find(@params['id'])
+ if @saccount
+ render :action => :edit
+ else
+ redirect :action => :index
+ end
+ end
+
+ # POST /Saccount/create
+ def create
+ @saccount = Saccount.create(@params['saccount'])
+ redirect :action => :index
+ end
+
+ # POST /Saccount/{1}/update
+ def update
+ @saccount = Saccount.find(@params['id'])
+ @saccount.update_attributes(@params['saccount']) if @saccount
+ redirect :action => :index
+ end
+
+ # POST /Saccount/{1}/delete
+ def delete
+ @saccount = Saccount.find(@params['id'])
+ @saccount.destroy if @saccount
+ redirect :action => :index
+ end
+end
View
31 SalesForce-rhodes/app/Saccount/show.bb.erb
@@ -0,0 +1,31 @@
+<div id="pageTitle">
+ <h1><%= @saccount.name%></h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Back", :action => :index %>
+ <%= link_to "Edit", :action => :edit, :id => @saccount.object %>
+</div>
+
+
+<div id="content">
+
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name</td>
+ <td class="itemValue"><%= @saccount.name%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Phone</td>
+ <td class="itemValue"><%= @saccount.phone%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Website</td>
+ <td class="itemValue"><%= @saccount.website%></td>
+ </tr>
+
+ </table>
+</div>
View
39 SalesForce-rhodes/app/Saccount/show.erb
@@ -0,0 +1,39 @@
+<div class="pageTitle">
+ <h1><%= @saccount.name %></h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem backButton">
+ <a href="<%= url_for :action => :index %>">Back</a>
+ </div>
+ <div class="rightItem regularButton">
+ <a href="<%= url_for :action => :edit, :id => @saccount.object %>">Edit</a>
+ </div>
+</div>
+
+<div class="content">
+ <ul>
+
+ <li>
+ <div class="itemLabel">Name</div>
+ <div class="itemValue"><%= @saccount.name %></div>
+ </li>
+
+ <li>
+ <div class="itemLabel">Phone</div>
+ <div class="itemValue"><%= @saccount.phone %></div>
+ </li>
+
+ <li>
+ <div class="itemLabel">Website</div>
+ <div class="itemValue"><%= @saccount.website %></div>
+ </li>
+
+ <li>
+ <a href="<%= url_for :controller => :Scontact, :action => :index, :query => {:account => @saccount.object} %>">
+ <span class="title">Contacts</span><span class="disclosure_indicator"></span>
+ </a>
+ </li>
+
+ </ul>
+</div>
View
39 SalesForce-rhodes/app/Scontact/edit.bb.erb
@@ -0,0 +1,39 @@
+<div id="pageTitle">
+ <h1>Edit <%= @scontact.name%></h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Back", :action => :show, :id => @scontact.object %>
+ <%= link_to "Delete", :action => :delete, :id => @scontact.object %>
+</div>
+
+
+<div id="content">
+ <form method="POST" action="<%= url_for :action => :update %>">
+ <input type="hidden" name="id" value="<%= @scontact.object %>"/>
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name: </td>
+ <td class="itemValue"><input type="text" name="scontact[name]" value="<%= @scontact.name %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Phone: </td>
+ <td class="itemValue"><input type="text" name="scontact[phone]" value="<%= @scontact.phone %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Email: </td>
+ <td class="itemValue"><input type="text" name="scontact[email]" value="<%= @scontact.email %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Account: </td>
+ <td class="itemValue"><input type="text" name="scontact[account_id]" value="<%= @scontact.account_id %>"/></td>
+ </tr>
+
+ </table>
+ <input type="submit" class="standardButton" value="Update" />
+ </form>
+</div>
View
42 SalesForce-rhodes/app/Scontact/edit.erb
@@ -0,0 +1,42 @@
+<div class="pageTitle">
+ <h1>Edit <%= @scontact.name %></h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem backButton">
+ <a href="<%= url_for :action => :show, :id => @scontact.object %>">Cancel</a>
+ </div>
+ <div class="rightItem regularButton">
+ <a class="button" href="<%= url_for :action => :delete, :id => @scontact.object %>">Delete</a>
+ </div>
+</div>
+
+<div class="content">
+ <form method="POST" action="<%= url_for :action => :update %>">
+ <input type="hidden" name="id" value="<%= @scontact.object %>"/>
+ <ul>
+
+ <li>
+ <label for="scontact[name]" class="fieldLabel">Name</label>
+ <input type="text" name="scontact[name]" value="<%= @scontact.name %>" <%= placeholder( "Name" ) %> />
+ </li>
+
+ <li>
+ <label for="scontact[phone]" class="fieldLabel">Phone</label>
+ <input type="text" name="scontact[phone]" value="<%= @scontact.phone %>" <%= placeholder( "Phone" ) %> />
+ </li>
+
+ <li>
+ <label for="scontact[email]" class="fieldLabel">Email</label>
+ <input type="text" name="scontact[email]" value="<%= @scontact.email %>" <%= placeholder( "Email" ) %> />
+ </li>
+
+ <li>
+ <label for="scontact[account_id]" class="fieldLabel">Account</label>
+ <input type="text" name="scontact[account_id]" value="<%= @scontact.account_id %>" <%= placeholder( "Account" ) %> />
+ </li>
+
+ </ul>
+ <input type="submit" class="standardButton" value="Update"/>
+ </form>
+</div>
View
21 SalesForce-rhodes/app/Scontact/index.bb.erb
@@ -0,0 +1,21 @@
+<div id="pageTitle">
+ <h1>Scontacts</h1>
+</div>
+
+
+<div id="toolbar">
+ <%= link_to "New", :action => :new %>
+ <%= link_to "Home", RhoConfig::start_path %>
+</div>
+
+<div id="content">
+ <table>
+ <tr>
+ <% @scontacts.each do |obj| %>
+
+ <td class="recordLabel"><%= link_to "#{obj.name}", :action => :show, :id => obj.object %></td>
+
+ <% end %>
+ </tr>
+ </table>
+</div>
View
26 SalesForce-rhodes/app/Scontact/index.erb
@@ -0,0 +1,26 @@
+<div class="pageTitle">
+ <h1>Scontacts</h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem regularButton">
+ <a href="<%= Rho::RhoConfig.start_path %>">Home</a>
+ </div>
+ <div class="rightItem regularButton">
+ <a class="button" href="<%= url_for :action => :new %>">New</a>
+ </div>
+</div>
+
+<div class="content">
+ <ul>
+ <% @scontacts.each do |scontact| %>
+
+ <li>
+ <a href="<%= url_for :action => :show, :id => scontact.object %>">
+ <span class="title"><%= scontact.name %></span><span class="disclosure_indicator"></span>
+ </a>
+ </li>
+
+ <% end %>
+ </ul>
+</div>
View
39 SalesForce-rhodes/app/Scontact/new.bb.erb
@@ -0,0 +1,39 @@
+<div id="pageTitle">
+ <h1>New Scontact</h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Back", :action => :index %>
+</div>
+
+
+<div id="content">
+
+ <form method="POST" action="<%= url_for :action => :create %>">
+ <input type="hidden" name="id" value="<%= @scontact.object %>"/>
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name: </td>
+ <td class="itemValue"><input type="text" name="scontact[name]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Phone: </td>
+ <td class="itemValue"><input type="text" name="scontact[phone]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Email: </td>
+ <td class="itemValue"><input type="text" name="scontact[email]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Account: </td>
+ <td class="itemValue"><input type="text" name="scontact[account_id]"/></td>
+ </tr>
+
+ </table>
+ <input type="submit" class="standardButton" value="Create" />
+ </form>
+</div>
View
43 SalesForce-rhodes/app/Scontact/new.erb
@@ -0,0 +1,43 @@
+<div class="pageTitle">
+ <h1>New <%= @scontact.title %></h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem backButton">
+ <a class="cancel" href="<%= url_for :action => :index %>">Cancel</a>
+ </div>
+</div>
+
+<div class="content">
+ <form method="POST" action="<%= url_for :action => :create %>">
+ <input type="hidden" name="id" value="<%= @scontact.object %>"/>
+ <ul>
+
+ <li>
+ <label for="scontact[name]" class="fieldLabel">Name</label>
+ <input type="text" name="scontact[name]" <%=
+ placeholder("Name") %> />
+ </li>
+
+ <li>
+ <label for="scontact[phone]" class="fieldLabel">Phone</label>
+ <input type="text" name="scontact[phone]" <%=
+ placeholder("Phone") %> />
+ </li>
+
+ <li>
+ <label for="scontact[email]" class="fieldLabel">Email</label>
+ <input type="text" name="scontact[email]" <%=
+ placeholder("Email") %> />
+ </li>
+
+ <li>
+ <label for="scontact[account_id]" class="fieldLabel">Account</label>
+ <input type="text" name="scontact[account_id]" <%=
+ placeholder("Account") %> />
+ </li>
+
+ </ul>
+ <input type="submit" class="standardButton" value="Create"/>
+ </form>
+</div>
View
10 SalesForce-rhodes/app/Scontact/scontact.rb
@@ -0,0 +1,10 @@
+# The model has already been created by the framework, and extends Rhom::RhomObject
+# You can add more methods here
+class Scontact
+ include Rhom::PropertyBag
+
+ # Uncomment the following line to enable sync with Scontact.
+ enable :sync
+
+ #add model specifc code here
+end
View
63 SalesForce-rhodes/app/Scontact/scontact_controller.rb
@@ -0,0 +1,63 @@
+require 'rho/rhocontroller'
+require 'helpers/browser_helper'
+
+class ScontactController < Rho::RhoController
+ include BrowserHelper
+
+ #GET /Scontact
+ def index
+ if @params["account"]
+ @scontacts = Scontact.find(:all, :conditions => {'account_id' => @params["account"]})
+ else
+ @scontacts = Scontact.find(:all)
+ end
+ render
+ end
+
+ # GET /Scontact/{1}
+ def show
+ @scontact = Scontact.find(@params['id'])
+ if @scontact
+ @saccount = Saccount.find(@scontact.account_id)
+ render :action => :show
+ else
+ redirect :action => :index
+ end
+ end
+
+ # GET /Scontact/new
+ def new
+ @scontact = Scontact.new
+ render :action => :new
+ end
+
+ # GET /Scontact/{1}/edit
+ def edit
+ @scontact = Scontact.find(@params['id'])
+ if @scontact
+ render :action => :edit
+ else
+ redirect :action => :index
+ end
+ end
+
+ # POST /Scontact/create
+ def create
+ @scontact = Scontact.create(@params['scontact'])
+ redirect :action => :index
+ end
+
+ # POST /Scontact/{1}/update
+ def update
+ @scontact = Scontact.find(@params['id'])
+ @scontact.update_attributes(@params['scontact']) if @scontact
+ redirect :action => :index
+ end
+
+ # POST /Scontact/{1}/delete
+ def delete
+ @scontact = Scontact.find(@params['id'])
+ @scontact.destroy if @scontact
+ redirect :action => :index
+ end
+end
View
36 SalesForce-rhodes/app/Scontact/show.bb.erb
@@ -0,0 +1,36 @@
+<div id="pageTitle">
+ <h1><%= @scontact.name%></h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Back", :action => :index %>
+ <%= link_to "Edit", :action => :edit, :id => @scontact.object %>
+</div>
+
+
+<div id="content">
+
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name</td>
+ <td class="itemValue"><%= @scontact.name%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Phone</td>
+ <td class="itemValue"><%= @scontact.phone%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Email</td>
+ <td class="itemValue"><%= @scontact.email%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">AccountId</td>
+ <td class="itemValue"><%= @scontact.account_id%></td>
+ </tr>
+
+ </table>
+</div>
View
42 SalesForce-rhodes/app/Scontact/show.erb
@@ -0,0 +1,42 @@
+<div class="pageTitle">
+ <h1><%= @scontact.name %></h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem backButton">
+ <a href="<%= url_for :action => :index %>">Back</a>
+ </div>
+ <div class="rightItem regularButton">
+ <a href="<%= url_for :action => :edit, :id => @scontact.object %>">Edit</a>
+ </div>
+</div>
+
+<div class="content">
+ <ul>
+
+ <li>
+ <div class="itemLabel">Name</div>
+ <div class="itemValue"><%= @scontact.name %></div>
+ </li>
+
+ <li>
+ <div class="itemLabel">Phone</div>
+ <div class="itemValue"><%= @scontact.phone %></div>
+ </li>
+
+ <li>
+ <div class="itemLabel">Email</div>
+ <div class="itemValue"><%= @scontact.email %></div>
+ </li>
+
+ <li>
+ <div class="itemLabel">AccountId</div>
+ <div class="itemValue"><%= @scontact.account_id %></div>
+ </li>
+ <li>
+ <a href="<%= url_for :controller => :Saccount, :action => :show, :id => @saccount.object %>">
+ <span class="title"><%= @saccount.name %></span><span class="disclosure_indicator"></span>
+ </a>
+ </li>
+ </ul>
+</div>
View
75 SalesForce-rhodes/app/Settings/controller.rb
@@ -0,0 +1,75 @@
+require 'rho'
+require 'rho/rhocontroller'
+require 'rho/rhoerror'
+require 'helpers/browser_helper'
+
+class SettingsController < Rho::RhoController
+ include BrowserHelper
+
+ def index
+ @msg = @params['msg']
+ render
+ end
+
+ def login
+ @msg = @params['msg']
+ render :action => :login, :back => '/app'
+ end
+
+ def login_callback
+ errCode = @params['error_code'].to_i
+ if errCode == 0
+ # run sync if we were successful
+ WebView.navigate Rho::RhoConfig.options_path
+ SyncEngine.dosync
+ else
+ if errCode == Rho::RhoError::ERR_CUSTOMSYNCSERVER
+ @msg = @params['error_message']
+ end
+
+ if !@msg || @msg.length == 0
+ @msg = Rho::RhoError.new(errCode).message
+ end
+
+ WebView.navigate ( url_for :action => :login, :query => {:msg => @msg} )
+ end
+ end
+
+ def do_login
+ if @params['login'] and @params['password']
+ begin
+ SyncEngine.login(@params['login'], @params['password'], (url_for :action => :login_callback) )
+ render :action => :wait
+ rescue Rho::RhoError => e
+ @msg = e.message
+ render :action => :login
+ end
+ else
+ @msg = Rho::RhoError.err_message(Rho::RhoError::ERR_UNATHORIZED) unless @msg && @msg.length > 0
+ render :action => :login
+ end
+ end
+
+ def logout
+ SyncEngine.logout
+ @msg = "You have been logged out."
+ render :action => :login
+ end
+
+ def reset
+ render :action => :reset
+ end
+
+ def do_reset
+ Rhom::Rhom.database_full_reset
+ SyncEngine.dosync
+ @msg = "Database has been reset."
+ redirect :action => :index, :query => {:msg => @msg}
+ end
+
+ def do_sync
+ SyncEngine.dosync
+ @msg = "Sync has been triggered."
+ redirect :action => :index, :query => {:msg => @msg}
+ end
+end
View
17 SalesForce-rhodes/app/Settings/home.bb.erb
@@ -0,0 +1,17 @@
+<div id="pageTitle">
+ <h1>Home</h1>
+</div>
+
+<div id="toolbar">
+ <% if SyncEngine::logged_in > 0 %>
+ <%= link_to "Logout", :action => :logout %>
+ <% else %>
+ <%= link_to "Login", :action => :login %>
+ <% end %>
+</div>
+
+<div id="content">
+ <ul>
+ <li>Add links here...</li>
+ </ul>
+</div>
View
20 SalesForce-rhodes/app/Settings/home.erb
@@ -0,0 +1,20 @@
+<div class="pageTitle">
+ <h1>Home</h1>
+</div>
+
+<div class="toolbar">
+ <%% if SyncEngine::logged_in > 0 %>
+ <a class="leftItem blueButton" href="<%%= url_for :action => :do_sync %>">Sync</a>
+ <a class="rightItem regularButton" href="<%%= url_for :action => :logout %>">Logout</a>
+ <%% else %>
+ <a class="rightItem regularButton" href="<%%= url_for :action => :login %>">Login</a>
+ <%% end %>
+</div>
+
+<div class="content">
+ <ul>
+ <li class="arrow">
+ <a href="#">Add Links Here...</a>
+ </li>
+ </ul>
+</div>
View
32 SalesForce-rhodes/app/Settings/index.bb.erb
@@ -0,0 +1,32 @@
+<div id="pageTitle">
+ <h1>Settings</h1>
+</div>
+
+<div id="content">
+ <% if @msg %>
+ <div class="alert" align="center"><%= @msg %></div>
+ <% end %>
+
+ <ul>
+ <li>
+ <p>Client ID: <span class="cid"><%= Rhom::Rhom::client_id %></span></p>
+ </li>
+ <li>
+ <%= link_to "Reset Database", :action => :reset %>
+ </li>
+ <li>
+ <%= link_to "Sync", :action => :do_sync %>
+ </li>
+
+ <% if SyncEngine::logged_in > 0 %>
+ <li>
+ <%= link_to "Logout", :action => :logout %>
+ </li>
+ <% else %>
+ <li>
+ <%= link_to "Login", :action => :login %>
+ </li>
+ <% end %>
+ </ul>
+
+</div>
View
30 SalesForce-rhodes/app/Settings/index.erb
@@ -0,0 +1,30 @@
+<div class="pageTitle">
+ <h1>Settings</h1>
+</div>
+
+
+<div class="toolbar">
+</div>
+
+<div class="content">
+ <ul>
+ <% if @msg %>
+ <li style="color: red; text-align: center"><%= @msg %></li>
+ <% end %>
+ <li>
+ <div class="itemLabel">
+ <span class="title">Client ID:</span>
+ </div>
+ <div class="itemValue">
+ <span class="clientID"><%= Rhom::Rhom::client_id %></span>
+ </div>
+ </li>
+ <li><a href="<%= url_for :action => :reset %>">Reset Database</a></li>
+ <li><a href="<%= url_for :action => :do_sync %>">Perform Sync</a></li>
+ <% if SyncEngine::logged_in > 0 %>
+ <li><a href="<%= url_for :action => :logout %>">Logout</a></li>
+ <% else %>
+ <li><a href="<%= url_for :action => :login %>">Login</a></li>
+ <% end %>
+ </ul>
+</div>
View
35 SalesForce-rhodes/app/Settings/login.bb.erb
@@ -0,0 +1,35 @@
+<div id="pageTitle">
+ <h1>Login</h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Back", :action => :index %>
+</div>
+
+<div id="content">
+ <form method="POST" action="<%= url_for :action => :do_login %>">
+
+ <% if @msg %>
+ <div class="alert" align="center"><%= @msg %></div>
+ <% end %>
+
+ <table>
+
+ <tr>
+ <td width="125" class="fieldLabel">Login</td>
+ <td><input type="text" maxlength="100" name="login"/></td>
+ </tr>
+
+ <tr>
+ <td width="125" class="fieldLabel">Password</td>
+ <td><input type="password" maxlength="100" name="password"/></td>
+ </tr>
+ </table>
+
+ <input type="submit" class="standardButton" value="Login" />
+ </form>
+</div>
+
+
+
+
View
27 SalesForce-rhodes/app/Settings/login.erb
@@ -0,0 +1,27 @@
+<div class="pageTitle">
+ <h1>Login</h1>
+</div>
+
+<div class="toolbar">
+</div>
+
+
+<div class="content" >
+ <form method="POST" action="<%= url_for :action => :do_login %>">
+ <% if @msg %>
+ <p style="color: red"><%= @msg %></p>
+ <% end %>
+ <ul>
+ <li>
+ <label for="login" class="fieldLabel">Login</label>
+ <input type="text" name="login" <%= placeholder("Login") %> />
+ </li>
+
+ <li>
+ <label for="password" class="fieldLabel">Password</label>
+ <input type="password" name="password" <%= placeholder("Password") %> />
+ </li>
+ </ul>
+ <input type="submit" class="standardButton" value="Login"/>
+ </form>
+</div>
View
15 SalesForce-rhodes/app/Settings/reset.bb.erb
@@ -0,0 +1,15 @@
+<div id="pageTitle">
+ <h1>Reset Database</h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Confirm", :action => :do_reset %>
+ <%= link_to "Cancel", Rho::RhoConfig.options_path %>
+</div>
+
+<div id="content">
+ <div class="warning">
+ <h2>Are you sure?</h2>
+ <p> Resetting removes all objects from your device.</p>
+ </div>
+</div>
View
17 SalesForce-rhodes/app/Settings/reset.erb
@@ -0,0 +1,17 @@
+<div class="pageTitle">
+ <h1>Reset Database</h1>
+</div>
+
+<div class="toolbar">
+ <div class="leftItem backButton">
+ <a href="<%= url_for :action => :index %>">Cancel</a>
+ </div>
+ <div class="button blueButton">
+ <a href="<%= url_for :action => :do_reset %>">Confirm</a>
+ </div>
+</div>
+
+<div class="content">
+ <h3>Are you sure?</h3>
+ <div style="margin: 10px;">Resetting removes all objects from your device.</div>
+</div>
View
3  SalesForce-rhodes/app/Settings/wait.bb.erb
@@ -0,0 +1,3 @@
+<div id="pageTitle">
+ <h1>Wait</h1>
+</div>
View
5 SalesForce-rhodes/app/Settings/wait.erb
@@ -0,0 +1,5 @@
+<div class="pageTitle">
+ <h1>Wait</h1>
+</div>
+
+<div class="toolbar"> </div>
View
16 SalesForce-rhodes/app/application.rb
@@ -0,0 +1,16 @@
+require 'rho/rhoapplication'
+
+class AppApplication < Rho::RhoApplication
+ def initialize
+ # Tab items are loaded left->right, @tabs[0] is leftmost tab in the tab-bar
+ # Super must be called *after* settings @tabs!
+ @tabs = nil
+ @@tabbar = nil
+
+ super
+
+ # Uncomment to set sync notification callback to /app/Settings/sync_notify.
+ # SyncEngine::set_objectnotify_url("/app/Settings/sync_notify")
+ # SyncEngine.set_notification(-1, "/app/Settings/sync_notify", '')
+ end
+end
View
126 SalesForce-rhodes/app/helpers/application_helper.rb
@@ -0,0 +1,126 @@
+require 'json'
+
+module ApplicationHelper
+ def strip_braces(str=nil)
+ str ? str.gsub(/\{/, "").gsub(/\}/, "") : nil
+ end
+
+ def strike_if(str, condition=true)
+ condition ? "<s>#{str}</s>" : str
+ end
+
+ def display_blanks(value)
+ if blank?(value)
+ "---"
+ else
+ value
+ end
+ end
+
+ def blank?(value)
+ value.nil? || value == "" || value.length==0
+ end
+
+ def display_blankstr(value)
+ if blank?(value)
+ " "
+ else
+ value
+ end
+ end
+
+ def display_newline()
+ "<br>"
+ end
+
+ def display_space()
+ " "
+ end
+
+ def display_dollars(value)
+ if blank?(value)
+ " "
+ else
+ number = "$" + sprintf("%.2f", value)
+
+ # use a commify algorithm -- http://snippets.dzone.com/tag/commify
+ number.reverse!
+ number.gsub!(/(\d\d\d)(?=\d)(?!\d*\.)/, '\1,')
+ number.reverse!
+ end
+ end
+
+ def display_number(value)
+ if blank?(value)
+ " "
+ else
+ sprintf("%.2f", value)
+ end
+ end
+
+ def both_items_present?(value1, value2)
+ !blank?(value1) && !blank?(value2)
+ end
+
+ def replace_newlines(value)
+ if blank?(value)
+ " "
+ else
+ value.gsub('\n', ' ')
+ end
+ end
+
+ def format_address_for_mapping(street, city, state, zip, tagforurl)
+ # handle case where fields could be nil
+ mystreet = !street.nil? ? street : ""
+ mycity = !city.nil? ? city : ""
+ mystate = !state.nil? ? state : ""
+ myzip = !zip.nil? ? zip : ""
+
+ result = ""
+ if !tagforurl
+ # build up address string
+ result += (mystreet + ", ") if mystreet.length > 0
+ result += (mycity + ", ") if mycity.length > 0
+ result += (mystate + " ") if mystate.length > 0
+ result += myzip if myzip.length > 0
+ else
+ # need to URL encode data too
+ result += ("&street=" + Rho::RhoSupport.url_encode(mystreet)) if mystreet.length > 0
+ result += ("&city=" + Rho::RhoSupport.url_encode(mycity)) if mycity.length > 0
+ result += ("&state=" + Rho::RhoSupport.url_encode(mystate)) if mystate.length > 0
+ result += ("&zip=" + Rho::RhoSupport.url_encode(myzip)) if myzip.length > 0
+ end
+ # remove any extraneous characters that could interfere with proper address matching
+ result = replace_newlines(result)
+ end
+
+ def has_valid_mapping_address(street, city, state, zip)
+ # at a minimum, an address must have a state or a zip
+ (!state.nil? && state.length > 0) || (!zip.nil? && zip.length > 0)
+ end
+
+ def format_latlon_for_mapping(latitude, longitude)
+ result = ""
+ result += ("&latitude=" + Rho::RhoSupport.url_encode(latitude)) if latitude.length > 0
+ result += ("&longitude=" + Rho::RhoSupport.url_encode(longitude)) if longitude.length > 0
+ result
+ end
+
+ def render_transition(params)
+ @params["rho_callback"] = nil
+ params[:layout] = false
+ # TODO: escape carriage returns instead of removing them altoegether
+ content = render(params).split('\'').join('\\\'').split(/[\r\n]/).join('')
+ WebView.execute_js("Rho.insertAsyncPage('<div>#{content}</div>')")
+ end
+
+ def caller_request_hash_to_query
+ 'caller_request=' + Rho::RhoSupport.url_encode(::JSON.generate(@request))
+ end
+
+ def caller_request_query_to_hash
+ @caller_request = Rho::JSON.parse(@params['caller_request']) if @params['caller_request']
+ end
+
+end
View
18 SalesForce-rhodes/app/helpers/browser_helper.rb
@@ -0,0 +1,18 @@
+module BrowserHelper
+
+ def placeholder(label=nil)
+ "placeholder='#{label}'" if platform == 'apple'
+ end
+
+ def platform
+ System::get_property('platform').downcase
+ end
+
+ def selected(option_value,object_value)
+ "selected=\"yes\"" if option_value == object_value
+ end
+
+ def checked(option_value,object_value)
+ "checked=\"yes\"" if option_value == object_value
+ end
+end
View
26 SalesForce-rhodes/app/index.bb.erb
@@ -0,0 +1,26 @@
+<div id="pageTitle">
+ <h1>SalesforceRhodes</h1>
+</div>
+
+<div id="toolbar">
+ <%= link_to "Sync", :controller => :Settings, :action => :do_sync %>
+ <% if SyncEngine::logged_in > 0 %>
+ <%= link_to "Logout", :controller => :Settings, :action => :logout %>
+ <% else %>
+ <%= link_to "Login", :controller => :Settings, :action => :login %>
+ <% end %>
+</div>
+
+
+<div id="content">
+ <table>
+ <tr>
+ <td class="recordLabel">Add links here...</td>
+ </tr>
+ </table>
+</div>
+
+
+
+
+
View
29 SalesForce-rhodes/app/index.erb
@@ -0,0 +1,29 @@
+<div class="pageTitle">
+ <h1>SalesforceRhodes</h1>
+</div>
+
+<div class="toolbar">
+ <% if SyncEngine::logged_in > 0 %>
+ <div class="leftItem blueButton">
+ <a href="<%= url_for :controller => :Settings, :action => :do_sync %>">Sync</a>
+ </div>
+ <div class="rightItem regularButton">
+ <a href="<%= url_for :controller => :Settings, :action => :logout %>">Logout</a>
+ </div>
+ <% else %>
+ <div class="rightItem regularButton">
+ <a href="<%= url_for :controller => :Settings, :action => :login %>">Login</a>
+ </div>
+ <% end %>
+</div>
+
+<div class="content">
+ <ul>
+ <li>
+ <a href="Saccount"><span class="title">Accounts</span><span class="disclosure_indicator"/></a>
+ </li>
+ <li>
+ <a href="Scontact"><span class="title">Contacts</span><span class="disclosure_indicator"/></a>
+ </li>
+ </ul>
+</div>
View
45 SalesForce-rhodes/app/layout.erb
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+
+ <title>SalesforceRhodes</title>
+ <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
+
+ <% if System::get_property('platform') == 'APPLE' || System::get_property('platform') == 'ANDROID' %>
+ <script src="/public/jqtouch/jquery.1.3.2.min.js" type="text/javascript"></script>
+ <script src="/public/jqtouch/jqtouch.js" type="text/javascript"></script>
+ <link href="/public/jqtouch/jqtouch.css" type="text/css" rel="stylesheet"/>
+ <% if System::get_property('platform') == 'APPLE' %>
+ <link href="/public/jqtouch/jqtouch-iphone.css" type="text/css" rel="stylesheet"/>
+ <% end %>
+ <script>$.jQTouch();</script>
+ <% end %>
+
+ <% if System::get_property('platform') == 'APPLE' %>
+ <link href="/public/css/iphone.css" type="text/css" rel="stylesheet"/>
+ <% elsif System::get_property('platform') == 'ANDROID' %>
+ <link href="/public/css/android.css" type="text/css" rel="stylesheet"/>
+ <% elsif System::get_property('platform') == 'Blackberry' %>
+ <% if System::get_property('os_version') =~ /^6\.0/ %>
+ <link href="/public/css/android.css" type="text/css" rel="stylesheet"/>
+ <!-- Percentage doesnt work here? Set body height to screen height - toolbar height -->
+ <style>
+ body {
+ height: <%= System::get_property('screen_height').to_i - 62 %>px;
+ }
+ </style>
+ <% else %>
+ <link href="/public/css/blackberry.css" type="text/css" rel="stylesheet"/>
+ <% end %>
+ <% else %>
+ <link href="/public/css/windows_mobile.css" type="text/css" rel="stylesheet"/>
+ <% end %>
+</head>
+
+<body>
+ <%= @content %>
+</body>
+
+</html>
View
11 SalesForce-rhodes/app/loading.html
@@ -0,0 +1,11 @@
+<html>
+ <head>
+ <title>Home</title>
+ <meta name="viewport" content="initial-scale=1.0, width=device-width"/>
+ </head>
+ <body>
+ <div align="center">
+ <h3>Loading...</h3>
+ </div>
+ </body>
+</html>
View
7 SalesForce-rhodes/app/test/saccount_spec.rb
@@ -0,0 +1,7 @@
+describe "Saccount" do
+ #this test always fails, you really should have tests!
+
+ it "should have tests" do
+ true.should == false
+ end
+end
View
7 SalesForce-rhodes/app/test/scontact_spec.rb
@@ -0,0 +1,7 @@
+describe "Scontact" do
+ #this test always fails, you really should have tests!
+
+ it "should have tests" do
+ true.should == false
+ end
+end
View
19 SalesForce-rhodes/build.yml
@@ -0,0 +1,19 @@
+---
+extensions:
+- json
+- another-extension
+name: SalesForce-rhodes
+bbver: 4.6
+sdk: /Users/brian/work/rhodes
+applog: rholog.txt
+build: debug
+wmsdk: Windows Mobile 6 Professional SDK (ARMV4I)
+version: 1.0
+vendor: rhomobile
+sdkversion: 2.2.3
+iphone:
+ provisionprofile:
+ sdk: iphonesimulator4.0
+ entitlements:
+ codesignidentity:
+ configuration: Debug
View
BIN  SalesForce-rhodes/icon/icon.ico
Binary file not shown
View
BIN  SalesForce-rhodes/icon/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
330 SalesForce-rhodes/public/css/android.css
@@ -0,0 +1,330 @@
+a {
+ text-decoration: none;
+}
+
+.content {
+ width: inherit;
+ height: 100%;
+}
+
+.toolbar .noButton {
+ display: none;
+}
+
+.content ul {
+ -webkit-padding-start: 0;
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+}
+
+.content ul li {
+ overflow: hidden;
+ clear: both;
+}
+
+.content ul li span {
+ display: block;
+}
+
+.content ul.settings li div.itemLabel span.title {
+ padding: 0;
+ margin: 0;
+}
+
+body {
+ margin: 0;
+ height: 100%;
+ width: inherit;
+ font-family: "Droid", sans-serif;
+ background: black;
+ color: white;
+}
+
+h1 {
+ font-size: 1em;
+}
+
+.content {
+ background-color: black;
+ width: 100%;
+ padding: 0;
+ margin: 0;
+}
+
+/* Toolbar */
+
+.toolbar {
+ height: 60px;
+ width: 100%;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #2B2B2B), color-stop(0.2, #585858), color-stop(1.0, #2B2B2B));
+ display: table;
+ text-align: center;
+ border-spacing: 10px;
+}
+
+.toolbar .leftItem,
+.toolbar .centerItem,
+.toolbar .rightItem {
+ display: table-cell;
+}
+
+.toolbar a {
+ line-height: 40px;
+ color: black;
+ display: block;
+}
+
+.toolbar .deleteButton,
+.toolbar .regularButton,
+.toolbar .blueButton,
+.toolbar .backButton {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, white), color-stop(0.5, #ccc), color-stop(1.0, #bdbebd));
+ -webkit-border-radius: 5px;
+ font-size: .9em;
+ border: 1px solid white;
+}
+
+/* Header */
+
+.pageTitle {
+ height: 25px;
+ margin: 0;
+ width: 100%;
+ display: none;
+}
+
+.pageTitle h1 {
+ position: absolute;
+ top: 0;
+ text-align: left;
+ width: 100%;
+ margin: 0;
+ padding-left: 5px;
+ color: white;
+ text-shadow: 1px 1px 1px #000;
+ line-height: 25px;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #999), color-stop(0.5, #848684));
+}
+
+/* lists */
+
+.content ul {
+ background: black;
+}
+
+.content ul li {
+ border-bottom: 1px solid #666;
+ font-size: 20px;
+}
+
+.content ul li a {
+ display: block;
+ text-decoration: none;
+ color: white;
+ font-size: 20px;
+ height: 100%;
+ width: 100%;
+ padding: 15px 0 15px 0;
+ background: url("../images/android/disclosure.png") no-repeat center right;
+}
+
+.content ul li a:hover {
+ background-color: #3399cc;
+}
+
+.content ul li a img {
+ float: left;
+ height: 100%;
+ max-width: 100px;
+}
+
+.content ul li span.title {
+ padding: 0 50px 0 10px;
+}
+
+.content ul li span.disclosure_indicator {
+ display: none;
+}
+
+.content ul li div.itemLabel {
+ float: left;
+ width: 45%;
+ padding: 15px 0 15px 10px;
+}
+
+.content ul li div.itemValue {
+ float: right;
+ width: 45%;
+ padding: 15px 10px 15px 0;
+}
+
+/* Forms */
+
+.content form button {
+ -webkit-appearance: push-button;
+ width: 300px;
+ height: 40px;
+ margin-left: 10px;
+}
+
+.content form ul {
+ font-size: 20px;
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+}
+
+.content form ul li {
+ border-bottom: 1px solid #666;
+ display: block;
+ list-style-type: none;
+}
+
+.content form label {
+ float: left;
+ display: block;
+ color: white;
+ line-height: 64px;
+ padding: 0 10px 0 5px;
+ margin: 0;
+ width: 40%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.content h2 {
+ margin: 0;
+}
+
+.content h2.groupTitle {
+ width: inherit;
+ margin: 0;
+ padding: 8px 0 8px 8px;
+ font-size: 10px;
+ color: white;
+ background-color: #666;
+}
+
+.content form {
+ background-color: black;
+}
+
+.content form input[type="checkbox"] {
+ -webkit-appearance: none;
+ background: url(/public/images/android/btn_check_off.png) no-repeat;
+ float: right;
+ height: 31px;
+ width: 31px;
+ margin-top: 15px;
+ margin-right: 20px;
+}
+
+.content form input[type="checkbox"]:checked {
+ background: url(/public/images/android/btn_check_on.png) no-repeat;
+ float: right;
+ height: 31px;
+ width: 31px;
+ margin-top: 15px;
+ margin-right: 20px;
+}
+
+.content form input[type="radio"] {
+ background: url(/public/images/android/btn_radio_off.png) no-repeat;
+ -webkit-appearance: none;
+ -webkit-box-sizing: border-box;
+ border: none;
+ height: 32px;
+ margin: 0px;
+ width: 32px;
+ float: right;
+ margin-right: 20px;
+ margin-top: 15px;
+}
+
+.content form input[type="radio"]:checked {
+ background: url(/public/images/android/btn_radio_on.png) no-repeat;
+ margin-top: 15px;
+ margin-right: 20px;
+}
+
+.content form select {
+ -webkit-appearance: none;
+ border: 0px;
+ width: 100%;
+ padding-left: 20px;
+ height: 60px;
+ color: white;
+ background: url('/public/images/android/ic_menu_more.png') no-repeat center right;
+}
+
+.content form textarea {
+ -webkit-appearance: none;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0125, #d6d7d6), color-stop(0.25, #efefef), color-stop(0.95, #f7f7f7), color-stop(1.0, #f7f3f7));
+ border: 1px solid #d6d7d6;
+ -webkit-border-radius: 4px;
+ margin: 10px 0 2px 10px;
+ font-size: 0.9em;
+ padding: 5px 0 2px 2px;
+ box-shadow: 0 -1px 3px #000000;
+}
+
+.content form input[type="text"],
+.content form input[type="password"] {
+ float: right;
+ height: 40px;
+ margin: 10px 10px 10px 0;
+ padding-left: 5px;
+ font-size: 26px;
+ width: 150px;
+ -webkit-appearance: none;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0125, #d6d7d6), color-stop(0.25, #efefef), color-stop(0.95, #f7f7f7), color-stop(1.0, #f7f3f7));
+ border: 1px solid #d6d7d6;
+ -webkit-border-radius: 4px;
+ box-shadow: 0 -1px 3px #000000;
+}
+
+.content form input.standardButton {
+ height: 45px;
+ margin: 2px 0 2px 0;
+ -webkit-border: 2px;
+ width: 100%;
+}
+
+/* Settings */
+
+.content ul.settings {
+ padding: 0;
+ margin: 0;
+}
+
+.content .reset h4 {
+ margin: 20px;
+ color: white;
+}
+
+.content div.standardButton {
+ margin: 10px 10px 10px 10px;
+ height: 45px;
+ width: 284px;
+ line-height: 45px;
+ -webkit-appearance: push-button;
+}
+
+.content div.standardButton a {
+ display: block;
+ width: 100%;
+ color: black;
+ text-align: center;
+}
+
+.content ul.settings li.alertMessage {
+ text-align: center;
+ height: 45px;
+ line-height: 45px;
+}
+
+.content ul.settings li.alertMessage span.message {
+ color: red;
+}
View
115 SalesForce-rhodes/public/css/blackberry.css
@@ -0,0 +1,115 @@
+/* bb main containers */
+body {
+ margin: 0;
+ font-family: Arial, Helvetica;
+ font-size:16px;
+ background: white;
+ color: black;
+ overflow-x: hidden;
+}
+
+div#pageTitle {
+ background: black;
+ width: auto;
+}
+
+div#pageTitle h1 {
+ margin: 0;
+ padding: 4px;
+ width: auto;
+ font-size: 16px;
+ max-height: 16px;
+ font-weight: normal;
+ text-align: left;
+ white-space: nowrap;
+ color: white;
+ font-weight: bold;
+}
+
+/*toolbar */
+div#toolbar{
+ border-bottom:1px solid lightgray;
+ height: 25px;
+ line-height: 25px;
+ padding-left: 4px;
+ width:100%;
+}
+
+div#toolbar .noButton {
+ display:hidden;
+}
+
+/*content div styling*/
+div#content h2 {
+ font-size:15px;
+ display:block;
+ margin:4px;
+}
+
+div