From ac9780b8449527a6a7ab5e2031eeb37f7f2291e7 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 29 Oct 2018 14:44:04 +0100 Subject: [Glitch] Include preview cards in status entity in REST API Port 795f0107d23c1c9bd039f6449fa1e094ab7653a7 to glitch-soc --- app/javascript/flavours/glitch/components/status.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 449532ea4..3a22f165b 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -7,6 +7,7 @@ import StatusIcons from './status_icons'; import StatusContent from './status_content'; import StatusActionBar from './status_action_bar'; import AttachmentList from './attachment_list'; +import Card from '../features/status/components/card'; import { injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { MediaGallery, Video } from 'flavours/glitch/util/async-components'; @@ -477,6 +478,15 @@ export default class Status extends ImmutablePureComponent { if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) { background = attachments.getIn([0, 'preview_url']); } + } else if (status.get('card')) { + media = ( + + ); + //TODO: set mediaIcon? } // Here we prepare extra data-* attributes for CSS selectors. -- cgit From bdc23388334f9d683d3829c5880cc6064cc994d0 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 30 Oct 2018 14:39:00 +0100 Subject: Add a “link” status icon for toots with a preview card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/flavours/glitch/components/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 3a22f165b..0c82ea7c6 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -486,7 +486,7 @@ export default class Status extends ImmutablePureComponent { compact /> ); - //TODO: set mediaIcon? + mediaIcon = 'link'; } // Here we prepare extra data-* attributes for CSS selectors. -- cgit From 7e18e95716052d5566f2e31559cbe4a68268f493 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 30 Oct 2018 14:46:48 +0100 Subject: Add a local setting for inline preview cards --- app/javascript/flavours/glitch/components/status.js | 2 +- .../flavours/glitch/features/local_settings/page/index.js | 8 ++++++++ app/javascript/flavours/glitch/reducers/local_settings.js | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 0c82ea7c6..9ff53485e 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -478,7 +478,7 @@ export default class Status extends ImmutablePureComponent { if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) { background = attachments.getIn([0, 'preview_url']); } - } else if (status.get('card')) { + } else if (status.get('card') && settings.get('inline_preview_cards')) { media = ( + + + ), ]; diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js index 19233a963..bf42810e9 100644 --- a/app/javascript/flavours/glitch/reducers/local_settings.js +++ b/app/javascript/flavours/glitch/reducers/local_settings.js @@ -15,6 +15,7 @@ const initialState = ImmutableMap({ always_show_spoilers_field: false, confirm_missing_media_description: false, preselect_on_reply: true, + inline_preview_cards: true, content_warnings : ImmutableMap({ auto_unfold : false, filter : null, -- cgit