From b27ec058cae582e8b9ad9e56be0e9be57f865886 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 27 Jan 2019 12:56:07 +0000 Subject: [PATCH 1/4] entity normalizer: add support for opengraph cards --- src/services/entity_normalizer/entity_normalizer.service.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index e69547b6..deffa537 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -215,6 +215,7 @@ export const parseStatus = (data) => { output.id = String(data.id) output.visibility = data.visibility + output.card = data.card output.created_at = new Date(data.created_at) // Converting to string, the right way. From 0924907c64376249433e2fd16278662181c9e856 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 27 Jan 2019 13:47:30 +0000 Subject: [PATCH 2/4] add link-preview component --- src/components/link-preview/link-preview.js | 8 +++ src/components/link-preview/link-preview.vue | 59 ++++++++++++++++++++ src/components/status/status.js | 4 +- src/components/status/status.vue | 4 ++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/components/link-preview/link-preview.js create mode 100644 src/components/link-preview/link-preview.vue diff --git a/src/components/link-preview/link-preview.js b/src/components/link-preview/link-preview.js new file mode 100644 index 00000000..13264afb --- /dev/null +++ b/src/components/link-preview/link-preview.js @@ -0,0 +1,8 @@ +const LinkPreview = { + name: 'LinkPreview', + props: [ + 'card' + ] +} + +export default LinkPreview diff --git a/src/components/link-preview/link-preview.vue b/src/components/link-preview/link-preview.vue new file mode 100644 index 00000000..49de654f --- /dev/null +++ b/src/components/link-preview/link-preview.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/components/status/status.js b/src/components/status/status.js index b14a74ec..681d0373 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -5,6 +5,7 @@ import DeleteButton from '../delete_button/delete_button.vue' import PostStatusForm from '../post_status_form/post_status_form.vue' import UserCardContent from '../user_card_content/user_card_content.vue' import StillImage from '../still-image/still-image.vue' +import LinkPreview from '../link-preview/link-preview.vue' import { filter, find } from 'lodash' import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' @@ -220,7 +221,8 @@ const Status = { DeleteButton, PostStatusForm, UserCardContent, - StillImage + StillImage, + LinkPreview }, methods: { visibilityIcon (visibility) { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 5c956467..e959544b 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -98,6 +98,10 @@ + +
From 2b86f6e883878bcec624d4a99aadac81d87f2826 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 27 Jan 2019 13:57:37 +0000 Subject: [PATCH 3/4] status: only show link preview in main post view --- src/components/status/status.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index e959544b..aa37ad51 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -98,7 +98,7 @@
-