This commit is contained in:
Alex Yatskov 2017-07-24 22:44:19 -07:00
parent 32680c58b8
commit eed630e9fa
3 changed files with 10 additions and 9 deletions

View File

@ -40,6 +40,6 @@ class Backend {
static instance() {
return chrome.extension.getBackgroundPage().yomichanBackend;
}
};
}
window.yomichanBackend = new Backend();

View File

@ -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'));
});
});

View File

@ -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>