aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-11-12 02:16:11 +0000
committerGitHub <noreply@github.com>2023-11-12 02:16:11 +0000
commitd06029ea8c4244f40f9ddfeec5154f9ef2a4c053 (patch)
tree93f3e15603ec38faef01070475904c08d2e9280b /ext/js/pages
parentf263e994c6eca2438eaff79cb22f1b48fe14b7b2 (diff)
parent784dcd93b02443bc253e3af43ad0586a1add39c5 (diff)
Merge pull request #314 from starxeras/replace-yomichan
Replace all instances of yomichan
Diffstat (limited to 'ext/js/pages')
-rw-r--r--ext/js/pages/action-popup-main.js22
-rw-r--r--ext/js/pages/info-main.js10
-rw-r--r--ext/js/pages/permissions-main.js6
-rw-r--r--ext/js/pages/settings/anki-controller.js6
-rw-r--r--ext/js/pages/settings/anki-templates-controller.js6
-rw-r--r--ext/js/pages/settings/backup-controller.js12
-rw-r--r--ext/js/pages/settings/collapsible-dictionary-controller.js4
-rw-r--r--ext/js/pages/settings/dictionary-controller.js8
-rw-r--r--ext/js/pages/settings/dictionary-import-controller.js8
-rw-r--r--ext/js/pages/settings/extension-keyboard-shortcuts-controller.js4
-rw-r--r--ext/js/pages/settings/keyboard-shortcuts-controller.js4
-rw-r--r--ext/js/pages/settings/mecab-controller.js4
-rw-r--r--ext/js/pages/settings/persistent-storage-controller.js4
-rw-r--r--ext/js/pages/settings/popup-preview-frame-main.js6
-rw-r--r--ext/js/pages/settings/popup-preview-frame.js6
-rw-r--r--ext/js/pages/settings/popup-window-controller.js4
-rw-r--r--ext/js/pages/settings/profile-controller.js4
-rw-r--r--ext/js/pages/settings/scan-inputs-controller.js4
-rw-r--r--ext/js/pages/settings/scan-inputs-simple-controller.js4
-rw-r--r--ext/js/pages/settings/secondary-search-dictionary-controller.js4
-rw-r--r--ext/js/pages/settings/settings-controller.js16
-rw-r--r--ext/js/pages/settings/settings-main.js4
-rw-r--r--ext/js/pages/settings/sort-frequency-dictionary-controller.js6
-rw-r--r--ext/js/pages/settings/storage-controller.js4
-rw-r--r--ext/js/pages/welcome-main.js6
25 files changed, 83 insertions, 83 deletions
diff --git a/ext/js/pages/action-popup-main.js b/ext/js/pages/action-popup-main.js
index 163c226a..32bfcb7f 100644
--- a/ext/js/pages/action-popup-main.js
+++ b/ext/js/pages/action-popup-main.js
@@ -18,7 +18,7 @@
import {PermissionsUtil} from '../data/permissions-util.js';
import {HotkeyHelpController} from '../input/hotkey-help-controller.js';
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
export class DisplayController {
constructor() {
@@ -34,7 +34,7 @@ export class DisplayController {
this._setupButtonEvents('.action-open-search', 'openSearchPage', chrome.runtime.getURL('/search.html'), this._onSearchClick.bind(this));
this._setupButtonEvents('.action-open-info', 'openInfoPage', chrome.runtime.getURL('/info.html'));
- const optionsFull = await yomichan.api.optionsGetFull();
+ const optionsFull = await yomitan.api.optionsGetFull();
this._optionsFull = optionsFull;
this._setupHotkeys();
@@ -84,12 +84,12 @@ export class DisplayController {
const result = customHandler(e);
if (typeof result !== 'undefined') { return; }
}
- yomichan.api.commandExec(command, {mode: e.ctrlKey ? 'newTab' : 'existingOrNewTab'});
+ yomitan.api.commandExec(command, {mode: e.ctrlKey ? 'newTab' : 'existingOrNewTab'});
e.preventDefault();
}, false);
node.addEventListener('auxclick', (e) => {
if (e.button !== 1) { return; }
- yomichan.api.commandExec(command, {mode: 'newTab'});
+ yomitan.api.commandExec(command, {mode: 'newTab'});
e.preventDefault();
}, false);
}
@@ -144,7 +144,7 @@ export class DisplayController {
_setupOptions({options}) {
const extensionEnabled = options.general.enable;
- const onToggleChanged = () => yomichan.api.commandExec('toggleTextScanning');
+ const onToggleChanged = () => yomitan.api.commandExec('toggleTextScanning');
for (const toggle of document.querySelectorAll('#enable-search,#enable-search2')) {
toggle.checked = extensionEnabled;
toggle.addEventListener('change', onToggleChanged, false);
@@ -192,7 +192,7 @@ export class DisplayController {
}
async _setPrimaryProfileIndex(value) {
- return await yomichan.api.modifySettings(
+ return await yomitan.api.modifySettings(
[{
action: 'set',
path: 'profileCurrent',
@@ -204,7 +204,7 @@ export class DisplayController {
async _updateDictionariesEnabledWarnings(options) {
const noDictionariesEnabledWarnings = document.querySelectorAll('.no-dictionaries-enabled-warning');
- const dictionaries = await yomichan.api.getDictionaryInfo();
+ const dictionaries = await yomitan.api.getDictionaryInfo();
const enabledDictionaries = new Set();
for (const {name, enabled} of options.dictionaries) {
@@ -237,18 +237,18 @@ export class DisplayController {
}
async _isSafari() {
- const {browser} = await yomichan.api.getEnvironmentInfo();
+ const {browser} = await yomitan.api.getEnvironmentInfo();
return browser === 'safari';
}
}
(async () => {
- await yomichan.prepare();
+ await yomitan.prepare();
- yomichan.api.logIndicatorClear();
+ yomitan.api.logIndicatorClear();
const displayController = new DisplayController();
displayController.prepare();
- yomichan.ready();
+ yomitan.ready();
})();
diff --git a/ext/js/pages/info-main.js b/ext/js/pages/info-main.js
index 58366d4c..7c6bc993 100644
--- a/ext/js/pages/info-main.js
+++ b/ext/js/pages/info-main.js
@@ -18,7 +18,7 @@
import {log, promiseTimeout} from '../core.js';
import {DocumentFocusController} from '../dom/document-focus-controller.js';
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
import {BackupController} from './settings/backup-controller.js';
import {SettingsController} from './settings/settings-controller.js';
@@ -54,11 +54,11 @@ function getOperatingSystemDisplayName(os) {
const manifest = chrome.runtime.getManifest();
const language = chrome.i18n.getUILanguage();
- await yomichan.prepare();
+ await yomitan.prepare();
const {userAgent} = navigator;
const {name, version} = manifest;
- const {browser, platform: {os}} = await yomichan.api.getEnvironmentInfo();
+ const {browser, platform: {os}} = await yomitan.api.getEnvironmentInfo();
const thisVersionLink = document.querySelector('#release-notes-this-version-link');
thisVersionLink.href = thisVersionLink.dataset.hrefFormat.replace(/\{version\}/g, version);
@@ -72,7 +72,7 @@ function getOperatingSystemDisplayName(os) {
(async () => {
let ankiConnectVersion = null;
try {
- ankiConnectVersion = await yomichan.api.getAnkiConnectVersion();
+ ankiConnectVersion = await yomitan.api.getAnkiConnectVersion();
} catch (e) {
// NOP
}
@@ -85,7 +85,7 @@ function getOperatingSystemDisplayName(os) {
(async () => {
let dictionaryInfos;
try {
- dictionaryInfos = await yomichan.api.getDictionaryInfo();
+ dictionaryInfos = await yomitan.api.getDictionaryInfo();
} catch (e) {
return;
}
diff --git a/ext/js/pages/permissions-main.js b/ext/js/pages/permissions-main.js
index b242ff63..ff614880 100644
--- a/ext/js/pages/permissions-main.js
+++ b/ext/js/pages/permissions-main.js
@@ -18,7 +18,7 @@
import {log, promiseTimeout} from '../core.js';
import {DocumentFocusController} from '../dom/document-focus-controller.js';
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
import {ExtensionContentController} from './common/extension-content-controller.js';
import {ModalController} from './settings/modal-controller.js';
import {PermissionsOriginController} from './settings/permissions-origin-controller.js';
@@ -29,7 +29,7 @@ import {SettingsDisplayController} from './settings/settings-display-controller.
async function setupEnvironmentInfo() {
const {manifest_version: manifestVersion} = chrome.runtime.getManifest();
- const {browser, platform} = await yomichan.api.getEnvironmentInfo();
+ const {browser, platform} = await yomitan.api.getEnvironmentInfo();
document.documentElement.dataset.browser = browser;
document.documentElement.dataset.os = platform.os;
document.documentElement.dataset.manifestVersion = `${manifestVersion}`;
@@ -73,7 +73,7 @@ function setupPermissionsToggles() {
setupPermissionsToggles();
- await yomichan.prepare();
+ await yomitan.prepare();
setupEnvironmentInfo();
diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js
index 0ad047aa..8164b8f6 100644
--- a/ext/js/pages/settings/anki-controller.js
+++ b/ext/js/pages/settings/anki-controller.js
@@ -21,7 +21,7 @@ import {EventListenerCollection, log} from '../../core.js';
import {AnkiUtil} from '../../data/anki-util.js';
import {SelectorObserver} from '../../dom/selector-observer.js';
import {ObjectPropertyAccessor} from '../../general/object-property-accessor.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class AnkiController {
constructor(settingsController) {
@@ -394,7 +394,7 @@ export class AnkiController {
let noteId = null;
for (const query of queries) {
- const notes = await yomichan.api.findAnkiNotes(query);
+ const notes = await yomitan.api.findAnkiNotes(query);
if (notes.length > 0) {
noteId = notes[0];
break;
@@ -405,7 +405,7 @@ export class AnkiController {
throw new Error('Could not find a note to test with');
}
- await yomichan.api.noteView(noteId, mode, false);
+ await yomitan.api.noteView(noteId, mode, false);
}
_setAnkiNoteViewerStatus(visible, error) {
diff --git a/ext/js/pages/settings/anki-templates-controller.js b/ext/js/pages/settings/anki-templates-controller.js
index 83b1b0bb..ac8a0205 100644
--- a/ext/js/pages/settings/anki-templates-controller.js
+++ b/ext/js/pages/settings/anki-templates-controller.js
@@ -19,7 +19,7 @@
import {isObject} from '../../core.js';
import {AnkiNoteBuilder} from '../../data/anki-note-builder.js';
import {JapaneseUtil} from '../../language/sandbox/japanese-util.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class AnkiTemplatesController {
constructor(settingsController, modalController, ankiController) {
@@ -38,7 +38,7 @@ export class AnkiTemplatesController {
}
async prepare() {
- this._defaultFieldTemplates = await yomichan.api.getDefaultAnkiFieldTemplates();
+ this._defaultFieldTemplates = await yomitan.api.getDefaultAnkiFieldTemplates();
this._fieldTemplatesTextarea = document.querySelector('#anki-card-templates-textarea');
this._compileResultInfo = document.querySelector('#anki-card-templates-compile-result');
@@ -136,7 +136,7 @@ export class AnkiTemplatesController {
async _getDictionaryEntry(text, optionsContext) {
if (this._cachedDictionaryEntryText !== text) {
- const {dictionaryEntries} = await yomichan.api.termsFind(text, {}, optionsContext);
+ const {dictionaryEntries} = await yomitan.api.termsFind(text, {}, optionsContext);
if (dictionaryEntries.length === 0) { return null; }
this._cachedDictionaryEntryValue = dictionaryEntries[0];
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js
index 115b7581..2863c505 100644
--- a/ext/js/pages/settings/backup-controller.js
+++ b/ext/js/pages/settings/backup-controller.js
@@ -20,7 +20,7 @@ import {Dexie} from '../../../lib/dexie.js';
import {isObject, log} from '../../core.js';
import {OptionsUtil} from '../../data/options-util.js';
import {ArrayBufferUtil} from '../../data/sandbox/array-buffer-util.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {DictionaryController} from './dictionary-controller.js';
export class BackupController {
@@ -95,8 +95,8 @@ export class BackupController {
async _getSettingsExportData(date) {
const optionsFull = await this._settingsController.getOptionsFull();
- const environment = await yomichan.api.getEnvironmentInfo();
- const fieldTemplatesDefault = await yomichan.api.getDefaultAnkiFieldTemplates();
+ const environment = await yomitan.api.getEnvironmentInfo();
+ const fieldTemplatesDefault = await yomitan.api.getDefaultAnkiFieldTemplates();
const permissions = await this._settingsController.permissionsUtil.getAllPermissions();
// Format options
@@ -503,10 +503,10 @@ export class BackupController {
}
async _importDatabase(databaseName, file) {
- await yomichan.api.purgeDatabase();
+ await yomitan.api.purgeDatabase();
await Dexie.import(file, {progressCallback: this._databaseImportProgressCallback});
- yomichan.api.triggerDatabaseUpdated('dictionary', 'import');
- yomichan.trigger('storageChanged');
+ yomitan.api.triggerDatabaseUpdated('dictionary', 'import');
+ yomitan.trigger('storageChanged');
}
_onSettingsImportDatabaseClick() {
diff --git a/ext/js/pages/settings/collapsible-dictionary-controller.js b/ext/js/pages/settings/collapsible-dictionary-controller.js
index 37d5e6c9..c8ce5e4f 100644
--- a/ext/js/pages/settings/collapsible-dictionary-controller.js
+++ b/ext/js/pages/settings/collapsible-dictionary-controller.js
@@ -17,7 +17,7 @@
*/
import {EventListenerCollection} from '../../core.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class CollapsibleDictionaryController {
constructor(settingsController) {
@@ -35,7 +35,7 @@ export class CollapsibleDictionaryController {
await this._onDatabaseUpdated();
- yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
+ yomitan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
this._settingsController.on('dictionarySettingsReordered', this._onDictionarySettingsReordered.bind(this));
}
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js
index 05f4f396..155ce55e 100644
--- a/ext/js/pages/settings/dictionary-controller.js
+++ b/ext/js/pages/settings/dictionary-controller.js
@@ -18,7 +18,7 @@
import {EventListenerCollection, log} from '../../core.js';
import {DictionaryWorker} from '../../language/dictionary-worker.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
class DictionaryEntry {
constructor(dictionaryController, fragment, index, dictionaryInfo) {
@@ -284,7 +284,7 @@ export class DictionaryController {
this._deleteDictionaryModal = this._modalController.getModal('dictionary-confirm-delete');
this._allCheckbox = document.querySelector('#all-dictionaries-enabled');
- yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
+ yomitan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
this._allCheckbox.addEventListener('change', this._onAllCheckboxChange.bind(this), false);
document.querySelector('#dictionary-confirm-delete-button').addEventListener('click', this._onDictionaryConfirmDelete.bind(this), false);
@@ -681,7 +681,7 @@ export class DictionaryController {
async _deleteDictionaryInternal(dictionaryTitle, onProgress) {
await new DictionaryWorker().deleteDictionary(dictionaryTitle, onProgress);
- yomichan.api.triggerDatabaseUpdated('dictionary', 'delete');
+ yomitan.api.triggerDatabaseUpdated('dictionary', 'delete');
}
async _deleteDictionarySettings(dictionaryTitle) {
@@ -706,7 +706,7 @@ export class DictionaryController {
}
_triggerStorageChanged() {
- yomichan.trigger('storageChanged');
+ yomitan.trigger('storageChanged');
}
_updateDictionaryEntryCount() {
diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js
index 57fe1cd4..12d29a6f 100644
--- a/ext/js/pages/settings/dictionary-import-controller.js
+++ b/ext/js/pages/settings/dictionary-import-controller.js
@@ -18,7 +18,7 @@
import {deserializeError, log} from '../../core.js';
import {DictionaryWorker} from '../../language/dictionary-worker.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {DictionaryController} from './dictionary-controller.js';
export class DictionaryImportController {
@@ -99,7 +99,7 @@ export class DictionaryImportController {
this._setSpinnerVisible(true);
if (purgeNotification !== null) { purgeNotification.hidden = false; }
- await yomichan.api.purgeDatabase();
+ await yomitan.api.purgeDatabase();
const errors = await this._clearDictionarySettings();
if (errors.length > 0) {
@@ -215,7 +215,7 @@ export class DictionaryImportController {
async _importDictionary(file, importDetails, onProgress) {
const archiveContent = await this._readFile(file);
const {result, errors} = await new DictionaryWorker().importDictionary(archiveContent, importDetails, onProgress);
- yomichan.api.triggerDatabaseUpdated('dictionary', 'import');
+ yomitan.api.triggerDatabaseUpdated('dictionary', 'import');
const errors2 = await this._addDictionarySettings(result.sequenced, result.title);
if (errors.length > 0) {
@@ -346,6 +346,6 @@ export class DictionaryImportController {
}
_triggerStorageChanged() {
- yomichan.trigger('storageChanged');
+ yomitan.trigger('storageChanged');
}
}
diff --git a/ext/js/pages/settings/extension-keyboard-shortcuts-controller.js b/ext/js/pages/settings/extension-keyboard-shortcuts-controller.js
index 6e84fa0e..4f3ed569 100644
--- a/ext/js/pages/settings/extension-keyboard-shortcuts-controller.js
+++ b/ext/js/pages/settings/extension-keyboard-shortcuts-controller.js
@@ -18,7 +18,7 @@
import {EventListenerCollection, isObject} from '../../core.js';
import {HotkeyUtil} from '../../input/hotkey-util.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {KeyboardMouseInputField} from './keyboard-mouse-input-field.js';
export class ExtensionKeyboardShortcutController {
@@ -53,7 +53,7 @@ export class ExtensionKeyboardShortcutController {
this._clearButton.addEventListener('click', this._onClearClick.bind(this));
}
- const {platform: {os}} = await yomichan.api.getEnvironmentInfo();
+ const {platform: {os}} = await yomitan.api.getEnvironmentInfo();
this._os = os;
this._hotkeyUtil.os = os;
diff --git a/ext/js/pages/settings/keyboard-shortcuts-controller.js b/ext/js/pages/settings/keyboard-shortcuts-controller.js
index 3f91d2f9..e7ad4d15 100644
--- a/ext/js/pages/settings/keyboard-shortcuts-controller.js
+++ b/ext/js/pages/settings/keyboard-shortcuts-controller.js
@@ -19,7 +19,7 @@
import {EventListenerCollection} from '../../core.js';
import {DocumentUtil} from '../../dom/document-util.js';
import {ObjectPropertyAccessor} from '../../general/object-property-accessor.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {KeyboardMouseInputField} from './keyboard-mouse-input-field.js';
export class KeyboardShortcutController {
@@ -63,7 +63,7 @@ export class KeyboardShortcutController {
}
async prepare() {
- const {platform: {os}} = await yomichan.api.getEnvironmentInfo();
+ const {platform: {os}} = await yomitan.api.getEnvironmentInfo();
this._os = os;
this._addButton = document.querySelector('#hotkey-list-add');
diff --git a/ext/js/pages/settings/mecab-controller.js b/ext/js/pages/settings/mecab-controller.js
index 6f9f15ed..a839fc21 100644
--- a/ext/js/pages/settings/mecab-controller.js
+++ b/ext/js/pages/settings/mecab-controller.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class MecabController {
constructor(settingsController) {
@@ -48,7 +48,7 @@ export class MecabController {
this._testButton.disabled = true;
this._resultsContainer.textContent = '';
this._resultsContainer.hidden = true;
- await yomichan.api.testMecab();
+ await yomitan.api.testMecab();
this._setStatus('Connection was successful', false);
} catch (e) {
this._setStatus(e.message, true);
diff --git a/ext/js/pages/settings/persistent-storage-controller.js b/ext/js/pages/settings/persistent-storage-controller.js
index 1c3bc276..aa060c14 100644
--- a/ext/js/pages/settings/persistent-storage-controller.js
+++ b/ext/js/pages/settings/persistent-storage-controller.js
@@ -17,7 +17,7 @@
*/
import {isObject} from '../../core.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class PersistentStorageController {
constructor() {
@@ -71,7 +71,7 @@ export class PersistentStorageController {
const node = document.querySelector('#storage-persistent-fail-warning');
if (node !== null) { node.hidden = isStoragePeristent; }
- yomichan.trigger('storageChanged');
+ yomitan.trigger('storageChanged');
}
_isPersistentStorageSupported() {
diff --git a/ext/js/pages/settings/popup-preview-frame-main.js b/ext/js/pages/settings/popup-preview-frame-main.js
index 0b69fea0..59e409c5 100644
--- a/ext/js/pages/settings/popup-preview-frame-main.js
+++ b/ext/js/pages/settings/popup-preview-frame-main.js
@@ -19,14 +19,14 @@
import {PopupFactory} from '../../app/popup-factory.js';
import {log} from '../../core.js';
import {HotkeyHandler} from '../../input/hotkey-handler.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {PopupPreviewFrame} from './popup-preview-frame.js';
(async () => {
try {
- await yomichan.prepare();
+ await yomitan.prepare();
- const {tabId, frameId} = await yomichan.api.frameInformationGet();
+ const {tabId, frameId} = await yomitan.api.frameInformationGet();
const hotkeyHandler = new HotkeyHandler();
hotkeyHandler.prepare();
diff --git a/ext/js/pages/settings/popup-preview-frame.js b/ext/js/pages/settings/popup-preview-frame.js
index c0d4358d..7a1a0b3a 100644
--- a/ext/js/pages/settings/popup-preview-frame.js
+++ b/ext/js/pages/settings/popup-preview-frame.js
@@ -19,7 +19,7 @@
import * as wanakana from '../../../lib/wanakana.js';
import {Frontend} from '../../app/frontend.js';
import {TextSourceRange} from '../../dom/text-source-range.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class PopupPreviewFrame {
constructor(tabId, frameId, popupFactory, hotkeyHandler) {
@@ -62,8 +62,8 @@ export class PopupPreviewFrame {
this._exampleTextInput.addEventListener('input', this._onExampleTextInputInput.bind(this), false);
// Overwrite API functions
- this._apiOptionsGetOld = yomichan.api.optionsGet.bind(yomichan.api);
- yomichan.api.optionsGet = this._apiOptionsGet.bind(this);
+ this._apiOptionsGetOld = yomitan.api.optionsGet.bind(yomitan.api);
+ yomitan.api.optionsGet = this._apiOptionsGet.bind(this);
// Overwrite frontend
this._frontend = new Frontend({
diff --git a/ext/js/pages/settings/popup-window-controller.js b/ext/js/pages/settings/popup-window-controller.js
index 6f4d9ec3..9b6708d5 100644
--- a/ext/js/pages/settings/popup-window-controller.js
+++ b/ext/js/pages/settings/popup-window-controller.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class PopupWindowController {
prepare() {
@@ -32,6 +32,6 @@ export class PopupWindowController {
}
async _testWindowOpen() {
- await yomichan.api.getOrCreateSearchPopup({focus: true});
+ await yomitan.api.getOrCreateSearchPopup({focus: true});
}
}
diff --git a/ext/js/pages/settings/profile-controller.js b/ext/js/pages/settings/profile-controller.js
index a4a64e60..a5bf41b3 100644
--- a/ext/js/pages/settings/profile-controller.js
+++ b/ext/js/pages/settings/profile-controller.js
@@ -17,7 +17,7 @@
*/
import {clone, EventListenerCollection} from '../../core.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {ProfileConditionsUI} from './profile-conditions-ui.js';
export class ProfileController {
@@ -53,7 +53,7 @@ export class ProfileController {
}
async prepare() {
- const {platform: {os}} = await yomichan.api.getEnvironmentInfo();
+ const {platform: {os}} = await yomitan.api.getEnvironmentInfo();
this._profileConditionsUI.os = os;
this._profileActiveSelect = document.querySelector('#profile-active-select');
diff --git a/ext/js/pages/settings/scan-inputs-controller.js b/ext/js/pages/settings/scan-inputs-controller.js
index ea8d500a..252e7238 100644
--- a/ext/js/pages/settings/scan-inputs-controller.js
+++ b/ext/js/pages/settings/scan-inputs-controller.js
@@ -17,7 +17,7 @@
*/
import {EventListenerCollection} from '../../core.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {KeyboardMouseInputField} from './keyboard-mouse-input-field.js';
export class ScanInputsController {
@@ -31,7 +31,7 @@ export class ScanInputsController {
}
async prepare() {
- const {platform: {os}} = await yomichan.api.getEnvironmentInfo();
+ const {platform: {os}} = await yomitan.api.getEnvironmentInfo();
this._os = os;
this._container = document.querySelector('#scan-input-list');
diff --git a/ext/js/pages/settings/scan-inputs-simple-controller.js b/ext/js/pages/settings/scan-inputs-simple-controller.js
index 79ffb773..112c03a9 100644
--- a/ext/js/pages/settings/scan-inputs-simple-controller.js
+++ b/ext/js/pages/settings/scan-inputs-simple-controller.js
@@ -17,7 +17,7 @@
*/
import {HotkeyUtil} from '../../input/hotkey-util.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {ScanInputsController} from './scan-inputs-controller.js';
export class ScanInputsSimpleController {
@@ -33,7 +33,7 @@ export class ScanInputsSimpleController {
this._middleMouseButtonScan = document.querySelector('#middle-mouse-button-scan');
this._mainScanModifierKeyInput = document.querySelector('#main-scan-modifier-key');
- const {platform: {os}} = await yomichan.api.getEnvironmentInfo();
+ const {platform: {os}} = await yomitan.api.getEnvironmentInfo();
this._hotkeyUtil.os = os;
this._mainScanModifierKeyInputHasOther = false;
diff --git a/ext/js/pages/settings/secondary-search-dictionary-controller.js b/ext/js/pages/settings/secondary-search-dictionary-controller.js
index 30575526..cc873901 100644
--- a/ext/js/pages/settings/secondary-search-dictionary-controller.js
+++ b/ext/js/pages/settings/secondary-search-dictionary-controller.js
@@ -17,7 +17,7 @@
*/
import {EventListenerCollection} from '../../core.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class SecondarySearchDictionaryController {
constructor(settingsController) {
@@ -33,7 +33,7 @@ export class SecondarySearchDictionaryController {
await this._onDatabaseUpdated();
- yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
+ yomitan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
this._settingsController.on('dictionarySettingsReordered', this._onDictionarySettingsReordered.bind(this));
}
diff --git a/ext/js/pages/settings/settings-controller.js b/ext/js/pages/settings/settings-controller.js
index 6f83c4c0..83ccdb39 100644
--- a/ext/js/pages/settings/settings-controller.js
+++ b/ext/js/pages/settings/settings-controller.js
@@ -20,7 +20,7 @@ import {EventDispatcher, EventListenerCollection, generateId, isObject} from '..
import {OptionsUtil} from '../../data/options-util.js';
import {PermissionsUtil} from '../../data/permissions-util.js';
import {HtmlTemplateCollection} from '../../dom/html-template-collection.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class SettingsController extends EventDispatcher {
constructor() {
@@ -51,7 +51,7 @@ export class SettingsController extends EventDispatcher {
}
async prepare() {
- yomichan.on('optionsUpdated', this._onOptionsUpdated.bind(this));
+ yomitan.on('optionsUpdated', this._onOptionsUpdated.bind(this));
if (this._canObservePermissionsChanges()) {
chrome.permissions.onAdded.addListener(this._onPermissionsChanged.bind(this));
chrome.permissions.onRemoved.addListener(this._onPermissionsChanged.bind(this));
@@ -69,16 +69,16 @@ export class SettingsController extends EventDispatcher {
async getOptions() {
const optionsContext = this.getOptionsContext();
- return await yomichan.api.optionsGet(optionsContext);
+ return await yomitan.api.optionsGet(optionsContext);
}
async getOptionsFull() {
- return await yomichan.api.optionsGetFull();
+ return await yomitan.api.optionsGetFull();
}
async setAllSettings(value) {
const profileIndex = value.profileCurrent;
- await yomichan.api.setAllSettings(value, this._source);
+ await yomitan.api.setAllSettings(value, this._source);
this._setProfileIndex(profileIndex, true);
}
@@ -115,7 +115,7 @@ export class SettingsController extends EventDispatcher {
}
async getDictionaryInfo() {
- return await yomichan.api.getDictionaryInfo();
+ return await yomitan.api.getDictionaryInfo();
}
getOptionsContext() {
@@ -186,12 +186,12 @@ export class SettingsController extends EventDispatcher {
async _getSettings(targets, extraFields) {
targets = this._setupTargets(targets, extraFields);
- return await yomichan.api.getSettings(targets);
+ return await yomitan.api.getSettings(targets);
}
async _modifySettings(targets, extraFields) {
targets = this._setupTargets(targets, extraFields);
- return await yomichan.api.modifySettings(targets, this._source);
+ return await yomitan.api.modifySettings(targets, this._source);
}
_onBeforeUnload(e) {
diff --git a/ext/js/pages/settings/settings-main.js b/ext/js/pages/settings/settings-main.js
index 1cd0b0a9..f9ea0aa1 100644
--- a/ext/js/pages/settings/settings-main.js
+++ b/ext/js/pages/settings/settings-main.js
@@ -18,7 +18,7 @@
import {log} from '../../core.js';
import {DocumentFocusController} from '../../dom/document-focus-controller.js';
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
import {ExtensionContentController} from '../common/extension-content-controller.js';
import {AnkiController} from './anki-controller.js';
import {AnkiTemplatesController} from './anki-templates-controller.js';
@@ -70,7 +70,7 @@ async function setupGenericSettingsController(genericSettingController) {
document.documentElement.dataset.loadingStalled = 'true';
}, 1000);
- await yomichan.prepare();
+ await yomitan.prepare();
if (prepareTimer !== null) {
clearTimeout(prepareTimer);
diff --git a/ext/js/pages/settings/sort-frequency-dictionary-controller.js b/ext/js/pages/settings/sort-frequency-dictionary-controller.js
index c946400f..53104085 100644
--- a/ext/js/pages/settings/sort-frequency-dictionary-controller.js
+++ b/ext/js/pages/settings/sort-frequency-dictionary-controller.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class SortFrequencyDictionaryController {
constructor(settingsController) {
@@ -36,7 +36,7 @@ export class SortFrequencyDictionaryController {
await this._onDatabaseUpdated();
- yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
+ yomitan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
this._sortFrequencyDictionarySelect.addEventListener('change', this._onSortFrequencyDictionarySelectChange.bind(this));
this._sortFrequencyDictionaryOrderSelect.addEventListener('change', this._onSortFrequencyDictionaryOrderSelectChange.bind(this));
@@ -124,7 +124,7 @@ export class SortFrequencyDictionaryController {
const lessCommonTerms = ['行なう', '論じる', '過す', '行方', '人口', '猫', '犬', '滝', '理', '暁'];
const terms = [...moreCommonTerms, ...lessCommonTerms];
- const frequencies = await yomichan.api.getTermFrequencies(
+ const frequencies = await yomitan.api.getTermFrequencies(
terms.map((term) => ({term, reading: null})),
[dictionary]
);
diff --git a/ext/js/pages/settings/storage-controller.js b/ext/js/pages/settings/storage-controller.js
index 8bc63725..ba1145b8 100644
--- a/ext/js/pages/settings/storage-controller.js
+++ b/ext/js/pages/settings/storage-controller.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {yomichan} from '../../yomichan.js';
+import {yomitan} from '../../yomitan.js';
export class StorageController {
constructor(persistentStorageController) {
@@ -41,7 +41,7 @@ export class StorageController {
this._storageUseInvalidNodes = document.querySelectorAll('.storage-use-invalid');
document.querySelector('#storage-refresh').addEventListener('click', this._onStorageRefreshButtonClick.bind(this), false);
- yomichan.on('storageChanged', this._onStorageChanged.bind(this));
+ yomitan.on('storageChanged', this._onStorageChanged.bind(this));
this._updateStats();
}
diff --git a/ext/js/pages/welcome-main.js b/ext/js/pages/welcome-main.js
index d2596921..b1438187 100644
--- a/ext/js/pages/welcome-main.js
+++ b/ext/js/pages/welcome-main.js
@@ -18,7 +18,7 @@
import {log} from '../core.js';
import {DocumentFocusController} from '../dom/document-focus-controller.js';
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
import {ExtensionContentController} from './common/extension-content-controller.js';
import {DictionaryController} from './settings/dictionary-controller.js';
import {DictionaryImportController} from './settings/dictionary-import-controller.js';
@@ -32,7 +32,7 @@ import {StatusFooter} from './settings/status-footer.js';
async function setupEnvironmentInfo() {
const {manifest_version: manifestVersion} = chrome.runtime.getManifest();
- const {browser, platform} = await yomichan.api.getEnvironmentInfo();
+ const {browser, platform} = await yomitan.api.getEnvironmentInfo();
document.documentElement.dataset.browser = browser;
document.documentElement.dataset.os = platform.os;
document.documentElement.dataset.manifestVersion = `${manifestVersion}`;
@@ -54,7 +54,7 @@ async function setupGenericSettingsController(genericSettingController) {
const statusFooter = new StatusFooter(document.querySelector('.status-footer-container'));
statusFooter.prepare();
- await yomichan.prepare();
+ await yomitan.prepare();
setupEnvironmentInfo();