summaryrefslogtreecommitdiff
path: root/ext/js/language
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/language
parentf263e994c6eca2438eaff79cb22f1b48fe14b7b2 (diff)
parent784dcd93b02443bc253e3af43ad0586a1add39c5 (diff)
Merge pull request #314 from starxeras/replace-yomichan
Replace all instances of yomichan
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;
}