Merge pull request #2340 from rodrigocorsi2/PLT-2076

PLT-2076: Add help text below the input box when a user starts typing
This commit is contained in:
Harrison Healey
2016-03-07 13:53:56 -05:00
4 changed files with 80 additions and 7 deletions

View File

@@ -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'

View File

@@ -58,22 +58,38 @@ body.ios {
box-shadow: none;
white-space: normal;
}
.textbox-preview-link, .textbox-help-link {
.textbox-help-link {
position: absolute;
z-index: 3;
bottom: -23px;
font-size: 13px;
cursor: pointer;
}
.textbox-preview-link {
right: 45px;
}
.textbox-help-link {
right: 0;
}
min-height:36px;
}
.help_format_text {
position: absolute;
z-index: 3;
bottom: -23px;
font-size: 0.7em;
right: 45px;
color: #999;
transition: visibility 0s, opacity 0.5s linear;
b, i, code {
margin-right: 3px;
}
.textbox-preview-link{
font-size: 13px;
cursor: pointer;
margin-left: 15px;
}
}
.date-separator, .new-separator {
text-align: center;
height: 2em;

View File

@@ -1054,9 +1054,15 @@
"team_signup_welcome.validEmailError": "Please enter a valid email address",
"team_signup_welcome.welcome": "Welcome to:",
"team_signup_welcome.yes": "Yes, this address is correct",
"textbox.bold": "**bold**",
"textbox.edit": "Edit message",
"textbox.help": "Help",
"textbox.inlinecode": "`inline code`",
"textbox.italic": "_italic_",
"textbox.preformatted": "```preformatted```",
"textbox.preview": "Preview",
"textbox.quote": ">quote",
"textbox.strike": "strike",
"tutorial_intro.allSet": "Youre all set",
"tutorial_intro.end": "Click “Next” to enter Town Square. This is the first channel teammates see when they sign up. Use it for posting updates everyone needs to know.",
"tutorial_intro.invite": "Invite teammates",

View File

@@ -1049,9 +1049,15 @@
"team_signup_welcome.validEmailError": "Por favor entre um endereço de e-mail válido",
"team_signup_welcome.welcome": "Bem-vindo:",
"team_signup_welcome.yes": "Sim, este endereço de email está correto",
"textbox.bold": "**negrito**",
"textbox.edit": "Editar mensagem",
"textbox.help": "Ajuda",
"textbox.inlinecode": "`código`",
"textbox.italic": "_itálico_",
"textbox.preformatted": "```pre-formatado```",
"textbox.preview": "Pré-visualização",
"textbox.quote": ">citado",
"textbox.strike": "tachado",
"tutorial_intro.allSet": "Está tudo pronto",
"tutorial_intro.end": "Clique em “Próximo” para entrar Town Square. Este é o primeiro canal que sua equipe de trabalho vê quando eles se inscrevem. Use para postar atualizações que todos precisam saber.",
"tutorial_intro.invite": "Convidar pessoas para equipe",