From a5efe5032247162e2a88554d39110ae1270544a8 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 7 Jan 2017 21:11:52 -0800 Subject: [PATCH] add dictionary tags --- ext/bg/js/translator.js | 9 ++++++++- ext/fg/css/frame.css | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index 2b6b87c1..374c6087 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -54,6 +54,13 @@ class Translator { let definitions = []; for (const deinflection of deinflections) { for (const definition of deinflection.definitions) { + const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta)); + tags.push(sanitizeTag({ + name: definition.dictionary, + category: 'dictionary', + order: 100 + })); + definitions.push({ source: deinflection.source, reasons: deinflection.reasons, @@ -63,7 +70,7 @@ class Translator { expression: definition.expression, reading: definition.reading, glossary: definition.glossary, - tags: sortTags(definition.tags.map(tag => buildTag(tag, definition.tagMeta))) + tags: sortTags(tags) }); } } diff --git a/ext/fg/css/frame.css b/ext/fg/css/frame.css index 6b608a63..f270fa54 100644 --- a/ext/fg/css/frame.css +++ b/ext/fg/css/frame.css @@ -75,6 +75,10 @@ body { background-color: #d9534f; } +.tag-dictionary { + background-color: #aa66cc; +} + .action-bar { float: right; }