diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/textbox.jsx | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index 23ecfb57b..b84cc9922 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -129,12 +129,12 @@ export default class Textbox extends React.Component { } render() { + const hastext = this.props.messageText.length > 0; + let previewLink = null; if (Utils.isFeatureEnabled(PreReleaseFeatures.MARKDOWN_PREVIEW)) { - const previewLinkVisible = this.props.messageText.length > 0; previewLink = ( <a - style={{visibility: previewLinkVisible ? 'visible' : 'hidden'}} onClick={this.showPreview} className='textbox-preview-link' > @@ -153,6 +153,51 @@ export default class Textbox extends React.Component { ); } + let helptext = ( + <div + style={{visibility: hastext ? 'visible' : 'hidden', opacity: hastext ? '1' : '0'}} + className='help_format_text' + > + <b> + <FormattedMessage + id='textbox.bold' + defaultMessage='**bold**' + /> + </b> + <i> + <FormattedMessage + id='textbox.italic' + defaultMessage='_italic_' + /> + </i> + <span>~~<strike> + <FormattedMessage + id='textbox.strike' + defaultMessage='strike' + /> + </strike>~~ </span> + <code> + <FormattedMessage + id='textbox.inlinecode' + defaultMessage='`inline code`' + /> + </code> + <code> + <FormattedMessage + id='textbox.preformatted' + defaultMessage='```preformatted```' + /> + </code> + <span> + <FormattedMessage + id='textbox.quote' + defaultMessage='>quote' + /> + </span> + {previewLink} + </div> + ); + return ( <div ref='wrapper' @@ -184,7 +229,7 @@ export default class Textbox extends React.Component { dangerouslySetInnerHTML={{__html: this.state.preview ? TextFormatting.formatText(this.props.messageText) : ''}} > </div> - {previewLink} + {helptext} <a target='_blank' href='http://docs.mattermost.com/help/getting-started/messaging-basics.html' |