From 5b58a9aeef66194bc51fe25f66aebf95f673089a Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 9 Jan 2021 16:02:03 -0500 Subject: [PATCH] Update term tags display and fix a layout issue (#1208) * Fix layout issue with term expression display * Update display of term tags * Update tag notification to include disambiguation information --- ext/mixed/css/display.css | 33 ++++++++++++++++-- ext/mixed/display-templates.html | 9 ++++- ext/mixed/js/dictionary-data-util.js | 37 +++++++++++++++++++- ext/mixed/js/display-generator.js | 52 ++++++++++++++++++++++++++++ ext/mixed/js/display-notification.js | 9 +++-- ext/mixed/js/display.js | 7 ++-- 6 files changed, 137 insertions(+), 10 deletions(-) diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index fd320904..e33ef802 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -699,6 +699,26 @@ button.action-button[data-icon=source-term]::before { .tag-inner { display: block; } +.tag-details-disambiguation-list::before { + content: 'Only: '; +} +.tag-details-disambiguation-list ruby>rt { + display: inline; + font-size: 1em; +} +.tag-details-disambiguation-list ruby>rt::before { + content: '('; +} +.tag-details-disambiguation-list ruby>rt::after { + content: ')'; +} +.tag-details-disambiguation-list[data-unmatched-expression-count='0'], +.tag-details-disambiguation-list:not([data-unmatched-expression-count]) { + display: none; +} +.tag-details-disambiguation:not(:last-child)::after { + content: ', '; +} /* Entries */ @@ -755,13 +775,13 @@ button.action-button[data-icon=source-term]::before { display: inline; } .term-expression { - display: inline; + display: inline-block; } .term-expression-details { display: inline; } .term-expression-details>.tags { - display: inline; + display: none; } .term-expression-details>.frequencies { display: none; @@ -769,6 +789,15 @@ button.action-button[data-icon=source-term]::before { .term-expression-list>.term-expression:not(:last-of-type)>.term-expression-text-container>.term-expression-text::after { content: '\3001'; } +.term-details { + display: inline; +} +.term-tags { + display: inline; +} +.entry[data-expression-multi=true] .term-details { + display: block; +} /* Entry indicator */ diff --git a/ext/mixed/display-templates.html b/ext/mixed/display-templates.html index ac42e138..83232b4c 100644 --- a/ext/mixed/display-templates.html +++ b/ext/mixed/display-templates.html @@ -15,7 +15,10 @@
-
+
+
+
+
@@ -137,6 +140,10 @@
+