From 2dbb24ea0416cb83185b6f92624bd9b6e937eade Mon Sep 17 00:00:00 2001
From: toasted-nutbread
Date: Sun, 26 Jan 2020 21:01:00 -0500
Subject: Improve error messages when Interface server is invalid
---
ext/bg/js/settings/anki.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'ext/bg/js/settings')
diff --git a/ext/bg/js/settings/anki.js b/ext/bg/js/settings/anki.js
index 9adb2f2a..3b0912d4 100644
--- a/ext/bg/js/settings/anki.js
+++ b/ext/bg/js/settings/anki.js
@@ -35,9 +35,15 @@ function _ankiSetError(error) {
const node = document.querySelector('#anki-error');
if (!node) { return; }
if (error) {
+ const errorString = `${error}`;
node.hidden = false;
- node.textContent = `${error}`;
+ node.textContent = errorString;
_ankiSetErrorData(node, error);
+
+ const node2 = document.querySelector('#anki-invalid-response-error');
+ if (node2 !== null) {
+ node2.hidden = (errorString.indexOf('Invalid response') < 0);
+ }
} else {
node.hidden = true;
node.textContent = '';
--
cgit v1.2.3
From 566012f228452a4113e83f76d1c53be1f1f41643 Mon Sep 17 00:00:00 2001
From: toasted-nutbread
Date: Sat, 1 Feb 2020 11:40:17 -0500
Subject: Use await
---
ext/bg/js/settings/dictionaries.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'ext/bg/js/settings')
diff --git a/ext/bg/js/settings/dictionaries.js b/ext/bg/js/settings/dictionaries.js
index ed171ae9..545e128d 100644
--- a/ext/bg/js/settings/dictionaries.js
+++ b/ext/bg/js/settings/dictionaries.js
@@ -427,7 +427,7 @@ async function onDictionaryMainChanged(e) {
const optionsContext = getOptionsContext();
const options = await getOptionsMutable(optionsContext);
options.general.mainDictionary = value;
- settingsSaveOptions();
+ await settingsSaveOptions();
}
--
cgit v1.2.3
From 748cd27ad09526e4ec8fd309c6a85fdba1e2462c Mon Sep 17 00:00:00 2001
From: toasted-nutbread
Date: Sat, 1 Feb 2020 11:20:50 -0500
Subject: Remove argument from onDictionaryOptionsChanged
---
ext/bg/js/settings/dictionaries.js | 8 ++++++--
ext/bg/js/settings/main.js | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
(limited to 'ext/bg/js/settings')
diff --git a/ext/bg/js/settings/dictionaries.js b/ext/bg/js/settings/dictionaries.js
index 545e128d..31f47bfd 100644
--- a/ext/bg/js/settings/dictionaries.js
+++ b/ext/bg/js/settings/dictionaries.js
@@ -361,12 +361,16 @@ async function dictSettingsInitialize() {
const optionsContext = getOptionsContext();
const options = await getOptionsMutable(optionsContext);
- onDictionaryOptionsChanged(options);
+ onDictionaryOptionsChanged();
onDatabaseUpdated(options);
}
-async function onDictionaryOptionsChanged(options) {
+async function onDictionaryOptionsChanged() {
if (dictionaryUI === null) { return; }
+
+ const optionsContext = getOptionsContext();
+ const options = await getOptionsMutable(optionsContext);
+
dictionaryUI.setOptionsDictionaries(options.dictionaries);
const optionsFull = await apiOptionsGetFull();
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js
index 3bf65eda..6e162ffc 100644
--- a/ext/bg/js/settings/main.js
+++ b/ext/bg/js/settings/main.js
@@ -167,7 +167,7 @@ async function formWrite(options) {
await ankiTemplatesUpdateValue();
await onAnkiOptionsChanged(options);
- await onDictionaryOptionsChanged(options);
+ await onDictionaryOptionsChanged();
formUpdateVisibility(options);
}
--
cgit v1.2.3
From 55047def9dad485b4ad6e118c5d9eaed5d09af0c Mon Sep 17 00:00:00 2001
From: toasted-nutbread
Date: Sat, 1 Feb 2020 11:40:09 -0500
Subject: Separate the functionality of updateMainDictionarySelect
One function now updates the options, and another handles updating the value.
The options are no longer mutated due to updating this
-
+
@@ -492,6 +492,10 @@
+
+
+
+
diff --git a/ext/mixed/css/display-dark.css b/ext/mixed/css/display-dark.css
index 088fc741..c9cd9f90 100644
--- a/ext/mixed/css/display-dark.css
+++ b/ext/mixed/css/display-dark.css
@@ -38,6 +38,7 @@ body { background-color: #1e1e1e; color: #d4d4d4; }
.tag[data-category=dictionary] { background-color: #9057ad; }
.tag[data-category=frequency] { background-color: #489148; }
.tag[data-category=partOfSpeech] { background-color: #565656; }
+.tag[data-category=search] { background-color: #69696e; }
.term-reasons { color: #888888; }
diff --git a/ext/mixed/css/display-default.css b/ext/mixed/css/display-default.css
index 69141c9d..6eee43c4 100644
--- a/ext/mixed/css/display-default.css
+++ b/ext/mixed/css/display-default.css
@@ -38,6 +38,7 @@ body { background-color: #ffffff; color: #333333; }
.tag[data-category=dictionary] { background-color: #aa66cc; }
.tag[data-category=frequency] { background-color: #5cb85c; }
.tag[data-category=partOfSpeech] { background-color: #565656; }
+.tag[data-category=search] { background-color: #8a8a91; }
.term-reasons { color: #777777; }
diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css
index fefd500f..3a66cec3 100644
--- a/ext/mixed/css/display.css
+++ b/ext/mixed/css/display.css
@@ -227,6 +227,10 @@ button.action-button {
margin-left: 0.375em;
}
+html:root:not([data-enable-search-tags=true]) .tag[data-category=search] {
+ display: none;
+}
+
.entry-header2,
.entry-header3 {
display: inline;
diff --git a/ext/mixed/display-templates.html b/ext/mixed/display-templates.html
index 6c611be9..6fcf4c74 100644
--- a/ext/mixed/display-templates.html
+++ b/ext/mixed/display-templates.html
@@ -77,5 +77,6 @@
+