mousetrap-rails 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +3 -1
- data/README.md +3 -2
- data/app/assets/stylesheets/mousetrap.css.sass +1 -1
- data/lib/mousetrap-rails/version.rb +1 -1
- data/vendor/assets/javascripts/mousetrap.js +4 -2
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,7 @@ And then execute:
|
|
24
24
|
It will create sample `keybindings.js.coffee` file in `app/assets/javascripts` and insert mousetrap-rails files to manifests of assert pipeline
|
25
25
|
|
26
26
|
//= require mousetrap # ---> application.js
|
27
|
-
*= require
|
27
|
+
*= require mousetrap # ---> application.css
|
28
28
|
|
29
29
|
Voila!
|
30
30
|
|
@@ -42,7 +42,8 @@ Instead of `gem 'mousetrap-rails'` add to your Gemfile
|
|
42
42
|
You can add keyboard navigation to your links by using `data-keybinding` attribute.
|
43
43
|
|
44
44
|
```haml
|
45
|
-
= link_to 'Homepage', root_path, data: { keybinding: 'h' }
|
45
|
+
= link_to 'Homepage', root_path, data: { keybinding: 'h' } # Press 'h' to navigate to homepage
|
46
|
+
= link_to 'About', about_path, data: { keybinding: '["a", "c"]' } # Press 'a' or 'c' to navigate to about
|
46
47
|
```
|
47
48
|
|
48
49
|
You can jump to input
|
@@ -16,7 +16,7 @@
|
|
16
16
|
* Mousetrap is a simple keyboard shortcut library for Javascript with
|
17
17
|
* no external dependencies
|
18
18
|
*
|
19
|
-
* @version 1.1.
|
19
|
+
* @version 1.1.4
|
20
20
|
* @url craig.is/killing/mice
|
21
21
|
*/
|
22
22
|
(function() {
|
@@ -454,7 +454,9 @@
|
|
454
454
|
|
455
455
|
// normalize e.which for key events
|
456
456
|
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
|
457
|
-
|
457
|
+
if (typeof e.which !== 'number') {
|
458
|
+
e.which = e.keyCode;
|
459
|
+
}
|
458
460
|
|
459
461
|
var character = _characterFromEvent(e);
|
460
462
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mousetrap-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -175,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: '0'
|
176
176
|
segments:
|
177
177
|
- 0
|
178
|
-
hash:
|
178
|
+
hash: 942320878644081280
|
179
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
180
|
none: false
|
181
181
|
requirements:
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
segments:
|
186
186
|
- 0
|
187
|
-
hash:
|
187
|
+
hash: 942320878644081280
|
188
188
|
requirements: []
|
189
189
|
rubyforge_project:
|
190
190
|
rubygems_version: 1.8.24
|