enable expression scan toggling on search page
This commit is contained in:
parent
b59a5b8cdb
commit
25af532ab7
@ -25,7 +25,9 @@ async function searchFrontendSetup() {
|
|||||||
const options = await apiOptionsGet(optionsContext);
|
const options = await apiOptionsGet(optionsContext);
|
||||||
if (!options.scanning.enableOnSearchPage) { return; }
|
if (!options.scanning.enableOnSearchPage) { return; }
|
||||||
|
|
||||||
window.frontendInitializationData = {depth: 1, proxy: false};
|
const ignoreNodes = options.scanning.enableOnPopupExpressions ? [] : ['.expression-scan-toggle', '.expression-scan-toggle *'];
|
||||||
|
|
||||||
|
window.frontendInitializationData = {depth: 1, ignoreNodes, proxy: false};
|
||||||
|
|
||||||
const scriptSrcs = [
|
const scriptSrcs = [
|
||||||
'/fg/js/frontend-api-receiver.js',
|
'/fg/js/frontend-api-receiver.js',
|
||||||
|
@ -299,7 +299,7 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
|
|||||||
return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.expressions : depth0),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
|
return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.expressions : depth0),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
|
||||||
},"33":function(container,depth0,helpers,partials,data,blockParams,depths) {
|
},"33":function(container,depth0,helpers,partials,data,blockParams,depths) {
|
||||||
var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", buffer =
|
var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", buffer =
|
||||||
"<div class=\"expression\"><span class=\"expression-"
|
"<div class=\"expression expression-scan-toggle\"><span class=\"expression-"
|
||||||
+ container.escapeExpression(((helper = (helper = helpers.termFrequency || (depth0 != null ? depth0.termFrequency : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"termFrequency","hash":{},"data":data}) : helper)))
|
+ container.escapeExpression(((helper = (helper = helpers.termFrequency || (depth0 != null ? depth0.termFrequency : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"termFrequency","hash":{},"data":data}) : helper)))
|
||||||
+ "\">";
|
+ "\">";
|
||||||
stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : alias2),(options={"name":"kanjiLinks","hash":{},"fn":container.program(34, data, 0, blockParams, depths),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
|
stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : alias2),(options={"name":"kanjiLinks","hash":{},"fn":container.program(34, data, 0, blockParams, depths),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
|
||||||
@ -359,7 +359,7 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
|
|||||||
return "invisible";
|
return "invisible";
|
||||||
},"47":function(container,depth0,helpers,partials,data) {
|
},"47":function(container,depth0,helpers,partials,data) {
|
||||||
var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), buffer =
|
var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), buffer =
|
||||||
" <div class=\"expression\">";
|
" <div class=\"expression expression-scan-toggle\">";
|
||||||
stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"kanjiLinks","hash":{},"fn":container.program(34, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper));
|
stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"kanjiLinks","hash":{},"fn":container.program(34, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper));
|
||||||
if (!helpers.kanjiLinks) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
|
if (!helpers.kanjiLinks) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
|
@ -401,7 +401,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label><input type="checkbox" id="enable-scanning-of-popup-expressions"> Enable scanning of popup expressions</label>
|
<label><input type="checkbox" id="enable-scanning-of-popup-expressions"> Enable scanning of expressions in search results</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -33,7 +33,7 @@ async function popupNestedInitialize(id, depth, parentFrameId, url) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ignoreNodes = options.scanning.enableOnPopupExpressions ? [] : [ '.expression', '.expression *' ];
|
const ignoreNodes = options.scanning.enableOnPopupExpressions ? [] : ['.expression-scan-toggle', '.expression-scan-toggle *'];
|
||||||
|
|
||||||
window.frontendInitializationData = {id, depth, parentFrameId, ignoreNodes, url, proxy: true};
|
window.frontendInitializationData = {id, depth, parentFrameId, ignoreNodes, url, proxy: true};
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
{{#if merged}}
|
{{#if merged}}
|
||||||
{{~#each expressions~}}
|
{{~#each expressions~}}
|
||||||
<div class="expression"><span class="expression-{{termFrequency}}">{{#kanjiLinks}}{{#furigana}}{{{.}}}{{/furigana}}{{/kanjiLinks}}</span><div class="peek-wrapper">
|
<div class="expression expression-scan-toggle"><span class="expression-{{termFrequency}}">{{#kanjiLinks}}{{#furigana}}{{{.}}}{{/furigana}}{{/kanjiLinks}}</span><div class="peek-wrapper">
|
||||||
{{~#if ../playback~}}
|
{{~#if ../playback~}}
|
||||||
<a href="#" class="action-play-audio"><img src="/mixed/img/play-audio.svg" title="Play audio" alt></a>
|
<a href="#" class="action-play-audio"><img src="/mixed/img/play-audio.svg" title="Play audio" alt></a>
|
||||||
{{~/if~}}
|
{{~/if~}}
|
||||||
@ -70,7 +70,7 @@
|
|||||||
</div><span class="{{#if @last}}invisible{{/if}}">、</span></div>
|
</div><span class="{{#if @last}}invisible{{/if}}">、</span></div>
|
||||||
{{~/each~}}
|
{{~/each~}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="expression">{{#kanjiLinks}}{{#furigana}}{{{.}}}{{/furigana}}{{/kanjiLinks}}</div>
|
<div class="expression expression-scan-toggle">{{#kanjiLinks}}{{#furigana}}{{{.}}}{{/furigana}}{{/kanjiLinks}}</div>
|
||||||
{{#if termTags}}
|
{{#if termTags}}
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
{{#each termTags}}
|
{{#each termTags}}
|
||||||
|
Loading…
Reference in New Issue
Block a user