diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index d26feec8..5d9bcf3c 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -199,10 +199,12 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia if (stack1 != null) { buffer += stack1; } return buffer + "\n\n" + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.reasons : depth0),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "\n" + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.frequencies : depth0),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "\n
"; stack1 = ((helper = (helper = helpers.dumpObject || (depth0 != null ? depth0.dumpObject : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"dumpObject","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),options) : helper)); if (!helpers.dumpObject) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)} if (stack1 != null) { buffer += stack1; } return buffer + "\n"; -},"34":function(container,depth0,helpers,partials,data,blockParams,depths) { +},"37":function(container,depth0,helpers,partials,data,blockParams,depths) { var stack1; - return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(35, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"35":function(container,depth0,helpers,partials,data,blockParams,depths) { + return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(38, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); +},"38":function(container,depth0,helpers,partials,data,blockParams,depths) { var stack1; - return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.first),{"name":"unless","hash":{},"fn":container.program(36, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") + return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.first),{"name":"unless","hash":{},"fn":container.program(39, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "\n" + ((stack1 = container.invokePartial(partials.term,depth0,{"name":"term","hash":{"playback":(depths[1] != null ? depths[1].playback : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1]),"grouped":(depths[1] != null ? depths[1].grouped : depths[1]),"debug":(depths[1] != null ? depths[1].debug : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"36":function(container,depth0,helpers,partials,data) { +},"39":function(container,depth0,helpers,partials,data) { return "
No results found.
\n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { var stack1; return "\n\n" - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(34, data, 0, blockParams, depths),"inverse":container.program(38, data, 0, blockParams, depths),"data":data})) != null ? stack1 : ""); + + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(37, data, 0, blockParams, depths),"inverse":container.program(41, data, 0, blockParams, depths),"data":data})) != null ? stack1 : ""); },"main_d": function(fn, props, container, depth0, data, blockParams, depths) { var decorators = container.decorators; diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index 0cd49c27..3dd482ca 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -42,7 +42,7 @@ class Translator { const definitionsGrouped = dictTermsGroup(definitions, dictionaries); for (const definition of definitionsGrouped) { - this.buildTermFrequencies(definition, titles); + await this.buildTermFrequencies(definition, titles); } return {length, definitions: definitionsGrouped}; @@ -53,7 +53,7 @@ class Translator { const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric); for (const definition of definitions) { - this.buildTermFrequencies(definition, titles); + await this.buildTermFrequencies(definition, titles); } return {length, definitions}; diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index 8b1819bd..6c7148dc 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -84,6 +84,10 @@ hr { background-color: #aa66cc; } +.tag-frequency { + background-color: #5cb85c; +} + .actions .disabled { pointer-events: none; cursor: default; diff --git a/tmpl/terms.html b/tmpl/terms.html index ffe52ab8..a130e775 100644 --- a/tmpl/terms.html +++ b/tmpl/terms.html @@ -41,6 +41,14 @@ {{/if}} + {{#if frequencies}} +