From 9c8e602163811fc9a21c5ae78d53d46d7dbc8db7 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 23 Sep 2017 01:50:17 +0200 Subject: Fix custom emojis not detected when used in content warning (#5049) --- app/views/stream_entries/_detailed_status.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/stream_entries/_detailed_status.html.haml') diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml index 6860c6bf3..26e41a10d 100644 --- a/app/views/stream_entries/_detailed_status.html.haml +++ b/app/views/stream_entries/_detailed_status.html.haml @@ -15,7 +15,7 @@ .status__content.p-name.emojify< - if status.spoiler_text? %p{ style: 'margin-bottom: 0' }< - %span.p-summary> #{status.spoiler_text}  + %span.p-summary> #{Formatter.instance.format_spoiler(status)}  %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more') .e-content{ lang: status.language, style: "display: #{status.spoiler_text? ? 'none' : 'block'}; direction: #{rtl_status?(status) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status, custom_emojify: true) -- cgit From 2f079573ed6aed9f27ece623c56a61c8e036574e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 24 Sep 2017 05:58:30 +0200 Subject: In detail status view, display attachment uncropped if there's only one (#5054) * In detail status view, display attachment uncropped if there's only one * Make media spoiler the size of the media it hides, enable on static --- .../mastodon/components/media_gallery.js | 42 +++++++++++++++++----- .../features/status/components/detailed_status.js | 11 +++++- app/javascript/styles/components.scss | 7 ++++ .../stream_entries/_detailed_status.html.haml | 2 +- package.json | 1 + yarn.lock | 18 ++++++++++ 6 files changed, 71 insertions(+), 10 deletions(-) (limited to 'app/views/stream_entries/_detailed_status.html.haml') diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 78a2f5dc4..d84e4229c 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -4,6 +4,8 @@ import PropTypes from 'prop-types'; import IconButton from './icon_button'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { isIOS } from '../is_mobile'; +import classNames from 'classnames'; +import sizeMe from 'react-sizeme'; const messages = defineMessages({ toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' }, @@ -17,6 +19,7 @@ class Item extends React.PureComponent { static propTypes = { attachment: ImmutablePropTypes.map.isRequired, + standalone: PropTypes.bool, index: PropTypes.number.isRequired, size: PropTypes.number.isRequired, onClick: PropTypes.func.isRequired, @@ -25,6 +28,9 @@ class Item extends React.PureComponent { static defaultProps = { autoPlayGif: false, + standalone: false, + index: 0, + size: 1, }; handleMouseEnter = (e) => { @@ -57,7 +63,7 @@ class Item extends React.PureComponent { } render () { - const { attachment, index, size } = this.props; + const { attachment, index, size, standalone } = this.props; let width = 50; let height = 100; @@ -136,7 +142,7 @@ class Item extends React.PureComponent { const autoPlay = !isIOS() && this.props.autoPlayGif; thumbnail = ( -
+