This commit is contained in:
Alex Yatskov 2016-04-24 22:06:49 -07:00
parent f466fe7218
commit 4ef620d74c
3 changed files with 70 additions and 47 deletions

View File

@ -19,37 +19,42 @@ templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(c
templates['kanji.html'] = template({"1":function(container,depth0,helpers,partials,data) { templates['kanji.html'] = template({"1":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " <dl class=\"kanji-info\">\n <dt>Meanings</dt>\n" return " <dt>Meanings</dt>\n <dd>\n"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </dl>\n"; + " </dd>\n";
},"2":function(container,depth0,helpers,partials,data) { },"2":function(container,depth0,helpers,partials,data) {
return " <dd>" var stack1;
return " "
+ container.escapeExpression(container.lambda(depth0, depth0)) + container.escapeExpression(container.lambda(depth0, depth0))
+ "</dd>\n"; + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : {},(data && data.last),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
},"4":function(container,depth0,helpers,partials,data) { + "\n";
},"3":function(container,depth0,helpers,partials,data) {
return ", ";
},"5":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " <dl class=\"kanji-info\">\n <dt>Kun</dt>\n" return " <dt>Kunyomi</dt>\n <dd>\n"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.kunyomi : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.kunyomi : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </dl>\n"; + " </dd>\n";
},"6":function(container,depth0,helpers,partials,data) { },"7":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " <dl class=\"kanji-info\">\n <dt>On</dt>\n" return " <dt>Onyomi</dt>\n <dd>\n"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.onyomi : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.onyomi : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </dl>\n"; + " </dd>\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : {}; var stack1, helper, alias1=depth0 != null ? depth0 : {};
return "<div class=\"definition\">\n <div class=\"kanji-info kanji-glyph\">" return "<div class=\"definition\">\n <div class=\"kanji-info kanji-glyph\">"
+ container.escapeExpression(((helper = (helper = helpers.character || (depth0 != null ? depth0.character : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"character","hash":{},"data":data}) : helper))) + container.escapeExpression(((helper = (helper = helpers.character || (depth0 != null ? depth0.character : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"character","hash":{},"data":data}) : helper)))
+ "</div>\n\n" + "</div>\n\n <dl class=\"kanji-info\">\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.glossary : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.glossary : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n" + "\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.kunyomi : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.kunyomi : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n" + "\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.onyomi : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.onyomi : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</div>\n</div>\n"; + " </dl>\n</div>\n</div>\n";
},"useData":true}); },"useData":true});
templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var helper; var helper;

View File

@ -43,18 +43,6 @@ body {
display: inline-block; display: inline-block;
} }
.kanji-glyph {
font-family: "KanjiStrokeOrders";
font-size: 140px;
line-height: 140px;
vertical-align: top;
}
.kanji-info {
float: left;
display: inline-block;
}
.tag { .tag {
border-radius: 0.25em; border-radius: 0.25em;
color: #fff; color: #fff;
@ -85,6 +73,17 @@ body {
background-color: #0275d8; background-color: #0275d8;
} }
.kanji-glyph {
font-family: "KanjiStrokeOrders";
font-size: 140px;
line-height: 140px;
vertical-align: top;
}
.kanji-info {
display: inline-block;
}
ol { ol {
padding-left: 1.2em; padding-left: 1.2em;
} }
@ -97,6 +96,23 @@ li span {
color: #000; color: #000;
} }
dl {
padding: 0.5em;
}
dt { dt {
float: left;
clear: left;
width: 100px;
text-align: right;
font-weight: bold; font-weight: bold;
} }
dt:after {
content: ":";
}
dd {
margin: 0 0 0 110px;
padding: 0 0 0.5em 0;
}

View File

@ -1,31 +1,33 @@
<div class="definition"> <div class="definition">
<div class="kanji-info kanji-glyph">{{character}}</div> <div class="kanji-info kanji-glyph">{{character}}</div>
{{#if glossary}}
<dl class="kanji-info"> <dl class="kanji-info">
{{#if glossary}}
<dt>Meanings</dt> <dt>Meanings</dt>
<dd>
{{#each glossary}} {{#each glossary}}
<dd>{{.}}</dd> {{.}}{{#unless @last}}, {{/unless}}
{{/each}} {{/each}}
</dl> </dd>
{{/if}} {{/if}}
{{#if kunyomi}} {{#if kunyomi}}
<dl class="kanji-info"> <dt>Kunyomi</dt>
<dt>Kun</dt> <dd>
{{#each kunyomi}} {{#each kunyomi}}
<dd>{{.}}</dd> {{.}}{{#unless @last}}, {{/unless}}
{{/each}} {{/each}}
</dl> </dd>
{{/if}} {{/if}}
{{#if onyomi}} {{#if onyomi}}
<dl class="kanji-info"> <dt>Onyomi</dt>
<dt>On</dt> <dd>
{{#each onyomi}} {{#each onyomi}}
<dd>{{.}}</dd> {{.}}{{#unless @last}}, {{/unless}}
{{/each}} {{/each}}
</dl> </dd>
{{/if}} {{/if}}
</dl>
</div> </div>
</div> </div>