summaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-05-29 13:26:09 -0700
committerAlex Yatskov <alex@foosoft.net>2016-05-29 13:26:09 -0700
commitd479107eb57fb59915693f47772d6e48ddd8b30d (patch)
tree4fe379737b200e5a94217344667d713d7c45cef4 /ext/fg
parent49951356572fe972ef01d0578861c39430520f19 (diff)
Cleanup
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/img/add_vocab_kana.png (renamed from ext/fg/img/add_reading.png)bin286 -> 286 bytes
-rw-r--r--ext/fg/img/add_vocab_kanji.png (renamed from ext/fg/img/add_expression.png)bin733 -> 733 bytes
-rw-r--r--ext/fg/js/api.js8
-rw-r--r--ext/fg/js/client.js10
4 files changed, 9 insertions, 9 deletions
diff --git a/ext/fg/img/add_reading.png b/ext/fg/img/add_vocab_kana.png
index 41ff8335..41ff8335 100644
--- a/ext/fg/img/add_reading.png
+++ b/ext/fg/img/add_vocab_kana.png
Binary files differ
diff --git a/ext/fg/img/add_expression.png b/ext/fg/img/add_vocab_kanji.png
index 6332fefe..6332fefe 100644
--- a/ext/fg/img/add_expression.png
+++ b/ext/fg/img/add_vocab_kanji.png
Binary files differ
diff --git a/ext/fg/js/api.js b/ext/fg/js/api.js
index ecd8dd36..5d060311 100644
--- a/ext/fg/js/api.js
+++ b/ext/fg/js/api.js
@@ -41,10 +41,10 @@ function bgGetState(callback) {
bgSendMessage('getState', {}, callback);
}
-function bgCanAddNotes(definitions, modes, callback) {
- bgSendMessage('canAddNotes', {definitions, modes}, callback);
+function bgCanAddDefinitions(definitions, modes, callback) {
+ bgSendMessage('canAddDefinitions', {definitions, modes}, callback);
}
-function bgAddNote(definition, mode, callback) {
- bgSendMessage('addNote', {definition, mode}, callback);
+function bgAddDefinition(definition, mode, callback) {
+ bgSendMessage('addDefinition', {definition, mode}, callback);
}
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 31cc29cc..ec2ea630 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -106,13 +106,13 @@ class Client {
range.setLength(length);
bgRenderText(
- {defs: definitions, root: this.fgRoot, options: this.options, sequence},
+ {definitions, root: this.fgRoot, options: this.options, sequence},
'term-list.html',
(content) => {
this.definitions = definitions;
this.showPopup(range, content);
- bgCanAddNotes(definitions, ['vocabExp', 'vocabReading'], (states) => {
+ bgCanAddDefinitions(definitions, ['vocab_kanji', 'vocab_kana'], (states) => {
if (states !== null) {
states.forEach((state, index) => this.popup.sendMessage('setActionState', {index, state, sequence}));
}
@@ -158,7 +158,7 @@ class Client {
const state = {};
state[mode] = false;
- bgAddNote(this.definitions[index], mode, (success) => {
+ bgAddDefinition(this.definitions[index], mode, (success) => {
if (success) {
this.popup.sendMessage('setActionState', {index, state, sequence: this.sequence});
} else {
@@ -171,13 +171,13 @@ class Client {
bgFindKanji(kanji, (definitions) => {
const sequence = ++this.sequence;
bgRenderText(
- {defs: definitions, root: this.fgRoot, options: this.options, sequence},
+ {definitions, root: this.fgRoot, options: this.options, sequence},
'kanji-list.html',
(content) => {
this.definitions = definitions;
this.popup.setContent(content, definitions);
- bgCanAddNotes(definitions, ['kanji'], (states) => {
+ bgCanAddDefinitions(definitions, ['kanji'], (states) => {
if (states !== null) {
states.forEach((state, index) => this.popup.sendMessage('setActionState', {index, state, sequence}));
}