From c4134168be8bf8df4e7ba4860e3d99b3c2256734 Mon Sep 17 00:00:00 2001 From: starxeras Date: Fri, 10 Nov 2023 19:48:27 -0600 Subject: `yomichan` -> `yomitan` --- ext/js/language/text-scanner.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'ext/js/language/text-scanner.js') diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index bd5b0fbe..ac7ef3d9 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -18,7 +18,7 @@ import {EventDispatcher, EventListenerCollection, clone, isObject, log, promiseTimeout} from '../core.js'; import {DocumentUtil} from '../dom/document-util.js'; -import {yomichan} from '../yomichan.js'; +import {yomitan} from '../yomitan.js'; export class TextScanner extends EventDispatcher { constructor({ @@ -89,7 +89,7 @@ export class TextScanner extends EventDispatcher { this._canClearSelection = true; this._textSelectionTimer = null; - this._yomichanIsChangingTextSelectionNow = false; + this._yomitanIsChangingTextSelectionNow = false; this._userHasNotSelectedAnythingManually = true; } @@ -270,13 +270,13 @@ export class TextScanner extends EventDispatcher { setCurrentTextSource(textSource) { this._textSourceCurrent = textSource; if (this._selectText && this._userHasNotSelectedAnythingManually) { - this._yomichanIsChangingTextSelectionNow = true; + this._yomitanIsChangingTextSelectionNow = true; this._textSourceCurrent.select(); if (this._textSelectionTimer !== null) { clearTimeout(this._textSelectionTimer); } // This timeout uses a 50ms delay to ensure that the selectionchange event has time to occur. // If the delay is 0ms, the timeout will sometimes complete before the event. this._textSelectionTimer = setTimeout(() => { - this._yomichanIsChangingTextSelectionNow = false; + this._yomitanIsChangingTextSelectionNow = false; this._textSelectionTimer = null; }, 50); this._textSourceCurrentSelected = true; @@ -390,7 +390,7 @@ export class TextScanner extends EventDispatcher { } _onSelectionChangeCheckUserSelection() { - if (this._yomichanIsChangingTextSelectionNow) { return; } + if (this._yomitanIsChangingTextSelectionNow) { return; } this._userHasNotSelectedAnythingManually = window.getSelection().isCollapsed; } @@ -881,7 +881,7 @@ export class TextScanner extends EventDispatcher { const details = {}; if (this._matchTypePrefix) { details.matchType = 'prefix'; } - const {dictionaryEntries, originalTextLength} = await yomichan.api.termsFind(searchText, details, optionsContext); + const {dictionaryEntries, originalTextLength} = await yomitan.api.termsFind(searchText, details, optionsContext); if (dictionaryEntries.length === 0) { return null; } textSource.setEndOffset(originalTextLength, false, layoutAwareScan); @@ -908,7 +908,7 @@ export class TextScanner extends EventDispatcher { const searchText = this.getTextSourceContent(textSource, 1, layoutAwareScan); if (searchText.length === 0) { return null; } - const dictionaryEntries = await yomichan.api.kanjiFind(searchText, optionsContext); + const dictionaryEntries = await yomitan.api.kanjiFind(searchText, optionsContext); if (dictionaryEntries.length === 0) { return null; } textSource.setEndOffset(1, false, layoutAwareScan); @@ -1145,7 +1145,7 @@ export class TextScanner extends EventDispatcher { async _hasJapanese(text) { try { - return await yomichan.api.textHasJapaneseCharacters(text); + return await yomitan.api.textHasJapaneseCharacters(text); } catch (e) { return false; } -- cgit v1.2.3