diff --git a/ext/css/search.css b/ext/css/search.css index 455799ce9e..81e4a74c78 100644 --- a/ext/css/search.css +++ b/ext/css/search.css @@ -174,20 +174,6 @@ h1 { .search-option-label { padding-left: 0.5em; } -.search-option-pre-label { - padding-right: 0.5em; -} -#query-parser-mode-container { - flex: 1 1 auto; -} -#query-parser-mode-container:not([hidden]) { - display: flex; -} -#query-parser-mode-select { - flex: 1 1 auto; - max-width: 220px; - min-width: 100px; -} /* Search styles */ #intro { diff --git a/ext/css/settings.css b/ext/css/settings.css index 651d805b8c..598673f43c 100644 --- a/ext/css/settings.css +++ b/ext/css/settings.css @@ -638,6 +638,9 @@ a.heading-link-light { .settings-item-children.settings-item-children-group .settings-item-children { padding-left: 0; } +:root:not([data-debug=true]) .debug-only { + display: none; +} :root:not([data-advanced=true]) .advanced-only { display: none; } @@ -769,6 +772,22 @@ select.short-height { --accent-color-transparent25: var(--advanced-color-transparent25); } +/* Debug settings */ +.settings-group.debug-only>.settings-item::after, +.settings-item.debug-only::after { + content: ''; + background-color: var(--danger-color-lighter); + position: absolute; + right: 0; + top: 0; + height: 100%; + width: 0.25em; +} +.debug-toggle { + --accent-color: var(--danger-color); + --accent-color-lighter: var(--danger-color-lighter); + --accent-color-transparent25: var(--danger-color-transparent25); +} /* Modal */ .modal { diff --git a/ext/data/schemas/options-schema.json b/ext/data/schemas/options-schema.json index 7112ee4d09..50fb81806b 100644 --- a/ext/data/schemas/options-schema.json +++ b/ext/data/schemas/options-schema.json @@ -86,6 +86,7 @@ "debugInfo", "maxResults", "showAdvanced", + "showDebug", "popupDisplayMode", "popupWidth", "popupHeight", @@ -166,6 +167,10 @@ "type": "boolean", "default": false }, + "showDebug": { + "type": "boolean", + "default": false + }, "popupDisplayMode": { "type": "string", "enum": ["default", "full-width"], diff --git a/ext/data/templates/anki-field-templates-upgrade-v48.handlebars b/ext/data/templates/anki-field-templates-upgrade-v49.handlebars similarity index 100% rename from ext/data/templates/anki-field-templates-upgrade-v48.handlebars rename to ext/data/templates/anki-field-templates-upgrade-v49.handlebars diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index 338eeb3d7d..b010cb38f2 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -2187,6 +2187,7 @@ export class Backend { const error = this._getAudioDownloadError(e); if (error !== null) { throw error; } // No audio + log.error(e); return null; } diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 3d7e128623..41bdaab9d7 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -1436,11 +1436,21 @@ export class OptionsUtil { } /** - * - Added dictionary alias + * - Added general.showDebug * @type {import('options-util').UpdateFunction} */ async _updateVersion48(options) { - await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v48.handlebars'); + for (const profile of options.profiles) { + profile.options.general.showDebug = false; + } + } + + /** + * - Added dictionary alias + * @type {import('options-util').UpdateFunction} + */ + async _updateVersion49(options) { + await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v49.handlebars'); for (const {options: profileOptions} of options.profiles) { if (Array.isArray(profileOptions.dictionaries)) { for (const dictionary of profileOptions.dictionaries) { diff --git a/ext/js/language/ja/japanese-transforms.js b/ext/js/language/ja/japanese-transforms.js index 42b4abc607..d42657a57f 100644 --- a/ext/js/language/ja/japanese-transforms.js +++ b/ext/js/language/ja/japanese-transforms.js @@ -801,22 +801,22 @@ export const japaneseTransforms = { }, ], rules: [ - suffixInflection('ねば', 'る', [], ['v1']), - suffixInflection('かねば', 'く', [], ['v5']), - suffixInflection('がねば', 'ぐ', [], ['v5']), - suffixInflection('さねば', 'す', [], ['v5']), - suffixInflection('たねば', 'つ', [], ['v5']), - suffixInflection('なねば', 'ぬ', [], ['v5']), - suffixInflection('ばねば', 'ぶ', [], ['v5']), - suffixInflection('まねば', 'む', [], ['v5']), - suffixInflection('らねば', 'る', [], ['v5']), - suffixInflection('わねば', 'う', [], ['v5']), - suffixInflection('ぜねば', 'ずる', [], ['vz']), - suffixInflection('せねば', 'する', [], ['vs']), - suffixInflection('為ねば', '為る', [], ['vs']), - suffixInflection('こねば', 'くる', [], ['vk']), - suffixInflection('来ねば', '来る', [], ['vk']), - suffixInflection('來ねば', '來る', [], ['vk']), + suffixInflection('ねば', 'る', ['-ba'], ['v1']), + suffixInflection('かねば', 'く', ['-ba'], ['v5']), + suffixInflection('がねば', 'ぐ', ['-ba'], ['v5']), + suffixInflection('さねば', 'す', ['-ba'], ['v5']), + suffixInflection('たねば', 'つ', ['-ba'], ['v5']), + suffixInflection('なねば', 'ぬ', ['-ba'], ['v5']), + suffixInflection('ばねば', 'ぶ', ['-ba'], ['v5']), + suffixInflection('まねば', 'む', ['-ba'], ['v5']), + suffixInflection('らねば', 'る', ['-ba'], ['v5']), + suffixInflection('わねば', 'う', ['-ba'], ['v5']), + suffixInflection('ぜねば', 'ずる', ['-ba'], ['vz']), + suffixInflection('せねば', 'する', ['-ba'], ['vs']), + suffixInflection('為ねば', '為る', ['-ba'], ['vs']), + suffixInflection('こねば', 'くる', ['-ba'], ['vk']), + suffixInflection('来ねば', '来る', ['-ba'], ['vk']), + suffixInflection('來ねば', '來る', ['-ba'], ['vk']), ], }, '-ku': { diff --git a/ext/js/pages/settings/anki-deck-generator-controller.js b/ext/js/pages/settings/anki-deck-generator-controller.js index 1a65d80f9a..8db12d9300 100644 --- a/ext/js/pages/settings/anki-deck-generator-controller.js +++ b/ext/js/pages/settings/anki-deck-generator-controller.js @@ -21,6 +21,7 @@ import {toError} from '../../core/to-error.js'; import {AnkiNoteBuilder} from '../../data/anki-note-builder.js'; import {getDynamicTemplates} from '../../data/anki-template-util.js'; import {querySelectorNotNull} from '../../dom/query-selector.js'; +import {getLanguageSummaries} from '../../language/languages.js'; import {TemplateRendererProxy} from '../../templates/template-renderer-proxy.js'; export class AnkiDeckGeneratorController { @@ -443,7 +444,8 @@ export class AnkiDeckGeneratorController { } } const idleTimeout = (Number.isFinite(options.anki.downloadTimeout) && options.anki.downloadTimeout > 0 ? options.anki.downloadTimeout : null); - const mediaOptions = addMedia ? {audio: {sources: options.audio.sources, preferredAudioIndex: null, idleTimeout: idleTimeout}} : null; + const languageSummary = getLanguageSummaries().find(({iso}) => iso === options.general.language); + const mediaOptions = addMedia ? {audio: {sources: options.audio.sources, preferredAudioIndex: null, idleTimeout: idleTimeout, languageSummary: languageSummary}} : null; const requirements = addMedia ? [...this._getDictionaryEntryMedia(dictionaryEntry), {type: 'audio'}] : []; const dictionaryStylesMap = this._ankiNoteBuilder.getDictionaryStylesMap(options.dictionaries); const {note} = await this._ankiNoteBuilder.createNote(/** @type {import('anki-note-builder').CreateNoteDetails} */ ({ diff --git a/ext/search.html b/ext/search.html index 6bc6024ed4..958b8a2858 100644 --- a/ext/search.html +++ b/ext/search.html @@ -44,10 +44,6 @@

Yomitan Search

Clipboard monitor -
@@ -102,6 +98,17 @@

Yomitan Search

-
+
Show debug information
A menu option to log debugging information will be shown in the search results.
@@ -2512,7 +2521,7 @@

Yomitan Settings