Permalink
Browse files

Added jqmobi store example

  • Loading branch information...
1 parent 75bb86a commit 1fd0ac8e72c8e2ac693f716eaa45873c80d68cb9 Brian Moore committed Apr 13, 2012
Showing with 37,986 additions and 0 deletions.
  1. +7 −0 MobiStore/.gitignore
  2. +17 −0 MobiStore/.project
  3. +37 −0 MobiStore/Rakefile
  4. +39 −0 MobiStore/app/Product/edit.bb.erb
  5. +38 −0 MobiStore/app/Product/edit.erb
  6. +21 −0 MobiStore/app/Product/index.bb.erb
  7. +22 −0 MobiStore/app/Product/index.erb
  8. +38 −0 MobiStore/app/Product/new.bb.erb
  9. +36 −0 MobiStore/app/Product/new.erb
  10. +10 −0 MobiStore/app/Product/product.rb
  11. +58 −0 MobiStore/app/Product/product_controller.rb
  12. +35 −0 MobiStore/app/Product/show.bb.erb
  13. +33 −0 MobiStore/app/Product/show.erb
  14. +76 −0 MobiStore/app/Settings/controller.rb
  15. +18 −0 MobiStore/app/Settings/home.bb.erb
  16. +19 −0 MobiStore/app/Settings/home.erb
  17. +31 −0 MobiStore/app/Settings/index.bb.erb
  18. +31 −0 MobiStore/app/Settings/index.erb
  19. +29 −0 MobiStore/app/Settings/login.bb.erb
  20. +25 −0 MobiStore/app/Settings/login.erb
  21. +16 −0 MobiStore/app/Settings/reset.bb.erb
  22. +14 −0 MobiStore/app/Settings/reset.erb
  23. +10 −0 MobiStore/app/Settings/wait.bb.erb
  24. +10 −0 MobiStore/app/Settings/wait.erb
  25. +16 −0 MobiStore/app/application.rb
  26. +129 −0 MobiStore/app/helpers/application_helper.rb
  27. +22 −0 MobiStore/app/helpers/browser_helper.rb
  28. +21 −0 MobiStore/app/index.bb.erb
  29. +4 −0 MobiStore/app/index.erb
  30. +73 −0 MobiStore/app/layout.erb
  31. +11 −0 MobiStore/app/loading.html
  32. BIN MobiStore/app/loading.png
  33. +7 −0 MobiStore/app/test/product_spec.rb
  34. +25 −0 MobiStore/build.yml
  35. BIN MobiStore/icon/icon.ico
  36. BIN MobiStore/icon/icon.png
  37. +5,334 −0 MobiStore/icon/icon.svg
  38. BIN MobiStore/icon/icon114.png
  39. BIN MobiStore/icon/icon57.png
  40. BIN MobiStore/icon/icon72.png
  41. +706 −0 MobiStore/public/css/android.css
  42. +140 −0 MobiStore/public/css/blackberry.css
  43. +870 −0 MobiStore/public/css/iphone.css
  44. +35 −0 MobiStore/public/css/jqmobile-patch.css
  45. +327 −0 MobiStore/public/css/windows_mobile.css
  46. +21 −0 MobiStore/public/images/IUI_LICENSE.txt
  47. BIN MobiStore/public/images/android/btn_check_off.png
  48. BIN MobiStore/public/images/android/btn_check_on.png
  49. BIN MobiStore/public/images/android/btn_radio_off.png
  50. BIN MobiStore/public/images/android/btn_radio_on.png
  51. BIN MobiStore/public/images/android/disclosure.png
  52. BIN MobiStore/public/images/android/ic_menu_more.png
  53. BIN MobiStore/public/images/backButton.png
  54. BIN MobiStore/public/images/blueButton.png
  55. BIN MobiStore/public/images/cancel.png
  56. BIN MobiStore/public/images/grayButton.png
  57. BIN MobiStore/public/images/iphone/disclosure.png
  58. BIN MobiStore/public/images/iphone/disclosure_detail.png
  59. BIN MobiStore/public/images/iphone/jqtouch/backButton.png
  60. BIN MobiStore/public/images/iphone/jqtouch/blueButton.png
  61. BIN MobiStore/public/images/iphone/jqtouch/cancel.png
  62. BIN MobiStore/public/images/iphone/jqtouch/chevron.png
  63. BIN MobiStore/public/images/iphone/jqtouch/grayButton.png
  64. BIN MobiStore/public/images/iphone/jqtouch/listArrowSel.png
  65. BIN MobiStore/public/images/iphone/jqtouch/listGroup.png
  66. BIN MobiStore/public/images/iphone/jqtouch/loading.gif
  67. BIN MobiStore/public/images/iphone/jqtouch/on_off.png
  68. BIN MobiStore/public/images/iphone/jqtouch/pinstripes.png
  69. BIN MobiStore/public/images/iphone/jqtouch/selection.png
  70. BIN MobiStore/public/images/iphone/jqtouch/thumb.png
  71. BIN MobiStore/public/images/iphone/jqtouch/toggle.png
  72. BIN MobiStore/public/images/iphone/jqtouch/toggleOn.png
  73. BIN MobiStore/public/images/iphone/jqtouch/toolButton.png
  74. BIN MobiStore/public/images/iphone/jqtouch/toolbar.png
  75. BIN MobiStore/public/images/iphone/jqtouch/whiteButton.png
  76. BIN MobiStore/public/images/iphone/radiobutton.png
  77. BIN MobiStore/public/images/iphone/select.png
  78. BIN MobiStore/public/images/iphone/switch.png
  79. BIN MobiStore/public/images/iui-logo-touch-icon.png
  80. BIN MobiStore/public/images/listArrow.png
  81. BIN MobiStore/public/images/listArrowDown.png
  82. BIN MobiStore/public/images/listArrowSel.png
  83. BIN MobiStore/public/images/listGroup.png
  84. BIN MobiStore/public/images/loading.gif
  85. BIN MobiStore/public/images/pinstripes.png
  86. BIN MobiStore/public/images/right_button.png
  87. BIN MobiStore/public/images/selection.png
  88. BIN MobiStore/public/images/thumb.png
  89. BIN MobiStore/public/images/toggle.png
  90. BIN MobiStore/public/images/toggleOn.png
  91. BIN MobiStore/public/images/toolButton.png
  92. BIN MobiStore/public/images/toolButton_new.png
  93. BIN MobiStore/public/images/toolbar.png
  94. BIN MobiStore/public/images/whiteButton.png
  95. +1,895 −0 MobiStore/public/jqmobi/jq.mobi.js
  96. +31 −0 MobiStore/public/jqmobi/jq.mobi.min.js
  97. +9 −0 MobiStore/public/jqmobi/kitchensink/external.html
  98. +78 −0 MobiStore/public/jqmobi/kitchensink/icons.css
  99. +68 −0 MobiStore/public/jqmobi/kitchensink/icons.svg
  100. BIN MobiStore/public/jqmobi/kitchensink/icons.ttf
  101. BIN MobiStore/public/jqmobi/kitchensink/images/Off-On_Slider.png
  102. BIN MobiStore/public/jqmobi/kitchensink/images/ajax-loader.png
  103. BIN MobiStore/public/jqmobi/kitchensink/images/badge.png
  104. BIN MobiStore/public/jqmobi/kitchensink/images/close.png
  105. BIN MobiStore/public/jqmobi/kitchensink/images/custom_inputs.png
  106. BIN MobiStore/public/jqmobi/kitchensink/images/horz_border.png
  107. BIN MobiStore/public/jqmobi/kitchensink/images/listGroup.png
  108. BIN MobiStore/public/jqmobi/kitchensink/images/splash.png
  109. BIN MobiStore/public/jqmobi/kitchensink/images/stripe_bg.png
  110. BIN MobiStore/public/jqmobi/kitchensink/images/vert_divider.png
  111. +1,011 −0 MobiStore/public/jqmobi/kitchensink/jq.ui.css
  112. +57 −0 MobiStore/public/jqmobi/plugins/css/jq.actionsheet.css
  113. +73 −0 MobiStore/public/jqmobi/plugins/css/jq.popup.css
  114. +10 −0 MobiStore/public/jqmobi/plugins/css/jq.scroller.css
  115. +35 −0 MobiStore/public/jqmobi/plugins/css/jq.selectBox.css
  116. +89 −0 MobiStore/public/jqmobi/plugins/jq.actionsheet.js
  117. +136 −0 MobiStore/public/jqmobi/plugins/jq.alphatable.js
  118. +415 −0 MobiStore/public/jqmobi/plugins/jq.carousel.js
  119. +142 −0 MobiStore/public/jqmobi/plugins/jq.css3animate.js
  120. +224 −0 MobiStore/public/jqmobi/plugins/jq.drawer.js
  121. +110 −0 MobiStore/public/jqmobi/plugins/jq.fx.js
  122. +45 −0 MobiStore/public/jqmobi/plugins/jq.passwordBox.js
  123. +182 −0 MobiStore/public/jqmobi/plugins/jq.popup.js
  124. +535 −0 MobiStore/public/jqmobi/plugins/jq.scroller.js
  125. +314 −0 MobiStore/public/jqmobi/plugins/jq.selectBox.js
  126. +39 −0 MobiStore/public/jqmobi/plugins/jq.shake.js
  127. +113 −0 MobiStore/public/jqmobi/plugins/jq.social.js
  128. +121 −0 MobiStore/public/jqmobi/plugins/jq.swipe.js
  129. +26 −0 MobiStore/public/jqmobi/plugins/jq.template.js
  130. +65 −0 MobiStore/public/jqmobi/plugins/jq.web.min.js
  131. +92 −0 MobiStore/public/jqmobi/touch.js
  132. +2,914 −0 MobiStore/public/jqmobi/ui/jq.ui.js
  133. +139 −0 MobiStore/public/jqmobi/ui/jq.ui.min.js
  134. +1,601 −0 MobiStore/public/jqmobi/ui/src/jq.ui.js
  135. +371 −0 MobiStore/public/jqmobi/ui/transitions/all.js
  136. +59 −0 MobiStore/public/jqmobi/ui/transitions/fade.js
  137. +68 −0 MobiStore/public/jqmobi/ui/transitions/flip.js
  138. +65 −0 MobiStore/public/jqmobi/ui/transitions/pop.js
  139. +59 −0 MobiStore/public/jqmobi/ui/transitions/slide.js
  140. +60 −0 MobiStore/public/jqmobi/ui/transitions/slideDown.js
  141. +60 −0 MobiStore/public/jqmobi/ui/transitions/slideUp.js
  142. BIN MobiStore/public/jqmobile/images/ajax-loader.png
  143. BIN MobiStore/public/jqmobile/images/icons-18-black.png
  144. BIN MobiStore/public/jqmobile/images/icons-18-white.png
  145. BIN MobiStore/public/jqmobile/images/icons-36-black.png
  146. BIN MobiStore/public/jqmobile/images/icons-36-white.png
  147. +9 −0 MobiStore/public/jqmobile/jquery-mobile-iphone.css
  148. +1,749 −0 MobiStore/public/jqmobile/jquery.mobile-1.0rc1.css
  149. +6,764 −0 MobiStore/public/jqmobile/jquery.mobile-1.0rc1.js
  150. +12 −0 MobiStore/public/jqmobile/jquery.mobile-1.0rc1.min.css
  151. +170 −0 MobiStore/public/jqmobile/jquery.mobile-1.0rc1.min.js
  152. +9,046 −0 MobiStore/public/jquery/jquery-1.6.4.js
  153. +4 −0 MobiStore/public/jquery/jquery-1.6.4.min.js
  154. +1 −0 MobiStore/public/js/application.js
  155. +344 −0 MobiStore/public/js/jqmobile-patch.js
  156. +4 −0 MobiStore/public/js/rho.js
  157. +59 −0 MobiStore/public/js/rhogeolocation-wm.js
  158. +11 −0 MobiStore/public/js/rhogeolocation.js
  159. +5 −0 MobiStore/public/js/wp7.js
  160. +86 −0 MobiStore/rhoconfig.txt
View
@@ -0,0 +1,7 @@
+# logs and symlinks
+rholog.txt
+rholog-*
+sim-*
+
+# build output
+bin/
View
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>MobiStore</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>rhogenwizard.builder.RhogenBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.rhomobile.rhostudio.rhogenNature</nature>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,37 @@
+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?
+ if $app_config["sdk"]
+ rakefilepath = "#{$app_config["sdk"]}/Rakefile"
+ else
+ begin
+ rakefilepath = `get-rhodes-info --rhodes-path`.chomp
+ rakefilepath = File.join(rakefilepath, "Rakefile")
+ rescue
+ rakefilepath = ""
+ end
+ end
+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
+
@@ -0,0 +1,39 @@
+<div data-role="page">
+
+ <div data-role="header" data-position="inline">
+ <%= link_to "Back", :action => :show, :id => @product.object %>
+ <h1>Edit <%= @product.name%></h1>
+ <%= link_to "Delete", :action => :delete, :id => @product.object %>
+ </div>
+
+ <div data-role="content">
+ <form method="POST" action="<%= url_for :action => :update %>">
+ <input type="hidden" name="id" value="<%= @product.object %>"/>
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name: </td>
+ <td class="itemValue"><input type="text" name="product[name]" value="<%= @product.name %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Brand: </td>
+ <td class="itemValue"><input type="text" name="product[brand]" value="<%= @product.brand %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Price: </td>
+ <td class="itemValue"><input type="text" name="product[price]" value="<%= @product.price %>"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Quantity: </td>
+ <td class="itemValue"><input type="text" name="product[quantity]" value="<%= @product.quantity %>"/></td>
+ </tr>
+
+ </table>
+ <input type="submit" value="Update"/>
+ </form>
+ </div>
+
+</div>
@@ -0,0 +1,38 @@
+
+
+ <header>
+ <h1>Edit <%= @product.name %></h1>
+ <a href="<%= url_for :action => :show, :id => @product.object %>" class="button" style="float:left;">
+ Cancel
+ </a>
+ <a href="<%= url_for :action => :delete, :id => @product.object %>" class="button" style="float:right;">
+ Delete
+ </a>
+ </header>
+
+ <form method="POST" action="<%= url_for :action => :update %>">
+ <input type="hidden" name="id" value="<%= @product.object %>"/>
+
+ <div>
+ <label for="product[name]" class="fieldLabel">Name</label>
+ <input class="jq-ui-forms" type="text" id="product[name]" name="product[name]" value="<%= @product.name %>" <%= placeholder( "Name" ) %> />
+ </div>
+
+ <div>
+ <label for="product[brand]" class="fieldLabel">Brand</label>
+ <input class="jq-ui-forms" type="text" id="product[brand]" name="product[brand]" value="<%= @product.brand %>" <%= placeholder( "Brand" ) %> />
+ </div>
+
+ <div>
+ <label for="product[price]" class="fieldLabel">Price</label>
+ <input class="jq-ui-forms" type="text" id="product[price]" name="product[price]" value="<%= @product.price %>" <%= placeholder( "Price" ) %> />
+ </div>
+
+ <div>
+ <label for="product[quantity]" class="fieldLabel">Quantity</label>
+ <input class="jq-ui-forms" type="text" id="product[quantity]" name="product[quantity]" value="<%= @product.quantity %>" <%= placeholder( "Quantity" ) %> />
+ </div>
+
+ <input type="submit" value="Update"/>
+ </form>
+
@@ -0,0 +1,21 @@
+<div data-role="page">
+
+ <div data-role="header" data-position="inline">
+ <%= link_to "New", :action => :new %>
+ <h1>Products</h1>
+ <%= link_to "Home", RhoConfig::start_path %>
+ </div>
+
+ <div data-role="content">
+ <table>
+ <tr>
+ <% @products.each do |obj| %>
+
+ <td class="recordLabel"><%= link_to "#{obj.name}", :action => :show, :id => obj.object %></td>
+
+ <% end %>
+ </tr>
+ </table>
+ </div>
+
+</div>
@@ -0,0 +1,22 @@
+ <header>
+ <h1>Products</h1>
+ <a href="<%= Rho::RhoConfig.start_path %>" class="button" style="float:left;">
+ Home
+ </a>
+ <a href="<%= url_for :action => :new %>" class="button" style="float:right;">
+ New
+ </a>
+ </header>
+
+ <ul>
+ <% @products.each do |product| %>
+
+ <li>
+ <a href="<%= url_for :action => :show, :id => product.object %>">
+ <%= product.name %>
+ </a>
+ </li>
+
+ <% end %>
+ </ul>
+
@@ -0,0 +1,38 @@
+<div data-role="page">
+
+ <div data-role="header" data-position="inline">
+ <%= link_to "Back", :action => :index %>
+ <h1>New Product</h1>
+ </div>
+
+ <div data-role="content">
+ <form method="POST" action="<%= url_for :action => :create %>">
+ <input type="hidden" name="id" value="<%= @product.object %>"/>
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name: </td>
+ <td class="itemValue"><input type="text" name="product[name]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Brand: </td>
+ <td class="itemValue"><input type="text" name="product[brand]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Price: </td>
+ <td class="itemValue"><input type="text" name="product[price]"/></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Quantity: </td>
+ <td class="itemValue"><input type="text" name="product[quantity]"/></td>
+ </tr>
+
+ </table>
+ <input type="submit" value="Create"/>
+ </form>
+ </div>
+
+</div>
@@ -0,0 +1,36 @@
+
+ <header>
+ <h1>New <%= @product.title %></h1>
+ <a href="<%= url_for :action => :index %>" class="button" style="float:left;">
+ Cancel
+ </a>
+ </header>
+
+ <form method="POST" action="<%= url_for :action => :create %>">
+ <input type="hidden" name="id" value="<%= @product.object %>"/>
+
+
+ <div>
+ <label for="product[name]" class="fieldLabel">Name</label>
+ <input class="jq-ui-forms" type="text" id="product[name]" name="product[name]" <%= placeholder("Name") %> />
+ </div>
+
+ <div>
+ <label for="product[brand]" class="fieldLabel">Brand</label>
+ <input class="jq-ui-forms" type="text" id="product[brand]" name="product[brand]" <%= placeholder("Brand") %> />
+ </div>
+
+ <div>
+ <label for="product[price]" class="fieldLabel">Price</label>
+ <input class="jq-ui-forms" type="text" id="product[price]" name="product[price]" <%= placeholder("Price") %> />
+ </div>
+
+ <div>
+ <label for="product[quantity]" class="fieldLabel">Quantity</label>
+ <input class="jq-ui-forms" type="text" id="product[quantity]" name="product[quantity]" <%= placeholder("Quantity") %> />
+ </div>
+
+
+ <input type="submit" value="Create"/>
+ </form>
+
@@ -0,0 +1,10 @@
+# The model has already been created by the framework, and extends Rhom::RhomObject
+# You can add more methods here
+class Product
+ include Rhom::PropertyBag
+
+ # Uncomment the following line to enable sync with Product.
+ # enable :sync
+
+ #add model specifc code here
+end
@@ -0,0 +1,58 @@
+require 'rho/rhocontroller'
+require 'helpers/browser_helper'
+
+class ProductController < Rho::RhoController
+ include BrowserHelper
+
+ # GET /Product
+ def index
+ @products = Product.find(:all)
+ render :back => '/app'
+ end
+
+ # GET /Product/{1}
+ def show
+ @product = Product.find(@params['id'])
+ if @product
+ render :action => :show, :back => url_for(:action => :index)
+ else
+ redirect :action => :index
+ end
+ end
+
+ # GET /Product/new
+ def new
+ @product = Product.new
+ render :action => :new, :back => url_for(:action => :index)
+ end
+
+ # GET /Product/{1}/edit
+ def edit
+ @product = Product.find(@params['id'])
+ if @product
+ render :action => :edit, :back => url_for(:action => :index)
+ else
+ redirect :action => :index
+ end
+ end
+
+ # POST /Product/create
+ def create
+ @product = Product.create(@params['product'])
+ redirect :action => :index
+ end
+
+ # POST /Product/{1}/update
+ def update
+ @product = Product.find(@params['id'])
+ @product.update_attributes(@params['product']) if @product
+ redirect :action => :index
+ end
+
+ # POST /Product/{1}/delete
+ def delete
+ @product = Product.find(@params['id'])
+ @product.destroy if @product
+ redirect :action => :index
+ end
+end
@@ -0,0 +1,35 @@
+<div data-role="page" data-add-back-btn="true">
+
+ <div data-role="header" data-position="inline">
+ <%= link_to "Back", :action => :index %>
+ <h1><%= @product.name %></h1>
+ <%= link_to "Edit", :action => :edit, :id => @product.object %>
+ </div>
+
+ <div data-role="content">
+ <table>
+
+ <tr>
+ <td class="itemLabel">Name</td>
+ <td class="itemValue"><%= @product.name%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Brand</td>
+ <td class="itemValue"><%= @product.brand%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Price</td>
+ <td class="itemValue"><%= @product.price%></td>
+ </tr>
+
+ <tr>
+ <td class="itemLabel">Quantity</td>
+ <td class="itemValue"><%= @product.quantity%></td>
+ </tr>
+
+ </table>
+ </div>
+
+</div>
Oops, something went wrong.

0 comments on commit 1fd0ac8

Please sign in to comment.