Skip to content

Commit

Permalink
fix bug and words
Browse files Browse the repository at this point in the history
  • Loading branch information
SquareScreamYT committed Nov 7, 2024
1 parent fcfa923 commit c7ecf8c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kotobalibre/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,15 @@ function applyFilters() {
button.style.display = categoryMatch && (searchMatch || searchTerm === "") ? "block" : "none";
});

// Sort visible buttons by relevance score
// Sort visible buttons by relevance score if there's a search term, otherwise restore alphabetical order
if (searchTerm) {
buttonArray
.sort((a, b) => b.relevanceScore - a.relevanceScore)
.forEach(button => button.parentNode.appendChild(button));
} else {
buttonArray
.sort((a, b) => a.textContent.localeCompare(b.textContent))
.forEach(button => button.parentNode.appendChild(button));
}
}

Expand Down
24 changes: 24 additions & 0 deletions kotobalibre/words.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,22 @@
"definition": "au lyk +, tatoeba: \"un nam ca. un nam kekso.\" sama \"un nam ca au kekso\""
}
},
{
"auauau": {
"category": [
"mitkotoba"
],
"definition": "abc auauau sama abcdefghijklmnopqrstuvwxyz"
}
},
{
"awen": {
"category": [
"mitkotoba"
],
"definition": "du lera viossa. un lera viossa awen. vi lera viossa."
}
},
{
"azuki": {
"category": [
Expand Down Expand Up @@ -2426,6 +2442,14 @@
"image2": "https://img.freepik.com/free-photo/fruit-group-tropical-agriculture-freshness_1417-312.jpg"
}
},
{
"rjoho": {
"category": [
"mitkotoba"
],
"definition": "pasjun a: \"du vil ringo os banan?\"<br>pasjun b: \"un vil rjoho!\"<br>sama<br>pasjun b: \"un vil ringo au banan!\""
}
},
{
"rju": {
"category": [
Expand Down

0 comments on commit c7ecf8c

Please sign in to comment.