-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
206 lines (191 loc) · 6.67 KB
/
index.html
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>jquery-keycombinator - easy user-defined keycombos!</title>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<!-- <link rel="stylesheet" href="twitter-bootstrap/docs/assets/css/bootstrap.css"> -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.keycombinator.js"></script>
<link href="prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify/prettify.js"></script>
<style type="text/css">
.container-fluid {
padding: 20px;
}
/* h1 { */
/* margin-bottom: 10px; */
/* } */
/* h6 { */
/* display: inline; */
/* } */
.combo-pane {
margin: 10px 0;
}
.right-box {
margin-left: 5px;
}
button {
cursor: auto;
}
#output1, #output2 {
height: 400px;
max-height: 400px;
}
pre.prettyprint {
border-color: whiteSmoke;
padding: 10px;
overflow: auto;
word-wrap: normal;
white-space: pre;
}
</style>
<script type="text/javascript">
function outputPrint(obj){
$('#output').val($('#output').val() + JSON.stringify(obj, null, 2) + '\n\n');
}
function outputReplace(obj){
$('#output').html(JSON.stringify(obj, null, 2) + '\n\n');
}
$(document).ready(function(){
$('#keyComboInput1').makeKeyCombinator({
onComplete: function(keyComboData){
$('#output1').html(JSON.stringify(keyComboData, null, 2) + '\n\n');
}
});
$('#keyComboInput2').makeKeyCombinator({
defaultCombos: {
mac: ['⌃', '⇧', 'F'],
win: ['Ctrl', 'Shift', 'F'],
unix: ['Ctrl', 'Shift', 'F']
},
onComplete: function(keyComboData){
$('#output2').html(JSON.stringify(keyComboData, null, 2) + '\n\n');
}
});
$('#clearBtn').click(function(){
$('#keyComboInput2').clearKeyCombinator();
});
$('#resetBtn').click(function(){
$('#keyComboInput2').defaultKeyCombinator();
});
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-15655792-5']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body onload="prettyPrint()">
<div class='container-fluid'>
<div class="row-fluid">
<div class="span12">
<div class="hero-unit">
<h1>jquery.keycombinator</h1>
<p>
jquery.keycombinator is a do-it-all plugin to let your <em>users</em> define keyboard shortcuts. Simply slap it onto an input box and it will detect any entered key combinations and provide detailed data in a callback function, with OS-specific key symbols. You can then pass that data on to key handler plugins such as <a href="http://keithcirkel.co.uk/jwerty/">jwerty</a>. Try it out!
</p>
<p>
<a href="https://github.com/suan/jquery-keycombinator/zipball/master"
class="btn btn-primary btn-large">
Download (.zip)
</a> |
<a href="https://github.com/suan/jquery-keycombinator/tarball/master"
class="btn btn-primary btn-large">
Download (.tar.gz)
</a> |
<a href="https://github.com/suan/jquery-keycombinator"
class="btn btn-primary btn-large">
View Docs and Code on Github
</a> |
<a href="http://suanaikyeo.com">Author's homepage</a>
</p>
<div>
<!-- PayPal Donate -->
<form style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="SECWMGZDWMZEU">
<input type="image" style="margin-top:-13px;" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<!-- Twitter -->
<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h2>Basic Usage</h2>
<div class="combo-pane">
Enter a key combination
<input type="text" name="keycombo" id="keyComboInput1" class="right-box"/>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<h3>Output</h3>
<pre class="prettyprint pre-scrollable" id="output1"></pre>
</div>
<div class="span6" style="vertical-align:center;">
<h3>Source</h3>
<pre class="prettyprint">
$('#keyComboInput1').makeKeyCombinator({
onComplete: function(keyComboData){
$('#output1').html(JSON.stringify(keyComboData, null, 2));
}
});
</pre>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h2>With "clear" and "reset to default" functionality</h2>
<div class="combo-pane">
Enter a key combination
<input type="text" name="keycombo" id="keyComboInput2" class="right-box"/>
<span class="right-box">
<button id="clearBtn">Clear</button>
<button id="resetBtn">Reset to Default</button>
</span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<h3>Output</h3>
<pre class="prettyprint pre-scrollable" id="output2"></pre>
</div>
<div class="span6" style="vertical-align:center;">
<h3>Source</h3>
<pre class="prettyprint">
$('#keyComboInput2').makeKeyCombinator({
defaultCombos: {
mac: ['⌃', '⇧', 'F'],
win: ['Ctrl', 'Shift', 'F'],
unix: ['Ctrl', 'Shift', 'F']
},
onComplete: function(keyComboData){
$('#output2').html(JSON.stringify(keyComboData, null, 2));
}
});
$('#clearBtn').click(function(){
$('#keyComboInput2').clearKeyCombinator();
});
$('#resetBtn').click(function(){
$('#keyComboInput2').defaultKeyCombinator();
});
</pre>
</div>
</div>
</div>
</body>
</html>