aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-07-24 22:44:19 -0700
committerAlex Yatskov <alex@foosoft.net>2017-07-24 22:44:19 -0700
commiteed630e9fa3c62610bda356e9c76393e70c1a08c (patch)
treef62eef3ee1c24d3ec89fa6192941a7f6e4e1557b /ext/bg
parent32680c58b895e4c781cfb2f51a97fbff42e111b0 (diff)
cleanup
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/backend.js2
-rw-r--r--ext/bg/js/popup.js10
-rw-r--r--ext/bg/popup.html7
3 files changed, 10 insertions, 9 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index e977735e..0615ffae 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -40,6 +40,6 @@ class Backend {
static instance() {
return chrome.extension.getBackgroundPage().yomichanBackend;
}
-};
+}
window.yomichanBackend = new Backend();
diff --git a/ext/bg/js/popup.js b/ext/bg/js/popup.js
index 01994827..712839d9 100644
--- a/ext/bg/js/popup.js
+++ b/ext/bg/js/popup.js
@@ -18,16 +18,14 @@
$(document).ready(() => {
- const commandExec = command => instYomi().onCommand(command);
-
- $('#open-search').click(() => commandExec('search'));
- $('#open-options').click(() => commandExec('options'));
- $('#open-help').click(() => commandExec('help'));
+ $('#open-search').click(() => utilCommandDispatch('search'));
+ $('#open-options').click(() => utilCommandDispatch('options'));
+ $('#open-help').click(() => utilCommandDispatch('help'));
optionsLoad().then(options => {
const toggle = $('#enable-search');
toggle.prop('checked', options.general.enable).change();
toggle.bootstrapToggle();
- toggle.change(() => commandExec('toggle'));
+ toggle.change(() => utilCommandDispatch('toggle'));
});
});
diff --git a/ext/bg/popup.html b/ext/bg/popup.html
index 26c0f0bb..4113b008 100644
--- a/ext/bg/popup.html
+++ b/ext/bg/popup.html
@@ -27,13 +27,16 @@
<button type="button" id="open-help" title="Help" class="btn btn-default btn-xs glyphicon glyphicon-question-sign"></button>
</div>
</p>
+
<script src="/mixed/lib/jquery.min.js"></script>
<script src="/mixed/lib/bootstrap-toggle/bootstrap-toggle.min.js"></script>
<script src="/mixed/lib/handlebars.min.js"></script>
+
+ <script src="/bg/js/api.js"></script>
<script src="/bg/js/dictionary.js"></script>
- <script src="/mixed/js/request.js"></script>
- <script src="/mixed/js/japanese.js"></script>
<script src="/bg/js/options.js"></script>
<script src="/bg/js/popup.js"></script>
+ <script src="/mixed/js/japanese.js"></script>
+ <script src="/mixed/js/request.js"></script>
</body>
</html>