diff options
author | Andrew Dolgov <[email protected]> | 2021-05-21 13:28:50 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-05-21 13:28:50 +0300 |
commit | 12116f6abb2d322fb1a4d4f27683561a3b331a41 (patch) | |
tree | 28b2c00928d3e223ec73523539105c10aae892f8 |
split into separate repo
-rw-r--r-- | init.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/init.php b/init.php new file mode 100644 index 0000000..9361584 --- /dev/null +++ b/init.php @@ -0,0 +1,40 @@ +<?php +class GoogleReaderKeys extends Plugin { + private $host; + + function about() { + return array(1.0, + "Keyboard hotkeys emulate Google Reader", + "markwaters"); + } + + function init($host) { + $this->host = $host; + + $host->add_hook($host::HOOK_HOTKEY_MAP, $this); + } + + function hook_hotkey_map($hotkeys) { + + $hotkeys["j"] = "next_article_noscroll"; + $hotkeys["k"] = "prev_article_noscroll"; + $hotkeys["N"] = "next_feed"; + $hotkeys["P"] = "prev_feed"; + $hotkeys["v"] = "open_in_new_window"; + $hotkeys["r"] = "feed_refresh"; + $hotkeys["m"] = "toggle_unread"; + $hotkeys["o"] = "toggle_expand"; + $hotkeys["\r|Enter"] = "toggle_expand"; + $hotkeys["?"] = "help_dialog"; + $hotkeys[" |Space"] = "next_article"; + $hotkeys["(38)|Up"] = "article_scroll_up"; + $hotkeys["(40)|Down"] = "article_scroll_down"; + + return $hotkeys; + } + + function api_version() { + return 2; + } + +} |