summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/react/components/channel_members_modal.jsx8
-rw-r--r--web/react/components/file_attachment.jsx110
-rw-r--r--web/react/components/suggestion/search_suggestion_list.jsx2
-rw-r--r--web/react/components/textbox.jsx51
-rw-r--r--web/react/components/user_list_row.jsx4
-rw-r--r--web/react/utils/text_formatting.jsx13
-rw-r--r--web/sass-files/sass/partials/_post.scss24
-rw-r--r--web/static/i18n/en.json12
-rw-r--r--web/static/i18n/es.json3
-rw-r--r--web/static/i18n/pt.json10
10 files changed, 106 insertions, 131 deletions
diff --git a/web/react/components/channel_members_modal.jsx b/web/react/components/channel_members_modal.jsx
index 688ab7dd2..3ec93a616 100644
--- a/web/react/components/channel_members_modal.jsx
+++ b/web/react/components/channel_members_modal.jsx
@@ -44,6 +44,7 @@ export default class ChannelMembersModal extends React.Component {
}
getStateFromStores() {
const extraInfo = ChannelStore.getCurrentExtraInfo();
+ const profiles = UserStore.getActiveOnlyProfiles();
if (extraInfo.member_count !== extraInfo.members.length) {
AsyncClient.getChannelExtraInfo(this.props.channel.id, -1);
@@ -53,9 +54,8 @@ export default class ChannelMembersModal extends React.Component {
};
}
- // clone the member list since we mutate it later on
const memberList = extraInfo.members.map((member) => {
- return Object.assign({}, member);
+ return profiles[member.id];
});
function compareByUsername(a, b) {
@@ -130,8 +130,8 @@ export default class ChannelMembersModal extends React.Component {
onClick={this.handleRemove.bind(this, user)}
>
<FormattedMessage
- id='channel_members_modal.removeMember'
- defaultMessage='Remove Member'
+ id='channel_members_modal.remove'
+ defaultMessage='Remove'
/>
</button>
);
diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx
index 810f90b13..819638676 100644
--- a/web/react/components/file_attachment.jsx
+++ b/web/react/components/file_attachment.jsx
@@ -19,12 +19,10 @@ class FileAttachment extends React.Component {
super(props);
this.loadFiles = this.loadFiles.bind(this);
- this.playGif = this.playGif.bind(this);
- this.stopGif = this.stopGif.bind(this);
this.addBackgroundImage = this.addBackgroundImage.bind(this);
this.canSetState = false;
- this.state = {fileSize: -1, mime: '', playing: false, loading: false, format: ''};
+ this.state = {fileSize: -1};
}
componentDidMount() {
this.loadFiles();
@@ -95,42 +93,6 @@ class FileAttachment extends React.Component {
return true;
}
- playGif(e, filename) {
- var img = new Image();
- var fileUrl = utils.getFileUrl(filename);
-
- this.setState({loading: true});
- img.load(fileUrl);
- img.onload = () => {
- var state = {playing: true, loading: false};
-
- switch (true) {
- case img.width > img.height:
- state.format = 'landscape';
- break;
- case img.height > img.width:
- state.format = 'portrait';
- break;
- default:
- state.format = 'quadrat';
- break;
- }
-
- this.setState(state);
-
- // keep displaying background image for a short moment while browser is
- // loading gif, to prevent white background flashing through
- setTimeout(() => this.removeBackgroundImage.bind(this)(filename), 100);
- };
- img.onError = () => this.setState({loading: false});
-
- e.stopPropagation();
- }
- stopGif(e, filename) {
- this.setState({playing: false});
- this.addBackgroundImage(filename);
- e.stopPropagation();
- }
getFileInfoFromName(name) {
var fileInfo = utils.splitFileLocation(name);
@@ -167,71 +129,15 @@ class FileAttachment extends React.Component {
var fileUrl = utils.getFileUrl(filename);
var type = utils.getFileType(fileInfo.ext);
- var playbackControls = '';
- var loadedFile = '';
- var loadingIndicator = '';
- if (this.state.mime === 'image/gif') {
- playbackControls = (
- <div
- className='file-playback-controls play'
- onClick={(e) => this.playGif(e, filename)}
- >
- {"►"}
- </div>
- );
- }
- if (this.state.playing) {
- loadedFile = (
- <img
- className={'file__loaded ' + this.state.format}
- src={fileUrl}
- />
- );
- playbackControls = (
+ var thumbnail;
+ if (type === 'image') {
+ thumbnail = (
<div
- className='file-playback-controls stop'
- onClick={(e) => this.stopGif(e, filename)}
- >
- {"■"}
- </div>
- );
- }
- if (this.state.loading) {
- loadingIndicator = (
- <img
- className='spinner file__loading'
- src='/static/images/load.gif'
+ ref={filename}
+ className='post__load'
+ style={{backgroundImage: 'url(/static/images/load.gif)'}}
/>
);
- playbackControls = '';
- }
-
- var thumbnail;
- if (type === 'image') {
- if (this.state.playing) {
- thumbnail = (
- <div
- ref={filename}
- className='post__load'
- style={{backgroundImage: 'url(/static/images/load.gif)'}}
- >
- {playbackControls}
- {loadedFile}
- </div>
- );
- } else {
- thumbnail = (
- <div
- ref={filename}
- className='post__load'
- style={{backgroundImage: 'url(/static/images/load.gif)'}}
- >
- {loadingIndicator}
- {playbackControls}
- {loadedFile}
- </div>
- );
- }
} else {
thumbnail = <div className={'file-icon ' + utils.getIconClassName(type)}/>;
}
@@ -242,7 +148,7 @@ class FileAttachment extends React.Component {
filename,
function success(data) {
if (this.canSetState) {
- this.setState({fileSize: parseInt(data.size, 10), mime: data.mime});
+ this.setState({fileSize: parseInt(data.size, 10)});
}
}.bind(this),
function error() {
diff --git a/web/react/components/suggestion/search_suggestion_list.jsx b/web/react/components/suggestion/search_suggestion_list.jsx
index 40f5d8777..60a5562fa 100644
--- a/web/react/components/suggestion/search_suggestion_list.jsx
+++ b/web/react/components/suggestion/search_suggestion_list.jsx
@@ -30,7 +30,7 @@ export default class SearchSuggestionList extends SuggestionList {
text = (
<FormattedMessage
id='suggestion.search.private'
- defaultMessage='Public Groups'
+ defaultMessage='Private Groups'
/>
);
}
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index 23ecfb57b..c119abcbc 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'
diff --git a/web/react/components/user_list_row.jsx b/web/react/components/user_list_row.jsx
index 2aeca7d47..d75078619 100644
--- a/web/react/components/user_list_row.jsx
+++ b/web/react/components/user_list_row.jsx
@@ -10,9 +10,9 @@ export default function UserListRow({user, actions}) {
let name = user.username;
if (user.nickname && nameFormat === Constants.Preferences.DISPLAY_PREFER_NICKNAME) {
- name = `${user.nickname} (${user.username})`;
+ name = `${user.nickname} (@${user.username})`;
} else if ((user.first_name || user.last_name) && (nameFormat === Constants.Preferences.DISPLAY_PREFER_NICKNAME || nameFormat === Constants.Preferences.DISPLAY_PREFER_FULL_NAME)) {
- name = `${Utils.getFullName(user)} (${user.username})`;
+ name = `${Utils.getFullName(user)} (@${user.username})`;
}
const buttons = actions.map((Action, index) => {
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index dae2252a6..a930e9ece 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -123,14 +123,13 @@ function autolinkAtMentions(text, tokens) {
return (Constants.SPECIAL_MENTIONS.indexOf(u) !== -1 || UserStore.getProfileByUsername(u));
}
- function addToken(username, mention, extraText) {
+ function addToken(username, mention) {
const index = tokens.size;
const alias = `MM_ATMENTION${index}`;
tokens.set(alias, {
value: `<a class='mention-link' href='#' data-mention='${username}'>${mention}</a>`,
- originalText: mention,
- extraText
+ originalText: mention
});
return alias;
}
@@ -152,9 +151,9 @@ function autolinkAtMentions(text, tokens) {
usernameLower = usernameLower.substring(0, c - 1);
if (mentionExists(usernameLower)) {
- const extraText = originalUsername.substr(c - 1);
- const alias = addToken(usernameLower, '@' + usernameLower, extraText);
- return alias;
+ const suffix = originalUsername.substr(c - 1);
+ const alias = addToken(usernameLower, '@' + usernameLower);
+ return alias + suffix;
}
} else {
// If the last character is not punctuation, no point in going any further
@@ -188,7 +187,7 @@ function highlightCurrentMentions(text, tokens) {
const newAlias = `MM_SELFMENTION${index}`;
newTokens.set(newAlias, {
- value: `<span class='mention-highlight'>${alias}</span>` + (token.extraText || ''),
+ value: `<span class='mention-highlight'>${alias}</span>`,
originalText: token.originalText
});
output = output.replace(alias, newAlias);
diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss
index 4478b3f15..a667a851c 100644
--- a/web/sass-files/sass/partials/_post.scss
+++ b/web/sass-files/sass/partials/_post.scss
@@ -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;
diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json
index 114b6bdb5..6915f7d26 100644
--- a/web/static/i18n/en.json
+++ b/web/static/i18n/en.json
@@ -561,7 +561,7 @@
"channel_loader.wrote": " wrote: ",
"channel_members_modal.addNew": " Add New Members",
"channel_members_modal.close": "Close",
- "channel_members_modal.removeMember": "Remove Member",
+ "channel_members_modal.remove": "Remove",
"channel_memebers_modal.members": " Members",
"channel_modal.cancel": "Cancel",
"channel_modal.channel": "Channel",
@@ -966,7 +966,7 @@
"sso_signup.team_error": "Please enter a team name",
"suggestion.mention.all": "Notifies everyone in the team",
"suggestion.mention.channel": "Notifies everyone in the channel",
- "suggestion.search.private": "Public Groups",
+ "suggestion.search.private": "Private Groups",
"suggestion.search.public": "Public Channels",
"team_export_tab.download": "download",
"team_export_tab.export": "Export",
@@ -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": "You’re 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",
@@ -1289,4 +1295,4 @@
"view_image_popover.download": "Download",
"view_image_popover.file": "File {count} of {total}",
"view_image_popover.publicLink": "Get Public Link"
-} \ No newline at end of file
+}
diff --git a/web/static/i18n/es.json b/web/static/i18n/es.json
index 77779847f..091b1e846 100644
--- a/web/static/i18n/es.json
+++ b/web/static/i18n/es.json
@@ -561,7 +561,6 @@
"channel_loader.wrote": " escribió: ",
"channel_members_modal.addNew": " Agregar nuevos Miembros",
"channel_members_modal.close": "Cerrar",
- "channel_members_modal.removeMember": "Elminar Miembro",
"channel_memebers_modal.members": " Miembros",
"channel_modal.cancel": "Cancelar",
"channel_modal.channel": "Canal",
@@ -1289,4 +1288,4 @@
"view_image_popover.download": "Descargar",
"view_image_popover.file": "Archivo {count} de {total}",
"view_image_popover.publicLink": "Obtener Enlace Público"
-} \ No newline at end of file
+}
diff --git a/web/static/i18n/pt.json b/web/static/i18n/pt.json
index eaec8ba78..99ef71b35 100644
--- a/web/static/i18n/pt.json
+++ b/web/static/i18n/pt.json
@@ -558,7 +558,6 @@
"channel_loader.wrote": " escreveu: ",
"channel_members_modal.addNew": " Adicionar Novos Membros",
"channel_members_modal.close": "Fechar",
- "channel_members_modal.removeMember": "Remover Membro",
"channel_memebers_modal.members": " Membros",
"channel_modal.cancel": "Cancelar",
"channel_modal.channel": "Canal",
@@ -961,7 +960,6 @@
"sso_signup.team_error": "Por favor entre o nome da equipe",
"suggestion.mention.all": "Notificar todo mundo na equipe",
"suggestion.mention.channel": "Notifica todos no canal",
- "suggestion.search.private": "Grupos Públicos",
"suggestion.search.public": "Canais Públicos",
"team_export_tab.download": "download",
"team_export_tab.export": "Exportar",
@@ -1049,9 +1047,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",
@@ -1284,4 +1288,4 @@
"view_image_popover.download": "Download",
"view_image_popover.file": "Arquivo {count} de {total}",
"view_image_popover.publicLink": "Obter O Link Público"
-} \ No newline at end of file
+}