aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/search.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-29 13:09:02 -0500
committerGitHub <noreply@github.com>2020-11-29 13:09:02 -0500
commit34451ebf7122a2a5d140696215411abfb0dfe188 (patch)
treee9eddb52f133269853059372045dea510e8d02dc /ext/bg/js/search.js
parenta8cd03cbecf4015483ce3479e589e65ce7eece45 (diff)
JapaneseUtil normalization (#1076)
* Use JapaneseUtil as a class which is manually instantiated * Use alias function for toKana
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r--ext/bg/js/search.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index effa31bc..d99e76e0 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -24,8 +24,8 @@
*/
class DisplaySearch extends Display {
- constructor() {
- super('search');
+ constructor(japaneseUtil) {
+ super('search', japaneseUtil);
this._searchButton = document.querySelector('#search-button');
this._queryInput = document.querySelector('#search-textbox');
this._introElement = document.querySelector('#intro');
@@ -38,6 +38,7 @@ class DisplaySearch extends Display {
this._introAnimationTimer = null;
this._clipboardMonitorEnabled = false;
this._clipboardMonitor = new ClipboardMonitor({
+ japaneseUtil,
clipboardReader: {
getText: async () => (await api.clipboardGet())
}
@@ -129,7 +130,7 @@ class DisplaySearch extends Display {
postProcessQuery(query) {
if (this._wanakanaEnabled) {
try {
- query = wanakana.toKana(query);
+ query = this._japaneseUtil.convertToKana(query);
} catch (e) {
// NOP
}