summaryrefslogtreecommitdiff
path: root/ext/bg/js/clipboard-monitor.js
diff options
context:
space:
mode:
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});
}
}