From caf71a8dab634cfb629cab0aae24aca620389a1e Mon Sep 17 00:00:00 2001 From: tobias <thinkdifferent055@gmail.com> Date: Fri, 6 Oct 2023 23:36:10 +0200 Subject: [PATCH] #187 - Add new page-action, navigate-action --- actions.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/actions.js b/actions.js index 26b3da9..48e5daa 100644 --- a/actions.js +++ b/actions.js @@ -21,5 +21,42 @@ module.exports = function (self) { }); }, }, + page_action: { + name: 'Set Page', + options: [ + { + id: 'page', + type: 'number', + label: 'Page Number', + default: '', + }, + ], + callback: async (event) => { + self.sendToWebSocket('page-action', { + 'page': event.options.page - 1 + }); + }, + }, + navigate_action: { + name: 'Navigate', + options: [ + { + id: 'type', + type: 'dropdown', + choices: [ + { id: 'PREVIOUS', label: 'Previous' }, + { id: 'NEXT', label: 'Next' } + ], + label: 'Action', + default: '', + }, + ], + callback: async (event) => { + self.sendToWebSocket('navigate-action', { + 'action': event.options.type + }); + }, + } + }) } -- GitLab