template work

This commit is contained in:
Alex Yatskov 2017-01-26 22:38:59 -08:00
parent 2b783018c1
commit b9addc8428
2 changed files with 58 additions and 72 deletions

View File

@ -37,9 +37,9 @@ templates['fields.html'] = template({"1":function(container,depth0,helpers,parti
},"3":function(container,depth0,helpers,partials,data) { },"3":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return "<div>(" return "<i>("
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tags : depth0),{"name":"each","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tags : depth0),{"name":"each","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ ")</div>"; + ")</i> ";
},"4":function(container,depth0,helpers,partials,data) { },"4":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : {}; var stack1, helper, alias1=depth0 != null ? depth0 : {};
@ -63,12 +63,12 @@ templates['fields.html'] = template({"1":function(container,depth0,helpers,parti
},"9":function(container,depth0,helpers,partials,data) { },"9":function(container,depth0,helpers,partials,data) {
return container.escapeExpression(container.lambda(depth0, depth0)); return container.escapeExpression(container.lambda(depth0, depth0));
},"11":function(container,depth0,helpers,partials,data) { },"11":function(container,depth0,helpers,partials,data) {
var stack1, helper, options, buffer = var stack1, helper, options, buffer = "";
"<div>";
stack1 = ((helper = (helper = helpers.multiLine || (depth0 != null ? depth0.multiLine : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"multiLine","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},options) : helper)); stack1 = ((helper = (helper = helpers.multiLine || (depth0 != null ? depth0.multiLine : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"multiLine","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},options) : helper));
if (!helpers.multiLine) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)} if (!helpers.multiLine) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "</div>"; return buffer;
},"12":function(container,depth0,helpers,partials,data) { },"12":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
@ -98,21 +98,15 @@ templates['fields.html'] = template({"1":function(container,depth0,helpers,parti
},"22":function(container,depth0,helpers,partials,data) { },"22":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.character : stack1), depth0));
+ container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.character : stack1), depth0))
+ "\n";
},"24":function(container,depth0,helpers,partials,data) { },"24":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.dictionary : stack1), depth0));
+ container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.dictionary : stack1), depth0))
+ "\n";
},"26":function(container,depth0,helpers,partials,data) { },"26":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.modeTermKana : depth0),{"name":"if","hash":{},"fn":container.program(27, data, 0),"inverse":container.program(30, data, 0),"data":data})) != null ? stack1 : "");
+ ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.modeTermKana : depth0),{"name":"if","hash":{},"fn":container.program(27, data, 0),"inverse":container.program(30, data, 0),"data":data})) != null ? stack1 : "")
+ "\n";
},"27":function(container,depth0,helpers,partials,data) { },"27":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
@ -152,89 +146,77 @@ templates['fields.html'] = template({"1":function(container,depth0,helpers,parti
+ " [" + " ["
+ alias2(alias1(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.reading : stack1), depth0)) + alias2(alias1(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.reading : stack1), depth0))
+ "]"; + "]";
},"39":function(container,depth0,helpers,partials,data) { },"39":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, alias1=depth0 != null ? depth0 : {}; var stack1, alias1=depth0 != null ? depth0 : {};
return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(40, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(40, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.group : depth0),{"name":"if","hash":{},"fn":container.program(42, data, 0),"inverse":container.program(52, data, 0),"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.group : depth0),{"name":"if","hash":{},"fn":container.program(42, data, 0, blockParams, depths),"inverse":container.program(52, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(54, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(54, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
},"40":function(container,depth0,helpers,partials,data) { },"40":function(container,depth0,helpers,partials,data) {
return "<div style=\"text-align: left;\">"; return "<div style=\"text-align: left;\">";
},"42":function(container,depth0,helpers,partials,data) { },"42":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1; var stack1;
return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},((stack1 = ((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(43, data, 0),"inverse":container.program(50, data, 0),"data":data})) != null ? stack1 : ""); return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},((stack1 = ((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(43, data, 0, blockParams, depths),"inverse":container.program(50, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
},"43":function(container,depth0,helpers,partials,data) { },"43":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1; var stack1;
return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(44, data, 0),"inverse":container.program(47, data, 0),"data":data})) != null ? stack1 : ""); return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(44, data, 0, blockParams, depths),"inverse":container.program(47, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
},"44":function(container,depth0,helpers,partials,data) { },"44":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1; var stack1;
return "<ol>" return "<ol>"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1),{"name":"each","hash":{},"fn":container.program(45, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1),{"name":"each","hash":{},"fn":container.program(45, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</ol>"; + "</ol>";
},"45":function(container,depth0,helpers,partials,data) { },"45":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1; var stack1;
return "<li>" return "<li>"
+ ((stack1 = container.invokePartial(partials["glossary-single"],depth0,{"name":"glossary-single","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + ((stack1 = container.invokePartial(partials["glossary-single"],depth0,{"name":"glossary-single","hash":{"html":(depths[1] != null ? depths[1].html : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ "</li>"; + "</li>";
},"47":function(container,depth0,helpers,partials,data) { },"47":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1; var stack1;
return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1),{"name":"each","hash":{},"fn":container.program(48, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1),{"name":"each","hash":{},"fn":container.program(48, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
},"48":function(container,depth0,helpers,partials,data) { },"48":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1; var stack1;
return " * " return " * "
+ ((stack1 = container.invokePartial(partials["glossary-single"],depth0,{"name":"glossary-single","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); + ((stack1 = container.invokePartial(partials["glossary-single"],depth0,{"name":"glossary-single","hash":{"html":(depths[1] != null ? depths[1].html : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"50":function(container,depth0,helpers,partials,data) { },"50":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return ((stack1 = container.invokePartial(partials["glossary-single"],((stack1 = ((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1)) != null ? stack1["0"] : stack1),{"name":"glossary-single","data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); return ((stack1 = container.invokePartial(partials["glossary-single"],((stack1 = ((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.definitions : stack1)) != null ? stack1["0"] : stack1),{"name":"glossary-single","hash":{"html":(depth0 != null ? depth0.html : depth0)},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"52":function(container,depth0,helpers,partials,data) { },"52":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return ((stack1 = container.invokePartial(partials["glossary-single"],(depth0 != null ? depth0.definition : depth0),{"name":"glossary-single","data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); return ((stack1 = container.invokePartial(partials["glossary-single"],(depth0 != null ? depth0.definition : depth0),{"name":"glossary-single","hash":{"html":(depth0 != null ? depth0.html : depth0)},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"54":function(container,depth0,helpers,partials,data) { },"54":function(container,depth0,helpers,partials,data) {
return "</div>"; return "</div>";
},"56":function(container,depth0,helpers,partials,data) { },"56":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.kunyomi : stack1),{"name":"each","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.kunyomi : stack1),{"name":"each","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n";
},"58":function(container,depth0,helpers,partials,data) { },"58":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.onyomi : stack1),{"name":"each","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.onyomi : stack1),{"name":"each","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n";
},"60":function(container,depth0,helpers,partials,data) { },"60":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.modeTermKana : depth0),{"name":"unless","hash":{},"fn":container.program(28, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+ ((stack1 = helpers.unless.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.modeTermKana : depth0),{"name":"unless","hash":{},"fn":container.program(28, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n";
},"62":function(container,depth0,helpers,partials,data) { },"62":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.sentence : stack1), depth0));
+ container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.sentence : stack1), depth0))
+ "\n";
},"64":function(container,depth0,helpers,partials,data) { },"64":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.tags : stack1),{"name":"each","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.definition : depth0)) != null ? stack1.tags : stack1),{"name":"each","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n";
},"66":function(container,depth0,helpers,partials,data) { },"66":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " " return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(67, data, 0),"inverse":container.program(69, data, 0),"data":data})) != null ? stack1 : "");
+ ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.html : depth0),{"name":"if","hash":{},"fn":container.program(67, data, 0),"inverse":container.program(69, data, 0),"data":data})) != null ? stack1 : "")
+ "\n";
},"67":function(container,depth0,helpers,partials,data) { },"67":function(container,depth0,helpers,partials,data) {
var stack1, alias1=container.lambda, alias2=container.escapeExpression; var stack1, alias1=container.lambda, alias2=container.escapeExpression;

View File

@ -1,17 +1,13 @@
{{#*inline "glossary-single"}} {{#*inline "glossary-single"}}
{{~#if html~}} {{~#if html~}}
{{~#if tags~}} {{~#if tags~}}<i>({{#each tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}})</i> {{/if~}}
<div>({{#each tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}})</div>
{{~/if~}}
{{~#if glossary.[1]~}} {{~#if glossary.[1]~}}
<ul>{{#each glossary}}<li>>{{#multiLine}}{{.}}{{/multiLine}}></li>{{/each}}</ul> <ul>{{#each glossary}}<li>>{{#multiLine}}{{.}}{{/multiLine}}></li>{{/each}}</ul>
{{~else~}} {{~else~}}
<div>{{#multiLine}}{{glossary.[0]}}{{/multiLine}}</div> {{~#multiLine}}{{glossary.[0]}}{{/multiLine~}}
{{~/if~}} {{~/if~}}
{{~else~}} {{~else~}}
{{~#if tags~}} {{~#if tags~}}({{#each tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}}) {{/if~}}
({{#each tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}})
{{~/if~}}
{{~#if glossary.[1]~}} {{~#if glossary.[1]~}}
{{#each glossary}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} {{#each glossary}}{{.}}{{#unless @last}}, {{/unless}}{{/each}}
{{~else~}} {{~else~}}
@ -23,15 +19,23 @@
{{#*inline "audio"}}{{/inline}} {{#*inline "audio"}}{{/inline}}
{{#*inline "character"}} {{#*inline "character"}}
{{definition.character}} {{~definition.character~}}
{{/inline}} {{/inline}}
{{#*inline "dictionary"}} {{#*inline "dictionary"}}
{{definition.dictionary}} {{~definition.dictionary~}}
{{/inline}} {{/inline}}
{{#*inline "expression"}} {{#*inline "expression"}}
{{#if modeTermKana}}{{#if definition.reading}}{{definition.reading}}{{else}}{{definition.expression}}{{/if}}{{else}}{{definition.expression}}{{/if}} {{~#if modeTermKana~}}
{{~#if definition.reading~}}
{{definition.reading}}
{{~else~}}
{{definition.expression}}
{{~/if~}}
{{~else~}}
{{definition.expression}}
{{~/if~}}
{{/inline}} {{/inline}}
{{#*inline "furigana"}} {{#*inline "furigana"}}
@ -46,39 +50,39 @@
{{~#if html}}<div style="text-align: left;">{{/if~}} {{~#if html}}<div style="text-align: left;">{{/if~}}
{{~#if group~}} {{~#if group~}}
{{~#if definition.definitions.[1]~}} {{~#if definition.definitions.[1]~}}
{{~#if html}}<ol>{{#each definition.definitions}}<li>{{> glossary-single}}</li>{{/each}}</ol> {{~#if html}}<ol>{{#each definition.definitions}}<li>{{> glossary-single html=../html}}</li>{{/each}}</ol>
{{~else}}{{#each definition.definitions}}* {{> glossary-single}}{{/each}}{{/if~}} {{~else}}{{#each definition.definitions}} * {{> glossary-single html=../html}}{{/each}}{{/if~}}
{{~else~}} {{~else~}}
{{> glossary-single definition.definitions.[0]}} {{~> glossary-single definition.definitions.[0] html=html~}}
{{~/if~}} {{~/if~}}
{{~else~}} {{~else~}}
{{> glossary-single definition}} {{~> glossary-single definition html=html~}}
{{~/if~}} {{~/if~}}
{{~#if html}}</div>{{/if~}} {{~#if html}}</div>{{/if~}}
{{/inline}} {{/inline}}
{{#*inline "kunyomi"}} {{#*inline "kunyomi"}}
{{#each definition.kunyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} {{~#each definition.kunyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
{{/inline}} {{/inline}}
{{#*inline "onyomi"}} {{#*inline "onyomi"}}
{{#each definition.onyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} {{~#each definition.onyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
{{/inline}} {{/inline}}
{{#*inline "reading"}} {{#*inline "reading"}}
{{#unless modeTermKana}}{{definition.reading}}{{/unless}} {{~#unless modeTermKana}}{{definition.reading}}{{/unless~}}
{{/inline}} {{/inline}}
{{#*inline "sentence"}} {{#*inline "sentence"}}
{{definition.sentence}} {{~definition.sentence~}}
{{/inline}} {{/inline}}
{{#*inline "tags"}} {{#*inline "tags"}}
{{#each definition.tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}} {{~#each definition.tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each~}}
{{/inline}} {{/inline}}
{{#*inline "url"}} {{#*inline "url"}}
{{#if html}}<a href="{{definition.url}}">{{definition.url}}</a>{{else}}{{definition.url}}{{/if}} {{~#if html}}<a href="{{definition.url}}">{{definition.url}}</a>{{else}}{{definition.url}}{{/if~}}
{{/inline}} {{/inline}}
{{~> (lookup . "marker") ~}} {{~> (lookup . "marker") ~}}