diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-05-18 13:03:36 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-05-21 03:16:50 -0500 |
commit | 7a0dc34cad955fecba8072f5ed3c179ba5a3fd98 (patch) | |
tree | 7e539207950bc274c5504bf5904a49abf0d9aca2 /app/javascript/flavours/glitch/features/compose | |
parent | 09b7532805a349d1a57f4a650c7f41456cda184b (diff) |
reimplement monsterpit bbcode and markdown extensions on top of new glitch-soc formatting system + bbcode feature parity + new `i:am` footer + set content type from `format` bangtag
Diffstat (limited to 'app/javascript/flavours/glitch/features/compose')
-rw-r--r-- | app/javascript/flavours/glitch/features/compose/components/options.js | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/components/options.js b/app/javascript/flavours/glitch/features/compose/components/options.js index 0c94f5514..46b32b4a3 100644 --- a/app/javascript/flavours/glitch/features/compose/components/options.js +++ b/app/javascript/flavours/glitch/features/compose/components/options.js @@ -25,6 +25,14 @@ const messages = defineMessages({ defaultMessage: 'Attach...', id: 'compose.attach', }, + bbcode: { + defaultMessage: 'BBCode', + id: 'compose.content-type.bbcode', + }, + bbdown: { + defaultMessage: 'BBdown', + id: 'compose.content-type.bbdown', + }, change_privacy: { defaultMessage: 'Adjust status privacy', id: 'privacy.change', @@ -232,7 +240,7 @@ class ComposerOptions extends ImmutablePureComponent { const contentTypeItems = { plain: { - icon: 'align-left', + icon: 'file-text', name: 'text/plain', text: <FormattedMessage {...messages.plain} />, }, @@ -242,10 +250,20 @@ class ComposerOptions extends ImmutablePureComponent { text: <FormattedMessage {...messages.html} />, }, markdown: { - icon: 'arrow-circle-down', + icon: 'hashtag', name: 'text/markdown', text: <FormattedMessage {...messages.markdown} />, }, + xbbcode: { + icon: 'thumb-tack', + name: 'text/x-bbcode', + text: <FormattedMessage {...messages.bbcode} />, + }, + xbbcodemarkdown: { + icon: 'arrow-circle-down', + name: 'text/x-bbcode+markdown', + text: <FormattedMessage {...messages.bbdown} />, + }, }; // The result. @@ -315,11 +333,13 @@ class ComposerOptions extends ImmutablePureComponent { {showContentTypeChoice && ( <Dropdown disabled={disabled} - icon={(contentTypeItems[contentType.split('/')[1]] || {}).icon} + icon={(contentTypeItems[contentType.split('/')[1].replace(/[+-]/g, '')] || {}).icon} items={[ - contentTypeItems.plain, - contentTypeItems.html, + contentTypeItems.xbbcodemarkdown, contentTypeItems.markdown, + contentTypeItems.xbbcode, + contentTypeItems.html, + contentTypeItems.plain, ]} onChange={onChangeContentType} onModalClose={onModalClose} |