forked from chieffancypants/angular-hotkeys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
141 lines (119 loc) · 7.93 KB
/
index.html
File metadata and controls
141 lines (119 loc) · 7.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>AngularHotkeys.js | Keyboard shortcuts for your angular apps</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="angular hotkeys" />
<meta name="author" content="chieffancypants" />
<!-- libs -->
<!-- <script type="text/javascript" src="js/skrollr.min.js"></script> -->
<script type="text/javascript" src="js/highlight.pack.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Oxygen:400,700,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/monokai_sublime.css">
<!-- app -->
<script src="build/hotkeys.js"></script>
<script src="js/app.js"></script>
<link rel="stylesheet" href="build/hotkeys.css">
<link rel="stylesheet" href="css/app.css">
</head>
<body ng-app="example" ng-controller="ExampleCtrl">
<div class="intro">
<div class="author">
<div class="author-img"><a href="https://github.com/chieffancypants"><img src="http://www.gravatar.com/avatar/2904352cb2e80219e33cc5879c5f0bc9.png"/></a></div>
<div class="author-text">Made with <i class="glyphicon glyphicon-heart-empty"></i> by <a href="https://github.com/chieffancypants">chieffancypants</a></div>
</div>
<div class="icon"><i class="fa fa-keyboard-o"></i></div>
<h1>AngularHotkeys<span class="emphasis">.js</span></h1>
<span class="tagline">Configuration-centric keyboard shortcuts for your angular apps</span>
<div class="actions">
<a class="btn btn-outline btn-lg" href="https://github.com/chieffancypants/angular-hotkeys/archive/master.zip"><i class="fa fa-download"></i> Download Zip</a>
<a class="btn btn-outline btn-lg" href="https://github.com/chieffancypants/angular-hotkeys/"><i class="octicon octicon-mark-github"></i> View on GitHub</a>
</div>
<div class="scroll-down">
<a href="#features"><i class="glyphicon glyphicon-chevron-down"></i></a>
</div>
</div>
<div class="container">
<div class="features clearfix" id="features">
<div class="feature">
<i class="fa fa-road"></i>
<h2>Fully route-aware</h2>
<div>Automatically binds and unbinds keys as you navigate the app</div>
</div>
<div class="feature">
<i class="fa fa-cog"></i>
<h2>Configuration centric</h2>
<div>No messy DOM attributes to litter your templates</div>
</div>
<div class="feature">
<i class="fa fa-check-square-o"></i>
<h2>Automatic Help</h2>
<div>Creates a <a href ng-click="toggleHelp()">pretty cheat sheet</a> automatically</div>
</div>
</div>
<div class="section">
<h2>What is this?</h2>
<p>Put simply, <strong>managing shortcuts via the DOM is a nightmare</strong>:</p>
<pre><code><!-- player.html: -->
<div class="player" shortcut="{space: playPause, 'alt+right': forward30, 'ctrl+right': forward60, 'left': back30, 'ctrl+left': back60, up: volumeUp, down: volumeDown, 'ctrl+down': mute, 'ctrl+up': unmute, f: fullscreen, h: showHelp, m: muteToggle, right: nextChapter, left: previousChapter, c: toggleCaptions}">
<div class="playPause-btn"></div>
<div class="mute-btn"></div>
</div>
</code></pre>
<p>Your DOM is littered with attributes making it hard to read, and moreover, <strong>managing the shortcuts over dozens of templates is very tedious</strong>.</p>
</div>
<div class="section">
<h2>What makes this different?</h2>
<p>This project is quite a bit different from any other angular-based keyboard shortcut libraries. It is aimed at creating configurable shortcuts in javascript, instead of as directives in the DOM. While tying the shortcuts to DOM elements may work for some Angular apps, mine rarely have a 1-to-1 relationship between DOM elements and controller methods. In my case, many methods on the controller were only accessible through the keyboard.</p>
<p><a href="https://github.com/chieffancypants/angular-hotkeys#angular-hotkeys-">Read more</a></p>
</div>
<div class="section">
<h2>What about the cheat-sheet?</h2>
<p>Well, go ahead and try it. Hit the <span class="cfp-hotkeys-key">?</span> key. As you create shortcuts, they will appear automatically in the cheat-sheet when they are active. This means the cheat-sheet is route aware as well, and will only show shortcuts that work for the current application's state.</p>
</div>
<div class="section license">
<h2>License</h2>
<p>The MIT License (MIT)</p>
<p>Copyright (c) 2014 Wes Cruver</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</div>
</div>
<div class="section cta">
<!-- <h1>AngularHotkeys<span class="emphasis">.js</span></h1> -->
<div class="actions">
<a class="btn btn-outline btn-lg" href="https://github.com/chieffancypants/angular-hotkeys/archive/master.zip"><i class="fa fa-download"></i> Download Zip</a>
<a class="btn btn-outline btn-lg" href="https://github.com/chieffancypants/angular-hotkeys/"><i class="octicon octicon-mark-github"></i> View on GitHub</a>
</div>
<div class="author clearfix">
<div class="author-img"><a href="https://github.com/chieffancypants"><img src="http://www.gravatar.com/avatar/2904352cb2e80219e33cc5879c5f0bc9.png"/></a></div>
<div class="author-text">Made with <i class="glyphicon glyphicon-heart-empty"></i> by <a href="https://github.com/chieffancypants">chieffancypants</a></div>
</div>
</div>
<footer>
<iframe width="100" height="25" frameborder="0" src="http://ghbtns.com/github-btn.html?user=chieffancypants&repo=angular-hotkeys&type=watch&count=true&size=medium"></iframe>
<iframe width="210" height="25" frameborder="0" src="http://ghbtns.com/github-btn.html?user=chieffancypants&type=follow&count=true&size=medium"></iframe>
</footer>
<div class="hotkey-display fade" ng-class="{out: !keypressed, in: keypressed}">
<span ng-repeat="key in keypressed track by $index" class="cfp-hotkeys-key">{{ key }}</span>
</div>
<script type="text/javascript">
// var s = skrollr.init();
// skrollr.menu.init(s, {easing: 'outCubic'});
hljs.initHighlightingOnLoad();
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44146513-2', 'chieffancypants.github.io');
ga('send', 'pageview');
</script>
</body>
</html>