From f8d96543de36dd2d9a223fd017b6c5f671ff3e6a Mon Sep 17 00:00:00 2001 From: Nathan Warner Date: Sat, 30 May 2020 22:45:41 -0600 Subject: Created hotkeys_force_top plugin Renamed swap_jk to match new naming scheme. --- plugins/hotkeys_force_top/init.js | 6 ++++++ plugins/hotkeys_force_top/init.php | 24 ++++++++++++++++++++++++ plugins/hotkeys_swap_jk/init.php | 30 ++++++++++++++++++++++++++++++ plugins/swap_jk/init.php | 30 ------------------------------ 4 files changed, 60 insertions(+), 30 deletions(-) create mode 100644 plugins/hotkeys_force_top/init.js create mode 100644 plugins/hotkeys_force_top/init.php create mode 100644 plugins/hotkeys_swap_jk/init.php delete mode 100644 plugins/swap_jk/init.php diff --git a/plugins/hotkeys_force_top/init.js b/plugins/hotkeys_force_top/init.js new file mode 100644 index 000000000..8d6280fc9 --- /dev/null +++ b/plugins/hotkeys_force_top/init.js @@ -0,0 +1,6 @@ +require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { + ready(function () { + Headlines.default_force_to_top = true; + }); +}); + diff --git a/plugins/hotkeys_force_top/init.php b/plugins/hotkeys_force_top/init.php new file mode 100644 index 000000000..faddc9148 --- /dev/null +++ b/plugins/hotkeys_force_top/init.php @@ -0,0 +1,24 @@ +host = $host; + + } + + function get_js() { + return file_get_contents(__DIR__ . "/init.js"); + } + + function api_version() { + return 2; + } + +} diff --git a/plugins/hotkeys_swap_jk/init.php b/plugins/hotkeys_swap_jk/init.php new file mode 100644 index 000000000..b1e3dbe04 --- /dev/null +++ b/plugins/hotkeys_swap_jk/init.php @@ -0,0 +1,30 @@ +host = $host; + + $host->add_hook($host::HOOK_HOTKEY_MAP, $this); + } + + function hook_hotkey_map($hotkeys) { + + $hotkeys["j"] = "next_feed"; + $hotkeys["k"] = "prev_feed"; + + return $hotkeys; + } + + function api_version() { + return 2; + } + +} diff --git a/plugins/swap_jk/init.php b/plugins/swap_jk/init.php deleted file mode 100644 index d85149ef3..000000000 --- a/plugins/swap_jk/init.php +++ /dev/null @@ -1,30 +0,0 @@ -host = $host; - - $host->add_hook($host::HOOK_HOTKEY_MAP, $this); - } - - function hook_hotkey_map($hotkeys) { - - $hotkeys["j"] = "next_feed"; - $hotkeys["k"] = "prev_feed"; - - return $hotkeys; - } - - function api_version() { - return 2; - } - -} \ No newline at end of file -- cgit v1.2.3