summaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.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/mixed/js/display.js
parenta8cd03cbecf4015483ce3479e589e65ce7eece45 (diff)
JapaneseUtil normalization (#1076)
* Use JapaneseUtil as a class which is manually instantiated * Use alias function for toKana
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index f3aead44..b9daa9a0 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -34,9 +34,10 @@
*/
class Display extends EventDispatcher {
- constructor(pageType) {
+ constructor(pageType, japaneseUtil) {
super();
this._pageType = pageType;
+ this._japaneseUtil = japaneseUtil;
this._container = document.querySelector('#definitions');
this._definitions = [];
this._optionsContext = {depth: 0, url: window.location.href};
@@ -53,7 +54,10 @@ class Display extends EventDispatcher {
this._autoPlayAudioTimer = null;
this._autoPlayAudioDelay = 400;
this._mediaLoader = new MediaLoader();
- this._displayGenerator = new DisplayGenerator({mediaLoader: this._mediaLoader});
+ this._displayGenerator = new DisplayGenerator({
+ japaneseUtil,
+ mediaLoader: this._mediaLoader
+ });
this._hotkeys = new Map();
this._actions = new Map();
this._messageHandlers = new Map();
@@ -177,6 +181,10 @@ class Display extends EventDispatcher {
return this._mode;
}
+ get japaneseUtil() {
+ return this._japaneseUtil;
+ }
+
async prepare() {
// State setup
const {documentElement} = document;