forked from Shinonome/dots-hyprland
sideleft: booru: /clear as command not tag
This commit is contained in:
@@ -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({
|
export const booruTabIcon = Box({
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
homogeneous: true,
|
homogeneous: true,
|
||||||
@@ -452,7 +459,8 @@ const booruTags = Revealer({
|
|||||||
export const booruCommands = Box({
|
export const booruCommands = Box({
|
||||||
className: 'spacing-h-5',
|
className: 'spacing-h-5',
|
||||||
setup: (self) => {
|
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({
|
self.pack_start(Button({
|
||||||
className: 'sidebar-chat-chip-toggle',
|
className: 'sidebar-chat-chip-toggle',
|
||||||
setup: setupCursorHover,
|
setup: setupCursorHover,
|
||||||
@@ -502,6 +510,9 @@ export const sendMessage = (text) => {
|
|||||||
booruContent.show_all();
|
booruContent.show_all();
|
||||||
booruContent.attribute.map.set(Date.now(), message);
|
booruContent.attribute.map.set(Date.now(), message);
|
||||||
}
|
}
|
||||||
|
else if (text.startsWith('/next')) {
|
||||||
|
sendMessage('+')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else BooruService.fetch(text);
|
else BooruService.fetch(text);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user