From 8e3b9df8e0a4eee375ca34b7b5861d921d156dae Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 6 Jun 2020 12:37:03 -0400 Subject: [PATCH] Make the config screen look nicer --- config.css | 12 ++++++++++++ config.html | 8 ++++---- config.js | 11 ++++++++++- filter.js | 1 + 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/config.css b/config.css index f616292..4919e90 100644 --- a/config.css +++ b/config.css @@ -1,2 +1,14 @@ +body { + min-width: 200pt; + min-height: 200pt; +} + #blacklist { + width: 100%; + height: 70%; +} + +#confirm { + width: 100%; + height: 20%; } \ No newline at end of file diff --git a/config.html b/config.html index f6defc5..6669150 100644 --- a/config.html +++ b/config.html @@ -5,11 +5,11 @@ - Blacklisted words: - - - + \ No newline at end of file diff --git a/config.js b/config.js index 3f48c48..c1e41a6 100644 --- a/config.js +++ b/config.js @@ -14,4 +14,13 @@ document.addEventListener("DOMContentLoaded", e => { chrome.storage.sync.set({"blacklist": JSON.stringify(blacklist)}); }); -}); \ No newline at end of file + + document.querySelector("#confirm").addEventListener("click", e => { + const blacklist = document.querySelector("#blacklist").value.toLowerCase().split("\n").map(line => line.trim()).filter(line => line.length > 0); + + chrome.storage.sync.set({"blacklist": JSON.stringify(blacklist)}); + + window.close(); + + }); +}); diff --git a/filter.js b/filter.js index 12b72b8..d93af2c 100644 --- a/filter.js +++ b/filter.js @@ -4,3 +4,4 @@ const script = document.createElement("script"); script.src = chrome.extension.getURL("inject.js"); (document.head || document.documentElement).appendChild(script); script.onload = script.remove; +