From d41c9a717ca3f52b0a67bbb2b0ab8b0c898bba4b Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 14 Jun 2020 13:16:08 +0200 Subject: [PATCH 1/4] Polls: Construct an html field during normalization. --- src/components/poll/poll.vue | 8 +++++++- .../entity_normalizer/entity_normalizer.service.js | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue index 56e91cca..28f90006 100644 --- a/src/components/poll/poll.vue +++ b/src/components/poll/poll.vue @@ -17,7 +17,7 @@ {{ percentageForOption(option.votes_count) }}% - {{ option.title }} +
{ output.summary_html = addEmojis(escape(data.spoiler_text), data.emojis) output.external_url = data.url output.poll = data.poll + if (output.poll) { + output.poll.options = (output.poll.options || []).map(field => { + field.title_html = addEmojis(field.title, data.emojis) + return field + }) + } output.pinned = data.pinned output.muted = data.muted } else { From 72ee51c85c9ab74de2009b90cfd7e3e50a2e00af Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 14 Jun 2020 13:09:14 +0000 Subject: [PATCH 2/4] Apply suggestion to src/services/entity_normalizer/entity_normalizer.service.js --- .../entity_normalizer/entity_normalizer.service.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index e93eea5b..883e7a02 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -259,10 +259,10 @@ export const parseStatus = (data) => { output.external_url = data.url output.poll = data.poll if (output.poll) { - output.poll.options = (output.poll.options || []).map(field => { - field.title_html = addEmojis(field.title, data.emojis) - return field - }) + output.poll.options = (output.poll.options || []).map(field => ({ + ...field, + title_html: addEmojis(field.title, data.emojis) + })) } output.pinned = data.pinned output.muted = data.muted From 8427c5a067a8b06ebb1e47d23ff3f70a16f921b8 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 15 Jun 2020 09:59:39 +0200 Subject: [PATCH 3/4] Changelog: Add info about poll option emoji. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad03c760..829f408f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add better visual indication for drag-and-drop for files ### Fixed +- Custom Emoji will display in poll options now. - Status ellipsis menu closes properly when selecting certain options - Cropped images look correct in Chrome - Newlines in the muted words settings work again From b0b33be9ddeb96fe808770604f6fab9c4d8d15c0 Mon Sep 17 00:00:00 2001 From: lain Date: Thu, 18 Jun 2020 14:41:40 +0200 Subject: [PATCH 4/4] Poll, StatusContent: Move emoji css to status body. --- src/components/poll/poll.vue | 6 ----- .../status_content/status_content.vue | 24 +++++++++---------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue index 28f90006..adbb0555 100644 --- a/src/components/poll/poll.vue +++ b/src/components/poll/poll.vue @@ -75,12 +75,6 @@ @import '../../_variables.scss'; .poll { - img.emoji { - vertical-align: middle; - object-fit: contain; - width: 32px; - height: 32px; - } .votes { display: flex; flex-direction: column; diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue index 8c2e8749..89f917dc 100644 --- a/src/components/status_content/status_content.vue +++ b/src/components/status_content/status_content.vue @@ -164,23 +164,23 @@ $status-margin: 0.75em; word-break: break-all; } + img, video { + max-width: 100%; + max-height: 400px; + vertical-align: middle; + object-fit: contain; + + &.emoji { + width: 32px; + height: 32px; + } + } + .status-content { font-family: var(--postFont, sans-serif); line-height: 1.4em; white-space: pre-wrap; - img, video { - max-width: 100%; - max-height: 400px; - vertical-align: middle; - object-fit: contain; - - &.emoji { - width: 32px; - height: 32px; - } - } - blockquote { margin: 0.2em 0 0.2em 2em; font-style: italic;