diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js
index 104e26ce..b2fc0651 100644
--- a/ext/bg/js/templates.js
+++ b/ext/bg/js/templates.js
@@ -27,12 +27,14 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
+ ((stack1 = helpers["with"].call(depth0 != null ? depth0 : {},(depths[1] != null ? depths[1].addable : depths[1]),{"name":"with","hash":{},"fn":container.program(3, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " \n";
},"3":function(container,depth0,helpers,partials,data,blockParams,depths) {
- var stack1;
+ var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=container.escapeExpression;
- return " \n";
},"4":function(container,depth0,helpers,partials,data) {
return "disabled";
@@ -107,16 +109,20 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial
+ ((stack1 = helpers["with"].call(depth0 != null ? depth0 : {},(depths[1] != null ? depths[1].addable : depths[1]),{"name":"with","hash":{},"fn":container.program(3, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " \n";
},"3":function(container,depth0,helpers,partials,data,blockParams,depths) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=container.lambda, alias3=container.escapeExpression;
+ var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda;
- return " \n \n \n";
},"4":function(container,depth0,helpers,partials,data) {
return "disabled";
@@ -177,11 +183,9 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial
+ container.escapeExpression(container.lambda(depth0, depth0))
+ "\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {
- var stack1, helper, alias1=depth0 != null ? depth0 : {};
+ var stack1, alias1=depth0 != null ? depth0 : {};
- return "
\n "
- + container.escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"id","hash":{},"data":data}) : helper)))
- + "\n\n"
+ return "
\n"
+ ((stack1 = helpers["with"].call(alias1,(depth0 != null ? depth0.options : depth0),{"name":"with","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.reading : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.program(9, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 1cf1cf6f..8495a354 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -26,6 +26,7 @@ class Client {
this.activateBtn = 2;
this.enabled = false;
this.options = {};
+ this.results = null;
this.fgRoot = chrome.extension.getURL('fg');
chrome.runtime.onMessage.addListener(this.onBgMessage.bind(this));
@@ -107,7 +108,10 @@ class Client {
renderText(
{defs: results, root: this.fgRoot, options: this.options},
'term-list.html',
- (content) => this.showPopup(range, content)
+ (content) => {
+ this.results = results;
+ this.showPopup(range, content, results);
+ }
);
}
});
@@ -118,7 +122,10 @@ class Client {
renderText(
{defs: results, root: this.fgRoot, options: this.options},
'kanji-list.html',
- (content) => this.popup.setContent(content)
+ (content) => {
+ this.results = results;
+ this.popup.setContent(content, results);
+ }
);
});
}
@@ -141,6 +148,7 @@ class Client {
}
this.lastRange = null;
+ this.results = null;
}
setEnabled(enabled) {
diff --git a/util/tmpl/kanji.html b/util/tmpl/kanji.html
index 55cf6b2e..4851826f 100644
--- a/util/tmpl/kanji.html
+++ b/util/tmpl/kanji.html
@@ -3,7 +3,7 @@
{{#if enableAnkiConnect}}
{{#with ../addable}}
-
+
{{/with}}
{{/if}}
diff --git a/util/tmpl/term.html b/util/tmpl/term.html
index 7d0d75d1..465a9388 100644
--- a/util/tmpl/term.html
+++ b/util/tmpl/term.html
@@ -1,12 +1,10 @@
- {{id}}
-
{{#with options}}
{{#if enableAnkiConnect}}
{{#with ../addable}}
-
-
+
+
{{/with}}
{{/if}}