diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-06-06 14:47:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-06 14:47:48 -0400 |
commit | 7ae964c8300092040583bdc341525c6579f76e5c (patch) | |
tree | f3c0332becac7da07a50d4bda92f5f6ac88a030c /ext/js/language/dictionary-importer.js | |
parent | 3a095b1f6cfe10b4d6cfa2e1c6d1ad3587dcfea2 (diff) |
Structured content updates (#1733)
* Add support for imageRendering
* Make crisp-edges appearance on Firefox more similar to Chrome
* Refactor
* Add background option
* Move data-image-rendering attribute
* Restructure
* Organize
* Add support for appearance
* Update test dictionary
* Update tests
Diffstat (limited to 'ext/js/language/dictionary-importer.js')
-rw-r--r-- | ext/js/language/dictionary-importer.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/js/language/dictionary-importer.js b/ext/js/language/dictionary-importer.js index a0806a3a..b735953a 100644 --- a/ext/js/language/dictionary-importer.js +++ b/ext/js/language/dictionary-importer.js @@ -361,7 +361,19 @@ class DictionaryImporter { } async _createImageData(data, context, entry, attributes) { - const {path, width: preferredWidth, height: preferredHeight, title, description, pixelated, collapsed, collapsible} = data; + const { + path, + width: preferredWidth, + height: preferredHeight, + title, + description, + pixelated, + imageRendering, + appearance, + background, + collapsed, + collapsible + } = data; const {width, height} = await this._getImageMedia(path, context, entry); const newData = Object.assign({}, attributes, {path, width, height}); if (typeof preferredWidth === 'number') { newData.preferredWidth = preferredWidth; } @@ -369,6 +381,9 @@ class DictionaryImporter { if (typeof title === 'string') { newData.title = title; } if (typeof description === 'string') { newData.description = description; } if (typeof pixelated === 'boolean') { newData.pixelated = pixelated; } + if (typeof imageRendering === 'string') { newData.imageRendering = imageRendering; } + if (typeof appearance === 'string') { newData.appearance = appearance; } + if (typeof background === 'boolean') { newData.background = background; } if (typeof collapsed === 'boolean') { newData.collapsed = collapsed; } if (typeof collapsible === 'boolean') { newData.collapsible = collapsible; } return newData; |