From d98f4566bc856e04f2f6a7d9a7bf49e30867551e Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 17 Dec 2016 18:45:19 -0800 Subject: WIP --- tmpl/term.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmpl/term.html') diff --git a/tmpl/term.html b/tmpl/term.html index 7d60e42a..fb50e7d7 100644 --- a/tmpl/term.html +++ b/tmpl/term.html @@ -23,7 +23,7 @@
{{#each tags}} - {{name}} + {{tag}} {{/each}}
-- cgit v1.2.3 From 5c755043fa2fb23f94f898fc57828277d7b02049 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 17 Dec 2016 19:30:26 -0800 Subject: CWIP --- ext/bg/js/database.js | 4 ++-- ext/bg/js/templates.js | 4 ++-- ext/bg/js/translator.js | 4 ++-- ext/bg/js/util.js | 2 +- tmpl/kanji.html | 2 +- tmpl/term.html | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tmpl/term.html') diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index 05cb8acd..980e9e40 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -231,7 +231,7 @@ class Database { for (const tag in tagMeta || {}) { const meta = tagMeta[tag]; rows.push({ - tag, + name: tag, category: meta.category, notes: meta.notes, order: meta.order, @@ -252,8 +252,8 @@ class Database { reading, tags, rules, + score, glossary, - score: parseInt(score), dictionary: title }); } diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index 2070f276..1e35f17e 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -70,7 +70,7 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia + "\" title=\"" + alias4(((helper = (helper = helpers.notes || (depth0 != null ? depth0.notes : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"notes","hash":{},"data":data}) : helper))) + "\">" - + alias4(((helper = (helper = helpers.tag || (depth0 != null ? depth0.tag : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tag","hash":{},"data":data}) : helper))) + + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + "\n"; },"8":function(container,depth0,helpers,partials,data) { return "
  • " @@ -194,7 +194,7 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial + "\" title=\"" + alias4(((helper = (helper = helpers.notes || (depth0 != null ? depth0.notes : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"notes","hash":{},"data":data}) : helper))) + "\">" - + alias4(((helper = (helper = helpers.tag || (depth0 != null ? depth0.tag : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tag","hash":{},"data":data}) : helper))) + + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + "\n"; },"15":function(container,depth0,helpers,partials,data) { return "
  • " diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index 1d143320..13bf1427 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -140,7 +140,7 @@ class Translator { const tagItems = []; for (const tag of definition.tags) { const tagItem = { - tag, + name: tag, category: 'default', order: Number.MAX_SAFE_INTEGER, notes: '' @@ -168,7 +168,7 @@ class Translator { const tagItems = []; for (const tag of definition.tags) { const tagItem = { - tag, + name: tag, category: 'default', order: Number.MAX_SAFE_INTEGER, notes: '' diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index a28692dc..dc606a73 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -97,7 +97,7 @@ function sortTermDefs(definitions) { } function applyTagMeta(tag, meta) { - const symbol = tag.tag.split(':')[0]; + const symbol = tag.name.split(':')[0]; for (const prop in meta[symbol] || {}) { tag[prop] = meta[symbol][prop]; } diff --git a/tmpl/kanji.html b/tmpl/kanji.html index c40bb3bc..380e16ff 100644 --- a/tmpl/kanji.html +++ b/tmpl/kanji.html @@ -30,7 +30,7 @@
    {{#each tags}} - {{tag}} + {{name}} {{/each}}
    diff --git a/tmpl/term.html b/tmpl/term.html index fb50e7d7..36f8f4fc 100644 --- a/tmpl/term.html +++ b/tmpl/term.html @@ -23,7 +23,7 @@
    {{#each tags}} - {{tag}} + {{name}} {{/each}}
    -- cgit v1.2.3 From 04ff83cc6cc03c5ca868fcc86eeaa85d8f4e0bc8 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 18 Dec 2016 12:24:07 -0800 Subject: Don't show list numbering on glossary lists with only one item --- ext/bg/js/templates.js | 36 ++++++++++++++++++++++++++++++------ tmpl/kanji.html | 6 ++++++ tmpl/term.html | 6 ++++++ 3 files changed, 42 insertions(+), 6 deletions(-) (limited to 'tmpl/term.html') diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index 1e35f17e..c9d0052c 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -73,9 +73,21 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + "
    \n"; },"8":function(container,depth0,helpers,partials,data) { + var stack1; + + return "
      \n" + + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "
    \n"; +},"9":function(container,depth0,helpers,partials,data) { return "
  • " + container.escapeExpression(container.lambda(depth0, depth0)) + "
  • \n"; +},"11":function(container,depth0,helpers,partials,data) { + var stack1; + + return "

    \n " + + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["0"] : stack1), depth0)) + + "\n

    \n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; @@ -91,9 +103,9 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.onyomi : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + " \n \n \n \n\n
    \n" + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.tags : depth0),{"name":"each","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \n\n
    \n
      \n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \n
    \n\n"; + + " \n\n
    \n" + + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(11, data, 0),"data":data})) != null ? stack1 : "") + + "
    \n\n"; },"useData":true}); templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var helper; @@ -197,9 +209,21 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + "\n"; },"15":function(container,depth0,helpers,partials,data) { + var stack1; + + return "
      \n" + + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "
    \n"; +},"16":function(container,depth0,helpers,partials,data) { return "
  • " + container.escapeExpression(container.lambda(depth0, depth0)) + "
  • \n"; +},"18":function(container,depth0,helpers,partials,data) { + var stack1; + + return "

    \n " + + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["0"] : stack1), depth0)) + + "\n

    \n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : {}; @@ -214,9 +238,9 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.rules : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + " \n\n
    \n" + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.tags : depth0),{"name":"each","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \n\n
    \n
      \n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \n
    \n\n"; + + " \n\n
    \n" + + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.program(18, data, 0),"data":data})) != null ? stack1 : "") + + "
    \n\n"; },"useData":true}); templates['term-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { var stack1; diff --git a/tmpl/kanji.html b/tmpl/kanji.html index 380e16ff..e22dd660 100644 --- a/tmpl/kanji.html +++ b/tmpl/kanji.html @@ -35,10 +35,16 @@
    + {{#if glossary.[1]}}
      {{#each glossary}}
    1. {{.}}
    2. {{/each}}
    + {{else}} +

    + {{glossary.[0]}} +

    + {{/if}}
    diff --git a/tmpl/term.html b/tmpl/term.html index 36f8f4fc..6185ca25 100644 --- a/tmpl/term.html +++ b/tmpl/term.html @@ -28,10 +28,16 @@
    + {{#if glossary.[1]}}
      {{#each glossary}}
    1. {{.}}
    2. {{/each}}
    + {{else}} +

    + {{glossary.[0]}} +

    + {{/if}}
    -- cgit v1.2.3 From 238c9e340e5f42f12e6f7f16b1da7b87652aa821 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 18 Dec 2016 22:24:34 -0800 Subject: WIP --- ext/bg/js/database.js | 17 ++++------ ext/bg/js/templates.js | 88 +++++++++++++++++++++++++------------------------- ext/fg/css/frame.css | 2 +- tmpl/term.html | 6 ++-- 4 files changed, 55 insertions(+), 58 deletions(-) (limited to 'tmpl/term.html') diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index 73acd1ae..7ad7d410 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -30,10 +30,10 @@ class Database { this.db = new Dexie('dict'); this.db.version(1).stores({ - terms: '++id, dictionary, expression, reading', - kanji: '++, dictionary, character', - tagMeta: '++, dictionary', - dictionaries: '++, title, version', + terms: '++id,dictionary,expression,reading', + kanji: '++,dictionary,character', + tagMeta: '++,dictionary', + dictionaries: '++,title,version', }); return this.db.open(); @@ -48,7 +48,7 @@ class Database { return this.db.delete().then(() => { this.db = null; this.tagMetaCache = {}; - this.prepare(); + return this.prepare(); }); } @@ -64,6 +64,7 @@ class Database { expression: row.expression, reading: row.reading, tags: splitField(row.tags), + rules: splitField(row.rules), glossary: row.glossary, score: row.score, dictionary: row.dictionary, @@ -123,11 +124,7 @@ class Database { const tagMeta = {}; promises.push( this.db.tagMeta.where('dictionary').equals(dictionary).each(row => { - tagMeta[row.name] = { - category: row.category, - notes: row.notes, - order: row.order - }; + tagMeta[row.name] = {category: row.category, notes: row.notes, order: row.order}; }).then(() => { this.tagMetaCache[dictionary] = tagMeta; }) diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index c9d0052c..94dfd4ee 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -45,6 +45,30 @@ templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(c + alias4(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"root","hash":{},"data":data}) : helper))) + "/css/frame.css\">\n \n \n"; },"useData":true}); +templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var helper; + + return "" + + container.escapeExpression(((helper = (helper = helpers.kanji || (depth0 != null ? depth0.kanji : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"kanji","hash":{},"data":data}) : helper))) + + "\n"; +},"useData":true}); +templates['kanji-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { + var stack1; + + return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); +},"2":function(container,depth0,helpers,partials,data,blockParams,depths) { + var stack1; + + return ((stack1 = container.invokePartial(partials["kanji.html"],depth0,{"name":"kanji.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); +},"4":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 ((stack1 = container.invokePartial(partials["header.html"],depth0,{"name":"header.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") + + ((stack1 = container.invokePartial(partials["footer.html"],depth0,{"name":"footer.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); +},"usePartial":true,"useData":true,"useDepths":true}); templates['kanji.html'] = template({"1":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; @@ -107,30 +131,6 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(11, data, 0),"data":data})) != null ? stack1 : "") + " \n\n"; },"useData":true}); -templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper; - - return "" - + container.escapeExpression(((helper = (helper = helpers.kanji || (depth0 != null ? depth0.kanji : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"kanji","hash":{},"data":data}) : helper))) - + "\n"; -},"useData":true}); -templates['kanji-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = container.invokePartial(partials["kanji.html"],depth0,{"name":"kanji.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"4":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 ((stack1 = container.invokePartial(partials["header.html"],depth0,{"name":"header.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["footer.html"],depth0,{"name":"footer.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"usePartial":true,"useData":true,"useDepths":true}); templates['model.html'] = template({"1":function(container,depth0,helpers,partials,data) { return "
  • " + container.escapeExpression(container.lambda(depth0, depth0)) @@ -148,6 +148,23 @@ templates['model.html'] = template({"1":function(container,depth0,helpers,partia + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.markers : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + " \n \n \n \n\n"; },"useData":true}); +templates['term-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { + var stack1; + + return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); +},"2":function(container,depth0,helpers,partials,data,blockParams,depths) { + var stack1; + + return ((stack1 = container.invokePartial(partials["term.html"],depth0,{"name":"term.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); +},"4":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 ((stack1 = container.invokePartial(partials["header.html"],depth0,{"name":"header.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") + + ((stack1 = container.invokePartial(partials["footer.html"],depth0,{"name":"footer.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); +},"usePartial":true,"useData":true,"useDepths":true}); templates['term.html'] = template({"1":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; @@ -191,7 +208,7 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial },"10":function(container,depth0,helpers,partials,data) { var stack1; - return " " + return " " + container.escapeExpression(container.lambda(depth0, depth0)) + " " + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : {},(data && data.last),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") @@ -234,29 +251,12 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.addable : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + " \n\n" + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.reading : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(8, data, 0),"data":data})) != null ? stack1 : "") - + "\n
    \n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.rules : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "\n
    \n" + + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.reasons : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "
    \n\n
    \n" + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.tags : depth0),{"name":"each","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "
    \n\n
    \n" + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.program(18, data, 0),"data":data})) != null ? stack1 : "") + "
    \n
    \n"; },"useData":true}); -templates['term-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = container.invokePartial(partials["term.html"],depth0,{"name":"term.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"4":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 ((stack1 = container.invokePartial(partials["header.html"],depth0,{"name":"header.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["footer.html"],depth0,{"name":"footer.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"usePartial":true,"useData":true,"useDepths":true}); })(); \ No newline at end of file diff --git a/ext/fg/css/frame.css b/ext/fg/css/frame.css index e7b5dedc..597646f2 100644 --- a/ext/fg/css/frame.css +++ b/ext/fg/css/frame.css @@ -100,7 +100,7 @@ body { text-decoration: none; } -.term-rules { +.term-reasons { color: #777; display: inline-block; } diff --git a/tmpl/term.html b/tmpl/term.html index 6185ca25..ce5ade84 100644 --- a/tmpl/term.html +++ b/tmpl/term.html @@ -15,9 +15,9 @@
    {{#kanjiLinks}}{{expression}}{{/kanjiLinks}}
    {{/if}} -
    - {{#each rules}} - {{.}} {{#unless @last}}«{{/unless}} +
    + {{#each reasons}} + {{.}} {{#unless @last}}«{{/unless}} {{/each}}
    -- cgit v1.2.3 From 4c5f93c7a75a7bcfd61dc557ccbd7e8e143e4a9d Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 21 Dec 2016 19:47:50 -0800 Subject: better output for epwing --- ext/bg/js/templates.js | 86 +++++++++++++++++++++++++------------------------- ext/fg/css/frame.css | 10 ++++++ tmpl/term.html | 4 +-- 3 files changed, 54 insertions(+), 46 deletions(-) (limited to 'tmpl/term.html') diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index b46d8813..1480bb17 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -49,30 +49,6 @@ templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(c + alias4(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"root","hash":{},"data":data}) : helper))) + "/css/frame.css\">\n \n \n"; },"useData":true}); -templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper; - - return "
    " - + container.escapeExpression(((helper = (helper = helpers.kanji || (depth0 != null ? depth0.kanji : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"kanji","hash":{},"data":data}) : helper))) - + "\n"; -},"useData":true}); -templates['kanji-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = container.invokePartial(partials["kanji.html"],depth0,{"name":"kanji.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"4":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 ((stack1 = container.invokePartial(partials["header.html"],depth0,{"name":"header.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["footer.html"],depth0,{"name":"footer.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"usePartial":true,"useData":true,"useDepths":true}); templates['kanji.html'] = template({"1":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; @@ -135,31 +111,21 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(11, data, 0),"data":data})) != null ? stack1 : "") + "
    \n\n"; },"useData":true}); -templates['model.html'] = template({"1":function(container,depth0,helpers,partials,data) { - return "
  • " - + container.escapeExpression(container.lambda(depth0, depth0)) - + "
  • \n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; +templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var helper; - return "\n " - + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) - + "\n \n
    \n \n
    \n \n
      \n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.markers : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \n
    \n
    \n \n\n"; + return "" + + container.escapeExpression(((helper = (helper = helpers.kanji || (depth0 != null ? depth0.kanji : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"kanji","hash":{},"data":data}) : helper))) + + "\n"; },"useData":true}); -templates['term-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { +templates['kanji-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { var stack1; return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); },"2":function(container,depth0,helpers,partials,data,blockParams,depths) { var stack1; - return ((stack1 = container.invokePartial(partials["term.html"],depth0,{"name":"term.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); + return ((stack1 = container.invokePartial(partials["kanji.html"],depth0,{"name":"kanji.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); },"4":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) { @@ -169,6 +135,23 @@ templates['term-list.html'] = template({"1":function(container,depth0,helpers,pa + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") + ((stack1 = container.invokePartial(partials["footer.html"],depth0,{"name":"footer.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); },"usePartial":true,"useData":true,"useDepths":true}); +templates['model.html'] = template({"1":function(container,depth0,helpers,partials,data) { + return "
  • " + + container.escapeExpression(container.lambda(depth0, depth0)) + + "
  • \n"; +},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; + + return "\n " + + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + + "\n \n
    \n \n
    \n \n
      \n" + + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.markers : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "
    \n
    \n
    \n \n\n"; +},"useData":true}); templates['term.html'] = template({"1":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; @@ -242,9 +225,9 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial },"18":function(container,depth0,helpers,partials,data) { var stack1; - return "

    \n " + return "

    " + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["0"] : stack1), depth0)) - + "\n

    \n"; + + "

    \n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : {}; @@ -263,4 +246,21 @@ templates['term.html'] = template({"1":function(container,depth0,helpers,partial + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.program(18, data, 0),"data":data})) != null ? stack1 : "") + " \n\n"; },"useData":true}); +templates['term-list.html'] = template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { + var stack1; + + return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); +},"2":function(container,depth0,helpers,partials,data,blockParams,depths) { + var stack1; + + return ((stack1 = container.invokePartial(partials["term.html"],depth0,{"name":"term.html","hash":{"sequence":(depths[1] != null ? depths[1].sequence : depths[1]),"options":(depths[1] != null ? depths[1].options : depths[1]),"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1])},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); +},"4":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 ((stack1 = container.invokePartial(partials["header.html"],depth0,{"name":"header.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") + + ((stack1 = container.invokePartial(partials["footer.html"],depth0,{"name":"footer.html","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); +},"usePartial":true,"useData":true,"useDepths":true}); })(); \ No newline at end of file diff --git a/ext/fg/css/frame.css b/ext/fg/css/frame.css index 597646f2..d519d4b7 100644 --- a/ext/fg/css/frame.css +++ b/ext/fg/css/frame.css @@ -117,6 +117,11 @@ body { color: #000; } +.term-glossary p { + overflow-x: auto; + white-space: pre; +} + /* kanji styles */ .kanji-glyph { @@ -153,3 +158,8 @@ body { .kanji-glossary li span { color: #000; } + +.kanji-glossary p { + overflow-x: auto; + white-space: pre; +} diff --git a/tmpl/term.html b/tmpl/term.html index ce5ade84..e4a0d02b 100644 --- a/tmpl/term.html +++ b/tmpl/term.html @@ -35,9 +35,7 @@ {{/each}} {{else}} -

    - {{glossary.[0]}} -

    +

    {{glossary.[0]}}

    {{/if}} -- cgit v1.2.3