aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-10 08:44:52 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-10 08:44:52 -0700
commit5cc989b87f671702912e28c0bce3747b6b79b87b (patch)
tree5f02fec89d585e5e773becdaea09f293c2b9d13a /ext/bg/js
parent0ef6a2f6c963f11a97b62eacca7476ee4ec2c071 (diff)
Rename references of "vocab" to "term"
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options-form.js12
-rw-r--r--ext/bg/js/options.js6
-rw-r--r--ext/bg/js/templates.js6
-rw-r--r--ext/bg/js/yomichan.js10
4 files changed, 17 insertions, 17 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index a3250ab3..99d01db4 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -31,7 +31,7 @@ function fieldsToDict(selection) {
}
function modelIdToFieldOptKey(id) {
- return {'anki-vocab-model': 'ankiVocabFields', 'anki-kanji-model': 'ankiKanjiFields'}[id];
+ return {'anki-term-model': 'ankiTermFields', 'anki-kanji-model': 'ankiKanjiFields'}[id];
}
function formToOptions(section, callback) {
@@ -50,9 +50,9 @@ function formToOptions(section, callback) {
case 'anki':
optsNew.ankiCardTags = $('#anki-card-tags').val().split(/[,; ]+/);
optsNew.sentenceExtent = parseInt($('#sentence-extent').val(), 10);
- optsNew.ankiVocabDeck = $('#anki-vocab-deck').val();
- optsNew.ankiVocabModel = $('#anki-vocab-model').val();
- optsNew.ankiVocabFields = fieldsToDict($('#vocab .anki-field-value'));
+ optsNew.ankiTermDeck = $('#anki-term-deck').val();
+ optsNew.ankiTermModel = $('#anki-term-model').val();
+ optsNew.ankiTermFields = fieldsToDict($('#term .anki-field-value'));
optsNew.ankiKanjiDeck = $('#anki-kanji-deck').val();
optsNew.ankiKanjiModel = $('#anki-kanji-model').val();
optsNew.ankiKanjiFields = fieldsToDict($('#kanji .anki-field-value'));
@@ -73,7 +73,7 @@ function populateAnkiDeckAndModel(opts) {
names.forEach((name) => ankiDeck.append($('<option/>', {value: name, text: name})));
}
- $('#anki-vocab-deck').val(opts.ankiVocabDeck);
+ $('#anki-term-deck').val(opts.ankiTermDeck);
$('#anki-kanji-deck').val(opts.ankiKanjiDeck);
}});
@@ -84,7 +84,7 @@ function populateAnkiDeckAndModel(opts) {
names.forEach((name) => ankiModel.append($('<option/>', {value: name, text: name})));
}
- populateAnkiFields($('#anki-vocab-model').val(opts.ankiVocabModel), opts);
+ populateAnkiFields($('#anki-term-model').val(opts.ankiTermModel), opts);
populateAnkiFields($('#anki-kanji-model').val(opts.ankiKanjiModel), opts);
}});
}
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 3f31aff8..1c54dfe7 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -27,9 +27,9 @@ function sanitizeOptions(options) {
enableAnkiConnect: false,
ankiCardTags: ['yomichan'],
sentenceExtent: 200,
- ankiVocabDeck: '',
- ankiVocabModel: '',
- ankiVocabFields: {},
+ ankiTermDeck: '',
+ ankiTermModel: '',
+ ankiTermFields: {},
ankiKanjiDeck: '',
ankiKanjiModel: '',
ankiKanjiFields: {}
diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js
index eec28982..1f9e3c30 100644
--- a/ext/bg/js/templates.js
+++ b/ext/bg/js/templates.js
@@ -112,15 +112,15 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial
},"4":function(container,depth0,helpers,partials,data,blockParams,depths) {
var helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda;
- return " <a href=\"#\" title=\"Add vocabulary as expression\" class=\"action-add-note disabled\" data-mode=\"vocab_kanji\" data-index=\""
+ return " <a href=\"#\" title=\"Add term as expression\" class=\"action-add-note disabled\" data-mode=\"term_kanji\" data-index=\""
+ alias4(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"index","hash":{},"data":data}) : helper)))
+ "\"><img src=\""
+ alias4(alias5((depths[1] != null ? depths[1].root : depths[1]), depth0))
- + "/img/add_vocab_kanji.png\"></a>\n <a href=\"#\" title=\"Add vocabulary as reading\" class=\"action-add-note disabled\" data-mode=\"vocab_kana\" data-index=\""
+ + "/img/add_term_kanji.png\"></a>\n <a href=\"#\" title=\"Add term as reading\" class=\"action-add-note disabled\" data-mode=\"term_kana\" data-index=\""
+ alias4(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"index","hash":{},"data":data}) : helper)))
+ "\"><img src=\""
+ alias4(alias5((depths[1] != null ? depths[1].root : depths[1]), depth0))
- + "/img/add_vocab_kana.png\"></a>\n";
+ + "/img/add_term_kana.png\"></a>\n";
},"6":function(container,depth0,helpers,partials,data) {
var stack1, helper, options, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", buffer =
" <div class=\"term-expression\"><ruby>";
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index 6aca4b5d..c6288e57 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -183,12 +183,12 @@ class Yomichan {
value = '';
break;
case 'expression':
- if (mode === 'vocab_kana' && definition.reading) {
+ if (mode === 'term_kana' && definition.reading) {
value = definition.reading;
}
break;
case 'reading':
- if (mode === 'vocab_kana') {
+ if (mode === 'term_kana') {
value = null;
}
break;
@@ -227,9 +227,9 @@ class Yomichan {
note.deckName = this.options.ankiKanjiDeck;
note.modelName = this.options.ankiKanjiModel;
} else {
- fields = this.options.ankiVocabFields;
- note.deckName = this.options.ankiVocabDeck;
- note.modelName = this.options.ankiVocabModel;
+ fields = this.options.ankiTermFields;
+ note.deckName = this.options.ankiTermDeck;
+ note.modelName = this.options.ankiTermModel;
const audio = {
kanji: definition.expression,