-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"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.","name":"Mousetrap-rails","google":"UA-2540348-19","body":"# Mousetrap::Rails [![endorse](http://api.coderwall.com/kugaevsky/endorsecount.png)](http://coderwall.com/kugaevsky) \r\n\r\n[![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 insert mousetrap-rails files to manifests of assert pipeline\r\n\r\n //= require mousetrap # ---> application.js\r\n *= require mousetrap # ---> application.css\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= link_to 'About', about_path, data: { keybinding: '[\"a\", \"c\"]' } # Press 'a' or 'c' to navigate to about\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### Key binding hints (experimental)\r\n\r\nYou can display key binding hints near links with `data-keybinding` attribute by pressing `Alt+Shift+h`. Now it's just experimental feature for debugging purposes only.\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"} | ||
{"tagline":"Rails gem for handling keyboard shortcuts via mousetrap javascript library","google":"UA-2540348-19","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Mousetrap-rails","body":"# Mousetrap::Rails [![endorse](http://api.coderwall.com/kugaevsky/endorsecount.png)](http://coderwall.com/kugaevsky) \r\n\r\n[![Build Status](https://secure.travis-ci.org/kugaevsky/mousetrap-rails.png?branch=master)](https://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 insert mousetrap-rails files to manifests of assert pipeline\r\n\r\n //= require mousetrap # ---> application.js\r\n *= require mousetrap # ---> application.css\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= link_to 'About', about_path, data: { keybinding: '[\"a\", \"c\"]' } # Press 'a' or 'c' to navigate to about\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### Key binding hints (experimental)\r\n\r\nYou can display key binding hints near links with `data-keybinding` attribute by pressing `Alt+Shift+h`. Now it's just experimental feature for debugging purposes only.\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"} |