summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_post.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-08-14 09:28:24 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-08-14 09:28:24 -0400
commitb9aef9f2a6b90663cb7ba4ff9e42560c145b631d (patch)
tree194e31d063e31009a15b994bbc34ad6497292e17 /web/react/components/create_post.jsx
parent92c4df5b109ac8b15f6384a5c027024696bbd4d8 (diff)
parent41e74860d8abc8e33648471249b127dd3f60fb88 (diff)
downloadchat-b9aef9f2a6b90663cb7ba4ff9e42560c145b631d.tar.gz
chat-b9aef9f2a6b90663cb7ba4ff9e42560c145b631d.tar.bz2
chat-b9aef9f2a6b90663cb7ba4ff9e42560c145b631d.zip
Merge pull request #360 from rgarmsen2295/mm-375d
MM-375 Adds text formatting features using a modified version of the marked js library
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r--web/react/components/create_post.jsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index 9ca1d5388..3e1faba7d 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -224,6 +224,7 @@ module.exports = React.createClass({
</div>
);
}
+ var allowTextFormatting = config.AllowTextFormatting;
var postError = null;
if (this.state.postError) {
@@ -244,6 +245,10 @@ module.exports = React.createClass({
if (postError) {
postFooterClassName += ' has-error';
}
+ var extraInfo = <MsgTyping channelId={this.state.channel_id} parentId='' />;
+ if (this.state.messageText.split(' ').length > 1 && allowTextFormatting) {
+ extraInfo = <span className='msg-typing'>_<em>italics</em>_ *<strong>bold</strong>* `<code className='code-info'>code</code>`</span>;
+ }
return (
<form id='create_post' ref='topDiv' role='form' onSubmit={this.handleSubmit}>
@@ -268,7 +273,7 @@ module.exports = React.createClass({
{postError}
{serverError}
{preview}
- <MsgTyping channelId={this.state.channelId} parentId=''/>
+ {extraInfo}
</div>
</div>
</form>