mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 09:57:29 -07:00
format
This commit is contained in:
parent
f0ea3ad0a6
commit
4baf90cb71
4 changed files with 93 additions and 89 deletions
|
@ -285,92 +285,96 @@ function onInputKeydown(evt: KeyboardEvent) {
|
|||
}
|
||||
|
||||
async function openSearchFilters(ev) {
|
||||
await os.popupMenu([
|
||||
{
|
||||
icon: "ph-user ph-bold ph-lg",
|
||||
text: "From user",
|
||||
action: () => {
|
||||
os.selectUser().then((user) => {
|
||||
inputValue.value += " from:@" + Acct.toString(user);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: "ph-file ph-bold ph-lg",
|
||||
text: "With file",
|
||||
action: () => {
|
||||
os.select({
|
||||
title: "Has file",
|
||||
items: [
|
||||
{
|
||||
text: "Image",
|
||||
value: "image",
|
||||
},
|
||||
{
|
||||
text: "Video",
|
||||
value: "video",
|
||||
},
|
||||
{
|
||||
text: "Audio",
|
||||
value: "audio",
|
||||
},
|
||||
{
|
||||
text: "File",
|
||||
value: "file",
|
||||
}
|
||||
]
|
||||
}).then((res) => {
|
||||
if (res.canceled) return;
|
||||
inputValue.value += " has:" + res.result;
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: "ph-link ph-bold ph-lg",
|
||||
text: "From domain",
|
||||
action: () => {
|
||||
inputValue.value += " domain:";
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: "ph-calendar-blank ph-bold ph-lg",
|
||||
text: "Posts before",
|
||||
action: () => {
|
||||
os.inputDate({
|
||||
title: "Posts before"
|
||||
}).then((res) => {
|
||||
if (res.canceled) return;
|
||||
inputValue.value += " before:" + res.result;
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: "ph-calendar-blank ph-bold ph-lg",
|
||||
text: "Posts after",
|
||||
action: () => {
|
||||
os.inputDate({
|
||||
title: "Posts after"
|
||||
}).then((res) => {
|
||||
if (res.canceled) return;
|
||||
inputValue.value += " after:" + res.result;
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: "ph-eye ph-bold ph-lg",
|
||||
text: "Following only",
|
||||
action: () => {
|
||||
inputValue.value += " filter:following ";
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: "ph-users-three ph-bold ph-lg",
|
||||
text: "Followers only",
|
||||
action: () => {
|
||||
inputValue.value += " filter:followers ";
|
||||
}
|
||||
},
|
||||
], ev.target, { noReturnFocus: true });
|
||||
await os.popupMenu(
|
||||
[
|
||||
{
|
||||
icon: "ph-user ph-bold ph-lg",
|
||||
text: "From user",
|
||||
action: () => {
|
||||
os.selectUser().then((user) => {
|
||||
inputValue.value += " from:@" + Acct.toString(user);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "ph-file ph-bold ph-lg",
|
||||
text: "With file",
|
||||
action: () => {
|
||||
os.select({
|
||||
title: "Has file",
|
||||
items: [
|
||||
{
|
||||
text: "Image",
|
||||
value: "image",
|
||||
},
|
||||
{
|
||||
text: "Video",
|
||||
value: "video",
|
||||
},
|
||||
{
|
||||
text: "Audio",
|
||||
value: "audio",
|
||||
},
|
||||
{
|
||||
text: "File",
|
||||
value: "file",
|
||||
},
|
||||
],
|
||||
}).then((res) => {
|
||||
if (res.canceled) return;
|
||||
inputValue.value += " has:" + res.result;
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "ph-link ph-bold ph-lg",
|
||||
text: "From domain",
|
||||
action: () => {
|
||||
inputValue.value += " domain:";
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "ph-calendar-blank ph-bold ph-lg",
|
||||
text: "Posts before",
|
||||
action: () => {
|
||||
os.inputDate({
|
||||
title: "Posts before",
|
||||
}).then((res) => {
|
||||
if (res.canceled) return;
|
||||
inputValue.value += " before:" + res.result;
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "ph-calendar-blank ph-bold ph-lg",
|
||||
text: "Posts after",
|
||||
action: () => {
|
||||
os.inputDate({
|
||||
title: "Posts after",
|
||||
}).then((res) => {
|
||||
if (res.canceled) return;
|
||||
inputValue.value += " after:" + res.result;
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "ph-eye ph-bold ph-lg",
|
||||
text: "Following only",
|
||||
action: () => {
|
||||
inputValue.value += " filter:following ";
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "ph-users-three ph-bold ph-lg",
|
||||
text: "Followers only",
|
||||
action: () => {
|
||||
inputValue.value += " filter:followers ";
|
||||
},
|
||||
},
|
||||
],
|
||||
ev.target,
|
||||
{ noReturnFocus: true }
|
||||
);
|
||||
inputEl.value.focus();
|
||||
inputEl.value.selectRange(inputValue.value.length, inputValue.value.length); // cursor at end
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<FocusTrap
|
||||
<FocusTrap
|
||||
:active="false"
|
||||
ref="focusTrap"
|
||||
:return-focus-on-deactivate="!noReturnFocus"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
@enter="emit('opening')"
|
||||
@after-enter="onOpened"
|
||||
>
|
||||
<FocusTrap
|
||||
<FocusTrap
|
||||
v-model:active="isActive"
|
||||
:return-focus-on-deactivate="!noReturnFocus"
|
||||
>
|
||||
|
|
|
@ -183,7 +183,7 @@ onMounted(() => {
|
|||
|
||||
defineExpose({
|
||||
focus,
|
||||
selectRange
|
||||
selectRange,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue