diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-02-12 19:56:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-12 19:56:24 -0500 |
commit | 2b4af57bd764ee07ed1d7db8e2985e34ba7ef8ea (patch) | |
tree | 06af52cf528773838c1144a323e74c93ddebdf45 /ext/bg/js | |
parent | 37f916171812afe22f1b435d9e06b52af5d8292a (diff) |
Move data folder (#1371)
* Move handlebars template files
* Move schema files
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/audio-downloader.js | 2 | ||||
-rw-r--r-- | ext/bg/js/backend.js | 2 | ||||
-rw-r--r-- | ext/bg/js/dictionary-importer.js | 16 | ||||
-rw-r--r-- | ext/bg/js/options.js | 10 |
4 files changed, 15 insertions, 15 deletions
diff --git a/ext/bg/js/audio-downloader.js b/ext/bg/js/audio-downloader.js index 25c25250..4e77419b 100644 --- a/ext/bg/js/audio-downloader.js +++ b/ext/bg/js/audio-downloader.js @@ -300,7 +300,7 @@ class AudioDownloader { async _getCustomAudioListSchema() { let schema = this._customAudioListSchema; if (schema === null) { - const url = chrome.runtime.getURL('/bg/data/custom-audio-list-schema.json'); + const url = chrome.runtime.getURL('/data/schemas/custom-audio-list-schema.json'); const response = await fetch(url, { method: 'GET', mode: 'no-cors', diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 3dd1955f..3970fe2d 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -211,7 +211,7 @@ class Backend { this._translator.prepare(deinflectionReasions); await this._optionsUtil.prepare(); - this._defaultAnkiFieldTemplates = (await this._fetchAsset('/bg/data/default-anki-field-templates.handlebars')).trim(); + this._defaultAnkiFieldTemplates = (await this._fetchAsset('/data/templates/default-anki-field-templates.handlebars')).trim(); this._options = await this._optionsUtil.load(); this._applyOptions('background'); diff --git a/ext/bg/js/dictionary-importer.js b/ext/bg/js/dictionary-importer.js index 33870259..4cb608db 100644 --- a/ext/bg/js/dictionary-importer.js +++ b/ext/bg/js/dictionary-importer.js @@ -50,7 +50,7 @@ class DictionaryImporter { const index = JSON.parse(await indexFile.async('string')); - const indexSchema = await this._getSchema('/bg/data/dictionary-index-schema.json'); + const indexSchema = await this._getSchema('/data/schemas/dictionary-index-schema.json'); this._validateJsonSchema(index, indexSchema, indexFileName); const dictionaryTitle = index.title; @@ -280,17 +280,17 @@ class DictionaryImporter { _getDataBankSchemaPaths(version) { const termBank = ( version === 1 ? - '/bg/data/dictionary-term-bank-v1-schema.json' : - '/bg/data/dictionary-term-bank-v3-schema.json' + '/data/schemas/dictionary-term-bank-v1-schema.json' : + '/data/schemas/dictionary-term-bank-v3-schema.json' ); - const termMetaBank = '/bg/data/dictionary-term-meta-bank-v3-schema.json'; + const termMetaBank = '/data/schemas/dictionary-term-meta-bank-v3-schema.json'; const kanjiBank = ( version === 1 ? - '/bg/data/dictionary-kanji-bank-v1-schema.json' : - '/bg/data/dictionary-kanji-bank-v3-schema.json' + '/data/schemas/dictionary-kanji-bank-v1-schema.json' : + '/data/schemas/dictionary-kanji-bank-v3-schema.json' ); - const kanjiMetaBank = '/bg/data/dictionary-kanji-meta-bank-v3-schema.json'; - const tagBank = '/bg/data/dictionary-tag-bank-v3-schema.json'; + const kanjiMetaBank = '/data/schemas/dictionary-kanji-meta-bank-v3-schema.json'; + const tagBank = '/data/schemas/dictionary-tag-bank-v3-schema.json'; return [termBank, termMetaBank, kanjiBank, kanjiMetaBank, tagBank]; } diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 9e0e9cf0..1105dfed 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -28,7 +28,7 @@ class OptionsUtil { } async prepare() { - this._optionsSchema = await this._fetchAsset('/bg/data/options-schema.json', true); + this._optionsSchema = await this._fetchAsset('/data/schemas/options-schema.json', true); } async update(options) { @@ -487,7 +487,7 @@ class OptionsUtil { async _updateVersion3(options) { // Version 3 changes: // Pitch accent Anki field templates added. - await this._applyAnkiFieldTemplatesPatch(options, '/bg/data/anki-field-templates-upgrade-v2.handlebars'); + await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v2.handlebars'); return options; } @@ -572,7 +572,7 @@ class OptionsUtil { }); profileOptions.scanning.inputs = scanningInputs; } - await this._applyAnkiFieldTemplatesPatch(options, '/bg/data/anki-field-templates-upgrade-v4.handlebars'); + await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v4.handlebars'); return options; } @@ -592,7 +592,7 @@ class OptionsUtil { // Added global option useSettingsV2. // Added anki.checkForDuplicates. // Added general.glossaryLayoutMode; removed general.compactGlossaries. - await this._applyAnkiFieldTemplatesPatch(options, '/bg/data/anki-field-templates-upgrade-v6.handlebars'); + await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v6.handlebars'); options.global.showPopupPreview = false; options.global.useSettingsV2 = false; for (const profile of options.profiles) { @@ -665,7 +665,7 @@ class OptionsUtil { // Moved general.enableClipboardMonitor => clipboard.enableSearchPageMonitor. Forced value to false due to a bug which caused its value to not be read. // Moved general.maximumClipboardSearchLength => clipboard.maximumSearchLength. // Added clipboard.autoSearchContent. - await this._applyAnkiFieldTemplatesPatch(options, '/bg/data/anki-field-templates-upgrade-v8.handlebars'); + await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v8.handlebars'); options.global.useSettingsV2 = true; for (const profile of options.profiles) { profile.options.translation.textReplacements = { |