Navigation Menu

Skip to content

Commit

Permalink
Create gh-pages branch via GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
kugaevsky committed Sep 23, 2012
1 parent 1f1c647 commit 7b85a92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion index.html
Expand Up @@ -46,7 +46,7 @@ <h2>Rails gem for handling keyboard shortcuts via mousetrap javascript library</


<section id="main_content">
<h1>Mousetrap::Rails <a href="http://coderwall.com/kugaevsky"><img src="http://api.coderwall.com/kugaevsky/endorsecount.png" alt="endorse"></a>
<h1>Mousetrap::Rails <a href="http://coderwall.com/kugaevsky"><img src="http://api.coderwall.com/kugaevsky/endorsecount.png" alt="endorse"></a> <a href="http://travis-ci.org/kugaevsky/mousetrap-rails"><img src="https://secure.travis-ci.org/kugaevsky/mousetrap-rails.png" alt="Build Status"></a> <a href="https://gemnasium.com/kugaevsky/mousetrap-rails"><img src="https://gemnasium.com/kugaevsky/mousetrap-rails.png" alt="Dependency Status"></a> <a href="https://codeclimate.com/github/kugaevsky/mousetrap-rails"><img src="https://codeclimate.com/badge.png" alt="Code Climate"></a>
</h1>

<p><a href="https://github.com/ccampbell/mousetrap">Mousetrap</a> is a javascript library for handling keyboard shortcuts in your web applications written by <a href="http://craig.is/">Craig Campbell</a>.</p>
Expand Down Expand Up @@ -129,6 +129,14 @@ <h3>More examples (from official guide)</h3>

<p>You can find full documentation on <a href="http://craig.is/killing/mice">Mousetrap library page</a>. Really, look there – there are plenty examples of using this awesome library.</p>

<h2>Changelog</h2>

<p>All changes could be found in <a href="https://github.com/kugaevsky/mousetrap-rails/blob/master/CHANGELOG.md">CHANGELOG.md</a></p>

<h2>License</h2>

<p>Gosh! It's <a href="https://github.com/kugaevsky/mousetrap-rails/blob/master/LICENSE.md">here</a>.</p>

<h2>Authors</h2>

<ul>
Expand Down
2 changes: 1 addition & 1 deletion params.json
@@ -1 +1 @@
{"name":"Mousetrap-rails","body":"# Mousetrap::Rails [![endorse](http://api.coderwall.com/kugaevsky/endorsecount.png)](http://coderwall.com/kugaevsky)\r\n\r\n[Mousetrap](https://github.com/ccampbell/mousetrap) is a javascript library for handling keyboard shortcuts in your web applications written by [Craig Campbell](http://craig.is/).\r\n\r\nThe `mousetrap-rails` gem integrates Mousetrap javascript library with Rails Asset Pipeline.\r\n\r\n\r\n## Installation\r\n\r\n### Add mousetrap-rails gem to app\r\n\r\nAdd this line to your application's Gemfile:\r\n\r\n gem 'mousetrap-rails'\r\n\r\nAnd then execute:\r\n\r\n $ bundle install\r\n\r\n### Run generator\r\n\r\n $ rails generate mousetrap:install\r\n\r\nIt will create sample `keybindings.js.coffee` file in `app/assets/javascripts` and add `//= require mousetrap` to `application.js` manifest.\r\n\r\nVoila!\r\n\r\n### Latest (may be unstable) version\r\n\r\nInstead of `gem 'mousetrap-rails'` add to your Gemfile\r\n\r\n gem 'mousetrap-rails', git: 'git://github.com/kugaevsky/mousetrap-rails.git'\r\n\r\n\r\n## Usage\r\n\r\n### Via data-attributes\r\n\r\nYou can add keyboard navigation to your links by using `data-keybinding` attribute.\r\n\r\n```haml\r\n= link_to 'Homepage', root_path, data: { keybinding: 'h' } # Press 'h' to navigate to homepage\r\n```\r\n\r\nYou can jump to input\r\n\r\n```haml\r\n= text_field_tag 'Username', nil, data: { keybinding: 'u' } # Press 'u' to focus username input field\r\n```\r\n\r\n### Via javascript\r\n\r\nAny javascript function can be called with mousetrap\r\n\r\n```coffeescript\r\nMousetrap.bind 'f', (e) -> alert 'My perfect function called' # Press 'f' to popup alert\r\n```\r\n\r\n### More examples (from official guide)\r\n\r\n```coffeescript\r\n# single keys\r\nMousetrap.bind '4', -> alert '4 pressed!'\r\nMousetrap.bind 'x', (-> alert 'x pressed!'), 'keyup'\r\n\r\n# combinations\r\nMousetrap.bind 'command+shift+k', ->\r\n alert 'command+shift+k pressed!'\r\n false\r\n\r\nMousetrap.bind ['command+k', 'ctrl+k'], ->\r\n alert 'command+k or ctrl+k pressed!'\r\n false\r\n\r\n# gmail style sequences\r\nMousetrap.bind 'g i', -> console.log 'g i sequence pressed!'\r\nMousetrap.bind '* a', -> console.log '* a sequence pressed!'\r\n\r\n# konami code!\r\nMousetrap.bind 'up up down down left right left right b a enter', -> console.log 'You WIN!'\r\n```\r\n\r\nYou can find full documentation on [Mousetrap library page](http://craig.is/killing/mice). Really, look there – there are plenty examples of using this awesome library.\r\n\r\n\r\n## Authors\r\n\r\n* mousetrap-rails gem by [Nick Kugaevsky](http://kugaevsky.ru)\r\n* original mousetrap library by [Craig Campbell](http://craig.is/)\r\n","tagline":"Rails gem for handling keyboard shortcuts via mousetrap javascript library","note":"Don't delete this file! It's used internally to help with page regeneration.","google":"UA-2540348-19"}
{"note":"Don't delete this file! It's used internally to help with page regeneration.","tagline":"Rails gem for handling keyboard shortcuts via mousetrap javascript library","name":"Mousetrap-rails","body":"# Mousetrap::Rails [![endorse](http://api.coderwall.com/kugaevsky/endorsecount.png)](http://coderwall.com/kugaevsky) [![Build Status](https://secure.travis-ci.org/kugaevsky/mousetrap-rails.png)](http://travis-ci.org/kugaevsky/mousetrap-rails) [![Dependency Status](https://gemnasium.com/kugaevsky/mousetrap-rails.png)](https://gemnasium.com/kugaevsky/mousetrap-rails) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/kugaevsky/mousetrap-rails)\r\n\r\n[Mousetrap](https://github.com/ccampbell/mousetrap) is a javascript library for handling keyboard shortcuts in your web applications written by [Craig Campbell](http://craig.is/).\r\n\r\nThe `mousetrap-rails` gem integrates Mousetrap javascript library with Rails Asset Pipeline.\r\n\r\n\r\n## Installation\r\n\r\n### Add mousetrap-rails gem to app\r\n\r\nAdd this line to your application's Gemfile:\r\n\r\n gem 'mousetrap-rails'\r\n\r\nAnd then execute:\r\n\r\n $ bundle install\r\n\r\n### Run generator\r\n\r\n $ rails generate mousetrap:install\r\n\r\nIt will create sample `keybindings.js.coffee` file in `app/assets/javascripts` and add `//= require mousetrap` to `application.js` manifest.\r\n\r\nVoila!\r\n\r\n### Latest (may be unstable) version\r\n\r\nInstead of `gem 'mousetrap-rails'` add to your Gemfile\r\n\r\n gem 'mousetrap-rails', git: 'git://github.com/kugaevsky/mousetrap-rails.git'\r\n\r\n\r\n## Usage\r\n\r\n### Via data-attributes\r\n\r\nYou can add keyboard navigation to your links by using `data-keybinding` attribute.\r\n\r\n```haml\r\n= link_to 'Homepage', root_path, data: { keybinding: 'h' } # Press 'h' to navigate to homepage\r\n```\r\n\r\nYou can jump to input\r\n\r\n```haml\r\n= text_field_tag 'Username', nil, data: { keybinding: 'u' } # Press 'u' to focus username input field\r\n```\r\n\r\n### Via javascript\r\n\r\nAny javascript function can be called with mousetrap\r\n\r\n```coffeescript\r\nMousetrap.bind 'f', (e) -> alert 'My perfect function called' # Press 'f' to popup alert\r\n```\r\n\r\n### More examples (from official guide)\r\n\r\n```coffeescript\r\n# single keys\r\nMousetrap.bind '4', -> alert '4 pressed!'\r\nMousetrap.bind 'x', (-> alert 'x pressed!'), 'keyup'\r\n\r\n# combinations\r\nMousetrap.bind 'command+shift+k', ->\r\n alert 'command+shift+k pressed!'\r\n false\r\n\r\nMousetrap.bind ['command+k', 'ctrl+k'], ->\r\n alert 'command+k or ctrl+k pressed!'\r\n false\r\n\r\n# gmail style sequences\r\nMousetrap.bind 'g i', -> console.log 'g i sequence pressed!'\r\nMousetrap.bind '* a', -> console.log '* a sequence pressed!'\r\n\r\n# konami code!\r\nMousetrap.bind 'up up down down left right left right b a enter', -> console.log 'You WIN!'\r\n```\r\n\r\nYou can find full documentation on [Mousetrap library page](http://craig.is/killing/mice). Really, look there – there are plenty examples of using this awesome library.\r\n\r\n\r\n## Changelog\r\n\r\nAll changes could be found in [CHANGELOG.md](https://github.com/kugaevsky/mousetrap-rails/blob/master/CHANGELOG.md)\r\n\r\n\r\n## License\r\n\r\nGosh! It's [here](https://github.com/kugaevsky/mousetrap-rails/blob/master/LICENSE.md).\r\n\r\n\r\n## Authors\r\n\r\n* mousetrap-rails gem by [Nick Kugaevsky](http://kugaevsky.ru)\r\n* original mousetrap library by [Craig Campbell](http://craig.is/)\r\n","google":"UA-2540348-19"}

0 comments on commit 7b85a92

Please sign in to comment.