Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
fix markdown in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpet committed Jun 12, 2011
1 parent e17c34b commit 7315695
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,4 @@
*~ *~
bender-min-dev.js bender-min-dev.js
_site _site
README.html
61 changes: 27 additions & 34 deletions README.markdown
Original file line number Original file line Diff line number Diff line change
@@ -1,48 +1,41 @@
Bender.js exists to simplify providing a mobile-friendly layout to users. Bender.js exists to simplify providing a mobile-friendly layout to users.


Features ##Features
========


- Entirely client side, suitable for use with a pure html site or pre-generated html from Jekyll or Movable Type. - Entirely client side, suitable for use with a pure html site or pre-generated html from Jekyll or Movable Type.
- Cookie persistence -- users can have different settings on different devices. - Cookie persistence -- users can have different settings on different devices.
- No redirects or url changes. - No redirects or url changes.
- User-switchable so you don't have to make a guess whether someone on an iPad wants the mobile or full screen version. - User-switchable so you don't have to make a guess whether someone on an iPad wants the mobile or full screen version.


Usage ##Usage
=====
###Create your stylesheets


Create your stylesheets
-----------------------
Create a shared stylesheet for rules that aren't dependent, and the stylesheets you intend to choose between. You can name these anything you want. For purposes of discussion: Create a shared stylesheet for rules that aren't dependent, and the stylesheets you intend to choose between. You can name these anything you want. For purposes of discussion:
# /css/shared.css
# /css/screen.css -- for normal users, the css "screen" media type
# /css/mobile.css -- for mobile users, can be installed as "mobile" media type as well


Install stylesheets * `/css/shared.css`
------------------- * `/css/screen.css` -- for normal users, the css "screen" media type
<pre> * `/css/mobile.css` -- for mobile users, can be installed as "mobile" media type as well
&lt;link rel="stylesheet" type="text/css" href="/css/shared.css"/&gt;
&lt;link rel="stylesheet" type="text/css" href="/css/screen.css" id="select-screen"/&gt; ###Install stylesheets
</pre>
<link rel="stylesheet" type="text/css" href="/css/shared.css"/>
<link rel="stylesheet" type="text/css" href="/css/screen.css" id="select-screen"/>


You can make this media-type-selective, and install mobile.css for the mobile media type. You want to allow the user to select the stylesheet configured for the screen media type, as this what computers and modern smartphones use. You can make this media-type-selective, and install mobile.css for the mobile media type. You want to allow the user to select the stylesheet configured for the screen media type, as this what computers and modern smartphones use.


Install scripts ###Install scripts
---------------
<pre> <script type="text/javascript" src="/js/jquery.min.js"></script>
&lt;script type="text/javascript" src="/js/jquery.min.js"&gt;&lt;/script&gt; <script type="text/javascript" src="/js/bender-min-0.0.1.js"></script>
&lt;script type="text/javascript" src="/js/bender-min-0.0.1.js"&gt;&lt;/script&gt;
</pre> ###Configure and install with javascript


Configure and install with javascript /* create a bender context */
------------------------------------- var bender = bender("bender-style")
<pre> /* add your user-selectable style sheets */
/* create a bender context */ bender.add("select-screen", "/css/screen.css")
var bender = bender("bender-style") /* passing the third parameter of "auto-mobile" will select it it matches known mobile user agents */
/* add your user-selectable style sheets */ bender.add("select-mobile", "/css/mobile.css", "auto-mobile")
bender.add("select-screen", "/css/screen.css") /* check cookies and autodetect mobile, and then bind the handlers on document load with jQuery */
/* passing the third parameter of "auto-mobile" will select it it matches known mobile user agents */ $(bender.install())
bender.add("select-mobile", "/css/mobile.css", "auto-mobile")
/* check cookies and autodetect mobile, and then bind the handlers on document load with jQuery */
$(bender.install())
</pre>

0 comments on commit 7315695

Please sign in to comment.