forked from bry4n/backbone-shortcuts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
34 lines (33 loc) · 1.1 KB
/
example.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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>test</title>
<script type="text/javascript" src="https://raw.github.com/douglascrockford/JSON-js/master/json2.js"></script>
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script>
<script type="text/javascript" src="http://backbonejs.org/backbone-min.js"></script>
<script type="text/javascript" src="https://raw.github.com/madrobby/keymaster/master/keymaster.min.js"></script>
<script type="text/javascript" src="backbone.shortcuts.js"></script>
<script type="text/javascript" charset="utf-8">
var TestShortcuts;
TestShortcuts = Backbone.Shortcuts.extend({
shortcuts: {
"ctrl+r" : "reloadPage",
"t" : "test"
},
test: function() {
alert("test");
},
reloadPage: function() {
alert("reload!");
}
});
var shortcuts = new TestShortcuts
</script>
</head>
<body>
Backbone.Shortcuts!
<br />
Demo: press Ctrl+R now!
</body>
</html>