aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-05-07 13:43:32 -0700
committerAlex Yatskov <alex@foosoft.net>2016-05-07 13:43:32 -0700
commit9b9985bd4ba810d5a4e985100c68c544df9bccaf (patch)
tree7d5ac749aa12a1a113a74731b33d81cbd960d91c /ext
parent8c1ebe6bcbc3511231c60133cd54722ae97e43ee (diff)
Improvements
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/templates.js8
-rw-r--r--ext/bg/js/yomichan.js2
-rw-r--r--ext/fg/js/api.js4
-rw-r--r--ext/fg/js/client.js4
4 files changed, 9 insertions, 9 deletions
diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js
index d0749d7b..1ed644a1 100644
--- a/ext/bg/js/templates.js
+++ b/ext/bg/js/templates.js
@@ -23,13 +23,13 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
},"2":function(container,depth0,helpers,partials,data,blockParams,depths) {
var helper, alias1=container.lambda, alias2=container.escapeExpression;
- return " <a href=\"#\" title=\"Add Kanji\" class=\"action-link disabled\" data-sequence=\""
+ return " <div class=\"action-bar\">\n <a href=\"#\" title=\"Add Kanji\" class=\"action-link disabled\" data-sequence=\""
+ alias2(alias1((depths[1] != null ? depths[1].sequence : depths[1]), depth0))
+ "\" data-mode=\"kanji\" data-index=\""
+ alias2(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"index","hash":{},"data":data}) : helper)))
+ "\"><img src=\""
+ alias2(alias1((depths[1] != null ? depths[1].root : depths[1]), depth0))
- + "/add_kanji.png\"></a>\n";
+ + "/img/add_kanji.png\"></a>\n </div>\n";
},"4":function(container,depth0,helpers,partials,data) {
var stack1;
@@ -97,13 +97,13 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial
},"2":function(container,depth0,helpers,partials,data,blockParams,depths) {
var helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : {}, alias4=helpers.helperMissing, alias5="function";
- return " <div class=\"action-bar\">\n <a href=\"#\" title=\"Add as expression\" class=\"action-link disabled\" data-sequence=\""
+ return " <div class=\"action-bar\">\n <a href=\"#\" title=\"Add term as expression\" class=\"action-link disabled\" data-sequence=\""
+ alias2(alias1((depths[1] != null ? depths[1].sequence : depths[1]), depth0))
+ "\" data-mode=\"vocabExp\" data-index=\""
+ alias2(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"index","hash":{},"data":data}) : helper)))
+ "\"><img src=\""
+ alias2(alias1((depths[1] != null ? depths[1].root : depths[1]), depth0))
- + "/img/add_expression.png\"></a>\n <a href=\"#\" title=\"Add as reading\" class=\"action-link disabled\" data-sequence=\""
+ + "/img/add_expression.png\"></a>\n <a href=\"#\" title=\"Add term as reading\" class=\"action-link disabled\" data-sequence=\""
+ alias2(alias1((depths[1] != null ? depths[1].sequence : depths[1]), depth0))
+ "\" data-mode=\"vocabReading\" data-index=\""
+ alias2(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"index","hash":{},"data":data}) : helper)))
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index f1cda178..abbcefe4 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -51,7 +51,7 @@ class Yomichan {
onMessage(request, sender, callback) {
const {action, params} = request, handlers = {
- canAddNotes: (definitions) => this.ankiInvoke('canAddNotes', definitions, 'notes', callback),
+ canAddNotes: ({definitions, modes}) => this.ankiInvoke('canAddNotes', {definitions: definitions, modes: modes}, 'notes', callback),
findKanji: (text) => callback(this.translator.findKanji(text)),
findTerm: (text) => callback(this.translator.findTerm(text)),
getOptions: () => callback(this.options),
diff --git a/ext/fg/js/api.js b/ext/fg/js/api.js
index 9026c8d3..e13c1421 100644
--- a/ext/fg/js/api.js
+++ b/ext/fg/js/api.js
@@ -45,6 +45,6 @@ function bgGetState(callback) {
bgSendMessage('getState', null, callback);
}
-function bgCanAddNotes(definitions, callback) {
- bgSendMessage('canAddNotes', definitions, callback);
+function bgCanAddNotes(definitions, modes, callback) {
+ bgSendMessage('canAddNotes', {definitions, modes}, callback);
}
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index b4c1c2d4..4b34ef9a 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -115,7 +115,7 @@ class Client {
this.definitions = definitions;
this.showPopup(range, content);
- bgCanAddNotes(definitions, (states) => {
+ bgCanAddNotes(definitions, ['vocabExp', 'vocabReading'], (states) => {
if (states !== null) {
states.forEach((state, index) => this.popup.sendMessage(
'setActionState',
@@ -149,7 +149,7 @@ class Client {
this.definitions = definitions;
this.popup.setContent(content, definitions);
- bgCanAddNotes(definitions, (states) => {
+ bgCanAddNotes(definitions, ['kanji'], (states) => {
if (states !== null) {
states.forEach((state, index) => this.popup.sendMessage(
'setActionState',