forked from stringer-rss/stringer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstories.js.erb
More file actions
43 lines (34 loc) · 980 Bytes
/
stories.js.erb
File metadata and controls
43 lines (34 loc) · 980 Bytes
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
<%= render_js_template :story %>
<script type="text/javascript">
$(document).ready(function() {
var Stories = new StoryList;
var StoryApp = new AppView(Stories);
StoryApp.loadData(<%= stories.to_json %>);
Mousetrap.bind("j", function() {
StoryApp.moveCursorDown();
StoryApp.openCurrentSelection();
});
Mousetrap.bind("k", function() {
StoryApp.moveCursorUp();
StoryApp.openCurrentSelection();
});
Mousetrap.bind("n", function() {
StoryApp.moveCursorDown();
});
Mousetrap.bind("p", function() {
StoryApp.moveCursorUp();
});
Mousetrap.bind(["o", "enter"], function() {
StoryApp.toggleCurrent();
});
Mousetrap.bind(["b", "v"], function() {
StoryApp.viewCurrentInTab();
});
Mousetrap.bind(["m"], function() {
StoryApp.toggleCurrentKeepUnread();
});
Mousetrap.bind(["s"], function() {
StoryApp.toggleCurrentStarred();
});
});
</script>