From 7e61ea9691fdbf7235ea83feaae6cf808991ab74 Mon Sep 17 00:00:00 2001 From: eight04 Date: Tue, 7 Dec 2021 02:17:41 +0800 Subject: [PATCH] Change: use textarea for include/exclude, remove isCodeUpdated --- _locales/en/messages.json | 9 ------ background/style-manager.js | 4 +-- edit.html | 18 ++++++------ edit/edit.js | 14 ++++------ edit/sections-editor.js | 31 +++++++++++++++++---- edit/settings.css | 16 ++++------- edit/settings.js | 55 +++++++------------------------------ edit/source-editor.js | 26 ++++++++++++++++-- 8 files changed, 79 insertions(+), 94 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3ad511d1..be2006e4 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1652,18 +1652,9 @@ "styleIncludeLabel": { "message": "Custom included sites" }, - "styleIncludeNewLabel": { - "message": "Add new inclusion" - }, - "styleIncludeDeleteLabel": { - "message": "Delete" - }, "styleExcludeLabel": { "message": "Custom excluded sites" }, - "styleExcludeNewLabel": { - "message": "Add new exclusion" - }, "syncDropboxDeprecated": { "message": "Dropbox import/export is replaced by a more advanced style sync in the options page." }, diff --git a/background/style-manager.js b/background/style-manager.js index a6c8b4ed..be66b535 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -382,7 +382,7 @@ const styleMan = (() => { throw new Error('The rule already exists'); } style[type] = list.concat([rule]); - return saveStyle(style, {reason: 'styleSettings'}); + return saveStyle(style, {reason: 'config'}); } async function removeIncludeExclude(type, id, rule) { @@ -393,7 +393,7 @@ const styleMan = (() => { return; } style[type] = list.filter(r => r !== rule); - return saveStyle(style, {reason: 'styleSettings'}); + return saveStyle(style, {reason: 'config'}); } function broadcastStyleUpdated(style, reason, method = 'styleUpdated', codeIsUpdated = true) { diff --git a/edit.html b/edit.html index afc4b436..567d4984 100644 --- a/edit.html +++ b/edit.html @@ -469,16 +469,14 @@ -
-
-
- -
-
-
-
- -
+ +