aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/clipboard-monitor.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/clipboard-monitor.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/clipboard-monitor.js')
-rw-r--r--ext/bg/js/clipboard-monitor.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/bg/js/clipboard-monitor.js b/ext/bg/js/clipboard-monitor.js
index 4d980e11..5be6d373 100644
--- a/ext/bg/js/clipboard-monitor.js
+++ b/ext/bg/js/clipboard-monitor.js
@@ -15,18 +15,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-/* global
- * jp
- */
-
class ClipboardMonitor extends EventDispatcher {
- constructor({clipboardReader}) {
+ constructor({japaneseUtil, clipboardReader}) {
super();
+ this._japaneseUtil = japaneseUtil;
+ this._clipboardReader = clipboardReader;
this._timerId = null;
this._timerToken = null;
this._interval = 250;
this._previousText = null;
- this._clipboardReader = clipboardReader;
}
start() {
@@ -53,7 +50,7 @@ class ClipboardMonitor extends EventDispatcher {
text !== this._previousText
) {
this._previousText = text;
- if (jp.isStringPartiallyJapanese(text)) {
+ if (this._japaneseUtil.isStringPartiallyJapanese(text)) {
this.trigger('change', {text});
}
}