Skip to content

Commit

Permalink
fix: tag autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
7nik committed Jun 1, 2024
1 parent f3816cf commit c2da5db
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ap-vk-poster",
"version": "2.6.7",
"version": "2.6.8",
"private": true,
"scripts": {
"build": "rollup -c --environment PROD",
Expand Down
1 change: 1 addition & 0 deletions src/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,6 @@
background-image: url(/assets/styles/icons/delete.svg);
background-size: contain;
filter: drop-shadow(0 0 1px #0004);
vertical-align: text-top;
}
</style>
9 changes: 9 additions & 0 deletions src/TagsField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,18 @@
height: 0;
width: 100%;
}
ul.autocomplite {
visibility: hidden;
}
ul.autocomplite.show {
visibility: visible;
}
li {
background: var(--autocomplite-background);
}
li:hover, li.autocomplite_active {
background: var(--autocomplite-background-active);
}
.cat-1 {
color: #006699;
}
Expand Down
7 changes: 2 additions & 5 deletions src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,8 @@ async function findTag (tag: string): Promise<{
}[]> {
const form = new FormData();
form.append("tag", tag);
const json = await fetch("https://api.anime-pictures.net/pictures/autocomplete_tag", {
method: "POST",
body: form,
}).then((resp) => resp.json());
return json.tags_list;
const json = await fetch(`https://api.anime-pictures.net/api/v3/tags:autocomplete?tag=${tag}`).then((resp) => resp.json());
return json.tags;
}

export {
Expand Down
2 changes: 1 addition & 1 deletion src/meta.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name AP VK poster
// @namespace 7nik@anime-pictures.net
// @version 2.6.5
// @version 2.6.8
// @description Make a post with a picture in vk.com/mjvart
// @author 7nik, MiTereKun
// @match https://anime-pictures.net/*
Expand Down

0 comments on commit c2da5db

Please sign in to comment.