From caf067883275f9b46259c2dbbf1f36aafc7e9108 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Tue, 14 Jun 2016 09:05:40 -0700 Subject: [PATCH] Cleanup --- ext/bg/js/templates.js | 22 +++++++++------------- ext/fg/js/frame.js | 8 ++++---- tmpl/term.html | 8 ++++---- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index 3408b334..b09c49dd 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -95,9 +95,9 @@ templates['kanji-list.html'] = template({"1":function(container,depth0,helpers,p templates['term.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : {}; - return "
\n \n \n"; },"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"; + var 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) { var stack1, helper, options, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", buffer = diff --git a/ext/fg/js/frame.js b/ext/fg/js/frame.js index 376d4826..339958f2 100644 --- a/ext/fg/js/frame.js +++ b/ext/fg/js/frame.js @@ -26,8 +26,8 @@ function registerKanjiLinks() { } } -function registerLearnLinks() { - for (const link of [].slice.call(document.getElementsByClassName('action-learn'))) { +function registerAddNoteLinks() { + for (const link of [].slice.call(document.getElementsByClassName('action-add-note'))) { link.addEventListener('click', (e) => { e.preventDefault(); const ds = e.currentTarget.dataset; @@ -48,7 +48,7 @@ function registerPronounceLinks() { function onDomContentLoaded() { registerKanjiLinks(); - registerLearnLinks(); + registerAddNoteLinks(); registerPronounceLinks(); } @@ -61,7 +61,7 @@ function onMessage(e) { function api_setActionState({index, state, sequence}) { for (const mode in state) { - const matches = document.querySelectorAll(`.action-learn[data-sequence="${sequence}"][data-index="${index}"][data-mode="${mode}"]`); + const matches = document.querySelectorAll(`.action-bar[data-sequence="${sequence}"] .action-add-note[data-index="${index}"][data-mode="${mode}"]`); if (matches.length === 0) { return; } diff --git a/tmpl/term.html b/tmpl/term.html index b6861b03..ccc321e6 100644 --- a/tmpl/term.html +++ b/tmpl/term.html @@ -1,10 +1,10 @@
{{#with options}} -
- +
+ {{#if enableAnkiConnect}} - - + + {{/if}}
{{/with}}