Styling work

This commit is contained in:
Alex Yatskov 2016-04-24 20:50:27 -07:00
parent 62c2120286
commit f466fe7218
4 changed files with 54 additions and 53 deletions

View File

@ -19,38 +19,37 @@ 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 " <dt>Kunyomi:</dt>\n" return " <dl class=\"kanji-info\">\n <dt>Meanings</dt>\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.glossary : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </dl>\n";
},"2":function(container,depth0,helpers,partials,data) { },"2":function(container,depth0,helpers,partials,data) {
var stack1; return " <dd>"
return " <dd>"
+ container.escapeExpression(container.lambda(depth0, depth0)) + container.escapeExpression(container.lambda(depth0, depth0))
+ ((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 : "")
+ "</dd>\n"; + "</dd>\n";
},"3":function(container,depth0,helpers,partials,data) { },"4":function(container,depth0,helpers,partials,data) {
return ", ";
},"5":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " <dt>Onyomi:</dt>\n" return " <dl class=\"kanji-info\">\n <dt>Kun</dt>\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.kunyomi : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
},"7":function(container,depth0,helpers,partials,data) { + " </dl>\n";
return " <li><span>" },"6":function(container,depth0,helpers,partials,data) {
+ container.escapeExpression(container.lambda(depth0, depth0)) var stack1;
+ "</span></li>\n";
return " <dl class=\"kanji-info\">\n <dt>On</dt>\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 : "")
+ " </dl>\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\">" 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 class=\"readings\">\n <dl>\n" + "</div>\n\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.kunyomi : 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.onyomi : depth0),{"name":"if","hash":{},"fn":container.program(5, 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(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </dl>\n </div>\n\n <div class=\"glossary\">\n <ol>\n" + "\n"
+ ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(7, 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(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </ol>\n </div>\n</div>\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,16 @@ body {
display: inline-block; display: inline-block;
} }
.kanji { .kanji-glyph {
background-color: #eee;
display: inline-block;
font-family: "KanjiStrokeOrders"; font-family: "KanjiStrokeOrders";
font-size: 140px; font-size: 140px;
line-height: 140px; line-height: 140px;
vertical-align: top; vertical-align: top;
} }
.readings { .kanji-info {
display: inline-block; float: left;
vertical-align: top; display: inline-block;
} }
.tag { .tag {

View File

@ -82,7 +82,9 @@ class Client {
displayKanji: this.displayKanji displayKanji: this.displayKanji
}; };
handlers[action].call(this, data); if (handlers.hasOwnProperty(action)) {
handlers[action].call(this, data);
}
} }
searchAt(point) { searchAt(point) {

View File

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