summaryrefslogtreecommitdiff
path: root/ext/data/templates/default-anki-field-templates.handlebars
diff options
context:
space:
mode:
Diffstat (limited to 'ext/data/templates/default-anki-field-templates.handlebars')
-rw-r--r--ext/data/templates/default-anki-field-templates.handlebars32
1 files changed, 27 insertions, 5 deletions
diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars
index 44741866..2ac12934 100644
--- a/ext/data/templates/default-anki-field-templates.handlebars
+++ b/ext/data/templates/default-anki-field-templates.handlebars
@@ -98,20 +98,26 @@
{{/inline}}
{{~#*inline "glossary"~}}
- <div style="text-align: left;">
+ <div style="text-align: left;" class="yomitan-glossary">
{{~#scope~}}
{{~#if (op "===" definition.type "term")~}}
{{~#unless (op "&&" selectedDictionary (op "!=" selectedDictionary definition.dictionary))~}}
{{~> glossary-single definition brief=brief noDictionaryTag=noDictionaryTag ~}}
+ {{~#if definition.glossaryScopedStyles~}}
+ <style>{{{definition.glossaryScopedStyles}}}</style>
+ {{~/if~}}
{{~/unless~}}
{{~else if (op "||" (op "===" definition.type "termGrouped") (op "===" definition.type "termMerged"))~}}
{{~#if (op ">" definition.definitions.length 1)~}}
<ol>
{{~#each definition.definitions~}}
{{~#unless (op "&&" ../selectedDictionary (op "!=" ../selectedDictionary dictionary))~}}
- <li>
+ <li data-dictionary="{{dictionary}}">
{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}
</li>
+ {{~#if dictScopedStyles~}}
+ <style>{{{dictScopedStyles}}}</style>
+ {{~/if~}}
{{~/unless~}}
{{~/each~}}
</ol>
@@ -119,6 +125,9 @@
{{~#each definition.definitions~}}
{{~#unless (op "&&" ../selectedDictionary (op "!=" ../selectedDictionary dictionary))~}}
{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}
+ {{~#if glossaryScopedStyles~}}
+ <style>{{{glossaryScopedStyles}}}</style>
+ {{~/if~}}
{{~/unless~}}
{{~/each~}}
{{~/if~}}
@@ -142,15 +151,28 @@
{{/inline}}
{{~#*inline "glossary-first"~}}
- <div style="text-align: left;">
+ <div style="text-align: left;" class="yomitan-glossary">
{{~#scope~}}
{{~#if (op "===" definition.type "term")~}}
{{~> glossary-single definition brief=brief noDictionaryTag=noDictionaryTag ~}}
+ {{~#if definition.glossaryScopedStyles~}}
+ <style>{{{definition.glossaryScopedStyles}}}</style>
+ {{~/if~}}
{{~else if (op "||" (op "===" definition.type "termGrouped") (op "===" definition.type "termMerged"))~}}
{{~#if (op ">" definition.definitions.length 1)~}}
- {{~#with definition.definitions.[0]~}}{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}{{~/with~}}
+ {{~#with definition.definitions.[0]~}}
+ {{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}
+ {{~#if glossaryScopedStyles~}}
+ <style>{{{glossaryScopedStyles}}}</style>
+ {{~/if~}}
+ {{~/with~}}
{{~else~}}
- {{~#with definition.definitions.[0]~}}{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}{{~/with~}}
+ {{~#with definition.definitions.[0]~}}
+ {{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}
+ {{~#if glossaryScopedStyles~}}
+ <style>{{{glossaryScopedStyles}}}</style>
+ {{~/if~}}
+ {{~/with~}}
{{~/if~}}
{{~/if~}}
{{~/scope~}}