diff --git a/assets/js/utils/local-autocompleter.js b/assets/js/utils/local-autocompleter.js index cbc24700..51a2b9f7 100644 --- a/assets/js/utils/local-autocompleter.js +++ b/assets/js/utils/local-autocompleter.js @@ -2,6 +2,7 @@ /* * Client-side tag completion. */ +import store from './store'; /** * @typedef {object} Result @@ -126,6 +127,8 @@ export class LocalAutocompleter { * @param {{[key: string]: Result}} results */ scanResults(getResult, compare, results) { + const unfilter = store.get('unfilter_tag_suggestions'); + let min = 0; let max = this.numTags; @@ -154,8 +157,8 @@ export class LocalAutocompleter { break; } - // Add if no associations are filtered - if (hiddenTags.findIndex(ht => result.associations.includes(ht)) === -1) { + // Add if not filtering or no associations are filtered + if (unfilter || hiddenTags.findIndex(ht => result.associations.includes(ht)) === -1) { results[result.name] = result; } } diff --git a/lib/philomena_web/controllers/setting_controller.ex b/lib/philomena_web/controllers/setting_controller.ex index 14a5b772..660a2bd2 100644 --- a/lib/philomena_web/controllers/setting_controller.ex +++ b/lib/philomena_web/controllers/setting_controller.ex @@ -43,6 +43,7 @@ defmodule PhilomenaWeb.SettingController do |> set_cookie(user_params, "hide_staff_tools", "hide_staff_tools") |> set_cookie(user_params, "hide_uploader", "hide_uploader") |> set_cookie(user_params, "hide_score", "hide_score") + |> set_cookie(user_params, "unfilter_tag_suggestions", "unfilter_tag_suggestions") end defp set_cookie(conn, params, param_name, cookie_name) do diff --git a/lib/philomena_web/templates/setting/edit.html.slime b/lib/philomena_web/templates/setting/edit.html.slime index a795d616..47064535 100644 --- a/lib/philomena_web/templates/setting/edit.html.slime +++ b/lib/philomena_web/templates/setting/edit.html.slime @@ -154,6 +154,10 @@ h1 Content Settings => label f, :hide_uploader => checkbox f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true" .fieldlabel: i Hide the uploader and date posted information on image pages. + .field + => label f, :unfilter_tag_suggestions + => checkbox f, :unfilter_tag_suggestions, checked: @conn.cookies["unfilter_tag_suggestions"] == "true" + .fieldlabel: i Don't attempt to filter tag suggestions using your current filter. .field => label f, :hide_score => checkbox f, :hide_score, checked: @conn.cookies["hide_score"] == "true"