Skip to content

Commit 15185e0

Browse files
authored
Merge pull request #189 from rthaut/release/v6.2.0
Version 6.2.0
2 parents a47774a + d8016f1 commit 15185e0

56 files changed

Lines changed: 182 additions & 745 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# DeviantArt Filter
22

3-
> This browser extension allows you to filter/block/hide deviations by user, keyword, and/or category on DeviantArt
3+
> This browser extension allows you to filter/block/hide deviations by user and/or keyword on DeviantArt
44
55
## Overview
66

7-
Have you ever want to block/filter deviations (a.k.a. submissions) while browsing [DeviantArt](https://www.deviantart.com)? **Well now you can!** Simply [install DeviantArt Filter](#installation) in your web browser of choice and start filtering by user, keyword, and/or category.
7+
Have you ever want to block/filter deviations (a.k.a. submissions) while browsing [DeviantArt](https://www.deviantart.com)? **Well now you can!** Simply [install DeviantArt Filter](#installation) in your web browser of choice and start filtering by user and/or keyword.
88

99
![DeviantArt Filter Promotional Image](/promo/Screenshot_1280x800.png?raw=true)
1010

@@ -13,7 +13,6 @@ Have you ever want to block/filter deviations (a.k.a. submissions) while browsin
1313
* Fully-featured management panel for maintaining your filters and controlling functionality.
1414
* Quickly create filters from any deviation thumbnail or link.
1515
* Filter deviations by keywords in titles and/or tags (with wildcard support).
16-
* Filter all deviations from specific categories.
1716
* Import and export filter lists for easy backup and migration.
1817

1918
#### For more information, head to the [DeviantArt Filter website](https://rthaut.github.io/deviantART-Filter/).

app/_locales/en/messages.json

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"description": "The short_name (maximum of 12 characters recommended) is a short version of the app's name"
99
},
1010
"ExtensionDescription": {
11-
"message": "Allows configurable filtering/removal of deviations by user, keyword, and/or category on DeviantArt.",
11+
"message": "Allows configurable filtering/removal of deviations by user and/or keyword on DeviantArt.",
1212
"description": "The description of the application"
1313
},
1414
"BrowserActionTitle": {
@@ -132,6 +132,18 @@
132132
"Options_EnabledPages_PageLabel_Notifications": {
133133
"message": "Notifications Page"
134134
},
135+
"Options_PlaceholderFunctionality_Header": {
136+
"message": "Placeholder Appearance/Behavior"
137+
},
138+
"Options_PlaceholderFunctionality_HelpText": {
139+
"message": "Use these to control the behavior and appearance of the placeholder thumbnails that are shown for filtered deviations."
140+
},
141+
"Options_PlaceholderFunctionality_OptionLabel_PreventClick": {
142+
"message": "Prevent clicking on thumbnails for filtered deviations"
143+
},
144+
"Options_PlaceholderFunctionality_OptionLabel_ShowFilterText": {
145+
"message": "Show the filter type/value on filtered deviations"
146+
},
135147
"Options_ShowUpdatedPage_Header": {
136148
"message": "Show Release Notes for Updates"
137149
},
@@ -165,45 +177,30 @@
165177
"SidebarLink_ImportExport": {
166178
"message": "Import/Export"
167179
},
168-
"SidebarLink_Categories": {
169-
"message": "Category Filters"
170-
},
171180
"SidebarLink_Keywords": {
172181
"message": "Keyword Filters"
173182
},
174183
"SidebarLink_Users": {
175184
"message": "User Filters"
176185
},
177-
"FilterTitle_Category": {
178-
"message": "Category"
179-
},
180186
"FilterTitle_Keyword": {
181187
"message": "Keyword"
182188
},
183189
"FilterTitle_User": {
184190
"message": "User"
185191
},
186-
"FilterTitle_Categories": {
187-
"message": "Categories"
188-
},
189192
"FilterTitle_Keywords": {
190193
"message": "Keywords"
191194
},
192195
"FilterTitle_Users": {
193196
"message": "Users"
194197
},
195-
"FilteredTitle_Categories": {
196-
"message": "Filtered Categories"
197-
},
198198
"FilteredTitle_Keywords": {
199199
"message": "Filtered Keywords"
200200
},
201201
"FilteredTitle_Users": {
202202
"message": "Filtered Users"
203203
},
204-
"Filter_Categories_PropTitle_Name": {
205-
"message": "Category"
206-
},
207204
"Filter_Keywords_PropTitle_Keyword": {
208205
"message": "Keyword"
209206
},
@@ -225,25 +222,10 @@
225222
"UnsupportedFilterError": {
226223
"message": "Unsupported filter type"
227224
},
228-
"CategoriesMenuLabel": {
229-
"message": "Select a category (type to search)",
230-
"description": "The label shown on the categories autocomplete menu"
231-
},
232-
"CategoriesMenuNoOptionsText": {
233-
"message": "No matching categories",
234-
"description": "The text shown on the categories autocomplete menu when no options match the entered value"
235-
},
236-
"CategoriesMenuErrorOption": {
237-
"message": "Failed to load category data",
238-
"description": "The option shown (disabled) when category data cannot be loaded"
239-
},
240225
"DarkModeSwitchLabel": {
241226
"message": "Dark Mode",
242227
"description": "The message displayed on the switch for toggling Dark Mode"
243228
},
244-
"Placeholder_Category": {
245-
"message": "Filtered Category"
246-
},
247229
"Placeholder_Keyword": {
248230
"message": "Filtered Keyword"
249231
},
@@ -306,9 +288,6 @@
306288
"CreateFiltersFromDeviation_Username_Help": {
307289
"message": "Toggle the switch to create a new user filter."
308290
},
309-
"CreateFiltersFromDeviation_Category_Help": {
310-
"message": "Click on sections of the following category hierarchy to create a new category filter. (You can click on a selected section to unselect it.)"
311-
},
312291
"CreateFiltersFromDeviation_Tags_Help": {
313292
"message": "Select one or more of the following tags to create new keyword filters."
314293
},
@@ -356,5 +335,16 @@
356335
"content": "$1"
357336
}
358337
}
338+
},
339+
"CreateUserFilterFromDeviation_ContextMenuLabel": {
340+
"message": "Create Filter for this User"
341+
},
342+
"CreateUserFilterForUsername_ContextMenuLabel": {
343+
"message": "Create User Filter for \"$USERNAME$\"",
344+
"placeholders": {
345+
"username": {
346+
"content": "$1"
347+
}
348+
}
359349
}
360350
}

app/scripts/background/categories.js

Lines changed: 0 additions & 155 deletions
This file was deleted.

app/scripts/background/filters.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { differenceBy, find, findIndex, mapKeys, uniqBy } from "lodash-es";
22

3-
export const SUPPORTED_FILTERS = ["users", "keywords", "categories"];
3+
export const SUPPORTED_FILTERS = ["users", "keywords"];
44

55
export const MIGRATED_FILTERS = {
66
// tags were changed to keywords in v6, so we need to change the storage key and the property names
@@ -29,13 +29,7 @@ export const FILTER_METHODS = {
2929
uniq: (array) => uniqBy(array, "keyword"),
3030
find: (array, value) => find(array, ["keyword", value.keyword]),
3131
findIndex: (array, value) => findIndex(array, ["keyword", value.keyword]),
32-
},
33-
categories: {
34-
diff: (array, values) => differenceBy(array, values, "name"),
35-
uniq: (array) => uniqBy(array, "name"),
36-
find: (array, value) => find(array, ["name", value.name]),
37-
findIndex: (array, value) => findIndex(array, ["name", value.name]),
38-
},
32+
}
3933
};
4034

4135
export const GetAllFilters = async () => {

app/scripts/background/menus.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AddFilter } from "./filters";
22
import { SHOW_FILTER_DEVIATION_MODAL } from "../constants/messages";
3-
import { TAG_URL_REGEX } from "../constants/url";
3+
import { TAG_URL_REGEX, USER_URL_REGEX } from "../constants/url";
44

55
export const MENUS = [
66
{
@@ -11,6 +11,17 @@ export const MENUS = [
1111
contexts: ["link"],
1212
targetUrlPatterns: ["*://*.deviantart.com/tag/*"],
1313
},
14+
{
15+
id: "filter-user",
16+
title: browser.i18n.getMessage(
17+
"CreateUserFilterFromDeviation_ContextMenuLabel"
18+
),
19+
contexts: ["link"],
20+
targetUrlPatterns: [
21+
"*://*.deviantart.com/*/art/*",
22+
"*://*.deviantart.com/*/journal/*",
23+
],
24+
},
1425
{
1526
id: "show-filter-modal-deviation",
1627
title: browser.i18n.getMessage(
@@ -60,6 +71,14 @@ export const OnMenuClicked = (info, tab) => {
6071
}
6172
break;
6273

74+
case "filter-user":
75+
if (USER_URL_REGEX.test(info.linkUrl)) {
76+
// eslint-disable-next-line no-case-declarations
77+
const username = USER_URL_REGEX.exec(info.linkUrl)[1];
78+
AddFilter("users", { username });
79+
}
80+
break;
81+
6382
case "show-filter-modal-deviation":
6483
browser.tabs.sendMessage(tab.id, {
6584
action: SHOW_FILTER_DEVIATION_MODAL,
@@ -90,6 +109,15 @@ export const OnMenuShown = (info, tab) => {
90109
keyword
91110
),
92111
});
112+
} else if (USER_URL_REGEX.test(info.linkUrl)) {
113+
// filter-user menu
114+
const username = USER_URL_REGEX.exec(info.linkUrl)[1];
115+
UpdateMenuItem("filter-user", {
116+
title: browser.i18n.getMessage(
117+
"CreateUserFilterForUsername_ContextMenuLabel",
118+
username
119+
),
120+
});
93121
}
94122
};
95123

0 commit comments

Comments
 (0)