Skip to content

Commit

Permalink
Add "Social widgets", "Cookie notices" sections in "Filter lists" pane
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 3, 2024
1 parent aac88ac commit 21a76e3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
28 changes: 14 additions & 14 deletions assets/assets.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,19 @@
},
"adguard-social": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard – Annoyances",
"group": "social",
"parent": null,
"off": true,
"title": "AdGuard – Social Media",
"title": "AdGuard – Social Widgets",
"tags": "annoyances social",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/4.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
},
"adguard-cookies": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard – Annoyances|AdGuard/uBO – Cookie Notices",
"group": "cookies",
"parent": "AdGuard/uBO – Cookie Notices",
"off": true,
"title": "AdGuard – Cookie Notices",
"tags": "annoyances cookies",
Expand All @@ -268,8 +268,8 @@
},
"ublock-cookies-adguard": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard – Annoyances|AdGuard/uBO – Cookie Notices",
"group": "cookies",
"parent": "AdGuard/uBO – Cookie Notices",
"off": true,
"title": "uBlock filters – Cookie Notices",
"tags": "annoyances cookies",
Expand Down Expand Up @@ -328,7 +328,7 @@
},
"fanboy-thirdparty_social": {
"content": "filters",
"group": "annoyances",
"group": "social",
"off": true,
"title": "Fanboy – Anti-Facebook",
"tags": "privacy",
Expand Down Expand Up @@ -369,8 +369,8 @@
},
"fanboy-cookiemonster": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList – Annoyances|EasyList/uBO – Cookie Notices",
"group": "cookies",
"parent": "EasyList/uBO – Cookie Notices",
"off": true,
"title": "EasyList – Cookie Notices",
"tags": "annoyances cookies",
Expand All @@ -389,8 +389,8 @@
},
"ublock-cookies-easylist": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList – Annoyances|EasyList/uBO – Cookie Notices",
"group": "cookies",
"parent": "EasyList/uBO – Cookie Notices",
"off": true,
"title": "uBlock filters – Cookie Notices",
"tags": "annoyances cookies",
Expand Down Expand Up @@ -441,8 +441,8 @@
},
"fanboy-social": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList – Annoyances",
"group": "social",
"parent": null,
"off": true,
"title": "EasyList – Social Widgets",
"tags": "annoyances social",
Expand Down
8 changes: 8 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,14 @@
"message": "Malware protection, security",
"description": "Filter lists section name"
},
"3pGroupSocial": {
"message": "Social widgets",
"description": "Filter lists section name"
},
"3pGroupCookies": {
"message": "Cookie notices",
"description": "Filter lists section name"
},
"3pGroupAnnoyances": {
"message": "Annoyances",
"description": "Filter lists section name"
Expand Down
11 changes: 5 additions & 6 deletions src/js/3p-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const renderNodeStats = (used, total) => {
};

const i18nGroupName = name => {
return i18n$('3pGroup' + name.charAt(0).toUpperCase() + name.slice(1));
const groupname = i18n$('3pGroup' + name.charAt(0).toUpperCase() + name.slice(1));
if ( groupname !== '' ) { return groupname; }
return `${name.charAt(0).toLocaleUpperCase}${name.slice(1)}`;
};

/******************************************************************************/
Expand Down Expand Up @@ -223,6 +225,8 @@ const renderFilterLists = ( ) => {
'privacy',
'malware',
'multipurpose',
'cookies',
'social',
'annoyances',
'regions',
'custom'
Expand All @@ -235,9 +239,6 @@ const renderFilterLists = ( ) => {
}
for ( const [ listkey, listDetails ] of Object.entries(response.available) ) {
let groupKey = listDetails.group;
if ( groupKey === 'social' ) {
groupKey = 'annoyances';
}
const groupDetails = listTree[groupKey];
if ( listDetails.parent !== undefined ) {
let lists = groupDetails.lists;
Expand Down Expand Up @@ -699,8 +700,6 @@ dom.on('.searchbar input', 'input', searchFilterLists);

const expandedListSet = new Set([
'uBlock filters',
'AdGuard – Annoyances',
'EasyList – Annoyances',
]);

const listIsExpanded = which => {
Expand Down

0 comments on commit 21a76e3

Please sign in to comment.