From 2531e38e35bdd5fbc3f27ac875ad0315319c6211 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 6 May 2024 23:05:27 +0700 Subject: [PATCH] sideleft: booru: /clear as command not tag --- .config/ags/modules/sideleft/apis/booru.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.config/ags/modules/sideleft/apis/booru.js b/.config/ags/modules/sideleft/apis/booru.js index dcd9545fc..5642dc727 100644 --- a/.config/ags/modules/sideleft/apis/booru.js +++ b/.config/ags/modules/sideleft/apis/booru.js @@ -45,6 +45,13 @@ const TagButton = (command) => { }); } +const CommandButton = (command, displayName = command) => Button({ + className: 'sidebar-chat-chip sidebar-chat-chip-action txt txt-small', + onClicked: () => sendMessage(command), + setup: setupCursorHover, + label: displayName, +}); + export const booruTabIcon = Box({ hpack: 'center', homogeneous: true, @@ -452,7 +459,8 @@ const booruTags = Revealer({ export const booruCommands = Box({ className: 'spacing-h-5', setup: (self) => { - self.pack_end(TagButton('/clear'), false, false, 0); + self.pack_end(CommandButton('/clear'), false, false, 0); + self.pack_end(CommandButton('/next'), false, false, 0); self.pack_start(Button({ className: 'sidebar-chat-chip-toggle', setup: setupCursorHover, @@ -502,6 +510,9 @@ export const sendMessage = (text) => { booruContent.show_all(); booruContent.attribute.map.set(Date.now(), message); } + else if (text.startsWith('/next')) { + sendMessage('+') + } } else BooruService.fetch(text); } \ No newline at end of file