diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-05-13 09:30:28 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-31 12:11:52 -0300 |
commit | 8019e8957ebd94bd53bf35002c24aa2dcdbe65c5 (patch) | |
tree | 4e1a665037f4ad62dbd5f753a86140f590ea9fdf /src | |
parent | 05f4385dc72df17eea850fd27b4b77d7b4f6f840 (diff) |
search, client: group results
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateSearchSidebarBox.js | 3 | ||||
-rw-r--r-- | src/static/js/client.js | 15 | ||||
-rw-r--r-- | src/strings-default.yaml | 1 | ||||
-rw-r--r-- | src/util/search-spec.js | 3 |
4 files changed, 22 insertions, 0 deletions
diff --git a/src/content/dependencies/generateSearchSidebarBox.js b/src/content/dependencies/generateSearchSidebarBox.js index 3758f209..796cfe28 100644 --- a/src/content/dependencies/generateSearchSidebarBox.js +++ b/src/content/dependencies/generateSearchSidebarBox.js @@ -31,6 +31,9 @@ export default { html.tag('template', {class: 'wiki-search-artist-result-kind-string'}, language.$('misc.search.resultKind.artist')), + + html.tag('template', {class: 'wiki-search-group-result-kind-string'}, + language.$('misc.search.resultKind.group')), ], }), }; diff --git a/src/static/js/client.js b/src/static/js/client.js index 5b762c49..ceaec460 100644 --- a/src/static/js/client.js +++ b/src/static/js/client.js @@ -197,6 +197,7 @@ const getLinkHref = (type, directory) => rebase(`${type}/${directory}`); const openAlbum = d => rebase(`album/${d}`); const openArtist = d => rebase(`artist/${d}`); const openFlash = d => rebase(`flash/${d}`); +const openGroup = d => rebase(`group/${d}`); const openTrack = d => rebase(`track/${d}`); // TODO: This should also use urlSpec. @@ -3590,6 +3591,7 @@ const sidebarSearchInfo = initInfo('sidebarSearchInfo', { endSearchString: null, artistResultKindString: null, + groupResultKindString: null, state: { stoppedTypingTimeout: null, @@ -3632,6 +3634,9 @@ function getSidebarSearchReferences() { info.artistResultKindString = findString('artist-result-kind'); + + info.groupResultKindString = + findString('group-result-kind'); } function mutateSidebarSearchContent() { @@ -3849,6 +3854,16 @@ function generateSidebarSearchResult(result) { break; } + case 'group': { + preparedSlots.href = + openGroup(result.directory); + + preparedSlots.kindString = + info.groupResultKindString; + + break; + } + case 'flash': { preparedSlots.href = openFlash(result.directory); diff --git a/src/strings-default.yaml b/src/strings-default.yaml index 7bc215b8..a06882c1 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -631,6 +631,7 @@ misc: resultKind: artist: "(artist)" + group: "(group)" # skippers: # diff --git a/src/util/search-spec.js b/src/util/search-spec.js index e9e0a6f9..5aba2194 100644 --- a/src/util/search-spec.js +++ b/src/util/search-spec.js @@ -83,6 +83,7 @@ export const searchSpec = { albumData, artistData, flashData, + groupData, trackData, }) => [ albumData, @@ -92,6 +93,8 @@ export const searchSpec = { flashData, + groupData, + trackData // Exclude rereleases - there's no reasonable way to differentiate // them from the main release as part of this query. |