Skip to content
Browse files

Merge branch 'master' of github.com:rhomobile/webinar-samples

  • Loading branch information...
2 parents 1fd0ac8 + 7b78ef1 commit d9d6714ec81ca4f3598a4e6918b5cfc9a3c287ad Brian Moore committed Apr 13, 2012
Showing with 3,380 additions and 0 deletions.
  1. +28 −0 nfc-rhodes/Rakefile
  2. +39 −0 nfc-rhodes/app/Nfc/index.erb
  3. +10 −0 nfc-rhodes/app/Nfc/nfc.rb
  4. +91 −0 nfc-rhodes/app/Nfc/nfc_controller.rb
  5. +75 −0 nfc-rhodes/app/Settings/controller.rb
  6. +17 −0 nfc-rhodes/app/Settings/home.bb.erb
  7. +20 −0 nfc-rhodes/app/Settings/home.erb
  8. +32 −0 nfc-rhodes/app/Settings/index.bb.erb
  9. +30 −0 nfc-rhodes/app/Settings/index.erb
  10. +35 −0 nfc-rhodes/app/Settings/login.bb.erb
  11. +27 −0 nfc-rhodes/app/Settings/login.erb
  12. +15 −0 nfc-rhodes/app/Settings/reset.bb.erb
  13. +17 −0 nfc-rhodes/app/Settings/reset.erb
  14. +3 −0 nfc-rhodes/app/Settings/wait.bb.erb
  15. +5 −0 nfc-rhodes/app/Settings/wait.erb
  16. +25 −0 nfc-rhodes/app/application.rb
  17. +129 −0 nfc-rhodes/app/helpers/application_helper.rb
  18. +18 −0 nfc-rhodes/app/helpers/browser_helper.rb
  19. +26 −0 nfc-rhodes/app/index.bb.erb
  20. +26 −0 nfc-rhodes/app/index.erb
  21. +53 −0 nfc-rhodes/app/layout.erb
  22. +11 −0 nfc-rhodes/app/loading.html
  23. BIN nfc-rhodes/app/loading.png
  24. +7 −0 nfc-rhodes/app/test/nfc_spec.rb
  25. +25 −0 nfc-rhodes/build.yml
  26. BIN nfc-rhodes/icon/icon.ico
  27. BIN nfc-rhodes/icon/icon.png
  28. BIN nfc-rhodes/icon/icon114.png
  29. BIN nfc-rhodes/icon/icon57.png
  30. BIN nfc-rhodes/icon/icon72.png
  31. +331 −0 nfc-rhodes/public/css/android.css
  32. +115 −0 nfc-rhodes/public/css/blackberry.css
  33. +506 −0 nfc-rhodes/public/css/iphone.css
  34. +222 −0 nfc-rhodes/public/css/windows_mobile.css
  35. +21 −0 nfc-rhodes/public/images/IUI_LICENSE.txt
  36. BIN nfc-rhodes/public/images/android/btn_check_off.png
  37. BIN nfc-rhodes/public/images/android/btn_check_on.png
  38. BIN nfc-rhodes/public/images/android/btn_radio_off.png
  39. BIN nfc-rhodes/public/images/android/btn_radio_on.png
  40. BIN nfc-rhodes/public/images/android/disclosure.png
  41. BIN nfc-rhodes/public/images/android/ic_menu_more.png
  42. BIN nfc-rhodes/public/images/backButton.png
  43. BIN nfc-rhodes/public/images/blueButton.png
  44. BIN nfc-rhodes/public/images/cancel.png
  45. BIN nfc-rhodes/public/images/grayButton.png
  46. BIN nfc-rhodes/public/images/iphone/disclosure.png
  47. BIN nfc-rhodes/public/images/iphone/disclosure_detail.png
  48. BIN nfc-rhodes/public/images/iphone/jqtouch/backButton.png
  49. BIN nfc-rhodes/public/images/iphone/jqtouch/blueButton.png
  50. BIN nfc-rhodes/public/images/iphone/jqtouch/cancel.png
  51. BIN nfc-rhodes/public/images/iphone/jqtouch/chevron.png
  52. BIN nfc-rhodes/public/images/iphone/jqtouch/grayButton.png
  53. BIN nfc-rhodes/public/images/iphone/jqtouch/listArrowSel.png
  54. BIN nfc-rhodes/public/images/iphone/jqtouch/listGroup.png
  55. BIN nfc-rhodes/public/images/iphone/jqtouch/loading.gif
  56. BIN nfc-rhodes/public/images/iphone/jqtouch/on_off.png
  57. BIN nfc-rhodes/public/images/iphone/jqtouch/pinstripes.png
  58. BIN nfc-rhodes/public/images/iphone/jqtouch/selection.png
  59. BIN nfc-rhodes/public/images/iphone/jqtouch/thumb.png
  60. BIN nfc-rhodes/public/images/iphone/jqtouch/toggle.png
  61. BIN nfc-rhodes/public/images/iphone/jqtouch/toggleOn.png
  62. BIN nfc-rhodes/public/images/iphone/jqtouch/toolButton.png
  63. BIN nfc-rhodes/public/images/iphone/jqtouch/toolbar.png
  64. BIN nfc-rhodes/public/images/iphone/jqtouch/whiteButton.png
  65. BIN nfc-rhodes/public/images/iphone/radiobutton.png
  66. BIN nfc-rhodes/public/images/iphone/select.png
  67. BIN nfc-rhodes/public/images/iphone/switch.png
  68. BIN nfc-rhodes/public/images/iui-logo-touch-icon.png
  69. BIN nfc-rhodes/public/images/listArrow.png
  70. BIN nfc-rhodes/public/images/listArrowDown.png
  71. BIN nfc-rhodes/public/images/listArrowSel.png
  72. BIN nfc-rhodes/public/images/listGroup.png
  73. BIN nfc-rhodes/public/images/loading.gif
  74. BIN nfc-rhodes/public/images/pinstripes.png
  75. BIN nfc-rhodes/public/images/right_button.png
  76. BIN nfc-rhodes/public/images/selection.png
  77. BIN nfc-rhodes/public/images/thumb.png
  78. BIN nfc-rhodes/public/images/toggle.png
  79. BIN nfc-rhodes/public/images/toggleOn.png
  80. BIN nfc-rhodes/public/images/toolButton.png
  81. BIN nfc-rhodes/public/images/toolButton_new.png
  82. BIN nfc-rhodes/public/images/toolbar.png
  83. BIN nfc-rhodes/public/images/whiteButton.png
  84. +20 −0 nfc-rhodes/public/jqtouch/changes.txt
  85. +9 −0 nfc-rhodes/public/jqtouch/jqtouch-iphone.css
  86. +374 −0 nfc-rhodes/public/jqtouch/jqtouch.css
  87. +771 −0 nfc-rhodes/public/jqtouch/jqtouch.js
  88. +60 −0 nfc-rhodes/public/jqtouch/jqtouch.transitions.js
  89. +19 −0 nfc-rhodes/public/jqtouch/jquery.1.3.2.min.js
  90. +1 −0 nfc-rhodes/public/js/application.js
  91. +4 −0 nfc-rhodes/public/js/rho.js
  92. +59 −0 nfc-rhodes/public/js/rhogeolocation-wm.js
  93. +11 −0 nfc-rhodes/public/js/rhogeolocation.js
  94. +7 −0 nfc-rhodes/public/js/wp7.js
  95. +86 −0 nfc-rhodes/rhoconfig.txt
View
28 nfc-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
39 nfc-rhodes/app/Nfc/index.erb
@@ -0,0 +1,39 @@
+<script type="text/javascript">
+function setLog(log) {
+ document.getElementById("id_log").value = log;
+}
+
+function onLogClear() {
+ document.getElementById("id_log").value = "";
+}
+</script>
+
+<div class="pageTitle">
+ <h1>NFC Demo</h1>
+</div>
+
+<div class="content">
+ <% if @notice %>
+ <p style="color: red"><%= @notice %></p>
+ <% end %>
+ <ul>
+ <li>
+ NFC Enabled: <span class="title"><%= @nfc_status %></span>
+ </li>
+ <li>NFC Log:</li>
+ <input type="text" style="font-style: bold" id="id_log" value="" />
+ <input type="button" value="Clear" onClick="onLogClear();"/>
+ </ul>
+ <form method="POST" action="<%= url_for :action => :start_nfc_push %>">
+ <ul>
+ <li>
+ <label for="text" class="fieldLabel">Push Message</label>
+ <input type="text" name="push" value="Hello from NFC!"/>
+ </li>
+ </ul>
+ <input type="submit" class="standardButton" value="Start Message Push!"/>
+ </form>
+ <form method="POST" action="<%= url_for :action => :stop_nfc_push %>">
+ <input type="submit" class="standardButton" value="Stop Message Push!"/>
+ </form>
+</div>
View
10 nfc-rhodes/app/Nfc/nfc.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 Nfc
+ include Rhom::PropertyBag
+
+ # Uncomment the following line to enable sync with Nfc.
+ # enable :sync
+
+ #add model specifc code here
+end
View
91 nfc-rhodes/app/Nfc/nfc_controller.rb
@@ -0,0 +1,91 @@
+require 'rho/rhocontroller'
+require 'helpers/browser_helper'
+
+class NfcController < Rho::RhoController
+ include BrowserHelper
+
+ #GET /Nfc
+ def index
+ @nfc_status = Rho::NFCManager.is_enabled.to_s
+ render :back => '/app'
+ end
+
+ def start_nfc_push
+ puts "Sending #{@params['push'].inspect}..."
+ payload = Rho::NFCManager.make_payload_with_well_known_text("en", @params['push'])
+ hash = {
+ 'id' => [0],
+ 'type' => Rho::NdefRecord:: RTD_TEXT,
+ 'tnf' => Rho::NdefRecord::TNF_WELL_KNOWN,
+ 'payload' => payload
+ }
+ record = Rho::NFCManager.make_NdefRecord_from_hash(hash)
+ records = [record]
+ msg = Rho::NFCManager.make_NdefMessage_from_array_of_NdefRecord(records)
+
+ # start push message
+ Rho::NFCManager.p2p_enable_foreground_nde_push(msg)
+ @notice = "Started push."
+ render :action => :index
+ end
+
+ def stop_nfc_push
+ Rho::NFCManager.p2p_disable_foreground_nde_push
+ @notice = "Stopped push."
+ render :action => :index
+ end
+
+ def nfc_callback
+ if @params['messages'].size > 0 and @params['messages'][0]['records'].size > 0
+ @msg = @params['messages'][0]['records'][0]['payload_as_string']
+ else
+ @msg = "No payload"
+ end
+ Alert.show_popup( {
+ :message => @msg,
+ :title => "NFC P2P",
+ :buttons => ["Close"] }
+ )
+ end
+
+ def add_to_log(msg)
+ WebView.execute_js('setLog("'+msg+'");')
+ end
+
+ def test_ndef_read(tag)
+ result = "No records..."
+ ndef = tag.get_tech(Rho::NFCTagTechnology::NDEF)
+ if ndef != nil
+ ndef.connect
+ msg = ndef.read_NdefMessage
+ records = msg.get_records
+
+ puts "msg: #{msg.inspect}"
+ puts "records: #{records.inspect}"
+
+ r_a = []
+ records.each do |record|
+ r_a << record.make_hash
+ end
+
+ msg_hash = { 'records' => r_a }
+ puts "records after processing: #{msg_hash.inspect}"
+
+ result = "Tag Result: " + msg_hash['records'][0]['payload_as_string'] if msg_hash['records'].size > 0
+ ndef.close
+ end
+ result
+ end
+
+ def nfc_tech_callback
+ @msg = 'Tech received! Reading tag...'
+ add_to_log(@msg)
+ tag = Rho::NFCManager.get_current_Tag
+ if tag != nil
+ @msg = test_ndef_read(tag)
+ else
+ @msg = "Tag is nil!"
+ end
+ add_to_log(@msg)
+ end
+end
View
75 nfc-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 nfc-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 nfc-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 nfc-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 nfc-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 nfc-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 nfc-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 nfc-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 nfc-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="rightItem regularButton">
+ <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 nfc-rhodes/app/Settings/wait.bb.erb
@@ -0,0 +1,3 @@
+<div id="pageTitle">
+ <h1>Wait</h1>
+</div>
View
5 nfc-rhodes/app/Settings/wait.erb
@@ -0,0 +1,5 @@
+<div class="pageTitle">
+ <h1>Wait</h1>
+</div>
+
+<div class="toolbar"> </div>
View
25 nfc-rhodes/app/application.rb
@@ -0,0 +1,25 @@
+require 'rho/rhoapplication'
+require 'nfc'
+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
+ #To remove default toolbar uncomment next line:
+ #@@toolbar = 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
+
+ def on_activate_app
+ Rho::NFCManager.enable
+
+ Rho::NFCManager.set_nfc_callback("/app/Nfc/nfc_callback")
+ Rho::NFCManager.set_nfc_tech_callback("/app/Nfc/nfc_tech_callback")
+
+ Rho::NFCManager.perform_open_application_event
+ end
+end
View
129 nfc-rhodes/app/helpers/application_helper.rb
@@ -0,0 +1,129 @@
+
+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
+ tab_index = params[:tab_index]
+ tab_index = -1 if tab_index == nil
+ # TODO: escape carriage returns instead of removing them altoegether
+ content = render(params).split('\'').join('\\\'').split(/[\r\n]/).join('')
+ content = content.unpack("U*").collect {|s| (s > 127 ? "&##{s};" : s.chr) }.join("")
+ WebView.execute_js("Rho.insertAsyncPage('<div>#{content}</div>')", tab_index)
+ end
+
+ def caller_request_hash_to_query
+ require 'json'
+ '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 nfc-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 nfc-rhodes/app/index.bb.erb
@@ -0,0 +1,26 @@
+<div id="pageTitle">
+ <h1>NfcRhodes</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
26 nfc-rhodes/app/index.erb
@@ -0,0 +1,26 @@
+<div class="pageTitle">
+ <h1>NfcRhodes</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="#"><span class="title">Add link here...</span><span class="disclosure_indicator"/></a>
+ </li>
+ </ul>
+</div>
View
53 nfc-rhodes/app/layout.erb
@@ -0,0 +1,53 @@
+<!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>NfcRhodes</title>
+
+ <% is_bb6 = System::get_property('platform') == 'Blackberry' && (System::get_property('os_version') =~ /^6\.0/) %>
+
+ <% if is_bb6 %>
+ <meta name="viewport" content="width=device-width; height=device-height; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
+ <% else %>
+ <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
+ <% end %>
+
+ <% if System::get_property('platform') == 'APPLE' || System::get_property('platform') == 'ANDROID' || is_bb6 || System::get_property('webview') =~ /^WEBKIT/ %>
+ <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>jQT = $.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 is_bb6 %>
+ <link href="/public/css/android.css" type="text/css" rel="stylesheet"/>
+ <% elsif System::get_property('platform') == 'Blackberry' %>
+ <link href="/public/css/blackberry.css" type="text/css" rel="stylesheet"/>
+ <% elsif System::get_property('platform') == 'WP7' %>
+ <script src="/public/js/wp7.js" type="text/javascript"></script>
+ <link href="/public/css/windows_mobile.css" type="text/css" rel="stylesheet"/>
+ <% elsif System::get_property('webview') =~ /^WEBKIT/ %>
+ <link href="/public/css/android.css" type="text/css" rel="stylesheet"/>
+ <% else %>
+ <link href="/public/css/windows_mobile.css" type="text/css" rel="stylesheet"/>
+ <% end %>
+</head>
+
+<% if System::get_property('platform') == 'WP7' %>
+ <body onload="wp7_change_forms_action_to_get()">
+<% else %>
+ <body>
+<% end %>
+ <%= @content %>
+</body>
+
+</html>
View
11 nfc-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
BIN nfc-rhodes/app/loading.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
7 nfc-rhodes/app/test/nfc_spec.rb
@@ -0,0 +1,7 @@
+describe "Nfc" do
+ #this test always fails, you really should have tests!
+
+ it "should have tests" do
+ true.should == false
+ end
+end
View
25 nfc-rhodes/build.yml
@@ -0,0 +1,25 @@
+sdk: "/Users/lars/.rvm/gems/ruby-1.8.7-p334/gems/rhodes-3.0.1"
+sdkversion: 3.0.1
+name: nfc-rhodes
+version: 1.0
+vendor: rhomobile
+build: debug
+bbver: 4.6
+wmsdk: "Windows Mobile 6 Professional SDK (ARMV4I)"
+applog: rholog.txt
+iphone:
+ configuration: Debug
+ sdk: iphonesimulator4.3
+ provisionprofile:
+ codesignidentity:
+ entitlements:
+ BundleIdentifier: com.rhomobile.nfc_rhodes
+ BundleURLScheme: nfc_rhodes
+wp:
+ productid: '7f375a90-702a-012e-85bf-482a141043d9'
+android:
+ version: 2.3.3
+ extensions:
+ - nfc
+
+extensions: ["json", "another-extension"]
View
BIN nfc-rhodes/icon/icon.ico
Binary file not shown.
View
BIN nfc-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
BIN nfc-rhodes/icon/icon114.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN nfc-rhodes/icon/icon57.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN nfc-rhodes/icon/icon72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
331 nfc-rhodes/public/css/android.css
@@ -0,0 +1,331 @@
+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="number"],
+.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 nfc-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#content h2.groupTitle{
+ background:black;
+ height:14px;
+ font-size:10px;
+ padding:5px;
+ border-bottom:1px solid lightgray;
+}
+
+div#content div.alert{
+ color:red;
+}
+
+div#content div.warning{
+ margin-left:4px;
+}
+
+div#content p{
+ font-size:14px;
+}
+
+/* bb table styles */
+
+div#content table {
+ display:block;
+ border:none;
+ border-spacing:0;
+ font-size: 80%;
+ width:100%;
+}
+
+div#content table th {
+ width:100%;
+ display: block;
+ border-bottom:1px solid #BBBBBB;
+}
+
+div#content table tr {
+ width:100%;
+}
+div#content table tr td {
+ margin:0;
+ border-bottom:1px solid lightgray;
+ height: 25px;
+ line-height:25px;
+}
+
+div#content table tr td a {
+ text-decoration: none;
+ font-weight:bold;
+ color:black;
+ display:block;
+ overflow: hidden;
+}
+
+div#content table tr td.recordLabel {
+ width:100%;
+ padding: 5px;
+}
+
+div#content table tr td.itemLabel {
+ width:50%;
+ font-weight:bold;
+}
+
+div#content table tr td.itemValue {
+ width:50%;
+}
View
506 nfc-rhodes/public/css/iphone.css
@@ -0,0 +1,506 @@
+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;
+ font-family: Helvetica;
+}
+
+h1 {
+ font-size: 1.4em;
+}
+
+/* header */
+
+.pageTitle h1 {
+ position: absolute;
+ text-align: center;
+ width: 100%;
+ margin: 0 auto 0 auto;
+ line-height: 50px;
+ color: white;
+ text-shadow: 1px 1px 1px #000;
+}
+
+/* toolbar */
+
+.toolbar {
+ width: 100%;
+ height: 50px;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #aebbcb), color-stop(0.5, #8094ae), color-stop(1.0, #6e84a2));
+}
+
+.toolbar div {
+ position: absolute;
+ overflow: hidden;
+ text-align: center;
+}
+
+.toolbar .leftItem {
+ top: 10px;
+ left: 10px;
+ width: 50px;
+}
+
+.toolbar .centerItem {
+ bottom: 20px;
+ width: 100%;
+ margin-left: 10px;
+ height: 30px;
+}
+
+.toolbar .rightItem {
+ top: 10px;
+ right: 10px;
+ width: 50px;
+}
+
+.toolbar a {
+ color: white;
+ display: block;
+ line-height: 30px;
+}
+
+.toolbar .backButton {
+ -webkit-border-bottom-left-radius: 16px 16px;
+ -webkit-border-bottom-right-radius: 6px 6px;
+ -webkit-border-image: url(/public/images/backButton.png) 0 5 0 13 stretch stretch;
+ -webkit-border-top-left-radius: 16px 16px;
+ -webkit-border-top-right-radius: 6px 6px;
+ border-width: 0 5px 0 13px;
+ width: auto;
+ font-size: .9em;
+ z-index: 3;
+}
+
+.toolbar .deleteButton,
+.toolbar .regularButton,
+.toolbar .blueButton {
+ -webkit-border-radius: 5px;
+ overflow: hidden;
+ text-align: center;
+ width: auto;
+ height: 30px;
+ font-size: .9em;
+ border-left: #5e7088 1px solid;
+ border-right: #5e7088 1px solid;
+ border-top: #34404e 1px solid;
+ border-bottom: #34404e 1px solid;
+ padding: 0 2px 0 2px;
+}
+
+.toolbar .deleteButton {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #aebbcb), color-stop(0.5, #8094ae), color-stop(1.0, #6e84a2));
+}
+
+.toolbar .regularButton {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #92a4bc), color-stop(0.5, #476997), color-stop(1.0, #4e6c92));
+}
+
+.toolbar .blueButton {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #6f96e9), color-stop(0.5, #3366cc), color-stop(1.0, #3366cc));
+ border: #1a49b3 1px solid;
+}
+
+.content {
+ background: url('/public/images/pinstripes.png');
+ min-height: 480px;
+}
+
+.content form button.createButton {
+ position: absolute;
+ bottom: 20px;
+ height: 35px;
+}
+
+.content .standardButton {
+ -webkit-appearance: none;
+ -webkit-border-radius: 8px;
+ background: white;
+ color: #436395;
+ font-size: 15px;
+ font-weight: bold;
+ width: 100%;
+ height: 40px;
+ border: 1px solid black;
+ margin-top: 10px;
+}
+
+.content .standardButton a {
+ display: block;
+ width: 100%;
+ color: #436395;
+ text-align: center;
+ line-height: 40px;
+}
+
+/* text styles */
+
+.darkBlue {
+ color: #7287A4;
+}
+
+.content h2.groupTitle {
+ font-size: 16px;
+ margin: 8px;
+ color: #565E70;
+}
+
+/* lists */
+
+.content ul {
+ border-top: 1px solid #848284;
+ background-color: white;
+ margin-bottom: 50px;
+}
+
+.content ul li {
+ border-bottom: 1px solid #848284;
+ min-height: 40px;
+}
+
+.content ul li a {
+ display: block;
+ color: black;
+ font-size: 20px;
+ height: 100%;
+ width: 100%;
+ padding: 15px 0 15px 0;
+}
+
+.content ul li > span {
+ padding: 15px 0 15px 0;
+}
+
+.content ul li a:active {
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(5, 140, 245)), to(rgb(1, 95, 230)));
+}
+
+.content ul li span.title {
+ padding: 0 10px 0 10px;
+ font-size: 20px;
+ font-weight: bold;
+ display: inline;
+}
+
+.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;
+}
+
+.content ul li a span.disclosure_indicator {
+ background: url('/public/images/iphone/disclosure.png') no-repeat center right;
+ height: 25px;
+ width: 35px;
+ float: right;
+ margin-right: 10px;
+ display: inline;
+}
+
+.content ul li a span.detail_disclosure {
+ background: url('/public/images/iphone/disclosure_detail.png') no-repeat center right;
+ height: 27px;
+ width: 34px;
+ float: right;
+ margin-right: 10px;
+ display: inline;
+}
+
+.content ul li a img {
+ float: left;
+ height: 100%;
+ max-width: 100px;
+}
+
+/* Forms */
+
+.content form {
+ padding: 5px 0 75px 0;
+ border: none;
+ width: 300px;
+ margin: 0 auto;
+ font-size: medium;
+}
+
+.content form ul {
+ -webkit-border-radius: 8px;
+ background-color: white;
+ border: 1px solid #878787;
+ display: block;
+ font-size: 16px;
+ list-style-type: none;
+ margin: 0 auto 15px auto;
+ overflow: hidden;
+ padding: 0;
+}
+
+.content form ul li {
+ display: block;
+ border-bottom: 1px solid #848284;
+ line-height: 40px;
+ min-height: 40px;
+ width: 300px;
+ overflow: hidden;
+}
+
+.content form ul li:last-child {
+ border: none;
+}
+
+.content form ul li label {
+ float: left;
+ display: block;
+ color: black;
+ line-height: 40px;
+ padding: 0;
+ margin: 0 20px 0 10px;
+ width: 40%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-weight: bold;
+}
+
+.content form ul li label.fieldLabel {
+ display: none;
+}
+
+.content form input {
+ -webkit-appearance: none;
+ width: 45%;
+ border: 0;
+}
+
+.content form input, .content form select {
+ height: 40px;
+ font-size: medium;
+ font-weight: bold;
+}
+
+.content form input[type="text"], .content form input[type="password"] {
+ width: 289px;
+ background: transparent;
+ padding: 0 5px 0 10px;
+}
+
+.content form input[type="checkbox"] {
+ background: url('/public/images/iphone/switch.png') no-repeat center;
+ background-position-y: -27px;
+ float: right;
+ display: block;
+ margin: 7px 10px 7px 10px;
+ line-height: 40px;
+ height: 27px;
+ width: 94px;
+}
+
+.content form input[type="checkbox"]:checked {
+ background-position-y: 0;
+}
+
+.content form input[type="radio"] {
+ position: relative;
+ display: block;
+ width: 290px;
+ height: 40px;
+ line-height: 40px;
+ margin: 0;
+ -webkit-border-radius: 8px;
+}
+
+.content form input[type="radio"]:checked {
+ background: url('/public/images/iphone/radiobutton.png') no-repeat;
+ background-position-x: 100%;
+ background-position-y: 50%;
+}
+
+.content form select {
+ background: url('/public/images/iphone/select.png') no-repeat right;
+ border: 0px;
+ width: 100%;
+}
+
+.content form textarea {
+ -webkit-appearance: none;
+ border: none;
+ font-size: medium;
+ width: 280px;
+ line-height: 20px;
+}
+
+/* Settings */
+
+.content ul.settings {
+ padding: 0;
+ margin: 0;
+}
+
+.content ul.settings li.alertMessage {
+ text-align: center;
+}
+
+.content ul.settings li span {
+ line-height: 40px;
+}
+
+.content ul.settings li.alertMessage span.message {
+ color: red;
+}
+
+.content ul.settings li span.clientID {
+ margin-left: 4px;
+ font-size: 10px;
+}
+
+.content ul.settings li div.itemLabel span.title {
+ padding: 0;
+ margin: 0;
+}
+
+.content .reset {
+ height: 100%;
+ width: 300px;
+ padding: 10px;
+}
+
+.content .reset h4 {
+ width: 100%;
+ padding: 0;
+ margin: 0;
+ margin: 0 8px;
+ color: #565E70;
+}
+
+
+
+/* Override some styles provided by iphone.css to make them match the real iPhone more closely. */
+
+.toolbar {
+ background: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgb(176,188,205)), color-stop(0.5, rgb(136,155,179)), color-stop(0.51, rgb(129,149,175)), color-stop(1, rgb(109,132,162)));
+ border-top: 1px solid #CDD5Df;
+ border-bottom: 1px solid #2D3642;
+}
+
+.toolbar a { font-weight: bold; }
+
+.pageTitle { width: 50%; margin:0 auto; }
+
+.pageTitle h1 {
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0;
+ width: 50%; /* Should match pageTitle's width. */
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space:nowrap;
+}
+
+/* --- Controls the switcher buttons, trying to emulate the native switcher control. --- */
+
+/* Use the following pattern in your HTML code to implement it:
+
+ <div class="switcher">
+ <div class="ls-button ls-pressed ls-left"><a href="#">Left Button</a></div>
+ <div class="ls-button ls-center"><a href="#">Center Button</a></div>
+ <div class="ls-button ls-right ls-disabled"><a href="#">Right Button</a></div>
+ </div>
+
+ */
+
+/* Use on the div containing your button options. */
+.switcher {
+ text-align:center;
+ position:relative;
+ position:relative;
+ width:250px;
+ margin:0 auto;
+ padding-top:10px;
+ height:30px;
+}
+
+/* All button divs must contain an <a> tag with the button's label in it. */
+.switcher a {
+ color:#fff;
+ text-shadow: rgba(0,0,0,0.5) 0px -1px 0;
+ font-weight:bold;
+ font-size:smaller;
+}
+
+ /* Include the .ls-button style on each button div. */
+ .switcher .ls-button {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(171,185,202)), color-stop(0.5, rgb(130,151,175)), color-stop(0.51, rgb(118,139,167)), color-stop(1, rgb(120,141,169)));
+ width:80px; /* NOTE: If you only want to use 2 buttons, increase width to something more like 125px, and change margin to 0 -3px. */
+ height:15px;
+ display:inline-block;
+ padding-bottom:8px;
+ margin:0 -2px;
+ border:1px solid #000;
+ text-align:center;
+ }
+
+ /* Indicates the currently active (pressed) button. */
+ .switcher .ls-pressed {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(142,164,193)), color-stop(0.5, rgb(88,119,162)), color-stop(0.51, rgb(71,105,153)), color-stop(1, rgb(74,108,152)));
+ }
+
+ .switcher .ls-left {
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ }
+
+ .switcher .ls-center {
+ border-right:none;
+ border-left:none;
+ }
+
+ .switcher .ls-right {
+ -webkit-border-top-right-radius: 4px;
+ -webkit-border-bottom-right-radius: 4px;
+ }
+
+ /* If an option should not be available, you can use the .ls-disabled class to gray it out. */
+ .switcher .ls-disabled {
+ background:-webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(158,158,158)), color-stop(0.95, rgb(204,204,204)))
+ }
+
+ /* However, even with disabled classes you must still include an <a> tag. Just have it go href="#" */
+ .switcher .ls-disabled a {
+ color:#f0f0f0;
+ }
+
View
222 nfc-rhodes/public/css/windows_mobile.css
@@ -0,0 +1,222 @@
+body {
+ margin: 0;
+ width: 100%;
+ height: 100%;
+ font-family: tahoma;
+}
+
+/* page title */
+.pageTitle {
+ display: none;
+}
+
+/* toolbar */
+.toolbar {
+ width: 100%;
+ height: 30px;
+ background: black;
+ border-bottom: 1px solid gray;
+}
+
+.toolbar a {
+ text-decoration: none;
+ color: white;
+ font-weight: bold;
+}
+
+.toolbar .leftItem, .toolbar .rightItem {
+ margin-top: 6px;
+}
+
+.toolbar .leftItem {
+ float: left;
+ width: 40px;
+ margin-left: 5px;
+}
+
+.toolbar .rightItem {
+ float: right;
+ text-align: right;
+ width: 40px;
+ margin-right: 5px;
+}
+
+.toolbar .noButton {
+ display: none;
+}
+
+/* content */
+.content {
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ margin: 0;
+}
+
+.content h2.groupTitle {
+ width: inherit;
+ margin: 0;
+ padding: 4px;
+ margin: 0;
+ font-size: 10px;
+ color: white;
+ background-color: black;
+}
+
+/* Lists */
+.content ul {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+.content ul li {
+ list-style-type: none;
+ height: 30px;
+ width: 100%;
+ border-bottom: 1px solid black;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ clear: both;
+}
+
+.content ul li a span.title {
+ margin: 0 5px 0 5px;
+ padding: 0;
+ font-size: 12px;
+ font-weight: bold;
+ line-height: 30px;
+ height: 30px;
+ display: block;
+}
+
+.content ul li a {
+ text-decoration: none;
+ display: block;
+ color: black;
+ height: 30px;
+ line-height: 30px;
+}
+
+.content ul li a span.disclosure_indicator {
+ display: none;
+ height: 0;
+ visibility: hidden;
+}
+
+.content ul li div {
+ width: 45%;
+ line-height: 30px;
+ margin: 0 5px;
+}
+
+.content ul li div.itemLabel {
+ float: left;
+ font-weight: bold;
+}
+
+.content ul li div.itemValue {
+ float: right;
+ text-align: right;
+}
+
+/* Settings */
+
+.content ul.settings li {
+ height: 60px;
+}
+
+.content ul.settings li div {
+ line-height: 60px;
+ margin: 0;
+}
+
+.content ul.settings li span.clientID {
+ font-size: 60%;
+ float: right;
+ display: block;
+ height: 20px;
+}
+
+.content ul.settings li.alertMessage {
+ text-align: center;
+}
+
+.content ul.settings li.alertMessage span.message {
+ color: red;
+ line-height: 60px;
+}
+
+.content ul.settings li div.itemLabel span.title {
+ padding-top: 5px;
+}
+
+/* reset */
+.content .reset {
+ padding: 10px;
+}
+
+/* forms */
+.content form {
+ margin: 0;
+ padding: 0;
+}
+
+.content form h4 {
+ background-color: black;
+ color: white;
+ display: block;
+ padding: 5px;
+ margin: 0;
+}
+
+.content form ul {
+ margin: 0;
+ padding: 0;
+}
+
+.content form ul li {
+ height: 40px;
+}
+
+.content form ul li.textarea {
+ height: 110px;
+}
+
+.content form ul li label {
+ float: left;
+ margin: 10px 0 0 5px;
+ width: 40%;
+
+}
+
+.content form ul li input {
+ float: right;
+ margin: 10px 5px 0 0;
+ width: 40%;
+}
+
+.content form ul li input[type="checkbox"] {
+ float: right;
+ margin: 10px 10px 0 0;
+ width: 15px;
+}
+
+.content form ul li input[type="radio"] {
+ float: right;
+ margin: 10px 10px 0 0;
+ width: 15px;
+}
+
+.content form select,
+.content form textarea {
+ float: right;
+ margin: 10px;
+}
+
+.content form input[type="submit"] {
+ float: right;
+ width: 50px;
+ margin: 10px 10px 0 0;
+}
View
21 nfc-rhodes/public/images/IUI_LICENSE.txt
@@ -0,0 +1,21 @@
+Copyright (c) 2007, iUI Project Members
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the iUI Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
BIN nfc-rhodes/public/images/android/btn_check_off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN nfc-rhodes/public/images/android/btn_check_on.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN nfc-rhodes/public/images/android/btn_radio_off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN