Created
March 6, 2012 02:20
-
-
Save elricstorm/1982942 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
span.title { | |
display: block; | |
text-align: center; | |
margin-top: 10px; | |
margin-bottom: 20px; | |
} | |
</style> | |
<div data-role="page" id="sitetips" data-title="Dialog Tips"> | |
<div data-role="header"> | |
<h1>Dialog Tips</h1> | |
<%= mobile_button_to('', '#home', :theme => 'a', :rel => 'external', :icon => 'back', :iconpos => 'notext', :class => 'ui-btn-right') %> | |
</div> | |
<div data-role="content"> | |
<span class="title">Are you sure?</span> | |
<%= mobile_button_to("Yes, I'm Sure!", '#home', :icon => 'check', :theme => 'b') %> | |
<%= mobile_button_to("No Way!", '#home', :theme => 'c', :rel => 'external', :mini => 'true') %> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MobileHelper | |
def mobile_button_to(name, url, options = {}) | |
return link_to "#{name}", "#{url}", | |
:'data-corners' => options[:corners], # default: true - if set false no rounded corners | |
:'data-role' => options[:role] || 'button', # Set the option to 'none' or keep a button | |
:'data-icon' => options[:icon], # Sets an icon attribute | |
:'data-iconpos' => options[:iconpos], # Set the icon position (right/top/bottom/notext) | |
:'data-iconshadow' => options[:iconshadow], # default: true - if set false, no shadow | |
:'data-mini' => options[:mini], # Sets whether data is compact (true) | |
:'data-inline' => options[:inline], # Sets whether buttons are inline | |
:'data-theme' => options[:theme], # Set the theme | |
:'data-shadow' => options[:shadow], # default: true | |
:'data-transition' => options[:transition], # Set the transition (slidedown) for example | |
:rel => options[:rel], # Set external to clear out the ajax hash | |
:class => options[:class], # Add a class (ui-btn-right) for example | |
:id => options[:id] # Add an ID (#some_id) for example | |
end | |
=begin | |
Icon Set | |
arrow-l => left arrow | |
arrow-r => right arrow | |
arrow-u => up arrow | |
arrow-d => down arrow | |
delete => delete icon | |
plus => plus icon | |
minus => minus icon | |
check => check mark | |
gear => gear icon | |
refresh => refresh icon | |
forward => forward icon | |
back => back icon | |
grid => table icon | |
star => star icon | |
alert => exclamation/triangle icon | |
info => (i) icon | |
home => house icon | |
search => magnifying glass icon | |
=end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment