Rename references of "vocab" to "term"

This commit is contained in:
Alex Yatskov 2016-08-10 08:44:52 -07:00
parent 0ef6a2f6c9
commit 5cc989b87f
11 changed files with 29 additions and 29 deletions

View File

@ -40,7 +40,7 @@ Store](https://chrome.google.com/webstore/detail/yomichan/ogmnaimimemjmbakcfefmn
## Screenshots ##
[![Vocabulary definitions](https://foosoft.net/projects/yomichan-chrome/img/vocab-thumb.png)](https://foosoft.net/projects/yomichan-chrome/img/vocab.png)
[![Term definitions](https://foosoft.net/projects/yomichan-chrome/img/term-thumb.png)](https://foosoft.net/projects/yomichan-chrome/img/term.png)
[![Kanji information](https://foosoft.net/projects/yomichan-chrome/img/kanji-thumb.png)](https://foosoft.net/projects/yomichan-chrome/img/kanji.png)
[![Options page](https://foosoft.net/projects/yomichan-chrome/img/options-thumb.png)](https://foosoft.net/projects/yomichan-chrome/img/options.png)

View File

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

View File

@ -27,9 +27,9 @@ function sanitizeOptions(options) {
enableAnkiConnect: false,
ankiCardTags: ['yomichan'],
sentenceExtent: 200,
ankiVocabDeck: '',
ankiVocabModel: '',
ankiVocabFields: {},
ankiTermDeck: '',
ankiTermModel: '',
ankiTermFields: {},
ankiKanjiDeck: '',
ankiKanjiModel: '',
ankiKanjiFields: {}

View File

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

View File

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

View File

@ -98,23 +98,23 @@
</div>
<ul class="nav nav-tabs col-sm-offset-2 col-sm-10">
<li class="active"><a href="#vocab" data-toggle="tab">Vocabulary</a></li>
<li class="active"><a href="#term" data-toggle="tab">Terms</a></li>
<li><a href="#kanji" data-toggle="tab">Kanji</a></li>
</ul>
<div class="tab-content col-sm-offset-2 col-sm-10">
<div id="vocab" class="tab-pane fade in active">
<div id="term" class="tab-pane fade in active">
<div class="form-group">
<label class="col-sm-2 control-label" for="anki-vocab-deck">Deck</label>
<label class="col-sm-2 control-label" for="anki-term-deck">Deck</label>
<div class="col-sm-10">
<select class="form-control anki-deck" id="anki-vocab-deck"></select>
<select class="form-control anki-deck" id="anki-term-deck"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="anki-vocab-model">Model</label>
<label class="col-sm-2 control-label" for="anki-term-model">Model</label>
<div class="col-sm-10">
<select class="form-control anki-model" id="anki-vocab-model"></select>
<select class="form-control anki-model" id="anki-term-model"></select>
</div>
</div>

View File

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 286 B

View File

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

View File

@ -117,7 +117,7 @@ class Client {
this.definitions = defs;
this.showPopup(textSource, content);
return bgCanAddDefinitions(defs, ['vocab_kanji', 'vocab_kana']);
return bgCanAddDefinitions(defs, ['term_kanji', 'term_kana']);
})
.then((states) => {
if (states !== null) {

View File

@ -28,8 +28,8 @@
"web_accessible_resources": [
"fg/css/frame.css",
"fg/img/add_kanji.png",
"fg/img/add_vocab_kana.png",
"fg/img/add_vocab_kanji.png",
"fg/img/add_term_kana.png",
"fg/img/add_term_kanji.png",
"fg/img/play_audio.png",
"fg/js/frame.js",
"fg/ttf/kanji-stroke-orders.ttf",

View File

@ -5,8 +5,8 @@
<a href="#" title="Play audio" class="action-play-audio" data-index="{{@index}}"><img src="{{../root}}/img/play_audio.png"></a>
{{/if}}
{{#if enableAnkiConnect}}
<a href="#" title="Add vocabulary as expression" class="action-add-note disabled" data-mode="vocab_kanji" data-index="{{@index}}"><img src="{{../root}}/img/add_vocab_kanji.png"></a>
<a href="#" title="Add vocabulary as reading" class="action-add-note disabled" data-mode="vocab_kana" data-index="{{@index}}"><img src="{{../root}}/img/add_vocab_kana.png"></a>
<a href="#" title="Add term as expression" class="action-add-note disabled" data-mode="term_kanji" data-index="{{@index}}"><img src="{{../root}}/img/add_term_kanji.png"></a>
<a href="#" title="Add term as reading" class="action-add-note disabled" data-mode="term_kana" data-index="{{@index}}"><img src="{{../root}}/img/add_term_kana.png"></a>
{{/if}}
</div>
{{/with}}