allow to export only selected emoji

Changelog: Added
This commit is contained in:
Johann150 2022-10-12 01:26:56 +02:00
parent cb0b14ba2d
commit 79c70c1017
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
2 changed files with 21 additions and 1 deletions

View file

@ -65,6 +65,8 @@ directNotes: "Direct notes"
importAndExport: "Import / Export" importAndExport: "Import / Export"
import: "Import" import: "Import"
export: "Export" export: "Export"
exportAll: "Export all"
exportSelected: "Export selected"
files: "Files" files: "Files"
download: "Download" download: "Download"
driveFileDeleteConfirm: "Are you sure you want to delete the file \"{name}\"? Notes\ driveFileDeleteConfirm: "Are you sure you want to delete the file \"{name}\"? Notes\

View file

@ -18,6 +18,7 @@
<MkButton inline @click="addTagBulk">{{ i18n.ts.addTag }}</MkButton> <MkButton inline @click="addTagBulk">{{ i18n.ts.addTag }}</MkButton>
<MkButton inline @click="removeTagBulk">{{ i18n.ts.removeTag }}</MkButton> <MkButton inline @click="removeTagBulk">{{ i18n.ts.removeTag }}</MkButton>
<MkButton inline @click="setTagBulk">{{ i18n.ts.setTag }}</MkButton> <MkButton inline @click="setTagBulk">{{ i18n.ts.setTag }}</MkButton>
<MkButton inline @click="exportSelected">{{ i18n.ts.exportSelected }}</MkButton>
<MkButton inline danger @click="delBulk">{{ i18n.ts.delete }}</MkButton> <MkButton inline danger @click="delBulk">{{ i18n.ts.delete }}</MkButton>
</div> </div>
<MkPagination ref="emojisPaginationComponent" :pagination="pagination"> <MkPagination ref="emojisPaginationComponent" :pagination="pagination">
@ -170,7 +171,7 @@ const remoteMenu = (emoji, ev: MouseEvent) => {
const menu = (ev: MouseEvent) => { const menu = (ev: MouseEvent) => {
os.popupMenu([{ os.popupMenu([{
icon: 'fas fa-download', icon: 'fas fa-download',
text: i18n.ts.export, text: i18n.ts.exportAll,
action: async () => { action: async () => {
os.api('export-custom-emojis', { os.api('export-custom-emojis', {
}) })
@ -257,6 +258,23 @@ const setTagBulk = async () => {
emojisPaginationComponent.value.reload(); emojisPaginationComponent.value.reload();
}; };
const exportSelected = async () => {
os.api('export-custom-emojis', {
ids: selectedEmojis.value,
})
.then(() => {
os.alert({
type: 'info',
text: i18n.ts.exportRequested,
});
}).catch((err) => {
os.alert({
type: 'error',
text: err.message,
});
});
};
const delBulk = async () => { const delBulk = async () => {
const { canceled } = await os.confirm({ const { canceled } = await os.confirm({
type: 'warning', type: 'warning',