]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | class GoogleReaderKeys extends Plugin { | |
3 | private $host; | |
4 | ||
5 | function about() { | |
6 | return array(1.0, | |
7 | "Keyboard hotkeys emulate Google Reader", | |
8 | "markwaters"); | |
9 | } | |
10 | ||
11 | function init($host) { | |
12 | $this->host = $host; | |
13 | ||
14 | $host->add_hook($host::HOOK_HOTKEY_MAP, $this); | |
15 | } | |
16 | ||
17 | function hook_hotkey_map($hotkeys) { | |
18 | ||
19 | $hotkeys["j"] = "next_article_noscroll"; | |
20 | $hotkeys["k"] = "prev_article_noscroll"; | |
21 | $hotkeys["*n"] = "next_feed"; | |
22 | $hotkeys["*p"] = "prev_feed"; | |
23 | $hotkeys["v"] = "open_in_new_window"; | |
24 | $hotkeys["r"] = "feed_refresh"; | |
25 | $hotkeys["m"] = "toggle_unread"; | |
26 | $hotkeys["o"] = "toggle_expand"; | |
27 | $hotkeys["(13)|enter"] = "toggle_expand"; | |
28 | $hotkeys["*(191)|?"] = "help_dialog"; | |
29 | $hotkeys["(32)|space"] = "next_article"; | |
30 | $hotkeys["(38)|up"] = "article_scroll_up"; | |
31 | $hotkeys["(40)|down"] = "article_scroll_down"; | |
32 | ||
33 | return $hotkeys; | |
34 | } | |
35 | ||
36 | function api_version() { | |
37 | return 2; | |
38 | } | |
39 | ||
40 | } | |
41 | ?> |