KEMBAR78
A Brief Introduction to JQuery Mobile | KEY
JQuery Mobile
Hi!
www.enlightsolutions.com
on the InterWeb




         dpickett
            on the
         Twitterz
OMG, That’s a lot of devices!
• Blackberry     == Horrible Java
• Android        == Tolerable Java
• IPhone         == Foreign Obj-C
• Windows Mobile == Sepaku!!!
• Blackberry     == Horrible Java
• Android        == Tolerable Java
• IPhone         == Foreign Obj-C
• Windows Mobile == Sepaku!!!
How’s about some Semantic
• Blackberry == Horrible Java
                       Web?

• Android == Tolerable Java
• IPhone == Completely foreign Obj-C
• Windows Mobile == Sepaku!!!
HTML5 Is Awesome
JQuery is Awesome
            I



   Happy Valentine’s Day
JQuery Mobile
   Awesome^2
mobile-fu
app/controllers/application_controller.rb
def set_mobile
  if request.format && request.format.html?
    session[:mobile_view] = true
  end

  if session[:mobile_view] == true
    request.format = :mobile
  end
end
mobile-fu
 app/controllers/application_controller.rb
def set_mobile
  if request.format && request.format.html?
    session[:mobile_view] = true
  end

  if session[:mobile_view] == true
    request.format = :mobile
  endhttps://github.com/brendanlim/mobile-fu
end
mobile-fu
  config/initializers/mime_types.rb




Mime::Type.register_alias "text/html", :mobile
app/views/layouts/application.mobile.erb
<%= stylesheet_link_tag("jquery.mobile.min.css", "mobile_frontend")
%>
<%= csrf_meta_tag %>

<%= javascript_include_tag "jquery-1.4.4.min.js" %>
<script type="text/javascript">
  $(document).bind("mobileinit", function(){
    $.extend( $.mobile , {
      ajaxLinksEnabled: false,
      ajaxFormsEnabled: false
    });
  });
</script>
<%= javascript_include_tag "jquery.mobile.min.js" %>
app/views/layouts/application.mobile.erb
<%= stylesheet_link_tag("jquery.mobile.min.css", "mobile_frontend")
%>
<%= csrf_meta_tag %>

<%= javascript_include_tag "jquery-1.4.4.min.js" %>
<script type="text/javascript">
  $(document).bind("mobileinit", function(){
    $.extend( $.mobile , {
      ajaxLinksEnabled: false,
      ajaxFormsEnabled: false
    });
  });
</script>
<%= javascript_include_tag "jquery.mobile.min.js" %>

      https://github.com/jquery/jquery-mobile
app/views/layouts/application.mobile.erb
<div data-role="page" id="page">
  <div data-role="header" data-backbtn="true" id="header">

    <h1>
      <%= image_tag "/images/css/textaurant-logo-small.png", :alt =>
"Textaurant" %>
      <%- if yield(:title).present? -%>
         <%= yield(:title) %>
      <%- end -%>
    </h1>

    <%= yield(:title_button) %>
  </div>

  <%= render :partial => "shared/flashes" %>

  <div data-role="content">
    <%= yield %>
  </div>
</div>
app/views/restaurants/index.mobile.erb
<%= content_for :title do -%>
  <h1>Restaurants</h1>
<%- end -%>

<ul data-role="listview">
  <li data-role="list-divider">
    Please select a restaurant
  </li>
  <%- @locations.each do |i| -%>
    <li class="arrow">
     <%= link_to i.name, new_restaurant_visit_path(i) %>
   </li>
  <%- end -%>
</ul>
JQueryMobile Is
         Awesome
• Built on web standards
• Built by a talented and capable team
• It’s JQuery-based
• It’s not having to learn 5 different
  frameworks and languages
Currently In Alpha
JQuery Mobile is Young

• Heavy footprint
• No final API for customization
• Limited theme extensibility
For App Store Love
For App Store Love




https://github.com/phonegap/phonegap
Thanks!

A Brief Introduction to JQuery Mobile