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 +++++++- ext/bg/settings.html | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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 = ''; diff --git a/ext/bg/settings.html b/ext/bg/settings.html index 3e06d4b5..8c787aff 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -760,6 +760,13 @@ + +
@@ -771,7 +778,7 @@
- +
-- cgit v1.2.3 From dd019ecf687299b0d2238312de7c476b2a263107 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Mon, 27 Jan 2020 23:24:34 +0200 Subject: fix audio index in resultOutputMode = 'merge' --- ext/mixed/js/display.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index c4be02f2..16bad3d9 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -176,7 +176,12 @@ class Display { const entry = link.closest('.entry'); const definitionIndex = this.entryIndexFind(entry); const expressionIndex = Display.indexOf(entry.querySelectorAll('.term-expression .action-play-audio'), link); - this.audioPlay(this.definitions[definitionIndex], expressionIndex, definitionIndex); + this.audioPlay( + this.definitions[definitionIndex], + // expressionIndex is used in audioPlay to detect result output mode + Math.max(expressionIndex, this.options.general.resultOutputMode === 'merge' ? 0 : -1), + definitionIndex + ); } onNoteAdd(e) { -- cgit v1.2.3 From 02e0e24153eb95b45057cfc92cadb6563b229cc1 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Mon, 27 Jan 2020 23:28:01 +0200 Subject: change jpod101 kana check to detect katakana --- ext/bg/js/audio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js index 36ac413b..d1e4af9e 100644 --- a/ext/bg/js/audio.js +++ b/ext/bg/js/audio.js @@ -22,7 +22,7 @@ const audioUrlBuilders = new Map([ let kana = definition.reading; let kanji = definition.expression; - if (!kana && wanakana.isHiragana(kanji)) { + if (!kana && jpIsStringEntirelyKana(kanji)) { kana = kanji; kanji = null; } -- cgit v1.2.3 From 05bb4aef71c5c062b451dd04dcd55111f7ba7377 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Tue, 28 Jan 2020 02:34:05 +0200 Subject: partially revert be77544d77ba1f07955d76ebba1ab36286f0e52f --- ext/mixed/css/display.css | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index add2583e..55e76ab7 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -237,7 +237,7 @@ button.action-button { border-top-style: solid; } -.entry[data-type=term][data-expression-multi=true]:not([data-expression-count="1"]) .actions>.action-play-audio { +.entry[data-type=term][data-expression-multi=true] .actions>.action-play-audio { display: none; } @@ -284,13 +284,13 @@ button.action-button { content: "\3001"; } -.term-expression-list>.term-expression:last-of-type:not(:first-of-type):after { +.term-expression-list[data-multi=true]>.term-expression:last-of-type:after { font-size: 2em; content: "\3000"; visibility: hidden; } -.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details { +.term-expression-list[data-multi=true] .term-expression-details { display: inline-block; position: relative; width: 0; @@ -298,21 +298,21 @@ button.action-button { visibility: hidden; } -.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression:hover .term-expression-details { +.term-expression-list[data-multi=true] .term-expression:hover .term-expression-details { visibility: visible; } -.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.action-play-audio { +.term-expression-list[data-multi=true] .term-expression-details>.action-play-audio { position: absolute; left: 0; bottom: 0.5em; } -.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.action-play-audio { +.term-expression-list[data-multi=true] .term-expression-details>.action-play-audio { display: block; } -.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.tags { +.term-expression-list[data-multi=true] .term-expression-details>.tags { display: block; position: absolute; left: 0; @@ -320,7 +320,7 @@ button.action-button { white-space: nowrap; } -.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.frequencies { +.term-expression-list[data-multi=true] .term-expression-details>.frequencies { display: block; position: absolute; left: 0; -- cgit v1.2.3 From dd700af0be94d33802dfc71e2c14abbad8a34578 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 29 Jan 2020 19:52:24 -0500 Subject: Fix tag double click --- ext/mixed/css/display.css | 8 ++++++-- ext/mixed/display-templates.html | 4 ++-- ext/mixed/js/display-generator.js | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index 55e76ab7..8bbd5731 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -208,17 +208,21 @@ button.action-button { } .tag { - display: inline; + display: inline-block; padding: 0.2em 0.6em 0.3em; font-size: 75%; font-weight: 700; - line-height: 1; + line-height: 1.25; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 0.25em; } +.tag-inner { + display: block; +} + .tag-list>.tag+.tag { margin-left: 0.375em; } diff --git a/ext/mixed/display-templates.html b/ext/mixed/display-templates.html index 62f3c69c..eda9abd9 100644 --- a/ext/mixed/display-templates.html +++ b/ext/mixed/display-templates.html @@ -75,7 +75,7 @@ - - + + diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js index e1710488..8c39d380 100644 --- a/ext/mixed/js/display-generator.js +++ b/ext/mixed/js/display-generator.js @@ -252,8 +252,10 @@ class DisplayGenerator { createTag(details) { const node = DisplayGenerator._instantiateTemplate(this._tagTemplate); + const inner = node.querySelector('.tag-inner'); + node.title = details.notes; - node.textContent = details.name; + inner.textContent = details.name; node.dataset.category = details.category; return node; -- cgit v1.2.3 From db247a283784a0a01dca18f6afe325de7d110ba9 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 29 Jan 2020 20:47:24 -0500 Subject: Fix double clicking reason and glossary text --- ext/mixed/css/display.css | 12 +++++++++++- ext/mixed/display-templates.html | 4 ++-- ext/mixed/js/display-generator.js | 9 +++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index 8bbd5731..b70ede90 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -249,7 +249,7 @@ button.action-button { display: inline-block; } -.term-reasons>.term-reason+.term-reason:before { +.term-reasons>.term-reason+.term-reason-separator+.term-reason:before { content: " \00AB "; /* The two spaces is not a typo */ display: inline; } @@ -468,3 +468,13 @@ button.action-button { padding-left: 1.4em; list-style-type: decimal; } + +.term-glossary-separator, +.term-reason-separator { + display: inline-block; + width: 0; + height: 0; + font-size: 0; + opacity: 0; + white-space: pre; +} diff --git a/ext/mixed/display-templates.html b/ext/mixed/display-templates.html index eda9abd9..e762f66b 100644 --- a/ext/mixed/display-templates.html +++ b/ext/mixed/display-templates.html @@ -31,8 +31,8 @@
    - - + + - - + +