|
|
@ -29,6 +29,10 @@ const messages = defineMessages({ |
|
|
|
defaultMessage: 'Adjust status privacy', |
|
|
|
defaultMessage: 'Adjust status privacy', |
|
|
|
id: 'privacy.change', |
|
|
|
id: 'privacy.change', |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
content_type: { |
|
|
|
|
|
|
|
defaultMessage: 'Content type', |
|
|
|
|
|
|
|
id: 'content-type.change', |
|
|
|
|
|
|
|
}, |
|
|
|
direct_long: { |
|
|
|
direct_long: { |
|
|
|
defaultMessage: 'Post to mentioned users only', |
|
|
|
defaultMessage: 'Post to mentioned users only', |
|
|
|
id: 'privacy.direct.long', |
|
|
|
id: 'privacy.direct.long', |
|
|
@ -41,6 +45,10 @@ const messages = defineMessages({ |
|
|
|
defaultMessage: 'Draw something', |
|
|
|
defaultMessage: 'Draw something', |
|
|
|
id: 'compose.attach.doodle', |
|
|
|
id: 'compose.attach.doodle', |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
html: { |
|
|
|
|
|
|
|
defaultMessage: 'HTML', |
|
|
|
|
|
|
|
id: 'compose.content-type.html', |
|
|
|
|
|
|
|
}, |
|
|
|
local_only_long: { |
|
|
|
local_only_long: { |
|
|
|
defaultMessage: 'Do not post to other instances', |
|
|
|
defaultMessage: 'Do not post to other instances', |
|
|
|
id: 'advanced_options.local-only.long', |
|
|
|
id: 'advanced_options.local-only.long', |
|
|
@ -49,6 +57,14 @@ const messages = defineMessages({ |
|
|
|
defaultMessage: 'Local-only', |
|
|
|
defaultMessage: 'Local-only', |
|
|
|
id: 'advanced_options.local-only.short', |
|
|
|
id: 'advanced_options.local-only.short', |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
markdown: { |
|
|
|
|
|
|
|
defaultMessage: 'Markdown', |
|
|
|
|
|
|
|
id: 'compose.content-type.markdown', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
plain: { |
|
|
|
|
|
|
|
defaultMessage: 'Plain text', |
|
|
|
|
|
|
|
id: 'compose.content-type.plain', |
|
|
|
|
|
|
|
}, |
|
|
|
private_long: { |
|
|
|
private_long: { |
|
|
|
defaultMessage: 'Post to followers only', |
|
|
|
defaultMessage: 'Post to followers only', |
|
|
|
id: 'privacy.private.long', |
|
|
|
id: 'privacy.private.long', |
|
|
@ -113,6 +129,7 @@ class ComposerOptions extends ImmutablePureComponent { |
|
|
|
intl: PropTypes.object.isRequired, |
|
|
|
intl: PropTypes.object.isRequired, |
|
|
|
onChangeAdvancedOption: PropTypes.func, |
|
|
|
onChangeAdvancedOption: PropTypes.func, |
|
|
|
onChangeVisibility: PropTypes.func, |
|
|
|
onChangeVisibility: PropTypes.func, |
|
|
|
|
|
|
|
onChangeContentType: PropTypes.func, |
|
|
|
onTogglePoll: PropTypes.func, |
|
|
|
onTogglePoll: PropTypes.func, |
|
|
|
onDoodleOpen: PropTypes.func, |
|
|
|
onDoodleOpen: PropTypes.func, |
|
|
|
onModalClose: PropTypes.func, |
|
|
|
onModalClose: PropTypes.func, |
|
|
@ -120,6 +137,7 @@ class ComposerOptions extends ImmutablePureComponent { |
|
|
|
onToggleSpoiler: PropTypes.func, |
|
|
|
onToggleSpoiler: PropTypes.func, |
|
|
|
onUpload: PropTypes.func, |
|
|
|
onUpload: PropTypes.func, |
|
|
|
privacy: PropTypes.string, |
|
|
|
privacy: PropTypes.string, |
|
|
|
|
|
|
|
contentType: PropTypes.string, |
|
|
|
resetFileKey: PropTypes.number, |
|
|
|
resetFileKey: PropTypes.number, |
|
|
|
spoiler: PropTypes.bool, |
|
|
|
spoiler: PropTypes.bool, |
|
|
|
}; |
|
|
|
}; |
|
|
@ -162,6 +180,7 @@ class ComposerOptions extends ImmutablePureComponent { |
|
|
|
const { |
|
|
|
const { |
|
|
|
acceptContentTypes, |
|
|
|
acceptContentTypes, |
|
|
|
advancedOptions, |
|
|
|
advancedOptions, |
|
|
|
|
|
|
|
contentType, |
|
|
|
disabled, |
|
|
|
disabled, |
|
|
|
allowMedia, |
|
|
|
allowMedia, |
|
|
|
hasMedia, |
|
|
|
hasMedia, |
|
|
@ -169,6 +188,7 @@ class ComposerOptions extends ImmutablePureComponent { |
|
|
|
hasPoll, |
|
|
|
hasPoll, |
|
|
|
intl, |
|
|
|
intl, |
|
|
|
onChangeAdvancedOption, |
|
|
|
onChangeAdvancedOption, |
|
|
|
|
|
|
|
onChangeContentType, |
|
|
|
onChangeVisibility, |
|
|
|
onChangeVisibility, |
|
|
|
onTogglePoll, |
|
|
|
onTogglePoll, |
|
|
|
onModalClose, |
|
|
|
onModalClose, |
|
|
@ -208,6 +228,24 @@ class ComposerOptions extends ImmutablePureComponent { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const contentTypeItems = { |
|
|
|
|
|
|
|
plain: { |
|
|
|
|
|
|
|
icon: 'file', |
|
|
|
|
|
|
|
name: 'text/plain', |
|
|
|
|
|
|
|
text: <FormattedMessage {...messages.plain} />, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
html: { |
|
|
|
|
|
|
|
icon: 'file-text', |
|
|
|
|
|
|
|
name: 'text/html', |
|
|
|
|
|
|
|
text: <FormattedMessage {...messages.html} />, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
markdown: { |
|
|
|
|
|
|
|
icon: 'file-text', |
|
|
|
|
|
|
|
name: 'text/markdown', |
|
|
|
|
|
|
|
text: <FormattedMessage {...messages.markdown} />, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// The result.
|
|
|
|
// The result.
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className='composer--options'> |
|
|
|
<div className='composer--options'> |
|
|
@ -272,6 +310,19 @@ class ComposerOptions extends ImmutablePureComponent { |
|
|
|
title={intl.formatMessage(messages.change_privacy)} |
|
|
|
title={intl.formatMessage(messages.change_privacy)} |
|
|
|
value={privacy} |
|
|
|
value={privacy} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
<Dropdown |
|
|
|
|
|
|
|
icon="code" |
|
|
|
|
|
|
|
items={[ |
|
|
|
|
|
|
|
contentTypeItems.plain, |
|
|
|
|
|
|
|
contentTypeItems.html, |
|
|
|
|
|
|
|
contentTypeItems.markdown, |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
onChange={onChangeContentType} |
|
|
|
|
|
|
|
onModalClose={onModalClose} |
|
|
|
|
|
|
|
onModalOpen={onModalOpen} |
|
|
|
|
|
|
|
title={intl.formatMessage(messages.content_type)} |
|
|
|
|
|
|
|
value={contentType} |
|
|
|
|
|
|
|
/> |
|
|
|
{onToggleSpoiler && ( |
|
|
|
{onToggleSpoiler && ( |
|
|
|
<TextIconButton |
|
|
|
<TextIconButton |
|
|
|
active={spoiler} |
|
|
|
active={spoiler} |
|
|
|