]> git.wh0rd.org - tt-rss.git/commitdiff
add plugins/googlereaderkeys
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 12 Mar 2013 07:35:41 +0000 (11:35 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 12 Mar 2013 07:35:41 +0000 (11:35 +0400)
plugins/googlereaderkeys/init.php [new file with mode: 0644]

diff --git a/plugins/googlereaderkeys/init.php b/plugins/googlereaderkeys/init.php
new file mode 100644 (file)
index 0000000..7695819
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+class GoogleReaderKeys extends Plugin {
+
+       private $link;
+       private $host;
+
+       function about() {
+               return array(1.0,
+                       "Keyboard hotkeys like Google Reader",
+                       "markwaters");
+       }
+
+       function init($host) {
+               $this->link = $host->get_link();
+               $this->host = $host;
+
+               $host->add_hook($host::HOOK_HOTKEY_MAP, $this);
+       }
+
+       function hook_hotkey_map($hotkeys) {
+
+               $hotkeys["j"] = "next_article_noscroll";
+               $hotkeys["N"] = "next_feed";
+               $hotkeys["k"] = "prev_article_noscroll";
+               $hotkeys["P"] = "prev_feed";
+               $hotkeys["v"] = "open_in_new_window";
+               $hotkeys["(32)|space"] = "next_article";
+               $hotkeys["r"] = "feed_refresh";
+
+               return $hotkeys;
+
+       }
+}
+?>