summaryrefslogtreecommitdiff
path: root/plugins/hotkeys_noscroll
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-02-20 15:32:53 +0300
committerAndrew Dolgov <[email protected]>2019-02-20 15:32:53 +0300
commit1a8770f8f48aeb7fbbcd3b569bd37a4a88ccfdb4 (patch)
tree584481b33ccc2bb59575a11312e4cb44fef617b9 /plugins/hotkeys_noscroll
parent580f8c0883c99e41cf9207d91ae9cd97837a592e (diff)
add plugins/hotkeys_noscroll
Diffstat (limited to 'plugins/hotkeys_noscroll')
-rw-r--r--plugins/hotkeys_noscroll/init.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/hotkeys_noscroll/init.php b/plugins/hotkeys_noscroll/init.php
new file mode 100644
index 000000000..18f5aedab
--- /dev/null
+++ b/plugins/hotkeys_noscroll/init.php
@@ -0,0 +1,31 @@
+<?php
+class Hotkeys_Noscroll extends Plugin {
+ private $host;
+
+ function about() {
+ return array(1.0,
+ "n/p hotkeys move between articles without scrolling",
+ "fox");
+ }
+
+ function init($host) {
+ $this->host = $host;
+
+ $host->add_hook($host::HOOK_HOTKEY_MAP, $this);
+ }
+
+ function hook_hotkey_map($hotkeys) {
+
+ $hotkeys["(40)|down"] = "next_article_noscroll";
+ $hotkeys["(38)|up"] = "prev_article_noscroll";
+ $hotkeys["n"] = "next_article_noscroll";
+ $hotkeys["p"] = "prev_article_noscroll";
+
+ return $hotkeys;
+ }
+
+ function api_version() {
+ return 2;
+ }
+
+}