Skip to content

a jQuery plugin for taking a list of links and giving each a hot key for easy keyboard navigation.

License

Notifications You must be signed in to change notification settings

TheDudeWithTheThing/charbroil.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

charbroil.js

Hot keys? Nope! We're broiling chars. Charbroil takes an element, finds all links inside of it and tries to be smart about which character from the link to make into the hot key (or broiled char).

Also I make no effort to hide the fact that I ripped off a ton of stuff from Joel Oliveira's chaves.js. Mostly the jasmine tests, project skeleton and only 90% of this README. THX 2 U!

Features

  • Easy hot key making
  • Control how the hot key looks via a css class
  • Define explicit keys per link with data attributes

Demo

http://thedudewiththething.github.com/charbroil.js/

Setup

The dependencies are jQuery (of course) and Thomas Fuch's Keymaster. Make sure they're loaded before you get down to business.

    <ul id="category_list">
      <li><a href="#apples">apples</a></li>
      <li><a href="#bananas">bananas</a></li>
      <li><a href="#cherries">cherries</a></li>
      <li><a href="#dates">dates</a></li>
      <li><a href="#figs">figs</a></li>
      <li><a href="#grapes">grapes</a></li>
      <li><a href="#honeydew_melon">honeydew melon</a></li>
    </ul>

    <script src="/javascript/jquery-1.7.2.js"></script>
    <script src="/javascript/keymaster.js"></script>
    <script src="/javascript/jquery.charbroil.js"></script>
    <script>
      $('#category_list').charbroil();
    </script>

Running Tests

I'm using Canary as my browser on a Mac for testing and I've set up the following alias for easy file loading / testing.

alias canary='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --allow-file-access-from-files'

and then

  canary SpecRunner.html

Thanks!

Changelog

  • 0.4.0 - got some docs now and improved performance with element caching and reduced number of loops
  • 0.3.0 - adds ability to add charbroil-key attribute to a tag to override "smart" selecting. Selecting is smarter now too!
  • 0.2.0 - I forget
  • 0.1.0 - Initial push

For The Future

  • Even smarter selecting of broiled char.

License

Charbroil.js

keymaster

About

a jQuery plugin for taking a list of links and giving each a hot key for easy keyboard navigation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published