init.php 908 B

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