1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-11 00:20:54 +00:00
* Added: Setting to hide unrelated results from the FFZ Control Center when searching. This is now enabled by default.
* Added: Setting to control whether the height of the Emote Menu is expanded. This is now disabled by default.
* Changed: When searching in the FFZ Control Center, pills are displayed in the navigation tree showing how many matching results there are.
* Changed: Update the method used for searching for channels and games, hopefully resulting in more accurate results.
* Changed: When searching for users in an auto-complete field, display a check-mark for verified users.
* Changed: When searching for users in an auto-complete field, respect the user's preference for rounded avatars.
* Fixed: Lazy load Markdown when possible to save on initial download size.
This commit is contained in:
SirStendec 2021-05-13 15:54:21 -04:00
parent ff4bb24a9a
commit f0d68527b8
21 changed files with 435 additions and 164 deletions

View file

@ -35,7 +35,10 @@
<span class="tw-flex-grow-1">
{{ t(item.i18n_key, item.title) }}
</span>
<span v-if="item.pill" class="ffz-pill ffz-pill--overlay">
<span v-if="filter" class="ffz-pill ffz-pill--overlay">
{{ countMatches(item) }}
</span>
<span v-else-if="item.pill" class="ffz-pill ffz-pill--overlay">
{{ item.pill_i18n_key ? t(item.pill_i18n_key, item.pill) : item.pill }}
</span>
<span v-else-if="item.unseen" class="ffz-pill ffz-pill--overlay">
@ -117,6 +120,31 @@ export default {
return false;
},
countMatches(item, seen) {
if ( ! this.filter || ! this.filter.length || ! item )
return 0;
if ( seen && seen.has(item) )
return 0;
if ( ! seen )
seen = new Set;
seen.add(item);
let count = 0;
for(const key of ['tabs', 'contents', 'items'])
if ( item[key] )
for(const thing of item[key])
count += this.countMatches(thing, seen);
if ( item.setting && item.search_terms && item.search_terms.includes(this.filter) )
count++;
return count;
},
containsCurrent(item) {
let i = this.currentItem;
while ( i ) {