aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language
diff options
context:
space:
mode:
authorstarxeras <starxeras@gmail.com>2023-11-10 19:48:27 -0600
committerstarxeras <starxeras@gmail.com>2023-11-10 19:48:27 -0600
commitc4134168be8bf8df4e7ba4860e3d99b3c2256734 (patch)
treed397833c6d7aca11b9fa452d80f0c61089f59b64 /ext/js/language
parentdae82459073c18c903c0bb54c578476ed83dbfd8 (diff)
`yomichan` -> `yomitan`
Diffstat (limited to 'ext/js/language')
-rw-r--r--ext/js/language/text-scanner.js16
1 files changed, 8 insertions, 8 deletions
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;
}