forked from FooSoft/yomichan
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Able to edit dictionary alias on settings * Fix lint * Persist alias * Alias for tag * Fix lint * update test * draft * handle dom data binder for contenteditable * kanji dict alias * alias frequency dict * update test * add alias to anki * Revert "add alias to anki" This reverts commit 7fd82f1. * Fix alias not working correctly for grouped entries * Remove contenteditable event listener * renaming * reset original name when alias empty && make alias pastable * refactor * Handle contenteditable empty makes observer child triggered * lint * add alias to anki glossary && add dictionary-alias marker * fallback to dictionary name if alias is empty * update handlebars * add alias to test * update test glossary * fixing test * add alias term frequncy & pitch accent anki * Pass dictionary alias to all anki type * update all unit tests * test populate alias after update * clean up * alias for frequency handlebars * Alias for pronunciation dict * lint * refactor * trim alias && save on enter * move edit alias to kebab menu * fix lint issues * Update text * update doc for {dictionary} marker
- Loading branch information
1 parent
9ef85b5
commit ecd9ffc
Showing
30 changed files
with
3,061 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
ext/data/templates/anki-field-templates-upgrade-v49.handlebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{{<<<<<<<}} | ||
{{#*inline "glossary-single"}} | ||
{{~#unless brief~}} | ||
{{~#scope~}} | ||
{{~set "any" false~}} | ||
{{~#each definitionTags~}} | ||
{{~#if (op "||" (op "!" @root.compactTags) (op "!" redundant))~}} | ||
{{~#if (get "any")}}, {{else}}<i>({{/if~}} | ||
{{name}} | ||
{{~set "any" true~}} | ||
{{~/if~}} | ||
{{~/each~}} | ||
{{~#unless noDictionaryTag~}} | ||
{{~#if (op "||" (op "!" @root.compactTags) (op "!==" dictionary (get "previousDictionary")))~}} | ||
{{~#if (get "any")}}, {{else}}<i>({{/if~}} | ||
{{dictionary}} | ||
{{~set "any" true~}} | ||
{{~/if~}} | ||
{{~/unless~}} | ||
{{~#if (get "any")}})</i> {{/if~}} | ||
{{~/scope~}} | ||
{{~#if only~}}({{#each only}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}} | ||
{{~/unless~}} | ||
{{~#if (op "<=" glossary.length 1)~}} | ||
{{#each glossary}}{{formatGlossary ../dictionary .}}{{/each}} | ||
{{~else if @root.compactGlossaries~}} | ||
{{#each glossary}}{{formatGlossary ../dictionary .}}{{#unless @last}} | {{/unless}}{{/each}} | ||
{{~else~}} | ||
<ul>{{#each glossary}}<li>{{formatGlossary ../dictionary .}}</li>{{/each}}</ul> | ||
{{~/if~}} | ||
{{~set "previousDictionary" dictionary~}} | ||
{{/inline}} | ||
{{=======}} | ||
{{#*inline "glossary-single"}} | ||
{{~#unless brief~}} | ||
{{~#scope~}} | ||
{{~set "any" false~}} | ||
{{~#each definitionTags~}} | ||
{{~#if (op "||" (op "!" @root.compactTags) (op "!" redundant))~}} | ||
{{~#if (get "any")}}, {{else}}<i>({{/if~}} | ||
{{name}} | ||
{{~set "any" true~}} | ||
{{~/if~}} | ||
{{~/each~}} | ||
{{~#unless noDictionaryTag~}} | ||
{{~#if (op "||" (op "!" @root.compactTags) (op "!==" dictionary (get "previousDictionary")))~}} | ||
{{~#if (get "any")}}, {{else}}<i>({{/if~}} | ||
{{dictionaryAlias}} | ||
{{~set "any" true~}} | ||
{{~/if~}} | ||
{{~/unless~}} | ||
{{~#if (get "any")}})</i> {{/if~}} | ||
{{~/scope~}} | ||
{{~#if only~}}({{#each only}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}} | ||
{{~/unless~}} | ||
{{~#if (op "<=" glossary.length 1)~}} | ||
{{#each glossary}}{{formatGlossary ../dictionary .}}{{/each}} | ||
{{~else if @root.compactGlossaries~}} | ||
{{#each glossary}}{{formatGlossary ../dictionary .}}{{#unless @last}} | {{/unless}}{{/each}} | ||
{{~else~}} | ||
<ul>{{#each glossary}}<li>{{formatGlossary ../dictionary .}}</li>{{/each}}</ul> | ||
{{~/if~}} | ||
{{~set "previousDictionary" dictionary~}} | ||
{{/inline}} | ||
{{>>>>>>>}} | ||
|
||
{{<<<<<<<}} | ||
{{#*inline "dictionary"}} | ||
{{~definition.dictionary~}} | ||
{{/inline}} | ||
{{=======}} | ||
{{#*inline "dictionary"}} | ||
{{~definition.dictionary~}} | ||
{{/inline}} | ||
|
||
{{#*inline "dictionary-alias"}} | ||
{{~definition.dictionaryAlias~}} | ||
{{/inline}} | ||
{{>>>>>>>}} | ||
|
||
{{<<<<<<<}} | ||
{{#*inline "frequencies"}} | ||
{{~#if (op ">" definition.frequencies.length 0)~}} | ||
<ul style="text-align: left;"> | ||
{{~#each definition.frequencies~}} | ||
<li> | ||
{{~#if (op "!==" ../definition.type "kanji")~}} | ||
{{~#if (op "||" (op ">" ../uniqueExpressions.length 1) (op ">" ../uniqueReadings.length 1))~}}( | ||
{{~furigana expression reading~}} | ||
) {{/if~}} | ||
{{~/if~}} | ||
{{~dictionary}}: {{frequency~}} | ||
</li> | ||
{{~/each~}} | ||
</ul> | ||
{{~/if~}} | ||
{{/inline}} | ||
{{=======}} | ||
{{#*inline "frequencies"}} | ||
{{~#if (op ">" definition.frequencies.length 0)~}} | ||
<ul style="text-align: left;"> | ||
{{~#each definition.frequencies~}} | ||
<li> | ||
{{~#if (op "!==" ../definition.type "kanji")~}} | ||
{{~#if (op "||" (op ">" ../uniqueExpressions.length 1) (op ">" ../uniqueReadings.length 1))~}}( | ||
{{~furigana expression reading~}} | ||
) {{/if~}} | ||
{{~/if~}} | ||
{{~dictionaryAlias}}: {{frequency~}} | ||
</li> | ||
{{~/each~}} | ||
</ul> | ||
{{~/if~}} | ||
{{/inline}} | ||
{{>>>>>>>}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.