aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/api.js22
-rw-r--r--ext/fg/js/frontend.js2
-rw-r--r--ext/fg/js/popup.js2
3 files changed, 17 insertions, 9 deletions
diff --git a/ext/fg/js/api.js b/ext/fg/js/api.js
index b4d75c3c..174531ba 100644
--- a/ext/fg/js/api.js
+++ b/ext/fg/js/api.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 Alex Yatskov <alex@foosoft.net>
+ * Copyright (C) 2016-2017 Alex Yatskov <alex@foosoft.net>
* Author: Alex Yatskov <alex@foosoft.net>
*
* This program is free software: you can redistribute it and/or modify
@@ -17,6 +17,10 @@
*/
+function apiOptionsSet(options) {
+ return utilInvoke('optionsSet', {options});
+}
+
function apiOptionsGet() {
return utilInvoke('optionsGet');
}
@@ -29,18 +33,22 @@ function apiKanjiFind(text) {
return utilInvoke('kanjiFind', {text});
}
-function apiTemplateRender(template, data) {
- return utilInvoke('templateRender', {data, template});
+function apiDefinitionAdd(definition, mode) {
+ return utilInvoke('definitionAdd', {definition, mode});
}
function apiDefinitionsAddable(definitions, modes) {
return utilInvoke('definitionsAddable', {definitions, modes}).catch(() => null);
}
-function apiDefinitionAdd(definition, mode) {
- return utilInvoke('definitionAdd', {definition, mode});
-}
-
function apiNoteView(noteId) {
return utilInvoke('noteView', {noteId});
}
+
+function apiTemplateRender(template, data) {
+ return utilInvoke('templateRender', {data, template});
+}
+
+function apiCommandExec(command) {
+ return utilInvoke('commandExec', {command});
+}
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 005139e6..cc4d99c8 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -230,7 +230,7 @@ class Frontend {
const sentence = docSentenceExtract(textSource, this.options.anki.sentenceExt);
const url = window.location.href;
- this.popup.showKanji(
+ this.popup.kanjiShow(
textSource.getRect(),
definitions,
this.options,
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 8e61169a..8cb16b5a 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -102,7 +102,7 @@ class Popup {
async kanjiShow(elementRect, definitions, options, context) {
await this.show(elementRect, options);
- this.invokeApi('termsShow', {definitions, options, context});
+ this.invokeApi('kanjiShow', {definitions, options, context});
}
invokeApi(action, params={}) {